# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1283256338 -10800 # Node ID 3104fc151679beff687193a3f7f8a2541d30cc87 # Parent 2b7283837edb0f9cc9d41f3224da0333d42d6ab8 Revision: 201033 Kit: 201035 diff -r 2b7283837edb -r 3104fc151679 conversations_plat/group/bld.inf --- a/conversations_plat/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2007 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: File that exports the files belonging to -: IM CV launcher API -* -*/ - - -#include - -#include "../im_cv_launcher_api/group/bld.inf" -#include "../im_connection_api/group/bld.inf" -#include "../im_cv_appui_api/group/bld.inf" - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_connection_api/group/bld.inf --- a/conversations_plat/im_connection_api/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2007 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: File that exports the files of im connection provider - -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/imconnectionproviderconsts.h APP_LAYER_PLATFORM_EXPORT_PATH(imconnectionproviderconsts.h) - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_connection_api/im_connection_api.metaxml --- a/conversations_plat/im_connection_api/im_connection_api.metaxml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -im_connection_api -im_connection_api -c++ -im - - - - -yes -no - - diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_connection_api/inc/imconnectionproviderconsts.h --- a/conversations_plat/im_connection_api/inc/imconnectionproviderconsts.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2008 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: common contant declaration class -* -*/ - - -#ifndef IMCONNECTIONPROVIDERCONSTS_H -#define IMCONNECTIONPROVIDERCONSTS_H - -#include - - -const TUid KMeCoPropertyUid = { 0x0D334E82 }; - -//used by imcvlauncher/conversationview -const TUint KMeCoConvViewServiceIdKey = 0x00000001; - -//used by vimpstengine -const TUint KMeCoSTServiceState = 0x00000002; - -//Used by details view -const TUint KMeCoXSPDetailsServiceIdKey = 0x00000003; - - -#endif // IMCONNECTIONPROVIDERCONSTS_H diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_appui_api/group/bld.inf --- a/conversations_plat/im_cv_appui_api/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2008 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: File that exports the files belonging to -* imcvappui API -* -*/ - - -#include - - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../inc/mimcvcommandmapper.h APP_LAYER_PLATFORM_EXPORT_PATH( mimcvcommandmapper.h ) -../inc/cimcvmenuextension.h APP_LAYER_PLATFORM_EXPORT_PATH( cimcvmenuextension.h ) -../rss/imcvmenuextensioncommand.rh APP_LAYER_PLATFORM_EXPORT_PATH( imcvmenuextensioncommand.rh ) diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_appui_api/inc/cimcvmenuextension.h --- a/conversations_plat/im_cv_appui_api/inc/cimcvmenuextension.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* Copyright (c) 2008 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: Abstract interface for menu extensions. -* -*/ - -#ifndef __CIMCVMENUEXTENSION_H__ -#define __CIMCVMENUEXTENSION_H__ - - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CEikMenuPane; -class MIMCVCommandMapper; - - -//CONSTANTS -const TUid KMenuCustomisationInterfaceUid = { 0x20026768 }; -// CLASS DECLARATION - -/** - * Abstract interface for menuextensions. extension plugins can - * extend service tab menu by implementing a class derived from this. - */ -class CIMCVMenuExtension : public CBase - { - - public: - - static CIMCVMenuExtension* CreateImplementationL( TUid aUid ); - - virtual ~CIMCVMenuExtension(); - - public: // Interface - /** - * Filters the menu pane of the plugin connected to this. - * - * @param aPreviousId Menu command id after which the plugins menu - * should come. - * @param aMenuPane Menu pane which will be filtered. - * @param aServiceId service id. - */ - virtual void DynInitMenuPaneL - (TInt aPreviousId, CEikMenuPane& aMenuPane,TUint aServiceId) = 0; - - /** - * Handles service tab extension commands. - * - * @param aCommandId Command ID. - * - * @return ETrue if command was handled, otherwise EFalse. - */ - virtual TBool HandleCommandL(const TInt& aCommand ) = 0; - - /** - * Registers command ID mapper. This method is called automatically - * by Servicetab menu extneions at initialization phase. - * - * @param aMapper Command ID mapper - */ - virtual void RegisterCommandMapper( MIMCVCommandMapper& aMapper ) = 0; - - /** - * Gets STM_COMMAND_INFO_ARRAY resource. Resource should be loaded. - * - * @return Resource ID or KErrNotFound - */ - virtual TInt CommandInfoResource() const = 0; - - - private: - /** - * Instance identifier key. When instance of an implementation is - * created by ECOM framework, the framework will assign a UID for - * it. The UID is used in the destructor to notify framework that - * this instance is being destroyed and resources can be released. - * Plugin implementations should leave this untouched, as the inline - * destructor and constructor method take care of ECom releasing. - */ - TUid iDtor_ID_Key; - - - }; -inline CIMCVMenuExtension* CIMCVMenuExtension::CreateImplementationL( TUid aUid ) - { - TAny* ptr = REComSession::CreateImplementationL( aUid, _FOFF( CIMCVMenuExtension, iDtor_ID_Key ) ); - CIMCVMenuExtension* impl = static_cast (ptr); - return impl; - } - -inline CIMCVMenuExtension::~CIMCVMenuExtension() - { - REComSession::DestroyedImplementation( iDtor_ID_Key ); - } - -#endif // __CIMCVMENUEXTENSION_H__ diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_appui_api/inc/mimcvcommandmapper.h --- a/conversations_plat/im_cv_appui_api/inc/mimcvcommandmapper.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2008 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: Abstract interface for getting mapped command ids -* -*/ - -#ifndef __MIMCVCOMMANDMAPPER_H__ -#define __MIMCVCOMMANDMAPPER_H__ - - -// INCLUDES -#include - -// CLASS DECLARATION - - -/** - * Abstract interface for getting mapped command IDs. Command ID mapping - * means that xSP's own "Names List" command IDs ( constants that are usually - * defined in a *.hrh file ) are substituted with IDs provided by Extension - * Manager. This is needed because there may be extensions using same - * "Names List" command IDs. After the substitution, the original IDs are - * not valid anymore. Still, in order to allow original "Names List" - * command IDs usage inside the xSP's own code, MxSPCommandMapper provides the - * mechanism for retrieving new IDs which correspond to the old original - * ones and vice versa. - */ -class MIMCVCommandMapper - { - public: - /** - * Gets old original command ID which corresponds - * to the given new one - * - * @param aPluginId implementation ID for identification - * @param aNewCommand New mapped command ID - * @param aOldCommand On return old/original command ID - * @return KErrNone if mapping exist, otherwise KErrNotFound - */ - virtual TInt GetOldCommand( TInt32 aPluginId, - TInt aNewCommand, - TInt& aOldCommand ) const = 0; - - /** - * Gets new mapped command ID which corresponds - * to the given old one - * - * @param aPluginId implementation ID for identification - * @param aOldCommand Old/original command ID - * @param aNewCommand On return new mapped command ID - * @return KErrNone if mapping exist, otherwise KErrNotFound - */ - virtual TInt GetNewCommand( TInt32 aPluginId, - TInt aOldCommand, - TInt& aNewCommand ) const = 0; - - protected: // Protected interface - - /** - * Destructor. - */ - virtual ~MIMCVCommandMapper() - {}; - - }; - - -#endif // __MIMCVCOMMANDMAPPER_H__ diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_appui_api/rss/imcvmenuextensioncommand.rh --- a/conversations_plat/im_cv_appui_api/rss/imcvmenuextensioncommand.rh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2008 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: Declaration of resource for CV menu command information -* -*/ - -STRUCT STM_COMMAND_INFO //SERVICETABMENU_COMMAND_INFO - { - // non-mapped command id - LONG oldId; - } - -STRUCT STM_COMMAND_INFO_ARRAY //SERVICETABMENU_COMMAND_INFO_ARRAY - { - STRUCT items[]; - } - diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/group/bld.inf --- a/conversations_plat/im_cv_launcher_api/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2007 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: File that exports the files belonging to -: IM CV launcher API -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -../inc/imcvlauncher.h APP_LAYER_PLATFORM_EXPORT_PATH(imcvlauncher.h) \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/im_cv_launcher_api.metaxml --- a/conversations_plat/im_cv_launcher_api/im_cv_launcher_api.metaxml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -im_cv_launcher_api -This is public API that provides interfaces to launch the conversation view with given details. -c++ -imcvlauncher - - - - -yes -no - - diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/inc/imcvlauncher.h --- a/conversations_plat/im_cv_launcher_api/inc/imcvlauncher.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2008 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: launcher class for launching the conversation view -* -*/ - - - -#ifndef IMCVLAUNCHER_H -#define IMCVLAUNCHER_H - -#include -#include -class MVPbkContactLink; -// INCLUDES -/** -* IM conversationview launcher implementation class -* -* @lib imcvlauncher -* @since 5.0 -*/ -class IMCVLauncher - { - - public: - - /** - * LaunchImConversationViewL, launches the imconversation view - * @param aActiveViewId , active view details - * @param aServiceId - ServiceId - * @param aRecipientUserId , recipient user id used to send the message - * @Returns Error Code - */ - - IMPORT_C static TInt LaunchImConversationViewL(TVwsViewId aActiveViewId, - TInt aServiceId, - const TDesC& aRecipientUserId , - const TDesC& aDisplayName = KNullDesC, - MVPbkContactLink* aContactLink = NULL - ) ; - - static TInt PropertySettingsIdL(TUint32 aServiceId ) ; - - private: - /** - * CheckValidServiceL, Checks whether the service is a Valid IM service - * @param aServiceId - ServiceId - * @Returns TBool - ETrue if Valid Service, else EFalse - */ - static TBool CheckValidServiceL(TInt aServiceId); - - }; - -#endif // CIMCVLAUNCHER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/bmarm/imcvlauncher_apiu.def --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/bmarm/imcvlauncher_apiu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) - diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/bwins/imcvlauncher_apiu.def --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/bwins/imcvlauncher_apiu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/conf/ImCvLauncher_api.cfg --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/conf/ImCvLauncher_api.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -[Test] -title Test_LaunchImConversationViewL -create ImCvLauncher_api ImCvLauncher_apiObj -ImCvLauncher_apiObj Test_LaunchImConversationViewL -delete ImCvLauncher_apiObj -[Endtest] - - diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/eabi/imcvlauncher_apiu.def --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/eabi/imcvlauncher_apiu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/group/ImCvLauncher_api.mmp --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/group/ImCvLauncher_api.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* 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: MMP file for STIF Test Framework's TestScripter -* testclass test module. -* -*/ - -#include - -TARGET ImCvLauncher_api.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE imcvlauncher_api.def - -USERINCLUDE ../inc - -OS_LAYER_SYSTEMINCLUDE -APP_LAYER_SYSTEMINCLUDE -MW_LAYER_SYSTEMINCLUDE -SOURCEPATH ../src - -SOURCE ImCvLauncher_api.cpp -SOURCE ImCvLauncher_apiBlocks.cpp - -//RESOURCE resource_file -//RESOURCE resource_file2 - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -LIBRARY imcvlauncher.lib - - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/group/ImCvLauncher_api.pkg --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/group/ImCvLauncher_api.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -; -; 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: -; -; Installation file for STIF -; - -; Languages -&EN - -; Provide value for uid -#{"STIF"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 3.0 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None -;INI FILE -"..\init\testframework.ini" -"c:\Testframework\ttestframework.ini" - -;CFG FILES -"..\conf\ImCvLauncher_api.cfg" -"c:\Testframework\ImCvLauncher_api.cfg" - -; Install files -"\epoc32\release\armv5\udeb\ImCvLauncher_api.dll" - "!:\Sys\Bin\ImCvLauncher_api.dll" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/group/ImCvLauncher_api_nrm.mmp --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/group/ImCvLauncher_api_nrm.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* 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: MMP file for STIF Test Framework's TestScripter -* testclass test module. -* -*/ - -#include - -TARGET ImCvLauncher_api.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE ImCvLauncher_api.def - -USERINCLUDE ../inc - -OS_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../src - -SOURCE ImCvLauncher_api.cpp -SOURCE ImCvLauncher_apiBlocks.cpp - -//RESOURCE resource_file -//RESOURCE resource_file2 - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/group/bld.inf --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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: -* -*/ - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these - - DEFAULT - -PRJ_TESTEXPORTS -// NOTE: If using ARS requirements all export operations should be done under this. -// 'abld test export' - -PRJ_EXPORTS -// Specify the source file followed by its destination here -// copy will be used to copy the source file to its destination -// If there's no destination then the source file will be copied -// -// Example: -/* - -*/ -../init/TestFramework.ini /epoc32/winscw/c/TestFramework/TestFramework.ini -../conf/ImCvLauncher_api.cfg /epoc32/winscw/c/TestFramework/ImCvLauncher_api.cfg - -PRJ_TESTMMPFILES - - ImCvLauncher_api.mmp - -PRJ_MMPFILES - - - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/inc/ImCvLauncher_api.h --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/inc/ImCvLauncher_api.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,184 +0,0 @@ -/* -* 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: STIF testclass declaration -* -*/ - -#ifndef IMCVLAUNCHER_API_H -#define IMCVLAUNCHER_API_H - -// INCLUDES -#include -#include -#include -#include - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def -#define TEST_CLASS_VERSION_MAJOR 0 -#define TEST_CLASS_VERSION_MINOR 0 -#define TEST_CLASS_VERSION_BUILD 0 - -// Logging path -_LIT( KImCvLauncher_apiLogPath, "\\logs\\testframework\\ImCvLauncher_api\\" ); -// Log file -_LIT( KImCvLauncher_apiLogFile, "ImCvLauncher_api.txt" ); -_LIT( KImCvLauncher_apiLogFileWithTitle, "ImCvLauncher_api_[%S].txt" ); - -// FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; -class CImCvLauncher_api; - -// DATA TYPES -//enum ?declaration -//typedef ?declaration -//extern ?data_type; - -// CLASS DECLARATION - -/** -* CImCvLauncher_api test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS(CImCvLauncher_api) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CImCvLauncher_api* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~CImCvLauncher_api(); - - public: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - - private: - - /** - * C++ default constructor. - */ - CImCvLauncher_api( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - /** - * Test methods are listed below. - */ - - /** - * Example test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt Test_LaunchImConversationViewL( CStifItemParser& aItem ); - - /** - * Method used to log version of test class - */ - void SendTestClassVersion(); - - //ADD NEW METHOD DEC HERE - //[TestMethods] - Do not remove - - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - private: // Data - - // ?one_line_short_description_of_data - //?data_declaration; - - // Reserved pointer for future extension - //TAny* iReserved; - - public: // Friend classes - //?friend_class_declaration; - protected: // Friend classes - //?friend_class_declaration; - private: // Friend classes - //?friend_class_declaration; - - }; - -#endif // IMCVLAUNCHER_API_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/init/TestFramework.ini --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/init/TestFramework.ini Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -# -# This is STIFTestFramework initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', - 'TestCases' or 'FullReport' - -CreateTestReport= YES # Possible values: YES or NO - -TestReportFilePath= C:\LOGS\TestFramework\ -TestReportFileName= TestReport - -TestReportFormat= TXT # Possible values: TXT or HTML -TestReportOutput= FILE # Possible values: FILE or RDEBUG -TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting - -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start - -[New_Module] -ModuleName= testscripter -TestCaseFile= C:\testframework\ImCvLauncher_api.cfg -[End_Module] - - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -[Logger_Defaults] - -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/src/ImCvLauncher_api.cpp --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/src/ImCvLauncher_api.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* 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: This file contains testclass implementation. -* -*/ - -// INCLUDE FILES -#include -#include "ImCvLauncher_api.h" -#include - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CImCvLauncher_api::CImCvLauncher_api -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CImCvLauncher_api::CImCvLauncher_api( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// CImCvLauncher_api::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CImCvLauncher_api::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(KImCvLauncher_apiLogFileWithTitle, &title); - } - else - { - logFileName.Copy(KImCvLauncher_apiLogFile); - } - - iLog = CStifLogger::NewL( KImCvLauncher_apiLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - SendTestClassVersion(); - } - -// ----------------------------------------------------------------------------- -// CImCvLauncher_api::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CImCvLauncher_api* CImCvLauncher_api::NewL( - CTestModuleIf& aTestModuleIf ) - { - CImCvLauncher_api* self = new (ELeave) CImCvLauncher_api( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -CImCvLauncher_api::~CImCvLauncher_api() - { - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - } - -//----------------------------------------------------------------------------- -// CImCvLauncher_api::SendTestClassVersion -// Method used to send version of test class -//----------------------------------------------------------------------------- -// -void CImCvLauncher_api::SendTestClassVersion() - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; - moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; - moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; - - TFileName moduleName; - moduleName = _L("ImCvLauncher_api.dll"); - - TBool newVersionOfMethod = ETrue; - TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) CImCvLauncher_api::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/src/ImCvLauncher_apiBlocks.cpp --- a/conversations_plat/im_cv_launcher_api/tsrc/ImCvLauncher_api/src/ImCvLauncher_apiBlocks.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* 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: This file contains testclass implementation. -* -*/ - -// [INCLUDE FILES] - do not remove -#include -#include -#include -#include "ImCvLauncher_api.h" -// imlauncher -#include - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CImCvLauncher_api::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void CImCvLauncher_api::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// CImCvLauncher_api::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt CImCvLauncher_api::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - ENTRY( "Test_LaunchImConversationViewL", CImCvLauncher_api::Test_LaunchImConversationViewL ), - //ADD NEW ENTRY HERE - // [test cases entries] - Do not remove - - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - -// ----------------------------------------------------------------------------- -// CImCvLauncher_api::ExampleL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CImCvLauncher_api::Test_LaunchImConversationViewL( CStifItemParser& aItem ) - { - - TVwsViewId activeViewId; - - IMCVLauncher::LaunchImConversationViewL(activeViewId, 4, KNullDesC ); - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CImCvLauncher_api::?member_function -// ?implementation_description -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -/* -TInt CImCvLauncher_api::?member_function( - CItemParser& aItem ) - { - - ?code - - } -*/ - -// ========================== OTHER EXPORTED FUNCTIONS ========================= -// None - -// [End of File] - Do not remove diff -r 2b7283837edb -r 3104fc151679 group/bld.inf --- a/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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: inf file for conversations -* -*/ -// Project configuration file for IM - -#include "../imstutils/help/group/bld.inf" -#include "../conversations_plat/group/bld.inf" -#include "../uiservicetabsettings/group/bld.inf" -#include "../instantmessagesalert/group/bld.inf" -#include "../imstutils/group/bld.inf" -#include "../uiservicetab/Group/bld.inf" -#include "../servicewidget/group/bld.inf" -#include "../instantmsgindicatorplugin/group/bld.inf" -#include "../imstatuspaneindicatorplugin/group/bld.inf" - - -PRJ_EXPORTS -// installation of default brands: - -./r47.conversations.mif /epoc32/winscw/c/private/102828dd/data/xsp/xsp/files/r47.conversations.mif -./brandfile.bin.r47 /epoc32/winscw/c/private/102828dd/data/xsp/xsp/brandfile.bin.r47 -./conversations.mbg /epoc32/include/conversations.mbg -//Note:this line needs to be removed once the icon is available in the sdk - diff -r 2b7283837edb -r 3104fc151679 group/brandfile.bin.r47 Binary file group/brandfile.bin.r47 has changed diff -r 2b7283837edb -r 3104fc151679 group/cimcvkeys.h --- a/group/cimcvkeys.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2008-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: common RProperty key shared between servicetab and conversationview -* -*/ - -#ifndef CIMCVKEYS_H -#define CIMCVKEYS_H - - - -const TUid KConvViewUID = { 0x20012425 }; - -//xsp Id and service Id published by conv view.. -const TUint KXspIdServiceIDKey = 0x00000001; - -//Used to get Display name and contact link published by VIMPST Engine. -const TUint KContactLinkDisplayNameKey = 0x00000002; - - -#endif // CIMCVKEYS_H diff -r 2b7283837edb -r 3104fc151679 group/conversations.h --- a/group/conversations.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -// Branding item header file created with XML2H. DO NOT MODIFY! - -_LIT8( KIconFile, "IconFile"); -_LIT8( KEMbmConversationsQgnpropimfriendoff, "person:offline:image"); -_LIT8( KEMbmConversationsQgnpropimimsg, "EMbmConversationsQgnpropimimsg"); -_LIT8( KEMbmConversationsQgnpropimbusytitle, "EMbmConversationsQgnpropimbusytitle"); -_LIT8( KEMbmConversationsQgnpropimfriendbusy, "person:dnd:image"); -_LIT8( KEMbmConversationsQgnpropservicefriendrequestsent, "EMbmConversationsQgnpropservicefriendrequestsent"); -_LIT8( KEMbmConversationsQgnpropimsmileyshappy, "EMbmConversationsQgnpropimsmileyshappy"); -_LIT8( KEMbmConversationsQgnpropimontitle, "EMbmConversationsQgnpropimontitle"); -_LIT8( KEMbmConversationsQgnpropserviceofffriendrequestsent, "EMbmConversationsQgnpropserviceofffriendrequestsent"); -_LIT8( KEMbmConversationsQgninditbconversation, "EMbmConversationsQgninditbconversation"); -_LIT8( KEMbmConversationsQgninditbaddrecipient, "EMbmConversationsQgninditbaddrecipient"); -_LIT8( KEMbmConversationsQgnindiimmsgeditor, "EMbmConversationsQgnindiimmsgeditor"); -_LIT8( KEMbmConversationsQgnpropserviceofffriendrequestreceived, "EMbmConversationsQgnpropserviceofffriendrequestreceived"); -_LIT8( KEMbmConversationsQgnpropimimsgnew, "EMbmConversationsQgnpropimimsgnew"); -_LIT8( KEMbmConversationsQgnpropimawaytitle, "EMbmConversationsQgnpropimawaytitle"); -_LIT8( KEMbmConversationsQgninditbbusinesscard, "EMbmConversationsQgninditbbusinesscard"); -_LIT8( KEMbmConversationsQgnpropiminvisibletitle, "EMbmConversationsQgnpropiminvisibletitle"); -_LIT8( KEMbmConversationsQgnpropimfrom, "EMbmConversationsQgnpropimfrom"); -_LIT8( KEMbmConversationsQgninditbsmiley, "EMbmConversationsQgninditbsmiley"); -_LIT8( KEMbmConversationsQgnpropimofftitle, "EMbmConversationsQgnpropimofftitle"); -_LIT8( KEMbmConversationsQgnpropimtome, "EMbmConversationsQgnpropimtome"); -_LIT8( KEMbmConversationsQgnpropimfriendaway, "person:away:image"); -_LIT8( KEMbmConversationsQgnpropimfriendon, "person:available:image"); -_LIT8( KEMbmConversationsQgnpropimfriendvoip, "EMbmConversationsQgnpropimfriendvoip"); -_LIT8( KEMbmConversationsQgnpropimfriendinvisible, "EMbmConversationsQgnpropimfriendinvisible"); -_LIT8( KEMbmConversationsQgnpropservicefriendrequestreceived, "EMbmConversationsQgnpropservicefriendrequestreceived"); -_LIT8( KEMbmConversationsQgnpropimonmobiletitle, "EMbmConversationsQgnpropimonmobiletitle"); -_LIT8( KEMbmConversationsQgninditbvoip, "EMbmConversationsQgninditbvoip"); -_LIT8( KEMbmConversationsQgninditbmsgsend, "EMbmConversationsQgninditbmsgsend"); -_LIT8( KEMbmConversationsQgnpropservicedefaultavatar, "EMbmConversationsQgnpropservicedefaultavatar"); -_LIT8( KEMbmConversationsExampletab, "EMbmConversationsExampletab"); -_LIT8( KEMbmConversationsQgnservtabavatarblocked, "EMbmConversationsQgnservtabavatarblocked"); -_LIT8( KEMbmConversationsQgnstatimuni, "EMbmConversationsQgnstatimuni"); -_LIT8( KEMbmConversationsExamplemsntab, "EMbmConversationsExamplemsntab"); -_LIT8( KEMbmConversationsQgnpropimfriendonmobile, "person:onmobile:image"); -_LIT8( KEMbmConversationsQgnpropimuserblocked, "person:block:image"); -_LIT8( KEMbmConversationsQgnpropimusercallforward, "person:callforward:image"); - -_LIT8( KToumessage, "toumessage"); -_LIT8( KSmileycount, "smileycount"); -_LIT8( KSmileytext, "smileytext"); - -//End of file diff -r 2b7283837edb -r 3104fc151679 group/conversations.mbg --- a/group/conversations.mbg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ - -/* This file has been generated, DO NOT MODIFY. */ -enum TMifConversations - { - EMbmConversationsQgn_stat_im_uni = 16384, - EMbmConversationsExample_tab = 16386, - EMbmConversationsExample_tab_mask = 16387, - EMbmConversationsQgn_prop_im_friend_voip = 16388, - EMbmConversationsQgn_prop_im_friend_voip_mask = 16389, - EMbmConversationsExample_msn_tab = 16390, - EMbmConversationsExample_msn_tab_mask = 16391, - EMbmConversationsQgn_prop_im_friend_off = 16392, - EMbmConversationsQgn_prop_im_friend_off_mask = 16393, - EMbmConversationsQgn_prop_im_friend_on = 16394, - EMbmConversationsQgn_prop_im_friend_on_mask = 16395, - EMbmConversationsQgn_prop_im_friend_away = 16396, - EMbmConversationsQgn_prop_im_friend_away_mask = 16397, - EMbmConversationsQgn_prop_im_friend_busy = 16398, - EMbmConversationsQgn_prop_im_friend_busy_mask = 16399, - EMbmConversationsQgn_prop_im_friend_invisible = 16400, - EMbmConversationsQgn_prop_im_friend_invisible_mask = 16401, - EMbmConversationsQgn_prop_im_imsg = 16402, - EMbmConversationsQgn_prop_im_imsg_mask = 16403, - EMbmConversationsQgn_prop_im_imsg_new = 16404, - EMbmConversationsQgn_prop_im_imsg_new_mask = 16405, - EMbmConversationsQgn_indi_tb_voip = 16406, - EMbmConversationsQgn_indi_tb_voip_mask = 16407, - EMbmConversationsQgn_indi_tb_conversation = 16408, - EMbmConversationsQgn_indi_tb_conversation_mask = 16409, - EMbmConversationsQgn_indi_tb_business_card = 16410, - EMbmConversationsQgn_indi_tb_business_card_mask = 16411, - EMbmConversationsQgn_indi_tb_add_recipient = 16412, - EMbmConversationsQgn_indi_tb_add_recipient_mask = 16413, - EMbmConversationsQgn_prop_service_default_avatar = 16414, - EMbmConversationsQgn_prop_service_default_avatar_mask = 16415, - EMbmConversationsQgn_prop_service_friend_request_received = 16416, - EMbmConversationsQgn_prop_service_friend_request_received_mask = 16417, - EMbmConversationsQgn_prop_service_friend_request_sent = 16418, - EMbmConversationsQgn_prop_service_friend_request_sent_mask = 16419, - EMbmConversationsQgn_prop_service_off_friend_request_received = 16420, - EMbmConversationsQgn_prop_service_off_friend_request_received_mask = 16421, - EMbmConversationsQgn_prop_service_off_friend_request_sent = 16422, - EMbmConversationsQgn_prop_service_off_friend_request_sent_mask = 16423, - EMbmConversationsQgn_prop_im_friend_on_mobile = 16424, - EMbmConversationsQgn_prop_im_friend_on_mobile_mask = 16425, - EMbmConversationsQgn_prop_im_user_blocked = 16426, - EMbmConversationsQgn_prop_im_user_blocked_mask = 16427, - EMbmConversationsQgn_prop_im_off_title = 16428, - EMbmConversationsQgn_prop_im_off_title_mask = 16429, - EMbmConversationsQgn_prop_im_on_title = 16430, - EMbmConversationsQgn_prop_im_on_title_mask = 16431, - EMbmConversationsQgn_prop_im_away_title = 16432, - EMbmConversationsQgn_prop_im_away_title_mask = 16433, - EMbmConversationsQgn_prop_im_busy_title = 16434, - EMbmConversationsQgn_prop_im_busy_title_mask = 16435, - EMbmConversationsQgn_prop_im_invisible_title = 16436, - EMbmConversationsQgn_prop_im_invisible_title_mask = 16437, - EMbmConversationsQgn_prop_im_on_mobile_title = 16438, - EMbmConversationsQgn_prop_im_on_mobile_title_mask = 16439, - EMbmConversationsQgn_prop_im_smileys_happy = 16440, - EMbmConversationsQgn_prop_im_smileys_happy_mask = 16441, - EMbmConversationsQgn_prop_im_smileys_sad = 16442, - EMbmConversationsQgn_prop_im_smileys_sad_mask = 16443, - EMbmConversationsQgn_prop_im_smileys_laugh = 16444, - EMbmConversationsQgn_prop_im_smileys_laugh_mask = 16445, - EMbmConversationsQgn_prop_im_smileys_wink = 16446, - EMbmConversationsQgn_prop_im_smileys_wink_mask = 16447, - EMbmConversationsQgn_prop_im_smileys_kiss = 16448, - EMbmConversationsQgn_prop_im_smileys_kiss_mask = 16449, - EMbmConversationsQgn_prop_im_smileys_angry = 16450, - EMbmConversationsQgn_prop_im_smileys_angry_mask = 16451, - EMbmConversationsQgn_prop_im_smileys_bored = 16452, - EMbmConversationsQgn_prop_im_smileys_bored_mask = 16453, - EMbmConversationsQgn_prop_im_smileys_crying = 16454, - EMbmConversationsQgn_prop_im_smileys_crying_mask = 16455, - EMbmConversationsQgn_prop_im_smileys_glasses = 16456, - EMbmConversationsQgn_prop_im_smileys_glasses_mask = 16457, - EMbmConversationsQgn_prop_im_smileys_indif = 16458, - EMbmConversationsQgn_prop_im_smileys_indif_mask = 16459, - EMbmConversationsQgn_prop_im_smileys_robot = 16460, - EMbmConversationsQgn_prop_im_smileys_robot_mask = 16461, - EMbmConversationsQgn_prop_im_smileys_shock = 16462, - EMbmConversationsQgn_prop_im_smileys_shock_mask = 16463, - EMbmConversationsQgn_prop_im_smileys_skeptical = 16464, - EMbmConversationsQgn_prop_im_smileys_skeptical_mask = 16465, - EMbmConversationsQgn_prop_im_smileys_sleepy = 16466, - EMbmConversationsQgn_prop_im_smileys_sleepy_mask = 16467, - EMbmConversationsQgn_prop_im_smileys_sunglasses = 16468, - EMbmConversationsQgn_prop_im_smileys_sunglasses_mask = 16469, - EMbmConversationsQgn_prop_im_smileys_surprise = 16470, - EMbmConversationsQgn_prop_im_smileys_surprise_mask = 16471, - EMbmConversationsQgn_prop_im_smileys_tired = 16472, - EMbmConversationsQgn_prop_im_smileys_tired_mask = 16473, - EMbmConversationsQgn_prop_im_smileys_veryhappy = 16474, - EMbmConversationsQgn_prop_im_smileys_veryhappy_mask = 16475, - EMbmConversationsQgn_prop_im_smileys_verysad = 16476, - EMbmConversationsQgn_prop_im_smileys_verysad_mask = 16477, - EMbmConversationsQgn_prop_im_smileys_wickedsmile = 16478, - EMbmConversationsQgn_prop_im_smileys_wickedsmile_mask = 16479, - EMbmConversationsQgn_prop_im_tome = 16480, - EMbmConversationsQgn_prop_im_tome_mask = 16481, - EMbmConversationsQgn_prop_im_from = 16482, - EMbmConversationsQgn_prop_im_from_mask = 16483, - EMbmConversationsQgn_indi_tb_msg_send = 16484, - EMbmConversationsQgn_indi_tb_msg_send_mask = 16485, - EMbmConversationsQgn_indi_tb_smiley = 16486, - EMbmConversationsQgn_indi_tb_smiley_mask = 16487, - EMbmConversationsQgn_indi_im_msg_editor = 16488, - EMbmConversationsQgn_indi_im_msg_editor_mask = 16489, - EMbmConversationsQgn_servtab_avatar_blocked = 16490, - EMbmConversationsQgn_servtab_avatar_blocked_mask = 16491, - EMbmConversationsBubble_manager_brand_image = 16492, - EMbmConversationsBubble_manager_brand_image_mask = 16493, - EMbmConversationsVoice_mailbox_icon = 16494, - EMbmConversationsVoice_mailbox_icon_mask = 16495, - EMbmConversationsService_active_image_large = 16496, - EMbmConversationsService_active_image_large_mask = 16497, - EMbmConversationsService_active_image_small = 16498, - EMbmConversationsService_active_image_small_mask = 16499, - EMbmConversationsService_passive_image_large = 16500, - EMbmConversationsService_passive_image_large_mask = 16501, - EMbmConversationsService_passive_image_small = 16502, - EMbmConversationsService_passive_image_small_mask = 16503, - EMbmConversationsQgn_prop_nrtyp_voip = 16504, - EMbmConversationsQgn_prop_nrtyp_voip_mask = 16505, - EMbmConversationsLastElement - }; diff -r 2b7283837edb -r 3104fc151679 group/imcvuiparams.h --- a/group/imcvuiparams.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2008-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: common params class shared between servicetab and conversationview -* -*/ - - -#ifndef TIMCVUIPARAMS_H -#define TIMCVUIPARAMS_H - -#include - - -/** - * constant to define the size of the contact link - */ -#define KMaxPackedContactLinkLength 300 -#define KMaxLength 100 -/** - * Using TXmppMessages and TXmppErrors enum's - */ -const TUid KConversationViewAppUid = {0x20012425}; - -/** - * Class for passing parameters to cv application. - * - * The objects of this class are wrapped into package buffer which is sent - * from external process and handled in cv applications ProcessMessage() - * - * @since S60 v5.0 - */ -class TIMCVUiParams - { - public: // Data - - inline TIMCVUiParams() - { - iAppUid = 0; - iViewUid = 0; - iServiceId =0; - iUpdate = EFalse; - } - - /** - * Buddy ID - */ - TBuf iBuddyId; - - /** - * Buddy ID - */ - TBuf iBuddyName; - - /** - * Using TXmppMessages and TXmppErrors enum's - */ - TInt iCommand; - - /** - * Using system wide error codes - */ - TInt iErrorCode; - - /** - * Calling application Uid - */ - TInt iAppUid; - - /** - * Calling application's ViewUid - */ - TInt iViewUid; - - - //service id; - TUint32 iServiceId; - - //contact link - TBuf8 iContactLink; - - // bool varaible to differentiate if its update - // of the display name or user id. - TBool iUpdate; - - }; - - -#endif // TIMCVUIPARAMS_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 group/r47.conversations.mif Binary file group/r47.conversations.mif has changed diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/group/bld.inf --- a/imstatuspaneindicatorplugin/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* 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: Build information file for imstatuspaneindicatorplugin -* -*/ - -#include - - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -// for image creation: -../rom/imstatuspaneindicatorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(imstatuspaneindicatorplugin.iby) -../rom/imstatuspaneindicatorpluginresource.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(imstatuspaneindicatorpluginresource.iby) - -// ROM SIS stubs -../sis/imstatuspaneindicatorpluginstub.sis /epoc32/data/Z/System/Install/imstatuspaneindicatorpluginstub.sis - -// -// IM open conversation components -// -PRJ_MMPFILES -imstatuspaneindicatorplugin.mmp - -// End of file \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/group/imstatuspaneindicatorplugin.mmp --- a/imstatuspaneindicatorplugin/group/imstatuspaneindicatorplugin.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* 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: plugin to the status pane. -* -*/ - - - -#include "../inc/imstatuspaneindicatorpluginuids.h" -#include - - -#include - -// Build target -TARGET imstatuspaneindicatorplugin.dll -TARGETTYPE PLUGIN -UID KECOMRECOGNITIONUID2 KIMSTATUSPANEINDICATORPLUGINUID3 -VENDORID VID_DEFAULT -CAPABILITY CAP_ECOM_PLUGIN -VERSION 10.0 - -//used to allow binary compression by making use of BYTEPAIR algorithm -PAGED - -// Source files location -SOURCEPATH ../src -SOURCE imstatuspaneindicatorproxy.cpp -SOURCE imstatuspaneindicator.cpp -SOURCE imstatuspaneindicatorpluginimplementation.cpp - - - -// Resources -START RESOURCE ../rss/20026767.rss - TARGET imstatuspaneindicatorplugin.rsc - TARGETPATH ECOM_RESOURCE_DIR -END - -START RESOURCE ../rss/imstatuspaneindicatorpluginrss.rss -DEPENDS aknfep.rsg -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - - - -// Include paths -USERINCLUDE ../inc - -APP_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE /epoc32/include/ecom - - -// Dependencies to system components -LIBRARY eikcore.lib -LIBRARY cone.lib -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY avkon.lib -LIBRARY commonengine.lib // stringloader -LIBRARY bafl.lib // baflutils -LIBRARY efsrv.lib // TParsePtrC -LIBRARY apgrfx.lib -LIBRARY apparc.lib - -//phone book -LIBRARY xSPViewServices.lib -// imcvlauncher -LIBRARY imcvlauncher.lib -// sp settings -LIBRARY serviceprovidersettings.lib -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/inc/imstatuspaneindicator.h --- a/imstatuspaneindicatorplugin/inc/imstatuspaneindicator.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* 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: This class subscribes and listens to rproperty defined in cinstantmsgindicator.h -* -*/ - - -#ifndef __CIMSTATUSPANEINDICATOR_H -#define __CIMSTATUSPANEINDICATOR_H - -#include "imstatuspaneindicatorpluginuids.h" - -//system includes -#include -#include -#include - -//Forward Declarations - -#define KMAXLENGTH 512 -/** -* IM Indicator Plug-in implementation -* -* @lib ImIndicatorPlugin -* @since 3.2 -*/ -class CIMStatusPaneIndicator : public CActive - - { - - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIMStatusPaneIndicator* NewL(); - - /** - * Destructor. - */ - ~CIMStatusPaneIndicator(); - public: // New Functions - - /** - * Returns the message count - */ - TInt MsgCount(); - /** - * Returns the service id - */ - TInt ServiceId(); - /** - * returns the message sender id - */ - const TDesC& SenderId(); - - /** - * returns the number of p-2-p chats. - */ - TInt IsMultipleSenders(); - - private: - - /** - * C++ default constructor. - */ - CIMStatusPaneIndicator(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - - /** - * from CActive - */ - void RunL(); - - /** - * from CActive - */ - void DoCancel(); - - private: // data - - // count of p-2-p chats - TInt iMultipleSenders; - - // owned: object of the Rproperty - RProperty iProperty; - - // count of number of new messages - TInt iMsgCount; - - // service id - TInt iServiceId; - - // owned: message sender id. - HBufC* iSenderId; - - - }; - -#endif // __CIMSTATUSPANEINDICATOR_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/inc/imstatuspaneindicatorpluginimplementation.h --- a/imstatuspaneindicatorplugin/inc/imstatuspaneindicatorpluginimplementation.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* 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: This class is the imstatuspaneindicator plugin implementation -*/ - - -#ifndef __CIMSTATUSPANEINDICATORPLUGINIMPLEMENTATION_H -#define __CIMSTATUSPANEINDICATORPLUGINIMPLEMENTATION_H - -// Until aknstylusactivatedpopupcontent.h is fixed -class TAknWindowComponentLayout; - -// INCLUDES -#include -#include "imstatuspaneindicatorpluginuids.h" - - -//system includes -#include -#include -#include -#include - -//Forward Declarations -class CIMStatusPaneIndicator; -class RxSPViewServices; - -_LIT( KResourceDir, "\\resource\\" ); -_LIT( KIndicatorResourceFile, "imstatuspaneindicatorpluginrss.rsc" ); -const TInt KMaxMessageNumberLength = 4; // 9999 = 4 numbers -const TInt KMaxResourcePathLength = 512; -#define KMECOIMPLEMENTATIONUID 0x20012423 -/** -* Instant msg indicator Plug-in implementation -* -* @lib ImIndicatorPlugin -* @since 5.0 -*/ -class CIMStatusPaneIndicatorPluginImplementation : public CAknIndicatorPlugin - - - { - - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIMStatusPaneIndicatorPluginImplementation* NewL(); - - /** - * Destructor. - */ - ~CIMStatusPaneIndicatorPluginImplementation(); - - public:// From CAknIndicatorPlugin - - /** - * Returns the description used as link text, displayed with - * the indicator icon in the indicator popup. - * - * @param aUid UID of the indicator. - * @param[out] aTextType Type of the text, - * @see TAknIndicatorPluginTextTypes. - * - * @return Indicator description or link text. - * Ownership is transferred. - */ - HBufC* TextL( const TInt aUid, TInt& aTextType ); - - /** - * @see CAknIndicatorPlugin - */ - void HandleIndicatorTapL( const TInt aUid ); - - private: - - /** - * C++ default constructor. - */ - CIMStatusPaneIndicatorPluginImplementation(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // new functions - - /** - * Create singular or plural content message for the popup - * @return constructed text - * - * NOTE! Ownership of the text is transferred to caller. - */ - HBufC* CreatePopupContentMessageL(); - - /** - * Shows IM message(s) - */ - void ShowMessageL(); - - private: // data - - // environment - CCoeEnv& iCoeEnv; - - // offset index for resource file - TInt iResourceOffset; - // Owns. Popup content singular (template) - HBufC* iPopupTextOne; - - // Owns. Popup content plural (template) - HBufC* iPopupTextMultiple; - - CIMStatusPaneIndicator* iIMStatusPaneIndicator; - /* - * Handle to xSPViewServices. - */ - RxSPViewServices iViewServices; - }; - -#endif // __CIMSTATUSPANEINDICATORPLUGINIMPLEMENTATION_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/inc/imstatuspaneindicatorpluginuids.h --- a/imstatuspaneindicatorplugin/inc/imstatuspaneindicatorpluginuids.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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: This class contains all the uids used in this plugin -* -*/ - - -#ifndef __IMSTATUSPANEINDICATORPLUGINUIDS_H -#define __IMSTATUSPANEINDICATORPLUGINUIDS_H - - - -// part of imindicatorplugin dll -#define KECOMRECOGNITIONUID2 0x10009d8d -#define KIMSTATUSPANEINDICATORPLUGINUID3 0x20026767 -// There is only one implementation for IM status pane indicator plugin -#define KIMSTATUSPANEINDICATORPLUGINIMPLEMENTATIONUIDVALUE 0x20026767 - - - - -#endif // __INSTANTMSGPINDICATORPLUGINCOMMONUIDS_H - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/rom/imstatuspaneindicatorplugin.iby --- a/imstatuspaneindicatorplugin/rom/imstatuspaneindicatorplugin.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* 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: this file contains the iby's -* -*/ - -#ifndef __IMSTATUSPANEINDICATORPLUGIN_IBY__ -#define __IMSTATUSPANEINDICATORPLUGIN_IBY__ - -#include -#include - -ECOM_PLUGIN(imstatuspaneindicatorplugin.dll,imstatuspaneindicatorplugin.rsc) - -// stub SIS, provides support for SIS upgrading -data=DATAZ_\system\install\imstatuspaneindicatorpluginstub.sis system\install\imstatuspaneindicatorpluginstub.sis - - -#endif // __IMSTATUSPANEINDICATORPLUGIN_IBY__ diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/rom/imstatuspaneindicatorpluginresource.iby --- a/imstatuspaneindicatorplugin/rom/imstatuspaneindicatorpluginresource.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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: this file contains the iby's -* -*/ - -#ifndef __IMSTATUSPANEINDICATORPLUGIN_RESOURCEIBY_ -#define __IMSTATUSPANEINDICATORPLUGIN_RESOURCEIBY_ - - - -// ECom plugin resources -data=DATAZ_\RESOURCE_FILES_DIR\imstatuspaneindicatorpluginrss.rsc RESOURCE_FILES_DIR\imstatuspaneindicatorpluginrss.rsc - -#endif //__IMSTATUSPANEINDICATORPLUGIN_RESOURCEIBY_ - - diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/rss/20026767.rss --- a/imstatuspaneindicatorplugin/rss/20026767.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2008 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: constant declaration class - * - * -*/ - - -#include "../inc/imstatuspaneindicatorpluginuids.h" -#include - - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KIMSTATUSPANEINDICATORPLUGINUID3; //IMPIndicatorPlugin's ecom dll uid - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x10275092; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KIMSTATUSPANEINDICATORPLUGINIMPLEMENTATIONUIDVALUE; //IMPIndicatorPlugin's ecom dll uid - version_no = 1; - display_name = "instmsgplg"; - default_data = "Default"; - opaque_data = ""; - } - }; - } - }; - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/rss/imstatuspaneindicatorpluginrss.rss --- a/imstatuspaneindicatorplugin/rss/imstatuspaneindicatorpluginrss.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* 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: This file contains all the resources. -* -*/ - -NAME IMIP -#include -#include - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF r_qtn_servtab_unipane_onenewmsg { buf = qtn_servtab_unipane_onenewmsg; } -RESOURCE TBUF r_qtn_servtab_unipane_newmsgs { buf = qtn_servtab_unipane_newmsgs; } - diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/sis/createsisx.bat --- a/imstatuspaneindicatorplugin/sis/createsisx.bat Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -makesis imstatuspaneindicatorplugin.pkg -signsis imstatuspaneindicatorplugin.sis imstatuspaneindicatorplugin.sisx rd.cer rd-key.pem diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/sis/imstatuspaneindicatorplugin.pkg --- a/imstatuspaneindicatorplugin/sis/imstatuspaneindicatorplugin.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -; -; 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: -; -;Language - standard language definitions -&EN - -;UID is the dll's UID -#{"imstatuspaneindicatorplugin"},(0x20026767),1,1,0, TYPE=SA, RU - -;Supports Series 60 v 5.0 -(0x1028315F), 0, 0, 0, {"Series60ProductID"} - -;Localised Vendor name -%{"Nokia-EN"} - -;VendorID -:"Nokia" - -; Files to copy -;;//imstatuspaneindicatorplugin.dll -"\EPOC32\RELEASE\ARMV5\UREL\imstatuspaneindicatorplugin.dll" -"!:\sys\bin\imstatuspaneindicatorplugin.dll" - - -"\EPOC32\DATA\Z\Resource\imstatuspaneindicatorpluginrss.rsc" -"!:\Resource\imstatuspaneindicatorpluginrss.rsc" -"\EPOC32\DATA\Z\Resource\Plugins\imstatuspaneindicatorplugin.rsc" -"!:\Resource\Plugins\imstatuspaneindicatorplugin.rsc" - -; end of file - diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/sis/imstatuspaneindicatorplugin.sis Binary file imstatuspaneindicatorplugin/sis/imstatuspaneindicatorplugin.sis has changed diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/sis/imstatuspaneindicatorplugin.sisx Binary file imstatuspaneindicatorplugin/sis/imstatuspaneindicatorplugin.sisx has changed diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/sis/imstatuspaneindicatorpluginstub.pkg --- a/imstatuspaneindicatorplugin/sis/imstatuspaneindicatorpluginstub.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -; -; 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: -; -;Language -&EN - -;Header -#{"imstatuspaneindicatorplugin"}, (0x102823BD), 1, 0, 0, TYPE=SA - -;Localised VendorID -%{"Nokia"} - -;VendorID -:"Nokia" - -;imstatuspaneindicatorplugin components -;//imstatuspaneindicatorplugin.dll -"" -"z:\sys\bin\imindicatorpluginng.dll" - -;resources - -"" -"z:\Resource\imstatuspaneindicatorpluginrss.r*" -"" -"z:\Resource\Plugins\ImIndicatorPluginng.rsc" -; end of file diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/sis/imstatuspaneindicatorpluginstub.sis Binary file imstatuspaneindicatorplugin/sis/imstatuspaneindicatorpluginstub.sis has changed diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/src/imstatuspaneindicator.cpp --- a/imstatuspaneindicatorplugin/src/imstatuspaneindicator.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* 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: This class subscribes and listens to the rproperty -* -*/ - - -// INCLUDE FILES -#include -#include "imstatuspaneindicator.h" - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicator::CIMStatusPaneIndicator -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------------------------- -// -CIMStatusPaneIndicator::CIMStatusPaneIndicator() - :CActive(CActive::EPriorityStandard ) - { - } - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicator::ConstructL -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CIMStatusPaneIndicator::ConstructL() - { - iSenderId = HBufC::NewL(KMAXLENGTH); - // attach the properties. - User::LeaveIfError( iProperty.Attach(KIMStatusProperty,EIMStatusPropertyMessageCount ) ); - User::LeaveIfError( iProperty.Attach(KIMStatusProperty,EIMStatusPropertyServiceId ) ); - User::LeaveIfError( iProperty.Attach(KIMStatusProperty,EIMMultipleSender ) ); - User::LeaveIfError( iProperty.Attach(KIMStatusProperty,EIMStatusPropertySenderId ) ); - //User::LeaveIfError( iProperty.Attach(KIMStatusProperty,EIMStatusPropertyMessageCount ) ); - CActiveScheduler::Add(this); - // initial subscription and process current property value - RunL(); - } - -// ----------------------------------------------------------------------------- -// CIMStatusPaneIndicator::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMStatusPaneIndicator* CIMStatusPaneIndicator::NewL() - { - CIMStatusPaneIndicator* self = - new( ELeave ) CIMStatusPaneIndicator(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// Destructor -CIMStatusPaneIndicator::~CIMStatusPaneIndicator() - { - delete iSenderId; - iProperty.Close(); - Cancel(); - } -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicator::DoCancel() -// --------------------------------------------------------------------------- -// -void CIMStatusPaneIndicator::DoCancel() - { - iProperty.Cancel(); - } - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicator::RunL() -// --------------------------------------------------------------------------- -// -void CIMStatusPaneIndicator::RunL() - { - // resubscribe before processing new value to prevent missing updates - iProperty.Subscribe( iStatus ); - SetActive(); - if( iProperty.Get(KIMStatusProperty, EIMStatusPropertyMessageCount,iMsgCount ) == KErrNotFound ) - { - //do necessary action - } - if( iProperty.Get(KIMStatusProperty, EIMStatusPropertyServiceId,iServiceId ) == KErrNotFound ) - { - //do necessary action - } - if( iProperty.Get(KIMStatusProperty, EIMMultipleSender,iMultipleSenders ) == KErrNotFound ) - { - //do necessary action - } - TBuf senderId; - if( iProperty.Get(KIMStatusProperty, EIMStatusPropertySenderId,senderId) == KErrNotFound ) - { - //do necessary action - } - if(iSenderId) - { - delete iSenderId; - iSenderId = NULL; - } - iSenderId = senderId.AllocL(); - } -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicator::MsgCount() -// --------------------------------------------------------------------------- -// -TInt CIMStatusPaneIndicator::MsgCount() - { - return iMsgCount; - } - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicator::ServiceId() -// --------------------------------------------------------------------------- -// -TInt CIMStatusPaneIndicator::ServiceId() - { - return iServiceId; - } - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicator::SenderId() -// --------------------------------------------------------------------------- -// -const TDesC& CIMStatusPaneIndicator::SenderId() - { - if(iSenderId) - { - return *iSenderId; - } - return KNullDesC() ; - } - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicator::IsMultipleSenders() -// --------------------------------------------------------------------------- -// -TInt CIMStatusPaneIndicator::IsMultipleSenders() - { - return iMultipleSenders; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/src/imstatuspaneindicatorpluginimplementation.cpp --- a/imstatuspaneindicatorplugin/src/imstatuspaneindicatorpluginimplementation.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,253 +0,0 @@ -/* -* 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: This class is the plugin implementation -* -*/ - - -// INCLUDE FILES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -// imlauncher -#include - -//sp settings -#include -#include -#include - -#include "imstatuspaneindicator.h" -#include "imstatuspaneindicatorpluginimplementation.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicatorPluginImplementation::CIMStatusPaneIndicatorPluginImplementation -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------------------------- -// -CIMStatusPaneIndicatorPluginImplementation::CIMStatusPaneIndicatorPluginImplementation() -: iCoeEnv( *CCoeEnv::Static() ) - { - } - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicatorPluginImplementation::ConstructL -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CIMStatusPaneIndicatorPluginImplementation::ConstructL() - { - TFileName resPathWithoutDrive; - resPathWithoutDrive.Zero(); - resPathWithoutDrive.Append( KResourceDir() ); - resPathWithoutDrive.Append( KIndicatorResourceFile() ); - - TFileName path; - Dll::FileName(path); //get the location of the dll - - TDriveName drive( TParsePtrC( path ).Drive( ) ); // solve drive - - // leave to stack, LC method - HBufC* resourceFilePath = HBufC::NewLC( KMaxResourcePathLength ); - TPtr ptr( resourceFilePath->Des() ); - ptr.Append( resPathWithoutDrive ); // without drive - ptr.Insert( 0, drive ); // insert drive - - // NearestLanguageFile takes only TFileName - path.Zero(); - path.Append( *resourceFilePath ); - - if ( path.Length() != 0 ) - { - BaflUtils::NearestLanguageFile( iCoeEnv.FsSession(), path ); - } - - CleanupStack::PopAndDestroy(resourceFilePath); - - iResourceOffset = iCoeEnv.AddResourceFileL(path); - - iPopupTextOne = StringLoader::LoadLC( R_QTN_SERVTAB_UNIPANE_ONENEWMSG ); - CleanupStack::Pop(); - iPopupTextMultiple = StringLoader::LoadLC( R_QTN_SERVTAB_UNIPANE_NEWMSGS ); - CleanupStack::Pop(); - iIMStatusPaneIndicator = CIMStatusPaneIndicator::NewL(); - } - -// ----------------------------------------------------------------------------- -// CIMStatusPaneIndicatorPluginImplementation::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMStatusPaneIndicatorPluginImplementation* CIMStatusPaneIndicatorPluginImplementation::NewL() - { - CIMStatusPaneIndicatorPluginImplementation* self = - new( ELeave ) CIMStatusPaneIndicatorPluginImplementation(); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -// Destructor -CIMStatusPaneIndicatorPluginImplementation::~CIMStatusPaneIndicatorPluginImplementation() - { - delete iIMStatusPaneIndicator; - iCoeEnv.DeleteResourceFile( iResourceOffset ); - delete iPopupTextMultiple; - delete iPopupTextOne; - iViewServices.Close(); - } - - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicatorPluginImplementation::HandleIndicatorTapL -// --------------------------------------------------------------------------- -// -void CIMStatusPaneIndicatorPluginImplementation::HandleIndicatorTapL( const TInt aUid) - { - if(EAknIndicatorMecoServiceTab == aUid) - { - ShowMessageL(); - } - } - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicatorPluginImplementation::CreatePopupContentMessageL() -// --------------------------------------------------------------------------- -// -HBufC* CIMStatusPaneIndicatorPluginImplementation::CreatePopupContentMessageL() - { - if( !iPopupTextMultiple || !iPopupTextOne ) - { - // do not allocate KNullDesC>AllocL() memory here, as the avakon component - // donot test for the lenght of the text, instead it tests if - // the text is valid or not. - // Load resource strings before calling this method! - return NULL; - } - - HBufC* dynStringBuf = NULL; - if(iIMStatusPaneIndicator) - { - TInt Count = iIMStatusPaneIndicator->MsgCount(); - if( 1 == Count ) - { - dynStringBuf = iPopupTextOne->AllocL(); - } - else if(Count > 1) - { - TInt reqDynLen = iPopupTextMultiple->Length() + - KMaxMessageNumberLength; - dynStringBuf = HBufC::NewL( reqDynLen ); - TPtr dynString = dynStringBuf->Des(); - StringLoader::Format( dynString, - iPopupTextMultiple->Des(), - -1, //No index code in source string - Count ); - } - } - - return dynStringBuf; - } - -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicatorPluginImplementation::TextL() -// --------------------------------------------------------------------------- -// -HBufC* CIMStatusPaneIndicatorPluginImplementation::TextL( const TInt aUid, TInt& aTextType ) - { - if(EAknIndicatorMecoServiceTab == aUid) - { - // check the uid, if its only my uid then call the functionality below. - aTextType = CAknIndicatorPlugin::EAknIndicatorPluginLinkText; - return CreatePopupContentMessageL(); - } - return NULL; - } -// --------------------------------------------------------------------------- -// CIMStatusPaneIndicatorPluginImplementation::ShowMessageL() -// --------------------------------------------------------------------------- -// -void CIMStatusPaneIndicatorPluginImplementation::ShowMessageL() - { - if(iIMStatusPaneIndicator) - { - // conversation view should be launched if is 1 message or if more than - // one message, but the sender is same of all the messages. - if(iIMStatusPaneIndicator->MsgCount() >= 1 && iIMStatusPaneIndicator->IsMultipleSenders() == 1 ) - { - TVwsViewId activeViewId; - CCoeEnv::Static()->AppUi()->GetActiveViewId( activeViewId ); - // launch the conversation view - // imlauncher call for luanching the conversationview with seletced user id - IMCVLauncher::LaunchImConversationViewL(activeViewId, iIMStatusPaneIndicator->ServiceId(), iIMStatusPaneIndicator->SenderId()); - } - // servie tab is launched when there are more than one messages received from different - // senders. - else if(iIMStatusPaneIndicator->MsgCount() > 1 ) - { - //launch service tab based on the service id. - TInt serviceviewId = 0 ; - TInt seriveId = iIMStatusPaneIndicator->ServiceId(); - if( seriveId != KErrNotFound) - { - CSPSettings* spSettings = CSPSettings::NewL(); - CleanupStack::PushL(spSettings); - //get the tabview id from settings - CSPProperty* property = CSPProperty::NewLC(); - spSettings->FindPropertyL( seriveId, - EPropertyContactViewId, - *property ); - property->GetValue(serviceviewId); - CleanupStack::PopAndDestroy( property ); - CleanupStack::PopAndDestroy( spSettings ); - } - // Launched from service tab, go back there - TInt err = iViewServices.Open(); - if ( KErrServerTerminated == err || KErrNotFound == err ) - { - iViewServices.Close(); - err = iViewServices.Open(); - } - // this error comes when the phonebook is already open, hence we should directly launch the - // service tab. - if(KErrAlreadyExists != err) - { - User::LeaveIfError( err ); - } - // Activate the service tab in phonebook. - User::LeaveIfError( iViewServices.Activate( - KMECOIMPLEMENTATIONUID, - serviceviewId ) ); - - } - } - } - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstatuspaneindicatorplugin/src/imstatuspaneindicatorproxy.cpp --- a/imstatuspaneindicatorplugin/src/imstatuspaneindicatorproxy.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* 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: proxy call for plugin -* -*/ -#include "imstatuspaneindicatorpluginimplementation.h" -#include "imstatuspaneindicatorpluginuids.h" - -#include - -// Define the interface UIDs -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KIMSTATUSPANEINDICATORPLUGINIMPLEMENTATIONUIDVALUE, - CIMStatusPaneIndicatorPluginImplementation::NewL ) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy - (TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(ImplementationTable[0]); - return ImplementationTable; - } -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/group/bld.inf --- a/imstutils/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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: inf file for imutils -* -*/ -// Project configuration file for IM - -// Project platforms -PRJ_PLATFORMS -WINSCW ARMV5 - -#include - -// Project exports -PRJ_EXPORTS -// export localisation files -../loc/meco.loc APP_LAYER_LOC_EXPORT_PATH(meco.loc) - -// MMP files for project components -PRJ_MMPFILES -#include "../imconnectionprovider/group/bld.inf" -#include "../xmppadapter/group/bld.inf" -#include "../imconversationview/group/bld.inf" - -PRJ_TESTMMPFILES - diff -r 2b7283837edb -r 3104fc151679 imstutils/help/data/xhtml.zip Binary file imstutils/help/data/xhtml.zip has changed diff -r 2b7283837edb -r 3104fc151679 imstutils/help/group/bld.inf --- a/imstutils/help/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - -#include -PRJ_EXPORTS -:zip ../data/xhtml.zip /epoc32/data/z/resource/ overwrite -:zip ../data/xhtml.zip /epoc32/winscw/c/resource/ overwrite - -../inc/meco.hlp.hrh MW_LAYER_PLATFORM_EXPORT_PATH(csxhelp/meco.hlp.hrh) -../rom/imstutilshelps_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(imstutilshelps_variant.iby) diff -r 2b7283837edb -r 3104fc151679 imstutils/help/inc/meco.hlp.hrh --- a/imstutils/help/inc/meco.hlp.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ -// -// meco.hlp.hrh generated by CSXHelp Utilities. -// - -#ifndef __MECO_HLP_HRH__ -#define __MECO_HLP_HRH__ - -_LIT(KSERVTAB_HLP_MAIN_VIEW_IM, "SERVTAB_HLP_MAIN_VIEW_IM"); // -_LIT(KSERVTAB_HLP_MAIN_VIEW_VOIPIM, "SERVTAB_HLP_MAIN_VIEW_VOIPIM"); // -_LIT(KSERVTAB_HLP_MAIN_VIEW_VOIP, "SERVTAB_HLP_MAIN_VIEW_VOIP"); // -_LIT(KSERVTAB_HLP_SEARCH, "SERVTAB_HLP_SEARCH"); // -_LIT(KSERVTAB_HLP_CONVERSATION, "SERVTAB_HLP_CONVERSATION"); // -_LIT(KSERVTAB_HLP_CONTACT_DETAILS, "SERVTAB_HLP_CONTACT_DETAILS"); // - -#endif diff -r 2b7283837edb -r 3104fc151679 imstutils/help/rom/imstutilshelps_variant.iby --- a/imstutils/help/rom/imstutilshelps_variant.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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: -* -*/ - -#ifndef __IMSTUTILSHELPS_VARIANT_IBY__ -#define __IMSTUTILSHELPS_VARIANT_IBY__ - -#if defined(FF_S60_HELPS_IN_USE) - data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x2001FDC2\contents.zip, RESOURCE_FILES_DIR\xhtml\%02d\0x2001FDC2\contents.zip) - data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x2001FDC2\index.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x2001FDC2\index.xml) - data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x2001FDC2\keywords.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x2001FDC2\keywords.xml) - data=LOCALISE(DATAZ_\resource\xhtml\%02d\0x2001FDC2\meta.xml, RESOURCE_FILES_DIR\xhtml\%02d\0x2001FDC2\meta.xml) -#endif - -#endif \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/data/20010120.rss --- a/imstutils/imconnectionprovider/data/20010120.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2008 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: 20010120.rss -* -*/ - - - - -#include -#include "registryinfov2.rh" -#include "imconnectionprovideruids.hrh" - -// RESOURCE DEFINITIONS -// ----------------------------------------------------------------------------- -// -// theInfo -// REGISTRY_INFO for ECom -// -// ----------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO theInfo - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = KIMConnectivityPluginUid; - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x10275457; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KIMConnectivityPluginImplUid; - version_no = 1; - display_name = " "; - default_data = "IM"; - opaque_data = " "; - } - }; - } - }; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/group/10282CE5.txt Binary file imstutils/imconnectionprovider/group/10282CE5.txt has changed diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/group/bld.inf --- a/imstutils/imconnectionprovider/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2008 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: Build information file for project imconnectionprovider -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -#ifdef FF_MECO_XMPP -../rom/imconnectionprovider.iby CORE_APP_LAYER_IBY_EXPORT_PATH(imconnectionprovider.iby) -10282CE5.txt /epoc32/data/z/private/10202BE9/10282CE5.txt -#endif - -PRJ_MMPFILES - -imconnectionprovider.mmp - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/group/imconnectionprovider.mmp --- a/imstutils/imconnectionprovider/group/imconnectionprovider.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2008 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: Project definition file for project imconnectionprovider -* -*/ - - -#include "../inc/imconnectionprovideruids.hrh" -#include -#include - -TARGET imconnectionprovider.dll -TARGETTYPE PLUGIN -UID 0x10009D8D KIMConnectivityPluginUid -VENDORID VID_DEFAULT -CAPABILITY CAP_ECOM_PLUGIN - -VERSION 10.0 -//used to allow binary compression by making use of BYTEPAIR algorithm -PAGED -// SOURCE -SOURCEPATH ../src -SOURCE cicpplugin.cpp -SOURCE cicpservicemanager.cpp -SOURCE cicpservicerequest.cpp - - -START RESOURCE ../data/20010120.rss -#ifdef SYMBIAN_SECURE_ECOM -TARGET imconnectionprovider.rsc -TARGETPATH ECOM_RESOURCE_DIR -#endif -END - -// INCLUDE -USERINCLUDE ../inc - - - -APP_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/stdapis - -// LIBRARY -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY serviceprovidersettings.lib -LIBRARY flogger.lib - -LIBRARY diskspacereserver.lib -LIBRARY featmgr.lib - -//imcache client -LIBRARY imcacheclient.lib - -// xmpp settings -LIBRARY jabbersettings.lib - - -/*************************** -* Logging method variants: -* 0 = No logging -* 1 = UDEB RDebug -* 2 = UDEB Flogger -* 3 = UDEB RDebug & Flogger -* -* For file logging make sure that directory C:/logs/scp exists -***************************/ - - -MACRO SCP_LOGGING_2 - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/inc/cicpplugin.h --- a/imstutils/imconnectionprovider/inc/cicpplugin.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,245 +0,0 @@ -/* -* Copyright (c) 2008 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: conecction provider plugin implementation class -* -*/ - - -#ifndef C_ICPPLUGIN_H -#define C_ICPPLUGIN_H - - -// INCLUDES -#include -#include "imserviceobserver.h" - - -class CIcpServiceManager; - -/** -* CIcpPlugin class -* @lib imconnectionprovider.dll -*/ -class CIcpPlugin : public CCchService, - public MImServiceObserver - { - -public: // Constructors and destructor - - /** - * Two-phased constructor - */ - static CIcpPlugin* NewL( TAny* aParam ); - - /** - * Destructor. - */ - virtual ~CIcpPlugin(); - - public : // from base class CCHService - - /** - * Client enables service. CCHService implementation - * should use MCCHServiceObserver for service state notifications. - * @see MCCHServiceObserver - * @param aServiceSelection Service selection - */ - void EnableServiceL( const TServiceSelection& aServiceSelection ); - - /** - * Client enables service. CCHService implementation - * should use MCCHServiceObserver for service state notifications. - * @see MCCHServiceObserver - * @param aServiceSelection Service selection - * @param aIapId Iap id - */ - void EnableServiceL( const TServiceSelection& aServiceSelection, - TUint aIapId ); - - /** - * Client disables service. - * @param aServiceId - */ - void DisableServiceL( const TServiceSelection& aServiceSelection ); - - /** - * Client checks is the service available by the IAP id array. - * CCHService implementation should return ETrue if service is - * registrable by the (some) IAP, array contains. - * @param aServiceSelection Service selection - * @param aIapIdArray Id array of the currently available iaps. - * @return ETrue if service is available. - */ - TBool IsAvailableL( const TServiceSelection& aServiceSelection, - const RArray& aIapIdArray ) const; - - /** - * Get service state information. - * @param aServiceSelection Service selection - * @param aState Current service state. - * @return General symbian error code. - */ - TInt GetServiceState( const TServiceSelection& aServiceSelection, - TCCHSubserviceState& aState ) const; - - /** - * Get service network information. - * @param aConnectionInfo Connection info - * @return General symbian error code. - */ - TInt GetServiceNetworkInfo( TServiceConnectionInfo& aConnectionInfo ) const; - - /** - * Set Snap id for service. - * @param aServiceSelection Service selection - * @return General symbian error code. - */ - TInt SetSnapId( const TServiceSelection& aServiceSelection, - TUint aSnapId ); - - /** - * Set IAP id for service. - * @param aServiceSelection Service selection - * @param aIapId - * @return General symbian error code. - */ - TInt SetIapId( const TServiceSelection& aServiceSelection, - TUint aIapId ); - - /** - * Get service specifics information about service and protocol - * @param aServiceSelection Service selection - * @param aBuffer Info will be inserted to this buffer - */ - void GetServiceInfoL( const TServiceSelection& aServiceSelection, - RBuf& aBuffer ) const; - - /** - * Reserves the service for exclusive use - * @param aServiceSelection Selected service, ID and type - * @return General symbian error code. - */ - TInt ReserveService( const TServiceSelection& aServiceSelection ); - - /** - * Frees the exclusive service reservation - * @param aServiceSelection Selected service, ID and type - * @return General symbian error code. - */ - TInt FreeService( const TServiceSelection& aServiceSelection ); - - /** - * Is the service reserved - * @param aServiceSelection Selected service, ID and type - * @return TBool - */ - TBool IsReserved( const TServiceSelection& aServiceSelection ) const; - - public : // from base class MSCPServiceObserver - - /** - * Service state observer. - * @since S60 5.0 - * @param aServiceId - * @param aState a new state of the service. - */ - void ServiceStateChanged( - const TUint aServiceId, - const TCCHSubserviceType aSubService, - TCCHSubserviceState aState, - TInt aError ); - - /** - * Returns the connection parameters - * @since S60 3.2.3 - * @param aServiceSelection Selected service, ID and type - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt GetConnectionParameter( - const TServiceSelection& aServiceSelection, - TCchConnectionParameter aParameter, - TInt& aValue ) const; - - /** - * Returns the connection parameters - * @since S60 3.2.3 - * @param aServiceSelection Selected service, ID and type - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt GetConnectionParameter( - const TServiceSelection& aServiceSelection, - TCchConnectionParameter aParameter, - RBuf& aValue ) const; - - /** - * Sets the connection parameters - * @since S60 3.2.3 - * @param aServiceSelection Selected service, ID and type - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt SetConnectionParameter( - const TServiceSelection& aServiceSelection, - TCchConnectionParameter aParameter, - TInt aValue ); - - /** - * Sets the connection parameters - * @since S60 3.2.3 - * @param aServiceSelection Selected service, ID and type - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt SetConnectionParameter( - const TServiceSelection& aServiceSelection, - TCchConnectionParameter aParameter, - const TDesC& aValue ); - - -private: - - /** - * Constructor is hidden - */ - CIcpPlugin( MCchServiceObserver& aServiceObserver ); - - /** - * 2nd phase constructor - */ - void ConstructL(); - -private: - - /** - * Service manager. Own - */ - CIcpServiceManager* iServiceManager; - - /** - * not owns : CCH service observer. - */ - MCchServiceObserver& iServiceObserver; - - }; - -#endif // C_SCPPLUGIN_H - -// End of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/inc/cicpservicemanager.h --- a/imstutils/imconnectionprovider/inc/cicpservicemanager.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,414 +0,0 @@ -/* -* Copyright (c) 2008 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: service manager callback implementation class -* -*/ - - -#ifndef C_CICPSERVICEMANAGER_H -#define C_CICPSERVICEMANAGER_H - - -// INCLUDES - -#include -#include -#include -#include -#include -#include -#include - -#include "timconnproviderenums.h" - -#define MAX_LENGTH 512 - -class MXIMPContext; //for MXIMPContext -class MXIMPClient; -class CICPServiceRequest; -class CXmppSettingsApi; //protocol specific settings store -class CIMCacheFactory; // imcache factory -class MIMCacheUpdater; // cache updater -class CSPSettings; //SP Settings - -/** -* CIcpServiceManager class -* @lib imconnectionprovider.dll -*/ -class CIcpServiceManager : public CBase, - public MXIMPContextObserver - { - //for test case purpose - friend class Cimconnectionprovider_test; - -public: - - /** - * Two-phased constructor - */ - static CIcpServiceManager* NewL( MCchServiceObserver& aServiceObserver ); - - /** - * Destructor. - */ - virtual ~CIcpServiceManager(); - -public: // New functions - - /** - * Client enables service. CCHService implementation - * should use MCCHServiceObserver for service state notifications. - * @see MCCHServiceObserver - * @param aServiceId - */ - void EnableServiceL( TUint aServiceId, - TCCHSubserviceType aSubServiceType ); - - /** - * Client enables service. CCHService implementation - * should use MCCHServiceObserver for service state notifications. - * @see MCCHServiceObserver - * @param aServiceId - * @param aIapId - */ - void EnableServiceL( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TUint aIapId ); - - /** - * Client disables service. - * @param aServiceId - */ - void DisableServiceL( TUint aServiceId, - TCCHSubserviceType aSubServiceType ); - - /** - * Client checks is the service available by the IAP id array. - * CCHService implementation should return ETrue if service is - * registrable by the (some) IAP, array contains. - * @param aServiceId - * @param aIapIdArray Id array of the currently available iaps. - * @return ETrue if service is available. - */ - TBool IsAvailableL( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - const RArray& aIapIdArray ) const; - - /** - * Get service state information. - * @param aServiceId - * @param aState Current service state. - * @return General symbian error code. - */ - TInt GetServiceState( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TCCHSubserviceState& aState ) const; - - /** - * Get service network information. - * @param aServiceId - * @param aSnapId Used Snap id (should be set as null if - * not in use) - * @pamar aIapId Used IAP id (should be set as null if - * not in use) - * @return General symbian error code. - */ - TInt GetServiceNetworkInfoL( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TUint32& aSnapId, - TUint32& aIapId, - TBool& aSnapLocked, - TBool& aPasswordSet) const; - - /** - * Set Snap id for service. - * @param aServiceId - * @param aSnapId - * @return General symbian error code. - */ - TInt SetSnapId( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TUint aSnapId ); - - /** - * Set IAP id for service. - * @param aServiceId - * @param aSnapId - * @return General symbian error code. - */ - TInt SetIapId( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TUint aIapId ); - - /** - * Get service specifics information about service and protocol - * @param aServiceId - * @param aSubservice - * @param aBuffer - */ - void GetServiceInfoL( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - RBuf& aBuffer ) const; - - /** - * Sets service reserved or unreserved - * @param aReserved Reserved - * @param aServiceId - * @param aSubServiceType Sub service type - * @return Symbian error codes - */ - TInt SetServiceReserved( TBool aReserved, - TUint aServiceId, - TCCHSubserviceType aSubServiceType ); - - - /** - * Returns the connection parameters - * @since S60 3.2.3 - * @param aServiceId Selected service id - * @param aServiceId Selected service type - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt GetConnectionParameter( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TCchConnectionParameter aParameter, - TInt& aValue ) const; - - /** - * Returns the connection parameters - * @since S60 3.2.3 - * @param aServiceId Selected service id - * @param aServiceId Selected service type - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - void GetConnectionParameterL(TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TCchConnectionParameter aParameter, - RBuf& aValue ) const; - - /** - * Sets the connection parameters - * @since S60 3.2.3 - * @param aServiceId Selected service id - * @param aServiceId Selected service type - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt SetConnectionParameter( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TCchConnectionParameter aParameter, - TInt aValue ); - - /** - * Sets the connection parameters - * @since S60 3.2.3 - * @param aServiceId Selected service id - * @param aServiceId Selected service type - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - void SetConnectionParameterL( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TCchConnectionParameter aParameter, - const TDesC& aValue ); - - /** - * Returns service reserved info - * @param aServiceId - * @param aSubServiceType Sub service type - * @return ETrue if reserved - */ - TBool IsReserved( TUint aServiceId, - TCCHSubserviceType aSubServiceType ) const; - - /** - * Profile event call back. - * @since S60 3.2 - * @param aProfileId SIP profile id. - * @param aEvent a new profile event. - */ - void ProfileEventOccurred( const TUint32 aProfileId, - TCCHSubserviceState aEvent, TInt aError ); - - /** - * Service event call back. - * @since S60 3.2 - * @param aServiceId Service id. - * @param aEvent a new profile event. - */ - void ServiceEventOccurred( const TUint32 aServiceId, - const TCCHSubserviceType aSubService, - TCCHSubserviceState aEvent, TInt aError ); - - - /** - * Handles presence context event - * @param aContext - * @param aEvent Event - */ - void HandlePresenceContextEvent( const MXIMPContext& aContext, - const MXIMPBase& aEvent ); - - - - /** - * Handles bind to the presence context - * @param aServiceSettingId - */ - void BindL(TInt aServiceSettingId); - - /** - * Handles unbind to the presence context - */ - void UnBindL(); - -private: - - TInt ConvertXIMPErrToCChErr(const TInt aXimpErr); - - /** - * Default constructor - * @param aStateObserver State Observer - */ - CIcpServiceManager( MCchServiceObserver& aServiceObserver ); - - /** - * 2nd phase constructor - */ - void ConstructL(); - - - /** - * FindRequestId - * find the request id - * @param aRequestId to find - */ - CICPServiceRequest* FindRequestId(TXIMPRequestId& aRequestId ) ; - - - /** - * RemoveRequestId - * remove from the array - * @param aRequestId ,to remove - */ - CICPServiceRequest* RemoveRequestId(TXIMPRequestId& aRequestId) ; - - - /** Create a Request - * @Returns the Ptr to the new request created - * @param - aRequestId - * @param - aType - */ - CICPServiceRequest* CreateRequestL(TXIMPRequestId& aRequestId, - TIMConnProviderEnums::TRequestTypes aType ); - - - - /** - * SetIMDisabledL - * @param aServiceId: ServiceId - */ - void SetIMDisabledL(TUint32 aServiceId); - - - TBool ValidateServiceL( TUint32 aServiceId ) const; - TInt GetSPSettingsIntPropertyL( TUint32 aServiceId, - TServicePropertyName aPropertyName ) const; - - - TBool ValidateSubService( TCCHSubserviceType aSubServiceType ) const; - - - - /** - * Gets the name of the service - * - * @since S60 5.0 - * @param aServiceId, service id - * @param aServiceName, service name is copied to this parameter - * caller should allocate memory for this parameter - * @return None - */ - void GetServiceNameL( - TUint32 aServiceId, TDes& aServiceName ); - -private: - - /** - * Observer for state changes - */ - MCchServiceObserver& iServiceObserver; - - /** - * Event - */ - TCCHSubserviceState iOngoingState; - - /** - * Ongoing service id and subservice type - */ - - TUint iIapId; - - TUint iSnapId; - - TInt iServiceId; - - TInt iLastReportedError; - /** - * Ximp specific data handling - */ - //owns - MXIMPClient* iPresClient; - - //owns - MXIMPContext* iPresenceCtx; - - // Own - RPointerArray iReqIDArray; - - // Owned , settings api to set and reset owndata. - CXmppSettingsApi* iXmppParameters; - - //Stores the XIMPFw EventTypes Subscribed for - RArray< TInt32 > iAcceptedEventTypes; - - //stores the userid - HBufC* iOwnUserId; - - // owned, imcache factory ,call release on it. - CIMCacheFactory* iIMCacheFactory; - - // owned,by factory, cache updater - MIMCacheUpdater* iIMCacheUpdater ; - - HBufC* iServiceName; - - CSPSettings *iCSPSetting; - - #ifdef _DEBUG - #endif - - }; - -#endif // C_CICPSERVICEMANAGER_H - -// End of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/inc/cicpservicerequest.h --- a/imstutils/imconnectionprovider/inc/cicpservicerequest.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation of single request to fw -* -*/ - - - -#ifndef _CICPSERVICEREQUEST_H__ -#define _CICPSERVICEREQUEST_H__ - -// include files -#include -#include - -#include "timconnproviderenums.h" - -/** -* class declaration -* @imconnectionprovider.dll -*/ - -class CICPServiceRequest :public CBase - { - - public: // Two-phased constructors and destructor - - /** - * create the instance of this class - * @param aRequestId, request id to use - * @param aType, a request type - * @return instance of this class - */ - static CICPServiceRequest* NewL(TXIMPRequestId& aRequestId, - TIMConnProviderEnums::TRequestTypes aType); - - /** - * create the instance of this class - * @param aRequestId, request id to use - * @param aType, a request type - * @return instance of this class - */ - static CICPServiceRequest* NewLC(TXIMPRequestId& aRequestId, - TIMConnProviderEnums::TRequestTypes aType); - - /** - * ~CICPServiceRequest - */ - virtual ~CICPServiceRequest(); - - /** - * StartWait - */ - void StartWait(); - - /** - * StopWait method - */ - void StopWait(); - - /** - * GetRequestId - * @return the request id - */ - const TXIMPRequestId& GetRequestId() const; - - /** - * IsWaitStarted method from context obsrver - * check weather wait is started or not - * @return flage - */ - TBool IsWaitStarted() ; - - /** - * Set the Type of Request - * @param aIsLoginReq, a request type - */ - void SetRequestType(TIMConnProviderEnums::TRequestTypes aIsLoginReq) ; - - - /** - * Get the Type of Request - * @return request type - */ - TIMConnProviderEnums::TRequestTypes RequestType() const; - - private: - - /** - * ConstructL - */ - void ConstructL(); - - /** - * CICPServiceRequest - * @param aRequestId ,request id - * @param aType ,request type - */ - CICPServiceRequest(TXIMPRequestId& aRequestId, - TIMConnProviderEnums::TRequestTypes aType); - - private: //data - - // own request id - TXIMPRequestId iRequestId; - - // own active sheduler - CActiveSchedulerWait iWait; - - //request type - TIMConnProviderEnums::TRequestTypes iReqType ; -}; - -#endif //_CICPSERVICEREQUEST_H__ - -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/inc/icplogger.h --- a/imstutils/imconnectionprovider/inc/icplogger.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2008 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: Provides macros for logging -* -*/ - - - -#ifndef __ICPLOGGER_H__ -#define __ICPLOGGER_H__ - -#ifdef __WINS__ - #ifdef _DEBUG - #define ICP_ENABLE_DEBUG_LOGS // for WINS UDEB - #endif -#else - #ifdef _DEBUG - #define ICP_ENABLE_DEBUG_LOGS // for device UDEB - #endif -#endif -#define SCP_TP_PRINT(s) L##s -#define SCP_STRA_PRINT(s) SCP_TP_PRINT(s) -#define SCP_STR_PRINT(t) SCP_STRA_PRINT("[SCP]") L##t -#define SCP_LIT_PRINT(s) TPtrC((const TText *) SCP_STR_PRINT(s)) -#define SCP_LIT_CONVERT(s) TPtrC((const TText *)(s)) - -//----------------------------------------------------------------------------- -// LOGGING MACROs -//----------------------------------------------------------------------------- - -// Logging method is defined in the mmp file - -#ifdef SCP_LOGGING_0 - - #define ICPLOGSTRING(a) - #define ICPLOGSTRING2(a,b) - #define ICPLOGSTRING3(a,b,c) - #define ICPLOGSTRING4(a,b,c,d) - #define ICPLOGSTRING5(a,b,c,d,e) - -#endif - -#ifdef SCP_LOGGING_1 - #ifdef _DEBUG - #include - #include - #define ICPLOGSTRING(a) { RDebug::Print(SCP_LIT_PRINT(a)); } - #define ICPLOGSTRING2(a,b) { RDebug::Print(SCP_LIT_PRINT(a),b); } - #define ICPLOGSTRING3(a,b,c) { RDebug::Print(SCP_LIT_PRINT(a),b,c); } - #define ICPLOGSTRING4(a,b,c,d) { RDebug::Print(SCP_LIT_PRINT(a),b,c,d); } - #define ICPLOGSTRING5(a,b,c,d,e) { RDebug::Print(SCP_LIT_PRINT(a),b,c,d,e); } - #else - #define ICPLOGSTRING(a) - #define ICPLOGSTRING2(a,b) - #define ICPLOGSTRING3(a,b,c) - #define ICPLOGSTRING4(a,b,c,d) - #define ICPLOGSTRING5(a,b,c,d,e) - #endif -#endif - -#ifdef SCP_LOGGING_2 - //#ifdef _DEBUG - #define ICPLOGSTRING(a) { IcpDebugWriteFormat(SCP_LIT_PRINT(a)); } - #define ICPLOGSTRING2(a,b) { IcpDebugWriteFormat(SCP_LIT_PRINT(a),b); } - #define ICPLOGSTRING3(a,b,c) { IcpDebugWriteFormat(SCP_LIT_PRINT(a),b,c); } - #define ICPLOGSTRING4(a,b,c,d) { IcpDebugWriteFormat(SCP_LIT_PRINT(a),b,c,d); }; - #define ICPLOGSTRING5(a,b,c,d,e) { IcpDebugWriteFormat(SCP_LIT_PRINT(a),b,c,d,e); }; - /*#else - #define ICPLOGSTRING(a) - #define ICPLOGSTRING2(a,b) - #define ICPLOGSTRING3(a,b,c) - #define ICPLOGSTRING4(a,b,c,d) - #define ICPLOGSTRING5(a,b,c,d,e) - #endif */ -#endif - -#ifdef SCP_LOGGING_3 - #ifdef _DEBUG - #include - #include - #define ICPLOGSTRING(a) { RDebug::Print(SCP_LIT_PRINT(a));\ - IcpDebugWriteFormat(SCP_LIT_PRINT(a)); } - #define ICPLOGSTRING2(a,b) { RDebug::Print(SCP_LIT_PRINT(a),b);\ - IcpDebugWriteFormat(SCP_LIT_PRINT(a),b); } - #define ICPLOGSTRING3(a,b,c) { RDebug::Print(SCP_LIT_PRINT(a),b,c);\ - IcpDebugWriteFormat(SCP_LIT_PRINT(a),b,c); } - #define ICPLOGSTRING4(a,b,c,d) { RDebug::Print(SCP_LIT_PRINT(a),b,c,d);\ - IcpDebugWriteFormat(SCP_LIT_PRINT(a),b,c,d); } - #define ICPLOGSTRING5(a,b,c,d,e) { RDebug::Print(SCP_LIT_PRINT(a),b,c,d,e);\ - IcpDebugWriteFormat(SCP_LIT_PRINT(a),b,c,d,e); } - #else - #define ICPLOGSTRING(a) - #define ICPLOGSTRING2(a,b) - #define ICPLOGSTRING3(a,b,c) - #define ICPLOGSTRING4(a,b,c,d) - #define ICPLOGSTRING5(a,b,c,d,e) - #endif -#endif - -#include - -inline void IcpDebugWriteFormat(TRefByValue aFmt,...) - { -#ifdef ICP_ENABLE_DEBUG_LOGS - _LIT(KDir, "icp"); - _LIT(KName, "icp.log"); - - // take the ellipsis parameters - VA_LIST args; - VA_START(args,aFmt); - RFileLogger::WriteFormat(KDir, KName, EFileLoggingModeAppend, aFmt, args); - VA_END(args); -#endif - } - -#endif // __SCPLOGGER_H__ diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/inc/imconnectionprovideruids.hrh --- a/imstutils/imconnectionprovider/inc/imconnectionprovideruids.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2008 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: uids collections -* -*/ - - -#ifndef IMCONNECTIONPROVIDER_HRH -#define IMCONNECTIONPROVIDER_HRH - -#define KIMConnectivityPluginUid 0x20010120 -#define KIMConnectivityPluginImplUid 0x20010121 - -#endif diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/inc/imserviceobserver.h --- a/imstutils/imconnectionprovider/inc/imserviceobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2008 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: imservice observer class -* -*/ - - -#ifndef M_IMSERVICEOBSERVER_H -#define M_IMSERVICEOBSERVER_H - -// INCLUDES -#include -#include - - -// CONSTANTS -// None - -// MACROS -// None - -// DATA TYPES -// None - -// FUNCTION PROTOTYPES -// None - -// FORWARD DECLARATIONS -// None - -// CLASS DECLARATION - -/** - * MImServiceObserver declaration. - * @since S60 5.0 - */ -class MImServiceObserver - { - -public: // New functions - - /** - * Service state observer. - * @since S60 5.0 - * @param aServiceId - * @param aSubService - * @param aState a new state of the service. - */ - virtual void ServiceStateChanged( const TUint aServiceId, - const TCCHSubserviceType aSubService, - TCCHSubserviceState aState, - TInt aError ) = 0; - - - - }; - -#endif // M_IMSERVICEOBSERVER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/inc/timconnproviderenums.h --- a/imstutils/imconnectionprovider/inc/timconnproviderenums.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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: enum value for imconnection provider -* -*/ -#ifndef TIMCONNPROVIDERENUMS_H -#define TIMCONNPROVIDERENUMS_H - -#include -#include - -/** -* enums of request types -*/ -class TIMConnProviderEnums - { - - public: // Enumerations and typedefs - - enum TRequestTypes - { - ELoginRequest = 0, - ELogoutRequest, - EFetchRequest, - EFetchContent, - EGrantListRequest, - EPublishOwnPresence, - EInvalid - }; - }; - -#endif // TIMCONNPROVIDERENUMS_H - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/rom/imconnectionprovider.iby --- a/imstutils/imconnectionprovider/rom/imconnectionprovider.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: imconnectionprovider IBY file. -* -*/ - - -#ifndef __IMCONNECTIONPROVIDER_IBY__ -#define __IMCONNECTIONPROVIDER_IBY__ - -//imconnprovider -ECOM_PLUGIN(imconnectionprovider.dll,imconnectionprovider.rsc) - -data=DATAZ_\private\10202be9\10282CE5.txt private\10202be9\10282CE5.txt - -#endif //__IMCONNECTIONPROVIDER_IBY__ - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/src/cicpplugin.cpp --- a/imstutils/imconnectionprovider/src/cicpplugin.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,368 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation for CIcpPlugin -* -*/ - - -#include "cicpplugin.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cicpservicemanager.h" -#include "icplogger.h" -#include "imconnectionprovideruids.hrh" -#include "cicpservicerequest.h" - - -// ----------------------------------------------------------------------------- -// CIcpPlugin::ConstructL -// ----------------------------------------------------------------------------- -// -void CIcpPlugin::ConstructL() - { - ICPLOGSTRING( "CIcpPlugin::ConstructL" ); - - iServiceManager = CIcpServiceManager::NewL( iServiceObserver ); - } - - -// ----------------------------------------------------------------------------- -// CIcpPlugin::CIcpPlugin() -// ----------------------------------------------------------------------------- -// -CIcpPlugin::CIcpPlugin( MCchServiceObserver& serviceObserver ) : - iServiceObserver( serviceObserver ) - { - } - - -// ----------------------------------------------------------------------------- -// CIcpPlugin::NewL -// ----------------------------------------------------------------------------- -// -CIcpPlugin* CIcpPlugin::NewL( TAny* aParam ) - { - ICPLOGSTRING2( "CIcpPlugin::NewL aParam: 0x%x", aParam ); - __ASSERT_DEBUG( aParam, User::Panic( KNullDesC, KErrGeneral ) ); - - MCchServiceObserver& serviceObserver = *((MCchServiceObserver*)(aParam)); - - CIcpPlugin* self = new ( ELeave ) CIcpPlugin( serviceObserver ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::~CIcpPlugin -// ----------------------------------------------------------------------------- -// -CIcpPlugin::~CIcpPlugin() - { - delete iServiceManager; - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::EnableServiceL -// ----------------------------------------------------------------------------- -// -void CIcpPlugin::EnableServiceL( const TServiceSelection& aServiceSelection ) - { - ICPLOGSTRING3( "CIcpPlugin::EnableServiceL service id: %d type: %d", - aServiceSelection.iServiceId, aServiceSelection.iType ); - - iServiceManager->EnableServiceL( aServiceSelection.iServiceId, - aServiceSelection.iType ); - } - - -// ----------------------------------------------------------------------------- -// CIcpPlugin::EnableServiceL -// ----------------------------------------------------------------------------- -// -void CIcpPlugin::EnableServiceL( const TServiceSelection& aServiceSelection, - TUint aIapId ) - { - ICPLOGSTRING4( "CIcpPlugin::EnableServiceL service id: %d type: %d iap id: %d", - aServiceSelection.iServiceId, aServiceSelection.iType, aIapId ); - - - iServiceManager->EnableServiceL( aServiceSelection.iServiceId, - aServiceSelection.iType, - aIapId ); - - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::DisableServiceL -// ----------------------------------------------------------------------------- -// -void CIcpPlugin::DisableServiceL( const TServiceSelection& aServiceSelection ) - { - ICPLOGSTRING3( "CIcpPlugin::DisableServiceL service id: %d type: %d", - aServiceSelection.iServiceId, aServiceSelection.iType ); - - iServiceManager->DisableServiceL( aServiceSelection.iServiceId, - aServiceSelection.iType ); - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::IsAvailableL -// ----------------------------------------------------------------------------- -// -TBool CIcpPlugin::IsAvailableL( const TServiceSelection& aServiceSelection, - const RArray& aIapIdArray ) const - { - ICPLOGSTRING3( "CIcpPlugin::IsAvailableL service id: %d type: %d", - aServiceSelection.iServiceId, aServiceSelection.iType ); - - return iServiceManager->IsAvailableL( aServiceSelection.iServiceId, - aServiceSelection.iType, aIapIdArray ); - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::GetServiceState -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::GetServiceState( const TServiceSelection& aServiceSelection, - TCCHSubserviceState& aState ) const - { - ICPLOGSTRING3( "CIcpPlugin::GetServiceState service id: %d type: %d", - aServiceSelection.iServiceId, aServiceSelection.iType ); - - return iServiceManager->GetServiceState( aServiceSelection.iServiceId, - aServiceSelection.iType, aState ); - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::GetServiceNetworkInfo -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::GetServiceNetworkInfo( TServiceConnectionInfo& aConnectionInfo ) const - { - TServiceSelection& selection = aConnectionInfo.iServiceSelection; - - ICPLOGSTRING3( "CIcpPlugin::GetServiceNetworkInfo service id: %d type: %d", - selection.iServiceId, selection.iType ); - TInt returnval = 0; - //TRAP_IGNORE to remove the codescanner high warning - TRAP_IGNORE(returnval = iServiceManager->GetServiceNetworkInfoL( selection.iServiceId, - selection.iType, - aConnectionInfo.iSNAPId, - aConnectionInfo.iIapId, - aConnectionInfo.iSNAPLocked, - aConnectionInfo.iPasswordSet)); - return returnval; - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::SetSnapId -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::SetSnapId( const TServiceSelection& aServiceSelection, - TUint aSnapId ) - { - ICPLOGSTRING4( "CIcpPlugin::SetSnapId service id: %d type: %d Snap %d", - aServiceSelection.iServiceId, aServiceSelection.iType, aSnapId ); - - return iServiceManager->SetSnapId( aServiceSelection.iServiceId, - aServiceSelection.iType, - aSnapId ); - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::SetIapId -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::SetIapId( const TServiceSelection& aServiceSelection, - TUint aIapId ) - { - ICPLOGSTRING4( "CIcpPlugin::SetIapId service id: %d type: %d iap id %d", - aServiceSelection.iServiceId, aServiceSelection.iType, aIapId ); - - return iServiceManager->SetIapId( aServiceSelection.iServiceId, - aServiceSelection.iType, - aIapId ); - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::GetServiceInfo -// ----------------------------------------------------------------------------- -// -void CIcpPlugin::GetServiceInfoL( const TServiceSelection& aServiceSelection, - RBuf& aBuffer ) const - { - ICPLOGSTRING3( "CIcpPlugin::GetServiceInfoL service id: %d type: %d", - aServiceSelection.iServiceId, aServiceSelection.iType ); - - iServiceManager->GetServiceInfoL( aServiceSelection.iServiceId, - aServiceSelection.iType, - aBuffer ); - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::ReserveService -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::ReserveService( const TServiceSelection& aServiceSelection ) - { - return iServiceManager->SetServiceReserved( ETrue, - aServiceSelection.iServiceId, - aServiceSelection.iType ); - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::FreeService -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::FreeService( const TServiceSelection& aServiceSelection ) - { - return iServiceManager->SetServiceReserved( EFalse, - aServiceSelection.iServiceId, - aServiceSelection.iType ); - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::IsReserved -// ----------------------------------------------------------------------------- -// -TBool CIcpPlugin::IsReserved( const TServiceSelection& aServiceSelection ) const - { - return iServiceManager->IsReserved( aServiceSelection.iServiceId, - aServiceSelection.iType ); - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::ServiceStateChanged -// ----------------------------------------------------------------------------- -// -void CIcpPlugin::ServiceStateChanged( - const TUint aServiceId, - const TCCHSubserviceType aSubService, - TCCHSubserviceState aState, - TInt aError ) - { - - // State of the service changed. Notify observer. - iServiceObserver.ServiceStateChanged( - TServiceSelection( aServiceId, aSubService ), - aState, - aError ); - - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::GetConnectionParameter -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::GetConnectionParameter( - const TServiceSelection& aServiceSelection, - TCchConnectionParameter aParameter, - TInt& aValue ) const - { - return iServiceManager->GetConnectionParameter( - aServiceSelection.iServiceId, - aServiceSelection.iType, - aParameter, - aValue - ) ; - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::GetConnectionParameter -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::GetConnectionParameter(const TServiceSelection& aServiceSelection, - TCchConnectionParameter aParameter, - RBuf& aValue ) const - { - TRAPD(error, iServiceManager->GetConnectionParameterL( - aServiceSelection.iServiceId, - aServiceSelection.iType, - aParameter, - aValue - )) ; - return error; - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::SetConnectionParameter -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::SetConnectionParameter( const TServiceSelection& aServiceSelection, - TCchConnectionParameter aParameter, - TInt aValue ) - { - return iServiceManager->SetConnectionParameter( - aServiceSelection.iServiceId, - aServiceSelection.iType, - aParameter, - aValue - ) ; - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::SetConnectionParameter -// ----------------------------------------------------------------------------- -// -TInt CIcpPlugin::SetConnectionParameter( const TServiceSelection& aServiceSelection, - TCchConnectionParameter aParameter, - const TDesC& aValue ) - { - TRAPD(error, iServiceManager->SetConnectionParameterL( - aServiceSelection.iServiceId, - aServiceSelection.iType, - aParameter, - aValue - )) ; - return error; - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// -// Rest of the file is for ECom initialization. -// - -// Map the interface UIDs -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KIMConnectivityPluginImplUid, CIcpPlugin::NewL ) - }; - - -// ----------------------------------------------------------------------------- -// ImplementationGroupProxy implements for ECom -// Exported proxy for instantiation method resolution -// Returns: ImplementationTable -// ----------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); - return ImplementationTable; - } - -// End of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/src/cicpservicemanager.cpp --- a/imstutils/imconnectionprovider/src/cicpservicemanager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1114 +0,0 @@ -/* -* Copyright (c) 2008 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: connection service manager for im -* -*/ - - -#include "cicpservicemanager.h" // service manager - -#include - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include // recieve message -#include - -#include -#include -#include -#include - -#include "icplogger.h" -#include "cicpservicerequest.h" - -// imcache related includes -#include -#include - -//xmppsettings -#include "xmppparams.h" -#include "xmppservicesettingsapi.h" - - -/************** Consts ***************/ -const TInt KPropertyMaxLength = 512; -const TInt KPasswordMaxLength = 50; -//Received message maximum length is 400 character if received message is longer than 400 character -//Truncate it to 400 character -//This must always be in sync with imcvuiapp KReceiveMsgMaxLength -const TInt KReceiveMsgMaxLength = 400; - _LIT(KAt, "@"); - _LIT(KPercentage, "%"); -/***********End of Consts**********************/ - - - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::CIcpServiceManager() -// ----------------------------------------------------------------------------- -// -CIcpServiceManager::CIcpServiceManager( MCchServiceObserver& aServiceObserver ) : - iServiceObserver( aServiceObserver ), - iOngoingState( ECCHUninitialized ) - { - ICPLOGSTRING( "CIcpServiceManager::CIcpServiceManager"); - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::NewL -// ----------------------------------------------------------------------------- -// -CIcpServiceManager* CIcpServiceManager::NewL( MCchServiceObserver& aServiceObserver ) - { - ICPLOGSTRING( "CIcpServiceManager::NewL"); - - CIcpServiceManager* self = new ( ELeave ) CIcpServiceManager( aServiceObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::ConstructL -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::ConstructL() - { - ICPLOGSTRING( "CIcpServiceManager::ConstructL"); - iCSPSetting = CSPSettings::NewL(); - iXmppParameters = CXmppSettingsApi::NewL(); - - iOwnUserId = HBufC::NewL(MAX_LENGTH); - - if ( iPresClient ) - { - delete iPresClient; - iPresClient = NULL; - } - - //XIMP Context creation - iPresClient = MXIMPClient::NewClientL(); - MXIMPContext* tmp = iPresClient->NewPresenceContextLC(); - iPresenceCtx = tmp; - CleanupStack::Pop( ); // iPresenceCtx - - iAcceptedEventTypes.Reset(); - iAcceptedEventTypes.AppendL( MXIMPRequestCompleteEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MXIMPContextStateEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MImConversationEvent::KInterfaceId ); - - - TArray< TInt32 > eventFilterArray = iAcceptedEventTypes.Array(); - // register this to prsence context - iPresenceCtx->RegisterObserverL( *this, &eventFilterArray ); - - tmp = NULL; - - ICPLOGSTRING( "CIcpServiceManager::ConstructL Done"); - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::~CIcpServiceManager -// ----------------------------------------------------------------------------- -// -CIcpServiceManager::~CIcpServiceManager() - { - ICPLOGSTRING( "CIcpServiceManager::~CIcpServiceManager"); - - delete iXmppParameters; - delete iOwnUserId; - - delete iCSPSetting; - - iAcceptedEventTypes.Reset(); - iAcceptedEventTypes.Close(); - - iReqIDArray.ResetAndDestroy(); - - delete iPresenceCtx; - delete iPresClient; - - if(iIMCacheFactory) - { - CIMCacheFactory::Release(); - } - - if (iServiceName) - { - delete iServiceName; - iServiceName = NULL; - } - } - - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::EnableServiceL -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::EnableServiceL( TUint aServiceId, - TCCHSubserviceType aSubServiceType ) - { - ICPLOGSTRING3( "CIcpServiceManager::EnableServiceL service:%i Type:%i", aServiceId, aSubServiceType ); - - __ASSERT_DEBUG( ValidateSubService(aSubServiceType), User::Panic( KNullDesC, KErrNotFound ) ); - __ASSERT_DEBUG( aServiceId > 0, User::Panic( KNullDesC, KErrNotFound ) ); - - if ( (iOngoingState != ECCHEnabled) && - (iOngoingState != ECCHConnecting) ) - { - //Get the service - iServiceId = aServiceId; - - if (iServiceName) - { - delete iServiceName; - iServiceName = NULL; - } - - iServiceName = HBufC::NewL(KPropertyMaxLength); - TPtr serviceIdPtr( iServiceName->Des() ); - - GetServiceNameL(iServiceId, serviceIdPtr); - - TInt settingsId = GetSPSettingsIntPropertyL(aServiceId, ESubPropertyIMSettingsId); - - //reset owndata - delete iOwnUserId; - iOwnUserId = NULL; - iOwnUserId = HBufC::NewL(MAX_LENGTH); - TPtr owndataPtr = iOwnUserId->Des(); - - //get the owndata from settingsapi - CXmppSettingsApi* xmppParameters = CXmppSettingsApi::NewLC(); - xmppParameters->GetParamL(settingsId, XmppParams::KXmppParamUsername(), owndataPtr ); - CleanupStack::PopAndDestroy(); // xmppParameters - - TInt passwordSet = KErrNotFound; - GetConnectionParameter(aServiceId,aSubServiceType,ECchPasswordSet,passwordSet); - if(0 == iOwnUserId->Length() || !passwordSet) - { - // check the user name if its empty or leave with the KCCHErrorAuthenticationFailed - // for the cch ui to show the user name and password query dialog. - User::Leave(KCCHErrorAuthenticationFailed); - } - - //bind to presence context - BindL(iServiceId); - iOngoingState = ECCHConnecting; - } - - - ICPLOGSTRING( "CIcpServiceManager::EnableServiceL out" ); - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::EnableServiceL -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::EnableServiceL( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TUint /*aIapId*/ ) - { - ICPLOGSTRING3( "CIcpServiceManager::EnableServiceL service:%i Type:%i", aServiceId, aSubServiceType ); - - __ASSERT_DEBUG( ValidateSubService(aSubServiceType), User::Panic( KNullDesC, KErrNotFound ) ); - __ASSERT_DEBUG( aServiceId > 0, User::Panic( KNullDesC, KErrNotFound ) ); - - EnableServiceL( aServiceId, aSubServiceType ); - - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::DisableServiceL -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::DisableServiceL( TUint aServiceId, - TCCHSubserviceType aSubServiceType ) - { - ICPLOGSTRING3( "CIcpServiceManager::DisableService service:%i Type:%i", aServiceId, aSubServiceType ); - __ASSERT_DEBUG( ValidateSubService(aSubServiceType), User::Panic( KNullDesC, KErrNotFound ) ); - __ASSERT_DEBUG( aServiceId > 0, User::Panic( KNullDesC, KErrNotFound ) ); - - - // just unbind the context from the oss protocol adaptation plugin - if (iOngoingState == ECCHEnabled) - { - UnBindL(); - iOngoingState = ECCHDisconnecting; - } - - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::IsAvailableL -// ----------------------------------------------------------------------------- -// -TBool CIcpServiceManager::IsAvailableL( TUint /*aServiceId*/, - TCCHSubserviceType /*a*/, - const RArray& /*aIapIdArray*/ ) const - { - ICPLOGSTRING( "CIcpServiceManager::IsAvailableL" ); - - return ETrue; - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::GetServiceState -// ----------------------------------------------------------------------------- -// -TInt CIcpServiceManager::GetServiceState( TUint aServiceId, - TCCHSubserviceType aSubServiceType , - TCCHSubserviceState& aState ) const - { - ICPLOGSTRING3( "CIcpServiceManager::GetServiceState service:%i type:%i", aServiceId, aSubServiceType ); - - __ASSERT_DEBUG( ValidateSubService(aSubServiceType), User::Panic( KNullDesC, KErrNotFound ) ); - __ASSERT_DEBUG( aServiceId > 0, User::Panic( KNullDesC, KErrNotFound ) ); - - TInt result( KErrNone ); - - aState = iOngoingState; - result = iLastReportedError; - return result; - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::GetServiceNetworkInfo -// ----------------------------------------------------------------------------- -// -TInt CIcpServiceManager::GetServiceNetworkInfoL( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TUint32& aSnapId, - TUint32& aIapId, - TBool& aSnapLocked, - TBool& aPasswordSet) const - { - ICPLOGSTRING3( "CIcpServiceManager::GetServiceNetworkInfo service:%i type:%i", aServiceId, aSubServiceType ); - - __ASSERT_DEBUG( ValidateSubService(aSubServiceType), User::Panic( KNullDesC, KErrNotFound ) ); - __ASSERT_DEBUG( aServiceId > 0, User::Panic( KNullDesC, KErrNotFound ) ); - - //Please dont remove the below line - //otheriwse enable service will not be called - //assuming service is down. Hack - aSnapId = 0; - aIapId = 5; - aSnapLocked = ETrue; - // read from setting see, if it is availabe set 1 else 0 - TInt settingsId = GetSPSettingsIntPropertyL(aServiceId, ESubPropertyIMSettingsId); - //get the owndata from settingsapi - HBufC* password = HBufC::NewLC( KPasswordMaxLength ); - TPtr passwordPtr( password->Des() ); - - iXmppParameters->GetParamL((TUint32)settingsId, XmppParams::KXmppParamPassword(), passwordPtr ); - - if( passwordPtr.Length() > 0 ) - { - aPasswordSet = ETrue; - } - else - { - aPasswordSet = EFalse; - } - CleanupStack::PopAndDestroy();// password - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::SetSnapId -// ----------------------------------------------------------------------------- -// -TInt CIcpServiceManager::SetSnapId( TUint /*aServiceId*/, - TCCHSubserviceType /*aSubServiceType*/, - const TUint /*aSnapId*/ ) - { - return KErrNotSupported; - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::SetIapId -// ----------------------------------------------------------------------------- -// -TInt CIcpServiceManager::SetIapId( TUint /*aServiceId*/, - TCCHSubserviceType /*aSubServiceType*/, - TUint /*aIapId*/ ) - { - return KErrNotSupported; - } - - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::GetServiceInfoL -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::GetServiceInfoL( TUint /*aServiceId*/, - TCCHSubserviceType /*aSubServiceType*/, - RBuf& /*aBuffer*/ ) const - { - } - - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::ReserveService -// ----------------------------------------------------------------------------- -// -TInt CIcpServiceManager::SetServiceReserved( TBool /*aReserved*/, - TUint /*aServiceId*/, - TCCHSubserviceType /*aSubServiceType*/ ) - { - return KErrNotSupported; - } - - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::GetConnectionParameter -// ----------------------------------------------------------------------------- -// -TInt CIcpServiceManager::GetConnectionParameter(TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TCchConnectionParameter aParameter, - TInt& aValue ) const - { - ICPLOGSTRING3( "CIcpServiceManager::GetConnectionParameter service:%i type:%i", aServiceId, aSubServiceType ); - - __ASSERT_DEBUG( ValidateSubService(aSubServiceType), User::Panic( KNullDesC, KErrNotFound ) ); - __ASSERT_DEBUG( aServiceId > 0, User::Panic( KNullDesC, KErrNotFound ) ); - - TInt error = KErrBadHandle; - - switch( aParameter ) - { - case ECchIapId: - { - aValue = iIapId; - error = KErrNone; - break; - } - case ECchSnapId: - { - aValue = iSnapId; - error = KErrNone; - break; - } - case ECchSnapLocked: - { - aValue = ETrue; - error = KErrNone; - break; - } - case ECchPasswordSet: - { - // dont return ETrue simply, check if password length is greater than 0, - // only then return ETrue, else return EFalse. - TBuf password; - TInt settingsId = KErrNotFound; - TRAPD(err,settingsId = GetSPSettingsIntPropertyL(aServiceId, ESubPropertyIMSettingsId)); - //get the owndata from settingsapi - if(KErrNone == err) - { - TRAP_IGNORE(iXmppParameters->GetParamL((TUint32)settingsId, - XmppParams::KXmppParamPassword(), password )); - } - if( 0 == password.Length()) - { - aValue = EFalse; - } - else - { - aValue = ETrue; - } - break; - } - default : - { - break; - } - - } - - return error; - - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::GetConnectionParameter -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::GetConnectionParameterL(TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TCchConnectionParameter aParameter, - RBuf& aValue ) const - { - - ICPLOGSTRING3( "CIcpServiceManager::GetConnectionParameterL service:%i type:%i", aServiceId, aSubServiceType ); - - __ASSERT_DEBUG( ValidateSubService(aSubServiceType), User::Panic( KNullDesC, KErrNotFound ) ); - __ASSERT_DEBUG( aServiceId > 0, User::Panic( KNullDesC, KErrNotFound ) ); - - TInt error = KErrBadHandle; - switch( aParameter ) - { - case ECchUsername: - { - TInt settingsId = GetSPSettingsIntPropertyL(aServiceId, ESubPropertyIMSettingsId); - TRAP(error,iXmppParameters->GetParamL((TUint32)settingsId, - XmppParams::KXmppParamUsername(), aValue )); - break; - } - case ECchPassword: - { - TInt settingsId = GetSPSettingsIntPropertyL(aServiceId, ESubPropertyIMSettingsId); - //get the owndata from settingsapi - TRAP(error,iXmppParameters->GetParamL((TUint32)settingsId, - XmppParams::KXmppParamPassword(), aValue )); - break; - } - default : - { - break; - } - - } - - } - -// ----------------------------------------------------------------------------- -// CIcpPlugin::SetConnectionParameter -// ----------------------------------------------------------------------------- -// -TInt CIcpServiceManager::SetConnectionParameter( TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TCchConnectionParameter aParameter, - TInt aValue ) - { - - ICPLOGSTRING3( "CIcpServiceManager::SetConnectionParameter service:%i type:%i", aServiceId, aSubServiceType ); - - __ASSERT_DEBUG( ValidateSubService(aSubServiceType), User::Panic( KNullDesC, KErrNotFound ) ); - __ASSERT_DEBUG( aServiceId > 0, User::Panic( KNullDesC, KErrNotFound ) ); - - TInt error = KErrBadHandle; - switch( aParameter ) - { - case ECchIapId: - { - iIapId = aValue ; - error = KErrNone; - break; - } - case ECchSnapId: - { - iSnapId = aValue ; - error = KErrNone; - break; - } - default : - { - break; - } - - } - return error; - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::SetConnectionParameter -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::SetConnectionParameterL(TUint aServiceId, - TCCHSubserviceType aSubServiceType, - TCchConnectionParameter aParameter, - const TDesC& aValue ) - { - - ICPLOGSTRING3( "CIcpServiceManager::SetConnectionParameterL service:%i type:%i", aServiceId, aSubServiceType ); - - __ASSERT_DEBUG( ValidateSubService(aSubServiceType), User::Panic( KNullDesC, KErrNotFound ) ); - __ASSERT_DEBUG( aServiceId > 0, User::Panic( KNullDesC, KErrNotFound ) ); - - switch( aParameter ) - { - case ECchUsername: - { - HBufC* userid = NULL; - TInt settingsId = GetSPSettingsIntPropertyL(aServiceId, ESubPropertyIMSettingsId); - if(KErrNotFound == aValue.Find( KAt() ) ) - { - //ownUserIdPtr.Append(KAt()); - HBufC* domainName = HBufC::NewLC(50); - TPtr domainNamePtr = domainName->Des(); - iXmppParameters->GetParamL((TUint32)settingsId, XmppParams::KXmppParamDomain(), domainNamePtr); - CleanupStack::Pop();//domainName - userid = HBufC::NewLC( aValue.Length() + domainName->Length() + KAt().Length() ); - TPtr useridPtr = userid->Des(); - useridPtr.Append(aValue); - useridPtr.Append(KAt); - useridPtr.Append(domainNamePtr); - delete domainName; - } - else - { - userid = aValue.AllocLC(); - } - TChar at('@'); - TInt loc = userid->Locate( at ); - if ( loc<2 ) - { - // There must be at least @ + something in domain part - User::Leave( KErrArgument ); - } - if(iOwnUserId) - { - delete iOwnUserId; - iOwnUserId = NULL; - } - iOwnUserId = userid->AllocL(); - iXmppParameters->SetParamL((TUint32)settingsId, - XmppParams::KXmppParamUsername(), *userid); - CleanupStack::PopAndDestroy();//userid - break; - } - case ECchPassword: - { - TInt settingsId = GetSPSettingsIntPropertyL(aServiceId, ESubPropertyIMSettingsId); - iXmppParameters->SetParamL((TUint32)settingsId, - XmppParams::KXmppParamPassword(), aValue); - break; - } - default : - { - break; - } - - } - - - } - - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::IsReserved -// ----------------------------------------------------------------------------- -// -TInt CIcpServiceManager::IsReserved( TUint aServiceId, - TCCHSubserviceType aSubServiceType ) const - { - ICPLOGSTRING3( "CIcpServiceManager::IsReserved service: %d type: %d", - aServiceId, aSubServiceType ); - - TBool result = EFalse; - - return result; - } - - - -// ----------------------------------------------------------------------------- -// CIcpServiceManager:: -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::BindL(TInt aServiceSettingId) - { - ICPLOGSTRING2( "CIcpServiceManager[0x%x]::BindL", this ); - //TUid protocolUid = TUid::Uid( KProtocolUid ); - TInt propertyId = GetSPSettingsIntPropertyL( aServiceSettingId, EPropertyPCSPluginId ); - - if ( KErrNotFound != propertyId ) - { - TUid protocolUid = TUid::Uid( propertyId ); - - TXIMPRequestId reqId = iPresenceCtx->BindToL( protocolUid, - aServiceSettingId ); - CreateRequestL(reqId, TIMConnProviderEnums::ELoginRequest); - - } - - ICPLOGSTRING( "CIcpServiceManager::BindL end" ); - } - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::UnBindL -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::UnBindL() - { - ICPLOGSTRING2( "CIcpServiceManager[0x%x]::UnBindL", this ); - - TXIMPRequestId reqId = iPresenceCtx->UnbindL(); - - CreateRequestL(reqId, TIMConnProviderEnums::ELogoutRequest); - - ICPLOGSTRING( "CIcpServiceManager::UnBindL end" ); - } - - -// ----------------------------------------------------------------------------- -// CIcpServiceManager::ProfileEventOccurred -// ----------------------------------------------------------------------------- -// -void CIcpServiceManager::HandlePresenceContextEvent( const MXIMPContext& /* aContext */, - const MXIMPBase& aEvent ) - { - ICPLOGSTRING2( "CIcpServiceManager[0x%x]::HandlePresenceContextEvent", this ); - - const TInt32 eventType = aEvent.GetInterfaceId(); - - switch( eventType ) - { - case MXIMPRequestCompleteEvent::KInterfaceId: - { - ICPLOGSTRING( "::HandlePresenceContextEvent event MximpRequestCompleteEvent start" ); - const MXIMPRequestCompleteEvent* event = - TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( aEvent, MXIMPBase::EPanicIfUnknown ); - - TXIMPRequestId reqId = event->RequestId(); - - const MXIMPStatus& status = event->CompletionResult(); - - TInt err = status.ResultCode(); - - CICPServiceRequest *req = FindRequestId( reqId ); - - if( req->RequestType() == TIMConnProviderEnums::ELoginRequest ) - { - if(KErrNone == err ) - { - //login successfull - ICPLOGSTRING( "CIcpServiceManager::HandlePresenceContextEvent event bind complete" ); - - iOngoingState = ECCHEnabled; - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHPresenceSub ), - ECCHEnabled, err ); - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHIMSub ), - ECCHEnabled, err ); - - - // create the imcache session ,since now ready to recieve message - if(!iIMCacheFactory) - { - - TRAP_IGNORE( - iIMCacheFactory = CIMCacheFactory::InstanceL() ; - iIMCacheUpdater = iIMCacheFactory->CreateUpdaterL(iServiceId, iOwnUserId->Des() ,EFalse) ; - ); - } - - } - else - { - TRAP_IGNORE( SetIMDisabledL(iServiceId) ); - - TInt cchErr = ConvertXIMPErrToCChErr(err); - iLastReportedError = cchErr; - //login unsuccessfull - ICPLOGSTRING( "CIcpServiceManager::HandlePresenceContextEvent event bind complete" ); - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHPresenceSub ), - ECCHDisabled, cchErr ); - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHIMSub ), - ECCHDisabled, cchErr ); - - iOngoingState = ECCHDisabled; - ICPLOGSTRING2( "CIcpServiceManager::HandlePresenceContextEvent err = %d",err); - - - } - - } - else if( req->RequestType() == TIMConnProviderEnums::ELogoutRequest ) - { - //Logout is successfull - ICPLOGSTRING( "CIcpServiceManager::HandlePresenceContextEvent status offline" ); - - - - // release the imcache, all the conversation will lost here - if( iIMCacheFactory ) - { - CIMCacheFactory::Release(); - iIMCacheFactory = NULL; // make sure factory is deleted - iIMCacheUpdater = NULL; - } - - // set the status into cenrep - - ICPLOGSTRING( "CIcpServiceManager::HandlePresenceContextEvent status offline end" ); - } - - ICPLOGSTRING( "CIcpServiceManager::HandlePresenceContextEvent offline end 2" ); - - req->StopWait() ; - RemoveRequestId(reqId); - delete req; - - break; - } - - case MXIMPContextStateEvent::KInterfaceId: - { - ICPLOGSTRING( "::HandlePresenceContextEvent event MXIMPContextStateEvent start" ); - // what do we do with context state event - // state of the context can be associated with the - const MXIMPContextStateEvent* ctxtStateEvent = - TXIMPGetInterface< const MXIMPContextStateEvent >::From( aEvent, - MXIMPBase::EPanicIfUnknown ); - const MXIMPStatus* fwStatus = ctxtStateEvent->StateChangeReason(); - const MXIMPContextState& cState = ctxtStateEvent->ContextState(); - MXIMPContextState::TState state = cState.ContextState(); - - if (MXIMPContextState::EBinding == state) - { - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHPresenceSub ), - ECCHConnecting, KErrNone ); - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHIMSub ), - ECCHConnecting, KErrNone ); - } - else if (MXIMPContextState::EUnbinding == state) - { - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHPresenceSub ), - ECCHDisconnecting, KErrNone ); - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHIMSub ), - ECCHDisconnecting, KErrNone ); - } - else if (MXIMPContextState::EInactive == state ) - { - // release the imcache, all the conversation will lost here - CIMCacheFactory::Release(); - iIMCacheFactory = NULL; // make sure factory is deleted - iIMCacheUpdater = NULL; - iOngoingState = ECCHDisabled; - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHPresenceSub ), - ECCHDisabled, KErrNone ); - - iServiceObserver.ServiceStateChanged( TServiceSelection( iServiceId, ECCHIMSub ), - ECCHDisabled, KErrNone ); - - } - - break; - } - - case MImConversationEvent::KInterfaceId: - { - ICPLOGSTRING( "CIcpServiceManager::HandlePresenceContextEvent new message recieved star" ); - const MImConversationEvent* convEvent = - TXIMPGetInterface< const MImConversationEvent >::From - (aEvent, MXIMPBase::EPanicIfUnknown); - if( iIMCacheUpdater ) - { - TInt count = convEvent->NewTextMessageCount(); - const MImConversationInfo& convInfo = convEvent->NewTextMessage(0); - const MXIMPIdentity& identity = convInfo.MessageId(); - const TDesC16& msgText = convInfo.TextMessage(); - ICPLOGSTRING2( "msg txt: %S", &msgText ); - TInt len = msgText.Length(); - HBufC* bigmsg = NULL; - TRAP_IGNORE( bigmsg = HBufC::NewL(KReceiveMsgMaxLength + 1) ; // 1 for % - if( bigmsg ) - { - CleanupStack::PushL(bigmsg) ; // bigmsg - TPtr bigmsgPtr = bigmsg->Des(); - //If message is more than 400 character take only first 400 character - //Rest of the message will be lost and - bigmsgPtr.Append( msgText.Left( KReceiveMsgMaxLength ) ); - if( len > KReceiveMsgMaxLength) - { - //append % as 401st character to identify on UI that it is a - //long message which is truncated - bigmsgPtr.Append(KPercentage); - } - TPtrC buddyId = identity.Identity(); - iIMCacheUpdater->AppendReceiveMessageL( buddyId, bigmsgPtr ) ; - ICPLOGSTRING( "CIcpServiceManager::HandlePresenceContextEvent Cache updated" ); - CleanupStack::PopAndDestroy(bigmsg); // bigmsg - } ); //End TRAP_IGNORE( bigmsg ... - } - ICPLOGSTRING( "CIcpServiceManager::HandlePresenceContextEvent new message recieved end" ); - break; - } - - - default: - { - break; - } - } - ICPLOGSTRING( "CIcpServiceManager::HandlePresenceContextEvent end" ); - } - - -// --------------------------------------------------------- -// CIcpServiceManager::FindRequestId -// -// --------------------------------------------------------- -CICPServiceRequest* CIcpServiceManager::CreateRequestL(TXIMPRequestId& aRequestId, - TIMConnProviderEnums::TRequestTypes aType ) - { - - CICPServiceRequest* req = CICPServiceRequest::NewL(aRequestId, aType); - CleanupStack::PushL(req); - - TInt status( iReqIDArray.Append( req ) ); - User::LeaveIfError( status ); - - CleanupStack::Pop(req); - - return req; - } - - -// --------------------------------------------------------- -// CIcpServiceManager::FindRequestId -// -// --------------------------------------------------------- -CICPServiceRequest* CIcpServiceManager::FindRequestId(TXIMPRequestId& aRequestId ) - { - TInt count = iReqIDArray.Count() ; - TXIMPRequestId reqId ; - CICPServiceRequest *req = NULL; - for (TInt i=0; i < count; i++) - { - req = iReqIDArray[i] ; - - reqId = req->GetRequestId() ; - - if( aRequestId == reqId ) - { - break ; - } - } - return req ; - } - -// --------------------------------------------------------- -// CIcpServiceManager::RemoveRequestId -// -// --------------------------------------------------------- -CICPServiceRequest* CIcpServiceManager::RemoveRequestId(TXIMPRequestId& aRequestId ) - { - TInt count = iReqIDArray.Count() ; - CICPServiceRequest *req = NULL; - for (TInt i=0; i < count; i++) - { - req = iReqIDArray[i] ; - if(req->GetRequestId() == aRequestId) - { - iReqIDArray.Remove( i ); - iReqIDArray.Compress(); - break ; - } - } - return req ; - } - - -// --------------------------------------------------------------------------- -// CIcpServiceManager::SetIMDisabledL -// --------------------------------------------------------------------------- -// -void CIcpServiceManager::SetIMDisabledL( - TUint32 aServiceId) - { - ICPLOGSTRING2( "CIcpServiceManager::SetIMDisabledL serviceId = %d",aServiceId); - - - { - //Disable IM Subservice - TSPItemType propertyType( EItemTypeIMSubProperty ); - TServicePropertyName propertyName( ESubPropertyIMEnabled ); - RPropertyArray subproperties; - CleanupClosePushL( subproperties ); - - // Find correct subservice - TInt err( iCSPSetting->FindSubServicePropertiesL( - aServiceId, propertyType, subproperties ) ); - - for ( TInt i( 0 ); i < subproperties.Count(); i++ ) - { - // Read subservice's On/Off information - if ( propertyName == subproperties[ i ]->GetName() ) - { - TOnOff onOff( EOff ); - ICPLOGSTRING2( "CIcpServiceManager::SetIMDisabledL subproperties[ i ]->SetValue err = %d",err); - subproperties[ i ]->SetValue( onOff ); - i = subproperties.Count(); - } - } - iCSPSetting->AddOrUpdatePropertiesL( aServiceId, subproperties ) ; - subproperties.ResetAndDestroy( ); - CleanupStack::PopAndDestroy( &subproperties ); - } - - { - TSPItemType propertyType( EItemTypePresenceSubProperty ); - TServicePropertyName propertyName( ESubPropertyPresenceEnabled ); - RPropertyArray subproperties; - CleanupClosePushL( subproperties ); - - // Find correct subservice - TInt err( iCSPSetting->FindSubServicePropertiesL( - aServiceId, propertyType, subproperties ) ); - - for ( TInt i( 0 ); i < subproperties.Count(); i++ ) - { - // Read subservice's On/Off information - if ( propertyName == subproperties[ i ]->GetName() ) - { - TOnOff onOff( EOff ); - ICPLOGSTRING2( "CIcpServiceManager::SetIMDisabledL subproperties[ i ]->SetValue err = %d",err); - subproperties[ i ]->SetValue( onOff ); - i = subproperties.Count(); - } - } - iCSPSetting->AddOrUpdatePropertiesL( aServiceId, subproperties ) ; - subproperties.ResetAndDestroy( ); - CleanupStack::PopAndDestroy( &subproperties ); - } - - - } - - -// --------------------------------------------------------------------------- -// CIcpServiceManager::ValidateServiceL -// --------------------------------------------------------------------------- -// -TBool CIcpServiceManager::ValidateServiceL( TUint32 aServiceId ) const - { - - TInt presenceSettingsId = GetSPSettingsIntPropertyL(aServiceId, ESubPropertyPresenceSettingsId); - TInt imSettingsId = GetSPSettingsIntPropertyL(aServiceId, ESubPropertyIMSettingsId); - - if ( (KErrNotFound != presenceSettingsId) && (presenceSettingsId == imSettingsId) ) - { - return ETrue; - } - - return EFalse; - } - -// --------------------------------------------------------------------------- -// CIcpServiceManager::GetSPSettingsIntPropertyL -// --------------------------------------------------------------------------- -// -TInt CIcpServiceManager::GetSPSettingsIntPropertyL( TUint32 aServiceId, - TServicePropertyName aPropertyName ) const - { - TInt tIntProperty = KErrNotFound; - - CSPProperty* property = CSPProperty::NewLC(); - - iCSPSetting->FindPropertyL( aServiceId, - aPropertyName, - *property ); - - if ( property ) - { - property->GetValue( tIntProperty ); - } - CleanupStack::PopAndDestroy( property ); - - return tIntProperty; - } - -// --------------------------------------------------------------------------- -// CIcpServiceManager::ValidateServiceL -// --------------------------------------------------------------------------- -// -TBool CIcpServiceManager::ValidateSubService( TCCHSubserviceType aSubServiceType ) const - { - if ( (ECCHUnknown == aSubServiceType) || - (ECCHPresenceSub == aSubServiceType) || - (ECCHIMSub == aSubServiceType) ) - { - return ETrue; - } - return EFalse; - } - - -// --------------------------------------------------------------------------- -// CIcpServiceManager::GetServiceNameL() -// --------------------------------------------------------------------------- -// -void CIcpServiceManager::GetServiceNameL( TUint32 aServiceId, TDes& aServiceName ) - { - - CSPEntry* entry = CSPEntry::NewLC(); - TRAPD( err, iCSPSetting->FindEntryL( aServiceId, *entry ) ); - if ( !err ) - { - aServiceName = entry->GetServiceName(); - } - - CleanupStack::PopAndDestroy( entry ); - - } - - -// --------------------------------------------------------------------------- -// CIcpServiceManager::ConvertXIMPErrToCChErr() -// --------------------------------------------------------------------------- -// -TInt CIcpServiceManager::ConvertXIMPErrToCChErr(const TInt aXimpErr) - { - - TInt returnValue (KErrNone); - - switch (aXimpErr) - { - case KXIMPErrServiceGeneralError: - case KXIMPErrServiceShutdown: - case KXIMPErrServiceRequestTypeNotSupported: - { - returnValue = KCCHErrorLoginFailed; - break; - } - - case KXIMPErrServiceAuthenticationFailed: - { - returnValue = KCCHErrorAuthenticationFailed; - break; - } - - default: - { - break; - } - } - - return returnValue; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/src/cicpservicerequest.cpp --- a/imstutils/imconnectionprovider/src/cicpservicerequest.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation of single request to fw -* -*/ - -// INCLUDE FILES -#include "cicpservicerequest.h" - -#include -#include - -// --------------------------------------------------------- -// CICPServiceRequest::two phase construction -// --------------------------------------------------------- - -CICPServiceRequest* CICPServiceRequest::NewL(TXIMPRequestId& aRequestId, - TIMConnProviderEnums::TRequestTypes aType) - { - CICPServiceRequest* self = CICPServiceRequest::NewLC(aRequestId, aType); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CICPServiceRequest::two phase construction -// --------------------------------------------------------- -CICPServiceRequest* CICPServiceRequest::NewLC(TXIMPRequestId& aRequestId, - TIMConnProviderEnums::TRequestTypes aType) - { - CICPServiceRequest* self = new (ELeave) CICPServiceRequest(aRequestId, aType); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// --------------------------------------------------------- -// CICPServiceRequest::~CICPServiceRequest -// -// --------------------------------------------------------- -CICPServiceRequest::~CICPServiceRequest() - { - - } - -// --------------------------------------------------------- -// CICPServiceRequest::ConstructL -// -// --------------------------------------------------------- -void CICPServiceRequest::ConstructL() - { - - } - -// --------------------------------------------------------- -// CICPServiceRequest::CICPServiceRequest -// -// --------------------------------------------------------- -CICPServiceRequest::CICPServiceRequest(TXIMPRequestId& aRequestId, - TIMConnProviderEnums::TRequestTypes aType): -iRequestId(aRequestId), -iReqType(aType) - { - - } - -// --------------------------------------------------------- -// CICPServiceRequest::StartWait -// -// --------------------------------------------------------- -void CICPServiceRequest::StartWait() - { - if( ! iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // CActiveSchedulerWait. - iWait.Start(); - } - - } - -// --------------------------------------------------------- -// CICPServiceRequest::StopWait -// -// --------------------------------------------------------- -void CICPServiceRequest::StopWait() - { - if(iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - } - -// --------------------------------------------------------- -// CICPServiceRequest::GetRequestId -// -// --------------------------------------------------------- -const TXIMPRequestId& CICPServiceRequest::GetRequestId() const - { - return iRequestId ; - } - -// --------------------------------------------------------- -// CICPServiceRequest::IsWaitStarted -// -// --------------------------------------------------------- -TBool CICPServiceRequest::IsWaitStarted() - { - return iWait.IsStarted() ; - } - - -// --------------------------------------------------------- -// CICPServiceRequest::SetRequestType -// -// --------------------------------------------------------- -void CICPServiceRequest::SetRequestType(TIMConnProviderEnums::TRequestTypes aType) - { - iReqType = aType ; - } - - -// --------------------------------------------------------- -// CICPServiceRequest::RequestType -// -// --------------------------------------------------------- -TIMConnProviderEnums::TRequestTypes CICPServiceRequest::RequestType() const - { - return iReqType ; - } -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/bmarm/imconnectionprovider_testu.def --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/bmarm/imconnectionprovider_testu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/bwins/imconnectionprovider_testu.def --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/bwins/imconnectionprovider_testu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - ?GetParamL@CXmppSettingsApi@@QAEXKABVTDesC16@@AAH@Z @ 2 NONAME ; void CXmppSettingsApi::GetParamL(unsigned long, class TDesC16 const &, int &) - ?FindSubServicePropertiesL@CSPSettings@@QAEHIW4TSPItemType@@AAV?$RPointerArray@VCSPProperty@@@@@Z @ 3 NONAME ; int CSPSettings::FindSubServicePropertiesL(unsigned int, enum TSPItemType, class RPointerArray &) - ?SettingsCountL@CSPSettings@@QAEHXZ @ 4 NONAME ; int CSPSettings::SettingsCountL(void) - ?GetValue@CSPProperty@@QBEHAAW4TOnOff@@@Z @ 5 NONAME ; int CSPProperty::GetValue(enum TOnOff &) const - ?FindServiceIdsL@CSPSettings@@QAEHAAV?$RArray@I@@@Z @ 6 NONAME ; int CSPSettings::FindServiceIdsL(class RArray &) - ?AddOrUpdatePropertiesL@CSPSettings@@QAEHIABV?$RPointerArray@VCSPProperty@@@@@Z @ 7 NONAME ; int CSPSettings::AddOrUpdatePropertiesL(unsigned int, class RPointerArray const &) - ?UpdateProperty@CSPEntry@@QAEHW4TServicePropertyName@@ABVTDesC16@@@Z @ 8 NONAME ; int CSPEntry::UpdateProperty(enum TServicePropertyName, class TDesC16 const &) - ?NewLC@CSPProperty@@SAPAV1@XZ @ 9 NONAME ; class CSPProperty * CSPProperty::NewLC(void) - ?DefaultSettingsRecordL@CXmppSettingsApi@@QAEXAAK@Z @ 10 NONAME ; void CXmppSettingsApi::DefaultSettingsRecordL(unsigned long &) - ?PropertyType@CSPProperty@@SA?AW4TSPItemType@@W4TServicePropertyName@@@Z @ 11 NONAME ; enum TSPItemType CSPProperty::PropertyType(enum TServicePropertyName) - ?GetParamL@CXmppSettingsApi@@QAEXKABVTDesC16@@AAVTDes16@@@Z @ 12 NONAME ; void CXmppSettingsApi::GetParamL(unsigned long, class TDesC16 const &, class TDes16 &) - ?GetAllProperties@CSPEntry@@QBEABV?$RPointerArray@VCSPProperty@@@@XZ @ 13 NONAME ; class RPointerArray const & CSPEntry::GetAllProperties(void) const - ?Set@RProperty@@SAHVTUid@@IH@Z @ 14 NONAME ; int RProperty::Set(class TUid, unsigned int, int) - ?SetServiceName@CSPEntry@@QAEHABVTDesC16@@@Z @ 15 NONAME ; int CSPEntry::SetServiceName(class TDesC16 const &) - ?FindEntryL@CSPSettings@@QAEHIAAVCSPEntry@@@Z @ 16 NONAME ; int CSPSettings::FindEntryL(unsigned int, class CSPEntry &) - ?GetPropertyType@CSPProperty@@QBE?AW4TSPItemType@@XZ @ 17 NONAME ; enum TSPItemType CSPProperty::GetPropertyType(void) const - ?GetServiceName@CSPEntry@@QBEABVTDesC16@@XZ @ 18 NONAME ; class TDesC16 const & CSPEntry::GetServiceName(void) const - ?UpdateProperty@CSPEntry@@QAEHW4TServicePropertyName@@W4TOnOff@@@Z @ 19 NONAME ; int CSPEntry::UpdateProperty(enum TServicePropertyName, enum TOnOff) - ?SetValue@CSPProperty@@QAEHH@Z @ 20 NONAME ; int CSPProperty::SetValue(int) - ?GetProperty@CSPEntry@@QBEHAAPBVCSPProperty@@H@Z @ 21 NONAME ; int CSPEntry::GetProperty(class CSPProperty const * &, int) const - ?RemoveParamL@CXmppSettingsApi@@QAEXKABVTDesC16@@@Z @ 22 NONAME ; void CXmppSettingsApi::RemoveParamL(unsigned long, class TDesC16 const &) - ?AddPropertyL@CSPEntry@@QAEHABVCSPProperty@@@Z @ 23 NONAME ; int CSPEntry::AddPropertyL(class CSPProperty const &) - ?Attach@RProperty@@QAEHVTUid@@IW4TOwnerType@@@Z @ 24 NONAME ; int RProperty::Attach(class TUid, unsigned int, enum TOwnerType) - ?PropertyCount@CSPEntry@@QBEHXZ @ 25 NONAME ; int CSPEntry::PropertyCount(void) const - ?DeleteProperty@CSPEntry@@QAEHH@Z @ 26 NONAME ; int CSPEntry::DeleteProperty(int) - ?GetValue@CSPProperty@@QBEHAAH@Z @ 27 NONAME ; int CSPProperty::GetValue(int &) const - ?Get@RProperty@@QAEHAAH@Z @ 28 NONAME ; int RProperty::Get(int &) - ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 29 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) - ?FindPropertyL@CSPSettings@@QAEHIW4TServicePropertyName@@AAVCSPProperty@@@Z @ 30 NONAME ; int CSPSettings::FindPropertyL(unsigned int, enum TServicePropertyName, class CSPProperty &) - ??1CSPProperty@@UAE@XZ @ 31 NONAME ; CSPProperty::~CSPProperty(void) - ?SetValue@CSPProperty@@QAEHABVTDesC16@@@Z @ 32 NONAME ; int CSPProperty::SetValue(class TDesC16 const &) - ?NewL@CSPSettings@@SAPAV1@XZ @ 33 NONAME ; class CSPSettings * CSPSettings::NewL(void) - ?GetRepositoryKeyL@CXmppSettingsApi@@QAEXKABVTDesC16@@HAAK@Z @ 34 NONAME ; void CXmppSettingsApi::GetRepositoryKeyL(unsigned long, class TDesC16 const &, int, unsigned long &) - ?Cancel@RProperty@@QAEXXZ @ 35 NONAME ; void RProperty::Cancel(void) - ?UpdateEntryL@CSPSettings@@QAEHABVCSPEntry@@@Z @ 36 NONAME ; int CSPSettings::UpdateEntryL(class CSPEntry const &) - ?SetName@CSPProperty@@QAEHW4TServicePropertyName@@@Z @ 37 NONAME ; int CSPProperty::SetName(enum TServicePropertyName) - ?UpdateProperty@CSPEntry@@QAEHW4TServicePropertyName@@H@Z @ 38 NONAME ; int CSPEntry::UpdateProperty(enum TServicePropertyName, int) - ?NewL@CSPProperty@@SAPAV1@XZ @ 39 NONAME ; class CSPProperty * CSPProperty::NewL(void) - ?GetServiceId@CSPEntry@@QBEIXZ @ 40 NONAME ; unsigned int CSPEntry::GetServiceId(void) const - ?DataType@CSPProperty@@SA?AW4TPropertyDataType@@W4TServicePropertyName@@@Z @ 41 NONAME ; enum TPropertyDataType CSPProperty::DataType(enum TServicePropertyName) - ?NewLC@CSPEntry@@SAPAV1@XZ @ 42 NONAME ; class CSPEntry * CSPEntry::NewLC(void) - ?GetDataType@CSPProperty@@QBE?AW4TPropertyDataType@@XZ @ 43 NONAME ; enum TPropertyDataType CSPProperty::GetDataType(void) const - ?Get@RProperty@@SAHVTUid@@IAAH@Z @ 44 NONAME ; int RProperty::Get(class TUid, unsigned int, int &) - ??8CSPProperty@@QBEHABV0@@Z @ 45 NONAME ; int CSPProperty::operator==(class CSPProperty const &) const - ?Subscribe@RProperty@@QAEXAAVTRequestStatus@@@Z @ 46 NONAME ; void RProperty::Subscribe(class TRequestStatus &) - ??1CSPSettings@@UAE@XZ @ 47 NONAME ; CSPSettings::~CSPSettings(void) - ?SetValue@CSPProperty@@QAEHW4TOnOff@@@Z @ 48 NONAME ; int CSPProperty::SetValue(enum TOnOff) - ?SetParamL@CXmppSettingsApi@@QAEXKABVTDesC16@@0@Z @ 49 NONAME ; void CXmppSettingsApi::SetParamL(unsigned long, class TDesC16 const &, class TDesC16 const &) - ??1CSPEntry@@UAE@XZ @ 50 NONAME ; CSPEntry::~CSPEntry(void) - ?NewL@CSPEntry@@SAPAV1@XZ @ 51 NONAME ; class CSPEntry * CSPEntry::NewL(void) - ?CreateSettingsRecordL@CXmppSettingsApi@@QAEXAAK@Z @ 52 NONAME ; void CXmppSettingsApi::CreateSettingsRecordL(unsigned long &) - ?AddOrUpdatePropertyL@CSPSettings@@QAEHIABVCSPProperty@@@Z @ 53 NONAME ; int CSPSettings::AddOrUpdatePropertyL(unsigned int, class CSPProperty const &) - ?Close@RHandleBase@@QAEXXZ @ 54 NONAME ; void RHandleBase::Close(void) - ?RemoveSettingsRecordL@CXmppSettingsApi@@QAEXK@Z @ 55 NONAME ; void CXmppSettingsApi::RemoveSettingsRecordL(unsigned long) - ?DeleteProperty@CSPEntry@@QAEHW4TServicePropertyName@@@Z @ 56 NONAME ; int CSPEntry::DeleteProperty(enum TServicePropertyName) - ?SetParamL@CXmppSettingsApi@@QAEXKABVTDesC16@@H@Z @ 57 NONAME ; void CXmppSettingsApi::SetParamL(unsigned long, class TDesC16 const &, int) - ?AddEntryL@CSPSettings@@QAEHAAVCSPEntry@@@Z @ 58 NONAME ; int CSPSettings::AddEntryL(class CSPEntry &) - ?GetProperty@CSPEntry@@QBEHAAPBVCSPProperty@@W4TServicePropertyName@@@Z @ 59 NONAME ; int CSPEntry::GetProperty(class CSPProperty const * &, enum TServicePropertyName) const - ?GetSettingsRecordIdArrayL@CXmppSettingsApi@@QAEXAAV?$RArray@K@@@Z @ 60 NONAME ; void CXmppSettingsApi::GetSettingsRecordIdArrayL(class RArray &) - ?Define@RProperty@@SAHVTUid@@IHH@Z @ 61 NONAME ; int RProperty::Define(class TUid, unsigned int, int, int) - ?CopyL@CSPProperty@@QAEXABV1@@Z @ 62 NONAME ; void CSPProperty::CopyL(class CSPProperty const &) - ?GetName@CSPProperty@@QBE?AW4TServicePropertyName@@XZ @ 63 NONAME ; enum TServicePropertyName CSPProperty::GetName(void) const - ?GetValue@CSPProperty@@QBEHAAVTDes16@@@Z @ 64 NONAME ; int CSPProperty::GetValue(class TDes16 &) const - ?NewLC@CSPSettings@@SAPAV1@XZ @ 65 NONAME ; class CSPSettings * CSPSettings::NewLC(void) - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/conf/imconnectionprovider_test.cfg --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/conf/imconnectionprovider_test.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -[Test] -title T_EnableServiceL -create imconnectionprovider_test foobar -foobar T_EnableServiceL pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_DisableServiceL -create imconnectionprovider_test foobar -foobar T_EnableServiceL pa ra me ters -delete foobar -[Endtest] - - -[Test] -title T_SetIMDisabledL -create imconnectionprovider_test foobar -foobar T_SetIMDisabledL pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_FindRequestId -create imconnectionprovider_test foobar -foobar T_FindRequestId pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_RemoveRequestId -create imconnectionprovider_test foobar -foobar T_RemoveRequestId pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_UnBindL -create imconnectionprovider_test foobar -foobar T_UnBindL pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_BindL -create imconnectionprovider_test foobar -foobar T_BindL pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_IsReserved -create imconnectionprovider_test foobar -foobar T_IsReserved pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_SetConnectionParameter -create imconnectionprovider_test foobar -foobar T_SetConnectionParameter pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_GetConnectionParameter -create imconnectionprovider_test foobar -foobar T_GetConnectionParameter pa ra me ters -delete foobar -[Endtest] - - -[Test] -title T_ValidateServiceL -create imconnectionprovider_test foobar -foobar T_ValidateServiceL pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_ValidateSubService -create imconnectionprovider_test foobar -foobar T_ValidateSubService pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_GetServiceNameL -create imconnectionprovider_test foobar -foobar T_GetServiceNameL pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_ConvertXIMPErrToCChErr -create imconnectionprovider_test foobar -foobar T_ConvertXIMPErrToCChErr pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_GetSPSettingsIntPropertyL -create imconnectionprovider_test foobar -foobar T_GetSPSettingsIntPropertyL pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_GetServiceNetworkInfo_passwordExistL -create imconnectionprovider_test foobar -foobar T_GetServiceNetworkInfo_passwordExistL pa ra me ters -delete foobar -[Endtest] - -[Test] -title T_GetServiceNetworkInfo_emptypasswordL -create imconnectionprovider_test foobar -foobar T_GetServiceNetworkInfo_emptypasswordL pa ra me ters -delete foobar -[Endtest] - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/eabi/imconnectionprovider_testu.def --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/eabi/imconnectionprovider_testu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - _Z24ImplementationGroupProxyRi @ 2 NONAME - _ZTI10CIcpPlugin @ 3 NONAME ; ## - _ZTI15MXIMPClientStub @ 4 NONAME ; ## - _ZTI16CXmppSettingsApi @ 5 NONAME ; ## - _ZTI16MSearchEventStub @ 6 NONAME ; ## - _ZTI16MXIMPContextStub @ 7 NONAME ; ## - _ZTI18CICPServiceRequest @ 8 NONAME ; ## - _ZTI18CIcpServiceManager @ 9 NONAME ; ## - _ZTI19MyMXIMPIdentityStub @ 10 NONAME ; ## - _ZTI20MSearchKeysEventStub @ 11 NONAME ; ## - _ZTI24MyMXIMPObjectFactoryStub @ 12 NONAME ; ## - _ZTI26MXIMPContextStateEventStub @ 13 NONAME ; ## - _ZTI28MPresentityPresenceEventStub @ 14 NONAME ; ## - _ZTI29MXIMPRequestCompleteEventStub @ 15 NONAME ; ## - _ZTI32MPresentityGroupContentEventStub @ 16 NONAME ; ## - _ZTV10CIcpPlugin @ 17 NONAME ; ## - _ZTV15MXIMPClientStub @ 18 NONAME ; ## - _ZTV16CXmppSettingsApi @ 19 NONAME ; ## - _ZTV16MSearchEventStub @ 20 NONAME ; ## - _ZTV16MXIMPContextStub @ 21 NONAME ; ## - _ZTV18CICPServiceRequest @ 22 NONAME ; ## - _ZTV18CIcpServiceManager @ 23 NONAME ; ## - _ZTV19MyMXIMPIdentityStub @ 24 NONAME ; ## - _ZTV20MSearchKeysEventStub @ 25 NONAME ; ## - _ZTV24MyMXIMPObjectFactoryStub @ 26 NONAME ; ## - _ZTV26MXIMPContextStateEventStub @ 27 NONAME ; ## - _ZTV28MPresentityPresenceEventStub @ 28 NONAME ; ## - _ZTV29MXIMPRequestCompleteEventStub @ 29 NONAME ; ## - _ZTV32MPresentityGroupContentEventStub @ 30 NONAME ; ## - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/group/bld.inf --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: bld.inf -* -*/ - - - - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these -DEFAULT - -PRJ_TESTEXPORTS -// NOTE: If using ARS requirements all export operations should be done under this. -// 'abld test export' -../init/TestFramework.ini /epoc32/winscw/c/TestFramework/TestFramework.ini -../conf/imconnectionprovider_test.cfg /epoc32/winscw/c/TestFramework/imconnectionprovider_test.cfg - -PRJ_EXPORTS - -// Specify the source file followed by its destination here -// copy will be used to copy the source file to its destination -// If there's no destination then the source file will be copied -// to the same name in /epoc32/include -// Example: - - - -PRJ_TESTMMPFILES -// NOTE: If using ARS requirements .mmp file operation should be done under this. -// 'abld test build' -imconnectionprovider_test.mmp -PRJ_MMPFILES -// Specify the .mmp files required for building the important component -// releasables. -// -// Specify "tidy" if the component you need to build doesn't need to be -// released. Specify "ignore" if the MMP file exists but should be -// ignored. -// Example: - - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/group/imconnectionprovider_test.mmp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/group/imconnectionprovider_test.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imconnectionprovider_test.mmp -* -*/ - - -#include -#include - -TARGET imconnectionprovider_test.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -EPOCALLOWDLLDATA - -CAPABILITY ALL -TCB - -//DEFFILE imconnectionprovider_test.def - -SOURCEPATH ../src -OS_LAYER_LIBC_SYSTEMINCLUDE -SOURCE imconnectionprovider_test.cpp -SOURCE imconnectionprovider_testBlocks.cpp -SOURCE ../../../src/cicpservicemanager.cpp -SOURCE ../../../src/cicpplugin.cpp -SOURCE ../../../src/cicpservicerequest.cpp - -SOURCE stubs/s_rproperty.cpp -SOURCE stubs/s_spentry.cpp -SOURCE stubs/s_spproperty.cpp -SOURCE stubs/s_spsettings.cpp -SOURCE stubs/s_ximpcontext.cpp -SOURCE stubs/s_ximpobjectfactory.cpp -SOURCE stubs/s_xmppsettingsapi.cpp -SOURCE stubs/s_ximpclient.cpp -SOURCE stubs/s_ximpcontextstateevent.cpp -SOURCE stubs/s_ximpidentity.cpp -SOURCE stubs/s_ximppresensitygroupcontentevent.cpp -SOURCE stubs/s_ximppresensitypresenceevent.cpp -SOURCE stubs/s_ximprequestcompleteevent.cpp -SOURCE stubs/s_ximpsearchevent.cpp -SOURCE stubs/s_ximpsearchkeysevent.cpp - -//SOURCE stubs/s_ecom.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../../inc -USERINCLUDE ../src/stubs - -SYSTEMINCLUDE /epoc32/include -//SYSTEMINCLUDE /epoc32/include/internal -SYSTEMINCLUDE /epoc32/include/ecom -//SYSTEMINCLUDE /epoc32/include/stdapis - -MACRO SCP_LOGGING_0 - -MW_LAYER_SYSTEMINCLUDE -APP_LAYER_SYSTEMINCLUDE - -//RESOURCE resource_file -//RESOURCE resource_file2 - - - -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -LIBRARY euser.lib -LIBRARY ecom.lib -//LIBRARY serviceprovidersettings.lib -LIBRARY flogger.lib - - -LIBRARY apgrfx.lib -LIBRARY ws32.lib -LIBRARY efsrv.lib - -//imcache client -LIBRARY imcacheclient.lib - -LIBRARY presencecacheclient2.lib -LIBRARY presencecacheutils.lib - -// xmpp settings -//LIBRARY jabbersettings.lib - -//LIBRARY imconnectionprovider.lib - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/group/imconnectionprovider_test.pkg --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/group/imconnectionprovider_test.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -; -; 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: imconnectionprovider_test.pkg -; -;Header -#{"imconnectionprovider_test"}, (0x101FB3E3), 1, 2, 3, TYPE=SP - -;Language - standard language definitions -&EN - -;Vendor ID -:"Nokia Corporation" - -;Localised vendor -%{"Vendor-EN"} - -;Supports Series 60 v 0.9 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - - -;INI FILE -; ttestframework , because rom will not allow to update , rename it -; after install to testframework.ini - -"..\init\testframework.ini" - "c:\Testframework\testframework.ini" - -;CFG FILES - "..\conf\imconnectionprovider_test.cfg"-"c:\Testframework\imconnectionprovider_test.cfg" - - -;imconnectionprovider_test dll files - "\epoc32\release\armv5\urel\imconnectionprovider_test.dll"-"!:\Sys\Bin\imconnectionprovider_test.dll" - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/inc/imconnectionprovider_test.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/inc/imconnectionprovider_test.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,258 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imconnectionprovider_test.h -* -*/ - - - -#ifndef IMCONNECTIONPROVIDER_TEST_H -#define IMCONNECTIONPROVIDER_TEST_H - -// INCLUDES -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "s_ximpobjectfactory.h" -#include "s_ximpcontext.h" -#include "s_xmppsettingsapi.h" -#include "s_ximpclient.h" - -#include "s_ximprequestcompleteevent.h" -#include "cicpservicemanager.h" - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def -#define TEST_CLASS_VERSION_MAJOR 0 -#define TEST_CLASS_VERSION_MINOR 0 -#define TEST_CLASS_VERSION_BUILD 0 - -// Logging path -_LIT( Kimconnectionprovider_testLogPath, "\\logs\\testframework\\imconnectionprovider_test\\" ); -// Log file -_LIT( Kimconnectionprovider_testLogFile, "imconnectionprovider_test.txt" ); -_LIT( Kimconnectionprovider_testLogFileWithTitle, "imconnectionprovider_test_[%S].txt" ); - -_LIT( KServiceName, "TestService"); - -_LIT( KServicePropName, "DummyService"); - -_LIT( KServreName, "test@testserver.com"); - -// FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - - -class Cimconnectionprovider_test; - -// DATA TYPES -//enum ?declaration -//typedef ?declaration -//extern ?data_type; - -// CLASS DECLARATION - -/** -* Cimconnectionprovider_test test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS(Cimconnectionprovider_test) : public CScriptBase, - public MCchServiceObserver - { - public: // Constructors and destructor - - friend class CIcpServiceManager; - /** - * Two-phased constructor. - */ - static Cimconnectionprovider_test* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~Cimconnectionprovider_test(); - - CIcpServiceManager* NewL( MCchServiceObserver* aServiceObserver = NULL); - - private: - void ServiceStateChanged( - const TServiceSelection aServiceSelection, - TCCHSubserviceState aState, - TInt aError ); - public: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - - private: - - /** - * C++ default constructor. - */ - Cimconnectionprovider_test( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - - - /** - * Test methods are listed below. - */ - - /** - * Example test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt T_EnableServiceL( CStifItemParser& aItem ); - - virtual TInt T_DisableServiceL( CStifItemParser& aItem ); - - virtual TInt T_SetIMDisabledL( CStifItemParser& aItem ); - - virtual TInt T_RemoveRequestId( CStifItemParser& aItem ); - - virtual TInt T_BindL( CStifItemParser& aItem ); - - virtual TInt T_UnBindL( CStifItemParser& aItem ); - - virtual TInt T_IsReserved( CStifItemParser& aItem ); - - virtual TInt T_SetConnectionParameter( CStifItemParser& aItem ); - - virtual TInt T_GetConnectionParameter( CStifItemParser& aItem ); - - virtual TInt T_ValidateServiceL( CStifItemParser& aItem ); - - virtual TInt T_GetSPSettingsIntPropertyL( CStifItemParser& aItem ); - - virtual TInt T_ValidateSubService( CStifItemParser& aItem ); - - virtual TInt T_GetServiceNameL( CStifItemParser& aItem ); - - virtual TInt T_ConvertXIMPErrToCChErr( CStifItemParser& aItem ); - - virtual TInt T_FindRequestId( CStifItemParser& aItem ); - - virtual TInt T_GetServiceNetworkInfo_emptypasswordL( CStifItemParser& aItem ); - - virtual TInt T_GetServiceNetworkInfo_passwordExistL( CStifItemParser& aItem ); - - // virtual TInt T_UnsubscribePresenceGrantRequestListL( CStifItemParser& aItem ); - /** - * Method used to log version of test class - */ - void SendTestClassVersion(); - - void Cimconnectionprovider_test::CreateSpEntryL( TInt aServiceId, - TServicePropertyName aName, - TInt aValue ); - - //ADD NEW METHOD DEC HERE - //[TestMethods] - Do not remove - - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - private: // Data - CSPSettings* iSpSettings; - // ?one_line_short_description_of_data - //?data_declaration; - - // Reserved pointer for future extension - //TAny* iReserved; - - public: // Friend classes - //?friend_class_declaration; - protected: // Friend classes - //?friend_class_declaration; - private: // Friend classes - //?friend_class_declaration; - - }; - -#endif // IMCONNECTIONPROVIDER_TEST_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/init/TestFramework.ini --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/init/TestFramework.ini Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -# -# This is STIFTestFramework initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', - 'TestCases' or 'FullReport' - -CreateTestReport= YES # Possible values: YES or NO - -TestReportFilePath= C:\LOGS\TestFramework\ -TestReportFileName= TestReport - -TestReportFormat= TXT # Possible values: TXT or HTML -TestReportOutput= FILE # Possible values: FILE or RDEBUG -TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting - -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start - -[New_Module] -ModuleName= testscripter -TestCaseFile= C:\testframework\imconnectionprovider_test.cfg -[End_Module] - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -[Logger_Defaults] - -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/imconnectionprovider_test.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/imconnectionprovider_test.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imconnectionprovider_test.cpp -* -*/ - - - -// INCLUDE FILES -#include -#include "imconnectionprovider_test.h" -#include - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::Cimconnectionprovider_test -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -Cimconnectionprovider_test::Cimconnectionprovider_test( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void Cimconnectionprovider_test::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(Kimconnectionprovider_testLogFileWithTitle, &title); - } - else - { - logFileName.Copy(Kimconnectionprovider_testLogFile); - } - - iLog = CStifLogger::NewL( Kimconnectionprovider_testLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - TestModuleIf().SetBehavior ( CTestModuleIf::ETestLeaksHandles ); - - - SendTestClassVersion(); - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -Cimconnectionprovider_test* Cimconnectionprovider_test::NewL( - CTestModuleIf& aTestModuleIf ) - { - Cimconnectionprovider_test* self = new (ELeave) Cimconnectionprovider_test( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -Cimconnectionprovider_test::~Cimconnectionprovider_test() - { - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - } - -//----------------------------------------------------------------------------- -// Cimconnectionprovider_test::SendTestClassVersion -// Method used to send version of test class -//----------------------------------------------------------------------------- -// -void Cimconnectionprovider_test::SendTestClassVersion() - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; - moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; - moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; - - TFileName moduleName; - moduleName = _L("imconnectionprovider_test.dll"); - - TBool newVersionOfMethod = ETrue; - TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) Cimconnectionprovider_test::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/imconnectionprovider_testBlocks.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/imconnectionprovider_testBlocks.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,559 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imconnectionprovider_testBlocks.cpp -* -*/ - - - -// [INCLUDE FILES] - do not remove - -#include "imconnectionprovider_test.h" -#include -#include -#include -#include -#include -#include -#include -#include "cchserviceobserver.h" - -extern TBool setpassword ; -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void Cimconnectionprovider_test::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt Cimconnectionprovider_test::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - ENTRY( "T_EnableServiceL", Cimconnectionprovider_test::T_EnableServiceL ), - ENTRY( "T_DisableServiceL", Cimconnectionprovider_test::T_DisableServiceL ), - ENTRY( "T_SetIMDisabledL", Cimconnectionprovider_test::T_SetIMDisabledL), - ENTRY( "T_FindRequestId", Cimconnectionprovider_test::T_FindRequestId), - ENTRY( "T_RemoveRequestId", Cimconnectionprovider_test::T_RemoveRequestId), - ENTRY( "T_UnBindL", Cimconnectionprovider_test::T_UnBindL), - ENTRY( "T_BindL", Cimconnectionprovider_test::T_BindL), - ENTRY( "T_IsReserved", Cimconnectionprovider_test::T_IsReserved), - ENTRY( "T_SetConnectionParameter", Cimconnectionprovider_test::T_SetConnectionParameter), - ENTRY( "T_GetConnectionParameter", Cimconnectionprovider_test::T_GetConnectionParameter), - ENTRY( "T_ValidateServiceL", Cimconnectionprovider_test::T_ValidateServiceL), - ENTRY( "T_ValidateSubService", Cimconnectionprovider_test::T_ValidateSubService), - ENTRY( "T_GetServiceNameL", Cimconnectionprovider_test::T_GetServiceNameL), - ENTRY( "T_ConvertXIMPErrToCChErr", Cimconnectionprovider_test::T_ConvertXIMPErrToCChErr), - ENTRY( "T_GetSPSettingsIntPropertyL", Cimconnectionprovider_test::T_GetSPSettingsIntPropertyL), - ENTRY( "T_GetServiceNetworkInfo_passwordExistL", Cimconnectionprovider_test::T_GetServiceNetworkInfo_passwordExistL), - ENTRY( "T_GetServiceNetworkInfo_emptypasswordL", Cimconnectionprovider_test::T_GetServiceNetworkInfo_emptypasswordL), - }; - - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::NewL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CIcpServiceManager* Cimconnectionprovider_test::NewL( MCchServiceObserver* aServiceObserver ) - { - //MCchServiceObserver& aServiceObserver = NULL; - CIcpServiceManager* self = CIcpServiceManager::NewL( *this ); - return self; - } - - -void Cimconnectionprovider_test::ServiceStateChanged( - const TServiceSelection aServiceSelection, - TCCHSubserviceState aState, - TInt aError ) -{ - -} - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_EnableServiceL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimconnectionprovider_test::T_EnableServiceL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - if(icpManager->iPresenceCtx) - { - delete icpManager->iPresenceCtx; - } - if(icpManager->iPresClient) - { - delete icpManager->iPresClient; - } - icpManager->iPresClient = MXIMPClientStub::NewClientL(); - icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC(); - CleanupStack::Pop( icpManager->iPresenceCtx ); - icpManager->EnableServiceL(1,ECCHIMSub); - delete icpManager; - return KErrNone; - - } - - - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_DisableServiceL -// T_DisableServiceL test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimconnectionprovider_test::T_DisableServiceL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - // TCCHSubserviceType type = TCCHSubserviceType::ECCHIMSub; - icpManager->DisableServiceL(1,ECCHIMSub); - if(icpManager->iPresenceCtx) - { - delete icpManager->iPresenceCtx; - } - if(icpManager->iPresClient) - { - delete icpManager->iPresClient; - } - icpManager->iPresClient = MXIMPClientStub::NewClientL(); - icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC(); - CleanupStack::Pop( icpManager->iPresenceCtx ); - delete icpManager; - return KErrNone; - - } - - - - - - - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_SetIMDisabledL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_SetIMDisabledL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - icpManager->SetIMDisabledL(0); - delete icpManager; - return KErrNone; - } - - - - - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_RemoveRequestId -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_RemoveRequestId( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - - if(icpManager->iPresClient) - { - delete icpManager->iPresClient; - } - icpManager->iPresClient = MXIMPClientStub::NewClientL(); - - - if(icpManager->iPresenceCtx) - { - delete icpManager->iPresenceCtx; - } - icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC(); - CleanupStack::Pop( icpManager->iPresenceCtx ); - - TXIMPRequestId reqId ; - - - icpManager->RemoveRequestId(reqId); - - delete icpManager; - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_FindRequestId -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_FindRequestId( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - - if(icpManager->iPresClient) - { - delete icpManager->iPresClient; - } - icpManager->iPresClient = MXIMPClientStub::NewClientL(); - - - if(icpManager->iPresenceCtx) - { - delete icpManager->iPresenceCtx; - } - icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC(); - CleanupStack::Pop( icpManager->iPresenceCtx ); - - - TXIMPRequestId reqId; - icpManager->FindRequestId(reqId); - - delete icpManager; - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_UnBindL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_UnBindL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - - if(icpManager->iPresClient) - { - delete icpManager->iPresClient; - } - icpManager->iPresClient = MXIMPClientStub::NewClientL(); - - - if(icpManager->iPresenceCtx) - { - delete icpManager->iPresenceCtx; - } - icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC(); - CleanupStack::Pop( icpManager->iPresenceCtx ); - - - icpManager->UnBindL(); - delete icpManager; - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_BindL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_BindL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - - if(icpManager->iPresClient) - { - delete icpManager->iPresClient; - } - icpManager->iPresClient = MXIMPClientStub::NewClientL(); - - - if(icpManager->iPresenceCtx) - { - delete icpManager->iPresenceCtx; - } - icpManager->iPresenceCtx = (icpManager->iPresClient)->NewPresenceContextLC(); - CleanupStack::Pop( icpManager->iPresenceCtx ); - - - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - icpManager->BindL(1); - delete icpManager; - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_IsReserved -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_IsReserved( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - icpManager->IsReserved(1,ECCHIMSub); - delete icpManager; - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_SetConnectionParameter -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_SetConnectionParameter( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - icpManager->SetConnectionParameter(1,ECCHIMSub,ECchUsername,1/*KServreName*/); - icpManager->SetConnectionParameter(1,ECCHIMSub,ECchPassword,1/*KServreName*/); - icpManager->SetConnectionParameter(1,ECCHIMSub,ECchIapId,0); - icpManager->SetConnectionParameter(1,ECCHIMSub,ECchSnapId,0); - delete icpManager; - return KErrNone; - } - - - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_HandlePresenceNotificationL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_GetConnectionParameter( CStifItemParser& aItem ) - { - TInt dunny; - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - icpManager->GetConnectionParameter(1,ECCHIMSub,ECchIapId,dunny); - icpManager->GetConnectionParameter(1,ECCHIMSub,ECchSnapId,dunny); - icpManager->GetConnectionParameter(1,ECCHIMSub,ECchSnapLocked,dunny); - icpManager->GetConnectionParameter(1,ECCHIMSub,ECchPasswordSet,dunny); - delete icpManager; - return KErrNone; - } -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_ValidateServiceL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_ValidateServiceL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - icpManager->ValidateServiceL(1); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::T_GetSPSettingsIntPropertyL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt Cimconnectionprovider_test::T_GetSPSettingsIntPropertyL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - icpManager->GetSPSettingsIntPropertyL(1,EServiceName); - return KErrNone; - } - - -TInt Cimconnectionprovider_test::T_ValidateSubService( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - icpManager->ValidateSubService(ECCHUnknown); - icpManager->ValidateSubService(ECCHPresenceSub); - icpManager->ValidateSubService(ECCHIMSub); - return KErrNone; - } - -TInt Cimconnectionprovider_test::T_GetServiceNameL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - HBufC* serviceName = HBufC::NewLC( 100 ); - TPtr serviceNamePtr( serviceName->Des() ); - icpManager->GetServiceNameL(1,serviceNamePtr ); - //icpManager->GetServiceNameL() - TInt ret = KErrNotFound; - if( serviceNamePtr.Length() ) - { - ret = KErrNone; - } - CleanupStack::PopAndDestroy(); // serviceName - return ret; - } - -TInt Cimconnectionprovider_test::T_GetServiceNetworkInfo_passwordExistL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - TCCHSubserviceType aSubServiceType; - TUint32 aSnapId = 0; - TUint32 aIapId =0; - TBool aSnapLocked = EFalse; - TBool aPasswordSet; - setpassword = ETrue; //password is set - - icpManager->GetServiceNetworkInfoL(1,ECCHUnknown,aSnapId,aIapId,aSnapLocked,aPasswordSet); - if(aPasswordSet) - { - return KErrNone; - } - else - { - return KErrNotFound; - } - } - -TInt Cimconnectionprovider_test::T_GetServiceNetworkInfo_emptypasswordL( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - TCCHSubserviceType aSubServiceType; - TUint32 aSnapId = 0; - TUint32 aIapId =0; - TBool aSnapLocked = EFalse; - TBool aPasswordSet; - setpassword = EFalse; //password is empty - - icpManager->GetServiceNetworkInfoL(1,ECCHUnknown,aSnapId,aIapId,aSnapLocked,aPasswordSet); - if(aPasswordSet) - { - return KErrNotFound; //test case failed - } - else - { - return KErrNone; //test case passed - - } - } -TInt Cimconnectionprovider_test::T_ConvertXIMPErrToCChErr( CStifItemParser& aItem ) - { - CIcpServiceManager *icpManager = NewL(NULL); - CreateSpEntryL( 1, EPropertyPCSPluginId, 10 ); - icpManager->ConvertXIMPErrToCChErr(KXIMPErrServiceGeneralError); - icpManager->ConvertXIMPErrToCChErr(KXIMPErrServiceShutdown); - icpManager->ConvertXIMPErrToCChErr(KXIMPErrServiceRequestTypeNotSupported); - icpManager->ConvertXIMPErrToCChErr(KXIMPErrServiceAuthenticationFailed); - return KErrNone; - } - - -void Cimconnectionprovider_test::CreateSpEntryL( TInt aServiceId, - TServicePropertyName aName, - TInt aValue ) - { - CSPSettings* settings = CSPSettings::NewL(); - - CSPProperty* property = CSPProperty::NewL(); - CleanupStack::PushL( property ); - property->SetName( aName ); - property->SetValue( aValue ); - - CSPEntry* entry = CSPEntry::NewL(); - CleanupStack::PushL( entry ); - entry->SetServiceId( aServiceId ); - entry->SetServiceName(KServiceName() ); - - entry->AddPropertyL( *property ); - - CSPEntry* testEntry = CSPEntry::NewLC(); - TInt result = settings->FindEntryL( entry->GetServiceId(), *testEntry ); - if( result == KErrNone ) - { - settings->UpdateEntryL( *entry ); - } - else - { - settings->AddEntryL( *entry ); - } - CleanupStack::PopAndDestroy( 3 ); - } - -// ----------------------------------------------------------------------------- -// Cimconnectionprovider_test::?member_function -// ?implementation_description -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -/* -TInt Cimconnectionprovider_test::?member_function( - CItemParser& aItem ) - { - - ?code - - } -*/ - -// ========================== OTHER EXPORTED FUNCTIONS ========================= -// None - -// [End of File] - Do not remove diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ecom.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ecom.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for identity object. -* -*/ - - -#include -#include "s_ximpclient.h" - -TAny* REComSession::CreateImplementationL( - TUid aImplementationUid, - TUid& aDtorIDKey) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI2 - TAny* REComSession::CreateImplementationL( - TUid aImplementationUid, - TInt32 aKeyOffset) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI3 -TAny* REComSession::CreateImplementationL( - TUid aImplementationUid, - TUid& aDtorIDKey, - TAny* aConstructionParameters) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI4 -TAny* REComSession::CreateImplementationL( - TUid aImplementationUid, - TInt32 aKeyOffset, - TAny* aConstructionParameters) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI5 -TAny* REComSession::CreateImplementationL( - TUid aInterfaceUid, - TUid& aDtorIDKey, - const TEComResolverParams& aResolutionParameters) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI6 -TAny* REComSession::CreateImplementationL( - TUid aInterfaceUid, - TInt32 aKeyOffset, - const TEComResolverParams& aResolutionParameters) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI7 -TAny* CreateImplementationL( - TUid aInterfaceUid, - TUid& aDtorIDKey, - TAny* aConstructionParameters, - const TEComResolverParams& aResolutionParameters) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - // CreateImplementationL - CI8 -TAny* REComSession::CreateImplementationL( - TUid aInterfaceUid, - TInt32 aKeyOffset, - TAny* aConstructionParameters, - const TEComResolverParams& aResolutionParameters) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI9 -TAny* REComSession::CreateImplementationL( - TUid aInterfaceUid, - TUid& aDtorIDKey, - const TEComResolverParams& aResolutionParameters, - TUid aResolverUid) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI10 -TAny* REComSession::CreateImplementationL( - TUid aInterfaceUid, - TInt32 aKeyOffset, - const TEComResolverParams& aResolutionParameters, - TUid aResolverUid) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI11 -TAny* CreateImplementationL( - TUid aInterfaceUid, - TUid& aDtorIDKey, - TAny* aConstructionParameters, - const TEComResolverParams& aResolutionParameters, - TUid aResolverUid) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // CreateImplementationL - CI12 -TAny* REComSession::CreateImplementationL( - TUid aInterfaceUid, - TInt32 aKeyOffset, - TAny* aConstructionParameters, - const TEComResolverParams& aResolutionParameters, - TUid aResolverUid) - { - //return NULL; - return MXIMPClientStub::NewClientL(); - } - - // Destroy Implementation API declaration -void REComSession::DestroyedImplementation( - TUid aDtorIDKey) - { - - } - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_rproperty.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_rproperty.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* 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: s_rproperty.cpp -* -*/ -#include -#include - - -TInt gKey = KErrNotFound; -TInt gValue = KErrNotFound; -TRequestStatus gRequest = 0; -/* - IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, TInt aPreallocate=0); - IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); - IMPORT_C static TInt Define(TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); - IMPORT_C static TInt Delete(TUid aCategory, TUint aKey); - IMPORT_C static TInt Delete(TUint aKey); - IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes16& aValue); -#endif - IMPORT_C static TInt Set(TUid aCategory, TUint aKey, TInt aValue); - IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC16& aValue); -#endif - - IMPORT_C void Cancel(); - - IMPORT_C TInt Get(TInt& aValue); - IMPORT_C TInt Get(TDes8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C TInt Get(TDes16& aValue); -#endif - IMPORT_C TInt Set(TInt aValue); - IMPORT_C TInt Set(const TDesC8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C TInt Set(const TDesC16& aValue); -*/ - -TInt RProperty::Attach(TUid aCategory, TUint aKey, TOwnerType aType ) - { - return KErrNone; - } - -TInt RProperty::Set(TUid aCategory, TUint aKey, TInt aValue) - { - gKey = aKey; - gValue = aValue; - - return KErrNone; - } - -TInt RProperty::Get( TInt& aValue ) - { - aValue = gValue; - - return KErrNone; - } - -TInt RProperty::Get(TUid aCategory, TUint aKey, TInt& aValue) - { - if( aKey == gKey ) - { - aValue = gValue; - return KErrNone; - } - - return KErrNotFound; - } - -void RProperty::Subscribe(TRequestStatus& aRequest) - { - } - -void RProperty::Cancel() - { - } - -TInt RProperty::Define(TUid aCategory, TUint aKey, TInt aAttr, TInt aPreallocate/*=0*/) - { - return KErrNone; - } - -void RHandleBase::Close() -{ - -} diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_spentry.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_spentry.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* 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: s_spentry.cpp -* -*/ - -#include -#include - - -CSPEntry* CSPEntry::NewL() - { - CSPEntry* self = CSPEntry::NewLC(); - CleanupStack::Pop(self); - return self; - } - -CSPEntry* CSPEntry::NewLC() - { - CSPEntry* self = new ( ELeave) CSPEntry; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -CSPEntry::~CSPEntry() - { - iServiceName.Close(); - iPropertyArray.ResetAndDestroy(); - iPropertyArray.Close(); - } - -TServiceId CSPEntry::GetServiceId() const - { - return iServiceId; - } - -void CSPEntry::SetServiceId( TServiceId aServiceId ) - { - iServiceId = aServiceId; - } - -const TDesC16& CSPEntry::GetServiceName() const - { - return iServiceName; - } - -TInt CSPEntry::SetServiceName( const TDesC16& aServiceName ) - { - - iServiceName.Copy(aServiceName); - - } - -TInt CSPEntry::AddPropertyL( const CSPProperty& aProperty ) - { - CSPProperty* property = CSPProperty::NewL(); - CleanupStack::PushL( property ); - - property->CopyL( aProperty ); - - TInt err = iPropertyArray.Append( property ); - if( err == KErrNoMemory ) - { - User::Leave( KErrNoMemory ); - } - - CleanupStack::Pop( property ); - - return KErrNone; - } - - -TInt CSPEntry::UpdateProperty( TServicePropertyName aPropertyName, TInt aValue ) - { - return KErrNone; - } - - -TInt CSPEntry::UpdateProperty( TServicePropertyName aPropertyName, const TDesC& aValue ) - { - return KErrNone; - } - -TInt CSPEntry::UpdateProperty( TServicePropertyName aPropertyName, TOnOff aValue ) - { - return KErrNone; - } - -TInt CSPEntry::GetProperty( const CSPProperty*& aProperty, - TServicePropertyName aPropertyName ) const - { - TInt count = iPropertyArray.Count(); - for( TInt i=0; iGetName() == aPropertyName ) - { - aProperty = iPropertyArray[ i ]; - return KErrNone; - } - } - - return KErrNotFound; - } - -TInt CSPEntry::GetProperty( const CSPProperty*& aProperty, - TInt aIndex ) const - { - return KErrNone; - } - -TInt CSPEntry::DeleteProperty( TInt aIndex ) - { - return KErrNone; - } - -TInt CSPEntry::DeleteProperty( TServicePropertyName aProperty ) - { - return KErrNone; - } - -const RPropertyArray& CSPEntry::GetAllProperties() const - { - return iPropertyArray; - } - -TInt CSPEntry::PropertyCount() const - { - return KErrNone; - } - -CSPEntry::CSPEntry() - { - } - -void CSPEntry::ConstructL() - { - iServiceName.Create(500); - } - -TInt CSPEntry::SearchProperty( TServicePropertyName aProperty ) const - { - return KErrNone; - } - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_spproperty.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_spproperty.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,270 +0,0 @@ -/* -* 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: s_spproperty.cpp -* -*/ - -#include - -TServicePropertyName gPropertyName = EPropertyUnknown; -TInt gContactViewPluginId = 0; -HBufC* gPropertyContactStoreId = 0; -HBufC* gPropertyBrandId = 0; -TBool gPropertyInvalid = EFalse; -TInt gPropertyBrandLanguage = 0; -TInt gPropertyBrandVersion = 0; -TInt gPropertyXIMP = 0; -TOnOff gPropertyPresenceRequestPreference = EOff; -TInt gContactViewId = 0; -TInt gESubPropertyIMSettingsId = 0; - -CSPProperty* CSPProperty::NewL() - { - return new ( ELeave ) CSPProperty; - } - - -CSPProperty* CSPProperty::NewLC() - { - - CSPProperty* self = new ( ELeave ) CSPProperty; - CleanupStack::PushL( self ); - return self; - } - -CSPProperty::~CSPProperty(){} - - -TServicePropertyName CSPProperty::GetName() const - { - return iPropertyName; - } - - -TInt CSPProperty::SetName( TServicePropertyName aPropertyname ) - { - iPropertyName = aPropertyname; - return KErrNone; - } - - -TSPItemType CSPProperty::GetPropertyType() const{} - - -TInt CSPProperty::SetPropertyType( TSPItemType aPropertyType ){} - - -TPropertyDataType CSPProperty::GetDataType() const{} - - -void CSPProperty::SetDataType( TPropertyDataType aDataType ){} - - -TInt CSPProperty::GetValue( TInt& aValue ) const - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - - if( GetName() == EPropertyContactViewPluginId ) - { - aValue = gContactViewPluginId; - } - else if( GetName() == EPropertyBrandLanguage ) - { - aValue = gPropertyBrandLanguage; - } - else if( GetName() == EPropertyBrandVersion ) - { - aValue = gPropertyBrandVersion; - } - else if( GetName() == EPropertyPCSPluginId ) - { - aValue = gPropertyXIMP; - } - else if( GetName() == EPropertyContactViewId ) - { - aValue = gContactViewId; - } - else if( GetName() == ESubPropertyIMSettingsId ) - { - aValue = gESubPropertyIMSettingsId; - } - - return KErrNone; - } - -TInt CSPProperty::SetValue( TInt aValue ) - { - if( GetName() == EPropertyContactViewPluginId ) - { - gContactViewPluginId = aValue; - } - else if( GetName() == EPropertyBrandLanguage ) - { - gPropertyBrandLanguage = aValue; - } - else if( GetName() == EPropertyBrandVersion ) - { - gPropertyBrandVersion = aValue; - } - else if( GetName() == EPropertyPCSPluginId ) - { - gPropertyXIMP = aValue; - } - else if( GetName() == EPropertyContactViewId ) - { - gContactViewId = aValue ; - } - else if( GetName() == ESubPropertyIMSettingsId ) - { - gESubPropertyIMSettingsId = aValue; - } - return KErrNone; - } - - -TInt CSPProperty::GetValue( TDes& aValue ) const - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - if( GetName() == EPropertyContactStoreId ) - { - if (gPropertyContactStoreId) - { - aValue.Copy(*gPropertyContactStoreId); - } - } - else if( GetName() == EPropertyBrandId ) - { - if (gPropertyBrandId) - { - aValue.Copy(*gPropertyBrandId); - } - } - - return KErrNone; - } - -TInt CSPProperty::SetValue( const TDesC& aValue ) - { - if( GetName() == EPropertyContactStoreId ) - { - - if (gPropertyContactStoreId) - { - delete gPropertyContactStoreId; - gPropertyContactStoreId = NULL; - } - - gPropertyContactStoreId = aValue.Alloc(); - } - else if( GetName() == EPropertyBrandId ) - { - if (gPropertyBrandId) - { - delete gPropertyBrandId; - gPropertyBrandId = NULL; - } - gPropertyBrandId = aValue.Alloc(); - } - - return KErrNone; - } - -TInt CSPProperty::GetValue( TOnOff& aValue ) const - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - - if( GetName() == ESubPropertyPresenceRequestPreference ) - { - aValue = gPropertyPresenceRequestPreference; - } - - return KErrNone; - } - - -TInt CSPProperty::SetValue( TOnOff aValue ) - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - - if( GetName() == ESubPropertyPresenceRequestPreference ) - { - gPropertyPresenceRequestPreference = aValue; - } - - return KErrNone; - } - - -TInt CSPProperty::SetValueNoDataTypeCheck( const TDesC& aValue ){} - - -TPropertyDataType CSPProperty::DataType( TServicePropertyName aProperty ){} - - -TSPItemType CSPProperty::PropertyType( TServicePropertyName aProperty ){} - - -void CSPProperty::CopyL( const CSPProperty& aSource ) - { - iPropertyName = aSource.GetName(); - - if( GetName() == EPropertyContactStoreId ) - { - HBufC* value = HBufC::NewLC(500); - TPtr valuePtr = value->Des(); - aSource.GetValue(valuePtr); - SetValue( valuePtr ); - - CleanupStack::PopAndDestroy(value); - } - else if( GetName() == EPropertyBrandId ) - { - HBufC* value = HBufC::NewLC(500); - TPtr valuePtr = value->Des(); - aSource.GetValue(valuePtr); - SetValue( valuePtr ); - - CleanupStack::PopAndDestroy(value); - } - else if( GetName() == EPropertyContactViewPluginId ) - { - TInt value = 0; - aSource.GetValue( value ); - SetValue( value ); - } - - } - - -TBool CSPProperty::CSPProperty::operator==( - const CSPProperty& aProperty ) const{} - -CSPProperty::CSPProperty(){} - -void CSPProperty::ConstructL(){} - - -TInt SetDefaultValue( TServicePropertyName aProperty ){} diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_spsettings.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_spsettings.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,251 +0,0 @@ -/* -* 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: s_spsettings.cpp -* -*/ -#include -#include -#include - -RArray< TServiceId > gServiceIds; -RPointerArray< CSPEntry > gEntries; - - -CSPSettings* myCSPSettings = NULL; - - -extern TServicePropertyName gPropertyName; -extern TInt gContactViewPluginId; -extern HBufC* gPropertyContactStoreId; -extern HBufC* gPropertyBrandId; -extern TBool gPropertyInvalid; -extern TInt gPropertyBrandLanguage; -extern TInt gPropertyBrandVersion; -extern TInt gPropertyXIMP; -extern TOnOff gPropertyPresenceRequestPreference; -extern TInt gContactViewId; - -CSPSettings* CSPSettings::NewL() - { - if (!myCSPSettings) - { - myCSPSettings = new ( ELeave ) CSPSettings; - } - return myCSPSettings; - } - -CSPSettings* CSPSettings::NewLC() - { - CSPSettings* settings = CSPSettings::NewL(); - CleanupStack::PushL( settings ); - return settings; - } - -CSPSettings::~CSPSettings() - { - gServiceIds.Close(); - - gEntries.ResetAndDestroy(); - gEntries.Close(); - delete gPropertyContactStoreId; - delete gPropertyBrandId; - - - myCSPSettings = NULL; - gPropertyName = EPropertyUnknown; - gContactViewPluginId = 0; - gPropertyContactStoreId = 0; - gPropertyBrandId = 0; - gPropertyInvalid = EFalse; - gPropertyBrandLanguage = 0; - gPropertyBrandVersion = 0; - gPropertyXIMP = 0; - gPropertyPresenceRequestPreference = EOff; - gContactViewId = 0; - } - -void CopyEntry( const CSPEntry& aOriginal, CSPEntry& aTarget ) - { - aTarget.SetServiceId( aOriginal.GetServiceId() ); - aTarget.SetServiceName( aOriginal.GetServiceName() ); - RPropertyArray array = aOriginal.GetAllProperties(); - for( TInt i = 0; i < array.Count(); i++ ) - { - TRAP_IGNORE( aTarget.AddPropertyL( *array[i] ) ); - } - } - -TInt CSPSettings::AddEntryL( CSPEntry& aEntry ) - { - TInt err = gServiceIds.Append( aEntry.GetServiceId() ); - if( err ) - { - User::Leave( err ); - } - - CSPEntry* entry = CSPEntry::NewLC(); - CopyEntry( aEntry, *entry ); - // If property counts difference from each other, - // alloc failure has happened in CopyEntry - if( aEntry.GetAllProperties().Count() != - entry->GetAllProperties().Count() ) - { - User::Leave( KErrNoMemory ); - } - - err = gEntries.Append( entry ); - if( err ) - { - User::Leave( err ); - } - CleanupStack::Pop( entry ); - return KErrNone; - } - -TInt CSPSettings::FindEntryL( TServiceId aServiceId, CSPEntry& aEntry ) - { - for( TInt i=0; iGetAllProperties().Count() ) - { - User::Leave( KErrNoMemory ); - } - - return KErrNone; - } - } - - return KErrNotFound; - } - - -TInt CSPSettings::UpdateEntryL( const CSPEntry& aEntry ) - { - for( TInt i=0; iSetServiceName( aEntry.GetServiceName() ); - RPropertyArray propOrig = gEntries[i]->GetAllProperties(); - RPropertyArray propNew = aEntry.GetAllProperties(); - TBool found = EFalse; - for( TInt j = 0; j < propNew.Count(); j++ ) - { - for( TInt k = 0; k < propOrig.Count() && !found; k++ ) - { - if( propNew[j] == propOrig[k] ) - { - found = ETrue; - } - } - if( !found ) - { - gEntries[i]->AddPropertyL( *propNew[j] ); - } - found = EFalse; - } - return KErrNone; - } - } - - return KErrNotFound; - } - -TInt CSPSettings::FindPropertyL( TServiceId aServiceId, - TServicePropertyName aPropertyName, - CSPProperty& aProperty ) - { - for( TInt i=0; iGetProperty( property, - aPropertyName ); - - if (KErrNone == err) - { - aProperty.CopyL(*property); - return KErrNone; - } - } - } - - return KErrNotFound; - } - - -TInt CSPSettings::FindServiceIdsL( RIdArray& aServiceIds ) - { - if( gServiceIds.Count() == 0 ) - { - return KErrNotFound; - } - - for( TInt i=0; i& aProtocols ) - { - } - -MXIMPFeatureInfo* MXIMPClientStub::GetFrameworkFeaturesLC() - { - return NULL; - } - -MXIMPContext* MXIMPClientStub::NewPresenceContextLC() - { - MXIMPContext* context = new ( ELeave ) MXIMPContextStub; - CleanupStack::PushL( context ); - return context; - } - -const TAny* MXIMPClientStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - return NULL; - } - -TAny* MXIMPClientStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) - { - return NULL; - } - -TInt32 MXIMPClientStub::GetInterfaceId() const - { - return 0; - } - - -MXIMPClient* MXIMPClientStub::NewClientL() - { - return new (ELeave) MXIMPClientStub(); - } - - - -MXIMPClientStub::~MXIMPClientStub() - { - - } - - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpclient.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpclient.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* 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: s_ximpclient.h -* -*/ -#ifndef _MXIMPCLIENTSTUB_ -#define _MXIMPCLIENTSTUB_ - -#include - -class MXIMPProtocolInfo; -class MXIMPFeatureInfo; -class MXIMPContext; - -class MXIMPClientStub : public CBase, public MXIMPClient - { - -public: - /** - * Factory method to instantiate MXIMPClient. - * - * Factory method to instantiate platform default - * MXIMPClient implementation through the ECom. - * If the default presence framework isn't supported - * in the platform, leaves with errorcode signalled - * from ECom. - * - * @return The new presence client object. Object - * ownership is returned to caller. - */ - static MXIMPClient* NewClientL(); - - - /** - * Public destructor. - * Object can be deleted through this interface. - */ - ~MXIMPClientStub(); - - void GetProtocolsL( - RXIMPObjOwningPtrArray< MXIMPProtocolInfo >& aProtocols ); - - MXIMPFeatureInfo* GetFrameworkFeaturesLC(); - - MXIMPContext* NewPresenceContextLC(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - -#endif // MXIMPFWCLIENT_H - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpcontext.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpcontext.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* 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: s_ximpcontext.cpp -* -*/ - -#include "s_ximpcontext.h" -#include "s_ximpobjectfactory.h" - -TInt gUnBindingLeaves = KErrNone; - -void MXIMPContextStub::RegisterObserverL( - MXIMPContextObserver& aObserver, - const TArray* aEventFilter ) - { - } - -void MXIMPContextStub::UnregisterObserver( - MXIMPContextObserver& aObserver ) - { - } - -TXIMPRequestId MXIMPContextStub::BindToL( - TUid aProtocolImpUid, - const TDesC16& aServiceAddress, - const TDesC16& aUsername, - const TDesC16& aPassword, - TInt32 aIapId ) - { - } - -TXIMPRequestId MXIMPContextStub::BindToL( - TUid aProtocolImpUid, - const TDesC16& aServiceAddress, - const TDesC16& aUsername, - const TDesC16& aPassword, - const TDesC16& aClientId, - TInt32 aIapId ) - { - } - -TXIMPRequestId MXIMPContextStub::BindToL( - TUid aProtocolImpUid, - const TDesC16& aUsername, - const TDesC16& aPassword, - TInt aSettingsId ) - { - } - -TXIMPRequestId MXIMPContextStub::BindToL( TUid aProtocolImpUid, - TInt aSettingsId ) - { - } - -TXIMPRequestId MXIMPContextStub::UnbindL() - { - User::LeaveIfError( gUnBindingLeaves ); - } - -MXIMPFeatureInfo* MXIMPContextStub::GetContextFeaturesLC() const - { - return NULL; - } - -MXIMPObjectFactory& MXIMPContextStub::ObjectFactory() const - { - - - MXIMPContextStub* thisObject = const_cast (this); - if (!thisObject->iObjFactory) - { - thisObject->iObjFactory = new (ELeave) MyMXIMPObjectFactoryStub(); - } - return *iObjFactory; - } - -const TAny* MXIMPContextStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - return NULL; - } - -TAny* MXIMPContextStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) - { - return NULL; - } - -TInt32 MXIMPContextStub::GetInterfaceId() const - { - return 0; - } - -MXIMPContextStub::MXIMPContextStub() -{ - -} - -MXIMPContextStub::~MXIMPContextStub() - { - delete iObjFactory; - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpcontext.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpcontext.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* 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: s_ximpcontext.h -* -*/ - -#ifndef MXIMPFWPRESENCECONTEXTSTUB_H -#define MXIMPFWPRESENCECONTEXTSTUB_H - -#include - -class MyMXIMPObjectFactoryStub; - -class MXIMPContextStub : public CBase, public MXIMPContext - { -public: - MXIMPContextStub(); - ~MXIMPContextStub(); - void RegisterObserverL( - MXIMPContextObserver& aObserver, - const TArray* aEventFilter = NULL ); - - void UnregisterObserver( - MXIMPContextObserver& aObserver ); - - TXIMPRequestId BindToL( - TUid aProtocolImpUid, - const TDesC16& aServiceAddress, - const TDesC16& aUsername, - const TDesC16& aPassword, - TInt32 aIapId ); - TXIMPRequestId BindToL( - TUid aProtocolImpUid, - const TDesC16& aServiceAddress, - const TDesC16& aUsername, - const TDesC16& aPassword, - const TDesC16& aClientId, - TInt32 aIapId ); - TXIMPRequestId BindToL( TUid aProtocolImpUid, - TInt aSettingsId ); - - TXIMPRequestId BindToL( - TUid aProtocolImpUid, - const TDesC16& aUsername, - const TDesC16& aPassword, - TInt aSettingsId ); - - TXIMPRequestId UnbindL(); - MXIMPFeatureInfo* GetContextFeaturesLC() const; - MXIMPObjectFactory& ObjectFactory() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - private: - MyMXIMPObjectFactoryStub* iObjFactory; - - }; - - -#endif // MXIMPFWPRESENCECONTEXT_H - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpcontextstateevent.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpcontextstateevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* 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: s_ximpcontextstateevent.cpp -* -*/ - -#include "s_ximpcontextstateevent.h" - - -TInt32 gMXIMPContextStateEventStubInterfaceId = 0; - -const MXIMPContextState& MXIMPContextStateEventStub::ContextState() const - { - MXIMPContextState* state; - return *state; - } - -const MXIMPStatus* MXIMPContextStateEventStub::StateChangeReason() const - { - MXIMPStatus* status; - return status; - } - -const TAny* MXIMPContextStateEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - return this; - } - -TAny* MXIMPContextStateEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) - { - return NULL; - } - -TInt32 MXIMPContextStateEventStub::GetInterfaceId() const - { - return gMXIMPContextStateEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpcontextstateevent.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpcontextstateevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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: s_ximpcontextstateevent.h -* -*/ -#ifndef MXIMPFWCONTEXTSTATEEVENTSTUB_H -#define MXIMPFWCONTEXTSTATEEVENTSTUB_H - -#include - - -class MXIMPContextStateEventStub : public MXIMPContextStateEvent - { - const MXIMPContextState& ContextState() const; - const MXIMPStatus* StateChangeReason() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - -#endif // MXIMPFWCONTEXTSTATEEVENTSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpidentity.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpidentity.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for identity object. -* -*/ - - -#include "s_ximpidentity.h" - -MyMXIMPIdentityStub::MyMXIMPIdentityStub() - { - - } -MyMXIMPIdentityStub::~MyMXIMPIdentityStub() - { - delete iIdentity; - } - - - -const TDesC16& MyMXIMPIdentityStub::Identity() const - { - return *iIdentity; - } - - - - - -void MyMXIMPIdentityStub::SetIdentityL( - const TDesC16& aIdentity ) - { - if (iIdentity) - { - delete iIdentity; - iIdentity = NULL; - } - iIdentity = aIdentity.AllocL(); - } - - -const TAny* MyMXIMPIdentityStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - - } - -TAny* MyMXIMPIdentityStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) -{ - -} - -TInt32 MyMXIMPIdentityStub::GetInterfaceId() const -{ - -} diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpidentity.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpidentity.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for identity object. -* -*/ - -#ifndef MyMXIMPIdentityStub_H -#define MyMXIMPIdentityStub_H - -#include -#include -#include -#include - -/** - * Interface for identity object. - * - * Identity objects are used to identify - * presentities, presentity groups and - * presentity group members, XIMP framework - * client applications etc. entities in - * XIMP Framework. - * - * @ingroup ximpdatamodelapi - * @since S60 v3.2 - */ -class MyMXIMPIdentityStub : public CBase, public MXIMPIdentity - { - -public: - - MyMXIMPIdentityStub(); - - /** - * Public destructor. - * Objects can be deleted through this interface. - */ - ~MyMXIMPIdentityStub() ; - - -public: - - - /** - * Returns identity string. - * - * @return The identity string. - */ - const TDesC16& Identity() const ; - - - - /** - * Sets identity. - * - * @param [in] aIdentity - * Identity string. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - void SetIdentityL( - const TDesC16& aIdentity ) ; - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; -private: - HBufC* iIdentity; - -}; - - -#endif // MyMXIMPIdentityStub_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpobjectfactory.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpobjectfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for XIMP Framework object factory. -* -*/ - - -#include "s_ximpobjectfactory.h" -#include "s_ximpidentity.h" - -TBool gCreateXIMPIdentity; -/** - * Instantiates new status object. - * - * @return New status object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPStatus* MyMXIMPObjectFactoryStub::NewStatusLC() {} - - -/** - * Instantiates new identity object. - * - * @return New identity object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPIdentity* MyMXIMPObjectFactoryStub::NewIdentityLC() - { - if (gCreateXIMPIdentity) - { - - - MyMXIMPIdentityStub* ret = new (ELeave) MyMXIMPIdentityStub(); - CleanupStack::PushL(ret); - return ret; - } - - return NULL; - } - - -/** - * Instantiates new restricted object collection object. - * - * @return New restricted object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPRestrictedObjectCollection* MyMXIMPObjectFactoryStub::NewRestrictedObjectCollectionLC() { return NULL;} - - -/** - * Instantiates new object collection object. - * - * @return New object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPObjectCollection* MyMXIMPObjectFactoryStub::NewObjectCollectionLC() { return NULL; } - - -/** - * Instantiates new data subscription state object. - * - * @return New data subscription state instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPDataSubscriptionState* MyMXIMPObjectFactoryStub::NewDataSubscriptionStateLC() { return NULL; } - - -const TAny* MyMXIMPObjectFactoryStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - - } - -TAny* MyMXIMPObjectFactoryStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) -{ - -} - -TInt32 MyMXIMPObjectFactoryStub::GetInterfaceId() const -{ - -} - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpobjectfactory.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpobjectfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for XIMP Framework object factory. -* -*/ - -#ifndef MyMXIMPObjectFactoryStub_H -#define MyMXIMPObjectFactoryStub_H - -#include -#include -#include -#include - - -class MXIMPStatus; -class MXIMPIdentity; -class MXIMPObjectCollection; -class MXIMPRestrictedObjectCollection; -class MXIMPDataSubscriptionState; - - -/** - * Interface for XIMP Framework object factory. - * - * XIMP object factory is used to instantiate - * data objects declared in Data Model API. - * - * MXimpFwObjectFactory interface can be obtained from - * MXIMPContext or MXIMPProtocolConnectionHost - * interfaces. - * - * @ingroup ximpdatamodelapi - * @since S60 v3.2 - */ -class MyMXIMPObjectFactoryStub : public CBase, public MXIMPObjectFactory - { -public: - - /** - * Protected destructor. - * Object instancies can't be deleted via this interface. - */ - ~MyMXIMPObjectFactoryStub() {}; - - MyMXIMPObjectFactoryStub() - { - - }; - - - /** - * Instantiates new status object. - * - * @return New status object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPStatus* NewStatusLC() ; - - - /** - * Instantiates new identity object. - * - * @return New identity object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPIdentity* NewIdentityLC() ; - - - /** - * Instantiates new restricted object collection object. - * - * @return New restricted object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPRestrictedObjectCollection* NewRestrictedObjectCollectionLC() ; - - - /** - * Instantiates new object collection object. - * - * @return New object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPObjectCollection* NewObjectCollectionLC() ; - - - /** - * Instantiates new data subscription state object. - * - * @return New data subscription state instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPDataSubscriptionState* NewDataSubscriptionStateLC() ; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - - - }; - -#endif // MyMXIMPObjectFactoryStub_H - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximppresensitygroupcontentevent.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximppresensitygroupcontentevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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: s_ximppresensitygroupcontentevent.cpp -* -*/ - -#include "s_ximppresensitygroupcontentevent.h" -#include "s_ximpidentity.h" - -TInt32 gMXIMPPresentityGroupEventStubInterfaceId = 0; -extern MyMXIMPIdentityStub gMXIMPIdentity; // already define in MPresentityPresenceEventStub - -const MXIMPIdentity& MPresentityGroupContentEventStub::GroupId() const - { - return gMXIMPIdentity; - } - -TInt MPresentityGroupContentEventStub::NewMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::NewMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info; - return *info; - } - -TInt MPresentityGroupContentEventStub::UpdatedMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::UpdatedMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info; - return *info; - } - -TInt MPresentityGroupContentEventStub::DisappearedMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::DisappearedMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info; - return *info; - } - -TInt MPresentityGroupContentEventStub::CurrentMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::CurrentMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info; - return *info; - } - -const MXIMPDataSubscriptionState& MPresentityGroupContentEventStub::DataSubscriptionState() const - { - MXIMPDataSubscriptionState* state; - return *state; - } - - -const TAny* MPresentityGroupContentEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - return this; - } - - TAny* MPresentityGroupContentEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) - { - return NULL; - } - -TInt32 MPresentityGroupContentEventStub::GetInterfaceId() const - { - return gMXIMPPresentityGroupEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximppresensitygroupcontentevent.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximppresensitygroupcontentevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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: s_ximppresensitygroupcontentevent.h -* -*/ -#ifndef MXIMPFWPRESENSITYGROUPCONTENTEVENTSTUB_H -#define MXIMPFWPRESENSITYGROUPCONTENTEVENTSTUB_H - -#include - - -class MPresentityGroupContentEventStub : public MPresentityGroupContentEvent - { - const MXIMPIdentity& GroupId() const; - TInt NewMembersCount() const; - const MPresentityGroupMemberInfo& NewMember( TInt aIndex ) const; - TInt UpdatedMembersCount() const; - const MPresentityGroupMemberInfo& UpdatedMember( TInt aIndex ) const; - TInt DisappearedMembersCount() const; - const MPresentityGroupMemberInfo& DisappearedMember( TInt aIndex ) const; - TInt CurrentMembersCount() const; - const MPresentityGroupMemberInfo& CurrentMember( TInt aIndex ) const; - const MXIMPDataSubscriptionState& DataSubscriptionState() const; - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENSITYGROUPCONTENTEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximppresensitypresenceevent.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximppresensitypresenceevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* 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: s_ximppresensitypresenceevent.cpp -* -*/ -#include "s_ximppresensitypresenceevent.h" -#include "s_ximpidentity.h" - -MyMXIMPIdentityStub gMXIMPIdentity; -//MPresenceInfo gMPresenceInfo; -//MXIMPDataSubscriptionState gMXIMPDataSubscriptionState; - -TInt32 gMXIMPPresentityPresenceEventStubInterfaceId = 0; - -const MXIMPIdentity& MPresentityPresenceEventStub::PresentityId() const - { - return gMXIMPIdentity; - } - -const MPresenceInfo& MPresentityPresenceEventStub::SubscribedPresence() const - { - MPresenceInfo* info = NULL; - return *info; - } - -const MXIMPDataSubscriptionState& MPresentityPresenceEventStub::DataSubscriptionState() const - { - MXIMPDataSubscriptionState* state = NULL; - return *state; - } - - -const TAny* MPresentityPresenceEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - return this; - } - - TAny* MPresentityPresenceEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) - { - return NULL; - } - -TInt32 MPresentityPresenceEventStub::GetInterfaceId() const - { - return gMXIMPPresentityPresenceEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximppresensitypresenceevent.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximppresensitypresenceevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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: s_ximppresensitypresenceevent.h -* -*/ -#ifndef MXIMPFWPRESENSITYPRESENCEEVENTSTUB_H -#define MXIMPFWPRESENSITYPRESENCEEVENTSTUB_H - -#include - - -class MPresentityPresenceEventStub : public MPresentityPresenceEvent - { - const MXIMPIdentity& PresentityId() const; - const MPresenceInfo& SubscribedPresence() const; - const MXIMPDataSubscriptionState& DataSubscriptionState() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENSITYPRESENCEEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximprequestcompleteevent.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximprequestcompleteevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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: s_ximprequestcompleteevent.cpp -* -*/ - -#include "s_ximprequestcompleteevent.h" - -TInt32 gMXIMPRequestCompleteEventStubInterfaceId = 0; -TXIMPRequestId gMXIMPRequestCompleteEventStubRequestId; -TBool gRequestCompleteEventResultCodeKerrNotSupported = 0; -MyXIMPStatusStub gXIMPStatus; - -const TXIMPRequestId& MXIMPRequestCompleteEventStub::RequestId() const - { - return gMXIMPRequestCompleteEventStubRequestId; - } - -const MXIMPStatus& MXIMPRequestCompleteEventStub::CompletionResult() const - { - if (gRequestCompleteEventResultCodeKerrNotSupported) - { - gXIMPStatus.SetResultCode(KErrNotSupported); - return gXIMPStatus; - } - - gXIMPStatus.SetResultCode(KErrNone); - - return gXIMPStatus; - } - -const MXIMPBase* MXIMPRequestCompleteEventStub::LookupCompletionDataByType( - TInt32 aInterfaceId ) const - { - MXIMPBase* base = NULL; - return base; - } - -const TAny* MXIMPRequestCompleteEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - return this; - } - -TAny* MXIMPRequestCompleteEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) - { - return NULL; - } - -TInt32 MXIMPRequestCompleteEventStub::GetInterfaceId() const - { - return gMXIMPRequestCompleteEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximprequestcompleteevent.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximprequestcompleteevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -/* -* 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: s_ximprequestcompleteevent.h -* -*/ -#ifndef MXIMPFWREQUESTCOMPLETEEVENTSTUB_H -#define MXIMPFWREQUESTCOMPLETEEVENTSTUB_H - -#include -#include - -class MXIMPStatus; - -class MXIMPRequestCompleteEventStub : public MXIMPRequestCompleteEvent - { - const TXIMPRequestId& RequestId() const; - const MXIMPStatus& CompletionResult() const; - const MXIMPBase* LookupCompletionDataByType( TInt32 aInterfaceId ) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - - -/** - * Interface for status object. - * - * Status object is used in XIMP Framework API - * to present result code and additional textual - * details from request completions, context - * state changes and similar events. - * - * @ingroup ximpdatamodelapi - * @since S60 v3.2 - */ -class MyXIMPStatusStub : public MXIMPStatus - { - -public: - - /** - * Gets request completion code. - * - * Result code can be: - * - one of the system wide errors - * - one of the ximp core specific errors defined in in ximperrors.hrh - * - one of the presence specific errors defined in in presenceerrors.hrh - * - error specific to the underlying communication channel - * - * @return The result code. - */ - TInt ResultCode() const { return iCode; }; - - - /** - * Gets the protocol level response code. - * - * - * @return Protocol level response code. - * KErrNone if no protocol level response code available. - */ - TInt ProtocolResultCode() const {}; - - - - /** - * Get the textual result description. - * Textual descriptions are protocol specific. - * - * @return The textual result description. - * Empty descriptor if no description available. - */ - const TDesC16& ProtocolResultDescription() const {}; - - - - /** - * Sets request completion code. - * - * @param [in] aCode - * The result code. - */ - void SetResultCode( - TInt aCode ) { iCode = aCode; }; - - - - /** - * Sets textual result description. - * - * @param [in] aCode - */ - void SetProtocolResultCode( - TInt aCode ) {}; - - - - /** - * Sets textual result description. - * - * @param [in] aDescription - * The textual result description. - */ - void SetProtocolResultDescriptionL( - const TDesC16& aDescription ) {}; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const {}; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) {}; - - TInt32 GetInterfaceId() const {}; - - private: - TInt iCode; - - }; - -#endif // MXIMPFWREQUESTCOMPLETEEVENT_H - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpsearchevent.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpsearchevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* 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: s_ximpsearchevent.cpp -* -*/ - - -#include "s_ximpsearchevent.h" - -TInt32 gMXIMPSearchEventStubInterfaceId = 0; - - -TInt MSearchEventStub::SearchResultCount()const - { - return KErrNone; - } - -const MSearchInfo& MSearchEventStub::SearchResult( TInt /*aIndex*/ )const - { - MSearchInfo* info; - return *info; - } - -const MXIMPIdentity& MSearchEventStub::SearchId()const - { - MXIMPIdentity* identity; - return *identity; - } - - -const TAny* MSearchEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - return this; - } - - TAny* MSearchEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) - { - return NULL; - } - -TInt32 MSearchEventStub::GetInterfaceId() const - { - return gMXIMPSearchEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpsearchevent.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpsearchevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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: s_ximpsearchevent.h -* -*/ -#ifndef MXIMPFWSEARCHEVENTSTUB_H -#define MXIMPFWSEARCHEVENTSTUB_H - -#include - - -class MSearchEventStub : public MSearchEvent - { - TInt SearchResultCount() const; - const MSearchInfo& SearchResult( TInt aIndex ) const; - const MXIMPIdentity& SearchId() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWSEARCHEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpsearchkeysevent.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpsearchkeysevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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: s_ximpsearchkeysevent.cpp -* -*/ - - -#include "s_ximpsearchkeysevent.h" - -TInt32 gMXIMPSearchKeysEventStubInterfaceId = 0; - - -TInt MSearchKeysEventStub::InfoCount()const - { - return KErrNone; - } - -const MSearchKeyInfo& MSearchKeysEventStub::SearchKeyInfo( TInt /*aIndex*/ )const - { - MSearchKeyInfo* info; - return *info; - } - - -const TAny* MSearchKeysEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const - { - return this; - } - - TAny* MSearchKeysEventStub::GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) - { - return NULL; - } - -TInt32 MSearchKeysEventStub::GetInterfaceId() const - { - return gMXIMPSearchKeysEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpsearchkeysevent.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_ximpsearchkeysevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* 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: s_ximpsearchkeysevent.h -* -*/ -#ifndef MXIMPFWSEARCHKEYSEVENTSTUB_H -#define MXIMPFWSEARCHKEYSEVENTSTUB_H - -#include - - -class MSearchKeysEventStub : public MSearchKeysEvent - { - TInt InfoCount() const; - const MSearchKeyInfo& SearchKeyInfo( TInt aIndex ) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWSEARCHKEYSEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_xmppsettingsapi.cpp --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_xmppsettingsapi.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for identity object. -* -*/ - - -#include "s_xmppsettingsapi.h" -TBool setpassword = EFalse; - -CXmppSettingsApi* CXmppSettingsApi::NewL() - { -// if (!myCSPSettings) -// { -// myCSPSettings = new ( ELeave ) CXmppSettingsApi; -// } -// return myCSPSettings; - return new ( ELeave ) CXmppSettingsApi; - } - -CXmppSettingsApi* CXmppSettingsApi::NewLC() - { - CXmppSettingsApi* settings = CXmppSettingsApi::NewL(); - CleanupStack::PushL( settings ); - return settings; - } - -CXmppSettingsApi::~CXmppSettingsApi() - { - - } - -void CXmppSettingsApi::CreateSettingsRecordL( TUint32& aSettingsRecordId ) - { - - } - -void CXmppSettingsApi::RemoveSettingsRecordL( TUint32 aSettingsRecordId ) - { - - } - -void CXmppSettingsApi::DefaultSettingsRecordL( TUint32& aSettingsRecordId ) - { - - } - -void CXmppSettingsApi::GetSettingsRecordIdArrayL( RArray& aArray ) - { - - } - -void CXmppSettingsApi::SetParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - const TDesC& aAttrValue ) - { - - } - -void CXmppSettingsApi::SetParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - TInt aAttrValue ) - { - - } - -void CXmppSettingsApi::GetParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - TDes& aAttrValue ) - { - if(setpassword) - { - _LIT(KText,"password"); - aAttrValue.Copy(KText); - } - else - { - _LIT(KText,""); - aAttrValue.Copy(KText); - } - } - -void CXmppSettingsApi::GetParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - TInt& aAttrValue ) - { - - } - -void CXmppSettingsApi::RemoveParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName ) - { - - } - - -void CXmppSettingsApi::GetRepositoryKeyL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - TBool aCreateColumnIfNotExist, - TUint32& aTheKey ) - { - - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_xmppsettingsapi.h --- a/imstutils/imconnectionprovider/tsrc/imconnectionprovider_test/src/stubs/s_xmppsettingsapi.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for identity object. -* -*/ - -#ifndef MyXMPPSettingApiStub_H -#define MyXMPPSettingApiStub_H -#include - -class CXmppSettingsApi : public CBase - { - -public: - - /** - * Two-phased constructor. - */ - static CXmppSettingsApi* NewL(); - - /** - * Two-phased constructor. - */ - static CXmppSettingsApi* NewLC(); - - /** - * Destructors. - */ - virtual ~CXmppSettingsApi(); - - -public: - - /** - * Creates new settings record. - * - * @since S60 5.0 - * @param aSettingsRecordId On return contains the new setting id. - */ - IMPORT_C void CreateSettingsRecordL( TUint32& aSettingsRecordId ); - - /** - * Removes Settings record using given settings record id. - * - * @since S60 5.0 - * @param aSettingsRecordId Setting id to be removed. - */ - IMPORT_C void RemoveSettingsRecordL( TUint32 aSettingsRecordId ); - - /** - * Returns default settings record id. - * - * @since S60 5.0 - * @param aSettingsRecordId On return contains the setting id. - */ - IMPORT_C void DefaultSettingsRecordL( TUint32& aSettingsRecordId ); - - /** - * Fills the array with settings ids. If there is none, array - * is zero length. - * - * @since S60 5.0 - * @param aArray Array is filled with setting ids. - */ - IMPORT_C void GetSettingsRecordIdArrayL( RArray& aArray ); - - /** - * Sets value of the param. If ParamName is not found, it creates new. - * - * @since S60 5.0 - * @param aSettingsRecordId Setting id of interest. - * @param aAttrName Parameters name. - * @param aAttrValue Parameters value. - */ - IMPORT_C void SetParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - const TDesC& aAttrValue ); - - /** - * Sets value of the param. If ParamName is not found, it creates new. - * - * @since S60 5.0 - * @param aSettingsRecordId Setting id of interest. - * @param aAttrName Parameters name. - * @param aAttrValue Parameters value. - */ - IMPORT_C void SetParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - TInt aAttrValue ); - - /** - * Gets value of the param. - * - KErrNotFound if setting collection or Param is not found. - * - * @since S60 5.0 - * @param aSettingsRecordId Setting id of interest. - * @param aAttrName Parameters name. - * @param aAttrValue On return, contains the param value. - */ - IMPORT_C void GetParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - TDes& aAttrValue ); - - /** - * Gets value of the param. - * - KErrNotFound if setting collection or Param is not found. - * - * @since S60 5.0 - * @param aSettingsRecordId Setting id of interest. - * @param aAttrName Parameters name. - * @param aAttrValue On return, contains the param value. - */ - IMPORT_C void GetParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - TInt& aAttrValue ); - - /** - * Removes this param from this Settings record. - * - KErrNotFound If Settings record or param is not found. - * - * @since S60 5.0 - * @param aSettingsRecordId Setting id. - * @param aAttrName Parameters name. - */ - IMPORT_C void RemoveParamL( TUint32 aSettingsRecordId, - const TDesC& aAttrName ); - - - /** - * This method does checks before setting or getting values. - * - * @since S60 5.0 - * @param aSettingsRecordId Setting id to be changed. - * @param aAttrName Parameters name. - * @param aCreateColumnIfNotExist Should new column be created if it is not - * founded (by aAttrName). - * @param aTheKey On return contains key to be created/changed. - */ - IMPORT_C void GetRepositoryKeyL( TUint32 aSettingsRecordId, - const TDesC& aAttrName, - TBool aCreateColumnIfNotExist, - TUint32& aTheKey ); - - -private: - -}; - - -#endif // MyXMPPSettingApiStub_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/group/bld.inf --- a/imstutils/imconversationview/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: build definition file -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -../rom/imconversationview.iby CORE_APP_LAYER_IBY_EXPORT_PATH(imconversationview.iby) -../rom/imconversationviewresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(imconversationviewresources.iby) -// ROM SIS stubs -../sis/imcvuiappstub.sis /epoc32/data/Z/System/Install/imcvuiappstub.sis -// include file of all component - -#include "../imcvuiengine/group/bld.inf" -#include "../imcvuiapp/group/bld.inf" -#include "../imcvlauncher/group/bld.inf" -#include "../imcmslauncherplugin/group/bld.inf" - -// test module -//#include "../internal/testui/group/bld.inf" -//#include "../tsrc/imcvuiengine_test/group/bld.inf" - -// end of file \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcmslauncherplugin/group/bld.inf --- a/imstutils/imconversationview/imcmslauncherplugin/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2008 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: This plugin is loaded by the Communication Launcher -* -*/ - - - -#include - - - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -PRJ_MMPFILES -imcmslauncherplugin.mmp - -PRJ_TESTMMPFILES - -PRJ_TESTEXPORTS - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcmslauncherplugin/group/imcmslauncherplugin.hrh --- a/imstutils/imconversationview/imcmslauncherplugin/group/imcmslauncherplugin.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2008 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: Interface Definition of cmscontactor implemtation plugin -* -*/ - -#ifndef IMCMSLAUNCHERPLUGIN_HRH -#define IMCMSLAUNCHERPLUGIN_HRH - - -/** - * CMS contactor interface id - */ -#define CMS_CONTACTOR_IM_PLUGIN_INTERFACE_UID 0x200113BA - - -#endif // IMCMSLAUNCHERPLUGIN_HRH - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcmslauncherplugin/group/imcmslauncherplugin.mmp --- a/imstutils/imconversationview/imcmslauncherplugin/group/imcmslauncherplugin.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2008 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: This plugin is loaded by the Communication Launcher -* -*/ - -// To get the MW_LAYER_SYSTEMINCLUDE-definition -#include -#include -#include "imcmslauncherplugin.hrh" - -TARGET imcmslauncherplugin.dll -TARGETTYPE plugin - -// Note: TAKE NEW UIDS -UID 0x10009D8D 0x200255D1 - -VERSION 10.0 - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -// ECOM RESOURCE -START RESOURCE imcmslauncherplugin.rss -TARGET imcmslauncherplugin -TARGETPATH ECOM_RESOURCE_DIR -END - - -SOURCEPATH ../src -SOURCE imcmslauncherplugin.cpp - - -USERINCLUDE . -USERINCLUDE ../inc - -APP_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/ecom - -LIBRARY euser.lib // Base -LIBRARY ecom.lib -LIBRARY bafl.lib -LIBRARY charconv.lib - -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY apgrfx.lib - -DEBUGLIBRARY flogger.lib // Sending trace data to log file -DEBUGLIBRARY efsrv.lib // file server -LIBRARY apparc.lib - -// imcvlauncher -LIBRARY imcvlauncher.lib -LIBRARY serviceprovidersettings.lib - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcmslauncherplugin/group/imcmslauncherplugin.rss --- a/imstutils/imconversationview/imcmslauncherplugin/group/imcmslauncherplugin.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2008 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: This plugin is loaded by the Communication Launcher -* -*/ - - -#include -#include "imcmslauncherplugin.hrh" - - -// --------------------------------------------------------------------------- -// ECOM registery info for CMS contactor Plugin -// --------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO theInfo - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = 0x200255D1; - - interfaces = - { - INTERFACE_INFO - { - // implemented interface - interface_uid = CMS_CONTACTOR_IM_PLUGIN_INTERFACE_UID; - - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0x200255D0; - version_no = 1; - display_name = "imcmslauncherplugin"; - default_data = "Launch"; - opaque_data = ""; - } - }; - } - }; - } - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcmslauncherplugin/inc/imcmslauncherplugin.h --- a/imstutils/imconversationview/imcmslauncherplugin/inc/imcmslauncherplugin.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2008 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: This plugin is loaded by the Communication Launcher -* -*/ - - -#ifndef CIMCMSLAUNCHERPLUGIN_H -#define CIMCMSLAUNCHERPLUGIN_H - -#include -#include - - -/** - * CImCmsLauncherPlugin - * - * Implementation of Communication Launcher Plugin - * - * @lib imcmslauncherplugin - * @since s60 v5.0 - */ -class CImCmsLauncherPlugin: public CCmsContactorImPluginBase - { -public: - - /** - * Two-phased constructor. - * @return Instance of this class - */ - static CImCmsLauncherPlugin* NewL(); - - - /** - * C++ default destructor. - */ - virtual ~CImCmsLauncherPlugin(); - -private: - - /** - * C++ default constructor. - */ - CImCmsLauncherPlugin(); - - -public: - - // from base class MCmsContactorImPluginApi - - /** - * Defined in a base class - */ - - void ExecuteL( const TDesC& aXspId ); - - }; - -#endif // CIMCMSLAUNCHERPLUGIN_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcmslauncherplugin/src/imcmslauncherplugin.cpp --- a/imstutils/imconversationview/imcmslauncherplugin/src/imcmslauncherplugin.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* Copyright (c) 2008 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: This plugin is loaded by the Communication Launcher -* -*/ - - -#include -#include -#include "imcmslauncherplugin.h" -#include - -#include -#include - -#include -#include - -#include - - -// ======== MEMBER FUNCTIONS ======== - - -// --------------------------------------------------------------------------- -// Key value pair table to identify correct constructor -// function for the requested interface. -// --------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( 0x200255D0, CImCmsLauncherPlugin::NewL ) - }; - -// --------------------------------------------------------------------------- -// Exported function to return the implementation proxy table -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); - return ImplementationTable; - } - -// --------------------------------------------------------------------------- -// CImCmsLauncherPlugin::CImCmsLauncherPlugin() -// --------------------------------------------------------------------------- -// -CImCmsLauncherPlugin::CImCmsLauncherPlugin() - { - } - -// --------------------------------------------------------------------------- -// CImCmsLauncherPlugin::NewL() -// --------------------------------------------------------------------------- -// -CImCmsLauncherPlugin* CImCmsLauncherPlugin::NewL() - { - return new( ELeave ) CImCmsLauncherPlugin(); - } - -// --------------------------------------------------------------------------- -// CImCmsLauncherPlugin::~CImCmsLauncherPlugin() -// --------------------------------------------------------------------------- -// -CImCmsLauncherPlugin::~CImCmsLauncherPlugin() - { - - } - -// --------------------------------------------------------------------------- -// CImCmsLauncherPlugin::ExecuteL -// --------------------------------------------------------------------------- -// -void CImCmsLauncherPlugin::ExecuteL( const TDesC& aXspId ) - { - - - // launch the UI - TVwsViewId activeViewId; - TInt serviceId = KErrNotFound; - - //Get the active view id. This used for getting the focus - //back to the application which launched the CV - CCoeEnv::Static()->AppUi()->GetActiveViewId( activeViewId ); - - // Call to launch the conversation view - TInt serviceIdStart = aXspId.Locate(':'); - - //Get the User Id - HBufC* userId = aXspId.Right(aXspId.Length() - serviceIdStart - 1).AllocLC(); - - if (serviceIdStart) - { - //Check to see whether its a valid service id - //then there is service id. set it in the RProperty - TInt err = KErrNone; - CDesCArrayFlat* nameArray = NULL; - - RIdArray ids; - CleanupClosePushL( ids ); - - HBufC* serviceName = aXspId.Left(serviceIdStart).AllocLC(); - - CSPSettings* settings = CSPSettings::NewLC(); - - nameArray = new (ELeave) CDesCArrayFlat(2); - CleanupStack::PushL( nameArray ); - - //Get the service table id's - err = settings->FindServiceIdsL( ids ); - User::LeaveIfError( err ); - - //get the service names - err = settings->FindServiceNamesL( ids, *nameArray ); - User::LeaveIfError( err ); - - TInt count = nameArray->MdcaCount(); - for ( TInt i(0); i < count; i++) - { - // search the mathching service name - TPtrC p = nameArray->MdcaPoint( i ); - if (!p.CompareF( *serviceName )) - { - // We have found the service, - serviceId = ids[i]; - break; - } - } - CleanupStack::PopAndDestroy( 4 ); - - } - - if (KErrNotFound != serviceId) - { - //if valid service - TInt err = IMCVLauncher::LaunchImConversationViewL(activeViewId, serviceId, userId->Des(), CmsParameter()->DisplayName()); - CleanupStack::PopAndDestroy(); - User::LeaveIfError(err); - return; - } - - CleanupStack::PopAndDestroy(); - User::LeaveIfError(KErrArgument); - - } - -// End of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvlauncher/bwins/imcvlauncheru.def --- a/imstutils/imconversationview/imcvlauncher/bwins/imcvlauncheru.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?LaunchImConversationViewL@IMCVLauncher@@SAHVTVwsViewId@@HABVTDesC16@@1PAVMVPbkContactLink@@@Z @ 1 NONAME ; int IMCVLauncher::LaunchImConversationViewL(class TVwsViewId, int, class TDesC16 const &, class TDesC16 const &, class MVPbkContactLink *) - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvlauncher/eabi/imcvlauncheru.def --- a/imstutils/imconversationview/imcvlauncher/eabi/imcvlauncheru.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _ZN12IMCVLauncher25LaunchImConversationViewLE10TVwsViewIdiRK7TDesC16S3_P16MVPbkContactLink @ 1 NONAME - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvlauncher/group/bld.inf --- a/imstutils/imconversationview/imcvlauncher/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2008 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: build file -* -*/ - - -// Platforms - -PRJ_PLATFORMS -DEFAULT -// IM cv exports api -PRJ_EXPORTS - -// IM open conversation components -PRJ_MMPFILES -imcvlauncher.mmp - -// End of file \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvlauncher/group/imcvlauncher.mmp --- a/imstutils/imconversationview/imcvlauncher/group/imcvlauncher.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2008 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: imcvlauncher.dll project definition file. -* -*/ - - -#include -#include -#include "../../inc/imcvuicommonuids.h" - -CAPABILITY CAP_GENERAL_DLL - -// Build target -TARGET imcvlauncher.dll -TARGETTYPE dll -UID KIMCVLAUNCHERUid2 KIMCVLAUNCHERUid3 - -VERSION 10.0 - -VENDORID VID_DEFAULT -// Source files location -SOURCEPATH ../src -// Source files -SOURCE imcvlauncher.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../../imconnectionprovider/inc -USERINCLUDE ../../../../group - -APP_LAYER_SYSTEMINCLUDE - -// Dependencies to system components -LIBRARY euser.lib -LIBRARY cone.lib -// logs -LIBRARY flogger.lib -LIBRARY serviceprovidersettings.lib - -// xmpp settings -LIBRARY jabbersettings.lib -// End of File - -// for task switching TApaTaskList class -LIBRARY apgrfx.lib -LIBRARY vpbkeng.lib - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvlauncher/src/imcvlauncher.cpp --- a/imstutils/imconversationview/imcvlauncher/src/imcvlauncher.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/* -* Copyright (c) 2008 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: launcher class for launching the conversation view -* -*/ - - -// INCLUDE FILES - -#include "imcvlauncher.h" -#include "imcvuiliterals.h" - -// logs file -#include "imcvlogger.h" -#include "imcvuiparams.h" - -//system includes -#include - -#include -#include -#include -#include -#include -#include -#include -#include "xmppparams.h" -#include "xmppservicesettingsapi.h" - -#include - -// Unique implementation Uid for this example -#define KIMCONTACTSEXTNIMPLEMENTATIONUID 0x20012423 -#define KIMCVUIAPPEXEUID3 0x20012425 - -//----------------------------------------------------------------------------- -// IMCVLauncher::LaunchImConversationViewL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -EXPORT_C TInt IMCVLauncher::LaunchImConversationViewL(TVwsViewId aActiveViewId, - TInt aServiceId, - const TDesC& aRecipientUserId, - const TDesC& aDisplayName , - MVPbkContactLink* aContactLink ) - { - IM_CV_LOGS(TXT("IMCVLauncher::LaunchImConversationViewL start") ); - IM_CV_LOGS(TXT("IMCVLauncher:: aRecipientUserId = %s "), &aRecipientUserId ); - - TInt err = RProperty::Define(KMeCoPropertyUid, KMeCoConvViewServiceIdKey, RProperty::EInt, - ECapabilityReadUserData ,ECapabilityWriteUserData); - - RProperty::Set( KMeCoPropertyUid, KMeCoConvViewServiceIdKey, aServiceId ); - - //check whether its valid service and then only proceed - if (!CheckValidServiceL(aServiceId)) - { - return KErrArgument; - } - // packing of data ,passed to conversation view - TPckgBuf< TIMCVUiParams > params; - - params().iAppUid = aActiveViewId.iAppUid.iUid; - params().iViewUid = aActiveViewId.iViewUid.iUid; - params().iBuddyId = aRecipientUserId; - params().iBuddyName = aDisplayName; - - if ( aContactLink ) - { - params().iContactLink = aContactLink->PackLC()->Des(); - CleanupStack::PopAndDestroy(); //pop and destroy the hbufc8* - } - - TApaTaskList taskList( CCoeEnv::Static()->WsSession() ); - TApaTask task = taskList.FindApp( KConversationViewAppUid ); - if ( task.Exists() ) - { - task.SendMessage(TUid::Uid( KUidApaMessageSwitchOpenFileValue ), params ); - } - else - { - // conversation view application uid and view uid - // system call will activate the same view. - TVwsViewId view( KConversationViewAppUid, KUidConversationsView ); - - CCoeEnv::Static()->AppUi()->CreateActivateViewEventL(view, - KUidIMCViewSoftNoteActivationId, - params ) ; - } - - - - IM_CV_LOGS(TXT("IMCVLauncher::LaunchImConversationViewL end") ); - - return KErrNone; - - } - - - -//----------------------------------------------------------------------------- -// IMCVLauncher::CheckValidServiceL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TBool IMCVLauncher::CheckValidServiceL(TInt aServiceId) - { - - CSPSettings* settings = CSPSettings::NewLC(); - - //check whether it has IMSubservice - CSPProperty* property = CSPProperty::NewLC(); - TInt err = settings->FindPropertyL( aServiceId, - ESubPropertyIMEnabled, - *property ); - - if ( err ) - { - CleanupStack::PopAndDestroy( 2 ); - return EFalse; - } - - //check whether it has IMSubservice valid for Meco ServiceTab - TInt contactViewUid = KErrNotFound; - err = settings->FindPropertyL( aServiceId, - EPropertyContactViewPluginId, - *property ); - if ( property ) - { - property->GetValue( contactViewUid ); - } - - if ( err ) - { - CleanupStack::PopAndDestroy( 2 ); - return EFalse; - } - - - if ( TUid::Uid( contactViewUid ) == - TUid::Uid( KIMCONTACTSEXTNIMPLEMENTATIONUID ) - || TUid::Uid( contactViewUid ) == - TUid::Uid( 0x20007B6D ) - || TUid::Uid(contactViewUid) == - TUid::Uid(0x2002B334)) - { - CleanupStack::PopAndDestroy( 2 ); - return ETrue; - } - - CleanupStack::PopAndDestroy( 2 ); - return EFalse; - } - -// --------------------------------------------------------------------------- -// IMCVLauncher::PropertySettingsIdL() -// --------------------------------------------------------------------------- -// -TInt IMCVLauncher::PropertySettingsIdL(TUint32 aServiceId ) - { - CSPSettings* settings = CSPSettings::NewLC(); - - // default to english - TInt settingsId = -1; - CSPProperty* property = CSPProperty::NewLC(); - settings->FindPropertyL( aServiceId, - ESubPropertyIMSettingsId, - *property ); - if ( property ) - { - property->GetValue( settingsId ); - } - CleanupStack::PopAndDestroy( 2,settings ); - - return (settingsId); - } -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_away.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_away.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_busy.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_busy.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_invisible.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_invisible.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_off.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_off.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_on.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_contact_on.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_from.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_from.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_angry.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_angry.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_bored.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_bored.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_crying.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_crying.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_glasses.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_glasses.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_happy.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_happy.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_indif.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_indif.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_kiss.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_kiss.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_laugh.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_laugh.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_robot.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_robot.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_sad.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_sad.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_shock.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_shock.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_skeptical.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_skeptical.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_sleepy.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_sleepy.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_sunglasses.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_sunglasses.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_surprise.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_surprise.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_tired.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_tired.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_veryhappy.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_veryhappy.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_verysad.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_verysad.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_wickedsmile.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_wickedsmile.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_wink.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_smileys_wink.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_tome.svg --- a/imstutils/imconversationview/imcvuiapp/bitmaps/qgn_prop_imcv_tome.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/group/bld.inf --- a/imstutils/imconversationview/imcvuiapp/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: build information file -* -*/ - - -// -// Platforms -// -PRJ_PLATFORMS -DEFAULT - -// -// Exports -// -//PRJ_EXPORTS - - -// mmp file -PRJ_MMPFILES -// icons (bitmap icons must have some different names than scalable icons) - -//enable when branding is needed. -//gnumakefile import.mk - - - -imcvuiapp.mmp - -PRJ_EXTENSIONS - -// Using mifconv_ext tool ( replacing gnu make to create icons ) To know more about mifconv tool go to the below link: -// http://s60wiki.nokia.com/S60Wiki/Mifconv_extension#Use_of_Iconlist_-_Icon_sources_are_fetched_from_.5Cepoc32.5Cs60.5Cicons - -START EXTENSION s60/mifconv -OPTION TARGETFILE imcvuiapp.mif -OPTION HEADERFILE imcvuiapp.mbg -OPTION SOURCES -c8,1 qgn_prop_im_off_title \ - -c8,1 qgn_prop_im_on_title \ - -c8,1 qgn_prop_im_away_title \ - -c8,1 qgn_prop_im_busy_title \ - -c8,1 qgn_prop_im_invisible_title \ - -c8,1 qgn_prop_im_on_mobile_title \ - -c8,1 qgn_prop_im_smileys_happy \ - -c8,1 qgn_prop_im_smileys_sad \ - -c8,1 qgn_prop_im_smileys_laugh \ - -c8,1 qgn_prop_im_smileys_wink \ - -c8,1 qgn_prop_im_smileys_kiss \ - -c8,1 qgn_prop_im_smileys_angry \ - -c8,1 qgn_prop_im_smileys_bored \ - -c8,1 qgn_prop_im_smileys_crying \ - -c8,1 qgn_prop_im_smileys_glasses \ - -c8,1 qgn_prop_im_smileys_indif \ - -c8,1 qgn_prop_im_smileys_robot \ - -c8,1 qgn_prop_im_smileys_shock \ - -c8,1 qgn_prop_im_smileys_skeptical \ - -c8,1 qgn_prop_im_smileys_sleepy \ - -c8,1 qgn_prop_im_smileys_sunglasses \ - -c8,1 qgn_prop_im_smileys_surprise \ - -c8,1 qgn_prop_im_smileys_tired \ - -c8,1 qgn_prop_im_smileys_veryhappy \ - -c8,1 qgn_prop_im_smileys_verysad \ - -c8,1 qgn_prop_im_smileys_wickedsmile \ - -c8,1 qgn_prop_im_tome \ - -c8,1 qgn_prop_im_from \ - -c8,8 qgn_indi_tb_msg_send \ - -c8,8 qgn_indi_tb_smiley \ - -c8,8 qgn_indi_tb_business_card \ - -c8,1 qgn_indi_im_msg_editor -END - - -// end of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/group/imcvuiapp.mmp --- a/imstutils/imconversationview/imcvuiapp/group/imcvuiapp.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: mmp file -* -*/ - - -#include -#include -#include "../../inc/imcvuicommonuids.h" - -CAPABILITY CAP_APPLICATION NetworkControl - -TARGET imcvuiapp.exe -TARGETTYPE exe -UID KIMCVUIAPPEXEUID2 KIMCVUIAPPEXEUID3 - -VENDORID VID_DEFAULT - -VERSION 10.0 - -START RESOURCE ../rss/imcvuiapp.rss -HEADER -TARGETPATH APP_RESOURCE_DIR -LANGUAGE_IDS -END - -START RESOURCE ../rss/imcvuiapp_reg.rss -DEPENDS imcvuiapp.rsg -// Do not change the UID below. -TARGETPATH /private/10003a3f/apps -END - - -SOURCEPATH ../src -SOURCE cimcvapp.cpp -SOURCE cimcvappapplication.cpp -SOURCE cimcvappdocument.cpp -SOURCE cimcvappui.cpp -SOURCE cimcvappview.cpp -SOURCE cimcvappviewcontainer.cpp -SOURCE cimcvappviewcontrol.cpp -SOURCE cimcvapptextviewcontrol.cpp -SOURCE cimcvapprichtextcontainer.cpp -SOURCE cimcvappcustomdraw.cpp -SOURCE cimcvappmessageflowhandler.cpp -SOURCE cimcvappmessagewrapper.cpp -SOURCE cimcvappmessageextensionshandler.cpp -SOURCE cimcvapplayoutinfo.cpp -SOURCE cimcvappstatuspanehandler.cpp -SOURCE cimcvappsmileyinformation.cpp -SOURCE cimcvapppicture.cpp -SOURCE cimcvappsmileyutil.cpp -SOURCE cimcvappsmileicondialog.cpp -SOURCE cimcvappsmileicongrid.cpp -SOURCE cimcvappsmileiconutility.cpp -SOURCE cimcvappsmilestring.cpp -SOURCE imcvuiapputils.cpp -SOURCE imcvuiappnotemapper.cpp -SOURCE cimcvuiappskinvariant.cpp -SOURCE cimcvuiappiconfileprovider.cpp -SOURCE cimcvappinputabsorber.cpp -SOURCE cimcvappwaitnote.cpp -SOURCE cimcvnewmsgfadecontrol.cpp -SOURCE cimcvappmessageeditor.cpp -SOURCE cimcvapprichtextcontainercache.cpp -SOURCE cimcvcommandinfo.cpp -SOURCE cimcvmenuextensionmanager.cpp - -USERINCLUDE ../inc -USERINCLUDE ../rss -USERINCLUDE ../../inc -USERINCLUDE ../../../../inc -USERINCLUDE ../../imcvuiengine/inc -USERINCLUDE ../../../../group -USERINCLUDE ../../../../uiservicetab/vimpstdetailsviewplugin/inc - -// For context sensitive help. -USERINCLUDE ../../../help/inc - - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY commonengine.lib -LIBRARY euser.lib -LIBRARY apparc.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY fbscli.lib -LIBRARY eikcoctl.lib -LIBRARY eikdlg.lib -LIBRARY avkon.lib -LIBRARY bafl.lib -LIBRARY eikctl.lib -LIBRARY egul.lib -LIBRARY uiklaf.lib -LIBRARY aknlayout.lib -LIBRARY aknnotify.lib - -LIBRARY gdi.lib -LIBRARY estor.lib -LIBRARY form.lib // CTextView -LIBRARY etext.lib // CRichText -LIBRARY aknlayout2.lib -LIBRARY aknlayout2scalable.lib -LIBRARY caf.lib -LIBRARY aknskins.lib -LIBRARY efsrv.lib -LIBRARY sysutil.lib -LIBRARY aknicon.lib //avkon icons -LIBRARY flogger.lib -LIBRARY ws32.lib -LIBRARY apgrfx.lib // aptasklist -LIBRARY commonUi.lib -LIBRARY centralrepository.lib -LIBRARY charconv.lib - -LANG SC -LIBRARY aiwdialdata.lib -LIBRARY ServiceHandler.lib -LIBRARY serviceprovidersettings.lib -//CCA -LIBRARY ccaclient.lib - -// For Context Sensitive Help -LIBRARY hlplch.lib - -// common libraries -LIBRARY imcvengine.lib - -// ecom -LIBRARY ecom.lib -// end of file \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappapplication.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappapplication.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: application class -* -*/ - - -#ifndef CIMCVAPPAPPLICATION_H -#define CIMCVAPPAPPLICATION_H - -#include - - -/*! - @class CIMCVAppApplication - - @discussion An instance of CIMCVAppApplication is the application part of the AVKON - application framework for the conversationview application - */ -class CIMCVAppApplication : public CAknApplication - { -public: // from CAknApplication - -/*! - @function AppDllUid - - @discussion Returns the application DLL UID value - @result the UID of this Application/Dll - */ - TUid AppDllUid() const; - -protected: // from CAknApplication -/*! - @function CreateDocumentL - - @discussion Create a CApaDocument object and return a pointer to it - @result a pointer to the created document - */ - CApaDocument* CreateDocumentL(); - }; - -#endif // CIMCVAPPAPPLICATION_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappbitmapmapping.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappbitmapmapping.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Defines the corresponding TAknsItemIds for bitmaps -* Description : Handles statuspane, context pane, navi pane -* -*/ - - - -#ifndef CIMCVAPPBITMAPMAPPING_H -#define CIMCVAPPBITMAPMAPPING_H - - -// INCLUDES -#include -#include -#include - -#include -#include - - -// STRUCTURES -struct TCABitmapMapping - { - TInt iBitmapId; - // must be pointer since msvc wont compile this if it's reference - const TAknsItemID* iItemId; - TInt iColorGroupId; - }; - - -// CONSTANTS - -static const TCABitmapMapping KCABitmaps[] = - { - // the color groups are from Avkon Skin LAF - - - { EMbmImcvuiappQgn_prop_im_smileys_happy, &KAknsIIDQgnPropImSmileysHappy, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_sad, &KAknsIIDQgnPropImSmileysSad, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_laugh, &KAknsIIDQgnPropImSmileysLaugh, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_wink, &KAknsIIDQgnPropImSmileysWink, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_kiss, &KAknsIIDQgnPropImSmileysKiss , 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_angry, &KAknsIIDQgnPropImSmileysAngry, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_bored, &KAknsIIDQgnPropImSmileysBored, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_crying, &KAknsIIDQgnPropImSmileysCrying, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_glasses, &KAknsIIDQgnPropImSmileysGlasses, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_indif, &KAknsIIDQgnPropImSmileysIndif, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_robot, &KAknsIIDQgnPropImSmileysRobot, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_shock, &KAknsIIDQgnPropImSmileysShock, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_skeptical, &KAknsIIDQgnPropImSmileysSkeptical, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_sleepy, &KAknsIIDQgnPropImSmileysSleepy, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_sunglasses, &KAknsIIDQgnPropImSmileysSunglasses, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_surprise, &KAknsIIDQgnPropImSmileysSurprise , 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_tired, &KAknsIIDQgnPropImSmileysTired, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_veryhappy, &KAknsIIDQgnPropImSmileysVeryhappy, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_verysad, &KAknsIIDQgnPropImSmileysVerysad, 0 }, - { EMbmImcvuiappQgn_prop_im_smileys_wickedsmile, &KAknsIIDQgnPropImSmileysWickedsmile, 0 }, - { EMbmImcvuiappQgn_prop_im_from, &KAknsIIDQgnPropImFrom, EAknsCIQsnIconColorsCG13 }, - { EMbmImcvuiappQgn_prop_im_tome, &KAknsIIDQgnPropImTome, EAknsCIQsnIconColorsCG13 }, - // other than Chat icons - { EMbmAvkonQgn_prop_empty, &KAknsIIDQgnPropEmpty, 0 }, - - // end of list - { KErrNotFound, &KAknsIIDNone, KErrNotFound } - }; - -#endif // CIMCVAPPBITMAPMAPPING_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappcustomdraw.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappcustomdraw.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: custom class -* -*/ - - -#ifndef _CIMCVAPPCUSTOMDRAW_H_ -#define _CIMCVAPPCUSTOMDRAW_H_ - -// INCLUDES -#include - -// CLASS DECLARATION -class CAknsBasicBackgroundControlContext; -class CCoeControl; - -/** -* Draws skins for invite viewer -*/ -class CIMCVAppCustomDraw : public CBase, public MFormCustomDraw - { - public: // Constructors and destructor - - /** - * Destructor. - */ - virtual ~CIMCVAppCustomDraw(); - - public: // New functions - - /** - * Set new viewing rectangle - * @param aRect New viewing rectangle - * @since 5.0 - */ - void SetRect( const TRect& aRect ); - - /** - * Sets the background graphic of text. - * - * @param aBgContext Background context which is used for drawing - * @param aParent Parent from which to get context position - * @since 5.0 - */ - void SetBackgroundContext( - CAknsBasicBackgroundControlContext* aBgContext, - CCoeControl* aParent ); - - public: // Functions from base classes - - /** - * @see MFormCustomDraw - */ - void DrawBackground( const TParam& aParam, const TRgb& aBackground, TRect& aDrawn ) const; - - - public: - - /** - * C++ default constructor. - */ - CIMCVAppCustomDraw( TRect aViewRect ); - - private: //Data - - // owned, view rect - TRect iViewRect; - - // Not owned. pointer to skinned background context - CAknsBasicBackgroundControlContext* iBgContext; - - // Not owned. parent control for drawing the skin in correct place - CCoeControl* iParent; - }; - -#endif // _CIMCVAPPCUSTOMDRAW_H_ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappdocument.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappdocument.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: document part of avkon -* -*/ - -#ifndef CIMCVAPPDOCUMENT_H -#define CIMCVAPPDOCUMENT_H - - -#include -#include -// Forward references -class CIMCVAppUi; -class CEikApplication; -class CEikAppUi; - -/*! - @class CIMCVAppDocument - - @discussion An instance of class CIMCVAppDocument is the Document part of the AVKON - application framework for the conversationview example application - */ -class CIMCVAppDocument : public CAknDocument - { -public: - -/*! - @function NewL - - @discussion Construct a CIMCVAppDocument for the AVKON application aApp - using two phase construction, and return a pointer to the created object - @param aApp application creating this document - @result a pointer to the created instance of CIMCVAppDocument - */ - static CIMCVAppDocument* NewL(CEikApplication& aApp); - -/*! - @function NewLC - - @discussion Construct a CIMCVAppDocument for the AVKON application aApp - using two phase construction, and return a pointer to the created object - @param aApp application creating this document - @result a pointer to the created instance of CIMCVAppDocument - */ - static CIMCVAppDocument* NewLC(CEikApplication& aApp); - -/*! - @function ~CIMCVAppDocument - - @discussion Destroy the object and release all memory objects - */ - ~CIMCVAppDocument(); - -public: // from CAknDocument -/*! - @function CreateAppUiL - - @discussion Create a CIMCVAppUi object and return a pointer to it - @result a pointer to the created instance of the AppUi created - */ - CEikAppUi* CreateAppUiL(); - - /** - * This method makes an application hidden so that it is not visible - * for example in Applications list and FastSwap window. - * @param aWgName ,aWgName - * @return void - */ - void UpdateTaskNameL( CApaWindowGroupName* aWgName ); - -private: - -/*! - @function ConstructL - - @discussion Perform the second phase construction of a CIMCVAppDocument object - */ - void ConstructL(); - -/*! - @function CIMCVAppDocument - - @discussion Perform the first phase of two phase construction - @param aApp application creating this document - */ - CIMCVAppDocument(CEikApplication& aApp); - - }; - - -#endif // CIMCVAPPDOCUMENT_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappinputabsorber.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappinputabsorber.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2006 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: Instance of this class catches key inputs when it is activated -* -*/ - - - -#ifndef CIMCVAPPINPUTABSORBER_H -#define CIMCVAPPINPUTABSORBER_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CEikAppUi; - -// CLASS DECLARATION - -/** -* Instance of this class catches key events when instance is activated -* Activation is handled by pushing control to view stack -* -* @lib chat.app -* @since 1.2 -*/ -class CIMCVAppInputAbsorber : public CCoeControl - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIMCVAppInputAbsorber* NewL(); - - /** - * Destructor. - */ - virtual ~CIMCVAppInputAbsorber(); - - public: // New functions - - /** - * Starts capturing events - */ - void CaptureEventsL(); - - /** - * Stops capturing events - */ - void Release(); - - /** - * Are events captured now - * @return Are events captured now - */ - TBool IsCaptured() const; - - public: // Functions from base classes - - /** - * @see CCoeControl - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - - /** - * @see CCoeControl - */ - void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - - private: - - /** - * C++ default constructor. - */ - CIMCVAppInputAbsorber(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: //data - // Doesn't own. Handle to EikAppUi - CEikAppUi* iAppUi; - // Event capturing status - TBool iIsCaptured; - - }; - -#endif // CIMCVAPPINPUTABSORBER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvapplayoutinfo.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvapplayoutinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,321 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: layout info class -* -*/ - - -#ifndef CIMCVAPPLAYOUTINFO_H -#define CIMCVAPPLAYOUTINFO_H - -// INCLUDES - -#include "mimcvapplayoutinfo.h" -#include "mimcvapplayoutchangeobserver.h" - -#include -#include -// FORWARD DECLARATIONS - -// CLASS DECLARATION - -/** -* Layout and render info for im Listbox's item drawer and view -* Helps to calculate and draw items. -* -* @lib imcvuiapp.exe -* @since 5.0 -*/ -class CIMCVAppLayoutInfo : public CBase, - public MIMCVAppLayoutInfo, - public MIMCVAppLayoutChangeObserver - { - public: // Constructors and destructor - - /** - * Two-phased constructor using default smile icon array. - */ - static CIMCVAppLayoutInfo* NewL( TChatListBoxLayout::TLayout aLayoutID ); - - /** - * Destructor. - */ - virtual ~CIMCVAppLayoutInfo(); - - public: // New methods - - - public: // from MIMCVAppLayoutInfo - - /** - * MainPaneRect - * rect of main pane. - */ - void SetLayoutID( TChatListBoxLayout::TLayout aLayout ); - - /** - * MainPaneRect - * rect of main pane. - */ - TRect MainPaneRect(); - - - /** - * ScreenRect - * rect of main pane. - */ - TRect ScreenRect(); - - /** - * SetEditorVisibility - */ - void SetEditorVisibility( TBool aVisible ); - - /** - * EditorVisibility - */ - TBool EditorVisibility(); - - /** - * im_reading_pane - * im reading pande - * param@ aIndex_h, index of reading pane - */ - TAknWindowLineLayout im_reading_pane(TInt aIndex_H); - - /** - * im_reading_field - * im reading pane. - * param@ aIndex_t, index of reading field - */ - TAknWindowLineLayout im_reading_field(TInt aIndex_t); - - /** - * IM_text_elements - * im text elements - * @param aLineIndex, index of text element - */ - TAknWindowLineLayout IM_text_elements(TInt aLineIndex); - - /** - * IM_reading_pane_texts_Line_1 - * im reading pane text line 1 - * @param aCommon1, command to excute - */ - TAknTextLineLayout IM_reading_pane_texts_Line_1(TInt aCommon1); - - /** - * IM_reading_pane_texts_Line_2 - * imreading pane text line2 - */ - TAknTextLineLayout IM_reading_pane_texts_Line_2(); - - - /** - * im_writing_pane - * im writing pane - * @param aCommon1, command to excute - */ - TAknWindowLineLayout im_writing_pane(TInt aCommon1); - - /** - * IM_writing_field_elements_Line_1 - * im writing field element line 1 - * @param aIndex_H, index of writing element - */ - TAknWindowLineLayout IM_writing_field_elements_Line_1(TInt aIndex_H); - - /** - * IM_writing_field_elements_Line_2 - * im writing fields elements line 2 - */ - TAknWindowLineLayout IM_writing_field_elements_Line_2(); - - /** - * IM_writing_field_elements_Line_3 - * im writing fields elements line 3 - * @param aIndex_H, index of writing field element - */ - TAknWindowLineLayout IM_writing_field_elements_Line_3(TInt aIndex_H); - - /** - * Multiline_IM_writing_pane_texts_Line_1 - * im writing pane text line 1 - * @param aNumberOfLinesShown, no of line to shown in the pane - */ - TAknMultiLineTextLayout Multiline_IM_writing_pane_texts_Line_1( - TInt aNumberOfLinesShown); - /** - * IM_navi_pane_texts_Line_1 - * im navi pane text line 1 - * @param aIndex_C, index of text line - * @param aIndex_W, index of pane - */ - TAknTextLineLayout IM_navi_pane_texts_Line_1(TInt aIndex_C, TInt aIndex_W); - /** - * DPLayout - * dp layout - * @param aStr, string to be draw - * @param aLayout, layout - */ - void DPLayout( const TDesC& aStr, const TAknTextLineLayout aLayout ); - /** - * DPLayout - * rect of main pane. - * @param aStr, string to be draw - * @param aLayout, layout - */ - void DPLayout( const TDesC& aStr, const TAknWindowLineLayout aLayout ); - /** - * DPRect - * dp rect - * @param aStr, string to be draw - * @param aRect, rect for the layout - */ - void DPRect( const TDesC& aStr, const TRect& aRect ); - - public: // from MIMCVAppLayoutChangeObserver - /** - * MainPaneRect - * change of layout - * @param aType, type of layout changes - */ - virtual void LayoutChangedL( TInt aType = 0 ); - - private: // Constructors and destructor - - /** - * C++ constructor. - * @param aLayoutID, id of layout - */ - CIMCVAppLayoutInfo( TChatListBoxLayout::TLayout aLayoutID ); - - /** - * Second-phased constructor - */ - void ConstructL(); - - private: // New methods - /** - * LogLayoutL - * log layout - */ - void LogLayoutL(); - /** - * FillLayoutL - * fill the layout - */ - void FillLayoutL(); - /** - * FillReadingPaneL - * fill the reading pane - */ - void FillReadingPaneL(); - /** - * FillReadingFieldL - * fill the reading field - */ - void FillReadingFieldL(); - /** - * FillReadingPaneTextsLine1L - * fill the reading pane text line1 - */ - void FillReadingPaneTextsLine1L(); - /** - * FillReadingPaneTextsLine2 - * fill the reading pane text line2 - */ - void FillReadingPaneTextsLine2(); - /** - * FillIMTextElementsL - * fill the text elements - */ - void FillIMTextElementsL(); - /** - * FillWrittingPaneTextsLineL - * fill writing pane text line - */ - void FillWrittingPaneTextsLineL(); - /** - * FillIMWritingFieldLine1L - * ffill writing field line 1 - */ - void FillIMWritingFieldLine1L(); - /** - * FillIMWritingFieldLine2 - * fill writing field line 2 - */ - void FillIMWritingFieldLine2(); - /** - * FillIMWritingFieldLine3L - * fill writing field line 3 - */ - void FillIMWritingFieldLine3L(); - /** - * FillWrittingPaneL - * fill writing pane - */ - void FillWrittingPaneL(); - /** - * FillIMNaviPaneTextsLineL - * fill navi pane text - */ - void FillIMNaviPaneTextsLineL(); - /** - * setMainPaneRect - * set rect of main pane. - */ - void SetupMainPaneRect(); - - private: // Data - - // owned, layout id - TChatListBoxLayout::TLayout iLayoutID; - // owned, max line toi display - TInt iMaxLines; - // owned, main pane layout - TRect iMainPaneRect; - // owned, screen rect - TRect iScreenRect; - // owned, last screen rect - TRect iLastScreenRect; - // owned, reading pane - CArrayFixFlat* iReadingPane; - // owned, writing pane - CArrayFixFlat* iWrittingPane; - // owned, reading fields - CArrayFixFlat* iReadingField; - // owned, reading pane text layout - CArrayFixFlat* iReadingPaneTextsLine1; - // owned, text elements - CArrayFixFlat* iIMTextElements; - // owned, reading text line - TAknTextLineLayout iReadingPaneTextsLine2; - // owned, writing text line - CArrayFixFlat* iWrittingPaneTextsLine; - // owned, writing field line 1 - CArrayFixFlat* iIMWritingFieldLine1; - // owned, writing field line 2 - TAknWindowLineLayout iIMWritingFieldLine2; - // owned, writing field line 3 - CArrayFixFlat* iIMWritingFieldLine3; - // owned, writing text line 1 - CArrayFixFlat* iIMNaviPaneTextsLine1; - - CArrayFixFlat* iIMNaviPaneTextsLine2; - - TBool iEditorVisibility; - }; - -#endif // CIMCVAPPLAYOUTINFO_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvapplogineventlistener.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvapplogineventlistener.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2008 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: Declaration for RProperty where conversation view login event handled. -* -*/ - -#ifndef CIMCVAPPLOGINEVENTLISTENER_H_ -#define CIMCVAPPLOGINEVENTLISTENER_H_ - -#include -#include -#include - -// forward declaration -class CIMCVEngine; -class CIMCVAppUi; -class CIMCVAppWaitNote; - -class CIMCVAppLoginEventListener : public CActive - { -public : - // Constructor - /** - * Creates a new CIMCVAppLoginEventListener. - * @param aTabbedView, reference to tabbedview - * @return New instance of this class - */ - static CIMCVAppLoginEventListener* NewL(CIMCVEngine& aEngine, - CIMCVAppUi& aAppUi, - const TDesC& aUserId); - - /** - * Standard C++ destructor. - */ - ~CIMCVAppLoginEventListener(); - - /** - * start listening - */ - void StartListening(); - - /** - * stop listening - */ - void StopListening(); - -private : // From CActive - - /** - * RunL - */ - void RunL(); - - /** - * DoCancel - */ - void DoCancel(); - -public: - - TInt LoginL(); - - void SetUserIdL( const TDesC& aUserId ); - -private: - - void LoginCompletedL(); - -private: // Implementation - /** - * Standard C++ constructor - * @param aTabbedView, reference to tabbedview - */ - CIMCVAppLoginEventListener( CIMCVEngine& aEngine, - CIMCVAppUi& aAppUi ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(const TDesC& aUserId); - -private : - - // owns , property to use - RProperty iProperty; - - // processing note is visible - TBool iWaitVisible; - - // Doesn't own (destroys itself) - CIMCVAppWaitNote* iWaitDialog; - - - CActiveSchedulerWait iWait; - - // not owned, reference to uiengine - CIMCVEngine& iEngine ; - - // not owned., reference to appui - CIMCVAppUi& iAppUi; - - //user id - Owns - HBufC* iUserId; - - //holds the error of the login operation - TInt iErr; - - - }; - -#endif /*CIMCVAPPLOGINEVENTLISTENER_H_*/ diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappmessageeditor.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappmessageeditor.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,269 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message editer class -* -*/ - -#ifndef __CIMCVAPPMESSAGEEDITOR__H -#define __CIMCVAPPMESSAGEEDITOR__H - - -// INCLUDE FILES -#include -#include -#include -#include -#include - -// FORWARD DECLARATION -class CAknInputFrame; -class MIMCVTapEventObserver; -class CIMCVAppView; -class CIMCVAppMessageExtensionsHandler; -/** - * Helper class to get editor content events. - * @since S60 v5.0 - */ -class MIMCVAppMessageEditorObserver - { - public: // Enumerations - enum TEditorEvent - { - EEditorContentCleared = 0, - EEditorContentChanged - }; - - public: // New methods - - /** - * Handle editor event. - */ - virtual void HandleMessageEditorEventL( TEditorEvent aEvent ) = 0; - - protected: - - /** - * Destructor for protection. - */ - virtual ~MIMCVAppMessageEditorObserver() {}; - }; - -/** -* Message Editor for meco application. -* It looks just like a search field. -* -* @imcvappui.exe -* @since Series 60 1.2 -*/ -class CIMCVAppMessageEditor: - public CCoeControl, - public MCoeControlObserver, - public MEikEdwinObserver - { - public: - /** - * Two-phased constructor. Leaves on failure. - * @since Series60 1.2 - * @param aParent Parent control - * @return The constructed Goto Pane control - */ - static CIMCVAppMessageEditor* NewL - ( - const CCoeControl* aParent, - TDesC& mbmPath, - CIMCVAppView& aAppView, - CIMCVAppMessageExtensionsHandler& aExtensionHandler - ); - - /** - * Destructor. - */ - virtual ~CIMCVAppMessageEditor(); - - /** - * See description in calslbs.h. - */ - void HandleFindSizeChanged(); - - - public: // from MCoeControlObserver - - /** - * Handle control event. - * @since Series60 1.2 - * @param aControl The control - * @param aEventType Event type - */ - void HandleControlEventL - ( CCoeControl* aControl, TCoeEvent aEventType ); - /** - * Catches EEventTextUpdate event. - * @since Series60 1.2 - * @param aKeyEvent - * @param aType - * @return - */ - virtual void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); - - public: // from CCoeControl - - /** - * Handle key event. - * @since Series60 1.2 - * @param aKeyEvent The key event - * @param aType Key event type - * @return Response (was the key event consumed?) - */ - virtual TKeyResponse OfferKeyEventL - ( const TKeyEvent& aKeyEvent, TEventCode aType ); - - /** - * HandlePointerEventL - * From CCoeControl - * - */ - void HandlePointerEventL(const TPointerEvent& /*aPointerEvent*/); - - private: // From MObjectProvider - - /** - * @see MObjectProvider - */ - TTypeUid::Ptr MopSupplyObject(TTypeUid aId); - - public: // from CCoeControl - - /** - * Count component controls. - * @since Series60 1.2 - * @return Number of component controls - */ - virtual TInt CountComponentControls() const; - - /** - * Get a component control by index. - * @since Series60 1.2 - * @param aIndex Index of component control to be returned - * @return Component control or NULL - */ - virtual CCoeControl* ComponentControl( TInt aIndex ) const; - - - public: // Text manipulation - - /** - * Lengt of the text in the editor. - * @since Series60 1.2 - * @return The text length - */ - TInt TextLength() const; - - - /** - * Set text. - * @since Series60 1.2 - * @param aTxt Text to set - * appended if needed. - */ - virtual void SetTextL( const TDesC& aTxt ); - - /** - * Returns editor control of goto pane. - * @since Series60 1.2 - * @return editor control of goto pane - */ - CEikRichTextEditor& Editor() const; - - /** - * Sets message editor observer. - * @since S60 v3.2 - * @param aObserver Pointer to observer, ownership not transfered. - */ - void SetMessageEditorObserver( MIMCVAppMessageEditorObserver* aObserver ); - /** - * This method is called when observed object is tapped - * @since S60 v5.0 - * @param aEvent Event which happened in touchable control - * @param aControlId in which control the event occured - * @return none - */ - void SetTapObserver( MIMCVTapEventObserver* aObserver, TUint aId ); - - - private: // Construct / destruct - /** - * Constructor. - * @param - */ - CIMCVAppMessageEditor(CIMCVAppView& aAppView, - CIMCVAppMessageExtensionsHandler& aExtensionHandler); - - /** - * Second-phase constructor. Leaves on failure. - * @param aParent Parent control - */ - void ConstructL( const CCoeControl* aParent, TDesC& mbmPath ); - - private: - - /** - * Notifies message editor observer when needed. - * @since S60 v5.0 - * @param aOldLen Editor content length before editing. - * @param aCurLen Editor content current length - */ - void NotifyObserverIfNeededL( TInt aOldLen, TInt aCurLen ) const; - - - protected: // from CCoeControl - - /** - * Handle size change, lay out and draw components. - */ - virtual void SizeChanged(); - - /** - * Handle focus change. - * @since Series60 1.2 - * @param aDrawNow Draw now? - */ - virtual void FocusChanged( TDrawNow aDrawNow ); - - private: // data - - // Editor. Owned. - CEikRichTextEditor* iEditor; - - // Input frame. Owned. - CAknInputFrame* iInputFrame; - // Not owned. - MIMCVAppMessageEditorObserver* iEditorObserver; - // Not owned. Pointer to observer - MIMCVTapEventObserver* iTapObserver; - // ID which needs to be reported back to TapObserver - TUint iTapControlId; - // does not own. Reference to the AppView object - CIMCVAppView& iAppView; - //does not own. reference to the smiley extension handler - CIMCVAppMessageExtensionsHandler& iExtensionHandler; - - TInt iServiceId; - - // Owns - CAknsBasicBackgroundControlContext* iBgContext; - - - }; - -#endif diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappmessageextensionshandler.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappmessageextensionshandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message extention class -* -*/ - - - -#ifndef _CIMCVAPPMESSAGEEXTENSIONSHANDLER_H -#define _CIMCVAPPMESSAGEEXTENSIONSHANDLER_H - -// INCLUDES -#include -#include - -#include "mimcvappmessageextension.h" - -// FORWARD DECLARATIONS -class CEikRichTextEditor; -class TCursorSelection; -class CIMCVAppUi; -class MIMCVAppUi; -class MIMCVUiAppSkinVariant; -class MIMCVEngineFactory; -class CIMCVEngine; -// CLASS DECLARATION - -/** -* Message extensions handler -* @since 5.0 -*/ -class CIMCVAppMessageExtensionsHandler : public CBase - { - public: - - /** - * Two-phased constructor - * @param aAddSmileyHandler - * @since 5.0 - */ - static CIMCVAppMessageExtensionsHandler* NewL( - MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, - MIMCVEngineFactory& aEngineFactory, - TBool aAddSmileyHandler = ETrue ); - - /** - * Destructor - * @since 5.0 - */ - ~CIMCVAppMessageExtensionsHandler(); - - private: - /** - * Symbian OS Constructor - * @since 5.0 - */ - void ConstructL(); - - /** - * Constructor - * @since 5.0 - */ - CIMCVAppMessageExtensionsHandler(MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, - MIMCVEngineFactory& aEngineFactory ); - - public: - /* - * new service has been installed - */ - void CreateServiceSmileyL( TInt aServiceId ); - /* - * service has been deleted - */ - void DeleteServiceSmileyL( TInt aServiceId ); - - public: - - - /** - * Process editor messages for sending them as characters. - * Resets extensions. - * @param aEditor Editor which contains message. - * @since 5.0 - * @return Ownership of message returned is passed to caller. - */ - HBufC* ProcessMessageLC( CEikRichTextEditor& aEditor, TInt aServiceId ); - - /** - * Convert extensions to characters. - * @param aEditor Editor which contains message. - * @since 5.0 - * @return Ownership of message returned is passed to caller. - */ - HBufC* ExtensionToStringLC( CEikRichTextEditor& aEditor, TInt aServiceId ); - - - /** - * Delete extension from editor - * @param aEditor Editor which contains message. - * @since 5.0 - */ - void DeleteExtensionL( CEikRichTextEditor& aEditor, - TInt aServiceId, - TMessageExtensionTypes aType, TInt aPos ); - - /** - * Converts all the extensions in selection area from - * strings to extensions. - * @since 2.6 - * @param aEditor, used editor - */ - void ConvertSelectionToExtensionL( CEikRichTextEditor& aEditor, TInt aServiceId); - - /** - * Converts all the extensions in selection area from - * strings to extensions. - * @since 3.0 - * @param aRichText Rich text to be converted - * @param aSelection Selection area - */ - void ConvertSelectionToExtensionL( CRichText& aRichText, - TCursorSelection& aSelection , - TInt aServiceId ); - - /** - * Converts all the extensions in selection area from - * extensions to strings - * @since 2.6 - * @param aEditor, used editor - * @param aPreserve, should we preserve original extension status. - * Are they strings or extensions. - */ - void ConvertSelectionToStringL( CEikRichTextEditor& aEditor, - TInt aServiceId, - TBool aPreserve = EFalse ); - - /** - * Informs the extensions about changed size - * @param aSize - * @since 3.0 - */ - void SizeChanged( TSize& aSize, TInt aServiceId ); - - /** - * Converts all the extensions in selection area from - * extensions to strings. - * @since S60 v3.1 - * @param aEditor Used editor. - * @param aResultString Descriptor for converted string, - * caller is responsible to provide - * large enough descriptor. - * @param aSelectionAfterConversion Cursor selection after - * extensions are converted to strings. - * @param aPreserve Should we preserve original extension status. - */ - void ConvertSelectionToStringL( - CEikRichTextEditor& aEditor, - TInt aServiceId, - TDes& aResultString, - TCursorSelection& aSelectionAfterConversion, - TBool aPreserve ); - - /** - * Insert extension to editor - * @param aEditor Editor which contains message. - * @param aType Type of extension needed. - * @param aCancelled ETrue after method returns if - * extension insertion was cancelled, - * EFalse otherwise - * @since 2.1 - */ - void InsertExtensionL( CEikRichTextEditor& aEditor, - TInt aServiceId, - TMessageExtensionTypes aType,TBool& aCancelled, TSize size ); - - private: - // not owns - MIMCVUiAppSkinVariant& iSkinVariant; - // not owns - MIMCVAppUi& iAppUi; - // not owns - MIMCVEngineFactory& iEngineFactory; - // owned , Array of extensions - RPointerArray iExtensionArray; - - - }; - -#endif // _CIMCVAPPMESSAGEEXTENSIONSHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappmessageflowhandler.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappmessageflowhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message flow handling -* -*/ - - - -#ifndef _CIMCVAPPMESSAGEFLOWHANDLER_H -#define _CIMCVAPPMESSAGEFLOWHANDLER_H - -// INCLUDES -#include -#include "mimcvenginemessageobserver.h" -#include "mimcvenginechatlistobserver.h" - -class MIMCVEngineMessageReadInterface; -class MIMCVEngineMessageContainer; -class CIMCVEngineContextObserver; -class CIMCVEngine; -// CLASS DECLARATION - -/** -* Flow controller for messages -* -* @imcvuiapp.exe -* @since Series 60 5.0 -*/ -class CIMCVAppMessageFlowHandler : public CTimer, - public MIMCVEngineMessageObserver, - public MIMCVEngineChatListObserver - { - - - - public: - - /** - * Should we fetch new messages or not - * @param aFetch ETrue if this chat is in foreground and should - * receive messages, EFalse otherwise. - */ - void FetchMessages( TBool aFetch ); - - - - protected: // Functions from MIMCVEngineMessageObserver - - /** - * Handle events. - * @param aEvent Event to handle. - * @param aIndex, Index of message which is affected by event. - */ - void HandleMessageEvent( TMessageEventType aEvent, TInt aIndex ); - - private: - /* - * See MIMCVEngineChatListObserver - */ - void HandleChatListEvent(TInt aServiceId, TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* aContainerInfo ) ; - - protected: // Functions from CTimer - - /** - * @see CTimer - */ - void RunL(); - - /** - * @see CActive - */ - TInt RunError( TInt aError ); - - - - private: // New functions - - /** - * Get flow control value from settings - */ - void UpdateTimeIntervalL(); - - /** - * Is opening on going or not. - * @return ETrue if opening on going, EFalse otherwise. - */ - TBool IsOpening() const; - - - - private: - - /** - * C++ default constructor. - */ - CIMCVAppMessageFlowHandler(MIMCVEngineMessageContainer& aMessageContainer, - MIMCVEngineMessageReadInterface& aReadInterface, - CIMCVEngine& aActiveEngine ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL( TBool aScrollOver ); - - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aMessageContainer Interface to UI side message container - * @param aReadInterface Message read interface - * @param aScrollOver Is scroll over required - * or not. - */ - static CIMCVAppMessageFlowHandler* NewL( - MIMCVEngineMessageContainer& aMessageContainer, - MIMCVEngineMessageReadInterface& aReadInterface, - CIMCVEngine& aActiveEngine, - TBool aScrollOver ); - - /** - * Destructor. - */ - virtual ~CIMCVAppMessageFlowHandler(); - - - private: // Data - - // Interface for UI side message container - // Not owned - MIMCVEngineMessageContainer& iMessages; - - // Interface for fetching messages - // Not owned - MIMCVEngineMessageReadInterface& iReadInterface; - - CIMCVEngine& iActiveEngine; - - // time interval for receiving messages - TTimeIntervalMicroSeconds32 iTimeInterval; - - // Is chat deleted already - TBool iChatDeleted; - - // Should we fetch new messages - TBool iFetchMessages; - - // Index for fetching messages - TInt iMsgIndex; - - // Initial count for messages - TInt iInitialMsgCount; - - // Is new message received while opening the chat - TBool iNewMsgWhileOpening; - - // Flag is read from CR variation in class construction - // ETrue in releases >= 3.2 - // EFalse in releases < 3.2 - // Set to EFalse if this handler is used to handle - // recorded chat - TBool iBgOpeningMode; - - TInt iAddedUnreadMsgs; - - - }; - - -#endif // _CIMCVAPPMESSAGEFLOWHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappmessagewrapper.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappmessagewrapper.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Message wrapper for MIMCVEngineMessage -* -*/ - - - - -#ifndef CIMCVAPPMESSAGEWRAPPER_H -#define CIMCVAPPMESSAGEWRAPPER_H - -// INCLUDES -#include -#include // TCursorSelection - -// FORWARD DECLARATIONS -class MIMCVEngineMessage; - -// CLASS DECLARATION - -/** -* Message wrapper for MIMCVEngineMessage -* stores information about highlight items inside this message etc -* -* @imcvuiapp.exe -* @since Series 60 3.0 -*/ -class CIMCVAppMessageWrapper : public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aWrappedMessage Wrapped message - * @param aContainer Message container interface - * (for informing about changed message) - */ - static CIMCVAppMessageWrapper* NewL( MIMCVEngineMessage& aWrappedMessage ); - - /** - * Destructor. - */ - virtual ~CIMCVAppMessageWrapper(); - - public: // New functions - - /** - * @return Modifiable position for thumbnail - * of this message in rich text - * - * Note that these are not used within this class, - * so it's safe to return non-const reference. - */ - TCursorSelection& ThumbPos(); - - /** - * @return Modifiable selection for this message in rich text - * (for highlighting) - * - * Note that these are not used within this class, - * so it's safe to return non-const reference. - */ - TCursorSelection& Selection(); - - /** - * @return Modifiable whole selection for this message in rich text. - * use this to remove message from rich text - * as this contains the whole text. - * - * Note that these are not used within this class, - * so it's safe to return non-const reference. - */ - TCursorSelection& WholeSelection(); - - /** - * @return Modifiable message selection for this message in rich text. - * use this to identify the message part from the nick part - * - * Note that these are not used within this class, - * so it's safe to return non-const reference. - */ - TCursorSelection& MessageSelection(); - - /** - * @return Modifiable array of highlights for this message - * - * Note that these are not used within this class, - * so it's safe to return non-const reference. - */ - RArray& Highlights(); - - /** - * @return Modifiable array of highlight types for this message - * - * Note that these are not used within this class, - * so it's safe to return non-const reference. - */ - RArray& HighlightTypes(); - - /** - * @return Wrapped message - * - * Note that these are not used within this class, - * so it's safe to return non-const reference. - */ - MIMCVEngineMessage& Message(); - - /** - * Sets wrapper to be inserted or added. - * @since S60 v3.2 - * @param aInserted ETrue to set wrapper inserted, - * EFalse to set added. - */ - void SetInserted( TBool aInserted ); - - /** - * Is wrapper inserted or added. - * @since S60 v3.2 - * @return ETrue if this wrapper is inserted, - * EFalse otherwise. - */ - TBool IsInserted() const; - - protected: // Functions from MIMCVAPPImageLoaderObserver - - /** - * @see MIMCVAPPImageLoaderObserver - */ - //void Handleplaaplaplaa - - private: - - /** - * C++ default constructor. - */ - CIMCVAppMessageWrapper( MIMCVEngineMessage& aWrappedMessage); - - private: // Data - - // Note that these shouldn't be used within this class, - // these are only contained in this wrapper class - - // Position of thumbnail in rich text - TCursorSelection iThumbPosition; - - // doesn't own. reference to wrapped message - MIMCVEngineMessage& iMessage; - - // Highlight selection for this text - TCursorSelection iSelection; - - // Whole selection for this text - TCursorSelection iWholeSelection; - - // Message part selection for this text - TCursorSelection iMessageSelection; - - // Selections inside this message - RArray iHighlights; - - // Selection types inside this message - RArray iTypes; - - // Is this wrapper inserted (ETrue) or added (EFalse) - TBool iInserted; - }; - -#endif // CIMCVAPPMESSAGEWRAPPER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvapppicture.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvapppicture.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Private -* Description : Handles statuspane, context pane, navi pane -* -*/ - - -#ifndef CIMCVAPPPICTURE_H -#define CIMCVAPPPICTURE_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class TSize; -class CGulIcon; - - -// CLASS DECLARATION - -/** -* Picture wrapper for icons and smileys -* -* @since Series 60 Platform 3.0 -*/ -class CIMCVAppPicture :public CPicture - { - - public: // Constructors and destructor - - /** - * Constructor. - * @param aMap Graphics device map for converting pixels to twips - * @param aBitmap Bitmap - * @param aBitmapMask Mask. Can be NULL - * @param aIndex Index of the picture, used for the rich text icons. - */ - CIMCVAppPicture( MGraphicsDeviceMap& aMap, CGulIcon* aIcon, TInt aIndex = -1, - TBool aExternalIcon = ETrue ); - /** - * Destructor. - */ - ~CIMCVAppPicture(); - - public: // From CPicture - - /** - * Prohibit linebreaks. - */ - TBool LineBreakPossible( TUint aClass, - TBool aBeforePicture, - TBool aHaveSpaces ) const; - - /** - * Draw the picture - */ - void Draw( CGraphicsContext& aGc, - const TPoint& aTopLeft, - const TRect& aClipRect, - MGraphicsDeviceMap* aMap ) const; - - /** - * Does nothing. There's no need for it, but must be implemented. - */ - void ExternalizeL( RWriteStream& aStream ) const; - - /** - * Returns the picture's size in twips. - * @param aSize Size. - */ - void GetOriginalSizeInTwips( TSize& aSize ) const; - - /** - * Gets the index of the picture, if it is set in the constructor - * @return TInt The index of the picture, -1 if not set in the - * constructor. - */ - TInt Index() const; - - private: - - /** - * Sets the size of the picture in twips. - * according to the size in pixels. - */ - void SetTwips() const; - - protected: // Data - - // Index of a smiley icon - TInt iIndex; - - // we might own - CGulIcon* iIcon; - - TBool iExternalIcon; - - MGraphicsDeviceMap& iGfxMap; - }; - -#endif // CIMCVAPPPICTURE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvapprichtextcontainer.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvapprichtextcontainer.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,471 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: richtext container -* Description : Handles statuspane, context pane, navi pane -* -*/ - - -#ifndef _CIMCVAPPRICHTEXTCONTAINER_H -#define _CIMCVAPPRICHTEXTCONTAINER_H - -// INCLUDES -#include "mimcvenginemessagecontainer.h" -#include "mimcvapplayoutchangeobserver.h" -#include "mimcvappresourcechangeobserver.h" -#include -#include -#include -#include // TCursorSelection - - -// FORWARD DECLARATIONS -class CIMCVAppMessageWrapper; -class CParaFormatLayer; -class CCharFormatLayer; -class CRichText; -class MLayDoc; -class MIMCVAppTextView; -class CIMCVAppMessageExtensionsHandler; -class MIMCVAppUi; -class MIMCVAppResourceChangeObserver; -// CLASS DECLARATION - -/** -* Rich text container -* @since Series 60 5.0 -*/ -class CIMCVAppRichTextContainer : public CBase, - public MIMCVEngineMessageContainer, - public MIMCVAppLayoutChangeObserver, - public MIMCVAppResourceChangeObserver - { - public: // enumerations - enum THighlightMovement - { - ENext = 0, - EPrevious - }; - - static CGulIcon*& iTempIcon; - - - private: // enums - - enum THighlightState - { - ENoHighlight = 0, - EItemSelected, - EMessageTop, - EMessageBottom - }; - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aTextView Viewer of the text - * @param aExtensionsHandler Message extensions handler - * @param aMessageUtils Message utils - * @param aScrollOver Should we scroll over the top and bottom, - * i.e. disabling highlight when pressing up at top. - * @param aPrimaryKey primary key of the object - used for storage and searching - */ - static CIMCVAppRichTextContainer* NewL(MIMCVAppUi* aAppUi, - MIMCVAppTextView* aTextView, - CIMCVAppMessageExtensionsHandler* aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - MGraphicsDeviceMap* aMap, - const TDesC& aPrimaryKey, - TInt aServiceId, - TBool aScrollOver /*= ETrue*/ - ); - - /** - * Destructor. - */ - virtual ~CIMCVAppRichTextContainer(); - - public: // From MIMCVAppResourceChangeObserver - - /** - * Reload all icons on resource change - */ - void ResourceChangedL(); - public: // New functions - - - /** - * @return Buffer containing the currently selected text - * (or empty buffer if nothing selected) - */ - HBufC* SelectedItemL(); - - /** - * @return Type of selected item - */ - TInt SelectedItemType(); - - /** - * @return Text layout interface for displaying the text - */ - MLayDoc* TextLayout(); - - /** - * Moves current highlight selection - * @return KErrNotFound If there are no items to highlight. - * KErrNone otherwise. - */ - TInt MoveHighlightL( THighlightMovement aDirection ); - - /** - * Set all highlighting off - */ - void DisableHighlightL(); - - - /** - * @return ETrue if some item is highlighted - */ - TBool Highlighted(); - - /** - * Highlights whole message or item at given position. - * @param aPos Highlights the message or item which has - * the craracter at aPos - * @return KErrNone - if highlighted a new item - * KErrAlreadyExists - if item is already highlighted - * KErrNotFound - if can't find message or item at aPos - */ - TInt HighlightItemAtPosL( TInt aPos ); - - - /** - * @returns the total messages in the view - */ - TInt GetMessageCount(); - - /** - * Sets item highlight on or off - * @param aItemHighlight ETrue if the items inside messages - * should be highlighted - */ - void SetItemHighlight( TBool aItemHighlight ); - - public: // From MIMCVAppLayoutChangeObserver - - /** - * From MIMCVAppLayoutChangeObserver - */ - void LayoutChangedL( TInt aType ); - - public: - /** - * Returns the Primary key of the object - */ - const TDesC& GetPrimaryKey(); - - /** - * Updates the color of messages according to current skin. - * Only the theme colored part of messages are updated. - * This method should be called when the skin is changed. - * @return None - */ - void UpdateSkinnedTextColourL(); - - protected: // Functions from MIMCVEngineMessageContainer - - /** - * Add new message to container - * @param aMessage Message - */ - void AddMessageL( MIMCVEngineMessage& aMessage ); - - - /** - * @see MIMCVEngineMessageContainer - */ - void InsertMessageL( MIMCVEngineMessage& aMessage ); - - protected: // New functions - - /** - * Updates all wrappers after (and including) aFirstIndex - * Adds aChange to wrapper positions (in rich text) - * @param aFirstIndex Index of first modified wrapper - * @param aChange Removed or added number of characters in rich - * text before wrapper at aFirstIndex - */ - void UpdateWrappers( TInt aFirstIndex, TInt aChange ); - - /** - * @return Union of two selections - * @param aSel1, cursor selection position1 - * @param aSel2, cursor selection position2 - */ - TCursorSelection Union( const TCursorSelection& aSel1, - const TCursorSelection& aSel2 ); - - /** - * @return Currently highlighted selection, or last - * message if highlighting is disabled - */ - TCursorSelection CurrentSelection() const; - - /** - * Sets the background color of selected text - * @param aSel, cursor selection position - * @param aColor, color to use - */ - void TextBackColorL( const TCursorSelection& aSel, const TRgb& aColor ); - - /** - * Sets the color of selected text - * @param aSel, cursor selection position - * @param aColor, color to use - */ - void TextColorL( const TCursorSelection& aSel, const TRgb& aColor ); - - /** - * Sets the background color of selected paragraph - * @param aSel, cursor selection position - * @param aColor, color to use - */ - void BackColorL( const TCursorSelection& aSel, const TRgb& aColor ); - - /** - * Format the highlight item - * @param aSel, cursor selection position - */ - void HighLightItemL( const TCursorSelection& aSel ); - - /** - * Sets the selection bold - * @param aSel, cursor selection position - */ - void BoldL( const TCursorSelection& aSel ); - - /** - * Parses text for highlight items (phone numbers, urls) and places - * the positions to messagewrapper. - * @param aText Text to be parsed - * @param aStartPos Start position of aText in rich text - * @param aRelativePos Relative position of aText inside one message - * @param aMessageWrapper Message wrapper where positions are stored - */ - void ParseTextL( const TDesC& aText, TInt aStartPos, TInt aRelativePos, - CIMCVAppMessageWrapper& aMessageWrapper ); - - /** - * Add nickname of a message to rich text - * @param aMessageWrapper Message wrapper - * @return Selection for nickname (for coloring) - */ - TCursorSelection AddNickL( CIMCVAppMessageWrapper& aMessageWrapper ); - - /** - * Add timestamp of a message to rich text - * @param aMessageWrapper Message wrapper - * @return Selection of timestamp - */ - TCursorSelection AddTimeStampL( CIMCVAppMessageWrapper& aMessageWrapper ); - - /** - * Add content of a message to rich text - * @param aMsgStart Start position of this message in rich text - * @param aMessageWrapper Message wrapper - */ - void AddContentL( TInt aMsgStart, CIMCVAppMessageWrapper& aMessageWrapper ); - - - - - /** - * Helper method to determine which part of the message really is - * colored by the active skin. - * @param aMessageWrapper Message to inspect - * @param aUseDefaultColors Variation for default colours - * @param aCustomDefinedColor Has user customized the message colour - * @return Selection of the text which follows the skin color - */ - TCursorSelection SkinColoredSelection( - CIMCVAppMessageWrapper& aMessageWrapper, - TBool aUseDefaultColors, - TBool aCustomDefinedColor ); - - /** - * Helper method for replacing all paragraph delimiters - * inside message content with line breaks, needed for - * keeping text alignment consistent inside one message. - * Used in AddContentL. - * @since S60 v5.0 - * @param aSource Source descriptor. - * @param aTarget Target descriptor. Caller is responsible - * to provide a large enough descriptor, - * aTarget size must not be less than - * size of aSource. - */ - void ReplaceParaDelimsWithLineBreaks( - const TPtrC& aSource, - TPtr& aTarget ) const; - - /** - * Helper method to update selection inside rich text. - * This will remove the highlight from previously selected item - * and add highlight to newly selected item. - * @since S60 v5.0 - */ - void UpdateSelectionL(); - - /** - * Insert nickname of a message to rich text start. - * @param aMessageWrapper Message wrapper. - * @return Selection for nickname. - */ - TCursorSelection InsertNickL( CIMCVAppMessageWrapper& aMessageWrapper ); - - /** - * Insert timestamp of a message to rich text. - * @param aMessageWrapper Message wrapper. - * @return Selection of timestamp. - */ - TCursorSelection InsertTimeStampL( CIMCVAppMessageWrapper& aMessageWrapper ); - - /** - * Insert content of a message to rich text. - * @param aMessageWrapper Message wrapper. - * @return Length of content added. - */ - TInt InsertContentL( CIMCVAppMessageWrapper& aMessageWrapper ); - - public: - /** - * Initializes the object with its cintainer's object - * @param aTextView - container object - */ - void Initialize( MIMCVAppUi* aAppUi, - MIMCVAppTextView* aTextView, - CIMCVAppMessageExtensionsHandler* aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - MGraphicsDeviceMap* aMap, - TBool aScrollOver /*= ETrue*/); - - TInt ServiceId() const; - - - private: - - /** - * constructor. - * @param aTextView Viewer of the text - * @param aExtensionsHandler Message extensions handler - * @param aMessageUtils Message utils - * @param aScrollOver Should we scroll over the top and bottom, - * i.e. disabling highlight when pressing up at top. - */ - CIMCVAppRichTextContainer( MIMCVAppUi* aAppUi, - MIMCVAppTextView* aTextView, - CIMCVAppMessageExtensionsHandler* aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - MGraphicsDeviceMap* aMap, - TInt aServiceId, - TBool aScrollOver /*= ETrue*/ ); - - /** - * By default Symbian 2nd phase constructor is private. - * @ params aPrimaryKey - primary key of the object - */ - void ConstructL(const TDesC& aPrimaryKey); - - CGulIcon* LoadDefaultBitmapL( TInt aBitmapId, TInt aMaskId, - const TDesC& aFullPath, TBool aOverrideBrand = EFalse) ; - - private: // Data - - MIMCVAppUi* iAppUi; - // doesn't own, interface to text viewer - MIMCVAppTextView* iTextView; - - // item highlight - TBool iItemHighlight; - // current highlight state - THighlightState iHighlightState; - // message extensions handler - CIMCVAppMessageExtensionsHandler* iExtensionsHandler; - - // Should we scroll over the top and bottom, - // i.e. disabling highlight when pressing up at top. - TBool iScrollOver; - - // Owns. Paragraph formatter - CParaFormatLayer* iParaFormatLayer; - - // Owns. Character formatter - CCharFormatLayer* iCharFormatLayer; - - // Owns. rich text document - CRichText* iRichText; - - // Owns. message wrappers - RPointerArray iMessages; - - // selected message - TInt iSelected; - - // selected item in message - TInt iSelectedItem; - // previous selection - TCursorSelection iPrevious; - - // should whole message be colored - TBool iColorWholeMessage; - // alternative colors - TBool iOwnMsgColorInUse; - TRgb iOwnMsgColor; - TBool iMsgColorInUse; - TRgb iMsgColor; - - // Show timestamp setting value - TBool iShowTimeStamps; - - - // doesn't own - const CFont* iPrimaryFont; - const CFont* iSecondaryFont; - - // "From me" icon. Not owned. - // Pointer to a pointer because this can change - CGulIcon* iFromMe; - - // "To me" icon. Not owned. - // Pointer to a pointer because this can change - CGulIcon* iToMe; - - - // interface to graphics device for converting pixels to twips - MGraphicsDeviceMap* iMap; - - //Owns Primary key - Used while storing the object - HBufC* iPrimaryKey; - - // service Id - TInt iServiceId; - - }; - -#endif // _CIMCVAPPRICHTEXTCONTAINER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvapprichtextcontainercache.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvapprichtextcontainercache.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Cache to Store Rich Text Containers -* -*/ - - -#ifndef _CIMCVAPPRICHTEXTCONTAINERCACHE_H -#define _CIMCVAPPRICHTEXTCONTAINERCACHE_H - -// INCLUDES -#include "cimcvapprichtextcontainer.h" -#include - -//forward declaration -class CIMCVAppRichTextContainer; - -/** -* Rich text container Cache -* @since Series 60 5.0 -*/ -class CIMCVAppRichTextContainerCache : public CBase - { -public: - - /** - * NewL() - */ - static CIMCVAppRichTextContainerCache* NewL(); - - /** - * Destructor - */ - ~CIMCVAppRichTextContainerCache(); - -private: - - /** - * Constructor - */ - CIMCVAppRichTextContainerCache(); - - -public: - - - void UpdateSkinTextColorL (); - - /** - * StoreContainer - stores the container to the cache - * @param aPrimaryKey - Primary key used for storage - * @param aContainer - CIMCVAppRichTextContainer object to be stored - */ - void StoreContainer( CIMCVAppRichTextContainer *aContainer); - - /** - * LoadContainer - Returns the container from the cache - * @param aPrimaryKey - Primary key used for Searching - * @return - the object if found else returns NULL - */ - CIMCVAppRichTextContainer* LoadContainer(TInt aServiceId, const TDesC& aPrimaryKey); - - /** - * DeleteContainer - Deletes the container from the cache - * @param aPrimaryKey - Primary key used for Searching - * @ aServiceId, aservice id - */ - void DeleteContainer(const TDesC& aPrimaryKey, TInt aServiceId ); - - /** - * DeleteAllServiceContainer - Deletes the container from the cache which has aServiceId - * @param aServiceId - Primary key used for Searching - */ - void DeleteAllServiceContainer(TInt aServiceId ); - -private: - - // Stores the CIMCVAppRichTextContainer objects - // Takes the ownership of objects stored - RPointerArray iRTContainerCache; - - }; - -#endif // _CIMCVAPPRICHTEXTCONTAINERCACHE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileicondialog.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileicondialog.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Dialog for selecting smile icon. -* Description : Handles statuspane, context pane, navi pane -* -*/ - - -#ifndef CIMCVAPPSMILEICONDIALOG_H -#define CIMCVAPPSMILEICONDIALOG_H - -// INCLUDES -#include "mimcvtapeventobserver.h" -#include -#include - -// FORWARD DECLARATIONS -class CGulIcon; - -// CLASS DECLARATION - -/** -* CIMCVAppSmileIconDialog -* -* Dialog for selecting smile icon. -*/ -class CIMCVAppSmileIconDialog : public CAknDialog, - public MIMCVTapEventObserver - { - public: // Constructors and destructor - /** - * Two-phased constructor. - * @param aIconArray : Reference to smile icon array. - * @param aSelectedIconId : For getting selected bitmap number. - */ - static CIMCVAppSmileIconDialog* NewL( - const RPointerArray& aIconArray, - TInt& aSelectedIconId ); - - /** - * Destructor. - */ - virtual ~CIMCVAppSmileIconDialog(); - - private: // New functions - - /** - * C++ constructor. - */ - CIMCVAppSmileIconDialog( const RPointerArray& aIconArray, - TInt& aSelectedIconId ); - - private: // Functions from base classes - - /** - * From CEikDialog : Handle key events. - */ - TKeyResponse OfferKeyEventL( - const TKeyEvent& aKeyEvent,TEventCode aType ); - - /** - * From CEikDialog : Prepare for opening dialog. - */ - void HandleResourceChange( TInt aType ); - - /** - * From CEikDialog : Handle CBA-keys. - */ - TBool OkToExitL( TInt aButtonId ); - - /** - * From CEikDialog : Prepare for opening dialog. - */ - void PreLayoutDynInitL(); - - /** - * From CCoeControl : Control size is set. - */ - void SetSizeAndPosition( const TSize& aSize ); - - /** - * From CCoeControl : Create custom control. - */ - SEikControlInfo CreateCustomControlL( TInt aControlType ); - - /** - * From CCoeControl : Event handler - */ - void HandleDialogPageEventL(TInt aEventID); - - /** - * Check if dialog is suitable for Smile Icon. - * @param aDialogRect Dialog inside which smile are shown. - * @param aRect Rectangle for top left smile icon. - * @return ViewableArea if all smile can fit in viewable area other wise return 0. - */ - TInt CheckDialog(TAknLayoutRect aDialogRect,TRect aRect); - - private: // From MIMCVTapEventObserver - - void HandleTapEventL( TTapEvent aEvent, TUint aControlId ); - - private: // helpers - - /** - * Set dialog layout. - */ - void SetLayout(); - - /** - * Calculates variety used for popup_grid_graphic_window - * according to rows in grid. - * @return Variety value. - */ - TInt CalculatePopupVariety(); - - - private: - - // Reference to smile icon array. - const RPointerArray& iIconArray; - - // Selected icon id reference. - TInt& iIconId; - - // Has user selected a smiley with pen - TBool iSmileyPointed; - - TBool iIsMirrored; - - TBool iLayoutChanged; - }; - -#endif // CIMCVAPPSMILEICONDIALOG_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileicongrid.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileicongrid.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Grid for smile icons. -* Description : Handles statuspane, context pane, navi pane -* -*/ - - -#ifndef CIMCVAPPSMILEICINGRID_H -#define CIMCVAPPSMILEICINGRID_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CEikDialog; -class CGulIcon; -class TAknLayoutRect; -class MIMCVTapEventObserver; -class MAknsSkinInstance; -class MAknsControlContext; - -// CLASS DECLARATION -/** -* CIMCVAppSmileIconGrid -* -* Grid for icons. -*/ -class CIMCVAppSmileIconGrid : public CCoeControl - { - public: // Constructors and destructor - /** - * Two-phased constructor. - * @param aParent : Parent control of grid. - * @param aIconArray : Reference to smile icon array. - */ - static CIMCVAppSmileIconGrid* NewL( CEikDialog* aParent, - const RPointerArray& aIconArray ); - - /** - * Destructor. - */ - virtual ~CIMCVAppSmileIconGrid(); - - public: // New methods - - /** - * Move cursor - * @param aKeyCode : EKeyLeftArrow | EKeyRightArrow | - * EKeyUpArrow | EKeyDownArrow - */ - void MoveCursor( TInt aKeyCode ); - - /** - * Return selected cursor position. - * @return : Selected cursor position if cursor is pointed a bitmap. - * KPinbEmptySpecialCharId if cursor is pointed empty cell. - */ - TInt SelectedBitmapId(); - - /** - * Return row count of grid. - * @return : Row count. - */ - TInt HeightInRows(); - - /** - * Set observer for handling tap events. - * Supports only single observer. - * @param aObserver observer to handle tap events - * @param aId control id which is used by the observer to - * identify this object. - */ - void SetTapObserver( MIMCVTapEventObserver* aObserver, TUint aId ); - - /** - * Calculate number of row and columns in smile grid - * aViewableWidth Width of Dialog in which smile are shown - */ - void SetViewableWindowWidth(TInt aViewableWidth); - - /** - *@return First smile icon rectangle in smile icon grid. - */ - TRect GetFirstCellRect(); - - - private: // New methods - - /** - * Set layout of identifier grid - */ - void SetLayout(); - - /** - * Drawing function - */ - void DrawItem( CWindowGc& aGc, - TBool aSkinEnabled, - MAknsSkinInstance* aSkin, - MAknsControlContext* aSkinCc, - TInt aIndex, TBool aSelected ) const; - - private: // Functions from base classes - - /** - * From CCoeControl : Return minimum size of the control. - */ - TSize MinimumSize(); - - /** - * From CCoeControl : Size of the control is set. - */ - void SizeChanged(); - - /** - * From CCoeControl : Notifier for changing layout - * @param aType : Type of resource change - */ - void HandleResourceChange( TInt aType ); - - /** - * From CCoeControl : Drawing control. - * @param aRect : Rectangle of control - */ - void Draw( const TRect& aRect ) const; - - /** - * From CCoeControl : Touch support. - */ - void HandlePointerEventL(const TPointerEvent& aPointerEvent); - - - private: // Constructors and destructor - - /** - * default constructor. - * @param aParent : Parent control of grid. - * @param aIconArray : Array of Icon - */ - CIMCVAppSmileIconGrid( CEikDialog* aParent, - const RPointerArray& aIconArray ); - - /** - * Second-phased constructor. - */ - void ConstructL(); - - private: // Data - - TInt iCursorPos; - TInt iPrevCursorPos; - TBool iDragEvent; - - CEikDialog* iParent; // Not own - - // Reference to smile icon array. - const RPointerArray& iIconArray; - - // Counts of icons and no. of rows - TInt iIconCount; - TInt iRowCount; - - //info regarding single cell - TRect iFirstCell; - TSize iIconSize; - TInt iCellWidth; - TInt iCellHeight; - - // Not owned. Pointer to observer - MIMCVTapEventObserver* iTapObserver; - - // ID which needs to be reported back to TapObserver - TUint iTapControlId; - TBool iIsMirrored ; - - TInt iMaxColumns; - }; - -#endif // CIMCVAPPSMILEICINGRID_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileiconutility.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileiconutility.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Utility for selecting smile icon and converting -* between smile id and smile string. -* Description : Handles statuspane, context pane, navi pane -* -*/ - - -#ifndef CIMCVAPPSMILEICONUTILITY_H -#define CIMCVAPPSMILEICONUTILITY_H - -// INCLUDES -#include -#include "mimcvappresourcechangeobserver.h" -#include - -// FORWARD DECLARATIONS -class CGulIcon; -class CIMCVAppSmileString; -class CIMCVAppSmileyInformation; -class MIMCVUiAppSkinVariant; -class CIMCVUiAppIconFileProvider; -class CIMCVEngine; - - -class MIMCVAppUi; - -// CLASS DECLARATION - -/** -* CIMCVAppSmileIconUtility -* -* Utility for selecting smile icon and mapping -* between smile icons and smile strings. -*/ -class CIMCVAppSmileIconUtility : public CBase, - public MIMCVAppResourceChangeObserver - { - public: // Constructors and destructor - - /** - * Two-phased constructor using default smile icon array. - *@param aAppUi : CIMCVAppUI reference - */ - static CIMCVAppSmileIconUtility* NewL( - MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, - CIMCVEngine& aServiceEngine ); - - /** - * Destructor. - */ - ~CIMCVAppSmileIconUtility(); - - public: - - /** - * Launch pop-up dialog for selecting smile icon. - * @param aSelectedSmileIndex Returns selected smile icon index - * @return (TInt) Return dialog value - */ - TInt LaunchSmileIconDialogL( TInt& aSelectedSmileIndex ); - - /** - * Smile icon count. - * @return (TInt) Smile icon count - */ - TInt SmileIconCount() const; - - /** - * Return needed smile icon pointer from icon array. - * @param aSmileIndex Smile icon index - */ - const CGulIcon* GetSmileIcon( TInt aSmileIndex ) const; - - /** - * Return needed smile string reference from string array. - * @param aSmileIndex Smile icon index - */ - const TDesC& GetSmileString( TInt aSmileIndex ) const; - - /** - * Search smileys from buffer. Replace every found smiley with KPuaCodeSmileyIconPadding - * @param aStr String to search smiles from. - * @param aFixedStr, Target string where smileys are replaced with KPUaCodeSmileyIconPadding - * @param aArray Array reference to icon array indexes in right order - */ - void SearchSmilesL( const TDesC& aStr, TDes& aFixedStr, - RArray* aArray ); - - /** - * Search smileys from buffer. - * @param aStr String to search smiles from. - * @param aSmileyInfoArray Information of found smileys. - * @param aFixedStr, Target string where smileys are replaced with KPUaCodeSmileyIconPadding - * @param aStartPos, Absolute position of index 0 in source string. Used when position of smiley is calculated. - */ - void SearchSmilesL( const TDesC& aStr, - RPointerArray< CIMCVAppSmileyInformation >& aSmileyInfoArray, - TDes* aFixedStr = NULL, TInt aStartPos = 0 ) const; - - /** - * Compares two TSmileyInformation objects' position field. - * @param aFirst Reference to the first TSmileyInformation - * @param aSecond Reference to the second TSmileyInformation - * @return (TInt) Positive if aFirst > aSecond, negative if opposite, - * 0 if aFirst == aSecond - */ - static TInt Compare( const CIMCVAppSmileyInformation& aFirst, - const CIMCVAppSmileyInformation& aSecond ); - - /** - * Compares two CIMCVAppSmileString objects' smiley length. - * @param aFirst Reference to the first CIMCVAppSmileString - * @param aSecond Reference to the second CIMCVAppSmileString - * @return (TInt) Positive if aFirst(length) < aSecond(length), - * negative if opposite, 0 if aFirst == aSecond - */ - static TInt CompareSmileyLengthReversed( - const CIMCVAppSmileString& aFirst, - const CIMCVAppSmileString& aSecond ); - - /** - * Resizes all icons. - * @param aSize new icon size - */ - void ResizeIcons( const TSize& aSize ); - - - /** - * @return aResourceId to use - */ - void ConstructSmileDialogIconArrayL( CIMCVEngine& aServiceEngine ); - - /** - * parses whole smiley string from branding and extracts each smiley code - */ - void ParseAllSmileyStringL(RPointerArray aAllSmileyString); - - public: // From MIMCVAppResourceChangeObserver - - /** - * Reload all icons on resource change - */ - void ResourceChangedL(); - - private: // Constructors and destructor - - /** - * C++ constructor. - */ - CIMCVAppSmileIconUtility( - MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi ); - - /** - * Second-phased constructor - */ - void ConstructL(CIMCVEngine& aServiceEngine ); - - private: // New methods - - /** - * Seek the first smiley which points to a given icon. - * This is slow method, and it should only be used to - * precalculate the index table. - * @param aIconIndex index of icon in iIconArray - * @return index of smiley in iStringArray - */ - TInt GetFirstSmileyIndex( TInt aIconIndex ) const; - - - - private: // Data - // NOT Own - MIMCVUiAppSkinVariant& iSkinVariant; - - // Own. Smiley strings with ref to icon array - RPointerArray iStringArray; - - // Own. Temporary array for searching the smileys. - // This should be empty when not searching. - RPointerArray iSmileArray; - - // Own. Icon reference to string smileys. - // Using a precalculated array makes seeking a lot faster, - RArray iIconToSmileyPointers; - - // Cache length, so we don't need the seek this every time. - TInt iLongestSmileyLength; - - // does not own - MIMCVAppUi& iAppUi; - - //Own. Smiley icons for SmileDialog - RPointerArray iSmileDlgIconArray; - - //Owns - RFile iFile; - - - }; - -#endif // CIMCVAPPSMILEICONUTILITY_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappsmilestring.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappsmilestring.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Class for storing one smiley with index to icon array. -* -*/ - - -#ifndef CIMCVAPPSMILESTRING_H -#define CIMCVAPPSMILESTRING_H - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* CIMCVAppSmileString -* -* Class for storing smile string and it's index of icon array. -*/ -class CIMCVAppSmileString : public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIMCVAppSmileString* NewL(); - - /** - * Destructor. - */ - virtual ~CIMCVAppSmileString(); - - public: - - /** - * Smile icon index. - * @return (TInt) Smile icon index - */ - TInt SmileIconIndex() const; - - /** - * Smile string corresponding a icon. - * @return (TDesC&) Reference to smile string - */ - const TDesC& SmileString() const; - - /** - * Set smiley string and it's index to icon. - * Takes ownership of the smiley string. - * @param aSmileyString String of smiley - * @param aIndex index of icon. - */ - void Set( const HBufC* aSmileyString, TInt aIndex ); - - /** - * Sets shortest smiley string for this smileys. - * @since S60 3.0 - * @param aSmileyString String for smiley - */ - void SetShortestSmileStringL( const TDesC& aSmileyString ); - - /** - * Check if this smiley has shortest string set or not. - * @since S60 3.0 - * @return ETrue if shortest string set, EFalse otherwise - */ - TBool HasShortestString() const; - - /** - * Returns shortest smiley string of this smiley. - * @since S60 3.0 - * @return Reference to shortest smiley string - */ - const TDesC& ShortestSmileString() const; - - private: // Constructors and destructor - - /** - * C++ constructor. - */ - CIMCVAppSmileString(); - - private: // Data - - // Owns; Smiley string - const HBufC* iSmiley; - - // Icon index of smiley - TInt iIndex; - - // Owns; Shortest string of this smiley - HBufC* iShortestSmileyString; - }; - -#endif // CIMCVAPPSMILESTRING_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileyinformation.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileyinformation.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Storage to save smiley information -* -*/ - - -#ifndef CIMCVAPPSMILEYINFORMATION_H -#define CIMCVAPPSMILEYINFORMATION_H - -// INCLUDES -#include - - -/** - * Smiley storage for saving information of one smiley and it's - * position inside a text. - * - * @lib imcvuiapp.exe - */ -class CIMCVAppSmileyInformation : public CBase - { - -public: - - /** - * Symbian constructor - */ - static CIMCVAppSmileyInformation* NewL(); - - /** - * Destructor - */ - virtual ~CIMCVAppSmileyInformation(); - - /** - * Get position of smiley inside a text - * - * @since S60 v3.0 - * @return position of smiley - */ - TInt Position() const; - - /** - * Set position of smiley inside a text - * - * @since S60 v3.0 - * @param aPosition Position of smiley - */ - void SetPosition( TInt aPosition ); - - /** - * Get the icon index of this smiley. - * - * @since S60 v3.0 - * @return Index to a correct icon. - */ - TInt Index() const; - - /** - * Set icon index of this smiley, - * - * @since S60 v3.0 - * @param aIndex index to an icon - */ - void SetIndex( TInt aIndex ); - - /** - * Get smiley string - * - * @since S60 v3.0 - * @return smiley string - */ - const TDesC& SmileyString() const; - - /** - * Set smiley string. - * - * @since S60 v3.0 - * @param aSmiley smiley string - */ - void SetSmileyStringL( const TDesC& aSmiley ); - - /** - * Flag which tells that this smiley is either in icon format (ETrue) or in - * text format (EFalse) - * - * @since S60 v3.0 - * @return Smiley is icon(ETrue) or text(EFalse) - */ - TBool IsIcon() const; - - /** - * Set format for this smiley. - * - * @since S60 v3.0 - * @param aIsIcon ETrue if this is icon, EFalse if this is text - */ - void SetIcon( TBool aIsIcon ); - - -private: - - /** - * C++ constructor - */ - CIMCVAppSmileyInformation(); - - -private: // data - - /** - * Position of this smiley in text. - */ - TInt iPosition; - - /** - * Index of smiley in icon array - */ - TInt iIndex; - - /** - * Text that contains one smiley e.g. ":-)" - * Own - */ - HBufC* iSmileyString; - - /** - * Is smiley in icon(ETrue) or string(EFalse) format. - */ - TBool iIsIcon; - - }; - -#endif // CIMCVAPPSMILEYINFORMATION_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileyutil.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappsmileyutil.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Utility for selecting smile icon and converting -* between smile id and smile string. -* -*/ - - -#ifndef CIMCVAPPSMILEYUTIL_H -#define CIMCVAPPSMILEYUTIL_H - -// INCLUDE - -#include "mimcvappmessageextension.h" -#include "cimcvappsmileiconutility.h" -#include - -// FORWARD DECLARATIONS - -class CIMCVAppSmileIconUtility; -class MIMCVAppUi; -class MIMCVUiAppSkinVariant; -class CIMCVEngine; - -// CLASS DECLARATION - - -/** -* CIMCVAPPSmileyUtil -* -* Utility for dealing with smileys in editor -*/ -class CIMCVAppSmileyUtil : public CBase, public MIMCVAppMessageExtension - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * aAppUi CIMCVAppUI reference - * @param aType message extension type - */ - static CIMCVAppSmileyUtil* NewL( MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, - TMessageExtensionTypes aType, - CIMCVEngine& aServiceEngine); - - /** - * Destructor. - */ - virtual ~CIMCVAppSmileyUtil(); - - private: // From MIMCVAPPMessageExtension - - - - /** - * Inserts icon to editor - * @param anEditor Reference to editor - */ - void InsertExtensionL( CEikRichTextEditor& anEditor, - TBool& aCancelled, TSize size ); - - /** - * Deletes icon from editor - * @param aEditor Reference to editor - * @param aPos Position where icon is located - */ - void DeleteExtensionL( CEikRichTextEditor& aEditor, TInt aPos ); - - /** - * Converts smiley icons to string smileys - * @param anEditor Reference to editor - * @param aDes Text from editor - */ - void ExtensionToStringL( CEikRichTextEditor& anEditor, TDes& aDes ); - - /** - * @see MIMCVAPPMessageExtension - */ - void ConvertSelectionToExtensionL( CEikRichTextEditor& aEditor ); - - /** - * Converts all the extensions in selection area from strings to extensions. - * @since 3.0 - * @param aRichText Rich text to be converted - * @param aSelection Selection area - */ - void ConvertSelectionToExtensionL( CRichText& aRichText, TCursorSelection& aSelection ); - - /** - * @see MIMCVAPPMessageExtension - */ - void ConvertSelectionToStringL( CEikRichTextEditor& aEditor, TBool aPreserve ); - - /** - * @see MIMCVAPPMessageExtension - */ - void Reset(); - - /** - * Informs the extensions about changed size - * @param aSize - */ - void SizeChanged( TSize& aSize ); - - /** - * @see MIMCVAPPMessageExtension - */ - void ConvertSelectionToStringL( - CEikRichTextEditor& aEditor, - TDes& aResultString, - TCursorSelection& aSelectionAfterConversion, - TBool aPreserve ); - - - TInt ServiceId() const ; - - private: // Constructors and destructor - - /** - * C++ constructor. - * @param aType Type of TMessageExtensionTypes - */ - CIMCVAppSmileyUtil( TMessageExtensionTypes aType ); - - /** - * Second-phased constructor - */ - void ConstructL( MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, - CIMCVEngine& aServiceEngine ); - - private: // Data - - //util for icon/string convertings - CIMCVAppSmileIconUtility* iSmileUtil; - - // Doesn't own - CEikRichTextEditor* iEditor; - - // Count of current smiley icons in editor - TInt iCurrentCount; - - // Is smiley converted or not - RPointerArray< CIMCVAppSmileyInformation > iConvertArray; - - // service id - TInt iServiceId; - - }; - -#endif // CIMCVAPPSMILEYUTIL_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappstatuspanehandler.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappstatuspanehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,327 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Handles statuspane, context pane -* -*/ - -#ifndef CIMCVAPPSTATUSPANEHANDLER_H -#define CIMCVAPPSTATUSPANEHANDLER_H - -// INCLUDES -#include -#include // CAknTitlePane -#include // CAknContextPane -#include //CFbsBitmap -#include -#include -#include -#include - -#include "mimcvengineopenchats.h" -#include "cimcvnewmsgfadecontrol.h" - - -// CLASS DECLARATION -class MIMCVTabObserver; -class MIMCVEngineFactory; -/** - * This class handles status, title and contextpane operations - * - * @lib imcvuiapp.exe - * @since 5.0 - */ -class CIMCVAppStatusPaneHandler : public CBase, - public MAknTabObserver, - public MIMCVEngineOpenChatsObserver - - { - public: // Constructors and destructor - - /** - * C++ default constructor. - */ - CIMCVAppStatusPaneHandler(MIMCVEngineFactory& aEngineFactory ); - - /** - * Two-phased constructor. - */ - static CIMCVAppStatusPaneHandler* NewL(MIMCVEngineFactory& aEngineFactory ); - - /** - * Destructor. - */ - virtual ~CIMCVAppStatusPaneHandler(); - - public: // New functions - - /** - * Functione to insert titlepane - */ - - void ClearTitlePaneL( ); - - /** - * Hides navi-pane decorators. - * @param aAllowDuplicates If this is true, duplicate default navi pane - * contents are allowed. Duplicates need to be removed with PopNaviPane - * when not needed anymore. - */ - void ClearNaviPaneL( TBool aAllowDuplicates = EFalse ); - - /** - * SetPicture decorators - * @since 5.0 - * @param aPicture Bitmap file - * @param aMask Bitmap mask file - */ - void SetPicture( const CFbsBitmap* aPicture, const CFbsBitmap* aMask ); - - - /** - * Sets title-pane text. - * @since 5.0 - * @param aTitle Title text - */ - void SetTitleL( const TDesC& aTitle ); - - /** - * Shows navi-pane's tabgroup-decorator according to aResourceId - * and activates a tab which has aType. - * @param aId - user id - * @param noCreate - ETrue - a New decorator is created else EFalse - */ - TInt ShowTabGroupL( const TDesC& aId, - const TBool noCreate = EFalse ); - - - /** - * RefreshTab, refreshes the title pane and tab text - * if the user has edited. - * @param aUserId - user id of the edited contact - */ - void RefreshTabL(const TDesC& aUserId,const TDesC& aDisplayName); - - public: - - /** - * API used to regiter for MIMCVTabObserver Events - */ - void AddObserver(MIMCVTabObserver* aObserver) ; - - /** - * API used to unregiter from MIMCVTabObserver events - */ - void RemoveObserver(MIMCVTabObserver* aObserver ); - - - /** - * SetActiveTabByIndexL - Sets the Tab Active indicated by Index - * @param aIndex - Index of the Conversation Item in Tab - */ - void SetActiveTabByIndexL( const TInt aIndex ); - - - /** - * Refresh title pane text, needed in skin change events. - */ - void RefreshTitlePaneTextL(); - - - /** - * Returns the pointer to CAknTabGroup. - */ - CAknTabGroup* TabGroup() const; - - void PopNaviPane(); - - public: - - - /** - * Returns IMessage indicator - * @return handle to imessage indicator - */ - CIMCVNewMsgFadeControl* IMessageIndicator() const; - - /** - * Initialises instant messaging navipane indicator. - */ - void InitMessageIndicatorL(); - - /** - * Hides fade text - */ - void HideFadeText(); - - /** - * Destroys instant messaging indicators. This method is called when - * view is deactivated. - */ - void DestroyMessageIndicator(); - - /** - * Pushes fade text control to navistack - */ - void PushFadeTextL(); - - /** - * Shows fade text - * @param aTextToFade Descriptor that contains message to fade - */ - void ShowFadeText( TDesC& aTextToFade ); - - /** - * Shows navipane indicators - */ - void ShowNavipaneIndicators(); - - /** - * Hides navi pane message info - */ - void HideNavipaneIndicators(); - - /** - * Setting previous title that was present before clear - */ - - void SetPreviousTitleL(); - /** - * Sending the Conversation View into BackGround - */ - void SendBackGroundL(); - - /** - * Bringing the Conversation View into Fore Ground - */ - void BringToForegroundL(); - - protected: // New functions - - /** - * creates new message navipane indicator - * @return CAknNavigationDecorator - */ - CAknNavigationDecorator* CreateIMessageIndicatorL(); - - /** - * Starts fade operation - */ - void RunFadeText(); - - /** - * Resets the text to fade - */ - void ResetFadeText(); - - - private: - - /** - * @see MIMCVEngineOpenChatsObserver - */ - void HandleChangeL(TInt aServiceId, TInt aIndex, TOpenChatsEventType aChangeType) ; - - /** - * @see MIMCVEngineOpenChatsObserver - */ - void SetStatusMsgL(TInt aServiceId, TInt aIndex,const TDesC & aMsg); - - /* - * play message tone, when receiving a new message. - */ - void PlayMsgBeepL(); - - - public: - /** - * API to show the tabs - */ - void ShowTabL(); - - /** - * API to hide the tabs - */ - void HideTab(); - - private: - - /** - * Creates tabs based on the Open Conversation List - */ - void CreateTabsL(const TBool noCreate); - - - private: - /** - * @see MAknTabObserver - */ - void TabChangedL(TInt aIndex); - - private: - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(); - - private: // Data - - // Doesn't own. Handle to title-pane - CAknTitlePane* iTitlePane; - - // Doesn't own. Handle to context-pane - CAknContextPane* iContextPane; - - //not Owns the factory for OpenChats - MIMCVEngineFactory& iEngineFactory; - - //Doesn't own - RPointerArray< MIMCVTabObserver > iObserverList; - - //previous tabID - TInt iPrevTabId; - - //Current TabID - TInt iCurrentTabId; - - //owns the new message icon - HBufC* iNewMsgIcon; - - //Stores the OpenConversations Tab Count - TInt iOpenChatArrayCount; - - //Owns. New decorated tab-group - CAknNavigationDecorator* iNewDecoratedTabGroup; - - // Doesn't own. Handle to navi-pane - CAknNavigationControlContainer* iNaviPane; - - //Owns. - CAknNavigationDecorator* iDecoratedFadeText; - - HBufC* iLastTitle; - - //iStatusPaneText is used to show truncated received msg (when user is conversation with one user, - //and receive msg from some other user.) - HBufC* iStatusPaneText; - - //service id - TInt iServiceId; - - - }; - -#endif // CIMCVAPPSTATUSPANEHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvapptextviewcontrol.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvapptextviewcontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,276 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: textview class -* -*/ - - -#ifndef _CIMCVAPPTEXTVIEWCONTROL_H -#define _CIMCVAPPTEXTVIEWCONTROL_H - -// INCLUDES -#include // MEikScrollBarObserver -#include -#include // TCursorSelection -#include "mimcvapptextview.h" - -// FORWARD DECLARATIONS -class CTextLayout; -class CTextView; -class CEikScrollBarFrame; -class CAknsBasicBackgroundControlContext; -class CIMCVAppCustomDraw; - -// CLASS DECLARATION - -/** -* Text viewer component -* @since 5.0 -*/ -class CIMCVAppTextViewControl : public CCoeControl, - public MIMCVAppTextView, - public MEikScrollBarObserver - { - - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aRect Draw area - * @param aParent Parent control - * @param aTextLayout Text to be viewed - * @return Instance of this class - */ - static CIMCVAppTextViewControl* NewL( const TRect& aRect, - const CCoeControl& aParent, - MLayDoc* aTextLayout ); - - /** - * Destructor. - */ - virtual ~CIMCVAppTextViewControl(); - - - void UpdateChatViewL (); - /** - * Update the view - */ - - void SmileyDialogLaunched (TBool aLaunched); - - void UpdateViewL(); - - protected: // New functions - - /** - * Updates scrollbars - */ - void UpdateScrollBarsL( TBool aScrollDraw = ETrue ); - - - /** - * Set highlight state - */ - void SetHighlighted( TBool aIsHighlighted ); - - /** - * Get scrollbars - */ - const CEikScrollBarFrame* ScrollBarFrame(); - - /** - * Finds the document position which is located at aPoint - * @param aPoint Location to find - * @return Document position or - * KErrNotFound if not found - */ - TInt FindDocPos( TPoint aPoint ); - protected: // Functions from MIMCVAppTextView - - /** - * @see MIMCVAppTextView - */ - void HandleFormatChangedL( TCursorSelection& aChanged, - TBool aPreserverFocus = EFalse ); - - /** - * @see MIMCVAppTextView - */ - void HandleInsertDeleteL( TCursorSelection& aChanged, - TInt aDeletedChars ); - - /** - * @see MIMCVAppTextView - */ - void HandleAdditionL( TBool aFirst, - TCursorSelection& aSelection, - TBool aTop ); - - - /** - * @see MIMCVAppTextView - */ - void ScrollVisibleL( TCursorSelection& aSelection, TBool aTop ); - - /** - * @see MIMCVAppTextView - */ - TCursorSelection ScrollSelection(); - - /** - * @see MIMCVAppTextView - */ - void ScrollLinesL( TInt aAmount ); - - /** - * @see MIMCVAppTextView - */ - public: - - TBool IsVisible( TInt aPos ); - - /** - * @see MIMCVAppTextView - */ - protected: - TBool ParagraphFits( TInt aPos ); - - /** - * @see MIMCVAppTextView - */ - void Redraw(); - - /** - * @see MIMCVAppTextView - */ - void SetPenBehaviour( TPenBehaviour aPen ); - - /** - * @see MIMCVAppTextView - */ - MIMCVAppTextView::TPenBehaviour PenBehaviour(); - - /** - * @see MIMCVAppTextView - */ - void ProcessStylusEventL( const TPointerEvent& aPointerEvent ); - - /** - * @see MIMCVAppTextView - */ - void HandleGlobalChangeNoRedrawL( - TViewYPosQualifier aYPosQualifier = TViewYPosQualifier() ); - - - public: // from MObjectProvider - - TTypeUid::Ptr MopSupplyObject(TTypeUid aId); - - protected: // from MEikScrollBarObserver - - void HandleScrollEventL( CEikScrollBar* aScrollBar, - TEikScrollEvent aEventType ); - - protected: // Functions from CCoeControl - - /** - * @see CCoeControl - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ); - - /** - * @see CCoeControl - */ - void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - - /** - * @see CCoeControl - */ - void Draw( const TRect& aRect ) const; - - /** - * @see CCoeControl - */ - void SizeChanged(); - - /** - * @see CCoeControl - */ - TInt CountComponentControls() const; - - - /** - * @see CCoeControl - */ - CCoeControl* ComponentControl(TInt aIndex) const; - - - protected: - - /** - * C++ default constructor. - */ - CIMCVAppTextViewControl(); - - /** - * By default Symbian 2nd phase constructor is private. - * @param aRect Draw area - * @param aParent Parent control - * @param aTextLayout Text to be viewed - */ - void ConstructL( const TRect& aRect, const CCoeControl& aParent, - MLayDoc* aTextLayout ); - - - private: // Data - - // Owns. rectangle in which to view text - TRect iViewRect; - - // Owns. text layout - CTextLayout* iLayout; - - // Owns. text view - CTextView* iTextView; - - // Owns. custom drawer for skins - CIMCVAppCustomDraw* iCustomDraw; - - // Owns. scroll bar container - CEikScrollBarFrame* iScrollBar; - - // Is control in stack? - TBool iAddedToStack; - - //owns - CAknsBasicBackgroundControlContext* iBgContext; // Skin background control context - - // Own. Clipping region to prevent flickering - RRegion* iClipping; - - // Highlight state inside text view - TBool iIsHighlighted; - - // Determines how this contol reacts to pointer events - TPenBehaviour iPenType; - - TBool iSmileyDialogLaunched; - - }; - -#endif // _CIMCVAPPTEXTVIEWCONTROL_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappui.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappui.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,314 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: application enviroment -* -*/ - -#ifndef CIMCVAPPUI_H -#define CIMCVAPPUI_H - -#include -#include -#include "mimcvappui.h" -// Forward reference -class CIMCVAppMessageExtensionsHandler; -class CIMCVAppLayoutInfo; -class MIMCVAppLayoutInfo; -class MIMCVEngineFactory; -class CIMCVAppView; -class CIMCVAppStatusPaneHandler; -class MIMCVAppLayoutChangeObserver; -class MIMCVAppResourceChangeObserver; -class TAknLayoutScalableParameterLimits; -class TAknWindowComponentLayout; -class MIMCVUiAppSkinVariant; -class CIMCVAppInputAbsorber; -class CIMCVEngine; - - -/*! - @class CIMCVAppUi - - @discussion An instance of class CIMCVAppUi is the UserInterface part of the AVKON - application framework for the conversationview example application - */ -class CIMCVAppUi :public CAknViewAppUi, - public MIMCVAppUi - { - public: - /*! - @function ConstructL - - @discussion Perform the second phase construction of a CIMCVAppUi object - this needs to be public due to the way the framework constructs the AppUi - */ - void ConstructL(); - - /*! - @function CIMCVAppUi - - @discussion Perform the first phase of two phase construction. - This needs to be public due to the way the framework constructs the AppUi - */ - CIMCVAppUi(); - - - /*! - @function ~CIMCVAppUi - - @discussion Destroy the object and release all memory objects - */ - ~CIMCVAppUi(); - - /** - * return ETrue if deletion is happening - */ - TBool IsUnderDestruction() ; - - /** - * return the mbn full resource path - */ - TDes& MbmFullPath(); - /** - * StorePreviousViewDetails store the previce application and view details - * @param aPreviousApplicationUid application uid - * @param aPreviousViewUid ,previous active view uid - */ - void StorePreviousViewDetails(TInt aPreviousApplicationUid,TInt aPreviousViewUid); - - /** - * switch application to background - */ - void SendMeToBackground(); - - - /** - * switch application to foreground - * @param aAppUid application uid - */ - void BringToForeground( TUid aAppUid ); - - /** - * constructs mif and rsc file paths based on branding, else - * initializes with default s60 path. - * @since S60 5.0 - */ - void ConstructBrandL( ); - - /** - * reconstructs the mif and rsc's after the uninstallation of the brand. - * initializes with default s60 path. - * @since S60 5.0 - */ - void ReInitializeBrandL(); - - /** - * Releases branding access. - */ - void ReleaseBrandAccess(); - - /** - * SkinVariantL - */ - - MIMCVUiAppSkinVariant* SkinVariantL(); - - /** - * is the application in Foreground - * @param Return True - if Application in Foreground else returns False - */ - TBool IsAppInForeground(); - - /* - * return active engine isntance - */ - CIMCVEngine& ActiveEngine() const ; - - public: - - /** - * Adds layout change observer - * @param aObserver Pointer to observer - */ - void AddLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver ) ; - - /** - * Removes layout observer - * @param aObserver Pointer to removed observer - */ - void RemoveLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver ) ; - - /** - * Adds resource observer - * @param aObserver Pointer to observer - */ - void AddResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver ) ; - - /** - * Removes resource observer - * @param aObserver Pointer to removed observer - */ - void RemoveResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver ) ; - - public: // from CAknAppUi - /* - @function HandleCommandL - @discussion Handle user menu selections - @param aCommand the enumerated code for the option selected - */ - void HandleCommandL(TInt aCommand); - - /* - @function HandleWsEventL - @param aEvent, event occured Handle user menu selections - @param aDestination , to delivered - */ - void HandleWsEventL( const TWsEvent& aEvent,CCoeControl* aDestination ); - - /* - @function LayoutInfo - @return pointer to layout info - */ - MIMCVAppLayoutInfo* LayoutInfo(); - /** - * From CEikAppui, Handles a change to the application's resources - * which are shared across the environment - * @param aType The type of resources that have changed - */ - void HandleResourceChangeL( TInt aType ); - - /** - * Proceses message from external application - * Used from Phonebooks external tab (Buddylist) to start instant - * messaging or from xmpp server to show new messages - * - * @since S60 v3.0 - * @param aUid Uid somethig. Needed to get this function called - * @param aParamData Data for processing - */ - void ProcessMessageL( TUid aUid, const TDesC8& aParamData ); - /** - * @since S60 v3.0 - * from CAknViewAppUi - * @param aForeground , ETrue if in Forground else Background - */ - void HandleForegroundEventL( TBool aForeground ); - - - public : // new functions - - - /** - * shut down and exit the application - */ - void ShutDownAndCloseApplicationL(); - - /** - * Capture events if needed - */ - void CaptureEventsL(); - - /** - * Releases events capturing - */ - void ReleaseCapturingL(); - - /** - * Returns if events are captured - * @return ETrue if captured - */ - TBool AreEventsCaptured() const; - - - - private : - - /** - * CCalculatePreviewPaneWidth - */ - void CalculatePreviewPaneWidth(); - - /** - * SelectWindowVariety variety from window - * @param aNumberOfLines lines to be used - * @param aLimits ,limits - */ - TInt SelectWindowVariety( const TInt aNumberOfLines, const TAknLayoutScalableParameterLimits& aLimits ) const; - /** - * RectFromLayout rect from layout - * @param aParent parant - * @param aComponentLayout layout - * @return rect - */ - TRect RectFromLayout( const TRect& aParent, const TAknWindowComponentLayout& aComponentLayout ) const; - - /** - * Prepares branding access - * - * @since S60 5.0 - */ - TInt PrepareBrandingAccess(); - - - /** - * handle connection close and exit the servicetab also - * @param aEventValue, the event value to publish - */ - void HandleServiceCloseExitL(TInt aEventValue ); - - private: - - // owned , refrence to message hadler - CIMCVAppMessageExtensionsHandler* iMessageHandler; - - // onwed, layout info - CIMCVAppLayoutInfo* iLayoutInfo; - - // owned, reference to imcvuiengine component - MIMCVEngineFactory* iEngineFactory ; - - // owned , used to set the tile, label icon in title pane - CIMCVAppStatusPaneHandler* iStatusPaneHandler; - - RPointerArray iLayoutObservers; - - // Doesn't own objects. Array of resource observers - RPointerArray iResourceObservers; - - TFileName iChatMbmFullPath; - - // phonebook application uid - TInt iPbkApplicationUid; - // phonebook active view id - TInt iPbkActiveViewUid; - // owned - MIMCVUiAppSkinVariant* iSkinVariant; - - TBool iDestructingFlag; - - TBool iServerDisconnected; - - //owns the instance of the inputobserver - CIMCVAppInputAbsorber* iInputAbsorber; - //not Owns : pointer to view - CIMCVAppView* iCIMCVAppView; - - //is app in forground or background - TBool iIsAppForeground; - - }; - - -#endif // CIMCVAPPUI_H - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappview.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappview.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,374 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: application main view -* -*/ - - - -#ifndef _CIMCVAPPVIEW_H -#define _CIMCVAPPVIEW_H - -// INCLUDES -#include "cimcvappviewcontainer.h" -#include -#include -#include "mimcvenginemessagehandlerobserver.h" -#include "mimcvrecipientobserver.h" -#include "mimcvtabobserver.h" -#include "mimcvnewmsgfadecontrolobserver.h" -#include "mimcvenginechatlistobserver.h" -#include -//For KMaxPackedContactLinkLength -#include "imcvuiparams.h" -#include "mimcvngineservicechangeobserver.h" -#include -// FORWARD DECLARATIONS -class CIMCVAppUi; -class MIMCVEngineChatInterface; -class CFindItemMenu; -class CItemFinder; -class CIMCVAppUi; -class CIMCVEngine; -class CIMCVAppStatusPaneHandler; -class MCCAConnection; -class MCCAParameter; -class CIMCVMenuExtensionManager; -class MIMCVEngineFactory; -class CAiwServiceHandler; - - -// CLASS DECLARATION - -/** - * This is view class for conversation view - */ - -class CIMCVAppView : public CAknView, - public MIMCVRecipientObserver, - public MIMCVTabObserver, - public MIMCVNewMsgFadeControlObserver, - public MAknToolbarObserver, - public MIMCVEngineServiceChangeObserver - - { - - public: // Constructors and destructor - - /** - * C++ default constructor. - */ - CIMCVAppView(); - - /** - * Symbian 2nd phase constructor. - * @param aAvkonViewResourceId Resource id for view - * @param aViewId Id of the view - */ - void ConstructL( TInt aAvkonViewResourceId, TUid aViewId, - CIMCVAppMessageExtensionsHandler& aMessageHandler); - - /** - * Destructor. - */ - virtual ~CIMCVAppView(); - - - public : // MIMCVEngineServiceChangeObserver - - /* - * new service has been installed - */ - void HandleNewServiceL( TInt aServiceId ) ; - /* - * service has been deleted - */ - void HandleServiceDeletedL( TInt aServiceId ) ; - /** - * handle presence change notification - * call back from imcvuiengine - */ - void HandlePresenceChangedL(TInt aServiceId, const TDesC& aBuddyId ) ; - - /** - * Handle message send operation completion. - * @param aResult result to handle. - */ - void HandleOperationCompletdL(TInt aServiceId , MIMCVEngineMessage::TMessagerType aType , TInt aResult); - - /** - * @see HandleConnectionTerminatedL - * to handle the connection lost - * @param aReason, reason report - */ - void HandleConnectionEventL(TInt aServiceId, TIMCVConnectionState aState, TInt aReason ) ; - - /* - * See MIMCVEngineChatListObserver - */ - void HandleChatListEvent(TInt aServiceId, TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* aContainerInfo ) ; - - - public: // New methods - - /** - * Handles changes in CBA states - * @since 5.0 - * @param aResourceId Resource that changes - */ - void HandleCbaChangeL( TInt aResourceId ); - - /** - * SetStatusPaneIconsL set the icons based on presence status - * @since 5.0 - */ - void SetStatusPaneIconsL(); - - /** - * From MIMCVRecipientObserver - * Shows customized menu - */ - void ShowPopUpMenuL( ); - - /** - * Function to launch help - */ - void LaunchHelpL( const TDesC& aContext); - - void ShowMeL( const TDesC8& aParamData ) ; - - void UpdateToolbarButtonsStateL(); - - /** - * Launches the contact details view - * - */ - void LaunchCcaL(); - - /* - * return active engine reference - */ - CIMCVEngine& ActiveEngine() const ; - - private: // Functions from base classes - - /** - * From MEikMenuObserver, Called by framework before - * constructing menupane - * @param aResourceId Resource to be constructed - * @param aMenuPane Pointer to menupane being constructed - * @see MEikMenuObserver - */ - void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); - - /** - * Resolve currently selected item type and set it to CItemFinder - */ - void UpdateItemTypeL(); - - private: - - /** - * From CAknView, Gets called from framework when activating this view - * @param aPrevViewId Previous view id - * @param aCustomMessageId Custom message's id - * @param aCustomMessage Custom message - * @see CAknView - */ - void DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId, - const TDesC8& aCustomMessage); - - /** - * From AknView, deactivates view - * @see CAknView - */ - void DoDeactivate(); - - - - /** - * From CAknView - * @param aCommand Command that was received - * @see CAknView - */ - void HandleCommandL(TInt aCommand); - - /** - * Handles foreground event - * @param aForeground ETrue if foreground else EFalse - * @see CAknView - */ - void HandleForegroundEventL( TBool aForeground ); - - /** - * Show query dialog - * @param aDialogResourceId resource id - * @param aPrompt text to be shown - */ - TInt DisplayQueryDialogL( TInt aDialogResourceId, - const TDesC& aPrompt ); - - - - - - private: - /** Helper Function - * This function is to be called when switching between tabs - * @param aChatId - Switch to this chat item - * @param aTabIndex - Index of the tab - */ - - void SwitchTabL(TInt aActiveServiceId , const TDesC& aChatId, const TInt aTabIndex); - - - - private: - - /** - * From MIMCVNewMsgFadeControlObserver - * @see MIMCVNewMsgFadeControlObserver - */ - void NotifyWhenCompleted() ; - - /** - * From MIMCVNewMsgFadeControlObserver - * @see MIMCVNewMsgFadeControlObserver - */ - void NotifyWhenStarted(); - - public: - /** - * This function is to be called when left/right Navigation key is pressed - * @param aKeyEvent - * @param aType - */ - TKeyResponse OfferTabEventL(const TKeyEvent& aKeyEvent,TEventCode aType); - public: // MAknToolbarObserver - /** - * Called when toolbar events occur - * - * @since 5.0 - * @return void - */ - void OfferToolbarEventL( TInt aCommand ) { HandleCommandL(aCommand); } - - private: - /** - * id from base clas. - */ - - TUid Id() const; - - /** - * constructs necessary icons for this decorator - * @return Icon. - **/ - CGulIcon* LoadBitmapL( ); - - - /** - * refreshes the view. - */ - void ViewRefreshL(); - - /* - * switch the valid service references - */ - void SwitchToValidServiceL( TInt aServiceId ); - - /* - * Deltete the CIMCVAppRichTextContainerCache when xsp id deleted from detail view.. - */ - void DeleteContainerCache(const TDesC& aPrimaryKey, TInt aServiceId ); - - private: // Data - - // View's UID - TUid iViewId; - - // Owns. Container - CIMCVAppViewContainer* iContainer; - - //Owns. Contact id - HBufC* iRecipientUserId; - - //Doesn't own. Message handler - CIMCVAppMessageExtensionsHandler* iExtensionHandler; - - - // not owned, from CCoeEnv - CIMCVAppUi* iAppUi; - - - //stores the default MBM path - TFileName iDefaultMbmPath; - - // Owns. Popup-menu for find item UI - CEikMenuBar* iFindContextMenu; - - // owns. menu pane for find item functionality - CFindItemMenu* iFindMenu; - - // owns. - CItemFinder* iItemFinder; - - //Service Id - TInt iServiceId; - - //Doesnt Own - CIMCVAppStatusPaneHandler* iStatusPane; - - - MCCAConnection* iConnection; - - MCCAParameter* iParameter; - - TBool iViewDeactivated; - - //Owns Cache to store CIMCVAppRichTextContainer objects - CIMCVAppRichTextContainerCache* iRTContainerCache; - - //Owns. "From me" icon - CGulIcon* iFromMe; - - //Owns. "To me" icon - CGulIcon* iToMe; - - //Owns Menu Extention manager - CIMCVMenuExtensionManager* iMenuExtManager; - - // not owns : reference to imcvuiengine component - MIMCVEngineFactory* iEngineFactory ; - - // not owns : active change engine pointer - CIMCVEngine* iActiveEngine; - - // not owned , chat interface - MIMCVEngineChatInterface* iActiveChatInterface; - //owns. object of aiwservicehandler. - CAiwServiceHandler *iAiwServiceHandler; - - //Keep track if Detail view is opened. - TBool iDetailViewOpen; - - //Keep track, if conv. view need to be closed when xsp id is deleted - //when doing back operation conv. view need to be closed if xsp id deleted from detail view. - TBool iConvViewDel ; - - - }; - -#endif // _CIMCVAPPVIEW_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappviewcontainer.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappviewcontainer.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,432 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: main view container class -* -*/ - - - -#ifndef _CIMCVAPPVIEWCONTAINER_H -#define _CIMCVAPPVIEWCONTAINER_H - -// INCLUDES -#include "cimcvapprichtextcontainercache.h" -#include "mimcvapplayoutchangeobserver.h" -#include "mimcvtapeventobserver.h" -#include "cimcvappmessageeditor.h" - -#include //For the CDesCArray -#include -#include "cimcvengine.h" -// FORWARD DECLARATIONS -class CIMCVAppMessageExtensionsHandler; -class CIMCVAppViewControl; -class MIMCVEngineMessageReadInterface; -class MIMCVEngineMessageWriteInterface; -class MIMCVEngineMessage; -class CIMCVAppUi; -class MIMCVUiAppSkinVariant; -class MIMCVRecipientObserver; -class CIMCVAppLoginEventListener; -class CIMCVAppView; -class CIMCVAppMessageEditor; -class MIMCVEngineFactory; - -// CLASS DECLARATION - -/** -* This is container class for conversation view -*/ -class CIMCVAppViewContainer : public CCoeControl, - public MEikEdwinSizeObserver, - public MIMCVAppLayoutChangeObserver, - public MCoeControlObserver, - public MIMCVAppMessageEditorObserver, - public MIMCVTapEventObserver - { - public: // Enumerations - - /** - * Observed controls - */ - enum TTouchableControls - { - EMessageList = 1, - EMessageEditor - }; - - public: // Constructors and destructor - - /** - * Symbian OS default constructor. - * @param aRect Frame rectangle for container. - * @param aEngine, refence to engine - * @param aReadInterface to read the messages - * @param aWriteInterface for writing the messages - * @param aParent Context access mechanism. - * @param aMessageHandler Handling messages - * @param aCba Pointer to cba of view. - * @param aRecipientId, recipient user id - * @param aBrandingAccess, brand accessor - */ - static CIMCVAppViewContainer* NewL( const TRect& aRect, - CIMCVEngine* aEngine, - MIMCVEngineMessageReadInterface* aReadInterface, - MIMCVEngineMessageWriteInterface* aWriteInterface, - CIMCVAppView* aParent, - CIMCVAppMessageExtensionsHandler& aMessageHandler, - CEikButtonGroupContainer* aCba, - const TDesC& aRecipientId, - MIMCVRecipientObserver* aRecipientObserver, - CIMCVAppRichTextContainerCache* aRTContainerCache, - CGulIcon* aFromMe, CGulIcon* aToMe); - - - /** - * Destructor. - */ - virtual ~CIMCVAppViewContainer(); - - - private: - - /** - * Symbian OS default constructor. - * @param aRect Frame rectangle for container. - * @param aParent Context access mechanism. - */ - void ConstructL( const TRect& aRect, MObjectProvider* aParent, - CGulIcon* aFromMe, CGulIcon* aToMe , - const TDesC& aRecipientId ); - - - public: // New functions - const TRect TextRect() const; - - - /** - * Switches the Containers ReadInterface & WriteInterface - * @param aReadInterface to read the messages - * @param aWriteInterface for writing the messages - */ - void SwitchViewL( MIMCVEngineMessageReadInterface* aReadInterface, - MIMCVEngineMessageWriteInterface* aWriteInterface, - const TDesC& aRecipientId ); - - /* - * assigned new engine instance - */ - void SetServiceParametersL(CIMCVEngine* aNewEngine ) ; - /** - * Returns buffer containing the currently selected text - * (or empty buffer if nothing selected) - */ - HBufC* SelectedItemL(); - - /** - * @return Type of selected item - */ - TInt SelectedItemType(); - - - /** - * This method starts scrolling - * @since 5.0 - */ - void StartScrollingL(); - - /** - * This method stops scrolling - * @since 5.0 - */ - void StopScrollingL(); - - void StartConversationL(); - - - /** - * This closes the active conversation - * @since 5.0 - */ - TInt CloseConversationL(const TDesC& aBuddyId ); - - /** - * This will deactivate the active conversation - * @since 5.0 - */ - TInt DeactivateConversationL(); - - /** - * This method handles message sending - * @since 5.0 - */ - void SendMessageL(); - - /** - * This method insert a message about the presence status changes - * @since 5.0 - */ - void InsertStatusChangedMessageL(CIMCVEngine& aEngine, TInt aServiceId,const TDesC& aBuddyId ); - - /** - * Return reference of CIMCVAppMessageEditor object. - */ - CIMCVAppMessageEditor& Editor() const ; - - /** - * This checks if scroll mode is on or off - * @since 3.2 - * @return Returns if scrolling is stopped or not (TBool) - */ - TBool IsStopped() const; - - /** - * Sets item highlighting on or off (automatic find) - * @param aHihghlight ETrue to set finder on - */ - void SetItemHighlightL( TBool aHighlight ); - - - /** - * Should we fetch new messages or not - * @param aFetch ETrue if this chat is in foreground and should receive - * messages, EFalse otherwise. - */ - void FetchMessages( TBool aFetch ); - - - /** - * Method to force refresh in the rich text editor, - * called from view when adding a smiley. - * @since 3.0 - */ - void RefreshEditorL(); - - /** - * Loads fome/tome icons - * @param aId, Id of the element required by the brnading server - * aBitmapId, id of the icon - * aMaskId of the icon - */ - CGulIcon* LoadBitmapL(const TDesC8& aId, const TInt aBitmapId,const TInt aMaskId ); - - /** - * IsLoggedIn - * @return ETrue if logged in else EFalse - * @since 5.0 - */ - TBool IsLoggedIn() const; - - - /** - * Update the CBA labels - */ - void UpdateCbaL(); - - /* - * Saves the message typed in the message editor of - * container - */ - void StoreEditorMessageL(); - void SmileyDialogLaunched (TBool aLaunched); - void UpdateChatViewL (); - - private: - - /** - * This function does basic clearing after the message is sent - */ - void ResetAfterSendL(); - - /** - * This function displays information notes - * @param aResourceId Resource ID of note - */ - void DisplayInfoNoteL( const TInt aResourceId ); - - void ResizeIcons( TRect aParentRect ) ; - - - private: - - void MapFromBitmapIdToAknsItemId( TInt aBitmapId, - TAknsItemID& aItemId, TInt& aColorGroupId ); - - //does not Owns. "From me" icon - CGulIcon* iFromMe; - - //does n0t Owns. "To me" icon - CGulIcon* iToMe; - - - private: // Functions from base classes - - /** - * From MIMCVAppLayoutChangeObserver, for layout change observing - */ - void LayoutChangedL( TInt aType ); - - - /** - * From MEikEdwinSizeObserver, This method handles edwin's size change - * @param aEdwin The edwin for which the size event is being handled - * @param aEventType The event type - * @param aDesirableEdwinSize The desired size for the edwin identified - * by aEdwin - * @return The return value depends on your implementation. - * Return ETrue if you wish to redraw the edwin. - * EFalse otherwise - */ - TBool HandleEdwinSizeEventL( CEikEdwin* aEdwin, - TEdwinSizeEvent aEventType, TSize aDesirableEdwinSize ); - - - - private: // From MCoeControlObserver - - /** - * @see MCoeControlObserver - */ - void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ); - - private: // Functions CCoeControl - - /** - * From CoeControl, Handles "size changed"-events.. - */ - void SizeChanged(); - - /** - * From CoeControl, - * Returns the number of control contained by this class. - * @return Number of controls contained - */ - TInt CountComponentControls() const; - - /** - * From CCoeControl, Returns handle to control pointed by aIndex - * @param aIndex Wanted control's index [0..n] - * @return Handle to wanted control - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * From CCoeControl, Gets called when drawing is needed (by framework) - * @param aRect Rect that needs to be drawed - */ - void Draw( const TRect& aRect ) const; - - /** - * From CCoeControl, Handles key-events - * @param aKeyEvent Event that occured - * @param aType Type of key-event - * (EEventKey, EEventKeyUp or EEventKeyDown) - * @return Containers response to event - * (EKeyWasNotConsumed/ EKeyWasConsumed) - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ); - - - private: // From MIMCVAppMessageEditorObserver - - /** - * Handle editor event. - */ - void HandleMessageEditorEventL( TEditorEvent aEvent ); - - private: // new functions - /** - * Constructor - * @param aEngine, refence to engine - * @param aReadInterface to read the messages - * @param aWriteInterface for writing the messages - * @param aMessageHandler Handling messages - * @param aCba Pointer to cba of view. - * @param aRecipientId, recipient user id - */ - CIMCVAppViewContainer( - CIMCVEngine* aEngine, - MIMCVEngineMessageReadInterface* aReadInterface, - MIMCVEngineMessageWriteInterface* aWriteInterface, - CIMCVAppMessageExtensionsHandler& aMessageHandler, - CEikButtonGroupContainer* aCba, - MIMCVRecipientObserver* aRecipientObserver, - CIMCVAppView& aAppView, - CIMCVAppRichTextContainerCache* aRTContainerCache - ); - - private: // From MIMCVTapEventObserver - - /** - * @see MIMCVTapEventObserver - */ - void HandleTapEventL( TTapEvent aEvent, TUint aControlId ); - - - private: // Data - // not owned, reference to uiengine - CIMCVEngine* iActiveEngine ; - - // not owned., reference to appui - CIMCVAppUi* iAppUi; - // Owns. Chat view control - CIMCVAppViewControl* iChatView; - // not owned, message read interface - MIMCVEngineMessageReadInterface* iReadInterface; - // not owned, message witre interface - MIMCVEngineMessageWriteInterface* iWriteInterface; - - - // owned, outer line - TAknLayoutRect iOutLine; - // owned, horizontal line - TAknLayoutRect iHoriline; - // owned, vertical line - TAknLayoutRect iVertLine; - - - // not owned, message extention handler - CIMCVAppMessageExtensionsHandler& iMessageExtensionsHandler; - - - // Does not own. Pointer to cba of view. - CEikButtonGroupContainer* iCba; - - - //holds the reference to the contact to which - //conversation has been established. - HBufC* iRecipientId; - - // owned, message content - HBufC* iEditorMessage; - - // not owned - MIMCVUiAppSkinVariant* iSkinVaiant; - - - //Doesn't own. Handle to recipient observer - MIMCVRecipientObserver* iRecipientObserver; - - //Reference to the AppView object - CIMCVAppView& iAppView; - //owns. meesage editor - CIMCVAppMessageEditor* iMsgEditor; - //Does nt Owns. Cache to store CIMCVAppRichTextContainer objects - CIMCVAppRichTextContainerCache* iRTContainerCache; - }; - -#endif // _CIMCVAPPVIEWCONTAINER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappviewcontrol.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappviewcontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: cimcvappviewcontrol.h -* -*/ - - - -#ifndef _CIMCVAPPVIEWCONTROL_H -#define _CIMCVAPPVIEWCONTROL_H - -// INCLUDES -#include "cimcvapprichtextcontainercache.h" -#include "cimcvapptextviewcontrol.h" -#include "cimcvapprichtextcontainer.h" -#include "cimcvengine.h" -// FORWARD DECLARATIONS -class CIMCVAppMessageFlowHandler; -class MIMCVEngineMessageReadInterface; -class CIMCVAppMessageExtensionsHandler; -class MIMCVTapEventObserver; -// CLASS DECLARATION - -/** -* @imcvuiapp.exe -* @since 5.0 -*/ -class CIMCVAppViewControl : public CIMCVAppTextViewControl - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aRect Draw area - * @param aParent Parent control - * @param aReadInterface Message read interface - * @param aExtensionsHandler Message extensions handler - * @param aMessageUtils Message utils - * @param aRTContainerCache - cache - * @param aScrollOver Should we scroll over the top and bottom, - * i.e. disabling highlight when pressing up at top. - * EFalse used with recorded chats. - * @return Instance of this class - */ - static CIMCVAppViewControl* NewL( const TRect& aRect, - const CCoeControl& aParent, - MIMCVEngineMessageReadInterface& aReadInterface, - CIMCVAppMessageExtensionsHandler& aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - CIMCVAppRichTextContainerCache& aRTContainerCache, - CIMCVEngine& aActiveEngine, - TBool aScrollOver = ETrue); - - /** - * Destructor. - */ - virtual ~CIMCVAppViewControl(); - - public: // New functions - - - /** - * Returns buffer containing the currently selected text - * (or empty buffer if nothing selected) - */ - HBufC* SelectedItemL(); - - /** - * @return Type of selected item - */ - TInt SelectedItemType(); - - - /** - * Disable all highlighting - */ - void DisableHighlightL(); - - /** - * @return ETrue if some item is highlighted - */ - TBool Highlighted(); - - /** - * Move text's highlight up and down. - * @param aMovement In which direction we move the higlight - */ - void MoveHighlightL( - CIMCVAppRichTextContainer::THighlightMovement aMovement); - - - /** - * @returns the total messages in the view - */ - TInt GetMessageCount(); - - /** - * Set scrolling method - * @param aHihghlight If ETrue, scroll by highlighting items - * otherwise scroll by rows - */ - void SetHighlight( TBool aHighlight ); - - /** - * Set observer for handling tap events. - * Supports only single observer. - * @param aObserver observer to handle tap events - * @param aId control id which is used by the observer to - * identify this object. - */ - void SetTapObserver( MIMCVTapEventObserver* aObserver, TUint aId ); - - - /** - * Should we fetch new messages or not - * @param aFetch ETrue if this chat is in foreground and should receive - * messages, EFalse otherwise. - */ - void FetchMessages( TBool aFetch ); - - - protected: // Functions from CIMCVAppTextViewControl - - /** - * @see CIMCVAppTextViewControl - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ); - - /** - * @see CIMCVAppTextViewControl - */ - void ProcessStylusEventL( const TPointerEvent& aPointerEvent ); - - /** - * @see CIMCVAppTextViewControl - */ - void SizeChanged(); - - private: - - /** - * C++ default constructor. - */ - CIMCVAppViewControl(); - - /** - * By default Symbian 2nd phase constructor is private. - * @param aRect Draw area - * @param aParent Parent control - * @param aReadInterface Message read interface - * @param aExtensionsHandler Message extensions handler - * @param aMessageUtils Message utils - * @param aRTContainerCache - cache - * @param aScrollOver Should we scroll over the top and bottom, - * i.e. disabling highlight when pressing up at top. - */ - void ConstructL( const TRect& aRect, const CCoeControl& aParent, - MIMCVEngineMessageReadInterface& aReadInterface, - CIMCVAppMessageExtensionsHandler& aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - CIMCVAppRichTextContainerCache& aRTContainerCache, - CIMCVEngine& aActiveEngine, - TBool aScrollOver ); - - - private: // Data - - // owns. Text container - CIMCVAppRichTextContainer* iTextContainer; - - // owns. Message flow handler - CIMCVAppMessageFlowHandler* iFlowHandler; - - // Not owned. Pointer to observer - MIMCVTapEventObserver* iTapObserver; - - // ID which needs to be reported back to TapObserver - TUint iTapControlId; - - // Tap waiting flags touch screen. - TBool iWaitForDoubleTap; - TBool iWaitForSingleTap; - }; - -#endif // _CIMCVAPPVIEWCONTROL_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvappwaitnote.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvappwaitnote.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* Copyright (c) 2008 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: Helper class for wait notes -* -*/ - - - -#ifndef CIMCVAPPWAITNOTE_H -#define CIMCVAPPWAITNOTE_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS - -// CLASS DECLARATION - - -// Observer class to notice dismissing note by cancel. -class MIMCVWaitNoteObserver - { - public: // Interface methods - - /** - * Wait note is canceled. - */ - virtual void NoteCanceled( TInt aButtonId ) = 0; - }; - -/** - * Helper class for wait notes - * - * @lib imcvuiapp.exe - * @since - */ -class CIMCVAppWaitNote : public CBase, public MProgressDialogCallback - { - public: // Constructors and destructor - - /** - * Shows waitnote - * - * @param aText Text to be shown in note. - * @param aShowImmediately If ETrue waitnote is shown immediately - * (not after 1 sec delay) - * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not - */ - static CIMCVAppWaitNote* ShowWaitNoteL( const TDesC& aText, - TBool aShowImmediately = EFalse, - TBool aCanBeCanceledByUser = EFalse, - MIMCVWaitNoteObserver* aObserver = NULL ); - - /** - * Shows waitnote and pushes the item to cleanupstack - * - * @param aTextResource Resource id of text to be shown in note. - * @param aShowImmediately If ETrue waitnote is shown immediately - * (not after 1 sec delay) - * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not - */ - static CIMCVAppWaitNote* ShowWaitNoteLC( TInt aTextResource, - TBool aShowImmediately = EFalse, - TBool aCanBeCanceledByUser = EFalse, - MIMCVWaitNoteObserver* aObserver = NULL ); - - /** - * Shows waitnote, does not leave anything to cleanupstack. - * - * @param aTextResource Resource id of text to be shown in note. - * @param aShowImmediately If ETrue waitnote is shown immediately - * (not after 1 sec delay) - * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not - */ - static CIMCVAppWaitNote* ShowWaitNoteL( TInt aTextResource, - TBool aShowImmediately = EFalse, - TBool aCanBeCanceledByUser = EFalse, - MIMCVWaitNoteObserver* aObserver = NULL ); - /** - * Destructor. - */ - virtual ~CIMCVAppWaitNote(); - - protected: // From MProgressDialogCallback - - /** - * From MProgressDialogCallback Get's called when a dialog is dismissed - * @param aButtonId Button that was used to dismiss the dialog - */ - void DialogDismissedL( TInt aButtonId ); - - - public: // New functions - - /** - * Dismisses this waitnote - */ - void DismissDialog(); - - - private: - - /** - * C++ default constructor. - */ - CIMCVAppWaitNote(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL( const TDesC& aText, - TBool aShowImmediately, - TBool aCanBeCanceledByUser, - MIMCVWaitNoteObserver* aObserver ); - - public: // New methods - - /** - * Set wait note observer. NULL will unset this one. - */ - void SetObserver( MIMCVWaitNoteObserver* aObserver ); - - private: // Data - - // Doesn't own (destroys itself) - CAknWaitDialog* iWaitDialog; - - /// Wait note observer. This will be notified when wait note is dismissed. - MIMCVWaitNoteObserver* iObserver; - }; - -#endif // CIMCVAPPWAITNOTE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvcommandinfo.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvcommandinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2008 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: Ccommand info -* -*/ -#ifndef __CIMCVCOMMANDINFO_H__ -#define __CIMCVCOMMANDINFO_H__ - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class TResourceReader; - -/** - * command info - */ -class CIMCVCommandInfo : public CBase - { - - public: - /** - * Static factory function that performs the 2-phased construction. - * - * @param aReader Reference to resource reader to be used - * @param aId Id of the component owning the command IDs - * @param anewCommandIds New command IDs - * @return New instance of this class - */ - static CIMCVCommandInfo* NewLC( TResourceReader& aReader, - TInt32 aPluginId, - TInt& aNewCommandIds ); - - /** - * Destructor. - */ - ~CIMCVCommandInfo(); - - public: - - /** - * Returns the plugin ID from command info - * - * @return The plugin ID related to this command info - */ - TInt32 PluginId() const; - - /** - * Gets the new command ID - * - * @return The new command ID - */ - TInt32 NewCommandId() const; - - /** - * Gets the old/original command ID - * - * @return The old/original command ID - */ - TInt32 OldCommandId() const; - - private: - - /** - * Constructor. - */ - CIMCVCommandInfo( TInt32 aPluginId ); - - /** - * 2nd phase constructor. - */ - void ConstructL( TResourceReader& aReader, - TInt& aNewCommandIds ); - - private: // Data - // plugin id - TInt32 iPluginId; - - //new command id form the command pool - TInt32 iNewCommandId; - - //old command id from the plugin - TInt32 iOldCommandId; - }; - - -#endif // __CIMCVCOMMANDINFO_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvmenuextensionmanager.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvmenuextensionmanager.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,170 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that provides extensions for options menu -* -*/ - -#ifndef CIMCVMENUEXTENSIONMANAGER_H -#define CIMCVMENUEXTENSIONMANAGER_H - -// INCLUDES -#include -#include -#include -#include - -// CONSTANTS - -// FORWARD DECLARATIONS -class CEikMenuPane; -class CIMCVCommandInfo; -class CIMCVMenuExtension; - - -// CLASS DECLARATION - -/** - * - * This class provides extensions to options menu. - * - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CIMCVMenuExtensionManager ) : public CBase, - public MIMCVCommandMapper - { - public: // Constructor and destructor - - /** - * Two-phased constructor. - * - * @param aServiceName, service name. - * @param aExtensionFactory, extension factory - */ - static CIMCVMenuExtensionManager* NewL( ); - - /** - * Two-phased constructor. - * - * @param aServiceName, service name. - * @param aExtensionFactory, extension factory - */ - static CIMCVMenuExtensionManager* NewLC(); - - /** - * Standard C++ destructor - */ - ~CIMCVMenuExtensionManager(); - public: // from MCommandMapper - /** - * Gets old original command ID which corresponds - * to the given new one - * - * @param aPluginId implementation ID for identification - * @param aNewCommand New mapped command ID - * @param aOldCommand On return old/original command ID - * @return KErrNone if mapping exist, otherwise KErrNotFound - */ - TInt GetOldCommand( TInt32 aPluginId, TInt aNewCommand, - TInt& aOldCommand ) const; - - /** - * Gets new mapped command ID which corresponds - * to the given old one - * - * @param aPluginId implementation ID for identification - * @param aOldCommand Old/original command ID - * @param aNewCommand On return new mapped command ID - * @return KErrNone if mapping exist, otherwise KErrNotFound - */ - TInt GetNewCommand( TInt32 aPluginId,TInt aOldCommand, - TInt& aNewCommand ) const; - public: - /** - * offers the menu pane of the ConversationView connected to this - * extension. - * - * @param aPreviousId Menu command id after which the plugins menu - * should come. - * @param aMenuPane Menu pane which will be filtered. - * @param aServiceid service id - */ - void OfferMenuPaneToPlugins - (TInt aPreviousId, CEikMenuPane& aMenuPane,TUint aServiceId); - - /** - * Handles ConversationView extension commands. - * - * @param aCommandId Command ID. - * - * @return ETrue if command was handled, otherwise EFalse. - */ - TBool OfferHandleCommandToPlugins(TInt aCommandId); - - /** - * Loads all the plugins - */ - void LoadPluginL( ); - - /** - * Map the plugin command to Conversation view command - */ - void MapCommandL(CIMCVMenuExtension& aMenuExtension, TInt32 aPluginId); - - private: // Implementation - - /** - * Standard C++ constructor - * @param aServiceName, service name. - * @param aExtensionFactory, extension factory - */ - CIMCVMenuExtensionManager( ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - private: - /** - * Internal class used as a wrapper around a plugin - * and its uid. - */ - class CPluginInfo : public CBase - { - public: // Constructor & Destructor - CPluginInfo( CIMCVMenuExtension* aPlugin, TUid aUid ); - ~CPluginInfo(); - - public: // New functions - CIMCVMenuExtension& Plugin(); - private: // Data - CIMCVMenuExtension* iPlugin; - TUid iPluginUid; - }; - - private: // Data - - // New commands pool - TInt iNewCommands; - - // takes ownership of the plugins - RPointerArray iPlugins; - - // Array of command id mappings,Owned - RPointerArray iCommandIdMap; - - }; - -#endif // C_CVIMPSTUIVIEWMANAGER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvuiappiconfileprovider.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvuiappiconfileprovider.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2008 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: Icon file provider. - * -*/ - - - -#ifndef CIMCVUIAPPICONFILEPROVIDER_H -#define CIMCVUIAPPICONFILEPROVIDER_H - -// INCLUDES -#include -#include -#include - - -// FORWARD DECLARATIONS - -// CLASS DECLARATION - -/** - * Icon file provider. - * See MAknIconFileProvider.h for comments. - * - * @lib chat.app - * @since 3.0 - */ -class CIMCVUiAppIconFileProvider : public CBase, public MAknIconFileProvider - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIMCVUiAppIconFileProvider* NewL( RFile& aFile ); - - /** - * Destructor. - */ - virtual ~CIMCVUiAppIconFileProvider(); - - public: // Functions from base classes - - /** - * @see MAknIconFileProvider - */ - void RetrieveIconFileHandleL( - RFile& aFile, const TIconFileType aType ); - - /** - * @see MAknIconFileProvider - */ - void Finished(); - - private: - - /** - * C++ default constructor. - */ - CIMCVUiAppIconFileProvider( ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(RFile& aFile); - - private: // Data - - RFile iFile; - }; - -#endif // CIMCVUIAPPICONFILEPROVIDER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cimcvuiappskinvariant.h --- a/imstutils/imconversationview/imcvuiapp/inc/cimcvuiappskinvariant.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -/* -* Copyright (c) 2008 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: skin variation class -* -*/ - - - -#ifndef CIMCVUIAPPSKINVARIANT_H -#define CIMCVUIAPPSKINVARIANT_H - -// INCLUDES -#include "mimcvuiappskinvariant.h" - -#include - -// FORWARD DECLARATIONS -class CCoeControl; -class CAknsBasicBackgroundControlContext; -class CGulIcon; -class TAknsItemID; -// CLASS DECLARATION - -/** -* Active implementation of skin feature. -* See base class MCASkinVariant.h for comments. -* @imcvuiapp.exe -* @since 5.0 -*/ - -class CIMCVUiAppSkinVariant : public CBase, - public MIMCVUiAppSkinVariant - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIMCVUiAppSkinVariant* NewL( ); - - /** - * Destructor. - */ - virtual ~CIMCVUiAppSkinVariant(); - - public: // Functions from base classes MIMCVUiAppSkinVariant - - - /** - * Clears listbox background. - * @since 5.0 - * @param aGc, graphics context to draw to. - * @param aUsedPortionOfViewRect, rect to draw to. - * @param aContext, skin control context. - */ - void ClearChatListBoxBackGround( CWindowGc& aGc, - const TRect& aUsedPortionOfViewRect, - MAknsControlContext* aContext ); - - /** - * Returns main pane background control context. - * @since 5.0 - * @return MAknsControlContext, skin control context. - */ - MAknsControlContext* MainPaneBackgroundContext() const; - - /** - * Update layout for skinvariant - * @return None - */ - void UpdateLayout(); - - /** - * Draws skinned version of the message editor. - * @since 5.0 - * @param aGc, graphics context. - * @param aParentRect, rects needed for drawing - * @param aEditorRect - * @param aOutlineRect - * @return TBool, whether skins were drawn or not. - */ - TBool DrawSkinnedEditor( const CCoeControl* aControl, - CWindowGc& aGc, - TRect& aParentRect, - TRect& aEditorRect, - TRect& aOutlineRect ); - /** - * Loads skinned/normal IM application bitmaps. - * @since 1.2s - * @param aBitmapId, bitmap id - * @param aMaskId, bitmap mask's id - * @param aFullPath, bitmap path - * @param aOverrideBrand, if true, bitmap is got from skins, not through - * brand bitmaps (if brand is active) - * @param aCustomColor If provided, will change the color of the bitmap - * to this color. - * @return CGulIcon, created icon, user of this method gets the ownership - */ - CGulIcon* LoadBitmapL( TInt aBitmapId, TInt aMaskId, - const TDesC& aFullPath, - TBool aOverrideBrand = EFalse, - TRgb* aCustomColor = NULL ) ; - - private: - - void MapFromBitmapIdToAknsItemId( TInt aBitmapId, - TAknsItemID& aItemId, - TInt& aColorGroupId ); - - private: - - /** - * C++ default constructor. - */ - CIMCVUiAppSkinVariant(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - // skin background control context - CAknsBasicBackgroundControlContext* iBgContext; - - - - }; - -#endif // CIMCVUIAPPSKINVARIANT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/cvmenucommandinfo.hrh --- a/imstutils/imconversationview/imcvuiapp/inc/cvmenucommandinfo.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2008 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: Defines macros for commands -* -*/ - -#ifndef __CVMENUCOMMANDINFO_HRH__ -#define __CVMENUCOMMANDINFO_HRH__ - - -// Command range allocated to xSP Extension Manager -#define ECVMenuExtensionFirstCommand 00000 -#define ECVMenuExtensionFirstFreeCommand 00050 -#define ECVMenuExtensionLastCommand 00100 - - -#endif // __CVMENUCOMMANDINFO_HRH__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/imcvuiapp.h --- a/imstutils/imconversationview/imcvuiapp/inc/imcvuiapp.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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: imcvuiapp.h -* -*/ -// Branding item header file created with XML2H. DO NOT MODIFY! - -_LIT8( KEMbmImcvuiappQgnpropimsmileyscrying, "EMbmConversationsQgnpropimsmileyscrying"); -_LIT8( KEMbmImcvuiappQgnpropimsmileyssunglasses, "EMbmConversationsQgnpropimsmileyssunglasses"); -_LIT8( KEMbmImcvuiappQgnpropimsmileysglasses, "EMbmConversationsQgnpropimsmileysglasses"); -_LIT8( KEMbmImcvuiappQgnpropimawaytitle, "EMbmConversationsQgnpropimawaytitle"); -_LIT8( KEMbmImcvuiappQgnpropiminvisibletitle, "EMbmConversationsQgnpropiminvisibletitle"); -_LIT8( KEMbmImcvuiappQgnpropimfrom, "EMbmConversationsQgnpropimfrom"); -_LIT8( KEMbmImcvuiappQgnpropimsmileysindif, "EMbmConversationsQgnpropimsmileysindif"); -_LIT8( KEMbmImcvuiappQgnpropimofftitle, "EMbmConversationsQgnpropimofftitle"); -_LIT8( KEMbmImcvuiappQgnpropimsmileysbored, "EMbmConversationsQgnpropimsmileysbored"); -_LIT8( KEMbmImcvuiappQgnpropimtome, "EMbmConversationsQgnpropimtome"); -_LIT8( KEMbmImcvuiappQgnpropimsmileyssurprise, "EMbmConversationsQgnpropimsmileyssurprise"); -_LIT8( KEMbmImcvuiappQgnpropimsmileysskeptical, "EMbmConversationsQgnpropimsmileysskeptical"); -_LIT8( KEMbmImcvuiappQgnpropimsmileystired, "EMbmConversationsQgnpropimsmileystired"); -_LIT8( KEMbmImcvuiappQgnpropimbusytitle, "EMbmConversationsQgnpropimbusytitle"); -_LIT8( KEMbmImcvuiappQgnpropimsmileyswink, "EMbmConversationsQgnpropimsmileyswink"); -_LIT8( KEMbmImcvuiappQgnpropimsmileysrobot, "EMbmConversationsQgnpropimsmileysrobot"); -_LIT8( KEMbmImcvuiappQgnpropimsmileyskiss, "EMbmConversationsQgnpropimsmileyskiss"); -_LIT8( KEMbmImcvuiappQgnpropimsmileysangry, "EMbmConversationsQgnpropimsmileysangry"); -_LIT8( KEMbmImcvuiappQgnpropimonmobiletitle, "EMbmConversationsQgnpropimonmobiletitle"); -_LIT8( KEMbmImcvuiappQgnpropimsmileyslaugh, "EMbmConversationsQgnpropimsmileyslaugh"); -_LIT8( KEMbmImcvuiappQgnpropimontitle, "EMbmConversationsQgnpropimontitle"); -_LIT8( KEMbmImcvuiappQgnpropimsmileyshappy, "EMbmConversationsQgnpropimsmileyshappy"); -_LIT8( KEMbmImcvuiappQgnpropimsmileyswickedsmile, "EMbmConversationsQgnpropimsmileyswickedsmile"); -_LIT8( KEMbmImcvuiappQgnpropimsmileysverysad, "EMbmConversationsQgnpropimsmileysverysad"); -_LIT8( KEMbmImcvuiappQgnpropimsmileyssleepy, "EMbmConversationsQgnpropimsmileyssleepy"); -_LIT8( KEMbmImcvuiappQgnpropimsmileyssad, "EMbmConversationsQgnpropimsmileyssad"); -_LIT8( KEMbmImcvuiappQgnpropimsmileysveryhappy, "EMbmConversationsQgnpropimsmileysveryhappy"); -_LIT8( KEMbmImcvuiappQgnpropimsmileysshock, "EMbmConversationsQgnpropimsmileysshock"); - -//End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/imcvuiappnotemapper.h --- a/imstutils/imconversationview/imcvuiapp/inc/imcvuiappnotemapper.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2008 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: note mapper class -* -*/ - - -#ifndef IMCVUIAPPNOTEMAPPER_H -#define IMCVUIAPPNOTEMAPPER_H - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* Class is used for mapping engine errors to correct error notes -* -* imcvuiapp.exe -* @since 5.0 -*/ -class IMCVUiAppNoteMapper - { - public: // New functions - /** - * Shows specified error note for aErrorCode (UI specification) - * @param aErrorCode Error code - * @param aAdditionalData, any aditional info to show - * @return Did class have information about given error or not - */ - static void ShowNoteL( const TInt aErrorCode, const TDesC& aAdditionalData ); - - - /** - * Displays query dialog with given data - * @param aDialogResourceId Dialogs resource id - * @param aPrompt Prompt text - * @return Dialog dismiss key - */ - static TInt DisplayQueryDialogL( TInt aDialogResourceId, - const TDesC& aPrompt = KNullDesC ); - - - }; - -#endif // IMCVUIAPPNOTEMAPPER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/imcvuiapputils.h --- a/imstutils/imconversationview/imcvuiapp/inc/imcvuiapputils.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2008 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: utils helper class -* -*/ - - -#ifndef __IMCVUIAPPUTILS_H__ -#define __IMCVUIAPPUTILS_H__ - -#include - -// FORWARD CLASS DECLERATIONS - -// CLASS DECLARATION - -/** - * Utils class . - */ - -class IMCVUiAppUtils - { - public: // new methods - - /** - * @param aUid Uid for cenrep - * @param aKey Central repository key - * @return Value for key - */ - static TUint32 CRKeyL( TUid aUid, TUint32 aKey ); - - - /** - * Variated version of AknLayoutUtils::PenEnabled() - * Use this to preserver 3.0 compatibility - * @return ETrue - Pen support on - * EFalse - Pen support off - */ - static TBool PenEnabled(); - - - }; - -#endif // __IMCVUIAPPUTILS_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvapplayoutchangeobserver.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvapplayoutchangeobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: layout change observer -* -*/ - - - -#ifndef MIMCVAPPLAYOUTCHANGEOBSERVER_H -#define MIMCVAPPLAYOUTCHANGEOBSERVER_H - -#include - -// CLASS DECLARATION - -/** -* Interface class for observing layout changes. -* @since 5.0 -*/ -class MIMCVAppLayoutChangeObserver - { - - public: // New functions - - /* - * Called when layout changes - */ - virtual void LayoutChangedL( TInt aType = 0 ) = 0; - - protected: - - virtual ~MIMCVAppLayoutChangeObserver() {}; - - }; - -#endif // MIMCVAPPLAYOUTCHANGEOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvapplayoutinfo.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvapplayoutinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: layout info interface -* -*/ - - -#ifndef MIMCVAPPLAYOUTINFO_H -#define MIMCVAPPLAYOUTINFO_H - -//INCLUDES -#include - -// FORWARD DECLARATIONS -class CFont; -class TAknWindowLineLayout; -class TAknTextLineLayout; -class TAknMultiLineTextLayout; - -class TChatListBoxLayout - { - - public: - enum TLayout - { - EWithEditor2Lines = 0, - EWithEditor, - EWithoutEditor - }; - }; -// CLASS DECLARATION - -/** - * Interface for Layout and render info for Chat Listbox's item drawer and view - * - * @since 5.0 - */ -class MIMCVAppLayoutInfo - { - public: // Interface - - /** - * MainPaneRect - * rect of main pane. - */ - virtual TRect MainPaneRect() =0; - /** - * im_reading_pane - * im reading pande - * param@ aIndex_h, index of reading pane - */ - virtual TAknWindowLineLayout im_reading_pane(TInt aIndex_H) =0; - /** - * im_reading_field - * im reading pane. - * param@ aIndex_t, index of reading field - */ - virtual TAknWindowLineLayout im_reading_field(TInt aIndex_t) =0; - /** - * IM_text_elements - * im text elements - * @param aLineIndex, index of text element - */ - virtual TAknWindowLineLayout IM_text_elements(TInt aLineIndex) =0; - /** - * IM_reading_pane_texts_Line_1 - * im reading pane text line 1 - * @param aCommon1, command to excute - */ - virtual TAknTextLineLayout IM_reading_pane_texts_Line_1( - TInt aCommon1) =0; - /** - * IM_reading_pane_texts_Line_2 - * imreading pane text line2 - */ - virtual TAknTextLineLayout IM_reading_pane_texts_Line_2() =0; - - /** - * im_writing_pane - * im writing pane - * @param aCommon1, command to excute - */ - virtual TAknWindowLineLayout im_writing_pane(TInt aCommon1) =0; - /** - * IM_writing_field_elements_Line_1 - * im writing field element line 1 - * @param aIndex_H, index of writing element - */ - virtual TAknWindowLineLayout IM_writing_field_elements_Line_1( - TInt aIndex_H) =0; - /** - * IM_writing_field_elements_Line_2 - * im writing fields elements line 2 - */ - virtual TAknWindowLineLayout IM_writing_field_elements_Line_2() =0; - /** - * IM_writing_field_elements_Line_3 - * im writing fields elements line 3 - * @param aIndex_H, index of writing field element - */ - virtual TAknWindowLineLayout IM_writing_field_elements_Line_3( - TInt aIndex_H) =0; - /** - * Multiline_IM_writing_pane_texts_Line_1 - * im writing pane text line 1 - * @param aNumberOfLinesShown, no of line to shown in the pane - */ - virtual TAknMultiLineTextLayout Multiline_IM_writing_pane_texts_Line_1( - TInt aNumberOfLinesShown) =0; - /** - * IM_navi_pane_texts_Line_1 - * im navi pane text line 1 - * @param aIndex_C, index of text line - * @param aIndex_W, index of pane - */ - virtual TAknTextLineLayout IM_navi_pane_texts_Line_1( - TInt aIndex_C, TInt aIndex_W) =0; - /** - * DPLayout - * dp layout - * @param aStr, string to be draw - * @param aLayout, layout - */ - virtual void DPLayout( const TDesC& aStr, - const TAknTextLineLayout aLayout ) =0; - /** - * DPLayout - * rect of main pane. - * @param aStr, string to be draw - * @param aLayout, layout - */ - virtual void DPLayout( const TDesC& aStr, - const TAknWindowLineLayout aLayout ) =0; - /** - * DPRect - * dp rect - * @param aStr, string to be draw - * @param aRect, rect for the layout - */ - virtual void DPRect( const TDesC& aStr, const TRect& aRect ) =0; - - /** - * SetLayoutID - * dp rect - * @param aLayout, to be to be draw - */ - virtual void SetLayoutID( TChatListBoxLayout::TLayout aLayout ) =0; - - /** - * SetEditorVisibility - * @param aVisible, ETrue or EFalse - */ - virtual void SetEditorVisibility( TBool aVisible ) = 0; - - protected: - /** - * ~MIMCVAppLayoutInfo - * virtual destrauctor - */ - virtual ~MIMCVAppLayoutInfo() {}; - - }; - -#endif // MIMCVAPPLAYOUTINFO_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvappmessageextension.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvappmessageextension.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message extention interface -* -*/ - - -#ifndef MIMCVAPPMESSAGEEXTENSION_H -#define MIMCVAPPMESSAGEEXTENSION_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CEikRichTextEditor; -class TCursorSelection; -class CRichText; -class MBSAccess; - -// Type definitions for different smiley types - enum TMessageExtensionTypes - { - EMessageExtensionSmiley = 0 - }; - -// CLASS DECLARATION - -/** -* Interface class for message extension classes -*/ -class MIMCVAppMessageExtension - { - public: - /** - * Return type of Extension. Inherited message extension does not need - * information of type. It is only needed by handler of extensions and - * user of extension. That is why implementation is created in here. - * @since 5.0 - * @return Type of extension - */ - virtual TMessageExtensionTypes Type() const - { - return iType; - } - - /** - * Destructor - * @since 5.0 - */ - virtual ~MIMCVAppMessageExtension(){}; - - protected: - - /** - * Constructor Inherited message extension does not need - * information of type. It is only needed by handler of extensions and - * user of extension. That is why implementation is created in here. - * @since 5.0 - * @param aType Type of extension - */ - MIMCVAppMessageExtension( TMessageExtensionTypes aType ) : iType( aType ){} - - public: //Interface methods - - - /** - * Removes extension from given position in Editor - * @param aEditor used editor - * @param aPos extension position in Editor - * @since 5.0 - */ - virtual void DeleteExtensionL( CEikRichTextEditor& aEditor, - TInt aPos ) = 0; - - /** - * Converts smiley icons to string smileys - * @since 5.0 - * @param aEditor used editor - * @param aDes Text from editor - */ - virtual void ExtensionToStringL( CEikRichTextEditor& aEditor, - TDes& aDes ) = 0; - - /** - * Converts extension in selection area from strings to extensions. - * Used for example for cut, copy, paste features. - * @since 5.0 - * @param aEditor, Used editor - */ - virtual void ConvertSelectionToExtensionL( - CEikRichTextEditor& aEditor ) = 0; - - /** - * Converts all the extensions in selection area from - * strings to extensions. - * @since 5.0 - * @param aRichText Rich text to be converted - * @param aSelection Selection area - */ - virtual void ConvertSelectionToExtensionL( CRichText& aRichText, - TCursorSelection& aSelection ) = 0; - - /** - * Converts extension in selection area from extensions to strings. - * Used for example for cut, copy, paste features. - * @since 5.0 - * @param aEditor, Used editor - * @param aPreserve, Preserve original status of extension - */ - virtual void ConvertSelectionToStringL( CEikRichTextEditor& aEditor, - TBool aPreserve ) = 0; - - /** - * Reset extension counters. - * @sinze 5.0 - */ - virtual void Reset() = 0; - - /** - * Informs the extensions about changed size - * @param aSize - * @since 5.0 - */ - virtual void SizeChanged( TSize& aSize ) = 0; - - /** - * Converts all the extensions in selection area from - * extensions to strings. - * @since S60 v5.0 - * @param aEditor Used editor. - * @param aResultString Descriptor for converted string, - * caller is responsible to provide - * large enough descriptor. - * @param aSelectionAfterConversion Cursor selection after - * extensions are converted to strings. - * @param aPreserve Should we preserve original extension status. - */ - virtual void ConvertSelectionToStringL( - CEikRichTextEditor& aEditor, - TDes& aResultString, - TCursorSelection& aSelectionAfterConversion, - TBool aPreserve ) = 0; - - /** - * Adds extension to current position in Editor - * @param aEditor used editor - * @param aCancelled - * @since 2.1 - */ - virtual void InsertExtensionL( CEikRichTextEditor& aEditor, - TBool& aCancelled, TSize size ) = 0; - - /* - * return service Id used - */ - virtual TInt ServiceId() const = 0 ; - - private: - - // Type of extension - TMessageExtensionTypes iType; - - }; - -#endif // MIMCVAPPMESSAGEEXTENSION_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvappresourcechangeobserver.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvappresourcechangeobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Classes that want events from resource changes implement this interface. -* -*/ - - - -#ifndef MIMCVAPPRESOURCECHANGEOBSERVER_H -#define MIMCVAPPRESOURCECHANGEOBSERVER_H - - - -// CLASS DECLARATION - -/** -* Interface class for observing resource changes. -* @lib imcvuiapp.exe -* @since S60 5.0 -*/ -class MIMCVAppResourceChangeObserver - { - - public: // New functions - - /* - * Called when resource changes - */ - virtual void ResourceChangedL() = 0; - - protected: - - virtual ~MIMCVAppResourceChangeObserver() {}; - - }; - -#endif // MIMCVAPPRESOURCECHANGEOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvapptextview.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvapptextview.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Interface for text viewer -* -*/ - - - -#ifndef MIMCVAPPTEXTVIEW_H -#define MIMCVAPPTEXTVIEW_H - -// CLASS DECLARATION -class TPointerEvent; - -/** -* Interface for text viewer -* -* imcvuiapp.exe -* @since Series 60 5.0 -*/ -class MIMCVAppTextView - { - public: // Enumerations - - enum TPenBehaviour - { - EPenForwardToChild = 0, - EPenForwardToParent, - EPenProcessEvent, - EPenIgnoreEvent - }; - - public: // New functions - - /** - * Update the view - */ - virtual void UpdateChatViewL() = 0; - - - /** - * Handles changed format. - * @param aChanged Changed section of rich text - * @param aPreserveFocus ETrue : Keeps focus of text control in place - * EFalse : Focus moves with changes - */ - virtual void HandleFormatChangedL( TCursorSelection& aChanged, - TBool aPreserveFocus = EFalse ) = 0; - - /** - * Handles insertion and deletion - * @param aChanged Changed section of rich text. If this function is - * being used to handle deletion only, this argument - * should be of length zero and its start position - * should be the beginning of the deletion. - * @param aDeletedChars The number of deleted characters. Specify zero - * if this function is being used to handle insertion - * only. - */ - virtual void HandleInsertDeleteL( TCursorSelection& aChanged, - TInt aDeletedChars ) = 0; - - /** - * Handles addition of text - * @param aFirst Should be set to ETrue if - * this is the first addition of text - * @param aSelection Selection - * @param aTop If selection doesn't fit to screen, should the top of the - * selection be visible. I.e. If ETrue, top of the message is shown. - * if EFalse, bottom of the message is shown. - */ - virtual void HandleAdditionL( TBool aFirst, TCursorSelection& aSelection, - TBool aTop ) = 0; - - /** - * Scrolls selection to screen and updates scroll bars - * @param aSelection Selection - * @param aTop If selection doesn't fit to screen, should the top of the - * selection be visible. I.e. If ETrue, top of the message is shown. - * if EFalse, bottom of the message is shown. - */ - virtual void ScrollVisibleL( TCursorSelection& aSelection, TBool aTop ) = 0; - - /** - * @return Current scroll selection (i.e. the visible part) - */ - virtual TCursorSelection ScrollSelection() = 0; - - /** - * Scrolls view up or down - * @param aAmount Amount of lines to be scrolled - * Use negative values for scrolling up - */ - virtual void ScrollLinesL( TInt aAmount ) = 0; - - /** - * @return ETrue if aPos is visible on screen, EFalse otherwise. - */ - virtual TBool IsVisible( TInt aPos ) = 0; - - /** - * @return ETrue if the paragraph in aPos fits to screen - */ - virtual TBool ParagraphFits( TInt aPos ) = 0; - - /** - * Redraws the view - */ - virtual void Redraw() = 0; - - /** - * Sets the behaviour of this control to pointer events. - * see TPenBehaviour for more detailed info. - * @param aPen How this control should react to pointer events - */ - virtual void SetPenBehaviour( TPenBehaviour aPen ) = 0; - - /** - * Return current pen behaviour state. Determines how this control - * reacts to pointer events. - * @return Current pen behaviour - */ - virtual TPenBehaviour PenBehaviour() = 0; - - /** - * Reformats the view after a global change has been made to the layout, - * but without causing a redraw. - * @since S60 v3.2 - * @param aYPosQualifier Specifies whether the visible area is to be - * filled and whether the top line should be made - * fully visible if possible. - */ - virtual void HandleGlobalChangeNoRedrawL( - TViewYPosQualifier aYPosQualifier = TViewYPosQualifier() ) = 0; - - protected: - - /** - * This gets called when the pointer event is inside the text message. - * @param aPointerEvent Pointer event - */ - virtual void ProcessStylusEventL( - const TPointerEvent& aPointerEvent ) = 0; - - /** - * Destructor. - */ - virtual ~MIMCVAppTextView() {}; - - }; - -#endif // MIMCVAPPTEXTVIEW_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvappui.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvappui.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Interface for AppUi class -* -*/ - - - -#ifndef MIMCVAPPUI_H -#define MIMCVAPPUI_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class MIMCVAppResourceChangeObserver; -class MIMCVAppLayoutChangeObserver; - -// CLASS DECLARATION - -/** -* Interface for AppUi class -* -* @lib imcvuiapp.exe -*/ - -class MIMCVAppUi - { - public: // New functions - - virtual TDes& MbmFullPath()= 0; - - /** - * Adds layout change observer - * @param aObserver Pointer to observer - */ - virtual void AddLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver ) = 0; - - /** - * Removes layout observer - * @param aObserver Pointer to removed observer - */ - virtual void RemoveLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver ) = 0; - - /** - * Adds resource observer - * @param aObserver Pointer to observer - */ - virtual void AddResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver ) = 0; - - /** - * Removes resource observer - * @param aObserver Pointer to removed observer - */ - virtual void RemoveResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver ) = 0; - }; - -#endif // MIMCVAPPUI_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvnewmsgfadecontrolobserver.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvnewmsgfadecontrolobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2008-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: Interface class for fadetext in navipane -* -*/ - - - -#ifndef MIMCVNewMsgFadeControlObserver_H -#define MIMCVNewMsgFadeControlObserver_H - -// CLASS DECLARATION - -/** -* Interface class for fadetext in navipane -* -* @imcvuiapp.exe -* @since 5.0 -*/ -class MIMCVNewMsgFadeControlObserver - { - public: - - /** - * This method notifies when complete - */ - virtual void NotifyWhenCompleted() = 0; - - - /** - * This method notifies when fadetext starts - */ - virtual void NotifyWhenStarted() = 0; - - protected: - - /** - * DEstructor - */ - virtual ~MIMCVNewMsgFadeControlObserver() {}; - - }; - -#endif //MIMCVNewMsgFadeControlObserver_H - -//end of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvrecipientobserver.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvrecipientobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2003 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: Declares interface for recipient procedures in chat view -* -*/ - - - -#ifndef MIMCVRECIPIENTOBSERVER_H -#define MIMCVRECIPIENTOBSERVER_H - -// CLASS DECLARATION - -/** -* Declares interface for recipient procedures in chat view -* Interface between chat container and chat view -* -* @lib chat.app -* @since 1.2 -*/ -class MIMCVRecipientObserver - { - public: - - /** - * Shows popup menu instead of application menu - */ - virtual void ShowPopUpMenuL() = 0; - - protected: - - virtual ~MIMCVRecipientObserver() {}; - - }; - -#endif // MIMCVRECIPIENTOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvtabobserver.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvtabobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2008-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: Interface for Tab observer -* -*/ - - -#ifndef MIMCVTabObserver_H -#define MIMCVTabObserver_H - - -/** - * Tab observer interface to the UI. - * @lib imcvuiapp.exe - * @since 5.0 - */ - -class MIMCVTabObserver - { - - - public: - - /** Helper Function - * This function is to be called when switching between tabs - * @param aChatId - Switch to this chat item - * @param aTabIndex - Index of the tab - */ - virtual void SwitchTabL(TInt aActiveServiceId , const TDesC& aChatId, const TInt aTabIndex) = 0; - - /** - * Destructor - */ - virtual ~MIMCVTabObserver(){} - - }; - -#endif //MIMCVTabObserver_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvtapeventobserver.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvtapeventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Interface to observe events in text control -* -*/ - - -#ifndef MIMCVTAPEVENTOBSERVER_H -#define MIMCVTAPEVENTOBSERVER_H - -#include - -/** - * Interface to observe events in touchable controls - * @lib imcvuiapp.exe - * @since S60 v5.0 - */ -class MIMCVTapEventObserver - { -public: - - /** Tap event types */ - enum TTapEvent - { - ESingleTap = 0, // This pure single tap on one item. - // User needs to start and release the - // tap on same item - EDoubleTap, // Double tap on single item. - // There's no time limit between the taps - EStartTap, // When user puts stylus on control - EReleaseTap, // When user raises the stylus off the control - - // NOTE: When DoubleTap event happens, the observer - // is also notified about SingleTap and Release. - }; - - /** - * This method is called when observed object is tapped - * @since S60 v5.0 - * @param aEvent Event which happened in touchable control - * @param aControlId in which control the event occured - * @return none - */ - virtual void HandleTapEventL( TTapEvent aEvent, TUint aControlId ) = 0; - -protected: - - ~MIMCVTapEventObserver() {} - }; - - -#endif // MIMCVTAPEVENTOBSERVER_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/inc/mimcvuiappskinvariant.h --- a/imstutils/imconversationview/imcvuiapp/inc/mimcvuiappskinvariant.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2008 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: skin variation base class -* -*/ - - -#ifndef MIMCVUIAPPSKINVARIANT_H -#define MIMCVUIAPPSKINVARIANT_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CWindowGc; -class CCoeControl; -class MAknsControlContext; -class CGulIcon; -class TRgb; - -// CLASS DECLARATION - -/** -* Interface class for skin variant. -* @imcvuiapp.exe -* @since 5.0 -*/ -class MIMCVUiAppSkinVariant - { - - public: // New functions - - - /** - * Clears listbox background. - * @since 5.0 - * @param aGc, graphics context to draw to. - * @param aUsedPortionOfViewRect, rect to draw to. - * @param aContext, skin control context. - */ - virtual void ClearChatListBoxBackGround( - CWindowGc& aGc, - const TRect& aUsedPortionOfViewRect, - MAknsControlContext* aContext ) = 0; - /** - * Returns main pane background control context. - * @since 5.0 - * @return MAknsControlContext, skin control context. - */ - virtual MAknsControlContext* MainPaneBackgroundContext() const = 0; - - /** - * Update layout for skinvariant - * @return None - */ - virtual void UpdateLayout() = 0; - - /** - * Draws skinned version of the message editor. - * @since 5.0 - * @param aGc, graphics context. - * @param aParentRect, rects needed for drawing - * @param aEditorRect - * @param aOutlineRect - * @return TBool, whether skins were drawn or not. - */ - virtual TBool DrawSkinnedEditor( const CCoeControl* aControl, - CWindowGc& aGc, - TRect& aParentRect, - TRect& aEditorRect, - TRect& aOutlineRect ) = 0; - - /** - * Loads skinned/normal IM application bitmaps. - * @since 1.2s - * @param aBitmapId, bitmap id - * @param aMaskId, bitmap mask's id - * @param aFullPath, bitmap path - * @param aOverrideBrand, if true, bitmap is got from skins, not through - * brand bitmaps (if brand is active) - * @param aCustomColor If provided, will change the color of the bitmap - * to this color. - * @return CGulIcon, created icon, user of this method gets the ownership - */ - virtual CGulIcon* LoadBitmapL( TInt aBitmapId, TInt aMaskId, - const TDesC& aFullPath, - TBool aOverrideBrand = EFalse, - TRgb* aCustomColor = NULL ) = 0; - - /** - * virtual destructor - */ - virtual ~MIMCVUiAppSkinVariant() - { - - } - - }; - -#endif // MIMCVUIAPPSKINVARIANT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/rss/imcvappsmileutility.hrh --- a/imstutils/imconversationview/imcvuiapp/rss/imcvappsmileutility.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: -* This file contains declarations for resources -* of Instant Messanger's SmileUtility. -* The file can be included in C++ or resource file. -* -*/ - - -#ifndef IMCVAPPSMILEUTILITY_HRH -#define IMCVAPPSMILEUTILITY_HRH - -enum TIMSelectSmileDlgCtrlId - { - EIMIdSelectSmileLabel = 10000, - EIMIdSelectSmileGrid - }; - -enum TIMSelectSmileDlgCtrlType - { - EIMCtrlSelectSmileGrid = 9990 - }; - -#endif // IMCVAPPSMILEUTILITY_HRH - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/rss/imcvappsmileutility.rh --- a/imstutils/imconversationview/imcvuiapp/rss/imcvappsmileutility.rh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: -* This file contains declarations for resources of -* Instant Messanger's SmileUtility. -* The file can be included in resource file. -* -*/ - - -#ifndef IMCVAPPSMILEUTILITY_RH -#define IMCVAPPSMILEUTILITY_RH - - -// RESOURCE STRUCTS - -STRUCT IM_SMILE_ARRAY - { - STRUCT smiles[]; // IM_SMILE - } - -STRUCT IM_SMILE - { - WORD icon_id; - WORD mask_id; - STRUCT strings[]; // LBUF - } - -#endif // IMCVAPPSMILEUTILITY_RH - -//End of file - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/rss/imcvuiapp.hrh --- a/imstutils/imconversationview/imcvuiapp/rss/imcvuiapp.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: hrh file -* -*/ - - -#ifndef __IMCVUIAPP_HRH__ -#define __IMCVUIAPP_HRH__ - -/** conversationview enumerate command codes */ - -enum TIMCVCommandIds - { - EIMCVCmdBack = 0 , // start value must not be 0 - EIMCVCmdSend, - EIMCVCmdSmiley, - EIMCVCmdCloseConversation, - EIMCVCmdFindMenuPlaceHolder, - EIMCVCmdCall, - ELoginWaitNote, - EIMCVCmdHelp, - EIMCVCmdExit, - EIMCVCmdToolbarSend, - EIMCVCmdToolbarInsertSmiley, - EIMCVCmdToolbarDetails, - EIMCVCmdInternetCall - }; - -// Size of Array used in launching context sensitive help -#define KHelpContextSize 1 -#endif // __IMCVUIAPP_HRH__ diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/rss/imcvuiapp.rss --- a/imstutils/imconversationview/imcvuiapp/rss/imcvuiapp.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,535 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: resource file -* -*/ - -NAME IMCV - -#include -#include -#include -#include -#include -#include -#include -#include -#include "imcvuiapp.hrh" -#include -#include -#include -#include -#include -#include -#include "imcvappsmileutility.hrh" -#include "imcvappsmileutility.rh" -#include -#include -#include - - -// --------------------------------------------------------- -// -// Define the resource file signature -// This resource should be empty. -// -// --------------------------------------------------------- -// -RESOURCE RSS_SIGNATURE { } - -// --------------------------------------------------------- -// -// Default Document Name -// -// --------------------------------------------------------- -// -RESOURCE TBUF r_default_document_name { buf=""; } - -// --------------------------------------------------------- -// -// LOCALISABLE_APP_INFO -// -// --------------------------------------------------------- -// -RESOURCE LOCALISABLE_APP_INFO r_cv_localisable_app_info - { - short_caption = " "; - caption_and_icon = - { - CAPTION_AND_ICON_INFO - { - caption=" "; - } - }; - } - - -// --------------------------------------------------------- -// -// Define default menu and CBA key. -// -// --------------------------------------------------------- -// -RESOURCE EIK_APP_INFO - { - menubar = r_conversationview_view_menubar; - cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT; - } - - -//---------------------------------------------------- -// -// r_chatclient_friendslist_view -// View-resource definition for friendslist-view -// -//---------------------------------------------------- -// -RESOURCE AVKON_VIEW r_conversationview_view - { - hotkeys= r_conversationview_hotkeys; - menubar= r_conversationview_view_menubar; - // cba state is dynamically changed within implementation - cba = r_cv_softkeys_options_back__send; - toolbar = r_im_cv_toolbar; - } - -//---------------------------------------------------- -// -// r_chatclient_menubar_friendslist_view -// Menubar definition for friendslist-view -// -//---------------------------------------------------- -// -RESOURCE MENU_BAR r_conversationview_view_menubar -{ - titles= - { - MENU_TITLE { menu_pane = r_converationview_general_menu; }, // this genaral menu ,help,exit - MENU_TITLE { menu_pane = r_conversationview_view_menu; } // add any new menu item in this menu - - - }; -} - -//---------------------------------------------------- -// -// r_cv_softkeys_options_back__empty -//---------------------------------------------------- - -RESOURCE CBA r_cv_softkeys_options_back__empty - { - - flags = 0; - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, - CBA_BUTTON { id = EAknSoftkeyEmpty; txt = text_softkey_empty; } - }; - } - -// -// r_chat_softkeys_options_continue__contextoptions -// -//---------------------------------------------------------- -// -RESOURCE CBA r_cv_softkeys_options_back__contextoptions - { - flags = 0; - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, - CBA_BUTTON { id = EAknSoftkeyContextOptions; txt = text_softkey_option; } - }; - } - -//---------------------------------------------------------- -// -// r_chat_softkeys_options_exit__empty -// -//---------------------------------------------------------- -// - -RESOURCE CBA r_cv_softkeys_options_back__send - { - flags = 0; - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyBack; txt = text_softkey_back; }, - CBA_BUTTON { id = EAknSoftkeySend; txt = qtn_msk_send; } - }; - } - - //---------------------------------------------------- -// -// r_chatclient_hotkeys -// ?description -// -//---------------------------------------------------- -// -RESOURCE HOTKEYS r_conversationview_hotkeys -{ - control= - { - HOTKEY { command=EEikCmdExit; key='e'; } - }; -} - - -//---------------------------------------------------- -// -// r_chatclient_general_menu -// Items for general menu -// -//---------------------------------------------------- -// -RESOURCE MENU_PANE r_converationview_general_menu -{ - items= - { - MENU_ITEM { command = EAknCmdHelp; txt = qtn_options_help; }, - MENU_ITEM { command = EAknCmdExit; txt = qtn_options_exit; } - - }; -} -// --------------------------------------------------------------------------- -// aiw_internetcall -// AIW app interest for calling -// --------------------------------------------------------------------------- -// -RESOURCE AIW_INTEREST aiw_internetcall - { - items= - { - // This application is interested in calling from menu. - AIW_CRITERIA_ITEM - { - id = KAiwCmdCall; - serviceCmd = KAiwCmdCall; - serviceClass = KAiwClassMenu; - contentType = "*"; - defaultProvider = 0x101F868E; - maxProviders = 1; - } - }; - } - -//---------------------------------------------------- -// -// r_chatclient_friendslist_view_menu -// Items in friendslist-view´s menubar -// -//---------------------------------------------------- -// -RESOURCE MENU_PANE r_conversationview_view_menu -{ - items= - { - MENU_ITEM { command = EIMCVCmdSend; txt = qtn_im_ibox_om_send; }, - MENU_ITEM { command = EIMCVCmdSmiley; txt = qtn_chat_conv_insert_smiley; } , - MENU_ITEM { command = EIMCVCmdFindMenuPlaceHolder;txt = ""; }, - MENU_ITEM { command = EIMCVCmdCloseConversation; txt = qtn_servtab_close_conversation; }, - MENU_ITEM - { - command = KAiwCmdCall; // The same ID than in interest. - txt = ""; // Will be replaced by AIW (plugin). - cascade=AIW_CASCADE_ID; - cascade = AIW_INTELLIGENT_CASCADE_ID; - } - - }; - -} -//---------------------------------------------------- -// -// r_conversationview_menubar_finditemui -// Menubar definition for find item menu -// -//---------------------------------------------------- -// -RESOURCE MENU_BAR r_conversationview_menubar_finditemui - { - titles= - { - MENU_TITLE { menu_pane = r_conversationview_finditemui_menu; } - }; - } - -//---------------------------------------------------- -// -// r_conversationview_finditemui_menu -// Items for menupane in find item menu -// -//---------------------------------------------------- -// -RESOURCE MENU_PANE r_conversationview_finditemui_menu - { - items = - { - MENU_ITEM - { - command = EFindItemContextMenuPlaceHolder; - txt = ""; - } - }; - } - - -// Failed message////////////////////////////////////////////////////////////// -RESOURCE TBUF R_QTN_CONVIEW_FAILED { buf = qtn_conview_failed; } - -RESOURCE TBUF r_chat_ceditor_memlo { buf = qtn_memlo_not_enough_memory; } - -RESOURCE TBUF r_chat_ceditor_memfull { buf = qtn_memlo_memory_full; } - -RESOURCE TBUF r_chat_error_service_err { buf = qtn_chat_error_service_err; } - -RESOURCE TBUF r_chat_error_not_reach { buf = qtn_chat_error_not_reach; } - -RESOURCE TBUF r_chat_error_gen_error { buf = qtn_chat_error_gen_error; } - -RESOURCE TBUF r_chat_error_disconnect_error { buf = qtn_chat_error_disconnect_error; } - -RESOURCE TBUF r_servtab_status_change_online { buf = qtn_servtab_status_change_online; } - -RESOURCE TBUF r_servtab_status_change_offline { buf = qtn_servtab_status_change_offline; } - -RESOURCE TBUF r_servtab_status_change_away { buf = qtn_servtab_status_change_away; } - -RESOURCE TBUF r_servtab_status_change_onthephone { buf = qtn_servtab_status_change_onthephone; } - -RESOURCE TBUF r_servtab_status_change_dnd { buf = qtn_servtab_status_change_dnd; } -RESOURCE TBUF r_servtab_status_change_blocked { buf = qtn_servtab_default_statustext_blocked; } - - - -RESOURCE TBUF r_servtab_exit_query { buf = qtn_servtab_exit_query; } - -RESOURCE TBUF r_chat_cquery_close_conv { buf = qtn_chat_cquery_close_conv; } - - -RESOURCE DIALOG r_chat_info_note_template - { - flags = EAknInformationNoteFlags | EEikDialogFlagWait; - buttons=R_AVKON_SOFTKEYS_EMPTY; - items= - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control= AVKON_NOTE - { - layout = EGeneralLayout; - animation = R_QGN_NOTE_INFO_ANIM; - }; - } - }; - } - -RESOURCE DIALOG r_chat_error_note_template - { - flags = EAknErrorNoteFlags | EEikDialogFlagWait; - buttons=R_AVKON_SOFTKEYS_EMPTY; - items= - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control= AVKON_NOTE - { - layout = EGeneralLayout; - animation = R_QGN_NOTE_ERROR_ANIM; - }; - } - }; - } - -RESOURCE DIALOG r_generic_yes_no_confirmation_query - { - flags=EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_YES_NO__YES; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - control= AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - }; - } - }; - } - - -// avkon loc string -RESOURCE TBUF r_servtab_login_ongoing { buf = qtn_chat_login_ongoing_note; } - -RESOURCE TBUF r_servtab_connection_needed_to { buf = qtn_chat_connection_needed_to; } - - -// --------------------------------------------------------- -// -// r_servtab_wait_note_template -// -// --------------------------------------------------------- -// -RESOURCE DIALOG r_servtab_wait_note_template - { - flags = EAknDialogGenericNoteFlags ; //EAknProgressNoteFlags; - buttons = R_AVKON_SOFTKEYS_EMPTY; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = ELoginWaitNote; - control = AVKON_NOTE - { - layout = EWaitLayout; - imagefile = AVKON_ICON_FILE; - imageid = EMbmAvkonQgn_note_progress; - imagemask = EMbmAvkonQgn_note_progress_mask; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_im_cv_toolbar_indi_tb_msg_send_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbMsgSend; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_im_cv_toolbar_indi_tb_smiley_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbSmiley; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_im_cv_toolbar_indi_tb_business_card_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbBusinessCard; - } -//---------------------------------------------------- -// -// r_cv_app_toolbar -// -// -// -//---------------------------------------------------- -// -RESOURCE AVKON_TOOLBAR r_im_cv_toolbar - { - flags = KAknToolbarFixed; - items = - { - TBAR_CTRL - { - type = EAknCtButton; - id = EIMCVCmdToolbarSend; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_send; - bmpfile = BITMAP_DIR"\\imcvuiapp.mif"; - bmpid = EMbmImcvuiappQgn_indi_tb_msg_send; - bmpmask = EMbmImcvuiappQgn_indi_tb_msg_send_mask; - extension = r_im_cv_toolbar_indi_tb_msg_send_extension; - } - }; - }; - }, - TBAR_CTRL - { - type = EAknCtButton; - id = EIMCVCmdToolbarInsertSmiley; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_smiley; - bmpfile = BITMAP_DIR"\\imcvuiapp.mif"; - bmpid = EMbmImcvuiappQgn_indi_tb_smiley; - bmpmask = EMbmImcvuiappQgn_indi_tb_smiley_mask; - extension = r_im_cv_toolbar_indi_tb_smiley_extension; - } - }; - }; - }, - TBAR_CTRL - { - type = EAknCtButton; - id = EIMCVCmdToolbarDetails; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_details; - bmpfile = BITMAP_DIR"\\imcvuiapp.mif"; - bmpid = EMbmImcvuiappQgn_indi_tb_business_card; - bmpmask = EMbmImcvuiappQgn_indi_tb_business_card_mask; - extension = r_im_cv_toolbar_indi_tb_business_card_extension; - } - }; - }; - } - }; - } - -// RESOURCE DEFINITIONS - -RESOURCE DIALOG r_select_smile_dialog - { - flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow; - buttons = R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; - items= - { - DLG_LINE - { - type = EAknCtPopupHeadingPane; - id = EIMIdSelectSmileLabel; - control = AVKON_HEADING - { - label = qtn_chat_conv_smiley; - headinglayout = R_AVKON_SCT_LIST_HEADING_PANE; - }; - }, - DLG_LINE - { - type = EIMCtrlSelectSmileGrid; - id = EIMIdSelectSmileGrid; - } - }; - } -//Message to truncate long received message -RESOURCE TBUF r_qtn_conview_truncated { buf = qtn_conview_truncated; } - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/rss/imcvuiapp_reg.rss --- a/imstutils/imconversationview/imcvuiapp/rss/imcvuiapp_reg.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: resource file -* -*/ - -//conversationview application's registration resource file - -#include -#include -#include - -UID2 KUidAppRegistrationResourceFile -UID3 0x20012425 // Define your application UID here - -RESOURCE APP_REGISTRATION_INFO - { - app_file = "IMCVUiApp"; - localisable_resource_file = APP_RESOURCE_DIR"\\IMCVUiApp"; - localisable_resource_id = R_CV_LOCALISABLE_APP_INFO; - hidden = KAppIsHidden; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvapp.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvapp.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: application main entry -* -*/ - - - -#include "cimcvappapplication.h" - -#include -// ================= OTHER EXPORTED FUNCTIONS ============== -// -// --------------------------------------------------------- -// NewApplication() -// Constructs CIMCVAPPApp -// Returns: CApaDocument*: created application object -// --------------------------------------------------------- -// -CApaApplication* NewApplication() - { - return new CIMCVAppApplication; - } - -TInt E32Main() - { - return EikStart::RunApplication(NewApplication); - - } - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappapplication.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappapplication.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: create document class -* -*/ - - -#include "cimcvappapplication.h" -#include "cimcvappdocument.h" -#include "imcvuiliterals.h" -// --------------------------------------------------------- -// CIMCVAppApplication::CreateDocumentL() -// Creates CIMCVAppDocument object -// --------------------------------------------------------- -// -CApaDocument* CIMCVAppApplication::CreateDocumentL() - { - // Create an conversationview document, and return a pointer to it - CApaDocument* document = CIMCVAppDocument::NewL(*this); - return document; - } -// --------------------------------------------------------- -// CIMCVAppApplication::AppDllUid() -// --------------------------------------------------------- -// -TUid CIMCVAppApplication::AppDllUid() const - { - // Return the UID for the conversationview application - return KUidconversationviewApp; - } - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappcustomdraw.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappcustomdraw.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: custom control class -* -*/ - - - - -// INCLUDE FILES -#include "cimcvappcustomdraw.h" - -#include -#include -#include -#include -#include - -#include -#include -#include // A/H -#include -#include //cdl -#include //cdl -#include -#include "imcvlogger.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVAppCustomDraw::CIMCVAppCustomDraw -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppCustomDraw::CIMCVAppCustomDraw( TRect aViewRect ) - :iViewRect( aViewRect ) - { - } - -// Destructor -CIMCVAppCustomDraw::~CIMCVAppCustomDraw() - { - - } - -// ----------------------------------------------------------------------------- -// CIMCVAppCustomDraw::SetRect -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppCustomDraw::SetRect( const TRect& aRect ) - { - IM_CV_LOGS(TXT("CIMCVAppCustomDraw::SetRect() start" )); - iViewRect = aRect; - IM_CV_LOGS(TXT("CIMCVAppCustomDraw::SetRect() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppCustomDraw::DrawBackground -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppCustomDraw::DrawBackground( const TParam& aParam, - const TRgb& aBackground, - TRect& aDrawn ) const - { - IM_CV_LOGS(TXT("CIMCVAppCustomDraw::DrawBackground() start" )); - if( aBackground != KRgbWhite || !iBgContext ) - { - // draw background with color - aParam.iGc.SetPenStyle( CGraphicsContext::ENullPen ); - aParam.iGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - aParam.iGc.SetBrushColor( aBackground ); - aParam.iGc.DrawRect( aParam.iDrawRect ); - } - // if background is white -> we draw the skinned background - else - { - //Draw the skin background - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - AknsDrawUtils::Background( skin, - iBgContext, - iParent, - static_cast(aParam.iGc), - aParam.iDrawRect); - - } - aDrawn = aParam.iDrawRect; - IM_CV_LOGS(TXT("CIMCVAppCustomDraw::DrawBackground() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppCustomDraw::SetBackgroundContext -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppCustomDraw::SetBackgroundContext( CAknsBasicBackgroundControlContext* aBgContext, - CCoeControl* aParent ) - { - IM_CV_LOGS(TXT("CIMCVAppCustomDraw::SetBackgroundContext() start" )); - iBgContext = aBgContext; - iParent = aParent; - IM_CV_LOGS(TXT("CIMCVAppCustomDraw::SetBackgroundContext() end" )); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappdocument.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappdocument.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: application document -* -*/ - - -#include "cimcvappdocument.h" -#include "cimcvappui.h" -#include "mimcvappui.h" -// Standard Symbian OS construction sequence -CIMCVAppDocument* CIMCVAppDocument::NewL(CEikApplication& aApp) - { - CIMCVAppDocument* self = NewLC(aApp); - CleanupStack::Pop(self); - return self; - } -// --------------------------------------------------------- -// CIMCVAppDocument::NewLC() -// two phase construction -// --------------------------------------------------------- -// -CIMCVAppDocument* CIMCVAppDocument::NewLC(CEikApplication& aApp) - { - CIMCVAppDocument* self = new (ELeave) CIMCVAppDocument(aApp); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } -// --------------------------------------------------------- -// CIMCVAppDocument::ConstructL() -// --------------------------------------------------------- -// -void CIMCVAppDocument::ConstructL() - { - // no implementation required - } -// --------------------------------------------------------- -// CIMCVAppDocument::CIMCVAppDocument() -// --------------------------------------------------------- -// -CIMCVAppDocument::CIMCVAppDocument(CEikApplication& aApp) : CAknDocument(aApp) - { - // no implementation required - } -// --------------------------------------------------------- -// CIMCVAppDocument::~CIMCVAppDocument() -// --------------------------------------------------------- -// -CIMCVAppDocument::~CIMCVAppDocument() - { - // no implementation required - } -// --------------------------------------------------------- -// CIMCVAppDocument::CreateAppUiL() -// --------------------------------------------------------- -// -CEikAppUi* CIMCVAppDocument::CreateAppUiL() - { - // Create the application user interface, and return a pointer to it, - // the framework takes ownership of this object - CEikAppUi* appUi = new (ELeave) CIMCVAppUi; - return appUi; - } - -// ---------------------------------------------------- -// CIMCVAppDocument::UpdateTaskNameL() -// Makes Startup-application hidden in menu shell and fastswap window -// ---------------------------------------------------- -void CIMCVAppDocument::UpdateTaskNameL( CApaWindowGroupName* aWgName ) - { - CEikDocument::UpdateTaskNameL( aWgName ); - aWgName->SetHidden( ETrue ); - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappinputabsorber.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappinputabsorber.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* Copyright (c) 2006 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: Instance of this class catches key inputs when it is activated -* -*/ - - - -// INCLUDE FILES -#include "cimcvappinputabsorber.h" -#include -#include -#include - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVAppInputAbsorber::CIMCVAppInputAbsorber -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppInputAbsorber::CIMCVAppInputAbsorber() - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppInputAbsorber::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVAppInputAbsorber::ConstructL() - { - CreateWindowL(); - SetExtent( TPoint( 0, 0 ), TSize( 0, 0 ) ); - ActivateL(); - ClaimPointerGrab( ETrue ); - iAppUi = iEikonEnv->EikAppUi(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppInputAbsorber::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppInputAbsorber* CIMCVAppInputAbsorber::NewL() - { - CIMCVAppInputAbsorber* self = new( ELeave ) CIMCVAppInputAbsorber; - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// Destructor -CIMCVAppInputAbsorber::~CIMCVAppInputAbsorber() - { - if ( iIsCaptured ) - { - if ( iAppUi ) - { - iAppUi->RemoveFromStack( this ); - } - } - } - -// --------------------------------------------------------- -// CIMCVAppInputAbsorber::CaptureEventsL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppInputAbsorber::CaptureEventsL() - { - if ( !iIsCaptured ) - { - iAppUi->AddToStackL( this ); - SetPointerCapture(); - } - - iIsCaptured = ETrue; - } - -// --------------------------------------------------------- -// CIMCVAppInputAbsorber::Release() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppInputAbsorber::Release() - { - if ( iIsCaptured ) - { - iAppUi->RemoveFromStack( this ); - SetPointerCapture( EFalse ); - } - - iIsCaptured = EFalse; - } - - -// --------------------------------------------------------- -// CIMCVAppInputAbsorber::IsCaptured() -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CIMCVAppInputAbsorber::IsCaptured() const - { - return iIsCaptured; - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppInputAbsorber::OfferKeyEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TKeyResponse CIMCVAppInputAbsorber::OfferKeyEventL( const TKeyEvent& /*aKeyEvent*/, - TEventCode /*aType*/ ) - { - // consume all keys - return EKeyWasConsumed; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppInputAbsorber::HandlePointerEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppInputAbsorber::HandlePointerEventL( const TPointerEvent& aPointerEvent ) - { - // For debugging purposes. - CCoeControl::HandlePointerEventL( aPointerEvent ); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvapplayoutinfo.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvapplayoutinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,863 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: layout info class -* -*/ - - - -// INCLUDE FILES -#include "cimcvapplayoutinfo.h" -#include -#include //cdl -#include -#include -#include "imcvlogger.h" - -// CONSTANTS - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CIMCVAppLayoutInfo::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppLayoutInfo* CIMCVAppLayoutInfo::NewL( TChatListBoxLayout::TLayout aLayoutID ) - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::NewL() start" )); - CIMCVAppLayoutInfo* self = new (ELeave) CIMCVAppLayoutInfo( aLayoutID ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::NewL() end" )); - return self; - - } - -// ----------------------------------------------------------------------------- -// CIMCVAppLayoutInfo::~CIMCVAppLayoutInfo -// Destructor -// ----------------------------------------------------------------------------- -// -CIMCVAppLayoutInfo::~CIMCVAppLayoutInfo() - { - if ( iReadingPane ) - { - iReadingPane->Reset(); - delete iReadingPane; - } - - if ( iWrittingPane ) - { - iWrittingPane->Reset(); - delete iWrittingPane; - } - - if ( iReadingField ) - { - iReadingField->Reset(); - delete iReadingField; - } - - if ( iReadingPaneTextsLine1 ) - { - iReadingPaneTextsLine1->Reset(); - delete iReadingPaneTextsLine1; - } - - if ( iIMTextElements ) - { - iIMTextElements->Reset(); - delete iIMTextElements; - } - - if ( iWrittingPaneTextsLine ) - { - iWrittingPaneTextsLine->Reset(); - delete iWrittingPaneTextsLine; - } - - if ( iIMWritingFieldLine1 ) - { - iIMWritingFieldLine1->Reset(); - delete iIMWritingFieldLine1; - } - - if ( iIMWritingFieldLine3 ) - { - iIMWritingFieldLine3->Reset(); - delete iIMWritingFieldLine3; - } - - if ( iIMNaviPaneTextsLine1 ) - { - iIMNaviPaneTextsLine1->Reset(); - delete iIMNaviPaneTextsLine1; - } - - if ( iIMNaviPaneTextsLine2 ) - { - iIMNaviPaneTextsLine2->Reset(); - delete iIMNaviPaneTextsLine2; - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppLayoutInfo::CIMCVAppLayoutInfo -// C++ constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppLayoutInfo::CIMCVAppLayoutInfo( TChatListBoxLayout::TLayout aLayoutID ) : - iLayoutID( aLayoutID ) - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::CIMCVAppLayoutInfo() start" )); - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::CIMCVAppLayoutInfo() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppLayoutInfo::ConstructL -// Second phase constructor -// ----------------------------------------------------------------------------- -// -void CIMCVAppLayoutInfo::ConstructL() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::ConstructL() start" )); - SetupMainPaneRect(); - FillLayoutL(); - LogLayoutL(); - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::ConstructL() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::LayoutChangedL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::LayoutChangedL( TInt /*aType = 0*/ ) - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::LayoutChangedL() start" )); - FillLayoutL(); - - TAknLayoutRect myLayoutRect; - - TAknLayoutRect myLine; - - //update MainPaneRect - SetupMainPaneRect(); - - TAknWindowLineLayout readingPane = im_reading_pane( iLayoutID ); - - myLayoutRect.LayoutRect( iMainPaneRect, readingPane ); - - //line height - TAknWindowLineLayout lineLayout = im_reading_field( 0 ); - - myLine.LayoutRect( myLayoutRect.Rect(), lineLayout ); - - TAknTextLineLayout myMessageHeaderLayout = - IM_reading_pane_texts_Line_1( 1 ); - - TAknLayoutText myTextLayout; - TAknLayoutText myTextLayout2; - - myTextLayout.LayoutText( myLine.Rect(), myMessageHeaderLayout); - - // IconSkip - myMessageHeaderLayout = IM_reading_pane_texts_Line_1( 2 ); - - myTextLayout2.LayoutText( myLine.Rect(), myMessageHeaderLayout); - - // MsgFont - - TAknTextLineLayout myMessageLayout = IM_reading_pane_texts_Line_2(); - - //normal message text with indent - myTextLayout.LayoutText( myLine.Rect(), myMessageLayout); - - //header with full width - myMessageHeaderLayout = IM_reading_pane_texts_Line_1( 1 ); - myTextLayout2.LayoutText( myLine.Rect(), myMessageHeaderLayout); - - - // MaxNickWidth - - myMessageHeaderLayout = IM_reading_pane_texts_Line_1( 0 ); - - myTextLayout.LayoutText( myLine.Rect(), myMessageHeaderLayout); - - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::LayoutChangedL() end" )); - } - - -// CIMCVAppLayoutInfo::MainPaneRect -// (other items were commented in a header). -// --------------------------------------------------------- -// -TRect CIMCVAppLayoutInfo::MainPaneRect() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::MainPaneRect() start" )); - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::MainPaneRect() end" )); - return TRect( iMainPaneRect ); - } -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::SetLayoutID -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::SetLayoutID( TChatListBoxLayout::TLayout aLayout ) - { - iLayoutID = aLayout; - TRAPD( err, LayoutChangedL() ); - if( err != KErrNone ) - { - CActiveScheduler::Current()->Error( err ); - } - } - - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::ScreenRect -// (other items were commented in a header). -// --------------------------------------------------------- -// -TRect CIMCVAppLayoutInfo::ScreenRect() - { - return iScreenRect; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::SetEditorVisibility -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::SetEditorVisibility( TBool aVisible ) - { - iEditorVisibility = aVisible; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::EditorVisibility -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CIMCVAppLayoutInfo::EditorVisibility() - { - return iEditorVisibility; - } - -// CIMCVAppLayoutInfo::SetupMainPaneRect -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::SetupMainPaneRect() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::SetupMainPaneRect() start" )); - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, - iMainPaneRect ); - _LIT( KMain, "MainPane"); - - iMainPaneRect.Move( -iMainPaneRect.iTl.iX, -iMainPaneRect.iTl.iY ); - - DPRect( KMain, iMainPaneRect ); - - TRect myControlPane; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EControlPane, - myControlPane ); - _LIT( KControlPane, "ControlPane"); - DPRect( KControlPane, myControlPane ); - //this is screen relative lets move back to origin. - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::SetupMainPaneRect() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::im_reading_pane -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknWindowLineLayout CIMCVAppLayoutInfo::im_reading_pane(TInt aIndex_H) - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::im_reading_pane() start" )); - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::im_reading_pane() end" )); - return (*iReadingPane)[ aIndex_H ]; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::im_reading_field -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknWindowLineLayout CIMCVAppLayoutInfo::im_reading_field(TInt aIndex_t) - { - return (*iReadingField)[ aIndex_t ]; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::IM_text_elements -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknWindowLineLayout CIMCVAppLayoutInfo::IM_text_elements(TInt aLineIndex) - { - return (*iIMTextElements)[ aLineIndex ]; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::IM_reading_pane_texts_Line_1 -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknTextLineLayout CIMCVAppLayoutInfo::IM_reading_pane_texts_Line_1(TInt aCommon1) - { - return (*iReadingPaneTextsLine1)[ aCommon1 ]; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::IM_reading_pane_texts_Line_2 -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknTextLineLayout CIMCVAppLayoutInfo::IM_reading_pane_texts_Line_2() - { - return iReadingPaneTextsLine2; - } - -// CIMCVAppLayoutInfo::im_writing_pane -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknWindowLineLayout CIMCVAppLayoutInfo::im_writing_pane( TInt aCommon1 ) - { - return (*iWrittingPane)[ aCommon1 ]; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::IM_writing_field_elements_Line_1 -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknWindowLineLayout CIMCVAppLayoutInfo::IM_writing_field_elements_Line_1( - TInt aIndex_H ) - { - return (*iIMWritingFieldLine1)[ aIndex_H ]; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::IM_writing_field_elements_Line_2 -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknWindowLineLayout CIMCVAppLayoutInfo::IM_writing_field_elements_Line_2() - { - return iIMWritingFieldLine2; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::IM_writing_field_elements_Line_3 -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknWindowLineLayout CIMCVAppLayoutInfo::IM_writing_field_elements_Line_3( - TInt aIndex_H ) - { - return (*iIMWritingFieldLine3)[ aIndex_H ]; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::Multiline_IM_writing_pane_texts_Line_1 -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknMultiLineTextLayout CIMCVAppLayoutInfo::Multiline_IM_writing_pane_texts_Line_1( - TInt aNumberOfLinesShown) - { - return (*iWrittingPaneTextsLine)[ aNumberOfLinesShown ]; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::IM_navi_pane_texts_Line_1 -// (other items were commented in a header). -// --------------------------------------------------------- -// -TAknTextLineLayout CIMCVAppLayoutInfo::IM_navi_pane_texts_Line_1( - TInt aIndex_C, TInt /*aIndex_W*/) - { - return (*iIMNaviPaneTextsLine1)[ aIndex_C ]; - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::LogLayout -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::LogLayoutL() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::LogLayoutL() start" )); -#ifdef _DEBUG - - _LIT( K1,"im_reading_pane( 0 ) "); - DPLayout( K1, AppLayout::im_reading_pane( 0 ) ); - DPLayout( K1, im_reading_pane( 0 ) ); - _LIT( K2,"im_reading_pane( 1 ) "); - DPLayout( K2, AppLayout::im_reading_pane( 1 ) ); - DPLayout( K2, im_reading_pane( 1 ) ); - _LIT( K3,"im_reading_pane( 2 ) "); - DPLayout( K3, AppLayout::im_reading_pane( 2 ) ); - DPLayout( K3, im_reading_pane( 2 ) ); - - _LIT( KWP1,"im_writing_pane( 0 )"); - DPLayout( KWP1, AppLayout::im_writing_pane( 0 ) ); - DPLayout( KWP1, im_writing_pane( 0 ) ); - _LIT( KWP2,"im_writing_pane( 1 )"); - DPLayout( KWP2, AppLayout::im_writing_pane( 1 ) ); - DPLayout( KWP2, im_writing_pane( 1 ) ); - - _LIT( K4,"im_reading_field( 0 ) "); - DPLayout( K4, AppLayout::im_reading_field( 0 ) ); - DPLayout( K4, im_reading_field( 0 ) ); - _LIT( K5,"im_reading_field( 1 ) "); - DPLayout( K5, AppLayout::im_reading_field( 1 ) ); - DPLayout( K5, im_reading_field( 1 ) ); - _LIT( K6,"im_reading_field( 2 ) "); - DPLayout( K6, AppLayout::im_reading_field( 2 ) ); - DPLayout( K6, im_reading_field( 2 ) ); - _LIT( K7,"im_reading_field( 3 ) "); - DPLayout( K7, AppLayout::im_reading_field( 3 ) ); - DPLayout( K7, im_reading_field( 3 ) ); - _LIT( K8,"im_reading_field( 4 ) "); - DPLayout( K8, AppLayout::im_reading_field( 4 ) ); - DPLayout( K8, im_reading_field( 4 ) ); - _LIT( K9,"im_reading_field( 5 ) "); - DPLayout( K9, AppLayout::im_reading_field( 5 ) ); - DPLayout( K9, im_reading_field( 5 ) ); - _LIT( K10,"im_reading_field( 6 ) "); - DPLayout( K10, AppLayout::im_reading_field( 6 ) ); - DPLayout( K10, im_reading_field( 6 ) ); - - TAknLayoutScalableParameterLimits limits( - AknLayoutScalable_Apps::list_im_single_pane_ParamLimits() ); - - if( 7 <= limits.LastRow() ) - { - _LIT( K11,"im_reading_field( 7 ) "); - DPLayout( K11, AppLayout::im_reading_field( 7 ) ); - DPLayout( K11, im_reading_field( 7 ) ); - } - - _LIT( KRPT0,"IM_reading_pane_texts_Line_1( 0 )"); - DPLayout( KRPT0, AppLayout::IM_reading_pane_texts_Line_1( 0 ) ); - DPLayout( KRPT0, IM_reading_pane_texts_Line_1( 0 ) ); - _LIT( KRPT1,"IM_reading_pane_texts_Line_1( 1 )"); - DPLayout( KRPT1, AppLayout::IM_reading_pane_texts_Line_1( 1 ) ); - DPLayout( KRPT1, IM_reading_pane_texts_Line_1( 1 ) ); - _LIT( KRPT2,"IM_reading_pane_texts_Line_1( 2 )"); - DPLayout( KRPT2, AppLayout::IM_reading_pane_texts_Line_1( 2 ) ); - DPLayout( KRPT2, IM_reading_pane_texts_Line_1( 2 ) ); - _LIT( KRPT3,"IM_reading_pane_texts_Line_2()"); - DPLayout( KRPT3, AppLayout::IM_reading_pane_texts_Line_2() ); - DPLayout( KRPT3, IM_reading_pane_texts_Line_2() ); - - _LIT( KIMT1,"IM_text_elements( 0 )"); - DPLayout( KIMT1, AppLayout::IM_text_elements( 0 ) ); - DPLayout( KIMT1, IM_text_elements( 0 ) ); - _LIT( KIMT2,"IM_text_elements( 1 )"); - DPLayout( KIMT2, AppLayout::IM_text_elements( 1 ) ); - DPLayout( KIMT2, IM_text_elements( 1 ) ); - _LIT( KIMT3,"IM_text_elements( 2 )"); - DPLayout( KIMT3, AppLayout::IM_text_elements( 2 ) ); - DPLayout( KIMT3, IM_text_elements( 2 ) ); - - _LIT( KMWPT0,"Multiline_IM_writing_pane_texts_Line_1( 0 )"); - DPLayout( KMWPT0, AppLayout::Multiline_IM_writing_pane_texts_Line_1( 0 ) ); - DPLayout( KMWPT0, Multiline_IM_writing_pane_texts_Line_1( 0 ) ); - - _LIT( KMWPT1,"Multiline_IM_writing_pane_texts_Line_1( 1 )"); - DPLayout( KMWPT1, AppLayout::Multiline_IM_writing_pane_texts_Line_1( 1 ) ); - DPLayout( KMWPT1, Multiline_IM_writing_pane_texts_Line_1( 1 ) ); - - _LIT( KMWPT2,"Multiline_IM_writing_pane_texts_Line_1( 2 )"); - DPLayout( KMWPT2, AppLayout::Multiline_IM_writing_pane_texts_Line_1( 2 ) ); - DPLayout( KMWPT2, Multiline_IM_writing_pane_texts_Line_1( 2 ) ); - - _LIT( KWFL10,"IM_writing_field_elements_Line_1( 0 )"); - DPLayout( KWFL10, AppLayout::IM_writing_field_elements_Line_1( 0 ) ); - DPLayout( KWFL10, IM_writing_field_elements_Line_1( 0 ) ); - - _LIT( KWFL11,"IM_writing_field_elements_Line_1( 1 )"); - DPLayout( KWFL11, AppLayout::IM_writing_field_elements_Line_1( 1 ) ); - DPLayout( KWFL11, IM_writing_field_elements_Line_1( 1 ) ); - - _LIT( KWFL2,"IM_writing_field_elements_Line_2()"); - DPLayout( KWFL2, AppLayout::IM_writing_field_elements_Line_2() ); - DPLayout( KWFL2, IM_writing_field_elements_Line_2() ); - - _LIT( KWFL30,"IM_writing_field_elements_Line_3( 0 )"); - DPLayout( KWFL30, AppLayout::IM_writing_field_elements_Line_3( 0 ) ); - DPLayout( KWFL30, IM_writing_field_elements_Line_3( 0 ) ); - - _LIT( KWFL31,"IM_writing_field_elements_Line_3( 1 )"); - DPLayout( KWFL31, AppLayout::IM_writing_field_elements_Line_3( 1 ) ); - DPLayout( KWFL31, IM_writing_field_elements_Line_3( 1 ) ); - - HBufC* myStr = HBufC::NewLC( 60 ); - TPtr myPtr = myStr->Des(); - - _LIT( KNPTL,"IM_navi_pane_texts_Line_1( "); - _LIT( KNPTL0,"AppLayout::"); - _LIT( KNPTL1,", 0 )"); - _LIT( KNPTL2,", 1 )"); - TInt i(0); - for( i=0; i<10; i++ ) - { - myPtr.Copy( KNPTL0() ); - myPtr.Append( KNPTL() ); - myPtr.AppendNum( i ); - myPtr.Append( KNPTL1() ); - DPLayout( myPtr, IM_navi_pane_texts_Line_1( i ,0 ) ); - - myPtr.Copy( KNPTL() ); - myPtr.AppendNum( i ); - myPtr.Append( KNPTL1() ); - DPLayout( myPtr, IM_navi_pane_texts_Line_1( i ,0 ) ); - } - for( i =0; i<10; i++ ) - { - myPtr.Copy( KNPTL0() ); - myPtr.Append( KNPTL() ); - myPtr.AppendNum( i ); - myPtr.Append( KNPTL2() ); - DPLayout( myPtr, IM_navi_pane_texts_Line_1( i ,1 ) ); - - myPtr.Copy( KNPTL() ); - myPtr.AppendNum( i ); - myPtr.Append( KNPTL2() ); - DPLayout( myPtr, IM_navi_pane_texts_Line_1( i ,1 ) ); - } - - CleanupStack::PopAndDestroy( myStr ); - -#endif // _DEBUG - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::LogLayoutL() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::DPLayout -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::DPLayout( const TDesC& /*aStr*/, const TAknTextLineLayout /*aLayout*/ ) - { - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::DPLayout -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::DPLayout( const TDesC& /*aStr*/, - const TAknWindowLineLayout /*aLayout*/ ) - { - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::DPRect -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::DPRect( const TDesC& /*aStr*/, const TRect& /*aRect*/ ) - { - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillLayoutL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillLayoutL() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillLayoutL() start" )); - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, iScreenRect ); - if ( iLastScreenRect != iScreenRect ) - { - FillReadingPaneL(); - FillWrittingPaneL(); - FillReadingFieldL(); - FillReadingPaneTextsLine1L(); - FillReadingPaneTextsLine2(); - FillIMTextElementsL(); - FillWrittingPaneTextsLineL(); - FillIMWritingFieldLine1L(); - FillIMWritingFieldLine2(); - FillIMWritingFieldLine3L(); - FillIMNaviPaneTextsLineL(); - } - iLastScreenRect = iScreenRect; - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillLayoutL() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillReadingPaneL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillReadingPaneL() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillReadingPaneL() start" )); - if ( iReadingPane ) - { - iReadingPane->Reset(); - delete iReadingPane; - iReadingPane = NULL; - } - - iReadingPane = new( ELeave )CArrayFixFlat( 3 ); - for( TInt i(0); i < 3; i++ ) - { - iReadingPane->AppendL( AppLayout::im_reading_pane( i ) ); - } - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillReadingPaneL() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillReadingFieldL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillReadingFieldL() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillReadingFieldL() start" )); - if ( iReadingField ) - { - iReadingField->Reset(); - delete iReadingField; - iReadingField = NULL; - } - - TAknLayoutScalableParameterLimits limits( - AknLayoutScalable_Apps::list_im_single_pane_ParamLimits() ); - - // items from FirstRow to LastRow - iReadingField = new( ELeave )CArrayFixFlat( - limits.LastRow() - limits.FirstRow() + 1 ); - - for( TInt i( limits.FirstRow() ); i <= limits.LastRow(); ++i ) - { - iReadingField->AppendL( AppLayout::im_reading_field( i ) ); - } - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillReadingFieldL() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillReadingPaneTextsLine1 -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillReadingPaneTextsLine1L() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillReadingPaneTextsLine1L() start" )); - if ( iReadingPaneTextsLine1 ) - { - iReadingPaneTextsLine1->Reset(); - delete iReadingPaneTextsLine1; - iReadingPaneTextsLine1 = NULL; - } - - iReadingPaneTextsLine1 = new( ELeave )CArrayFixFlat( 3 ); - for( TInt i(0); i < 3; i++ ) - { - iReadingPaneTextsLine1->AppendL( - AppLayout::IM_reading_pane_texts_Line_1( i ) ); - } - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillReadingPaneTextsLine1L() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillIMTextElementsL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillIMTextElementsL() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMTextElementsL() start" )); - if ( iIMTextElements ) - { - iIMTextElements->Reset(); - delete iIMTextElements; - iIMTextElements = NULL; - } - - iIMTextElements = new( ELeave )CArrayFixFlat( 3 ); - for( TInt i(0); i < 3; i++ ) - { - iIMTextElements->AppendL( AppLayout::IM_text_elements( i ) ); - } - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMTextElementsL() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillReadingPaneTextsLine2 -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillReadingPaneTextsLine2() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillReadingPaneTextsLine2() start" )); - iReadingPaneTextsLine2 = AppLayout::IM_reading_pane_texts_Line_2(); - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillReadingPaneTextsLine2() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillWrittingPaneTextsLineL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillWrittingPaneTextsLineL() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillWrittingPaneTextsLineL() start" )); - if ( iWrittingPaneTextsLine ) - { - iWrittingPaneTextsLine->Reset(); - delete iWrittingPaneTextsLine; - iWrittingPaneTextsLine = NULL; - } - - iWrittingPaneTextsLine = new( ELeave )CArrayFixFlat( 3 ); - for( TInt i(0); i < 3; i++ ) - { - iWrittingPaneTextsLine->AppendL( - AppLayout::Multiline_IM_writing_pane_texts_Line_1( i ) ); - } - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillWrittingPaneTextsLineL() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillIMWritingFieldLine1 -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillIMWritingFieldLine1L() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMWritingFieldLine1L() start" )); - if ( iIMWritingFieldLine1 ) - { - iIMWritingFieldLine1->Reset(); - delete iIMWritingFieldLine1; - iIMWritingFieldLine1 = NULL; - } - - iIMWritingFieldLine1 = new( ELeave )CArrayFixFlat( 3 ); - for( TInt i(0); i < 2; i++ ) - { - iIMWritingFieldLine1->AppendL( - AppLayout::IM_writing_field_elements_Line_1( i ) ); - } - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMWritingFieldLine1L() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillIMWritingFieldLine2 -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillIMWritingFieldLine2() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMWritingFieldLine2() start" )); - iIMWritingFieldLine2 = - AppLayout::IM_writing_field_elements_Line_2(); - iIMWritingFieldLine2.iH = 1; - iIMWritingFieldLine2.iW = ELayoutP; - iIMWritingFieldLine2.iC = 221; - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMWritingFieldLine2() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillIMWritingFieldLine3L -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillIMWritingFieldLine3L() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMWritingFieldLine3L() start" )); - if ( iIMWritingFieldLine3 ) - { - iIMWritingFieldLine3->Reset(); - delete iIMWritingFieldLine3; - iIMWritingFieldLine3 = NULL; - } - - iIMWritingFieldLine3 = new ( ELeave ) CArrayFixFlat< TAknWindowLineLayout >( - 3 ); - for( TInt i(0); i < 2; i++ ) - { - iIMWritingFieldLine3->AppendL( - AppLayout::IM_writing_field_elements_Line_3( i ) ); - } - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMWritingFieldLine3L() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillWrittingPaneL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillWrittingPaneL() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillWrittingPaneL() start" )); - if ( iWrittingPane ) - { - iWrittingPane->Reset(); - delete iWrittingPane; - iWrittingPane = NULL; - } - - iWrittingPane = new( ELeave )CArrayFixFlat( 2 ); - for( TInt i(0); i < 2; i++ ) - { - iWrittingPane->AppendL( AppLayout::im_writing_pane( i ) ); - } - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillWrittingPaneL() end" )); - } - -// --------------------------------------------------------- -// CIMCVAppLayoutInfo::FillIMNaviPaneTextsLine -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLayoutInfo::FillIMNaviPaneTextsLineL() - { - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMNaviPaneTextsLineL() start" )); - // fader colors from LAF. These are hardcoded as the LAF (impl.) adviced. - const TInt16 colors[] = { 234, 232, 230, 228, 226, 0, 226, 227, 228, 229 }; - - if ( iIMNaviPaneTextsLine1 ) - { - iIMNaviPaneTextsLine1->Reset(); - delete iIMNaviPaneTextsLine1; - iIMNaviPaneTextsLine1 = NULL; - } - - iIMNaviPaneTextsLine1 = - new ( ELeave ) CArrayFixFlat( 10 ); - - TAknTextLineLayout text; - for( TInt i(0); i < 10; i++ ) - { - text = AknLayoutScalable_Apps::navi_pane_im_t1(); - text.iC = colors[ i ]; - iIMNaviPaneTextsLine1->AppendL( text ); - } - IM_CV_LOGS(TXT("CIMCVAppLayoutInfo::FillIMNaviPaneTextsLineL() end" )); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvapplogineventlistener.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvapplogineventlistener.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,316 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for RProperty where conversation view login event handled. -* -*/ - - -// INCLUDE FILES - -#include "cimcvapplogineventlistener.h" -#include "cimcvengine.h" -#include "cimcvappui.h" -#include "imconnectionproviderconsts.h" -#include -#include "cimcvappwaitnote.h" -#include "mimcvenginemessagehandler.h" - -//system includes -#include -#include - -#include - -// ================= MEMBER FUNCTIONS ======================= - -// -------------------------------------------------------------------------- -// CIMCVAppLoginEventListener::CIMCVAppLoginEventListener -// -------------------------------------------------------------------------- -// -CIMCVAppLoginEventListener::CIMCVAppLoginEventListener( CIMCVEngine& aEngine, - CIMCVAppUi& aAppUi ) - : CActive( CActive::EPriorityStandard ), - iEngine( aEngine ), - iAppUi( aAppUi ) - { - CActiveScheduler::Add( this ); - } - -// -------------------------------------------------------------------------- -// CIMCVAppLoginEventListener::ConstructL -// -------------------------------------------------------------------------- -// -void CIMCVAppLoginEventListener::ConstructL( const TDesC& aUserId ) - { - iUserId = aUserId.AllocL(); - - RProperty::Set(KIMPropertyUid, KIMCCHLauncher, EMecoCV ); //0 reset property - RProperty::Set(KIMPropertyUid, KIMCCHLauncherId, *iUserId ); //0 reset property - RProperty::Set(KIMPropertyUid, KIMCCHLauncherErr, 0 ); //0 reset property - User::LeaveIfError( iProperty.Attach(KIMPropertyUid, KIMCCHLauncherErr) ); - } - - -// -------------------------------------------------------------------------- -// CIMCVAppLoginEventListener::NewL -// -------------------------------------------------------------------------- -// -CIMCVAppLoginEventListener* CIMCVAppLoginEventListener::NewL(CIMCVEngine& aEngine, - CIMCVAppUi& aAppUi, - const TDesC& aUserId ) - { - CIMCVAppLoginEventListener* self = new(ELeave) CIMCVAppLoginEventListener( aEngine, aAppUi ); - CleanupStack::PushL(self); - self->ConstructL(aUserId); - CleanupStack::Pop(self); - return self; - } -// --------------------------------------------------------- -// CIMCVAppLoginEventListener::~CIMCVAppLoginEventListener() -// C++ Destructor -// --------------------------------------------------------- -// -CIMCVAppLoginEventListener::~CIMCVAppLoginEventListener() - { - - //reset all properties - RProperty::Set(KIMPropertyUid, KIMCCHLauncher, EMecoCV ); //0 reset property - RProperty::Set(KIMPropertyUid, KIMCCHLauncherErr, 0 ); //0 reset property - - if (iWaitDialog) - { - delete iWaitDialog; - iWaitDialog = NULL; - } - - - if (iUserId) - { - RProperty::Set(KIMPropertyUid, KIMCCHLauncherId, *iUserId ); //0 reset property - delete iUserId; - iUserId = NULL; - } - - Cancel(); // Cancel any request, if outstanding - iProperty.Close(); // Destroy the property object - } -// --------------------------------------------------------- -// CIMCVAppLoginEventListener::RunL() -// --------------------------------------------------------- -// -void CIMCVAppLoginEventListener::RunL() - { - - TInt eventValue = 0; - - TInt error = RProperty::Get(KIMPropertyUid,KIMCCHLauncherErr, eventValue ); - - if (error) - { - iErr = KErrGeneral; - User::Leave( error ); - } - - switch (eventValue) - { - case ESuccess: - //login is successfull; - // hide wait note - if ( iWaitVisible ) - { - TRAPD(err,LoginCompletedL() ); - if ( err != KErrNone ) - { - User::Leave( err ); - } - iWaitVisible = EFalse; - - //iEngine.DeleteContextL(); - //iEngine.CreateContextL(); - iEngine.MessageHandler().SubscribePresenceL( *iUserId ); - iErr = KErrNone; - } - break; - - case EInvalid: - //this user is not in the fetched contact list - //hence show the note and close the coversation view - // hide wait note - if ( iWaitVisible ) - { - TRAPD(err,LoginCompletedL() ); - if ( err != KErrNone ) - { - User::Leave( err ); - } - iWaitVisible = EFalse; - } - //iEngine.DeleteContextL(); - //iEngine.CreateContextL(); - iErr = KErrBadHandle; - break; - - case EGeneral: - //some error in logging - // hide wait note - if ( iWaitVisible ) - { - TRAPD(err,LoginCompletedL() ); - if ( err != KErrNone ) - { - User::Leave( err ); - } - iWaitVisible = EFalse; - } - iErr = KErrGeneral; - - break; - - default: - iErr = KErrGeneral; - break; - - } - - error = RProperty::Set(KIMPropertyUid,KIMCCHLauncherErr, 0 ); - - } -// --------------------------------------------------------- -// CIMCVAppLoginEventListener::RunL() -// --------------------------------------------------------- -// -void CIMCVAppLoginEventListener::DoCancel() - { - iProperty.Cancel(); - } -// --------------------------------------------------------- -// CIMCVAppLoginEventListener::StartListening() -// --------------------------------------------------------- -// -void CIMCVAppLoginEventListener::StartListening() - { - if(!IsActive() ) - { - iProperty.Subscribe(iStatus); - SetActive(); // Tell scheduler a request is active - } - } - - -// --------------------------------------------------------- -// CIMCVAppLoginEventListener::StopListening() -// --------------------------------------------------------- -// -void CIMCVAppLoginEventListener::StopListening() - { - if(IsActive() ) - { - Cancel(); // Cancel any request, if outstanding - } - } - - -// --------------------------------------------------------- -// CIMCVAppLoginEventListener::LoginL -// (other items were commented in a header). -// --------------------------------------------------------- - -TInt CIMCVAppLoginEventListener::LoginL() - { - - if( !iWaitVisible ) - { - // launch the wait note - iWaitVisible = ETrue; - - //reset the error - iErr = KErrNone; - - MIMCVEngineCchHandler& cchHandler = iEngine.CCHHandler(); - - StartListening(); - - cchHandler.EnableService(); - - // load the promp from lOC file + server name - HBufC* prompt = StringLoader::LoadLC( R_SERVTAB_LOGIN_ONGOING, - iEngine.ServiceName() ); - - iWaitDialog = CIMCVAppWaitNote::ShowWaitNoteL( - *prompt, - ETrue ); - - CleanupStack::PopAndDestroy( prompt ); - - // start capturing the events - iAppUi.CaptureEventsL(); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); // CSI: 10 # iWait is not an active object - } - - delete iWaitDialog; - - iWaitDialog = NULL; - - StopListening(); - - } - - RProperty::Set(KIMPropertyUid, KIMCCHLauncher, 0 ); //0 reset property - RProperty::Set(KIMPropertyUid, KIMCCHLauncherId, KNullDesC ); //0 reset property - RProperty::Set(KIMPropertyUid, KIMCCHLauncherErr, 0 ); //0 reset property - - return iErr; - - } - - -// --------------------------------------------------------- -// CIMCVAppLoginEventListener::LoginCompletedL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLoginEventListener::LoginCompletedL() - { - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - // stop capturing the events - iAppUi.ReleaseCapturingL(); - - } - - - -// --------------------------------------------------------- -// CIMCVAppLoginEventListener::SetUserIdL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppLoginEventListener::SetUserIdL( const TDesC& aUserId ) - { - delete iUserId; - iUserId = NULL; - iUserId = aUserId.AllocL(); - - RProperty::Set(KIMPropertyUid, KIMCCHLauncher, EMecoCV ); //0 reset property - RProperty::Set(KIMPropertyUid, KIMCCHLauncherId, *iUserId ); //0 reset property - RProperty::Set(KIMPropertyUid, KIMCCHLauncherErr, 0 ); //0 reset property - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappmessageeditor.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappmessageeditor.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,446 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message editer -* -*/ - -// INCLUDE FILES -#include -#include "cimcvappmessageeditor.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include //CEikAppUiFactory -#include -#include -#include -#include -#include "cimcvappview.h" -#include "mimcvtapeventobserver.h" -#include "cimcvappmessageextensionshandler.h" -#include -using namespace SkinLayout; - - -// CONSTANTS -const TInt KChatKeyEventHotkeyLimit = 100; -const TInt KChatResourceBufferSize = 24; -const TInt KMaxMsgLength = 400; - - - - -// --------------------------------------------------------------------------- -// CIMCVAppMessageEditor::NewL -// --------------------------------------------------------------------------- -// -CIMCVAppMessageEditor* CIMCVAppMessageEditor::NewL(const CCoeControl* aParent, - TDesC& mbmPath, - CIMCVAppView& aAppView, - CIMCVAppMessageExtensionsHandler& aExtensionsHandler) - { - CIMCVAppMessageEditor* msgEditor = new(ELeave)CIMCVAppMessageEditor(aAppView, - aExtensionsHandler); - CleanupStack::PushL( msgEditor ); - msgEditor->ConstructL( aParent, mbmPath ); - msgEditor->SetFocus( ETrue ); - CleanupStack::Pop(); // msgEditor - return msgEditor; - } - - -// --------------------------------------------------------------------------- -// CIMCVAppMessageEditor::~CBrowserGotoPane -// --------------------------------------------------------------------------- -// -CIMCVAppMessageEditor::~CIMCVAppMessageEditor() - { - if(iBgContext) - { - delete iBgContext; - } - delete iEditor; - delete iInputFrame; - iEditorObserver = NULL; - } - -// --------------------------------------------------------------------------- -// CIMCVAppMessageEditor::CIMCVAppMessageEditor -// --------------------------------------------------------------------------- -// -CIMCVAppMessageEditor::CIMCVAppMessageEditor(CIMCVAppView& aAppView, - CIMCVAppMessageExtensionsHandler& aExtensionHandler): - iAppView (aAppView), - iExtensionHandler(aExtensionHandler) - { - } - -// --------------------------------------------------------------------------- -// CIMCVAppMessageEditor::ConstructL -// --------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::ConstructL ( const CCoeControl* aParent, TDesC& mbmPath ) - { - CreateWindowL(); - - // remove 'const' modifier and set parent control - SetMopParent( CONST_CAST( CCoeControl*, aParent ) ); - - iEditor = new (ELeave) CEikRichTextEditor; - - iInputFrame = CAknInputFrame::NewL( - iEditor, - EFalse, - mbmPath, - EMbmImcvuiappQgn_indi_im_msg_editor, - EMbmImcvuiappQgn_indi_im_msg_editor_mask, - 0 ); - - iInputFrame->SetContainerWindowL( *this ); - - AknEditUtils::ConstructEditingL ( iEditor, - KMaxMsgLength, - 1, - EAknEditorCharactersLowerCase, - EAknEditorAlignRight, - EFalse, - ETrue, - EFalse ); - - iEditor->SetContainerWindowL( *this ); - iEditor->SetObserver( this ); - iEditor->SetBorder( TGulBorder::ENone ); - iEditor->SetAknEditorCase( EAknEditorLowerCase ); - iEditor->SetAknEditorInputMode( EAknEditorAllInputModes ); - iEditor->SetAllowPictures(ETrue); - // iEditor->SetAknEditorFlags(CEikRichTextEditor::ENoTextParsers); - iEditor->SetAknEditorPermittedCaseModes ( EAknEditorAllCaseModes ); - iEditor->CreateTextViewL(); - TRect screen( 0,0,0,0 ); - - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); - //get the background skin context - iBgContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMain, screen, EFalse ); - //set the editor background color to background skin context - iEditor->SetSkinBackgroundControlContextL( iBgContext ); - iEditor->OverrideColorL(EColorControlSurroundBackground,KRgbRed); - iEditor->EnableCcpuSupportL(ETrue); - iEditor->SetEdwinObserver(this); - iServiceId = iAppView.ActiveEngine().GetServiceId(); - ActivateL(); - } - -// --------------------------------------------------------------------------- -// CIMCVAppMessageEditor::HandleControlEventL -// --------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::HandleControlEventL ( CCoeControl* /*aControl*/, - TCoeEvent aEventType ) - { - switch (aEventType) - { - case EEventStateChanged: - { - iEditor->DrawNow(); - iAppView.UpdateToolbarButtonsStateL(); - break; - } - case EEventRequestFocus: - { - FocusChanged( EDrawNow ); - break; - } - default: - break; - } - } - -// --------------------------------------------------------------------------- -// CIMCVAppMessageEditor::HandleControlEventL -// --------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::HandleEdwinEventL(CEikEdwin* /*aEdwin*/, - TEdwinEvent /*aEventType*/) - { - iEditor->DrawNow(); - } -// ----------------------------------------------------------------------------- -// CIMCVAppMessageEditor::NotifyObserverIfNeededL -// Called to force refresh of editor contents after inserting a smiley -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::NotifyObserverIfNeededL( TInt aOldLen, TInt aCurLen ) const - { - if ( iEditorObserver ) - { - if ( aCurLen == 0 && aOldLen > 0 ) - { - iEditorObserver->HandleMessageEditorEventL( - MIMCVAppMessageEditorObserver::EEditorContentCleared ); - - return; - } - if (aOldLen != aCurLen) - { - iEditorObserver->HandleMessageEditorEventL( - MIMCVAppMessageEditorObserver::EEditorContentChanged ); - return; - } - } - - } -// ---------------------------------------------------------------------------- -// CIMCVAppMessageEditor::OfferKeyEventL -// ---------------------------------------------------------------------------- -// -TKeyResponse CIMCVAppMessageEditor::OfferKeyEventL -( const TKeyEvent& aKeyEvent, TEventCode aType ) - { - TInt oldLen = iEditor->TextLength(); - if ( iEditor->TextLength() == iEditor->MaxLength() ) - { - if(( aType == EEventKey && - ( aKeyEvent.iCode != EKeyBackspace && - aKeyEvent.iCode < EKeyDelete ) - ) || - ( aType == EEventKeyUp && - aKeyEvent.iScanCode >= '0' && - aKeyEvent.iScanCode <= '9' - ) - ) - { - - return EKeyWasConsumed; - } - } - - TKeyResponse res = EKeyWasNotConsumed; - - // This logic comes from CEikEdwin - // We need to handle hot keys cut and copy - TBool select = aKeyEvent.iModifiers & EModifierShift; - TBool magnify = aKeyEvent.iModifiers & EModifierCtrl; - if ( magnify && aKeyEvent.iCode < KChatKeyEventHotkeyLimit - && aKeyEvent.iCode != ' ' ) - { - TBuf buf; - if ( select ) - { - iCoeEnv->ReadResourceL( buf, R_EIK_EDWIN_SHIFT_CTRL_HOTKEYS ); - } - else - { - iCoeEnv->ReadResourceL( buf, R_EIK_EDWIN_CTRL_HOTKEYS ); - } - - const TInt ret = buf.Locate( TChar( aKeyEvent.iCode + 'a' - 1 ) ); - switch( ret ) - { - case CEikEdwin::EHotKeyCut: - { - iEditor->CcpuCutL(); - res = EKeyWasConsumed; - break; - } - case CEikEdwin::EHotKeyCopy: - { - iEditor->CcpuCopyL(); - res = EKeyWasConsumed; - break; - } - default: - { - // No need to handle other hot keys here - break; - } - } - } - // -------------------- - - if ( res != EKeyWasConsumed ) - { - res = iEditor->OfferKeyEventL( aKeyEvent, aType ); - } - - NotifyObserverIfNeededL(oldLen, iEditor->TextLength()); - return res; - - } - -// ---------------------------------------------------------------------------- -// CIMCVAppMessageEditor::HandlePointerEventL -// ---------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::HandlePointerEventL(const TPointerEvent& aPointerEvent) - { - if( !AknLayoutUtils::PenEnabled() ) - { - return; - } - iEditor->HandlePointerEventL( aPointerEvent ); - } - -// ---------------------------------------------------------------------------- -// CIMCVAppMessageEditor::CountComponentControls -// ---------------------------------------------------------------------------- -// -TInt CIMCVAppMessageEditor::CountComponentControls() const - { - return 2; // iEditor and input frame - } - -// ---------------------------------------------------------------------------- -// CIMCVAppMessageEditor::ComponentControl -// ---------------------------------------------------------------------------- -// -CCoeControl* CIMCVAppMessageEditor::ComponentControl ( TInt aIndex ) const - { - switch(aIndex) - { - case 0: - { - return iInputFrame; - } - case 1: - { - return iEditor; - } - default: - return NULL; - } - } - -// ---------------------------------------------------------------------------- -// CIMCVAppMessageEditor::SizeChanged -// ---------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::SizeChanged() - { - TAknLayoutRect layoutRectTemp; - TAknWindowLineLayout windowLayoutTmp, windowLayoutTmp2; - - windowLayoutTmp = AknLayout::Find_pane_elements_Line_4(); - windowLayoutTmp2 = windowLayoutTmp; - layoutRectTemp.LayoutRect( Rect(), windowLayoutTmp2 ); - iEditor->SetRect( layoutRectTemp.Rect() ); - iInputFrame->SetRect( Rect() ); - } - -// ---------------------------------------------------------------------------- -// CIMCVAppMessageEditor::FocusChanged -// ---------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::FocusChanged( TDrawNow aDrawNow ) - { - iEditor->SetFocus( IsFocused(), aDrawNow ); - } - -// ---------------------------------------------------------------------------- -// CIMCVAppMessageEditor::TextLength -// ---------------------------------------------------------------------------- -// -TInt CIMCVAppMessageEditor::TextLength() const - { - return iEditor->TextLength(); - } - -// ---------------------------------------------------------------------------- -// CIMCVAppMessageEditor::SetTextL -// ---------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::SetTextL( const TDesC& aTxt ) - { - iEditor->SetTextL( &aTxt ); - TInt curPos = TextLength(); - // Cursor to end, no selection. - iEditor->SetSelectionL( curPos, curPos ); - iEditor->DrawNow(); - } - - -// ---------------------------------------------------------------------------- -// CIMCVAppMessageEditor::Editor -// ---------------------------------------------------------------------------- -CEikRichTextEditor& CIMCVAppMessageEditor::Editor() const - { - return *iEditor; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageEditor::SetMessageEditorObserver -// Called to force refresh of editor contents after inserting a smiley -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::SetMessageEditorObserver( MIMCVAppMessageEditorObserver* aObserver ) - { - iEditorObserver = aObserver; - } - -// --------------------------------------------------------------------------- -// CIMCVAppMessageEditor::HandleFindSizeChanged -// --------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::HandleFindSizeChanged() - { - // Lay out Goto Pane as if it was the old Find Pane. - TRect rect; - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane,rect); - TAknWindowLineLayout msgPane=AknLayoutScalable_Avkon::find_pane(); - - - AknLayoutUtils::LayoutControl( this, rect, msgPane ); - - SizeChanged(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageEditor::SetTapObserver -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageEditor::SetTapObserver( MIMCVTapEventObserver* aObserver, TUint aId ) - { - iTapObserver = aObserver; - iTapControlId = aId; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageEditor::MopSupplyObject -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TTypeUid::Ptr CIMCVAppMessageEditor::MopSupplyObject( TTypeUid aId ) - { - if( aId.iUid == MAknsControlContext::ETypeId && iBgContext ) - { - return MAknsControlContext::SupplyMopObject( aId, iBgContext ); - } - return CCoeControl::MopSupplyObject(aId); - } - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappmessageextensionshandler.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappmessageextensionshandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,386 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message extention class -* -*/ - - -#include "cimcvappmessageextensionshandler.h" -#include "cimcvenginefactory.h" -#include -#include -#include "imcvlogger.h" -#include "cimcvappsmileyutil.h" -#include "imcvuiliterals.h" -#include "cimcvengine.h" - - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::CIMCVAppMessageExtensionsHandler -// Constructor -// ----------------------------------------------------------------------------- -// -CIMCVAppMessageExtensionsHandler::CIMCVAppMessageExtensionsHandler( MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, - MIMCVEngineFactory& aEngineFactory ) - :iSkinVariant( aSkinVariant ), - iAppUi( aAppUi ), - iEngineFactory( aEngineFactory ) - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::~CIMCVAppMessageExtensionsHandler -// Destructor -// ----------------------------------------------------------------------------- -// -CIMCVAppMessageExtensionsHandler::~CIMCVAppMessageExtensionsHandler() - { - iExtensionArray.ResetAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::NewL -// Symbian two phased constructor -// ----------------------------------------------------------------------------- -// -CIMCVAppMessageExtensionsHandler* CIMCVAppMessageExtensionsHandler::NewL( - MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, - MIMCVEngineFactory& aEngineFactory, - TBool /*aAddSmileyHandler = ETrue */) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::CIMCVAppMessageExtensionsHandler() start" )); - CIMCVAppMessageExtensionsHandler* self = - new ( ELeave ) CIMCVAppMessageExtensionsHandler(aSkinVariant,aAppUi,aEngineFactory); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::CIMCVAppMessageExtensionsHandler() end" )); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::ConstructL -// Symbian OS Constructor -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageExtensionsHandler::ConstructL() - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ConstructL() start" )); - //get the count of number of services - RPointerArray& serviceEngines = iEngineFactory.GetServiceEngines(); - for(TInt i=0; iServiceId() == aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::CREATE SERVICE SMILEY ALREADY EXISTS" )); - error = KErrAlreadyExists; - break; - } - } - if( error == KErrNone ) - { - CIMCVAppSmileyUtil* smiley = CIMCVAppSmileyUtil::NewL(iSkinVariant, iAppUi, EMessageExtensionSmiley, engine ); - CleanupStack::PushL( smiley ); - User::LeaveIfError( iExtensionArray.Append( smiley )); - CleanupStack::Pop( smiley ); - } - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::HandleNewServiceL() end" )); - } -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::DeleteServiceSmileyL -// Symbian OS Constructor -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageExtensionsHandler::DeleteServiceSmileyL( TInt aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::HandleServiceDeletedL() start" )); - TInt count = iExtensionArray.Count(); - for(TInt i=0; iServiceId() == aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::DELET SMILEY SERVICES" )); - MIMCVAppMessageExtension* smiley = iExtensionArray[ i ]; - iExtensionArray.Remove( i ); - delete smiley; - smiley = NULL; - iExtensionArray.Compress(); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::HandleServiceDeletedL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::ProcessMessageLC -// Process messages trough extensions. -// ----------------------------------------------------------------------------- -// -HBufC* CIMCVAppMessageExtensionsHandler::ProcessMessageLC( - CEikRichTextEditor& aEditor, - TInt aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ProcessMessageLC() start" )); - HBufC* msg = ExtensionToStringLC( aEditor, aServiceId ); - for( TInt a( 0 ); a < iExtensionArray.Count(); ++a ) - { - if( aServiceId == iExtensionArray[a]->ServiceId() ) - { - iExtensionArray[ a ]->Reset( ); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ProcessMessageLC() end" )); - return msg; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::ExtensionToStringL -// Convert extensions to strings. -// ----------------------------------------------------------------------------- -// -HBufC* CIMCVAppMessageExtensionsHandler::ExtensionToStringLC( - CEikRichTextEditor& aEditor, - TInt aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ExtensionToStringLC() start" )); - HBufC* text = HBufC::NewMaxLC(KDefaultMsgLength ); - TPtr tBuf( text->Des() ); - - HBufC* msgBuf = aEditor.GetTextInHBufL(); - if(!msgBuf) - { - tBuf.Zero(); - return text; - } - CleanupStack::PushL( msgBuf ); - TPtr msgPtr( msgBuf->Des() ); - - for( TInt a( 0 ); a < iExtensionArray.Count(); ++a ) - { - if( aServiceId == iExtensionArray[a]->ServiceId() ) - { - tBuf = msgPtr; - iExtensionArray[ a ]->ExtensionToStringL( aEditor, tBuf ); - CleanupStack::PopAndDestroy( msgBuf ); - msgBuf = NULL; - msgBuf = tBuf.AllocLC(); - TPtr newPtr( msgBuf->Des() ); - msgPtr.Set( newPtr ); - break; - } - } - - // Remove all CEditableText::EZeroWidthNoBreakSpace characters - // which are used to go around CRichText editor bug - // when msg contains only smiley pictures - // These rows below can be removed when CRichText editor - // don't need anyrmore this "hack" - tBuf = msgPtr; - - TInt length = tBuf.Length(); - for( TInt i = length-1; i >=0 ; --i ) - { - if( tBuf[ i ] == CEditableText::EZeroWidthNoBreakSpace ) - { - tBuf.Delete( i, 1 ); // removing 1 character - } - } - CleanupStack::PopAndDestroy( msgBuf ); - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ExtensionToStringLC() end" )); - return text; - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::DeleteExtensionIcon -// Find right extension handler and delete extension -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageExtensionsHandler::DeleteExtensionL( CEikRichTextEditor& aEditor, - TInt aServiceId , - TMessageExtensionTypes /*aType*/, - TInt aPos ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::DeleteExtensionL() start" )); - for( TInt a( 0 ); a < iExtensionArray.Count(); ++a ) - { - if( aServiceId == iExtensionArray[a]->ServiceId() ) - { - iExtensionArray[ a ]->DeleteExtensionL( aEditor, aPos ); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::DeleteExtensionL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::ConvertSelectionToExtensionL -// Convert all extensions from strings to extensions in area. -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageExtensionsHandler::ConvertSelectionToExtensionL( - CEikRichTextEditor& aEditor, - TInt aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ConvertSelectionToExtensionL() start" )); - for( TInt a( 0 ); a < iExtensionArray.Count(); ++a ) - { - if( aServiceId == iExtensionArray[a]->ServiceId() ) - { - iExtensionArray[ a ]->ConvertSelectionToExtensionL( aEditor ); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ConvertSelectionToExtensionL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::ConvertSelectionToExtensionL -// Convert all extensions from strings to extensions in area. -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageExtensionsHandler::ConvertSelectionToExtensionL( - CRichText& aRichText, - TCursorSelection& aSelection, - TInt aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ConvertSelectionToExtensionL() start" )); - for( TInt a( 0 ); a < iExtensionArray.Count(); ++a ) - { - if( aServiceId == iExtensionArray[a]->ServiceId() ) - { - iExtensionArray[ a ]->ConvertSelectionToExtensionL( aRichText, aSelection ); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ConvertSelectionToExtensionL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::ConvertSelectionToStringL -// Convert all extensions from extensions to strings in area. -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageExtensionsHandler::ConvertSelectionToStringL( - CEikRichTextEditor& aEditor, - TInt aServiceId, - TBool aPreserve /*= EFalse*/ ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ConvertSelectionToStringL() start" )); - - for( TInt a( 0 ); a < iExtensionArray.Count(); ++a ) - { - if( aServiceId == iExtensionArray[a]->ServiceId() ) - { - iExtensionArray[ a ]->ConvertSelectionToStringL( aEditor, aPreserve ); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ConvertSelectionToStringL() end" )); - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::SizeChanged -// Convert all extensions from extensions to strings in area. -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageExtensionsHandler::SizeChanged( TSize& aSize, - TInt aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::SizeChanged() start" )); - - for( TInt a( 0 ); a < iExtensionArray.Count(); ++a ) - { - if( aServiceId == iExtensionArray[a]->ServiceId() ) - { - iExtensionArray[ a ]->SizeChanged( aSize ); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::SizeChanged() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::ConvertSelectionToStringL -// Convert all extensions from extensions to strings in area. -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageExtensionsHandler::ConvertSelectionToStringL( - CEikRichTextEditor& aEditor, - TInt aServiceId , - TDes& aResultString, - TCursorSelection& aSelectionAfterConversion, - TBool aPreserve ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ConvertSelectionToStringL() start" )); - for( TInt a( 0 ); a < iExtensionArray.Count(); ++a ) - { - if( aServiceId == iExtensionArray[a]->ServiceId() ) - { - iExtensionArray[ a ]->ConvertSelectionToStringL( - aEditor, aResultString, aSelectionAfterConversion, aPreserve ); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppMessageExtensionsHandler::ConvertSelectionToStringL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageExtensionsHandler::InsertExtensionIcon -// Find right extension handler and insert extension -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageExtensionsHandler::InsertExtensionL( CEikRichTextEditor& aEditor, - TInt aServiceId , - TMessageExtensionTypes aType, - TBool& aCancelled, - TSize size) - { - for( TInt a( 0 ); a < iExtensionArray.Count(); ++a ) - { - if( aType == iExtensionArray[ a ]->Type() && aServiceId == iExtensionArray[a]->ServiceId() ) - { - iExtensionArray[ a ]->InsertExtensionL( aEditor, aCancelled, size ); - break; - } - } - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappmessageflowhandler.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappmessageflowhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,416 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Message flow handler class -* -*/ - - -// INCLUDE FILES -#include - -#include "cimcvappmessageflowhandler.h" -#include "mimcvenginemessagecontainer.h" -#include "cimcvenginecontextobserver.h" -#include "mimcvenginemessagesreadinterface.h" -#include "imcvlogger.h" -#include "cimcvappui.h" -#include "cimcvengine.h" -#include "mimcvenginechatinterface.h" - - -// CONSTANTS -const TInt KMilliToMicro = 1000; // multiplier for converting milliseconds to microseconds - -const TInt KTimeIntervalSlow = 2000; // slowest message speed (in milliseconds) -const TInt KTimeIntervalFast = 200; // fastest message speed (in milliseconds) - -const TInt KTimeIntervalOpen = 0; // message fetching speed when opening the view -const TInt KInitialMessages = 3; // fetch n messages at once when opening the view - -const TInt KSettingValueMin = 1; // minimum value for flow control setting -const TInt KSettingValueMax = 3; // maximum value for flow control setting - -const TInt KIMFeatBackgroundGroupOpening = 0x00000008; - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageFlowHandler::CIMCVAppMessageFlowHandler -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppMessageFlowHandler::CIMCVAppMessageFlowHandler( MIMCVEngineMessageContainer& aMessageContainer, - MIMCVEngineMessageReadInterface& aReadInterface,CIMCVEngine& aActiveEngine ) - : CTimer( EPriorityStandard ), - iMessages( aMessageContainer ), - iReadInterface( aReadInterface ), - iActiveEngine( aActiveEngine ), - iFetchMessages( ETrue ) - { - CActiveScheduler::Add( this ); - } - - -// ----------------------------------------------------------------------------- -// CCAMessageFlowHandler::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppMessageFlowHandler* CIMCVAppMessageFlowHandler::NewL( - MIMCVEngineMessageContainer& aMessageContainer, - MIMCVEngineMessageReadInterface& aReadInterface, - CIMCVEngine& aActiveEngine, - TBool aScrollOver ) - { - CIMCVAppMessageFlowHandler* self = new( ELeave ) CIMCVAppMessageFlowHandler( - aMessageContainer, - aReadInterface , - aActiveEngine ); - - CleanupStack::PushL( self ); - self->ConstructL( aScrollOver ); - CleanupStack::Pop( self ); - - return self; - } -// ----------------------------------------------------------------------------- -// CIMCVAppMessageFlowHandler::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageFlowHandler::ConstructL( TBool aScrollOver ) - { - // construct base class - CTimer::ConstructL(); - - // for getting chat interface from CIMCVAPPAppUi - iActiveEngine.ChatInterface().RegisterChatListObserver(this); - - // and observe changes - iReadInterface.SetObserver( this ); - iReadInterface.SetActive(ETrue); - - // fetch flow control value from settings - UpdateTimeIntervalL(); - - if ( aScrollOver ) - { - iBgOpeningMode = EFalse; - } - else - { - iBgOpeningMode = 0 & KIMFeatBackgroundGroupOpening; - } - - // start the timer if there are messages - iInitialMsgCount = iReadInterface.MessageCount(); - if( iInitialMsgCount + iReadInterface.UnreadCount() > 0 ) - { - // lock the buffer - iReadInterface.Lock( ETrue ); - - // use faster timer when constructing - iTimeInterval = KTimeIntervalOpen * KMilliToMicro; - After( iTimeInterval ); - } - } - - -// Destructor -CIMCVAppMessageFlowHandler::~CIMCVAppMessageFlowHandler() - { - // for getting chat interface from CIMCVAPPAppUi - iActiveEngine.ChatInterface().UnregisterChatListObserver(this); - - if ( !iChatDeleted ) - { - iReadInterface.SetActive(EFalse); - iReadInterface.SetObserver( NULL ); - iReadInterface.Lock( EFalse ); - } - Cancel(); - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageFlowHandler::FetchMessages -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageFlowHandler::FetchMessages( TBool aFetch ) - { - TBool reallyInBg = - CCoeEnv::Static()->RootWin().OrdinalPosition() == 0 ? EFalse : ETrue; - - if ( !reallyInBg && !aFetch ) - { - // Application is not really in background, this can happen - // if key lock is activated while application is in foreground - aFetch = ETrue; - } - - iFetchMessages = aFetch; - if( iFetchMessages && !iChatDeleted ) - { - // we're allowed to fetch messages again - if( iReadInterface.UnreadCount() > 0 && !IsActive() ) - { - // there are some unread messages - // => start the timer (if not active already) - After( iTimeInterval ); - } - } - - else if( iMsgIndex < iInitialMsgCount ) - { - Cancel(); - After( iTimeInterval ); - return; - } - else - { - // we're not allowed to fetch new messages any more, so cancel the timer - Cancel(); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageFlowHandler::HandleMessageEvent -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageFlowHandler::HandleMessageEvent( TMessageEventType aEvent, - TInt aIndex ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageFlowHandler::HandleMessageEvent event %d, \ - index %d"), aEvent, aIndex ); - switch( aEvent ) - { - case ENewMessage: - { - if( !IsActive() && iFetchMessages ) - { - // if not active, start timer - After( iTimeInterval ); - } - - if ( IsOpening() && iBgOpeningMode ) - { - // New message during opening phase - iNewMsgWhileOpening = ETrue; - } - - // otherwise do nothing as timer fetches the messages - break; - } - - default: - { - break; - } - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageFlowHandler::RunL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageFlowHandler::RunL() - { - TBool messages( ETrue ); - TBool opening = IsOpening(); - - // If we're opening the view, fetch KInitialMessages at a time, otherwise just one - TInt count( opening ? KInitialMessages : 1 ); - - while( count-- > 0 && messages ) - { - if ( iBgOpeningMode && opening ) - { - // Opening the chat with background message fetching. - // Perform steps in following order: - // 1. Add possible new messages that are received during - // the opening phase to the end of chat normally - // 2. Insert unread messages to the beginning of chat - - if ( iNewMsgWhileOpening && iFetchMessages ) - { - // Add the new message now - iMessages.AddMessageL( iReadInterface.ReadNextUnread() ); - - iNewMsgWhileOpening = EFalse; - } - else if ( iReadInterface.UnreadCount() > 0 && iFetchMessages ) - { - // Insert unread messages, insert in last-to-first order - iAddedUnreadMsgs++; - - iMessages.InsertMessageL( - iReadInterface.ReadUnreadFromIndex( - iReadInterface.MessageCount() - + iReadInterface.UnreadCount() - - iAddedUnreadMsgs ) ); - - - } - - else - { - // Check if the initial speed was active - if ( opening ) - { - UpdateTimeIntervalL(); - } - messages = EFalse; - iReadInterface.Lock( EFalse ); - } - } - else - { - // Functionality in opening in releases 3.1 and earlier - // and normal functionality when the chat is already fully opened - // and new messages are received. - - // Add unread messages in first-to-last order - if ( iReadInterface.UnreadCount() > 0 ) - { - // Add unread messages - iMessages.AddMessageL( iReadInterface.ReadNextUnread() ); - - } - else - { - // Check if the initial speed was active - if ( opening ) - { - UpdateTimeIntervalL(); - } - messages = EFalse; - iReadInterface.Lock( EFalse ); - } - } - } - - // And restart timer if needed - if ( messages ) - { - Cancel(); - After( iTimeInterval ); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageFlowHandler::RunError -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppMessageFlowHandler::RunError( TInt aError ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageFlowHandler::RunError (%d)"), aError ); - - // Something leaved in RunL - if( aError == KErrNoMemory ) - { - // inform user about low memory - CActiveScheduler::Current()->Error( aError ); - } - - if( IsActive() ) - { - // stop processing messages - Cancel(); - } - - return KErrNone; - } - - - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageFlowHandler::UpdateTimeIntervalL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageFlowHandler::UpdateTimeIntervalL() - { - // codescanner warning can be ignored - TInt flowSetting( 10 ); - - // flowSetting is from KSettingValueMin to KSettingValueMax - TInt range( KSettingValueMax - KSettingValueMin ); - TInt newRange( KTimeIntervalFast - KTimeIntervalSlow ); - - // convert it to a range from KTimeIntervalSlow to KTimeIntervalFast - TInt flowSpeed( (flowSetting-KSettingValueMin)*newRange / range ); - - // update the end point - flowSpeed += KTimeIntervalSlow; - - // validate the result - if( flowSpeed > KTimeIntervalSlow ) - { - flowSpeed = KTimeIntervalSlow; - } - - if( flowSpeed < KTimeIntervalFast ) - { - flowSpeed = KTimeIntervalFast; - } - - // and convert from milliseconds to microseconds - iTimeInterval = flowSpeed * KMilliToMicro; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageFlowHandler::IsOpening -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVAppMessageFlowHandler::IsOpening() const - { - return iTimeInterval == - TTimeIntervalMicroSeconds32( KTimeIntervalOpen * KMilliToMicro ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageFlowHandler: HandleChatListEvent -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageFlowHandler::HandleChatListEvent( TInt /*aServiceId*/, TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* /*aContainerInfo*/ - ) - { - - switch (aEvent) - { - case EChatItemAdded: - { - break; - } - - case EChatItemDeleted: - { - iChatDeleted = ETrue; - break; - } - - default: - break; - } - - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappmessagewrapper.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappmessagewrapper.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: wrapper for message container -* -*/ - - - - -// INCLUDE FILES -#include "cimcvappmessagewrapper.h" -#include "mimcvenginemessage.h" -#include "mimcvenginemessagecontainer.h" -#include "imcvlogger.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::CIMCVAppMessageWrapper -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppMessageWrapper::CIMCVAppMessageWrapper( MIMCVEngineMessage& aWrappedMessage - ) - : iMessage( aWrappedMessage ), - iInserted( EFalse ) - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppMessageWrapper* CIMCVAppMessageWrapper::NewL( MIMCVEngineMessage& aWrappedMessage ) - { - IM_CV_LOGS(TXT("CIMCVAppMessageWrapper::NewL() start" )); - CIMCVAppMessageWrapper* self = - new( ELeave ) CIMCVAppMessageWrapper( aWrappedMessage ); - IM_CV_LOGS(TXT("CIMCVAppMessageWrapper::NewL() end" )); - return self; - } - - -// Destructor -CIMCVAppMessageWrapper::~CIMCVAppMessageWrapper() - { - - iHighlights.Reset(); - iTypes.Reset(); - } - - - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::ThumbPos -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection& CIMCVAppMessageWrapper::ThumbPos() - { - return iThumbPosition; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::Selection -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection& CIMCVAppMessageWrapper::Selection() - { - return iSelection; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::WholeSelection -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection& CIMCVAppMessageWrapper::WholeSelection() - { - return iWholeSelection; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::WholeSelection -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection& CIMCVAppMessageWrapper::MessageSelection() - { - return iMessageSelection; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::Highlights -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -RArray& CIMCVAppMessageWrapper::Highlights() - { - return iHighlights; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::HighlightTypes -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -RArray& CIMCVAppMessageWrapper::HighlightTypes() - { - return iTypes; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::Message -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -MIMCVEngineMessage& CIMCVAppMessageWrapper::Message() - { - return iMessage; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::SetInserted -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppMessageWrapper::SetInserted( TBool aInserted ) - { - iInserted = aInserted; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppMessageWrapper::IsInserted -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVAppMessageWrapper::IsInserted() const - { - return iInserted; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvapppicture.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvapppicture.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Picture wrapper for icons and smileys -* -*/ - - -// INCLUDE FILES -#include "cimcvapppicture.h" -#include "fbs.h" -#include -#include "imcvlogger.h" - -_LIT( KPanicText, "Smiley" ); - -// ----------------------------------------------------------------------------- -// CIMCVAppPicture::CIMCVAppPicture -// ----------------------------------------------------------------------------- -// -CIMCVAppPicture::CIMCVAppPicture( MGraphicsDeviceMap& aMap, CGulIcon* aIcon, - TInt aIndex /* = -1 */, TBool aExternalIcon /* = ETrue */) - : iIndex( aIndex ), - iIcon( aIcon ), - iExternalIcon( aExternalIcon ), - iGfxMap( aMap ) - { - __ASSERT_ALWAYS( iIcon, - User::Panic( KPanicText, 1 ) ); - - SetTwips(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppPicture::~CIMCVAppPicture -// ----------------------------------------------------------------------------- -// -CIMCVAppPicture::~CIMCVAppPicture() - { - if ( !iExternalIcon ) - { - delete iIcon; - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppPicture::LineBreakPossible -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVAppPicture::LineBreakPossible( TUint /*aClass*/, - TBool /*aBeforePicture*/, - TBool /*aHaveSpaces*/ ) const - { - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppPicture::Draw -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppPicture::Draw( CGraphicsContext& aGc, - const TPoint& aTopLeft, - const TRect& aClipRect, - MGraphicsDeviceMap* /*aMap*/ ) const - { - IM_CV_LOGS(TXT("CIMCVAppPicture::Draw() start") ); - TSize size( iIcon->Bitmap()->SizeInPixels() ); - CBitmapContext& bc = static_cast( aGc ); - - - aGc.Reset(); - aGc.SetClippingRect( aClipRect ); - - if( iIcon->Mask() ) - { - bc.BitBltMasked( aTopLeft, iIcon->Bitmap(), size, iIcon->Mask(), ETrue ); - } - else - { - bc.BitBlt( aTopLeft, iIcon->Bitmap(), size ); - } - IM_CV_LOGS(TXT("CIMCVAppPicture::Draw() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppPicture::ExternalizeL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppPicture::ExternalizeL( RWriteStream& /*aStream*/ ) const - { - // nothing to be done here - } - -// ----------------------------------------------------------------------------- -// CIMCVAppPicture::GetOriginalSizeInTwips( -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppPicture::GetOriginalSizeInTwips( TSize& aSize ) const - { - IM_CV_LOGS(TXT("CIMCVAppPicture::GetOriginalSizeInTwips() start") ); - if ( iIcon->Bitmap() ) - { - aSize = iIcon->Bitmap()->SizeInTwips(); - - if( aSize.iHeight == 0 || aSize.iWidth == 0 ) - { - SetTwips(); - aSize = iIcon->Bitmap()->SizeInTwips(); - } - } - IM_CV_LOGS(TXT("CIMCVAppPicture::GetOriginalSizeInTwips() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppPicture::Index -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppPicture::Index() const - { - return iIndex; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppPicture::SetTwips -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppPicture::SetTwips() const - { - IM_CV_LOGS(TXT("CIMCVAppPicture::SetTwips() start") ); - TSize sizeP( iIcon->Bitmap()->SizeInPixels() ); - TSize sizeT( iGfxMap.HorizontalPixelsToTwips( sizeP.iWidth ), - iGfxMap.VerticalPixelsToTwips( sizeP.iHeight ) ); - iIcon->Bitmap()->SetSizeInTwips( sizeT ); - - IM_CV_LOGS(TXT("CIMCVAppPicture::SetTwips() end") ); - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvapprichtextcontainer.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvapprichtextcontainer.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2116 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - - - - -// INCLUDE FILES -#include "cimcvapprichtextcontainer.h" -#include "cimcvappmessagewrapper.h" -#include "mimcvapptextview.h" -#include "cimcvappui.h" -#include "mimcvenginemessage.h" -#include "cimcvappmessageextensionshandler.h" - -#include -#include // CRichtText -#include -#include -#include -#include -#include // resourcereader -#include - -#include -#include -#include -#include "imcvlogger.h" -#include "cimcvapppicture.h" -#include -#include "cimcvappsmileiconutility.h" -#include - -// CONSTANTS -const TInt KIMCVHighlightColor = 244; -const TInt KTimeStampMaxLength = 15; // max length of timestamp text -const TInt KUnicodeRLM = 0x200F; // Right-to-Left Mark -const TInt KUnicodeLRM = 0x200E; // Left-to-Right Mark -//Received message maximum length is 400 character, -//this must always be in sync with imconnectionprovider KReceiveMsgMaxLength -const TInt KReceiveMsgMaxLength = 400; -const TInt KMsgMaxLength = 450; //Received message maximum length is 400 character + truncation message -_LIT( KSeparator, ": " ); -_LIT(KSpace, " "); - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::CIMCVAppRichTextContainer -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppRichTextContainer::CIMCVAppRichTextContainer(MIMCVAppUi* aAppUi, - MIMCVAppTextView* aTextView, - CIMCVAppMessageExtensionsHandler* aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - MGraphicsDeviceMap* aMap, - TInt aServiceId, - TBool aScrollOver /*= ETrue*/): - iAppUi(aAppUi), - iTextView( aTextView ), - iItemHighlight( ETrue ), - iHighlightState( ENoHighlight ), - iExtensionsHandler( aExtensionsHandler ), - iScrollOver( aScrollOver ), - iFromMe( aFromMe ), - iToMe( aToMe ), - iMap(aMap), - iServiceId( aServiceId ) - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::Initialize -// Initializes iTextView -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::Initialize( MIMCVAppUi* aAppUi, - MIMCVAppTextView* aTextView, - CIMCVAppMessageExtensionsHandler* aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - MGraphicsDeviceMap* aMap, - TBool aScrollOver /*= ETrue*/ ) - { - iAppUi = aAppUi; - iTextView = aTextView; - iExtensionsHandler = aExtensionsHandler; - iFromMe = aFromMe; - iToMe = aToMe; - iMap = aMap; - iScrollOver = aScrollOver; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::ConstructL(const TDesC& aPrimaryKey) - { - - iPrimaryKey = aPrimaryKey.AllocL(); - - iAppUi->AddLayoutChangeObserver( this ); - iAppUi->AddResourceChangeObserver( this ); - // setup layout - TAknLayoutId layoutId; - CAknEnv::Static()->GetCurrentLayoutId( layoutId ); - - - iPrimaryFont = AknLayoutUtils::FontFromId( EAknLogicalFontPrimaryFont, - NULL ); - iSecondaryFont = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont, - NULL ); - - CParaFormat paraFormat; - TParaFormatMask paraFormatMask; - paraFormat.iLanguage = CAknEnv::Static()->SettingCache().InputLanguage(); - paraFormatMask.SetAttrib( EAttParaLanguage ); - - paraFormat.iFillColor = KRgbWhite; - paraFormatMask.SetAttrib( EAttFillColor ); - - paraFormat.iLeftMarginInTwips = 100; - paraFormat.iIndentInTwips = -100; - paraFormatMask.SetAttrib( EAttLeftMargin ); - paraFormatMask.SetAttrib( EAttIndent ); - - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormat.iFontSpec = iSecondaryFont->FontSpecInTwips(); - charFormatMask.SetAttrib( EAttFontTypeface ); - charFormatMask.SetAttrib( EAttFontHeight ); - - // Text color - TRgb defaultSkinTextColor( KRgbBlack ); - AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - defaultSkinTextColor, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - charFormat.iFontPresentation.iTextColor = defaultSkinTextColor; - charFormatMask.SetAttrib( EAttColor ); - - charFormat.iFontPresentation.iPictureAlignment = - TFontPresentation::EAlignTop; - charFormatMask.SetAttrib( EAttFontPictureAlignment ); - - charFormat.iFontSpec.iFontStyle.SetStrokeWeight( EStrokeWeightNormal ); - charFormatMask.SetAttrib( EAttFontStrokeWeight ); - - - iParaFormatLayer = CParaFormatLayer::NewL( ¶Format, paraFormatMask ); - iCharFormatLayer = CCharFormatLayer::NewL( charFormat, charFormatMask ); - - iRichText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::ConstructL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppRichTextContainer* CIMCVAppRichTextContainer::NewL( MIMCVAppUi* aAppUi, - MIMCVAppTextView* aTextView, - CIMCVAppMessageExtensionsHandler* aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - MGraphicsDeviceMap* aMap, - const TDesC& aPrimaryKey, - TInt aServiceId, - TBool aScrollOver /*= ETrue*/) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::NewL() start" )); - CIMCVAppRichTextContainer* self = new( ELeave ) CIMCVAppRichTextContainer(aAppUi, - aTextView, - aExtensionsHandler, aFromMe, aToMe, aMap,aServiceId, - aScrollOver ); - - CleanupStack::PushL( self ); - self->ConstructL(aPrimaryKey); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::NewL() end" )); - return self; - } - - -// Destructor -CIMCVAppRichTextContainer::~CIMCVAppRichTextContainer() - { - if(iPrimaryKey) - { - delete iPrimaryKey; - iPrimaryKey = NULL; - } - delete iParaFormatLayer; - delete iCharFormatLayer; - delete iRichText; - iMessages.ResetAndDestroy(); - if(iAppUi) - { - iAppUi->RemoveLayoutChangeObserver( this ); - iAppUi->RemoveResourceChangeObserver( this ); - } - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::SelectedItem -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -HBufC* CIMCVAppRichTextContainer::SelectedItemL() - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::SelectedItemL() start" )); - if( iHighlightState == EItemSelected ) - { - TCursorSelection curSel( iMessages[iSelected]->Selection() ); - - // calculate item highlight position - TCursorSelection itemSel( - iMessages[iSelected]->Highlights()[iSelectedItem] ); - - TInt messageStart( curSel.LowerPos() ); - curSel.iAnchorPos = itemSel.iAnchorPos + messageStart; - curSel.iCursorPos = itemSel.iCursorPos + messageStart; - - HBufC* text = HBufC::NewMaxL( curSel.Length() ); - TPtr ptr( text->Des() ); - iRichText->Extract( ptr, curSel.LowerPos(), curSel.Length() ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::SelectedItemL() end" )); - return text; - } - else - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::SelectedItemL() end" )); - return KNullDesC().AllocL(); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::SelectedItemType -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppRichTextContainer::SelectedItemType() - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::SelectedItemType() start" )); - if( (iHighlightState == EItemSelected) && ( iMessages.Count() >0 ) - && (iSelected >= 0 ) ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::SelectedItemType() end" )); - - return iMessages[iSelected]->HighlightTypes()[iSelectedItem]; - } - else - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::SelectedItemType() end" )); - return KErrNotFound; - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::RichText -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -MLayDoc* CIMCVAppRichTextContainer::TextLayout() - { - return iRichText; - } -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::RichText -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppRichTextContainer::ServiceId() const - { - return iServiceId; - } -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::SetItemHighlight -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::SetItemHighlight( TBool aItemHighlight ) - { - iItemHighlight = aItemHighlight; - TInt richTextDocumentLength = iRichText->DocumentLength(); - if (!richTextDocumentLength) - return; - - if (aItemHighlight) - { - HBufC* text = HBufC::NewMaxLC( richTextDocumentLength ); - TPtr txt( text->Des() ); - - iRichText->Extract( txt); - CFindItemEngine* findItem = CFindItemEngine::NewL( txt, - CFindItemEngine::TFindItemSearchCase( - CFindItemEngine::EFindItemSearchPhoneNumberBin | - CFindItemEngine::EFindItemSearchMailAddressBin | - CFindItemEngine::EFindItemSearchURLBin/* | - CFindItemEngine::EFindItemSearchScheme*/ ) - ); - - CleanupStack::PushL( findItem ); - const CArrayFixFlat* items = findItem->ItemArray(); - TInt count( items->Count() ); - - for( TInt i(0); iAt(i); - - // selection in rich text - TCursorSelection realSel( item.iStartPos + item.iLength, item.iStartPos ); - - HighLightItemL( realSel ); - } - - CleanupStack::PopAndDestroy( findItem ); - CleanupStack::PopAndDestroy( text); - - } - else - { - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormatMask.SetAttrib( EAttFontUnderline ); - - charFormat.iFontPresentation.iUnderline = EUnderlineOff; - - iRichText->ApplyCharFormatL ( charFormat, charFormatMask, 0, richTextDocumentLength); - } - } -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::MoveHighlightL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppRichTextContainer::MoveHighlightL( THighlightMovement aDirection ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::MoveHighlightL() start" )); - TBool up( aDirection == EPrevious ); - TInt messageCount( iMessages.Count() ); - if( messageCount == 0 ) - { - // no messages, nothing to highlight - //but make highlight state as EMessageBottom - //so that tabs can be switched when there is no conversation in text container. - if(iHighlightState == EMessageBottom) - { - iHighlightState = ENoHighlight; - } - else - { - iHighlightState = EMessageBottom; - } - return KErrNone; - } - - - TInt highlightCount( iMessages[iSelected]->Highlights().Count() ); - - if( !iItemHighlight ) - { - // if item highlighting is not on, clear the item count - highlightCount = 0; - } - - // if message is highlighted, but it doesn't fit to screen - // scroll it line by line - if( iHighlightState == EMessageTop || iHighlightState == EMessageBottom ) - { - TCursorSelection& sel = iMessages[iSelected]->Selection(); - if( up ) - { - // up - if( !iTextView->IsVisible( sel.LowerPos() ) ) - { - // we're scrolling up and top line is not shown, - // so scroll messages down by one line - iTextView->ScrollLinesL( 1 ); - return KErrNone; - } - } - else if( !iTextView->IsVisible( sel.HigherPos() ) ) - { - // we're scrolling down and bottom line is not shown, - // so scroll messages up by one line - iTextView->ScrollLinesL( -1 ); - return KErrNone; - } - } - - // update highlight position - switch( iHighlightState ) - { - case ENoHighlight: // no highlight, select last or first message - { - if( up ) - { - iSelected = messageCount - 1; - - // Get highlight count of prev message - // if item highlighting is on - if ( iItemHighlight ) - { - highlightCount = iMessages[iSelected]->Highlights().Count(); - } - - if ( highlightCount > 0 ) - { - // highlight items inside last message (if any) - iHighlightState = EItemSelected; - iSelectedItem = highlightCount - 1; - } - else - { - // bottom of last message - iHighlightState = EMessageBottom; - } - } - else - { - // top of first message - iHighlightState = EMessageTop; - iSelected = 0; - } - break; - } - case EItemSelected: // highlighting items - { - if( up ) - { - // up, previous item - --iSelectedItem; - if( iSelectedItem < 0 ) - { - // end of highlights, focus message - iHighlightState = EMessageTop; - } - } - else - { - // down, next item - ++iSelectedItem; - if( iSelectedItem >= highlightCount ) - { - // end of highlights - if ( iSelected < messageCount - 1 ) - { - // focus next message - ++iSelected; - iHighlightState = EMessageTop; - } - else if ( iScrollOver ) - { - // going down from last message, - // disable highlight so editor can take the focus - DisableHighlightL(); - return KErrNone; - } - else - { - // Loop back to beginning - iSelected = 0; - iSelectedItem = 0; - iHighlightState = EMessageTop; - } - - } - } - break; - } - case EMessageTop: // highlighting message ("top" of it) - { - if( up ) - { - // up, highlighting previous message - if( iSelected > 0 ) - { - // prev - --iSelected; - - // get highlight count of prev message - // if item highlighting is on - if ( iItemHighlight ) - { - highlightCount = iMessages[iSelected]->Highlights().Count(); - } - - if ( highlightCount > 0 ) - { - // highlight items inside prev message (if any) - iHighlightState = EItemSelected; - iSelectedItem = highlightCount - 1; - } - else - { - // highlight whole prev message - iHighlightState = EMessageBottom; - } - } - else if ( iScrollOver ) - { - // going up from first message, - // disable highlight, so editor can take the focus - DisableHighlightL(); - return KErrNone; - } - else - { - // Loop to last message - iSelected = messageCount-1; - highlightCount = 0; - - // Get highlight count of last message - // if item highlighting is on - if ( iItemHighlight ) - { - highlightCount = - iMessages[iSelected]->Highlights().Count(); - } - - if ( highlightCount > 0 ) - { - // Highlight items inside last message (if any) - iHighlightState = EItemSelected; - iSelectedItem = highlightCount - 1; - } - else - { - // Highlight whole last message - iHighlightState = EMessageBottom; - } - } - } - else - { - // down, highlight items inside this message (if any) - if( highlightCount > 0 ) - { - iSelectedItem = 0; - iHighlightState = EItemSelected; - } - else if( iSelected < messageCount-1 ) - { - // next - ++iSelected; - iHighlightState = EMessageTop; - } - else if( iScrollOver ) - { - // going down from last message, - // disable highlight, so editor can take the focus - DisableHighlightL(); - return KErrNone; - } - else - { - // Loop back to beginning - iSelected = 0; - iSelectedItem = 0; - iHighlightState = EMessageTop; - } - } - break; - } - case EMessageBottom: // highlighting message ("bottom" of it) - { - if( up ) - { - // up, highlight items inside this message (if any) - if( highlightCount > 0 ) - { - iSelectedItem = highlightCount-1; - iHighlightState = EItemSelected; - } - else if( iSelected > 0 ) - { - // prev - --iSelected; - - // get highlight count of prev message - // if item highlighting is on - if ( iItemHighlight ) - { - highlightCount = iMessages[iSelected]->Highlights().Count(); - } - - if ( highlightCount > 0 ) - { - // highlight items inside prev message (if any) - iHighlightState = EItemSelected; - iSelectedItem = highlightCount - 1; - } - else - { - iHighlightState = EMessageBottom; - } - } - else if( iScrollOver ) - { - // going up from first message, - // disable highlight, so editor can take the focus - DisableHighlightL(); - return KErrNone; - } - else - { - // Loop to last message - iSelected = messageCount-1; - highlightCount = 0; - - // Get highlight count of last message - // if item highlighting is on - if ( iItemHighlight ) - { - highlightCount = - iMessages[iSelected]->Highlights().Count(); - } - - if ( highlightCount > 0 ) - { - // Highlight items inside last message (if any) - iHighlightState = EItemSelected; - iSelectedItem = highlightCount - 1; - } - else - { - // Highlight whole last message - iHighlightState = EMessageBottom; - } - } - } - else - { - // down, highlighting next message - if( iSelected < messageCount-1 ) - { - // next - ++iSelected; - iHighlightState = EMessageTop; - } - else if( iScrollOver ) - { - // going down from last message, - // disable highlight, so editor can take the focus - DisableHighlightL(); - return KErrNone; - } - else - { - // Loop back to beginning - iSelected = 0; - iSelectedItem = 0; - iHighlightState = EMessageTop; - } - } - break; - } - default: - { - - break; - } - } - - // get the selection - TCursorSelection curSel( CurrentSelection() ); - - // remove colors from old highlight - TInt textLen( iRichText->DocumentLength() ); - if( iPrevious.iAnchorPos < textLen && - iPrevious.iCursorPos <= textLen ) - { - BackColorL( iPrevious, KRgbWhite ); - TextBackColorL( iPrevious, KRgbWhite ); - } - - // and set new one - if ( iHighlightState == EItemSelected ) - { - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - TRgb color; - - TInt error = AknsUtils::GetCachedColor( skin, - color, - KAknsIIDQsnHighlightColors, - EAknsCIQsnHighlightColorsCG2 ); - - if ( !error ) - { - // No error, use skinned background color - TextBackColorL( curSel, color ); - } - else - { - TextBackColorL( curSel, AKN_LAF_COLOR_STATIC( KIMCVHighlightColor ) ); - } - } - else - { - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - TRgb color; - - TInt error = AknsUtils::GetCachedColor( skin, - color, - KAknsIIDQsnHighlightColors, - EAknsCIQsnHighlightColorsCG2 ); - - if ( !error ) - { - // No error, use skinned background color - BackColorL( curSel, color ); - } - else - { - BackColorL( curSel, AKN_LAF_COLOR_STATIC( KIMCVHighlightColor ) ); - } - } - - // handle changed format - TCursorSelection changed( Union( iPrevious, curSel ) ); - - - iTextView->HandleFormatChangedL( changed, ETrue ); - - iTextView->ScrollVisibleL( curSel, ETrue ); - - iPrevious = curSel; - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::MoveHighlightL() end" )); - return KErrNone; - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::DisableHighlightL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::DisableHighlightL() - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::DisableHighlightL() start" )); - iHighlightState = ENoHighlight; - - TCursorSelection sel( 0,0 ); - TInt count( iMessages.Count() ); - if( count > 0 ) - { - sel = iMessages[count-1]->Selection(); - } - - // remove colors from old highlight (if any) - TInt textLen( iRichText->DocumentLength() ); - if( iPrevious.iAnchorPos < textLen && - iPrevious.iCursorPos <= textLen ) - { - BackColorL( iPrevious, KRgbWhite ); - TextBackColorL( iPrevious, KRgbWhite ); - iTextView->HandleFormatChangedL( iPrevious ); - } - - // set focus to last message - iTextView->ScrollVisibleL( sel, EFalse ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::DisableHighlightL() end" )); - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::Highlighted -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVAppRichTextContainer::Highlighted() - { - return iHighlightState != ENoHighlight; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::Highlighted -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppRichTextContainer::HighlightItemAtPosL( TInt aPos ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::HighlightItemAtPosL() start" )); - TInt messagecount = iMessages.Count(); - if( messagecount == 0 ) - { - // no messages - return KErrNotFound; - } - - // Store old values - TInt oldSelectedMessage = iSelected; - TInt oldSelectedItem = iSelectedItem; - THighlightState oldHighlight = iHighlightState; - - // Find message in position aPos - TBool found = EFalse; - for( TInt i = 0; i < messagecount; ++i ) - { - TCursorSelection sel = iMessages[ i ]->WholeSelection(); - if( aPos >= sel.LowerPos() && - aPos <= sel.HigherPos() ) - { - // Found the message - iSelected = i; - iHighlightState = EMessageTop; - found = ETrue; - // stop searching - break; - } - } - - if( !found ) - { - // not found - return KErrNotFound; - } - - // Check if there are items inside the message that can be highlighted. - if( iItemHighlight ) - { - TInt hlCount = iMessages[ iSelected ]->Highlights().Count(); - TInt relativePos = - aPos - iMessages[ iSelected ]->WholeSelection().LowerPos(); - - for( TInt i = 0; i < hlCount; ++i ) - { - TCursorSelection sel = iMessages[ iSelected ]->Highlights()[ i ]; - - // Highlight's selection is relative to message - if( relativePos >= sel.LowerPos() && - relativePos <= sel.HigherPos() ) - { - // Found an item - iHighlightState = EItemSelected; - iSelectedItem = i; - // stop searching - break; - } - } - } - - // Update UI only if selection has changed - if( iSelected != oldSelectedMessage || - iSelectedItem != oldSelectedItem || - oldHighlight != iHighlightState ) - { - UpdateSelectionL(); - return KErrNone; - } - // Already highlighted - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::HighlightItemAtPosL() end" )); - return KErrAlreadyExists; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::UpdateSelection -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::UpdateSelectionL() - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::UpdateSelectionL() start" )); - // get the selection - TCursorSelection curSel( CurrentSelection() ); - - // remove colors from old highlight - TInt textLen( iRichText->DocumentLength() ); - if( iPrevious.iAnchorPos < textLen && - iPrevious.iCursorPos <= textLen ) - { - BackColorL( iPrevious, KRgbWhite ); - TextBackColorL( iPrevious, KRgbWhite ); - } - - // and set new one - if ( iHighlightState == EItemSelected ) - { - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - TRgb color; - - TInt error = AknsUtils::GetCachedColor( skin, - color, - KAknsIIDQsnHighlightColors, - EAknsCIQsnHighlightColorsCG2 ); - - if ( !error ) - { - // No error, use skinned background color - TextBackColorL( curSel, color ); - } - else - { - TextBackColorL( curSel, AKN_LAF_COLOR_STATIC( KIMCVHighlightColor ) ); - } - } - else - { - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - TRgb color; - - TInt error = AknsUtils::GetCachedColor( skin, - color, - KAknsIIDQsnHighlightColors, - EAknsCIQsnHighlightColorsCG2 ); - - if ( !error ) - { - // No error, use skinned background color - BackColorL( curSel, color ); - } - else - { - BackColorL( curSel, AKN_LAF_COLOR_STATIC( KIMCVHighlightColor ) ); - } - } - - // handle changed format - TCursorSelection changed( Union( iPrevious, curSel ) ); - - iTextView->HandleFormatChangedL( changed ); - iTextView->ScrollVisibleL( curSel, ETrue ); - - - iPrevious = curSel; - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::UpdateSelectionL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::InsertTimeStampL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection CIMCVAppRichTextContainer::InsertTimeStampL( - CIMCVAppMessageWrapper& aMessageWrapper ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::InsertTimeStampL() start" )); - TInt start = 0; - TCursorSelection timeSel( start, start ); - - - // format time - HBufC* timeStamp = HBufC::NewLC( KTimeStampMaxLength + KSpace().Length() ); - TPtr timePtr( timeStamp->Des() ); - - HBufC* timeStampFormat = NULL; - timeStampFormat = StringLoader::LoadLC( R_QTN_TIME_USUAL_WITH_ZERO ); - - TTime time = aMessageWrapper.Message().TimeStamp(); - TRAPD( err, time.FormatL( timePtr, *timeStampFormat ) ); - if ( err == KErrOverflow ) - { - // Reserved text space was not enough. - // Adjust the KTimeStampMaxLength! - - - // in release builds return without timestamp - CleanupStack::PopAndDestroy( 2, timeStamp ); // timeStamp, timeStampFormat - return timeSel; - } - - // Convert numbers to local language - AknTextUtils::LanguageSpecificNumberConversion( timePtr ); - - // Set Alignment of Pm/Am from local setting - // This keeps the am/pm text close to the time. - timePtr.Append( AknLayoutUtils::LayoutMirrored() ? - KUnicodeRLM : KUnicodeLRM ); - // append time to rich text - timePtr.Append( KSpace ); - iRichText->InsertL( start, timePtr ); - - CleanupStack::PopAndDestroy( 2, timeStamp ); // timeStamp, timeStampFormat - timeSel.SetSelection( start, timePtr.Length() - 1 ); - - // bold the time - if ( timeSel.Length() > 0 ) - { - BoldL( timeSel ); - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::InsertTimeStampL() end" )); - return timeSel; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::InsertContentL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppRichTextContainer::InsertContentL( CIMCVAppMessageWrapper& aMessageWrapper ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::InsertContentL() start" )); - MIMCVEngineMessage& message = aMessageWrapper.Message(); - - MIMCVEngineMessage::TContentType type( message.ContentType() ); - switch( type ) - { - case MIMCVEngineMessage::EContentText: - { - TInt oldLen = iRichText->DocumentLength(); - - // Insert text - TPtrC msg( message.Text() ); - - HBufC* tempMsg = NULL; - - TInt paraBreak = msg.Locate( CEditableText::EParagraphDelimiter ); - // Replace all paragraph delimiters with line breaks - // to keep alingment consistent - if ( paraBreak != KErrNotFound ) - { - tempMsg = msg.AllocLC(); - TPtr ptr( tempMsg->Des() ); - ptr.Zero(); - - ReplaceParaDelimsWithLineBreaks( msg, ptr ); - msg.Set( ptr ); - } - - HBufC* numberConv = NULL; - - // Convert numerals to local language - // 1) date item - if ( aMessageWrapper.Message().SystemMessageType() == - MIMCVEngineMessage::ESystemMessageDateChange ) - { - // Don't touch the original message - numberConv = msg.AllocLC(); - TPtr ptr( numberConv->Des() ); - AknTextUtils::LanguageSpecificNumberConversion( ptr ); - msg.Set( ptr ); - } - - iRichText->InsertL( 0, msg ); - - TInt textEnd = msg.Length(); - - // Check for extensions (smileys) - TCursorSelection selection( 0, textEnd ); - TInt bfrConv = iRichText->DocumentLength(); - iExtensionsHandler->ConvertSelectionToExtensionL( *iRichText, - selection, - iServiceId ); - - // Move textEnd index if extensions were found - textEnd -= ( bfrConv - iRichText->DocumentLength() ); - - // Add nbs to preserve formatting - iRichText->InsertL( textEnd, - CEditableText::EZeroWidthNoBreakSpace ); - - // If this is system message, it should be bold - if( message.MessageType() == MIMCVEngineMessage::EMessageSystem ) - { - TCursorSelection sel( 0, textEnd ); - BoldL( sel ); - // System messages need different kind of alignment - CParaFormat paraFormat; - TParaFormatMask paraFormatMask; - paraFormat.iLeftMarginInTwips = 0; - paraFormatMask.SetAttrib( EAttLeftMargin ); - iRichText->ApplyParaFormatL( ¶Format, paraFormatMask, - 0, textEnd + 1 ); - } - else - { - // Apply alignment for "normal" messages - CParaFormat paraFormat; - TParaFormatMask paraFormatMask; - paraFormat.iLeftMarginInTwips = 100; - paraFormatMask.SetAttrib( EAttLeftMargin ); - iRichText->ApplyParaFormatL( ¶Format, paraFormatMask, - 0, textEnd + 1 ); - - // Remove bolding from message content - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormat.iFontSpec.iFontStyle.SetStrokeWeight( EStrokeWeightNormal ); - charFormatMask.SetAttrib( EAttFontStrokeWeight ); - iRichText->ApplyCharFormatL( charFormat, charFormatMask, - 0, textEnd + 1 ); - } - - // Cleanup - if ( numberConv ) - { - CleanupStack::PopAndDestroy( numberConv ); - } - if ( tempMsg ) - { - CleanupStack::PopAndDestroy( tempMsg ); - } - - return iRichText->DocumentLength() - oldLen; - } - default: - { - // Unsupported type - - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::InsertContentL() end" )); - return 0; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::InsertNickL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection CIMCVAppRichTextContainer::InsertNickL( - CIMCVAppMessageWrapper& aMessageWrapper ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::InsertNickL() start" )); - // insert nick - MIMCVEngineMessage& message = aMessageWrapper.Message(); - TPtrC sender; - TPtrC recipient; - if ( message.MessageType() == MIMCVEngineMessage::EMessageGroup || - message.MessageType() == MIMCVEngineMessage::EMessageWhisper ) - { - sender.Set( message.Sender() ); - recipient.Set( message.Recipient() ); - } - - TCursorSelection nickSel( 0,0 ); - - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::InsertNickL() end" )); - return nickSel; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::LayoutChangedL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::LayoutChangedL( TInt aType) - { - #if 0 - //if layout change.. then dont update skin text color. - if (aType == KAknsMessageSkinChange) - { - UpdateSkinnedTextColourL(); - } - #endif - } - -// ----------------------------------------------------------------------------- -// CCARichTextContainer::ResourceChangedL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::ResourceChangedL() - { - // When resource changes (branding): - // clear content, so that old pictures don't cause any problems. - // we are reloaded anyway. - iRichText->DeleteL( 0, iRichText->DocumentLength() ); - iTextView->HandleGlobalChangeNoRedrawL(); - } -// CIMCVAppRichTextContainer::AddMessageL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::AddMessageL( MIMCVEngineMessage& aMessage ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::AddMessageL() start" )); - if( !iShowTimeStamps && - aMessage.SystemMessageType() == MIMCVEngineMessage::ESystemMessageDateChange ) - { - // if timestamp setting is OFF we don't show day change items - return; - } - - TInt oldCount = iMessages.Count(); - - // create wrapper - CIMCVAppMessageWrapper* wrapper = CIMCVAppMessageWrapper::NewL( aMessage ); - - CleanupStack::PushL( wrapper ); - iMessages.AppendL( wrapper ); // takes the ownership - CleanupStack::Pop( wrapper ); - - - // start new paragraph - TInt lineStart = iRichText->DocumentLength(); - if( lineStart != 0 ) - { - iRichText->InsertL( lineStart, CEditableText::EParagraphDelimiter ); - } - - // Set Alignment from local layout - iRichText->InsertL( iRichText->DocumentLength(), - AknLayoutUtils::LayoutMirrored() ? KUnicodeRLM : KUnicodeLRM ); - - // add message to rich text - TInt startPos( iRichText->DocumentLength() ); - TCursorSelection timeSel = AddTimeStampL( *wrapper ); - TCursorSelection nickSel = AddNickL( *wrapper ); - AddContentL( startPos, *wrapper ); - TInt endPos( iRichText->DocumentLength() ); - - // set selection for highlight and the whole selection - // (so that this can be removed) - // append deletioncount to new messages - wrapper->Selection().SetSelection( endPos - 1, startPos ); - wrapper->WholeSelection().SetSelection( endPos, lineStart ); - wrapper->MessageSelection().SetSelection( endPos - 1, nickSel.HigherPos() ); - - - // append coloring - TCursorSelection& sel = iColorWholeMessage ? wrapper->Selection() : nickSel; - TInt len( sel.Length() ); - - - // Make sure the background (highlight) is not copied from - // previous message. - BackColorL( sel, KRgbWhite ); - TextBackColorL( sel, KRgbWhite ); - - if( len > 0 && - aMessage.MessageType() != MIMCVEngineMessage::EMessageSystem ) - { - // custom colors - if( aMessage.MessagerType() == MIMCVEngineMessage::EMessageSent ) - { - // own msg - if( iOwnMsgColorInUse ) - { - TextColorL( sel, iOwnMsgColor ); - } - } - else if( aMessage.MessagerType() == MIMCVEngineMessage::EMessageReceived ) - { - // other msg - if( iMsgColorInUse ) - { - TextColorL( sel, iMsgColor ); - } - } - } - -#ifdef RD_30_COMPATIBILITY_MODE - if( lineStart == 0 ) - { - // This is needed only in 3.0 backport so that the alignment - // character doesn't cause a virtual linebreak. - TRAP_IGNORE( iTextView->HandleFormatChangedL( - wrapper->WholeSelection() ) ); - } -#endif // RD_30_COMPATIBILITY_MODE - - // inform of inserted rich text - TCursorSelection curSel( CurrentSelection() ); - TRAPD( error, iTextView->HandleAdditionL( lineStart == 0, curSel, EFalse ) ); - if( error != KErrNone ) - { - - // Remove failed text - TCursorSelection del = wrapper->WholeSelection(); - iRichText->DeleteL( del.LowerPos(), del.Length() ); - - // Remove the failed wrapper and leave - TInt index = iMessages.Find( wrapper ); - if( index != KErrNotFound ) - { - delete wrapper; - iMessages.Remove( index ); - } - - // Try to handle changes once more - TRAPD( updateErr, iTextView->HandleGlobalChangeNoRedrawL() ); - if( !updateErr ) - { - TCursorSelection curSel( CurrentSelection() ); - TRAP_IGNORE( iTextView->ScrollVisibleL( curSel, EFalse ) ); - } - User::Leave( error ); - } - - // and scroll (unless in highlight-mode) - if( iHighlightState == ENoHighlight ) - { - TCursorSelection curSel( CurrentSelection() ); - iTextView->ScrollVisibleL( curSel, EFalse ); - - // If this is recorded chat container (iScrollOver == EFalse) - // and added message was first move highlight - // so we have focus on the topmost item. - if ( oldCount == 0 && !iScrollOver ) - { - MoveHighlightL( ENext ); - } - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::AddMessageL() end" )); - } - - - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::InsertMessageL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::InsertMessageL( MIMCVEngineMessage& aMessage ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::InsertMessageL() start" )); - if ( !iShowTimeStamps && - aMessage.SystemMessageType() == MIMCVEngineMessage::ESystemMessageDateChange ) - { - // if timestamp setting is OFF we don't show day change items - return; - } - - // create wrapper - CIMCVAppMessageWrapper* wrapper = CIMCVAppMessageWrapper::NewL( aMessage ); - - CleanupStack::PushL( wrapper ); - iMessages.InsertL( wrapper, 0 ); // takes the ownership - CleanupStack::Pop( wrapper ); - - - TInt oldLen = iRichText->DocumentLength(); - - // Insert paragraph break if this is not the last message - TInt paraBreak = 0; - if ( iMessages.Count() > 1 ) - { - iRichText->InsertL( 0, CEditableText::EParagraphDelimiter ); - paraBreak = 1; - } - - // Insert message to rich text in reverse order compared to adding - TInt contentLen = InsertContentL( *wrapper ); - TCursorSelection nickSel = InsertNickL( *wrapper ); - TCursorSelection timeSel = InsertTimeStampL( *wrapper ); - - // Set Alignment from local layout - TInt dirChrLen = iRichText->DocumentLength(); - iRichText->InsertL( 0, AknLayoutUtils::LayoutMirrored() ? - KUnicodeRLM : KUnicodeLRM ); - dirChrLen = iRichText->DocumentLength() - dirChrLen; - - wrapper->SetInserted( ETrue ); - - // Update timestamp selection - timeSel.iAnchorPos += dirChrLen; - timeSel.iCursorPos += dirChrLen; - // Update nick selection - nickSel.iAnchorPos += timeSel.HigherPos(); - nickSel.iCursorPos += timeSel.HigherPos(); - // Update thumb pos - TCursorSelection& thumbPos = wrapper->ThumbPos(); - thumbPos.iAnchorPos += nickSel.HigherPos() + KSeparator().Length(); - thumbPos.iCursorPos += nickSel.HigherPos() + KSeparator().Length(); - - TInt addedLen = iRichText->DocumentLength() - oldLen; - - // parse text for highlights and store positions to messagewrapper - HBufC* text = HBufC::NewMaxLC( contentLen ); - TPtr txt( text->Des() ); - iRichText->Extract( txt, - nickSel.HigherPos() + KSeparator().Length() + 1, // Don't extract separator and space - contentLen ); - ParseTextL( txt, nickSel.HigherPos() + KSeparator().Length() + 1, - nickSel.HigherPos() + KSeparator().Length() + 1, *wrapper ); - CleanupStack::PopAndDestroy( text ); - - // Set selection for highlight and the whole selection - // so that this message can be removed - wrapper->Selection().SetSelection( addedLen - 1 - paraBreak, 0 ); - wrapper->WholeSelection().SetSelection( addedLen - 1, 0 ); - wrapper->MessageSelection().SetSelection( addedLen - 1, - nickSel.HigherPos() + 1 ); - - if ( iHighlightState != ENoHighlight ) - { - BackColorL( wrapper->WholeSelection(), KRgbWhite ); - TextBackColorL( wrapper->WholeSelection(), KRgbWhite ); - } - - // Update wrappers after this if there is any - if ( iMessages.Count() > 1 ) - { - UpdateWrappers( 1, addedLen ); - } - - // Append coloring - TCursorSelection& sel = iColorWholeMessage ? wrapper->Selection() : nickSel; - TInt len( sel.Length() ); - - if ( len > 0 && - aMessage.MessageType() != MIMCVEngineMessage::EMessageSystem ) - { - // Custom colors - if ( aMessage.MessagerType() == MIMCVEngineMessage::EMessageSent ) - { - // Own msg - if( iOwnMsgColorInUse ) - { - TextColorL( sel, iOwnMsgColor ); - } - } - else if ( aMessage.MessagerType() == MIMCVEngineMessage::EMessageReceived ) - { - // Other msg - if( iMsgColorInUse ) - { - TextColorL( sel, iMsgColor ); - } - } - } - - // Inform of inserted rich text - TInt error = KErrNone; - if ( oldLen == 0 ) - { - TCursorSelection curSel( CurrentSelection() ); - // First message inserted, format the whole text - TRAP( error, iTextView->HandleAdditionL( ETrue, curSel, EFalse ) ); - } - else - { - TCursorSelection curSel( CurrentSelection() ); - // There might be a faster method to handle text addition, but - // this works for now. - TRAP( error, iTextView->HandleAdditionL( ETrue, curSel, EFalse) ); - } - // And scroll (unless in highlight-mode) - if ( iHighlightState == ENoHighlight ) - { - TCursorSelection curSel( CurrentSelection() ); - iTextView->ScrollVisibleL( curSel, EFalse ); - } - else - { - // In highlight mode, message inserted -> increase selected - // message index and previous selection indexes - iSelected++; - iPrevious.iAnchorPos += addedLen; - iPrevious.iCursorPos += addedLen; - - TCursorSelection curSel( CurrentSelection() ); - iTextView->ScrollVisibleL( curSel, EFalse ); - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::InsertMessageL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::UpdateWrappers -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::UpdateWrappers( TInt aFirstIndex, TInt aChange ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::UpdateWrappers() start" )); - TInt count( iMessages.Count() ); - for( TInt i( aFirstIndex ); iSelection(); - TCursorSelection& wholeSelection = wrapper->WholeSelection(); - TCursorSelection& thumbPos = wrapper->ThumbPos(); - selection.iAnchorPos += aChange; - selection.iCursorPos += aChange; - wholeSelection.iAnchorPos += aChange; - wholeSelection.iCursorPos += aChange; - thumbPos.iAnchorPos += aChange; - thumbPos.iCursorPos += aChange; - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::UpdateWrappers() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::Union -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection CIMCVAppRichTextContainer::Union( const TCursorSelection& aSel1, - const TCursorSelection& aSel2 ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::Union() start" )); - // make union of selections - TCursorSelection changed; - changed.iAnchorPos = aSel1.LowerPos(); - changed.iCursorPos = aSel1.HigherPos(); - - TInt low( aSel2.LowerPos() ); - TInt high( aSel2.HigherPos() ); - if( low < changed.iAnchorPos ) - { - changed.iAnchorPos = low; - } - if( high > changed.iCursorPos ) - { - changed.iCursorPos = high; - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::Union() end" )); - return changed; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::CurrentSelection -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection CIMCVAppRichTextContainer::CurrentSelection() const - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::CurrentSelection() start" )); - TCursorSelection sel( 0,0 ); - if( iHighlightState == ENoHighlight ) - { - // if nothing highlighted, return last message - TInt count( iMessages.Count() ); - if( count > 0 ) - { - sel = iMessages[count-1]->Selection(); - } - } - else - { - // something highlighted, start with current message - sel = iMessages[iSelected]->Selection(); - - // check if the highlighted selection is item inside message - if( iHighlightState == EItemSelected ) - { - // calculate item highlight position - TCursorSelection itemSel( - iMessages[iSelected]->Highlights()[iSelectedItem] ); - - TInt messageStart( sel.LowerPos() ); - sel.iAnchorPos = itemSel.iAnchorPos + messageStart; - sel.iCursorPos = itemSel.iCursorPos + messageStart; - } - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::CurrentSelection() end" )); - return sel; - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::TextBackColorL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::TextBackColorL( const TCursorSelection& aSel, - const TRgb& aColor ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::TextBackColorL() start" )); - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormatMask.SetAttrib( EAttFontHighlightColor ); - charFormatMask.SetAttrib( EAttFontHighlightStyle ); - - charFormat.iFontPresentation.iHighlightColor = aColor; - charFormat.iFontPresentation.iHighlightStyle = aColor == KRgbWhite ? - TFontPresentation::EFontHighlightNone : - TFontPresentation::EFontHighlightNormal; - - iRichText->ApplyCharFormatL( charFormat, charFormatMask, - aSel.LowerPos(), - aSel.Length() ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::TextBackColorL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::TextColorL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::TextColorL( const TCursorSelection& aSel, - const TRgb& aColor ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::TextColorL() start" )); - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormatMask.SetAttrib( EAttColor ); - charFormat.iFontPresentation.iTextColor = aColor; - - iRichText->ApplyCharFormatL( charFormat, charFormatMask, - aSel.LowerPos(), - aSel.Length() ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::TextColorL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::BackColorL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::BackColorL( const TCursorSelection& aSel, - const TRgb& aColor ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::BackColorL() start" )); - CParaFormat paraFormat; - TParaFormatMask paraFormatMask; - paraFormatMask.SetAttrib( EAttFillColor ); - - paraFormat.iFillColor = aColor; - iRichText->ApplyParaFormatL( ¶Format, paraFormatMask, - aSel.LowerPos(), - aSel.Length() ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::BackColorL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::HighLightItemL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::HighLightItemL( const TCursorSelection& aSel ) - { - - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormatMask.SetAttrib( EAttFontUnderline ); - - charFormat.iFontPresentation.iUnderline = EUnderlineOn; - - iRichText->ApplyCharFormatL( charFormat, charFormatMask, - aSel.LowerPos(), - aSel.Length() ); - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::GetMessageCount -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppRichTextContainer::GetMessageCount() - { - return iMessages.Count(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::BoldL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::BoldL( const TCursorSelection& aSel ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::BoldL() start" )); -#ifdef _DEBUG - TInt len( iRichText->DocumentLength() ); - -#endif //_DEBUG - - TCharFormat charFormat; - TCharFormatMask charFormatMask; - - charFormat.iFontSpec.iFontStyle.SetStrokeWeight( EStrokeWeightBold ); - charFormatMask.SetAttrib( EAttFontStrokeWeight ); - - iRichText->ApplyCharFormatL( charFormat, charFormatMask, - aSel.LowerPos(), - aSel.Length() ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::BoldL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::ParseTextL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::ParseTextL( const TDesC& aText, TInt aStartPos, - TInt aRelativePos, CIMCVAppMessageWrapper& aMessageWrapper ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::ParseTextL() start" )); - CFindItemEngine* findItem = CFindItemEngine::NewL( aText, - CFindItemEngine::TFindItemSearchCase( - CFindItemEngine::EFindItemSearchPhoneNumberBin | - CFindItemEngine::EFindItemSearchMailAddressBin | - CFindItemEngine::EFindItemSearchURLBin/* | - CFindItemEngine::EFindItemSearchScheme*/ ) - ); - - CleanupStack::PushL( findItem ); - - // reset array - RArray& highlights = aMessageWrapper.Highlights(); - RArray& types = aMessageWrapper.HighlightTypes(); - highlights.Reset(); - types.Reset(); - - // get found items - const CArrayFixFlat* items = - findItem->ItemArray(); - TInt count( items->Count() ); - - for( TInt i(0); iAt(i); - - // selection in rich text - TCursorSelection realSel( aStartPos + item.iStartPos + item.iLength, - aStartPos + item.iStartPos ); - - // relative selection inside one message - TCursorSelection relativeSel( aRelativePos + item.iStartPos + - item.iLength, - aRelativePos + item.iStartPos ); - - highlights.AppendL( relativeSel ); - types.AppendL( item.iItemType ); - - // apply highlight item formatting - if( iItemHighlight ) - { - HighLightItemL( realSel ); - } - } - - CleanupStack::PopAndDestroy( findItem ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::ParseTextL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::AddNickL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection CIMCVAppRichTextContainer::AddNickL( - CIMCVAppMessageWrapper& aMessageWrapper ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::AddNickL() start" )); - // insert nick - MIMCVEngineMessage& message = aMessageWrapper.Message(); - TPtrC sender; - TPtrC recipient; - if( message.MessageType() == MIMCVEngineMessage::EMessageGroup || - message.MessageType() == MIMCVEngineMessage::EMessageWhisper ) - { - sender.Set( message.Sender() ); - recipient.Set( message.Recipient() ); - } - // need to implements todo - TCursorSelection nickSel( 0,0 ); - //============================================================================ - if( message.MessagerType() == MIMCVEngineMessage::EMessageSent && - message.MessageType() == MIMCVEngineMessage::EMessagePTOP) - { - CIMCVAppPicture* pic = new( ELeave )CIMCVAppPicture( *iMap, iFromMe ); - TPictureHeader header; - header.iPicture = TSwizzle(pic ); - iRichText->InsertL( iRichText->DocumentLength(), header );// takes ownership - iRichText->InsertL( iRichText->DocumentLength(), KSeparator ); - } - - else if( message.MessageType() == MIMCVEngineMessage::EMessagePTOP && - message.MessagerType() == MIMCVEngineMessage::EMessageReceived ) - { - // received p2p message and we want to display icon - // insert "to me" icon and separator - CIMCVAppPicture* pic = new( ELeave )CIMCVAppPicture( *iMap,iToMe ); - TPictureHeader header; - header.iPicture = TSwizzle( pic ); - iRichText->CancelInsertCharFormat(); // to prevent ETEXT 31 panic - iRichText->InsertL( iRichText->DocumentLength(), header ); // takes ownership - iRichText->InsertL( iRichText->DocumentLength(), KSeparator ); - } - //============================================================================ - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::AddNickL() end" )); - return nickSel; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconUtility::LoadDefaultBitmapL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CGulIcon* CIMCVAppRichTextContainer::LoadDefaultBitmapL( TInt aBitmapId, TInt aMaskId, - const TDesC& aFullPath, TBool/* aOverrideBrand */) - { - - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::LoadDefaultBitmapL() start") ); - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - TAknsItemID itemId( KAknsIIDNone ); - - AknsUtils::CreateIconLC( skin, - itemId, - bitmap, mask, aFullPath, aBitmapId, aMaskId ); - - CGulIcon* gulIcon = CGulIcon::NewL( bitmap, mask ); - CleanupStack::Pop( 2 ); // bitmap, mask - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::LoadDefaultBitmapL() end") ); - return gulIcon; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::AddTimeStampL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection CIMCVAppRichTextContainer::AddTimeStampL( - CIMCVAppMessageWrapper& aMessageWrapper ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::AddTimeStampL() start" )); - TInt start = iRichText->DocumentLength(); - - TCursorSelection timeSel( start, start ); - - - // format time - HBufC* timeStamp = HBufC::NewLC( KTimeStampMaxLength + KSpace().Length() ); - TPtr timePtr( timeStamp->Des() ); - - HBufC* timeStampFormat = NULL; - timeStampFormat = StringLoader::LoadLC( R_QTN_TIME_USUAL_WITH_ZERO ); - - TTime time = aMessageWrapper.Message().TimeStamp(); - TRAPD( err, time.FormatL( timePtr, *timeStampFormat ) ); - if( err == KErrOverflow ) - { - // Reserved text space was not enough. - // Adjust the KTimeStampMaxLength! - // in release builds return without timestamp - CleanupStack::PopAndDestroy( 2, timeStamp); // timeStamp, timeStampFormat - return timeSel; - } - - // Convert numbers to local language - AknTextUtils::LanguageSpecificNumberConversion( timePtr ); - - // Set Alignment of Pm/Am from local setting - // This keeps the am/pm text close to the time. - timePtr.Append( AknLayoutUtils::LayoutMirrored() ? - KUnicodeRLM : KUnicodeLRM ); - - // append time to rich text - timePtr.Append( KSpace ); - iRichText->InsertL( start, timePtr ); - - CleanupStack::PopAndDestroy( 2, timeStamp); // timeStamp, timeStampFormat - timeSel.SetSelection( start, iRichText->DocumentLength() - 1 ); - - // bold the time - if( timeSel.Length() > 0 ) - { - BoldL( timeSel ); - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::AddTimeStampL() end" )); - return timeSel; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::AddContentL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::AddContentL( TInt aMsgStart, - CIMCVAppMessageWrapper& aMessageWrapper ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::AddContentL() start" )); - MIMCVEngineMessage& message = aMessageWrapper.Message(); - - MIMCVEngineMessage::TContentType type( message.ContentType() ); - switch( type ) - { - case MIMCVEngineMessage::EContentText: - { - // insert text - //If received message is longer than 400 characters it will be truncated in imconnectionprovider - //so append truncation message to inform user that received message is truncated - HBufC* newmsg = HBufC::NewLC(KMsgMaxLength); - TPtr msg = newmsg->Des(); - if(message.Text().Length() > KReceiveMsgMaxLength) - { - msg.Append(message.Text().Left(KReceiveMsgMaxLength)); - HBufC* addText = StringLoader::LoadLC( R_QTN_CONVIEW_TRUNCATED ); - msg.Append(addText->Des()); - CleanupStack::PopAndDestroy(addText);//addText - } - else - { - msg.Append(message.Text()); - } - // TPtrC msg( message.Text() ); - HBufC* tempMsg = NULL; - - TInt paraBreak = msg.Locate( CEditableText::EParagraphDelimiter ); - // Replace all paragraph delimiters with line breaks - // to keep alingment consistent - if ( paraBreak != KErrNotFound ) - { - tempMsg = msg.AllocLC(); - TPtr ptr( tempMsg->Des() ); - ptr.Zero(); - - ReplaceParaDelimsWithLineBreaks( msg, ptr ); - msg.Set( ptr ); - } - - HBufC* numberConv = NULL; - - // Convert numerals to local language - // 1) date item - if( aMessageWrapper.Message().SystemMessageType() == - MIMCVEngineMessage::ESystemMessageDateChange ) - { - // don't touch the original message - numberConv = msg.AllocLC(); - TPtr ptr( numberConv->Des() ); - AknTextUtils::LanguageSpecificNumberConversion( ptr ); - msg.Set( ptr ); - } - - TInt textStart( iRichText->DocumentLength() ); - iRichText->InsertL( textStart, msg ); - - CleanupStack::PopAndDestroy(newmsg);//newmsg - // check for extensions (smileys) - TCursorSelection selection( iRichText->DocumentLength(), - textStart ); - iExtensionsHandler->ConvertSelectionToExtensionL( *iRichText, - selection , - iServiceId ); - - TInt textEnd( iRichText->DocumentLength() ); - - // add nbs to preserve formatting - iRichText->InsertL( iRichText->DocumentLength(), - CEditableText::EZeroWidthNoBreakSpace ); - - // if this is system message, it should be bold - if( message.MessageType() == MIMCVEngineMessage::EMessageSystem ) - { - TCursorSelection sel( textStart, textEnd ); - BoldL( sel ); - // System messages need different kind of alignment - CParaFormat paraFormat; - TParaFormatMask paraFormatMask; - paraFormat.iLeftMarginInTwips = 0; - paraFormatMask.SetAttrib( EAttLeftMargin ); - iRichText->ApplyParaFormatL( ¶Format, paraFormatMask, - textStart, sel.Length() ); - } - else - { - // Apply alignment for "normal" messages - CParaFormat paraFormat; - TParaFormatMask paraFormatMask; - paraFormat.iLeftMarginInTwips = 100; - paraFormatMask.SetAttrib( EAttLeftMargin ); - iRichText->ApplyParaFormatL( ¶Format, paraFormatMask, - textStart, textEnd - textStart ); - } - - // parse text for highlights and store positions to messagewrapper - HBufC* text = HBufC::NewMaxLC( textEnd-textStart ); - TPtr txt( text->Des() ); - iRichText->Extract( txt, textStart, textEnd-textStart ); - ParseTextL( txt, textStart, textStart-aMsgStart, aMessageWrapper ); - CleanupStack::PopAndDestroy( text ); - - // Cleanup - if( numberConv ) - { - CleanupStack::PopAndDestroy( numberConv ); - } - if ( tempMsg ) - { - CleanupStack::PopAndDestroy( tempMsg ); - } - break; - } - - default: - { - // unsupported type - - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::AddContentL() end" )); - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::UpdateSkinnedTextColourL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::UpdateSkinnedTextColourL() - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::UpdateSkinnedTextColourL() start" )); - // Get current text's color - TRgb defaultSkinTextColor( KRgbBlack ); - AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - defaultSkinTextColor, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormat.iFontPresentation.iTextColor = defaultSkinTextColor; - charFormatMask.SetAttrib( EAttColor ); - - // also appended messages should have new colour - TInt richTextDocumentLength = iRichText->DocumentLength(); - - iRichText->ApplyCharFormatL ( charFormat, charFormatMask, 0, richTextDocumentLength); - TCursorSelection cursorSelection(0, richTextDocumentLength); - iTextView->HandleFormatChangedL (cursorSelection); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::UpdateSkinnedTextColourL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::SkinColoredSelection -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection CIMCVAppRichTextContainer::SkinColoredSelection( - CIMCVAppMessageWrapper& aMessageWrapper, - TBool aUseDefaultColors, - TBool aCustomDefinedColor ) - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::SkinColoredSelection() start" )); - // This logic determines which part of the message is colored by the theme - if( !aCustomDefinedColor && aUseDefaultColors ) - { - return aMessageWrapper.WholeSelection(); - } - - if( !iColorWholeMessage ) - { - return aMessageWrapper.MessageSelection(); - } - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::SkinColoredSelection() end" )); - return TCursorSelection( 0, 0 ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::ReplaceParaDelimsWithLineBreaks -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainer::ReplaceParaDelimsWithLineBreaks( - const TPtrC& aSource, - TPtr& aTarget ) const - { - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::ReplaceParaDelimsWithLineBreaks() start" )); -#ifdef _DEBUG - TPtrC target; - target.Set( aTarget ); - -#endif - - TInt paraBreak = aSource.Mid( aTarget.Length() ).Locate( - CEditableText::EParagraphDelimiter ); - - if ( paraBreak == KErrNotFound ) - { - // No more paragraph delimiters, append what's left - aTarget.Append( aSource.Mid( aTarget.Length() ) ); - // And break away from recursion - return; - } - - aTarget.Append( aSource.Mid( aTarget.Length(), paraBreak ) ); - aTarget.Append( CEditableText::ELineBreak ); - -#ifdef _DEBUG - target.Set( aTarget ); - -#endif - - ReplaceParaDelimsWithLineBreaks( aSource, aTarget ); - IM_CV_LOGS(TXT("CIMCVAppRichTextContainer::ReplaceParaDelimsWithLineBreaks() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainer::GetPrimaryKey -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// - -const TDesC& CIMCVAppRichTextContainer::GetPrimaryKey() - { - if( iPrimaryKey) - { - return *iPrimaryKey; - } - return KNullDesC; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvapprichtextcontainercache.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvapprichtextcontainercache.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: A class which show message to ui -* -*/ - -// INCLUDE FILES -#include "cimcvapprichtextcontainercache.h" - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainerCache::NewL -// ----------------------------------------------------------------------------- -// -CIMCVAppRichTextContainerCache* CIMCVAppRichTextContainerCache::NewL() - { - CIMCVAppRichTextContainerCache* self = new( ELeave) CIMCVAppRichTextContainerCache(); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainerCache::CIMCVAppRichTextContainerCache -// Default constructor -// ----------------------------------------------------------------------------- -// -CIMCVAppRichTextContainerCache::CIMCVAppRichTextContainerCache() - { - - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainerCache::~CIMCVAppRichTextContainerCache -// Destructor -// ----------------------------------------------------------------------------- -// -CIMCVAppRichTextContainerCache::~CIMCVAppRichTextContainerCache() - { - //destroy all the objects in the cache - iRTContainerCache.ResetAndDestroy(); - - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainerCache::UpdateSkinTextColorL -// This is called when the skin text color is changed, and it is applied to all the containers. -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainerCache::UpdateSkinTextColorL () -{ - TInt count = iRTContainerCache.Count(); - for(TInt i=0;iUpdateSkinnedTextColourL(); - } -} - - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainerCache::StoreContainer -// Used to store the container to the cache -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainerCache::StoreContainer(CIMCVAppRichTextContainer *aContainer) - { - if( aContainer ) - { - TInt count = iRTContainerCache.Count(); - for(TInt i=0;iServiceId() == iRTContainerCache[i]->ServiceId() ) && - ( KErrNone == iRTContainerCache[i]->GetPrimaryKey().Compare( aContainer->GetPrimaryKey() ) ) ) - { - //if found, no need to store - return; - } - } - //container is not in the cache so append it - iRTContainerCache.Append(aContainer); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainerCache::LoadContainer -// Used to find the container in the cache -// ----------------------------------------------------------------------------- -// -CIMCVAppRichTextContainer* CIMCVAppRichTextContainerCache::LoadContainer(TInt aServiceId, const TDesC& aPrimaryKey) - { - TInt count = iRTContainerCache.Count(); - for(TInt i=0;iServiceId() ) && - ( KErrNone == iRTContainerCache[i]->GetPrimaryKey().Compare(aPrimaryKey) ) ) - { - //if found returns the pointer to the container - return iRTContainerCache[i]; - } - } - return NULL; //if not found return NULL - } - -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainerCache::DeleteContainer -// Used to delete the container in the cache -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainerCache::DeleteContainer(const TDesC& aPrimaryKey, TInt aServiceId ) - { - TInt count = iRTContainerCache.Count(); - for(TInt i=0;iServiceId() ) && - ( KErrNone == iRTContainerCache[i]->GetPrimaryKey().Compare(aPrimaryKey) ) ) - { - //if found delete the container and remove the element from the array - delete iRTContainerCache[i]; - iRTContainerCache.Remove(i); - break; - } - } - } -// ----------------------------------------------------------------------------- -// CIMCVAppRichTextContainerCache::DeleteAllServiceContainer -// Used to delete the container in the cache -// ----------------------------------------------------------------------------- -// -void CIMCVAppRichTextContainerCache::DeleteAllServiceContainer(TInt aServiceId ) - { - for(TInt index=0; indexServiceId() ) - { - //if found delete the container and remove the element from the array - delete iRTContainerCache[index]; - iRTContainerCache.Remove(index); - iRTContainerCache.Compress(); - index=index-1;// start from same index again - } - } - } - -// end of file - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappsmileicondialog.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappsmileicondialog.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,516 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Dialog for selecting smile icon. -* -*/ - - - - -// INCLUDE FILES - -#include "cimcvappsmileicondialog.h" -#include "cimcvappsmileicongrid.h" -#include "imcvappsmileutility.hrh" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "imcvlogger.h" -#include "imcvuiapputils.h" - -#include "e32property.h" -// CONSTANTS - -const TInt KAknSctCBaButtonDirections = 3; // bottom, right and left - - - - - -// ================= MEMBER FUNCTIONS ======================= - - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::NewL -// (other items were commented in a header). -// --------------------------------------------------------- -CIMCVAppSmileIconDialog* CIMCVAppSmileIconDialog::NewL( - const RPointerArray& aIconArray, - TInt& aSelectedIconId ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::NewL() start") ); - CIMCVAppSmileIconDialog* self = - new (ELeave) CIMCVAppSmileIconDialog( aIconArray, aSelectedIconId ); - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::NewL() end") ); - return self; - } - - - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::~CIMCVAppSmileIconDialog -// --------------------------------------------------------- -// -CIMCVAppSmileIconDialog::~CIMCVAppSmileIconDialog() - { - - } - - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::CIMCVAppSmileIconDialog -// (other items were commented in a header). -// --------------------------------------------------------- -// -CIMCVAppSmileIconDialog::CIMCVAppSmileIconDialog( - const RPointerArray& aIconArray, - TInt& aSelectedIconId ) -:iIconArray( aIconArray ), iIconId( aSelectedIconId ), iLayoutChanged(EFalse) - { - - } - - - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::OfferKeyEventL -// Handle key event. -// If key code is other than OK and arrow key, no action. -// (other items were commented in a header). -// --------------------------------------------------------- -// -TKeyResponse CIMCVAppSmileIconDialog::OfferKeyEventL( - const TKeyEvent& aKeyEvent, TEventCode aType) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::OfferKeyEventL() start") ); - TKeyResponse response( EKeyWasConsumed ); - switch( aKeyEvent.iCode ) - { - // fall through - case EKeyLeftArrow: - case EKeyRightArrow: - case EKeyUpArrow: - case EKeyDownArrow: - { - CIMCVAppSmileIconGrid* grid = - static_cast< CIMCVAppSmileIconGrid*>( - Control( EIMIdSelectSmileGrid ) ); - grid->MoveCursor( aKeyEvent.iCode ); - break; - } - case EKeyEscape: // handle dialog shutdown. - { - TryExitL( EAknSoftkeyExit ); - return EKeyWasNotConsumed; - } - default: - { - response = CAknDialog::OfferKeyEventL(aKeyEvent, aType); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::OfferKeyEventL() end") ); - return response; - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::OkToExitL -// Called when CBA-key or OK-key is pressed. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconDialog::HandleResourceChange( TInt aType ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::HandleResourceChange() start") ); - if( aType == KEikDynamicLayoutVariantSwitch ) - { - iLayoutChanged = ETrue; - SetLayout(); - } - CAknDialog::HandleResourceChange( aType ); - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::HandleResourceChange() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::OkToExitL -// Called when CBA-key or OK-key is pressed. -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CIMCVAppSmileIconDialog::OkToExitL( TInt aButtonId ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::OkToExitL() start") ); - if( aButtonId == EAknSoftkeySelect || - aButtonId == EEikBidOk ) - { - CIMCVAppSmileIconGrid* grid = - static_cast< CIMCVAppSmileIconGrid*>( - Control( EIMIdSelectSmileGrid ) ); - iIconId = grid->SelectedBitmapId(); - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::OkToExitL() end") ); - return ETrue; - } - - - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::PreLayoutDynInitL -// Prepare for drawing dialog. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconDialog::PreLayoutDynInitL() - { - SetLineNonFocusing( EIMIdSelectSmileLabel ); - EnableDragEvents(); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::SetSizeAndPosition -// Control size is set. This is called just after PreLayoutDynInitL(). -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconDialog::SetSizeAndPosition(const TSize& /*aSize*/) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::SetSizeAndPosition() start") ); - SetLayout(); - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::SetSizeAndPosition() end") ); - } - - - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::CalculatePopupVariety -// (other items were commented in a header). -// --------------------------------------------------------- -// - -TInt CIMCVAppSmileIconDialog::CalculatePopupVariety() - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::CalculatePopupVariety() start") ); - - TAknLayoutScalableParameterLimits smileyDialogVariety = - AknLayoutScalable_Avkon::popup_grid_graphic_window_ParamLimits(); - TInt maxVariety = smileyDialogVariety.LastVariety(); - - // CBA location affects popup layout - AknLayoutUtils::TAknCbaLocation cbaLocation = AknLayoutUtils::CbaLocation(); - - // bottom variety - TInt maxVarietyOffset = 0; - TInt varietyOffset = maxVariety + 1; - // right variety - if (cbaLocation == AknLayoutUtils::EAknCbaLocationRight) - { - varietyOffset = (maxVariety + 1)/KAknSctCBaButtonDirections; - maxVarietyOffset = varietyOffset; - } - - // left variety - else if (cbaLocation == AknLayoutUtils::EAknCbaLocationLeft) - { - varietyOffset = (maxVariety + 1)/KAknSctCBaButtonDirections; - maxVarietyOffset = varietyOffset + varietyOffset; - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::CalculatePopupVariety() end") ); - - if ((maxVarietyOffset + varietyOffset)>maxVariety) - return maxVariety; - else - return maxVarietyOffset + varietyOffset; - - } - - - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::SetLayout -// Set dialog layout. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconDialog::SetLayout() - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::SetLayout() start")); - iIsMirrored = AknLayoutUtils::LayoutMirrored(); - TRect clientRect; - //check LAF docs for constants - //AknLayoutUtils::LayoutMetricsRect - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, - clientRect); - CIMCVAppSmileIconGrid* grid = - - static_cast ( - - Control(EIMIdSelectSmileGrid)); - - // Select correct popup layout - - TInt varietyNumber = CalculatePopupVariety(); - TRect rect = grid->GetFirstCellRect(); - - TInt iconCount = iIconArray.Count(); - // calculating the number of rows required by the icon grid. - - TInt viewableWidth = 0; - - for (TInt i = varietyNumber; i >= 0; i--) - { - - TAknWindowLineLayout popupGridDialogLayout( - AknLayoutScalable_Avkon::popup_grid_graphic_window(i)); - - TAknLayoutRect dialogRect; - - dialogRect.LayoutRect(clientRect, popupGridDialogLayout); - - viewableWidth = CheckDialog(dialogRect, rect); - if (viewableWidth) - { - varietyNumber = i; - break; - } - } - if (viewableWidth) - { - TAknWindowLineLayout popupGridDialogLayout( - AknLayoutScalable_Avkon::popup_grid_graphic_window( - varietyNumber)); - TAknLayoutRect dialogRect; - dialogRect.LayoutRect(clientRect, popupGridDialogLayout); - grid->SetViewableWindowWidth(viewableWidth); - SetRect(dialogRect.Rect()); - } - // If there is no suitable solution for the smiley dialog layout - else - { - // No variety of the popup_grid_graphic_window has provided sufficient area - // for the grid display. Hence selecting 0 variety for displaying the grid - // because it has the greatest area. - varietyNumber = 0; - TAknWindowLineLayout popupGridDialogLayout( - AknLayoutScalable_Avkon::popup_grid_graphic_window( - varietyNumber)); - - TAknLayoutRect dialogRect; - - dialogRect.LayoutRect(clientRect, popupGridDialogLayout); - - if (!iIsMirrored) - { - // Right Margin of the top left (top right) icon's X - TInt leftMargin = rect.iTl.iX; - - // Use the max viewable width - viewableWidth = dialogRect.Rect().iBr.iX - - dialogRect.Rect().iTl.iX - leftMargin; - } - else - { - // Left Margin of the top left (top right) icon's X - TInt rightMargin = rect.iBr.iX; - - // Use the max viewable width - viewableWidth = dialogRect.Rect().iBr.iX - - dialogRect.Rect().iTl.iX + rightMargin; - } - - grid->SetViewableWindowWidth(viewableWidth); - - if (!iIsMirrored) - SetRect(dialogRect.Rect()); - // When the Hebrew is the language as well as the Arb languages - // The align is not right - else - { - TRect mirroredDialogRect; - - // Align to right. - mirroredDialogRect = dialogRect.Rect(); - - // Get the rect of the cba pane. - TRect controlPaneRect; - AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EControlPane, - controlPaneRect); - - TInt cbaWidth = controlPaneRect.iBr.iX - controlPaneRect.iTl.iX; - - mirroredDialogRect.iTl.iX -= cbaWidth; - mirroredDialogRect.iBr.iX -= cbaWidth; - - SetRect(mirroredDialogRect); - } - } - } - - - -// --------------------------------------------------------- - -// CIMCVAppSmileIconDialog::CheckDialog - -// Check if Dialog is suitable to fit all smile icon - -// (other items were commented in a header). - -// --------------------------------------------------------- - -TInt CIMCVAppSmileIconDialog::CheckDialog(TAknLayoutRect aDialogRect,TRect aRect) - { - // topMargin is the height of the margin which the smiley grid has - // above its top horizontal line and bottom horizontal line. - TInt topMargin = aRect.Height(); - - TRect dialogRect = aDialogRect.Rect(); - - TInt vWidth = 0; - TInt vheight = 0; - TInt vArea = 0; - vheight = dialogRect.iBr.iY - dialogRect.iTl.iY - 2*topMargin; - if ( !iIsMirrored ) - { - vWidth = dialogRect.iBr.iX - dialogRect.iTl.iX - 2*aRect.iTl.iX;; - } - else - { - // Patch fix for mirrored layout when mode changes from portrait to - // landscape or vice versa the width calculation differs to adjust the correct width - if (iLayoutChanged) // mode change like portrait to landscape or vice versa - { - vWidth = (2*aRect.iBr.iX) - (dialogRect.iBr.iX - dialogRect.iTl.iX); - } - else - { - vWidth = dialogRect.iBr.iX - dialogRect.iTl.iX + 2*aRect.iBr.iX; - } - } - vArea = vWidth*vheight; - - TInt iconCount = iIconArray.Count(); - - TInt areaOfIcon = iconCount * aRect.Width() * aRect.Height(); - - if(areaOfIcon > vArea) - { - return 0; - } - else - { - return vWidth; - } - } - - -// --------------------------------------------------------- -// CIMCVAppSmileIconDialog::CreateCustomControlL -// Create CIMCVAppSmileIconGrid class in order to display -// icons in grid. -// This is called when dialog is created. -// (other items were commented in a header). -// --------------------------------------------------------- -// -SEikControlInfo CIMCVAppSmileIconDialog::CreateCustomControlL( - TInt aControlType ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::SetLayout() start") ); - SEikControlInfo controlInfo; - controlInfo.iControl = NULL; - controlInfo.iTrailerTextId = 0; - controlInfo.iFlags = 0; - if( aControlType == EIMCtrlSelectSmileGrid ) - { - controlInfo.iControl = CIMCVAppSmileIconGrid::NewL( this, iIconArray ); - - static_cast - - (controlInfo.iControl)->SetTapObserver( this, 0 ); - - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconDialog::SetLayout() end") ); - return controlInfo; - } - - - -// --------------------------------------------------------- - -// CIMCVAppSmileIconDialog::HandleDialogPageEventL - -// (other items were commented in a header). - -// --------------------------------------------------------- - -// - -void CIMCVAppSmileIconDialog::HandleDialogPageEventL( TInt aEventID ) - - { - if( IMCVUiAppUtils::PenEnabled() ) - { - if ( iSmileyPointed && - aEventID == MEikDialogPageObserver::EDialogPageTapped ) - { - // Exit requested, exit with ok. - TryExitL( EAknSoftkeyOk ); - } - - //else keep dialog as it is do not exit. - } - } - -// --------------------------------------------------------- - -// CIMCVAppSmileIconDialog::HandleTapEventL - -// (other items were commented in a header). - -// --------------------------------------------------------- - -// - -void CIMCVAppSmileIconDialog::HandleTapEventL( TTapEvent aEvent, - - TUint /*aControlId*/ ) - - { - - // User tapped on smiley. - - if( aEvent == MIMCVTapEventObserver::ESingleTap ) - - { - - // Smiley was selected but we can't exit directly from here. - - // Instead we put the flag on and wait for - - // HandleDialogPageEventL. - - iSmileyPointed = ETrue; - - } - - } - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappsmileicongrid.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappsmileicongrid.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,684 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Grid for smile icons -* -*/ - - -// INCLUDE FILES -#include "cimcvappsmileicongrid.h" -#include "imcvappsmileutility.hrh" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "imcvlogger.h" -#include "imcvuiapputils.h" -#include "mimcvtapeventobserver.h" - - -// CONSTANTS -// The (KTopLeft_x,KTopLeft_y) and (KBottomRight_x,KBottomRight_y) are the co ordinates of the -// topleft and bottomright points of the first cell in the grid. -// These co-ordinates to draw the grid lines and the logic to draw the grid lines is based on the topleft -// and bottomright points of the first cell in the grid. -#define KTopLeft_x 56 -#define KTopLeft_y 55 -#define KBottomRight_x 105 -#define KBottomRight_y 104 - - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconGrid::NewL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// Two-phased constructor. -CIMCVAppSmileIconGrid* CIMCVAppSmileIconGrid::NewL( CEikDialog* aParent, - const RPointerArray& aIconArray ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::NewL() start") ); - CIMCVAppSmileIconGrid* self = new (ELeave) CIMCVAppSmileIconGrid( aParent, - aIconArray ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::NewL() end") ); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconGrid::~CIMCVAppSmileIconGrid -// ----------------------------------------------------------------------------- -CIMCVAppSmileIconGrid::~CIMCVAppSmileIconGrid() - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconGrid::CIMCVAppSmileIconGrid -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// C++ constructor can NOT contain any code, that -// might leave. -// -CIMCVAppSmileIconGrid::CIMCVAppSmileIconGrid( CEikDialog* aParent, - const RPointerArray& aIconArray ) -:iParent( aParent ), iIconArray( aIconArray ) - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconGrid::ConstructL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -// default constructor can leave. -void CIMCVAppSmileIconGrid::ConstructL() - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::ConstructL() start") ); - iIconCount = iIconArray.Count(); - - iIsMirrored = ETrue ; - SetContainerWindowL( *iParent ); - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::ConstructL() end") ); - } - - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::MoveCursor -// Move cursor and redraw highlight. -// Called when arrow-key is pressed. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconGrid::MoveCursor( TInt aKeyCode ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::MoveCursor() start") ); - iPrevCursorPos = iCursorPos; - - switch( aKeyCode ) - { - case EKeyLeftArrow: - { - if( AknLayoutUtils::LayoutMirrored() ) - { - iCursorPos++; - if( iCursorPos >= iIconCount ) - { - iCursorPos = 0; - } - } - else - { - iCursorPos--; - if( iCursorPos < 0 ) - { - iCursorPos = iIconCount - 1; - } - } - break; - } - case EKeyRightArrow: - { - if( AknLayoutUtils::LayoutMirrored() ) - { - iCursorPos--; - if( iCursorPos < 0 ) - { - iCursorPos = iIconCount - 1; - } - } - else - { - iCursorPos++; - if( iCursorPos >= iIconCount ) - { - iCursorPos = 0; - } - } - break; - } - case EKeyUpArrow: - { - if( iCursorPos < iMaxColumns ) - { - iCursorPos += ( iRowCount * iMaxColumns ) - 1; - - if( iCursorPos >= iIconCount ) - { - iCursorPos -= iMaxColumns; - } - - if( iCursorPos < 0 ) - { - iCursorPos = iIconCount - 1; - } - } - else - { - iCursorPos -= iMaxColumns; - } - break; - } - case EKeyDownArrow: - { - if( iCursorPos < ( iIconCount - iMaxColumns ) ) - { - iCursorPos += iMaxColumns; - } - else - { - iCursorPos %= iMaxColumns; - iCursorPos++; - if( iCursorPos >= iMaxColumns || - iCursorPos >= iIconCount ) - { - iCursorPos = 0; - } - } - break; - } - default: - { - return; - } - } - - DrawDeferred(); - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::MoveCursor() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::SelectedBitmapId -// Called when OK-key or Select-softkey is pressed. -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CIMCVAppSmileIconGrid::SelectedBitmapId() - { - return iCursorPos; - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::HeightInRows -// Return row count of grid. -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CIMCVAppSmileIconGrid::HeightInRows() - { - return iRowCount; - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::SetLayout -// Set layout of identifier grid. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconGrid::SetLayout() - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::SetLayout() start")); - iIsMirrored = AknLayoutUtils::LayoutMirrored(); - - // popup_grid_graphic_window (Parent) - TRect parentRect(iParent->Rect()); - - // listscroll_popup_graphic_pane (this compoment) - TAknLayoutRect listLayoutRect; - listLayoutRect.LayoutRect(parentRect, - AknLayoutScalable_Avkon::listscroll_popup_graphic_pane(0)); - - // grid_graphic_popup_pane - TAknLayoutRect gridLayoutRect; - gridLayoutRect.LayoutRect(listLayoutRect.Rect(), - AknLayoutScalable_Avkon::grid_graphic_popup_pane(0)); - - // cell_graphic_popup_pane (upper left cell) - TAknLayoutRect oneCellRect; - oneCellRect.LayoutRect(gridLayoutRect.Rect(), - AknLayoutScalable_Avkon::cell_graphic_popup_pane(0, 0, 0)); - - iFirstCell = oneCellRect.Rect(); - iCellWidth = iFirstCell.Width(); - iCellHeight = iFirstCell.Height(); - - // cell_graphic_popup_pane_g1 (icon size) - TAknLayoutRect myIconRect; - myIconRect.LayoutRect(iFirstCell, - AknLayoutScalable_Avkon::cell_graphic_popup_pane_g1(0)); - iIconSize = myIconRect.Rect().Size(); - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::SetLayout() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::MinimumSize -// Return minimum size to use the control. -// (other items were commented in a header). -// --------------------------------------------------------- -// -TSize CIMCVAppSmileIconGrid::MinimumSize() - { - TAknLayoutRect gridRect; - gridRect.LayoutRect( - iParent->Rect(), - AknLayoutScalable_Avkon::listscroll_popup_graphic_pane() ); - return gridRect.Rect().Size(); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::SizeChanged -// Control rectangle is set. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconGrid::SizeChanged() - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::SizeChanged() start") ); - SetLayout(); - - TInt iconCount( iIconArray.Count() ); - for ( TInt i = 0; i < iconCount; i++ ) - { - AknIconUtils::SetSize( iIconArray[i]->Bitmap(), - iIconSize ); - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::SizeChanged() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::HandleResourceChange -// Notifier for changing layout -// (other items were commented in a header). -// --------------------------------------------------------- -// - -void CIMCVAppSmileIconGrid::HandleResourceChange( TInt aType ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::HandleResourceChange() start") ); - if( aType == KEikDynamicLayoutVariantSwitch ) - { - SetLayout(); - } - else - { - CCoeControl::HandleResourceChange( aType ); - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::HandleResourceChange() end") ); - } - - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::Draw -// Drawing control. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconGrid::Draw( const TRect& /* aRect */ ) const - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::Draw() start") ); - CWindowGc& gc = SystemGc(); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - - if( !iDragEvent ) - { - // Draw the grid - gc.SetPenStyle(CGraphicsContext::ESolidPen); - gc.SetBrushStyle(CGraphicsContext::ENullBrush); - gc.SetPenSize(TSize(1,1)); - gc.SetPenColor(AKN_LAF_COLOR(215)); - - // For some reason the dialog does not draw it's background - // completely, so we'll have to do it here. - // This should work with bgRect = Rect(), but it doesn't. - // Change this if you know how it should be done. - TRect bgRect = iParent->Rect(); - bgRect.iTl.iY = Rect().iTl.iY; - // --- - - TBool skins = AknsDrawUtils::Background( skin, cc, this, gc, bgRect ); - - if ( !skins ) - { - TRgb color = AKN_LAF_COLOR( 0 ); - AknsUtils::GetCachedColor(skin,color,KAknsIIDQsnIconColors,EAknsCIQsnIconColorsCG1); - gc.SetBrushColor(color); - gc.Clear( bgRect ); - } - - TInt lastRowIconsCount = iIconCount % iMaxColumns; - if( lastRowIconsCount == 0 && iIconCount > 0 ) - { - // Last row is full - lastRowIconsCount = iMaxColumns; - } - - TInt i( 0 ); - TPoint cellLeftTop( KTopLeft_x,KTopLeft_y ); - TPoint cellBottomRight( KBottomRight_x,KBottomRight_y ); - if(!iIsMirrored) - { - // Draw horizontal lines - for( i = 0; i <= iRowCount; ++i ) - { - TPoint startPoint( cellLeftTop ); - TPoint endPoint( cellLeftTop ); - startPoint.iY += i * iCellHeight; - endPoint.iY += i * iCellHeight; - endPoint.iX += ( ( i == iRowCount ) || ( i == 0 && iRowCount == 1 ) - ? ( lastRowIconsCount ) - * iCellWidth : iMaxColumns * iCellWidth ); - // add 1 pixel to remove the gap from bottom right corners - ++endPoint.iX; - gc.DrawLine( startPoint, endPoint ); - } - - // Draw vertical lines - for( i = 0; i <= iMaxColumns; ++i ) - { - TPoint startPoint( cellLeftTop ); - TPoint endPoint( cellLeftTop ); - startPoint.iX += i * iCellWidth; - endPoint.iX += i * iCellWidth; - endPoint.iY += ( i <= lastRowIconsCount ? - iCellHeight * iRowCount : iCellHeight * ( iRowCount - 1 ) ); - gc.DrawLine( startPoint, endPoint ); - } - } - else - { - // Draw horizontal lines - for( i = 0; i <= iRowCount; ++i ) - { - TPoint startPoint( cellLeftTop ); - TPoint endPoint( cellLeftTop ); - startPoint.iY += i * iCellHeight; - endPoint.iY += i * iCellHeight; - endPoint.iX += ( ( i == iRowCount ) || ( i == 0 && iRowCount == 1 ) - ? ( lastRowIconsCount ) - * iCellWidth : iMaxColumns * iCellWidth ); - // subtract one pixel to remove the gap from bottom left corners - --endPoint.iX; - gc.DrawLine( startPoint, endPoint ); - } - - // Draw vertical lines - for( i = 0; i <= iMaxColumns; ++i ) - { - TPoint startPoint( cellLeftTop ); - TPoint endPoint( cellLeftTop ); - startPoint.iX += i * iCellWidth; - endPoint.iX += i * iCellWidth; - endPoint.iY += ( i <= lastRowIconsCount ? - iCellHeight * iRowCount : iCellHeight * ( iRowCount - 1 ) ); - gc.DrawLine( startPoint, endPoint ); - } - - } - - // Draw icons - for( i = 0; i < iIconCount; ++i ) - { - DrawItem( gc, skins, skin, cc, i, i == iCursorPos ); - } - } - else - { - // Only selection changed, highlight new pos - DrawItem( gc, cc != NULL, skin, cc, iCursorPos, ETrue ); - // And clear old - DrawItem( gc, cc != NULL, skin, cc, iPrevCursorPos, EFalse ); - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::Draw() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::DrawItem -// (other items were commented in a header). -// --------------------------------------------------------- -void CIMCVAppSmileIconGrid::DrawItem( CWindowGc& aGc, - TBool aSkinEnabled, - MAknsSkinInstance* aSkin, - MAknsControlContext* aSkinCc, - TInt aIndex, TBool aSelected ) const - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::DrawItem() start") ); - //lets count current cell - TPoint cellLeftTop( KTopLeft_x,KTopLeft_y ); - TPoint cellBottomRight( KBottomRight_x,KBottomRight_y ); - - TRect myRect; - myRect.SetRect( cellLeftTop, cellBottomRight ); - TPoint offset; - - offset.iX = ( aIndex % iMaxColumns ) * iCellWidth; - offset.iY = aIndex / iMaxColumns * iCellHeight; - - myRect.Move( offset ); - - // don't draw bg/highlight over borderlines - TRect myHighLightRect = myRect; - myHighLightRect.iTl.iX++; - myHighLightRect.iTl.iY++; - - if( aSelected ) - { - // HIGHLIGHT - if( !aSkinEnabled ) - { - aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - } - - TRgb color = AKN_LAF_COLOR(210); - AknsUtils::GetCachedColor( aSkin, color, KAknsIIDQsnIconColors, - EAknsCIQsnComponentColorsCG17 ); - aGc.SetBrushColor( color ); - aGc.Clear( myHighLightRect ); - } - else - { - TRgb color = AKN_LAF_COLOR( 0 ); - AknsUtils::GetCachedColor( aSkin, color, KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG1 ); - aGc.SetBrushColor( color ); - if ( aSkinEnabled ) - { - AknsDrawUtils::Background( aSkin, aSkinCc, aGc, myHighLightRect ); - } - else - { - aGc.DrawRect( myHighLightRect ); - } - } - - - TAknWindowLineLayout myIconLayout( AknLayoutScalable_Avkon::cell_graphic_popup_pane_g1(0) ); - - TAknLayoutRect myIconRect; - myIconRect.LayoutRect( myRect, myIconLayout ); - - if( aIndex < iIconArray.Count() ) - { - myIconRect.DrawImage( aGc, - iIconArray[ aIndex ]->Bitmap(), - iIconArray[ aIndex ]->Mask() ); - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::DrawItem() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconGrid::HandlePointerEventL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconGrid::HandlePointerEventL( - const TPointerEvent& aPointerEvent ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::HandlePointerEventL() start") ); - if( !IMCVUiAppUtils::PenEnabled() ) - { - // Ignore event - //return; - } - - TInt oldSelection = iCursorPos; - TPoint hitPos = aPointerEvent.iPosition; - - // Convert XY position to linear cursor position - TPoint cellLeftTop( KTopLeft_x,KTopLeft_y ); - hitPos -= cellLeftTop; - - TInt xPos = hitPos.iX / iCellWidth; - TInt yPos = hitPos.iY / iCellHeight; - TInt newSelection = yPos * iMaxColumns + xPos; - - // Check that the selection is inside the grid - TBool validItem = xPos <= iMaxColumns - 1 && - Rng( 0, newSelection, iIconCount - 1 ) && - hitPos.iX >= 0 && - hitPos.iY >= 0; - if( !validItem ) - { - // not valid point --> ignore event - return; - } - - // Only update if something new was selected - if( newSelection != oldSelection ) - { - // New valid item - iPrevCursorPos = iCursorPos; - iCursorPos = newSelection; - iDragEvent = ETrue; - DrawDeferred(); - iDragEvent = EFalse; - } - - // Notify observer - if( iTapObserver && - aPointerEvent.iType == TPointerEvent::EButton1Up ) - { - // Smiley was tapped - iTapObserver->HandleTapEventL( MIMCVTapEventObserver::ESingleTap, - iTapControlId ); - } - - if( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - // enable dragging when button1 is down - EnableDragEvents(); - // single tap has to insert the smiley. - // this code is not required - // Window().SetPointerGrab( ETrue ); - - // and make sure that we get the dragging events - // ClaimPointerGrab( ETrue ); - } - - CCoeControl::HandlePointerEventL( aPointerEvent ); - IM_CV_LOGS(TXT("CIMCVAppSmileIconGrid::HandlePointerEventL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconGrid::SetTapObserver -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileIconGrid::SetTapObserver( MIMCVTapEventObserver* aObserver, - TUint aId ) - { - iTapObserver = aObserver; - iTapControlId = aId; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconGrid::SetViewableWindowWidth -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileIconGrid::SetViewableWindowWidth(TInt aViewableWidth) -{ - TRect parentRect( iParent->Rect() ); - - // listscroll_popup_graphic_pane (this compoment) - TAknLayoutRect listLayoutRect; - listLayoutRect.LayoutRect( - parentRect, - AknLayoutScalable_Avkon::listscroll_popup_graphic_pane() ); - - // grid_graphic_popup_pane - TAknLayoutRect gridLayoutRect; - gridLayoutRect.LayoutRect( - listLayoutRect.Rect(), - AknLayoutScalable_Avkon::grid_graphic_popup_pane( 0 ) ); - - // cell_graphic_popup_pane (upper left cell) - TAknLayoutRect oneCellRect; - oneCellRect.LayoutRect( - gridLayoutRect.Rect(), - AknLayoutScalable_Avkon::cell_graphic_popup_pane( 0, 0, 0 ) ); - - TInt cellWidth = oneCellRect.Rect().Width(); - - iMaxColumns = aViewableWidth/cellWidth; - - iRowCount = iIconCount / iMaxColumns; - - if (iIconCount % iMaxColumns) - { - iRowCount++; - } - -} - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconGrid::GetFirstCellRect -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TRect CIMCVAppSmileIconGrid::GetFirstCellRect() - { - // popup_grid_graphic_window (Parent) - TRect parentRect( iParent->Rect() ); - - // listscroll_popup_graphic_pane (this compoment) - TAknLayoutRect listLayoutRect; - listLayoutRect.LayoutRect( - parentRect, - AknLayoutScalable_Avkon::listscroll_popup_graphic_pane() ); - - // grid_graphic_popup_pane - TAknLayoutRect gridLayoutRect; - gridLayoutRect.LayoutRect( - listLayoutRect.Rect(), - AknLayoutScalable_Avkon::grid_graphic_popup_pane( 0 ) ); - - // cell_graphic_popup_pane (upper left cell) - TAknLayoutRect oneCellRect; - oneCellRect.LayoutRect( - gridLayoutRect.Rect(), - AknLayoutScalable_Avkon::cell_graphic_popup_pane( 0, 0, 0 ) ); - - return oneCellRect.Rect(); - //return iFirstCell; - - } -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappsmileiconutility.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappsmileiconutility.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,385 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Utility for selecting smile icon and converting -* between smile id and smile string. -* -*/ - - -// INCLUDE FILES -#include "cimcvappsmileiconutility.h" -#include "cimcvappsmileicondialog.h" -#include "cimcvappsmilestring.h" -#include "cimcvappsmileyinformation.h" -#include "mimcvuiappskinvariant.h" -#include "cimcvengine.h" -#include "cimcvappbitmapmapping.h" // defines the skinned bitmap ids - -#include "mimcvappui.h" -#include -#include -#include -#include -#include -#include // RResourceReader -#include -#include -#include - -#include -#include // skins -#include -#include -#include -#include -#include "imcvlogger.h" -#include -#include "cimcvuiappiconfileprovider.h" -#include "conversations.h" -#include "imcvuiapp.h" -#include - - -// ================= MEMBER FUNCTIONS ======================= - -// Two-phased constructor. -CIMCVAppSmileIconUtility* CIMCVAppSmileIconUtility::NewL(MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, - CIMCVEngine& aServiceEngine ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::NewL() start") ); - CIMCVAppSmileIconUtility* self = new (ELeave) CIMCVAppSmileIconUtility(aSkinVariant, aAppUi); - CleanupStack::PushL( self ); - self->ConstructL(aServiceEngine); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::NewL() end") ); - return self; - } - -// Destructor -CIMCVAppSmileIconUtility::~CIMCVAppSmileIconUtility() - { - iAppUi.RemoveResourceChangeObserver( this ); - iStringArray.ResetAndDestroy(); - iSmileArray.ResetAndDestroy(); - iIconToSmileyPointers.Close(); - iSmileDlgIconArray.ResetAndDestroy(); - iFile.Close(); - } - -// C++ constructor can NOT contain any code, that -// might leave. -// -CIMCVAppSmileIconUtility::CIMCVAppSmileIconUtility(MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi ) - :iSkinVariant( aSkinVariant), - iAppUi( aAppUi ) - { - } - -// ConstructL -// -void CIMCVAppSmileIconUtility::ConstructL(CIMCVEngine& aServiceEngine ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::ConstructL() start") ); - // we need to be resource aware - iAppUi.AddResourceChangeObserver( this ); - ConstructSmileDialogIconArrayL( aServiceEngine ); - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::ConstructL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconUtility::ParseAllSmileyStringL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconUtility::ParseAllSmileyStringL(RPointerArray aAllSmileyString) - { - TInt iconCount = aAllSmileyString.Count(); - //make sure everything is fresh - iStringArray.ResetAndDestroy(); - for(TInt i=0; iLength() > iLongestSmileyLength ) - { - iLongestSmileyLength = smileString->Length(); - } - // ownership is transferred - smileArray->Set( smileString, i ); - User::LeaveIfError( iStringArray.Append( smileArray ) ); - CleanupStack::Pop( smileArray ); - } - } -// --------------------------------------------------------- -// CIMCVAppSmileIconUtility::ConstructSmileDialogIconArrayL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconUtility::ConstructSmileDialogIconArrayL(CIMCVEngine& aServiceEngine ) - { - RPointerArray smileyString = aServiceEngine.GetSmileStringArray(); - CleanupClosePushL( smileyString ); - ParseAllSmileyStringL(smileyString); // all object ownership transfered - smileyString.Reset(); - CleanupStack::Pop( &smileyString ); // no objects alive - - iSmileDlgIconArray = aServiceEngine.GetSmileyIconArray(); - - // Sort smileys according to their string length, so that searching - // for smileys is done from the longest smiley to the shortest. This - // prevents the chat from detecting smaller smileys inside the big ones. - TLinearOrder< CIMCVAppSmileString > - order( CIMCVAppSmileIconUtility::CompareSmileyLengthReversed ); - iStringArray.Sort( order ); - // Precalculate an ref table from icon to smiley. - iIconToSmileyPointers.Reset(); - TInt count = iSmileDlgIconArray.Count(); - for( TInt i = 0; i < count; ++i ) - { - User::LeaveIfError( - iIconToSmileyPointers.Append( GetFirstSmileyIndex( i ) ) ); - } - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconUtility::LaunchSmileIconDialogL -// (other items were commented in a header). -// --------------------------------------------------------- -//code scaner warning can be ignored since ExecuteLD is leaving and we need to return dialogVal. -TInt CIMCVAppSmileIconUtility::LaunchSmileIconDialogL( TInt& aSelectedIconId ) - { - if( iSmileDlgIconArray.Count() <= 0 ) - { - User::Leave(KErrArgument); - } - CIMCVAppSmileIconDialog* dialog = CIMCVAppSmileIconDialog::NewL( iSmileDlgIconArray, - aSelectedIconId ); - TInt dialogVal = dialog->ExecuteLD( R_SELECT_SMILE_DIALOG ); - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::LaunchSmileIconDialogL() end") ); - return dialogVal; - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconUtility::SmileIconCount -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CIMCVAppSmileIconUtility::SmileIconCount() const - { - return iSmileDlgIconArray.Count(); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconUtility::GetSmileIcon -// (other items were commented in a header). -// --------------------------------------------------------- -// -const CGulIcon* CIMCVAppSmileIconUtility::GetSmileIcon( TInt aIconId ) const - { - return iSmileDlgIconArray[ aIconId ]; - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconUtility::GetSmileString -// (other items were commented in a header). -// --------------------------------------------------------- -// -const TDesC& CIMCVAppSmileIconUtility::GetSmileString( TInt aIconId ) const - { - return iStringArray[ iIconToSmileyPointers[ aIconId ] ]->SmileString(); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconUtility::SearchSmilesL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconUtility::SearchSmilesL( const TDesC& aStr, TDes& aFixedStr, - RArray* aArray ) - { - CleanupClosePushL(*aArray); - - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::SearchSmilesL() start") ); - TInt i; - iSmileArray.ResetAndDestroy(); - SearchSmilesL( aStr, iSmileArray, &aFixedStr ); - - aArray->Reset(); - TInt arrayCount( iSmileArray.Count() ); - - for ( i = 0; i < arrayCount; ++i ) - { - User::LeaveIfError( aArray->Append( iSmileArray[ i ]->Index() ) ); - } - - iSmileArray.ResetAndDestroy(); - - CleanupStack::Pop(aArray); - - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::SearchSmilesL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconUtility::SearchSmilesL -// Search smileys from string and sort them in linear order. -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileIconUtility::SearchSmilesL( const TDesC& aStr, - RPointerArray< CIMCVAppSmileyInformation >& aSmileyInfoArray, - TDes* aFixedStr /*= NULL */, - TInt aStartPos /* = 0 */) const - { - CleanupClosePushL(aSmileyInfoArray); - - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::SearchSmilesL() start") ); - HBufC* text = HBufC::NewMaxLC( aStr.Length() ); - TPtr fixedText( text->Des() ); - fixedText.Copy( aStr.Left(fixedText.MaxLength()) ); - - HBufC* replaceString = HBufC::NewMaxLC( iLongestSmileyLength ); - TPtr replace( replaceString->Des() ); - if ( aFixedStr ) - { - replace.Fill( KPuaCodeSmileyIconPadding, 1 ); - } - else - { - //we dont need fixed, but we do need correct positions - replace.Fill( KPuaCodeSmileyIconPadding, iLongestSmileyLength ); - } - - // order to sort array by the position - TLinearOrder< CIMCVAppSmileyInformation > order( CIMCVAppSmileIconUtility::Compare ); - - // for i-loop goes throug every smile string - // while-loop searches smiles from given string - TInt arrayCount = iStringArray.Count(); - TInt index = 0; - for ( TInt i = 0; i < arrayCount; ++i ) - { - const TDesC& smileString( iStringArray[ i ]->SmileString() ); - index = fixedText.Find( smileString ); - while ( index != KErrNotFound ) - { - CIMCVAppSmileyInformation* smileInfo = CIMCVAppSmileyInformation::NewL(); - CleanupStack::PushL( smileInfo ); - - smileInfo->SetPosition( index + aStartPos ); - smileInfo->SetIndex( iStringArray[ i ]->SmileIconIndex() ); - smileInfo->SetSmileyStringL( smileString ); - smileInfo->SetIcon( EFalse ); - - User::LeaveIfError( aSmileyInfoArray.Append( smileInfo ) ); - CleanupStack::Pop( smileInfo ); - - TInt smilyLength = smileString.Length(); - // Only replace the same amount of chars than in smiley, so we - // don't mess up the length or index table. - fixedText.Replace( index, - smilyLength, - replace.Left( smilyLength ) ); - index = fixedText.Find( smileString ); - } // while - } // for i - - aSmileyInfoArray.Sort( order ); - if( aFixedStr ) - { - *aFixedStr = fixedText; - } - - CleanupStack::PopAndDestroy( 2, text ); // replaceString, text - CleanupStack::Pop(&aSmileyInfoArray); - - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::SearchSmilesL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconUtility::Compare -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CIMCVAppSmileIconUtility::Compare( const CIMCVAppSmileyInformation& aFirst, - const CIMCVAppSmileyInformation& aSecond ) - { - return ( aFirst.Position() - aSecond.Position() ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconUtility::CompareSmileyLengthReversed -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppSmileIconUtility::CompareSmileyLengthReversed( - const CIMCVAppSmileString& aFirst, - const CIMCVAppSmileString& aSecond ) - { - return ( aSecond.SmileString().Length() - aFirst.SmileString().Length() ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileIconUtility::ResizeIcons -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileIconUtility::ResizeIcons( const TSize& aSize ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::ResizeIcons() start") ); - TInt count( SmileIconCount() ); - for( TInt i(0); i < count; i++) - { - AknIconUtils::SetSize( iSmileDlgIconArray[ i ]->Bitmap(), aSize ); - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::ResizeIcons() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconUtility::GetFirstSmileyIndex -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppSmileIconUtility::GetFirstSmileyIndex( TInt aIconIndex ) const - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::GetFirstSmileyIndex() start") ); - TInt count = iStringArray.Count(); - - for( TInt i = 0; i < count; ++i ) - { - if( iStringArray[ i ]->SmileIconIndex() == aIconIndex ) - { - return i; - } - } - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::GetFirstSmileyIndex() end") ); - // Icon was not found. - return KErrNotFound; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconUtility::ResourceChangedL -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileIconUtility::ResourceChangedL() - { - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::ResourceChangedL() start") ); - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::ResourceChangedL() end") ); - } - - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappsmilestring.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappsmilestring.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Class for storing one smiley with index to icon array. -* -*/ - - -// INCLUDE FILES -#include "cimcvappsmilestring.h" -#include "imcvlogger.h" - -// ================= MEMBER FUNCTIONS ======================= - -// Two-phased constructor. -CIMCVAppSmileString* CIMCVAppSmileString::NewL() - { - IM_CV_LOGS(TXT("CIMCVAppSmileString::NewL() start") ); - CIMCVAppSmileString* self = new (ELeave) CIMCVAppSmileString(); - IM_CV_LOGS(TXT("CIMCVAppSmileString::NewL() end") ); - return self; - } - -// Destructor -CIMCVAppSmileString::~CIMCVAppSmileString() - { - if(iSmiley) - { - delete iSmiley; - iSmiley = NULL; - } - if(iShortestSmileyString) - { - delete iShortestSmileyString; - iShortestSmileyString = NULL; - } - } - -// C++ constructor can NOT contain any code, that -// might leave. -// -CIMCVAppSmileString::CIMCVAppSmileString() - { - } - -// --------------------------------------------------------- -// CIMCVAppSmileString::SmileIconIndex -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CIMCVAppSmileString::SmileIconIndex() const - { - return iIndex; - } - -// --------------------------------------------------------- -// CIMCVAppSmileString::SmileString -// (other items were commented in a header). -// --------------------------------------------------------- -// -const TDesC& CIMCVAppSmileString::SmileString() const - { - return *iSmiley; - } - -// --------------------------------------------------------- -// CIMCVAppSmileString::Set -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileString::Set( const HBufC* aSmileyString, TInt aIndex ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileString::Set() start") ); - // detect (ignore) double assignment - if( aSmileyString != iSmiley ) - { - delete iSmiley; - iSmiley = aSmileyString; - } - iIndex = aIndex; - IM_CV_LOGS(TXT("CIMCVAppSmileString::Set() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileString::SetShortestSmileStringL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileString::SetShortestSmileStringL( const TDesC& aSmileyString ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileString::SetShortestSmileStringL() start") ); - HBufC* temp = aSmileyString.AllocL(); - delete iShortestSmileyString; - iShortestSmileyString = temp; - IM_CV_LOGS(TXT("CIMCVAppSmileString::SetShortestSmileStringL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileString::HasShortestString -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CIMCVAppSmileString::HasShortestString() const - { - return iShortestSmileyString ? ETrue : EFalse; - } - -// --------------------------------------------------------- -// CIMCVAppSmileString::ShortestSmileString -// (other items were commented in a header). -// --------------------------------------------------------- -// -const TDesC& CIMCVAppSmileString::ShortestSmileString() const - { - return *iShortestSmileyString; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappsmileyinformation.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappsmileyinformation.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* Copyright (c) 2006 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: Storage to save smiley information -* -*/ - - -// INCLUDES -#include "cimcvappsmileyinformation.h" -#include "imcvlogger.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::CIMCVAppSmileyInformation() -// --------------------------------------------------------------------------- -// -CIMCVAppSmileyInformation::CIMCVAppSmileyInformation() - { - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::NewL() -// --------------------------------------------------------------------------- -// -CIMCVAppSmileyInformation* CIMCVAppSmileyInformation::NewL() - { - IM_CV_LOGS(TXT("CIMCVAppSmileyInformation::NewL() start") ); - CIMCVAppSmileyInformation* self = new (ELeave) CIMCVAppSmileyInformation; - IM_CV_LOGS(TXT("CIMCVAppSmileyInformation::NewL() end") ); - return self; - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::~CIMCVAppSmileyInformation() -// --------------------------------------------------------------------------- -// -CIMCVAppSmileyInformation::~CIMCVAppSmileyInformation() - { - if(iSmileyString) - { - delete iSmileyString; - iSmileyString = NULL; - } - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::Position() -// --------------------------------------------------------------------------- -// -TInt CIMCVAppSmileyInformation::Position() const - { - return iPosition; - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::SetPosition() -// --------------------------------------------------------------------------- -// -void CIMCVAppSmileyInformation::SetPosition( TInt aPosition ) - { - iPosition = aPosition; - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::Index() -// --------------------------------------------------------------------------- -// -TInt CIMCVAppSmileyInformation::Index() const - { - return iIndex; - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::SetIndex() -// --------------------------------------------------------------------------- -// -void CIMCVAppSmileyInformation::SetIndex( TInt aIndex ) - { - iIndex = aIndex; - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::SmileyString() -// --------------------------------------------------------------------------- -// -const TDesC& CIMCVAppSmileyInformation::SmileyString() const - { - return *iSmileyString; - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::SetSmileyStringL() -// --------------------------------------------------------------------------- -// -void CIMCVAppSmileyInformation::SetSmileyStringL( const TDesC& aSmiley ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileyInformation::SetSmileyStringL() start") ); - HBufC* smile = aSmiley.AllocL(); - delete iSmileyString; - iSmileyString = smile; - IM_CV_LOGS(TXT("CIMCVAppSmileyInformation::SetSmileyStringL() end") ); - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::IsIcon() -// --------------------------------------------------------------------------- -// -TBool CIMCVAppSmileyInformation::IsIcon() const - { - return iIsIcon; - } - -// --------------------------------------------------------------------------- -// CIMCVAppSmileyInformation::SetIcon() -// --------------------------------------------------------------------------- -// -void CIMCVAppSmileyInformation::SetIcon( TBool aIsIcon ) - { - iIsIcon = aIsIcon; - } diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappsmileyutil.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappsmileyutil.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,627 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Utility for selecting smile icon and converting -* between smile id and smile string. -* -*/ - -// INCLUDE FILES -#include "cimcvappsmileyutil.h" -#include "cimcvapppicture.h" -#include "cimcvappsmileyinformation.h" - -#include - -#include -#include -#include -#include -#include -#include "imcvlogger.h" -#include "imcvuiliterals.h" -#include "cimcvengine.h" -//CONSTANT -const TInt KChatSmileyLength( 3 ); -_LIT(KSpace, " "); - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppSmileyUtil* CIMCVAppSmileyUtil::NewL( - MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, TMessageExtensionTypes aType, - CIMCVEngine& aServiceEngine) - { - CIMCVAppSmileyUtil* self = new (ELeave) CIMCVAppSmileyUtil( aType ); - CleanupStack::PushL( self ); - self->ConstructL( aSkinVariant, aAppUi,aServiceEngine ); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::~CIMCVAppSmileyUtil -// Destructor -// ----------------------------------------------------------------------------- -// -CIMCVAppSmileyUtil::~CIMCVAppSmileyUtil() - { - iConvertArray.ResetAndDestroy(); - delete iSmileUtil; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::CIMCVAppSmileyUtil -// C++ constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppSmileyUtil::CIMCVAppSmileyUtil( TMessageExtensionTypes aType ) -: MIMCVAppMessageExtension( aType) - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::ConstructL -// ConstructL -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileyUtil::ConstructL( - MIMCVUiAppSkinVariant& aSkinVariant, - MIMCVAppUi& aAppUi, - CIMCVEngine& aServiceEngine ) - { - iServiceId = aServiceEngine.GetServiceId(); - iSmileUtil = CIMCVAppSmileIconUtility::NewL(aSkinVariant, aAppUi, aServiceEngine ); - } - - -// --------------------------------------------------------- -// CIMCVAppSmileyUtil::InsertExtensionL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileyUtil::InsertExtensionL( CEikRichTextEditor& aEditor, - TBool& aCancelled, TSize asize ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::InsertExtensionL() start") ); - TInt bitmapId( KErrNone ); - TInt retVal = iSmileUtil->LaunchSmileIconDialogL( bitmapId ); - iSmileUtil->ResizeIcons(asize); - if( retVal ) - { - // check if there is room for icon, if not return - if( ( aEditor.MaxLength() - aEditor.TextLength() ) < KChatSmileyLength ) - { - return; - } - //we don't own this - const TDesC& iconString = iSmileUtil->GetSmileString(bitmapId); - TInt cursorPos = aEditor.CursorPos(); - HBufC* msgBuf = aEditor.GetTextInHBufL(); - CleanupStack::PushL( msgBuf ); - if(msgBuf) - { - TPtr msgPtr( msgBuf->Des() ); - aEditor.RichText()->InsertL(cursorPos,iconString); - cursorPos = aEditor.TextLength(); - aEditor.SetCursorPosL( cursorPos, EFalse); - } - else - { - aEditor.RichText()->InsertL(cursorPos,iconString); - cursorPos = aEditor.TextLength(); - aEditor.SetCursorPosL( cursorPos, EFalse); - } - CleanupStack::PopAndDestroy( msgBuf ); // msgBuf - if( &aEditor != iEditor ) - { - iEditor = &aEditor; - iCurrentCount = 1; - } - else - { - ++iCurrentCount; - } - - aCancelled = EFalse; - } - else - { - // apply formatting even in case of cancel, as the sizes of icons would have changed and when - // shifted from portrait to landscape and vice versa, alignment differs. - TCharFormat charFormat; - TCharFormatMask charFormatMask; - - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::InsertExtensionL() before applying format") ); - charFormat.iFontPresentation.iPictureAlignment = TFontPresentation::EAlignCentered; - charFormatMask.SetAttrib( EAttFontPictureAlignment ); - aEditor.RichText()->ApplyCharFormatL( charFormat, charFormatMask, 0, - aEditor.TextLength() ); - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::InsertExtensionL() after applying format") ); - aEditor.HandleTextChangedL (); - aCancelled = ETrue; - } - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::InsertExtensionL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileyUtil::ExtensionToStringL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileyUtil::ExtensionToStringL( CEikRichTextEditor& anEditor, TDes& aDes ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ExtensionToStringL() start") ); - RArray iconIndArray; - CleanupClosePushL( iconIndArray ); - - CPicture* editorPic; - TInt i; - TInt limit( 0 ); - - // for loop gets icon positions to array - TInt length = aDes.Length(); - for( i = 0; i < length; ++i ) - { - if( aDes[ i ] == CEditableText::EPictureCharacter ) - { - User::LeaveIfError( iconIndArray.Append( i ) ); - } - } - - // real count of pictures - TInt count = anEditor.RichText()->PictureCount(); - TInt indCount = iconIndArray.Count(); - - if( &anEditor != iEditor ) - { - Reset(); - } - - // whisper message - if( indCount > iCurrentCount ) - { - limit = indCount - iCurrentCount; - } - - if( indCount > 0 ) - { - for( i = count; i > limit; --i ) - { - editorPic = anEditor.RichText()->PictureHandleL( - iconIndArray[ i - 1 ], MLayDoc::EForceLoadTrue ); - if ( !editorPic ) - { - User::Leave( KErrBadHandle ); - } - - CIMCVAppPicture* icon = static_cast ( editorPic ); - - TInt oldLen = aDes.Length(); - //delete padding char - aDes.Delete( iconIndArray[ i - 1 ], 1 ); // 1 = one char - //insert string smiley - aDes.Insert( iconIndArray[ i - 1 ], - iSmileUtil->GetSmileString( icon->Index() ) ); - } - } - CleanupStack::PopAndDestroy(); // iconIndArray.Close() - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ExtensionToStringL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::ConvertSelectionToExtensionL -// Convert selection smileys to icons. -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileyUtil::ConvertSelectionToExtensionL( CEikRichTextEditor& aEditor ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ConvertSelectionToExtensionL() start") ); - TInt selectAdd( 0 ); - - // for loop gets icon positions to array - TInt start = aEditor.Selection().LowerPos(); - TInt end = aEditor.Selection().HigherPos(); - - // Clear convert array, it has something, but its not correct - iConvertArray.ResetAndDestroy(); - - const TInt KMaxLength( KDefaultMsgLength ); - HBufC* des = HBufC::NewLC( KMaxLength ); - TPtr desText( des->Des() ); - - aEditor.GetText( desText ); - TInt txtLen = desText.Length(); - if ( txtLen < end ) - { - end = txtLen; - } - desText.Delete( end, txtLen - end ); - desText.Delete( 0, start ); - - iSmileUtil->SearchSmilesL( desText, iConvertArray, NULL, start ); - - #ifdef _DEBUG - TPtrC myDebug( aEditor.Text()->Read( 0 ) ); - #endif - - for( TInt a( iConvertArray.Count() - 1 ); a >= 0; --a ) - { - if( iConvertArray[ a ]->Position() >= start && iConvertArray[ a ]->Position() < end ) // do we convert or not - { - TPictureHeader picHeader; - // Insert icon in place - - //we don't own this - CGulIcon* icon = const_cast( - iSmileUtil->GetSmileIcon( iConvertArray[ a ]->Index() ) ); - - //create CIMCVAppPicture from selected icon - CIMCVAppPicture* smileIcon = new ( ELeave ) CIMCVAppPicture( - *CCoeEnv::Static()->SystemGc().Device(), - icon, - iConvertArray[ a ]->Index() ); - - picHeader.iPicture = TSwizzle( smileIcon ); - aEditor.Text()->DeleteL( iConvertArray[ a ]->Position(), - iConvertArray[ a ]->SmileyString().Length() ); - - #ifdef _DEBUG - myDebug.Set( aEditor.Text()->Read( 0 ) ); - - #endif - - aEditor.RichText()->InsertL( iConvertArray[ a ]->Position(), picHeader ); - - #ifdef _DEBUG - myDebug.Set( aEditor.Text()->Read( 0 ) ); - - #endif - - selectAdd -= iConvertArray[ a ]->SmileyString().Length() - 1; - - // icon is inserted, and it should be converted to text - // before sending, so it needs extra chars according to smiley string length - TInt textLimit = - aEditor.MaxLength() - iConvertArray[ a ]->SmileyString().Length(); - TInt currentlength = aEditor.Text()->DocumentLength(); - aEditor.SetTextLimit( Max( textLimit, currentlength ) ); - - if( &aEditor != iEditor ) - { - iEditor = &aEditor; - iCurrentCount = 1; - } - else - { - ++iCurrentCount; - } - } - } - - // Apply formatting - TInt selectionLen = end + selectAdd - start; - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormat.iFontPresentation.iPictureAlignment = - TFontPresentation::EAlignCentered; - charFormatMask.SetAttrib( EAttFontPictureAlignment ); - aEditor.RichText()->ApplyCharFormatL( charFormat, charFormatMask, - start, selectionLen ); - - // Handle changes in editor - aEditor.TextView()->HandleGlobalChangeL(); - - // Set selection to correct after adding images - aEditor.SetSelectionL( start, end + selectAdd ); - - // Clear convert array - iConvertArray.ResetAndDestroy(); - - CleanupStack::PopAndDestroy( des ); - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ConvertSelectionToExtensionL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::ConvertSelectionToExtensionL -// Convert selection smileys to icons. -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileyUtil::ConvertSelectionToExtensionL( CRichText& aRichText, - TCursorSelection& aSelection ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ConvertSelectionToExtensionL() start") ); - TInt start( aSelection.LowerPos() ); - TInt length( aSelection.Length() ); - - // Clear convert array and fetch the text - iConvertArray.ResetAndDestroy(); - HBufC* text = HBufC::NewMaxLC( aRichText.DocumentLength() ); - TPtr desText( text->Des() ); - aRichText.Extract( desText, start, length ); - - iSmileUtil->SearchSmilesL( desText, iConvertArray ); - - for( TInt a( iConvertArray.Count() - 1 ); a >= 0; --a ) - { - TPictureHeader picHeader; - // Insert icon in place - //we don't own this - CGulIcon* icon = const_cast( - iSmileUtil->GetSmileIcon( iConvertArray[ a ]->Index()) ); - - //create CIMCVAppPicture from selected icon - CIMCVAppPicture* smileIcon = new ( ELeave ) CIMCVAppPicture( - *CCoeEnv::Static()->SystemGc().Device(), - icon, - iConvertArray[ a ]->Index()); - - picHeader.iPicture = TSwizzle( smileIcon ); - aRichText.DeleteL( iConvertArray[ a ]->Position() + start, - iConvertArray[ a ]->SmileyString().Length() ); - - aRichText.InsertL( iConvertArray[ a ]->Position() + start, picHeader ); - } - - // clean up - iConvertArray.ResetAndDestroy(); - CleanupStack::PopAndDestroy( text ); - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ConvertSelectionToExtensionL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::ConvertSelectionToStringL -// Convert selection smileys to strings -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileyUtil::ConvertSelectionToStringL( CEikRichTextEditor& aEditor, TBool aPreserve ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ConvertSelectionToStringL() start") ); - // Clear convert array - iConvertArray.ResetAndDestroy(); - - HBufC* text = HBufC::NewMaxLC( KDefaultMsgLength ); - TPtr textCopy( text->Des() ); - aEditor.GetText( textCopy ); - - // for loop gets icon positions to array - TInt start = 0; - TInt end = aEditor.Text()->DocumentLength(); - //aEditor.Selection().HigherPos(); - - TInt i; - for( i = start; i < end; ++i ) - { - if( textCopy[ i ] == CEditableText::EPictureCharacter ) - { - CIMCVAppSmileyInformation* smileInfo = CIMCVAppSmileyInformation::NewL(); - CleanupStack::PushL( smileInfo ); - smileInfo->SetPosition( i ); - smileInfo->SetIcon( ETrue ); - User::LeaveIfError( iConvertArray.Append( smileInfo ) ); - CleanupStack::Pop( smileInfo ); - } - } - - TInt count = iConvertArray.Count(); - for( i = count - 1; i >= 0; --i ) - { - CPicture* editorPic = aEditor.RichText()->PictureHandleL( - iConvertArray[ i ]->Position(), MLayDoc::EForceLoadTrue ); - - if ( !editorPic ) - { - User::Leave( KErrBadHandle ); - } - - CIMCVAppPicture* icon = static_cast ( editorPic ); - - const TDesC& iconString = iSmileUtil->GetSmileString( icon->Index() ); - iConvertArray[ i ]->SetSmileyStringL( iconString ); - iConvertArray[ i ]->SetIndex( icon->Index() ); - } - - textCopy.Delete( end, textCopy.Length() - end ); - textCopy.Delete( 0, start ); - iSmileUtil->SearchSmilesL( textCopy, iConvertArray, NULL, start ); - - // Change icons to strings - TPtrC myDebug( aEditor.Text()->Read( 0 ) ); - - TInt selectAdd( 0 ); - count = iConvertArray.Count(); - for( i = count - 1; i >= 0; --i ) - { - if( iConvertArray[ i ]->IsIcon() ) // Icon - { - TCursorSelection deleteSel( iConvertArray[ i ]->Position(), - iConvertArray[ i ]->Position() + 1 ); - - aEditor.InsertDeleteCharsL( iConvertArray[ i ]->Position(), - iConvertArray[ i ]->SmileyString(), - deleteSel ); - selectAdd += iConvertArray[ i ]->SmileyString().Length() - 1; - //aEditor.SetMaxLength( aEditor.MaxLength() + selectAdd ); - } - } - myDebug.Set( aEditor.Text()->Read( 0 ) ); - - - aEditor.SetSelectionL( start, end + selectAdd ); - aEditor.TextView()->HandleGlobalChangeL(); - - if( !aPreserve ) - { - iConvertArray.ResetAndDestroy(); - } - - CleanupStack::PopAndDestroy( text ); - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ConvertSelectionToStringL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppSmileyUtil::DeleteExtensionL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppSmileyUtil::DeleteExtensionL( CEikRichTextEditor& aEditor, TInt aPos ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::DeleteExtensionL() start") ); - // Set cursor position before deletion. - // Deletion may cause editor size to change and if - // cursor pos is not updated before that ETEXT 12 panic - // is raised. - aEditor.SetCursorPosL( aPos, EFalse ); - aEditor.RichText()->DeleteL( aPos, 1 ); - aEditor.HandleTextChangedL(); - // Ugly hack. Needed to keep alignment of - // cursor correct. - aEditor.SetCursorPosL( aPos, EFalse ); - - // update editors length, it grows by 2 when icon is deleted - TInt textLimit = aEditor.MaxLength() + 2; - aEditor.SetTextLimit( textLimit ); - - --iCurrentCount; - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::DeleteExtensionL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::Reset -// Reset extension -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileyUtil::Reset() - { - iCurrentCount = 0; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::SizeChanged -// Reset extension -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileyUtil::SizeChanged( TSize& aSize ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::SizeChanged() start") ); - iSmileUtil->ResizeIcons( aSize ); - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::SizeChanged() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::ConvertSelectionToStringL -// Convert selection smileys to strings -// ----------------------------------------------------------------------------- -// -void CIMCVAppSmileyUtil::ConvertSelectionToStringL( - CEikRichTextEditor& aEditor, - TDes& aResultString, - TCursorSelection& aSelectionAfterConversion, - TBool aPreserve ) - { - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ConvertSelectionToStringL() start") ); - // Clear convert array - iConvertArray.ResetAndDestroy(); - - // Get text from editor - HBufC* text = HBufC::NewMaxLC( KDefaultMsgLength ); - TPtr textCopy( text->Des() ); - aEditor.GetText( textCopy ); - - // For loop gets icon positions to array - TInt start = aEditor.Selection().LowerPos(); - TInt end = aEditor.Selection().HigherPos(); - - // Copy text to result string - aResultString.Append( textCopy ); - - TInt i = 0; - for( i = start; i < end; ++i ) - { - if ( textCopy[i] == CEditableText::EPictureCharacter ) - { - CIMCVAppSmileyInformation* smileInfo = CIMCVAppSmileyInformation::NewL(); - CleanupStack::PushL( smileInfo ); - smileInfo->SetPosition( i ); - smileInfo->SetIcon( ETrue ); - User::LeaveIfError( iConvertArray.Append( smileInfo ) ); - CleanupStack::Pop( smileInfo ); - } - } - - TInt count = iConvertArray.Count(); - for( i = count - 1; i >= 0; --i ) - { - CPicture* editorPic = NULL; - - editorPic = aEditor.RichText()->PictureHandleL( - iConvertArray[i]->Position(), MLayDoc::EForceLoadTrue ); - - if ( !editorPic ) - { - User::Leave( KErrBadHandle ); - } - - CIMCVAppPicture* icon = static_cast ( editorPic ); - - const TDesC& iconString = iSmileUtil->GetSmileString( icon->Index() ); - iConvertArray[i]->SetSmileyStringL( iconString ); - iConvertArray[i]->SetIndex( icon->Index() ); - } - - textCopy.Delete( end, textCopy.Length() - end ); - textCopy.Delete( 0, start ); - iSmileUtil->SearchSmilesL( textCopy, iConvertArray, NULL, start ); - - // Change icons to strings - TInt selectAdd = 0; - count = iConvertArray.Count(); - for( i = count - 1; i >= 0; --i ) - { - if( iConvertArray[ i ]->IsIcon() ) // Icon - { - // Append smiley string to result - aResultString.Delete( iConvertArray[i]->Position(), 1 ); - aResultString.Insert( iConvertArray[i]->Position(), iConvertArray[i]->SmileyString() ); - selectAdd += iConvertArray[ i ]->SmileyString().Length() - 1; - } - } - - if( !aPreserve ) - { - iConvertArray.ResetAndDestroy(); - } - - // Set correct selection - aSelectionAfterConversion.SetSelection( end + selectAdd, start ); - - CleanupStack::PopAndDestroy( text ); - IM_CV_LOGS(TXT("CIMCVAppSmileyUtil::ConvertSelectionToStringL() end") ); - } -// ----------------------------------------------------------------------------- -// CIMCVAppSmileyUtil::ServiceId -// Convert selection smileys to strings -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppSmileyUtil::ServiceId() const - { - return iServiceId; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappstatuspanehandler.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappstatuspanehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,890 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Handles statuspane, context pane, navi pane -<<<<<<< C:\DOCUME~1\mbn\LOCALS~1\Temp\cimcvappstatuspanehandler-3_GAA.cpp -* -*/ - - -// INCLUDE FILES -#include "cimcvappstatuspanehandler.h" -#include "mimcvtabobserver.h" - - -// for logs -#include "imcvlogger.h" -//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// system includes -#include -#include -#include -#include "cimcvenginefactory.h" -#include "mimcvenginefactory.h" -const TUint16 KNewMessageIcon( 0xF818 ); - -// ================= MEMBER FUNCTIONS ======================= -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::ConstructL -// (other items were commented in a header). -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppStatusPaneHandler::CIMCVAppStatusPaneHandler(MIMCVEngineFactory& aEngineFactory): - iEngineFactory( aEngineFactory ) - { - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::CIMCVAppStatusPaneHandler()" )); - } -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::ConstructL -// (other items were commented in a header). -// Symbian OS default constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::ConstructL() - { - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::ConstructL() start" )); - // Get pointer to status-pane - CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()-> - StatusPane(); - - iNaviPane = static_cast( - statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - - // Get pointer to title-pane - iTitlePane = static_cast( statusPane->ControlL( - TUid::Uid( EEikStatusPaneUidTitle ) ) ); - - iContextPane = static_cast( statusPane->ControlL( - TUid::Uid( EEikStatusPaneUidContext ) ) ); - - iNewMsgIcon = HBufC::NewL( 1 ); - - TPtr iconPtr( iNewMsgIcon->Des() ); - iconPtr.Append( TChar( KNewMessageIcon ) ); - - InitMessageIndicatorL(); - - //Get the service id - this property is published by imcvlauncher - TInt error = RProperty::Get( KMeCoPropertyUid, KMeCoConvViewServiceIdKey, iServiceId ); - User::LeaveIfError(error); - - iEngineFactory.RegisterOpenChatObserver(this); - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::ConstructL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::NewL -// (other items were commented in a header). -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppStatusPaneHandler* CIMCVAppStatusPaneHandler::NewL(MIMCVEngineFactory& aEngineFactory) - { - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::NewL() start" )); - CIMCVAppStatusPaneHandler* self = new ( ELeave ) CIMCVAppStatusPaneHandler( aEngineFactory ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::NewL() end" )); - return self; - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::~CIMCVAppStatusPaneHandler -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CIMCVAppStatusPaneHandler::~CIMCVAppStatusPaneHandler() - { - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::~CIMCVAppStatusPaneHandler() start" )); - - if (iLastTitle) - { - delete iLastTitle; - iLastTitle = NULL; - } - DestroyMessageIndicator(); - - iObserverList.Reset(); - - delete iNewMsgIcon; - delete iNewDecoratedTabGroup; - - iEngineFactory.UnRegisterOpenChatObserver(); - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::~CIMCVAppStatusPaneHandler() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::SetPicture -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::SetPicture( const CFbsBitmap* aPicture , - const CFbsBitmap* aMask ) - { - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::SetPicture() start" )); - TBool landscape( Layout_Meta_Data::IsLandscapeOrientation() ); - - TBool cpVisible( iContextPane ? iContextPane->IsVisible() : EFalse ); - TBool useTitle( !cpVisible || landscape ); - if( useTitle ) - { - iTitlePane->SetSmallPicture(aPicture, aMask ,useTitle ); - } - else - { - iContextPane->SetPicture( aPicture, aMask ); - } - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::SetPicture() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::SetTitleL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::SetTitleL( const TDesC& aTitle ) - { - - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::SetTitleL() start %S" ), &aTitle); - iTitlePane->SetTextL( aTitle ); - if (iLastTitle) - { - delete iLastTitle; - iLastTitle = NULL; - } - iLastTitle = aTitle.AllocL(); - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::SetTitleL() end" )); - } - - - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::ShowTabGroupL -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CIMCVAppStatusPaneHandler::ShowTabGroupL( const TDesC& aId, - const TBool noCreate /* = EFalse */ ) - { - - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::ShowTabGroupL() start %S" ), &aId); - iPrevTabId = 0; - iCurrentTabId =0; - - iCurrentTabId = iEngineFactory.FindIndexL(aId); - - CreateTabsL(noCreate); - - - return iCurrentTabId; - } - - - - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::CreateTabsL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::CreateTabsL(const TBool noCreate) - { - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::CreateTabs() start " )); - iOpenChatArrayCount = iEngineFactory.Count(); - - - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::CreateTabs() OPEN CHAT ARRAY COUNT %d" ), iOpenChatArrayCount); - if ( (noCreate) && (iNewDecoratedTabGroup) ) - { - - CAknTabGroup* origtabGroup = - static_cast( iNewDecoratedTabGroup->DecoratedControl() ); - - if ( origtabGroup->TabCount() == (iOpenChatArrayCount-1) ) - { - - for (TInt index=0; indexReplaceTabTextL(index, iNewMsgIcon->Des()); - } - else - { - origtabGroup->ReplaceTabTextL( index, iEngineFactory.GetDisplayNameL(index) ); - } - } - - return; - - } - - } - - - CAknNavigationDecorator* tmpDecoration = iNaviPane->CreateTabGroupL(); - - CleanupStack::PushL( tmpDecoration ); - - CAknTabGroup* tabGroup = - static_cast( tmpDecoration->DecoratedControl() ); - - if( iOpenChatArrayCount > 2 ) - { - tabGroup->SetTabFixedWidthL( EAknTabWidthWithThreeTabs ); - } - else if ( iOpenChatArrayCount == 2 ) - { - tabGroup->SetTabFixedWidthL( EAknTabWidthWithTwoTabs ); - } - else - { - tabGroup->SetTabFixedWidthL( EAknTabWidthWithOneTab ); - } - - - tabGroup->SetObserver( this ); - - - for (TInt index=0; indexAddTabL(index, iNewMsgIcon->Des()); - } - else - { - if ( 1 == iOpenChatArrayCount ) - { - // When a single conversation exists , no need to display name on tab - tabGroup->AddTabL( index, KNullDesC ); - } - else - { - // When more than one conversation exists , display names are displayed on the tabs - tabGroup->AddTabL( index, iEngineFactory.GetDisplayNameL(index) ); - } - } - } - - CleanupStack::Pop( tmpDecoration ); - - delete iNewDecoratedTabGroup; - iNewDecoratedTabGroup = tmpDecoration; - - ShowTabL(); - - - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::CreateTabs() end" )); - - } - - - - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::TabChangedL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::TabChangedL(TInt aIndex) - { - TInt activechatitemindex; - CAknTabGroup* tabGroup = static_cast( - iNewDecoratedTabGroup->DecoratedControl()); - if ( tabGroup ) - { - tabGroup->SetActiveTabByIndex( aIndex ); - iEngineFactory.SetActiveItemL(tabGroup->ActiveTabId()); - iPrevTabId = iCurrentTabId; - iCurrentTabId = tabGroup->ActiveTabId(); - // Get the corrent position in open chat array using tab id - if( iOpenChatArrayCount > iEngineFactory.Count() ) - { - activechatitemindex = (( iPrevTabIdReplaceTabTextL( iCurrentTabId, iEngineFactory.GetDisplayNameL(activechatitemindex) ); // replace of iCurrentTabId using activechatitemindex - for (TInt index=0; indexSwitchTabL( iEngineFactory.GetActiveServiceId(), iEngineFactory.GetTargetIdL(iCurrentTabId), iCurrentTabId ); - } - - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler: AddObserver -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::AddObserver( - MIMCVTabObserver* aObserver) - { - - ASSERT( aObserver); - TInt status( iObserverList.Find( aObserver ) ); - if ( status == KErrNotFound ) - { - status = iObserverList.Append( aObserver ) ; - if( status != KErrNone) - { - CActiveScheduler::Current()->Error( status ); - } - } - - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler: RemoveObserver -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::RemoveObserver( - MIMCVTabObserver* aObserver ) - { - - ASSERT( aObserver); - const TInt status( iObserverList.Find( aObserver ) ); - if ( status != KErrNotFound ) - { - iObserverList.Remove( status ); - iObserverList.Compress(); - } - - - } - - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::ShowTabL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::ShowTabL() - { - CAknTabGroup* tabGroup = static_cast( - iNewDecoratedTabGroup->DecoratedControl()); - - tabGroup->SetActiveTabById( iCurrentTabId ); - iEngineFactory.SetActiveItemL(iCurrentTabId); - - /* Pushes new decorator object to top of the stack and draws it*/ - - iNaviPane->PushL( *iNewDecoratedTabGroup ); - - } - - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::HideTab -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::HideTab() - { - - /* Pops*/ - iNaviPane->Pop( iNewDecoratedTabGroup ); - - } - - - - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::SetActiveTabByIndexL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::SetActiveTabByIndexL( const TInt aIndex ) - { - - CAknTabGroup* tabGroup = static_cast( - iNewDecoratedTabGroup->DecoratedControl()); - - if (!tabGroup) - { - return ; - } - - iCurrentTabId = aIndex; - - TRAP_IGNORE( tabGroup->ReplaceTabL( iCurrentTabId, - iEngineFactory.GetDisplayNameL(iCurrentTabId) ) ); - - tabGroup->SetActiveTabById( iCurrentTabId ); - - iEngineFactory.SetActiveItemL(iCurrentTabId); - - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::RefreshTitlePaneTextL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::RefreshTitlePaneTextL() - { - // seems that this is the only way that the title pane text color updates.. - if( iTitlePane->Text() ) - { - HBufC* origText = iTitlePane->Text()->AllocLC(); - HBufC* empty = HBufC::NewLC( 1 ); - iTitlePane->SetText( empty ); - iTitlePane->SetText( origText); - CleanupStack::Pop( 2, origText ); // empty, origText - } - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::TabGroup -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CAknTabGroup* CIMCVAppStatusPaneHandler::TabGroup() const - { - // Returns pointer to topmost decorator's tabgroup - return static_cast( - iNewDecoratedTabGroup->DecoratedControl() ); - } - - - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::PopNaviPane -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::PopNaviPane() - { - // Pops the topmost decorator out of decorator stack. - iNaviPane->Pop(); - - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::ClearNaviPaneL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::ClearNaviPaneL( TBool aAllowDuplicates ) - { - // Pushes default decorator object (empty one) - // to top of the stack and draws it. if aAllowDuplicates is ETrue - // the new empty decorator is created on top of the stack, rather than - // raising the existing one. - iNaviPane->PushDefaultL( aAllowDuplicates ); - } - - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::HandleChangeL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::HandleChangeL(TInt /*aServiceId*/, TInt aIndex, TOpenChatsEventType aChangeType) - { - switch( aChangeType ) - { - case ENewChat: - { - if( iCurrentTabId >= aIndex ) - { - iCurrentTabId = iCurrentTabId+1; - iEngineFactory.SetActiveItemL( iCurrentTabId ); - } - const TDesC& chatId ( iEngineFactory.GetActiveItemL() ); - TRAP_IGNORE( - { - if ( (iCurrentTabId == -1) || (!chatId.Length()) ) - { - ShowTabGroupL(iEngineFactory.GetTargetIdL(aIndex)); - } - else - { - ShowTabGroupL(chatId) ; - } - } - ); - break; - } - case EChatClosed: - { - if( aIndex == 0 ) - { - return; - } - iEngineFactory.SetActiveItemL( aIndex -1 ); - - const TDesC& chatId (iEngineFactory.GetActiveItemL()); - - TRAP_IGNORE( - { - if ( (iCurrentTabId == -1) || (!chatId.Length()) ) - { - ShowTabGroupL(iEngineFactory.GetTargetIdL(aIndex)); - } - else - { - ShowTabGroupL(chatId) ; - } - } - ); - - break; - } - - - case EUnReadCountChanged: - { - - const TDesC& chatId (iEngineFactory.GetActiveItemL()); - - if (!chatId.Length()) - { - break; - } - - TRAP_IGNORE( - { - ShowTabGroupL(chatId, ETrue); - PushFadeTextL(); - ShowFadeText( *iStatusPaneText ); - delete iStatusPaneText; - iStatusPaneText = NULL; - } - ); - - break; - } - - default: - { - //should never be here. - break; - } - } - - - } - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::SetStatusMsgL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::SetStatusMsgL(TInt /*aServiceId*/, TInt aIndex,const TDesC & aMsg) - { - if(aIndex>=0) - { - _LIT(KColun, ": "); - iStatusPaneText = HBufC::NewL(iEngineFactory.GetTargetIdL(aIndex).Length() + - aMsg.Length() + KColun().Length()); - TPtr statusPanePtr(iStatusPaneText->Des()); - - statusPanePtr.Copy(iEngineFactory.GetTargetIdL(aIndex)); - statusPanePtr.Append(KColun); - statusPanePtr.Append(aMsg); - } - } - - - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::RunFadeText() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::RunFadeText() - { - static_cast(iDecoratedFadeText->DecoratedControl())->Start(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::HideFadeText -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::HideFadeText() - { - if ( iDecoratedFadeText ) - { - iNaviPane->Pop( iDecoratedFadeText ); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::ShowFadeText -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::ShowFadeText( TDesC& aTextToFade ) - { - IMessageIndicator()->SetMessage( aTextToFade ); - RunFadeText(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::ShowNavipaneIndicators -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::ShowNavipaneIndicators() - { - MAknEditingStateIndicator* editStateIndicator = - CAknEnv::Static()->EditingStateIndicator(); - - if ( editStateIndicator ) - { - CAknIndicatorContainer* indicatorContainer = editStateIndicator->IndicatorContainer(); - - if( indicatorContainer ) - { - indicatorContainer->SetIndicatorState( - TUid::Uid( EAknNaviPaneEditorIndicatorMessageInfo ), - EAknIndicatorStateOn ); - } - } - } - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::HideNavipaneIndicators() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::HideNavipaneIndicators() - { - MAknEditingStateIndicator* editStateIndicator = - CAknEnv::Static()->EditingStateIndicator(); - - if ( editStateIndicator ) - { - CAknIndicatorContainer* indicatorContainer = editStateIndicator->IndicatorContainer(); - - if( indicatorContainer ) - { - indicatorContainer->SetIndicatorState( - TUid::Uid( EAknNaviPaneEditorIndicatorMessageInfo ), - EAknIndicatorStateOff ); - } - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::IMessageIndicator -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CIMCVNewMsgFadeControl* CIMCVAppStatusPaneHandler::IMessageIndicator() const - { - if( iDecoratedFadeText ) - { - return static_cast(iDecoratedFadeText->DecoratedControl()); - } - else - { - return NULL; - } - - } - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::PushFadeTextL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::PushFadeTextL() - { - if ( iDecoratedFadeText ) - { - iNaviPane->PushL( *iDecoratedFadeText ); - } - } - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::ResetFadeText() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::ResetFadeText() - { - IMessageIndicator()->Reset(); - } - - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::InitMessageIndicatorL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::InitMessageIndicatorL() - { - CAknNavigationDecorator* fade = CreateIMessageIndicatorL(); - delete iDecoratedFadeText; - iDecoratedFadeText = fade; - } - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::DestroyMessageIndicator() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::DestroyMessageIndicator() - { - delete iDecoratedFadeText; - iDecoratedFadeText = NULL; - } -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::CreateIMessageIndicatorL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknNavigationDecorator* CIMCVAppStatusPaneHandler::CreateIMessageIndicatorL() - { - - CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()-> - StatusPane(); - - CIMCVNewMsgFadeControl* fadetext = CIMCVNewMsgFadeControl::NewLC( - statusPane->PaneRectL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - fadetext->SetContainerWindowL( *iNaviPane ); - - CAknNavigationDecorator* decoratedFadetext = - CAknNavigationDecorator::NewL( iNaviPane, fadetext, - CAknNavigationDecorator::EHintText ); - - CleanupStack::Pop( fadetext ); - CleanupStack::PushL( decoratedFadetext ); - decoratedFadetext->SetContainerWindowL( *iNaviPane ); - decoratedFadetext->SetControlContext( iNaviPane ); - decoratedFadetext->MakeScrollButtonVisible( EFalse ); - - CleanupStack::Pop( decoratedFadetext ); - - return decoratedFadetext; - } - -// --------------------------------------------------------- -// CIMCVAppStatusPaneHandler::ClearTitlePaneL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::ClearTitlePaneL( ) - { - iTitlePane->SetTextL( _L(" ") ); - iTitlePane->SetSmallPicture( NULL, NULL, EFalse ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::SetPreviousTitleL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::SetPreviousTitleL() - { - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::SetPreviousTitleL() start" )); - - HBufC* setTitle = NULL; - if (iLastTitle) - { - setTitle = iLastTitle->AllocLC(); - } - else - { - setTitle = KNullDesC().AllocLC(); - } - SetTitleL(*setTitle); - CleanupStack::PopAndDestroy(); - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::SetPreviousTitleL() end" )); - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::SendBackGroundL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::SendBackGroundL() - { - ClearTitlePaneL(); - ClearNaviPaneL(ETrue); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppStatusPaneHandler::BringToForegroundL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::BringToForegroundL() - { - SetPreviousTitleL(); - ShowTabL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::RefreshTabL() -// ----------------------------------------------------------------------------- -// -void CIMCVAppStatusPaneHandler::RefreshTabL(const TDesC& aUserId, const TDesC& aDisplayName) - { - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::RefreshTab() Start" )); - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::RefreshTab()aUserId: %S " ), &aUserId); - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::RefreshTab() aDisplayName : %S " ), &aDisplayName); - // find if itsthe active conversation, only then the - // the statuspane title and tab text should be updated. - CAknTabGroup* tabGroup = static_cast( - iNewDecoratedTabGroup->DecoratedControl()); - if (tabGroup) - { - TInt index = iEngineFactory.FindIndexL(aUserId); - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::RefreshTab() Get the index %d" ), index); - if(KErrNotFound != index) - { - const TDesC& activeContversationName = iEngineFactory.GetTargetIdL(index); - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::RefreshTab(): %S " ), &activeContversationName); - - if(activeContversationName.Compare(aUserId) == 0 ) - { - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::RefreshTab(): Inside if" )); - SetTitleL(aDisplayName); - } - // only the tab text needs to be updated. - tabGroup->ReplaceTabTextL( index, aDisplayName); - } - } - IM_CV_LOGS(TXT("CIMCVAppStatusPaneHandler::RefreshTab() End" )); - } -//End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvapptextviewcontrol.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvapptextviewcontrol.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,866 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - - -// INCLUDE FILES -#include "cimcvapptextviewcontrol.h" - -#include "cimcvappcustomdraw.h" -#include // CTextView -#include -#include -#include -#include "mimcvapptextview.h" -#include -#include -#include -#include "imcvlogger.h" -#include "imcvuiapputils.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::CIMCVAppTextViewControl -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppTextViewControl::CIMCVAppTextViewControl() - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::ConstructL( const TRect& aRect, - const CCoeControl& aParent, - MLayDoc* aTextLayout ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::ConstructL() start") ); - CreateWindowL( &aParent ); - - // get the drawing device - CWindowGc& gc = SystemGc(); - CBitmapDevice* device = static_cast( gc.Device() ); - - // create text layout and text view - - iViewRect = aRect; - iClipping = new ( ELeave ) RRegion( aRect ); - - iLayout = CTextLayout::NewL( aTextLayout, iViewRect.Width() ); - iTextView = CTextView::NewL( iLayout, iViewRect, - device, device, &Window(), NULL, &iCoeEnv->WsSession() ); - - iTextView->EnableFlickerFreeRedraw(); - iTextView->SetOpaque( ETrue ); - - // create our background drawer - iCustomDraw = new( ELeave )CIMCVAppCustomDraw( iViewRect ); - iLayout->SetCustomDraw( iCustomDraw ); - - // and scrollbar - if( IMCVUiAppUtils::PenEnabled() ) - { - // Observer - iScrollBar = new( ELeave )CEikScrollBarFrame( this, this ); - } - else - { - // No observer - iScrollBar = new( ELeave )CEikScrollBarFrame( this, NULL ); - } - - - if (AknLayoutUtils::DefaultScrollBarType(iAvkonAppUi) == CEikScrollBarFrame::EDoubleSpan) - { - - // For EDoubleSpan type scrollbar - // If pen is supported, SB needs to own a window - iScrollBar->CreateDoubleSpanScrollBarsL( IMCVUiAppUtils::PenEnabled(), - EFalse, ETrue, EFalse ); - iScrollBar->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan); - - } - else - { - // For EArrowHead type scrollbar - iScrollBar->SetTypeOfVScrollBar(CEikScrollBarFrame::EArrowHead); - } - iScrollBar->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EOn ); - TEikScrollBarModel vSbarModel; - vSbarModel.iThumbPosition = 0; // current position - vSbarModel.iScrollSpan = 0; // how many items - vSbarModel.iThumbSpan = 0; // ignored - - iScrollBar->Tile( &vSbarModel ); - iScrollBar->SetVFocusPosToThumbPos( vSbarModel.iThumbPosition ); - - iBgContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMain, Rect(), ETrue ); - iCustomDraw->SetBackgroundContext( iBgContext, this ); - - // set extensions - ActivateL(); - - // we're ready - static_cast( iEikonEnv->AppUi() )->AddToStackL( this ); - iAddedToStack = ETrue; - - // Enable draging - if ( DrawableWindow() && IMCVUiAppUtils::PenEnabled() ) - { - EnableDragEvents(); - Window().SetPointerGrab( ETrue ); - } - - // Enable draging - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::ConstructL() end") ); - } - - -// Destructor -CIMCVAppTextViewControl::~CIMCVAppTextViewControl() - { - if( iAddedToStack ) - { - static_cast( iEikonEnv->AppUi() )->RemoveFromStack( this ); - } - - delete iScrollBar; - delete iCustomDraw; - delete iTextView; - delete iLayout; - - delete iBgContext; - if( iClipping ) - { - iClipping->Destroy(); - iClipping = NULL; - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::UpdateScrollBarsL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::UpdateScrollBarsL( TBool aScrollDraw /*ETrue*/ ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::UpdateScrollBarsL() start") ); - TInt height = iLayout->FormattedHeightInPixels(); - TInt span = iViewRect.Height(); - TInt pos = iLayout->PixelsAboveBand(); - - if( span < 0 ) - { - span = 0; - } - - if( pos < 0 ) - { - pos = 0; - } - - TEikScrollBarModel vSbarModel; - vSbarModel.iThumbPosition = pos; // current position - vSbarModel.iScrollSpan = height; // total length - vSbarModel.iThumbSpan = span; // bar length - - // Double span - if( iScrollBar ) - { - if ( iScrollBar->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan ) - { - TAknDoubleSpanScrollBarModel vDsModel( vSbarModel ); - iScrollBar->Tile( &vDsModel ); - iScrollBar->SetVFocusPosToThumbPos( vDsModel.FocusPosition()); - } - // ArrowHead - else - { - iScrollBar->Tile( &vSbarModel ); - iScrollBar->SetVFocusPosToThumbPos( vSbarModel.iThumbPosition ); - } - if( aScrollDraw ) - { - iScrollBar->DrawScrollBarsNow(); - } - } - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::UpdateScrollBarsL() end") ); - } - -void CIMCVAppTextViewControl::UpdateChatViewL () -{ - UpdateViewL (); -} - - -void CIMCVAppTextViewControl:: SmileyDialogLaunched (TBool aLaunched) -{ - iSmileyDialogLaunched = aLaunched; -} - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::UpdateViewL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::UpdateViewL() - { - // do not refresh if smiley dialog is launched. - if (iSmileyDialogLaunched) - return; - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::UpdateViewL() start") ); - iTextView->FormatTextL(); - iTextView->SetSelectionVisibilityL( EFalse ); - TCursorSelection sel; - // Don't scroll if some item is highlighted - if ( !iIsHighlighted ) - { - sel = TCursorSelection( iLayout->DocumentLength(), 0 ); - ScrollVisibleL( sel, ETrue ); - } - else - { - sel = iTextView->Selection(); - ScrollVisibleL( sel, ETrue ); - } - - DrawDeferred(); - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::UpdateViewL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::SetHighlighted -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::SetHighlighted( TBool aIsHighlighted ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::SetHighlighted() start") ); - iIsHighlighted = aIsHighlighted; - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::SetHighlighted() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::ScrollBarFrame -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -const CEikScrollBarFrame* CIMCVAppTextViewControl::ScrollBarFrame() - { - return iScrollBar; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::ScrollBarFrame -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppTextViewControl::FindDocPos( TPoint aPoint ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::FindDocPos() start") ); - TTmPosInfo2 posInfo; - TBool found = EFalse; - - TRAPD( err, found = iTextView->FindXyPosL( aPoint, posInfo ) ); - if ( err ) - { - CActiveScheduler::Current()->Error( err ); - // Return not found - return KErrNotFound; - } - - if ( found ) - { - - return posInfo.iDocPos.iPos; - } - // not found - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::FindDocPos() end") ); - return KErrNotFound; - } - -// --------------------------------------------------------- -// CIMCVAppTextViewControl::MopSupplyObject -// -// --------------------------------------------------------- -// -TTypeUid::Ptr CIMCVAppTextViewControl::MopSupplyObject( TTypeUid aId ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::MopSupplyObject() start") ); - if ( aId.iUid == MAknsControlContext::ETypeId ) - { - return MAknsControlContext::SupplyMopObject( aId, iBgContext ); - } - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::MopSupplyObject() end") ); - return CCoeControl::MopSupplyObject( aId ); - } - -// --------------------------------------------------------- -// CIMCVAppTextViewControl::HandleScrollEventL -// -// --------------------------------------------------------- -// -void CIMCVAppTextViewControl::HandleScrollEventL( CEikScrollBar* /*aScrollBar*/, - TEikScrollEvent aEventType ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::HandleScrollEventL() start") ); - switch( aEventType ) - { - case EEikScrollUp: - { - ScrollLinesL( 1 ); - break; - } - case EEikScrollDown: - { - ScrollLinesL( -1 ); - break; - } - case EEikScrollPageUp: - { - iTextView->ScrollDisplayL( TCursorPosition::EFPageUp ); - UpdateScrollBarsL(); - DrawDeferred(); - break; - } - case EEikScrollPageDown: - { - iTextView->ScrollDisplayL( TCursorPosition::EFPageDown ); - UpdateScrollBarsL(); - DrawDeferred(); - break; - } - case EEikScrollThumbDragVert: - { - // Get position values from scrollbar - const TEikScrollBarModel* model = - iScrollBar->VerticalScrollBar()->Model(); - TInt thumb = model->iThumbPosition; - if( CEikScrollBarFrame::EDoubleSpan == - iScrollBar->TypeOfVScrollBar() ) - { - const TAknDoubleSpanScrollBarModel* dsModel = - static_cast ( model ); - thumb = dsModel->FocusPosition(); - } - - // Scroll the textview according to scrollbar - TViewYPosQualifier yPosQua; - yPosQua.SetHotSpot( TViewYPosQualifier::EFViewTopOfLine ); - TInt topPos = -thumb; - iTextView->SetViewL( 0, topPos, yPosQua ); - break; - } - case EEikScrollThumbReleaseVert: - { - // Nothing to do here because EEikScrollThumbDragVert gets - // the scrollbar in correct state - break; - } - default: - { - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::HandleScrollEventL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::OfferKeyEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TKeyResponse CIMCVAppTextViewControl::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::OfferKeyEventL() start") ); - // Commented because it generates so much log - // CHAT_DP( D_CHAT_LIT("CIMCVAppTextViewControl::OfferKeyEventL %d, type %d"), - // aKeyEvent, aType ) - - if( aType != EEventKey ) - { - return EKeyWasNotConsumed; - } - - switch( aKeyEvent.iCode ) - { - case EKeyDownArrow: - { - //scroll lines one line down - ScrollLinesL( -1 ); - return EKeyWasConsumed; - - } - case EKeyUpArrow: - { - //scroll lines one line up - ScrollLinesL( 1 ); - return EKeyWasConsumed; - - } - default: - { - // No handling for other events - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::OfferKeyEventL() end") ); - return EKeyWasNotConsumed; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::HandlePointerEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::HandlePointerEventL( - const TPointerEvent& aPointerEvent ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::HandlePointerEventL() start") ); - - if( !IMCVUiAppUtils::PenEnabled() ) - { - return; - } - - switch( iPenType ) - { - case EPenForwardToChild: - { - // normal (CCoeControl) behaviour - CCoeControl::HandlePointerEventL( aPointerEvent ); - break; - } - case EPenForwardToParent: - { - // forward all to parent - if( Parent() ) - { - Parent()->HandlePointerEventL( aPointerEvent ); - } - break; - } - // Process event ourself - case EPenProcessEvent: - { - ProcessStylusEventL( aPointerEvent ); - break; - } - case EPenIgnoreEvent: - { - // Ignore all - break; - } - default: - { - // Can't be - break; - } - } - - - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::HandlePointerEventL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::Draw -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::Draw( const TRect& aRect ) const - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::Draw() start") ); - CWindowGc& gc = SystemGc(); - - // Clip text control and scrollbar to prevent flickering - gc.SetClippingRegion( *iClipping ); - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - if (iBgContext) - { - // Draw the skin background - AknsDrawUtils::Background( - skin, iBgContext, this, gc, aRect); - } - else - { - // clear the area - gc.SetBrushColor( iEikonEnv->ControlColor( EColorWindowBackground, *this ) ); - gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - gc.Clear( aRect ); - } - - TRAP_IGNORE( iTextView->DrawL( aRect ) ); - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::Draw() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::SizeChanged -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::SizeChanged() - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::SizeChanged() start") ); - TAknWindowLineLayout rpLayout( AknLayoutScalable_Apps::list_im_pane( 3 ) ); - TAknLayoutRect rpLayoutRect; - rpLayoutRect.LayoutRect( Rect(), rpLayout ); - - // update rects - iViewRect = rpLayoutRect.Rect(); - - iCustomDraw->SetRect( iViewRect ); - iTextView->SetViewRect( iViewRect ); - iLayout->SetWrapWidth( iViewRect.Width() ); - - if (AknLayoutUtils::DefaultScrollBarType(iAvkonAppUi) == CEikScrollBarFrame::EDoubleSpan) - { - // For EDoubleSpan type scrollbar - TAknWindowLineLayout sbLayout( AknLayoutScalable_Apps::scroll_pane_cp07( 3 ) ); - AknLayoutUtils::LayoutVerticalScrollBar( iScrollBar, Rect(), sbLayout ); - TAknLayoutRect sbLayoutRect; - sbLayoutRect.LayoutRect( Rect(), sbLayout ); - } - if ( iBgContext ) - { - iBgContext->SetRect( Parent()->Rect() ); - iBgContext->SetParentPos( Parent()->PositionRelativeToScreen() ); - } - - // Setup clipping region - iClipping->Clear(); - iClipping->AddRect( Rect() ); - - // clip text control - iClipping->SubRect( iTextView->ViewRect() ); - - // clip scrollbar - if ( iScrollBar->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan) - { - //fix for the tsw bug id:EKYT-7B68G9 //start. - TAknWindowLineLayout sbLayout( AknLayoutScalable_Apps::scroll_pane_cp07( 3 ) ); - AknLayoutUtils::LayoutVerticalScrollBar( iScrollBar, Rect(), sbLayout ); - TAknLayoutRect sbLayoutRect; - sbLayoutRect.LayoutRect( Rect(), sbLayout ); - iClipping->SubRect( sbLayoutRect.Rect() ); - //fix for the tsw bug id:EKYT-7B68G9 //end. - } - - // and update view - TRAPD( err, ScrollLinesL( 0 ); - UpdateViewL() ); - if( err != KErrNone ) - { - CActiveScheduler::Current()->Error( err ); - } - - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::SizeChanged() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::HandleFormatChangedL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::HandleFormatChangedL( TCursorSelection& aChanged, - TBool aPreserveFocus /* = EFalse */ ) - { - if (iSmileyDialogLaunched) - return; - - // rich text has changed, inform viewer - iTextView->SetSelectionVisibilityL( EFalse ); - - if( aPreserveFocus ) - { - // Preserve focus - TCursorSelection sel = iTextView->Selection(); - // This seems to be the only method which doesn't change focus. - // --> so it's possible to preserve focus without flicker - iTextView->HandleGlobalChangeNoRedrawL(); - ScrollVisibleL( sel, EFalse ); - DrawDeferred(); - - } - else - { - // Move focus along with changes - iTextView->HandleRangeFormatChangeL( aChanged, ETrue ); - //ScrollVisibleL( aChanged, ETrue ); - UpdateViewL (); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::HandleInsertDeleteL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::HandleInsertDeleteL( TCursorSelection& aChanged, - TInt aDeletedChars ) - { - if (iSmileyDialogLaunched) - return; - - // inform about insertion or deletion - iTextView->SetSelectionVisibilityL( EFalse ); - iTextView->HandleInsertDeleteL( aChanged, aDeletedChars ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::HandleAdditionL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::HandleAdditionL( TBool aFirst, - TCursorSelection& aSelection, - TBool aTop ) - { - // inform about addition - if( aFirst ) - { - iTextView->FormatTextL(); - } - else - { - iTextView->HandleAdditionalCharactersAtEndL(); - } - - // if smiley dialog is launched, then dont draw. - if (iSmileyDialogLaunched) - return; - - ScrollVisibleL( aSelection, aTop ); - DrawDeferred(); - - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::ScrollVisibleL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::ScrollVisibleL( TCursorSelection& aSelection, TBool aTop ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::ScrollVisibleL() start") ); - // if smiley dialog is launched, then dont draw. - if (iSmileyDialogLaunched) - return; - - - TCursorSelection sel( aSelection ); - if( !ParagraphFits( sel.LowerPos() ) ) - { - // selection doesn't fit to screen - TInt pos( aTop ? aSelection.LowerPos() : aSelection.HigherPos() ); - sel.SetSelection( pos, pos ); - } - - // scroll selection to screen - iTextView->SetSelectionVisibilityL( EFalse ); - iTextView->SetSelectionL( sel ); - - // and update scroll bars - UpdateScrollBarsL(); - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::ScrollVisibleL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::ScrollSelectionL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TCursorSelection CIMCVAppTextViewControl::ScrollSelection() - { - return iTextView->Selection(); - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::ScrollLinesL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::ScrollLinesL( TInt aAmount ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::ScrollLinesL() start")); - iLayout->ScrollLinesL( aAmount ); - UpdateScrollBarsL(); - DrawDeferred(); - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::ScrollLinesL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::IsVisible -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVAppTextViewControl::IsVisible( TInt aPos ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::IsVisible() start") ); - TTmDocPos pos( aPos, ETrue ); - TTmLineInfo lineInfo; - - if( !iLayout->PosInBand( pos, &lineInfo ) ) - { - // current position outside - return EFalse; - } - - if( !ParagraphFits( aPos ) ) - { - // paragraph doesn't fit to screen - // extend scrolling one line up and down - - // iLineNumber starts from 0 and FirstCharOnLine assumes first line to be 1 - TInt lineNo( lineInfo.iLineNumber + 1 ); - - // check previous line (if it exists) - if( lineNo > 1 ) - { - pos.iPos = iLayout->FirstCharOnLine( lineNo - 1 ); - - if( !iLayout->PosInBand( pos ) ) - { - // previous line outside - return EFalse; - } - } - - // check next line - pos.iPos = iLayout->FirstCharOnLine( lineNo + 1 ); - - return iLayout->PosInBand( pos ); - } - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::IsVisible() end") ); - return ETrue; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::ParagraphFits -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVAppTextViewControl::ParagraphFits( TInt aPos ) - { - return iLayout->ParagraphHeight( aPos ) <= iViewRect.Height(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::RedrawL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::Redraw() - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::Redraw() start" )); - DrawDeferred(); - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::Redraw() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::CountComponentControls -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppTextViewControl::CountComponentControls() const - { - if (iScrollBar && iScrollBar->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan) - { - return 1; - } - else - { - return 0; - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::ComponentControl -// ----------------------------------------------------------------------------- -// -CCoeControl* CIMCVAppTextViewControl::ComponentControl(TInt aIndex) const - { - if (aIndex == 0 && iScrollBar && - iScrollBar->TypeOfVScrollBar() == CEikScrollBarFrame::EDoubleSpan) - { - return iScrollBar->VerticalScrollBar(); - } - else - { - return NULL; - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::SetPenBehaviour -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::SetPenBehaviour( TPenBehaviour aPen ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::SetPenBehaviour() start" )); - iPenType = aPen; - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::SetPenBehaviour() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::PenBehaviour -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -MIMCVAppTextView::TPenBehaviour CIMCVAppTextViewControl::PenBehaviour() - { - return iPenType; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::ProcessStylusEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::ProcessStylusEventL( - const TPointerEvent& /*aPointerEvent*/ ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::ProcessStylusEventL() start" )); - // nothing to do. Let derived classes to handle text selection. - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::ProcessStylusEventL() end" )); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppTextViewControl::HandleGlobalChangeNoRedrawL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppTextViewControl::HandleGlobalChangeNoRedrawL( - TViewYPosQualifier aYPosQualifier /*= TViewYPosQualifier()*/ ) - { - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::HandleGlobalChangeNoRedrawL() start" )); - iTextView->HandleGlobalChangeNoRedrawL( aYPosQualifier ); - IM_CV_LOGS(TXT("CIMCVAppTextViewControl::HandleGlobalChangeNoRedrawL() end" )); - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappui.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappui.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,569 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: application ui -* -*/ - - -#include "cimcvappui.h" -#include -#include -#include "cimcvappview.h" -#include "imcvuiapp.hrh" -#include -#include -#include "cimcvapplayoutinfo.h" -#include "cimcvappmessageextensionshandler.h" -#include "cimcvengine.h" -#include "imcvuiliterals.h" -#include "cimcvappstatuspanehandler.h" -#include "mimcvenginemessagehandler.h" -// logs -#include "imcvlogger.h" -#include "mimcvapplayoutchangeobserver.h" -#include -#include -#include -#include -#include -#include -#include "imcvuicommonuids.h" -#include "cimcvuiappskinvariant.h" -#include "imcvuiparams.h" -#include -#include -#include -#include -#include - -#include "imcvuiliterals.h" -#include "conversations.h" -#include "imcvuiapp.h" -#include "cimcvenginefactory.h" -#include "mimcvenginefactory.h" -// imconnectionprovider -#include "cimcvappinputabsorber.h" -#include "cimcvengine.h" - -// ConstructL is called by the application framework -void CIMCVAppUi::ConstructL() - { - IM_CV_LOGS(TXT("CIMCVAppUi::ConstructL() start") ); - iDestructingFlag = EFalse; - - BaseConstructL( EAknEnableSkin | ENoAppResourceFile | - EAppOrientationAutomatic | EAknEnableMSK | EAknSingleClickCompatible ); - //Message extension handler. This must be created before views. - - iChatMbmFullPath = Application()->BitmapStoreName(); - - // Input absorber - iInputAbsorber = CIMCVAppInputAbsorber::NewL(); - - /////////////////////////////// - - TDriveName drive( TParsePtrC( iChatMbmFullPath ).Drive( ) ); // solve drive - - // leave to stack, LC method - HBufC* resourceFilePath = HBufC::NewLC( KAMaxResourcePathLength ); - TPtr ptr( resourceFilePath->Des() ); - ptr.Append( KADefaultIconFile() ); // without drive - ptr.Insert( 0, drive ); // insert drive - - // NearestLanguageFile takes only TFileName - iChatMbmFullPath.Zero(); - iChatMbmFullPath.Append( *resourceFilePath ); - ///////////////////////////////// - CleanupStack::PopAndDestroy(); - - iSkinVariant = CIMCVUiAppSkinVariant::NewL(); - - iEngineFactory = CIMCVEngineFactory::InstanceL(); - - iMessageHandler = CIMCVAppMessageExtensionsHandler::NewL(*iSkinVariant, *this, *iEngineFactory ); - - - - iLayoutInfo = CIMCVAppLayoutInfo::NewL( TChatListBoxLayout::EWithoutEditor ); - iLayoutInfo->LayoutChangedL(); - CalculatePreviewPaneWidth(); - - // connected create view and activate it - iCIMCVAppView = new (ELeave) CIMCVAppView(); - iCIMCVAppView->ConstructL( R_CONVERSATIONVIEW_VIEW, KUidConversationView ,*iMessageHandler); - AddViewL( iCIMCVAppView ); // transfer ownership to CAknViewAppUi - - IM_CV_LOGS(TXT("CIMCVAppUi::ConstructL() end ") ); - } -// --------------------------------------------------------- -// CIMCVAppUi::CIMCVAppUi() -// --------------------------------------------------------- -// -CIMCVAppUi::CIMCVAppUi() : -iIsAppForeground(ETrue) - { - // no implementation required - } -// --------------------------------------------------------- -// CIMCVAppUi::CIMCVAppUi() -// --------------------------------------------------------- -// -CIMCVAppUi::~CIMCVAppUi() - { - iLayoutObservers.Close(); - - iResourceObservers.Close(); - - delete iLayoutInfo; - - delete iInputAbsorber; - - iDestructingFlag = ETrue; - - if( iSkinVariant ) - { - delete iSkinVariant; - } - - - delete iMessageHandler; - - CIMCVEngineFactory::Release(); - - } -// ----------------------------------------------------------------------------- -// CIMCVAppUi::IsAppInForeground -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVAppUi::IsAppInForeground() - { - return iIsAppForeground; - } - - // ----------------------------------------------------------------------------- -// CIMCVAppUi::IsUnderDestruction -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVAppUi::IsUnderDestruction() - { - return iDestructingFlag; - } -// --------------------------------------------------------- -// CIMCVAppUi::CIMCVAppUi() -// --------------------------------------------------------- -// handle any menu commands -void CIMCVAppUi::HandleCommandL(TInt aCommand) - { - IM_CV_LOGS(TXT("CIMCVAppUi::HandleCommandL() start") ); - switch(aCommand) - { - case EEikCmdExit: - case EAknSoftkeyExit: - case EIMCVCmdExit: - case EAknSoftkeyBack: - { - //Deactivate conversation is done in HandleForegroundEventL so that - //notification can be received in UI in case of new messages - if( iPbkApplicationUid != 0 ) - { - // activate previous application - BringToForeground( TUid::Uid(iPbkApplicationUid ) ); - } - TApaTask task(iEikonEnv->WsSession()); - task.SetWgId( CEikonEnv::Static()->RootWin().Identifier()); - task.SendToBackground(); - break; - } - - default: - break; - } - IM_CV_LOGS(TXT("CIMCVAppUi::HandleCommandL() end") ); - } -// ----------------------------------------------------------------------------- -// CIMCVAPPAppUi::HandleWsEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppUi::HandleWsEventL( const TWsEvent& aEvent,CCoeControl* aDestination ) - { - IM_CV_LOGS(TXT("CIMCVAppUi::HandleWsEventL() start") ); - switch( aEvent.Type() ) - { - case KAknUidValueEndKeyCloseEvent: - { - - break; - } - default: - { - CAknViewAppUi::HandleWsEventL( aEvent, aDestination ); - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppUi::HandleWsEventL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppUi::LayoutInfo -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -MIMCVAppLayoutInfo* CIMCVAppUi::LayoutInfo() - { - return iLayoutInfo; - } -// ----------------------------------------------------------------------------- -// CIMCVAppUi::LayoutInfo -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CIMCVEngine& CIMCVAppUi::ActiveEngine() const - { - return iCIMCVAppView->ActiveEngine(); - } - -// --------------------------------------------------------- -// CIMCVAPPAppUi::AddLayoutChangeObserver -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppUi::AddLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver ) - { - IM_CV_LOGS(TXT("CIMCVAppUi::AddLayoutChangeObserver() start") ); - TInt err( iLayoutObservers.Append( aObserver ) ); - if ( err ) - { - CActiveScheduler::Current()->Error( err ); - } - IM_CV_LOGS(TXT("CIMCVAppUi::AddLayoutChangeObserver() End") ); - } - -// --------------------------------------------------------- -// CIMCVAPPAppUi::RemoveLayoutChangeObserver -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppUi::RemoveLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver ) - { - IM_CV_LOGS(TXT("CIMCVAppUi::RemoveLayoutChangeObserver() start") ); - // remove from end first (LIFO) to avoid - // tweaking the index while removing - TInt count( iLayoutObservers.Count() ); - for( TInt i( count - 1 ); i >= 0; i-- ) - { - if( iLayoutObservers[i] == aObserver ) - { - iLayoutObservers.Remove( i ); - } - } - iLayoutObservers.Compress(); - IM_CV_LOGS(TXT("CIMCVAppUi::RemoveLayoutChangeObserver() end") ); - } - -// --------------------------------------------------------- -// CIMCVAPPAppUi::AddResourceChangeObserver -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppUi::AddResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver ) - { - IM_CV_LOGS(TXT("CIMCVAppUi::AddResourceChangeObserver() start") ); - TInt err( iResourceObservers.Append( aObserver ) ); - if ( err ) - { - CActiveScheduler::Current()->Error( err ); - } - IM_CV_LOGS(TXT("CIMCVAppUi::AddResourceChangeObserver() end") ); - } - -// --------------------------------------------------------- -// CIMCVAPPAppUi::RemoveResourceChangeObserver -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppUi::RemoveResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver ) - { - IM_CV_LOGS(TXT("CIMCVAppUi::RemoveResourceChangeObserver() start") ); - // remove from end first (LIFO) to avoid - // tweaking the index while removing - TInt count( iResourceObservers.Count() ); - for( TInt i( count - 1 ); i >= 0; i-- ) - { - if( iResourceObservers[i] == aObserver ) - { - iResourceObservers.Remove( i ); - } - } - iResourceObservers.Compress(); - IM_CV_LOGS(TXT("CIMCVAppUi::RemoveResourceChangeObserver() start") ); - } - - -// --------------------------------------------------------- -// CIMCVAPPAppUi::MbmFullPath -// (other items were commented in a header). -// --------------------------------------------------------- -// -TDes& CIMCVAppUi::MbmFullPath() - { - return iChatMbmFullPath; - } -// --------------------------------------------------------- -// CIMCVAPPAppUi::StorePreviousViewDetails -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppUi::StorePreviousViewDetails(TInt aPreviousApplicationUid,TInt aPreviousViewUid ) - { - IM_CV_LOGS(TXT("CIMCVAppUi::StorePreviousViewDetails() start") ); - iPbkApplicationUid = aPreviousApplicationUid; - iPbkActiveViewUid = aPreviousViewUid; - IM_CV_LOGS(TXT("CIMCVAppUi::StorePreviousViewDetails() end") ); - } - -// --------------------------------------------------------------------------- -//// CIMCVAPPAppUi::SendMeToBackground -// Send this application to background -// --------------------------------------------------------------------------- -// -void CIMCVAppUi::SendMeToBackground() - { - IM_CV_LOGS(TXT("CIMCVAppUi::SendMeToBackground() start") ); - TApaTaskList taskList( iEikonEnv->WsSession() ); - TApaTask xmppImApp = taskList.FindApp( TUid::Uid(KIMCVUIAPPEXEUID3 ) ); - xmppImApp.SendToBackground(); - IM_CV_LOGS(TXT("CIMCVAppUi::SendMeToBackground() end") ); - } - - // --------------------------------------------------------------------------- -//// CIMCVAppUi::ShutDownAndCloseApplicationL -// Send this application to background -// --------------------------------------------------------------------------- -// -void CIMCVAppUi::ShutDownAndCloseApplicationL() - { - IM_CV_LOGS(TXT("CIMCVAppUi::ShutDownAndCloseApplicationL() start") ); - TApaTaskList taskList( iEikonEnv->WsSession() ); - TApaTask xmppImApp = taskList.FindApp( TUid::Uid(KIMCVUIAPPEXEUID3 ) ); - xmppImApp.KillTask(); - IM_CV_LOGS(TXT("CIMCVAppUi::ShutDownAndCloseApplicationL() end") ); - } -// --------------------------------------------------------- -// CIMCVAppUi::HandleResourceChangeL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppUi::HandleResourceChangeL( TInt aType ) - { - IM_CV_LOGS(TXT("CIMCVAppUi::HandleResourceChangeL() Start") ); - CAknViewAppUi::HandleResourceChangeL( aType ); - if ( aType == KEikDynamicLayoutVariantSwitch ) - { - // skin change for this app ui class - iLayoutInfo->LayoutChangedL( aType ); - - CalculatePreviewPaneWidth(); - - iSkinVariant->UpdateLayout(); - } - - - if ( aType == KEikDynamicLayoutVariantSwitch || - aType == KAknsMessageSkinChange ) - { - TInt count( iLayoutObservers.Count() ); - for( TInt i( 0 ); i < count; ++i ) - { - iLayoutObservers[i]->LayoutChangedL( aType ); - } - } - IM_CV_LOGS(TXT("CIMCVAppUi::HandleResourceChangeL() end") ); - } -// --------------------------------------------------------- -// CIMCVAppUi::CalculatePreviewPaneWidth() -// --------------------------------------------------------- -// -void CIMCVAppUi::CalculatePreviewPaneWidth() - { - IM_CV_LOGS(TXT("CIMCVAppUi::CalculatePreviewPaneWidth() Start") ); - // Get parameter and table limits for popup preview text window - TAknLayoutScalableParameterLimits limits = - AknLayoutScalable_Avkon::popup_preview_text_window_ParamLimits(); - - TAknLayoutScalableTableLimits tableLimits = - AknLayoutScalable_Avkon::popup_preview_text_window_t_Limits(); - - // Get layout rects - TRect rectScreen = iAvkonAppUi->ApplicationRect(); - TRect rectMainPane = rectScreen; - - // Use first variety to be able to get the font for text parsing - TInt firstVariety = SelectWindowVariety( 1, limits ); - - TRect rectPopupWindow = RectFromLayout( rectMainPane, - AknLayoutScalable_Avkon::popup_preview_text_window( firstVariety ) ); - - TInt firstIndex = tableLimits.FirstIndex(); - TInt firstLineVariety = AknLayoutScalable_Avkon:: - popup_preview_text_window_t_ParamLimits( firstIndex ).FirstVariety(); - - TAknTextLineLayout popupTextLayout = - AknLayoutScalable_Avkon::popup_preview_text_window_t( - firstIndex, firstLineVariety ); - - TAknLayoutText layoutText; - layoutText.LayoutText( rectPopupWindow, popupTextLayout ); - - IM_CV_LOGS(TXT("CIMCVAppUi::CalculatePreviewPaneWidth() End") ); - } -// --------------------------------------------------------- -// CIMCVAppUi::SelectWindowVariety() -// --------------------------------------------------------- -// -TInt CIMCVAppUi::SelectWindowVariety( const TInt aNumberOfLines, - const TAknLayoutScalableParameterLimits& aLimits ) const - { - TInt index = aNumberOfLines - 1; - if ( Layout_Meta_Data::IsLandscapeOrientation() ) - { - index += 5; - } - - return Min( Max( index, aLimits.FirstVariety() ), - aLimits.LastVariety() ); - } - -// --------------------------------------------------------- -// CIMCVAppUi::RectFromLayout() -// --------------------------------------------------------- -// -TRect CIMCVAppUi::RectFromLayout( const TRect& aParent, - const TAknWindowComponentLayout& aComponentLayout ) const - { - TAknWindowLineLayout lineLayout = aComponentLayout.LayoutLine(); - TAknLayoutRect layoutRect; - layoutRect.LayoutRect(aParent, lineLayout); - return layoutRect.Rect(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppUi::SkinVariantL -// ----------------------------------------------------------------------------- -// -MIMCVUiAppSkinVariant* CIMCVAppUi::SkinVariantL() - { - return iSkinVariant; - } - -// --------------------------------------------------------------------------- -// Proceses message from external application -// Used from Phonebooks external tab (Buddylist) to start instant messaging -// or from xmpp server to show new messages -// --------------------------------------------------------------------------- -// -void CIMCVAppUi::ProcessMessageL( TUid /*aUid*/, const TDesC8& aParamData ) - { - IM_CV_LOGS(TXT("CIMCVAppUi::ProcessMessageL() Start") ); - - iCIMCVAppView->ShowMeL(aParamData); - - IM_CV_LOGS(TXT("CIMCVAppUi::ProcessMessageL() End ") ); - } - -/// ----------------------------------------------------------------------------- -// CIMCVAppUi::HandleServiceCloseExitL -// ----------------------------------------------------------------------------- -// -void CIMCVAppUi::HandleServiceCloseExitL(TInt /*aEventValue*/ ) - { - IM_CV_LOGS(TXT("CIMCVAppUi::HandleServiceCloseExitL() Start") ); - - IM_CV_LOGS(TXT("CIMCVAppUi::HandleServiceCloseExitL() Start") ); - } - -// --------------------------------------------------------- -// CIMCVAppUi::CaptureEventsL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppUi::CaptureEventsL() - { - if ( !AreEventsCaptured() ) - { - iInputAbsorber->CaptureEventsL(); - } - } - -// --------------------------------------------------------- -// CIMCVAppUi::ReleaseCapturingL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppUi::ReleaseCapturingL() - { - if ( AreEventsCaptured() ) - { - iInputAbsorber->Release(); - } - } - -// --------------------------------------------------------- -// CIMCVAppUi::AreEventsCaptured -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CIMCVAppUi::AreEventsCaptured() const - { - return iInputAbsorber->IsCaptured(); - } - -// --------------------------------------------------------- -// CIMCVAppUi::BringToForeground -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppUi::BringToForeground( TUid aAppUid ) - { - - IM_CV_LOGS(TXT("CIMCVAppUi::BringToForeground() start") ); - TApaTaskList taskList( iEikonEnv->WsSession() ); - TApaTask task = taskList.FindApp( aAppUid ); - if ( task.Exists() ) - { - task.BringToForeground(); - } - IM_CV_LOGS(TXT("CIMCVAppUi::BringToForeground() end") ); - - } - - -// -------------------------------------------------------------------------- -// CIMCVAppUi::HandleForegroundEventL -// -------------------------------------------------------------------------- -// -void CIMCVAppUi::HandleForegroundEventL( TBool aForeground ) - { - iIsAppForeground = aForeground; - - if( !aForeground ) - { - ActiveEngine().MessageHandler().DeactivateConversationL(); - } - - CAknViewAppUi::HandleForegroundEventL( aForeground ); - } -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappview.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappview.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1506 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: conversation main view -* -*/ - -// INCLUDE FILES -#include "cimcvappview.h" -#include "cimcvmenuextensionmanager.h" - -#include "cimcvappviewcontainer.h" -#include "cimcvappui.h" -#include "cimcvengine.h" -#include "mimcvenginechatinterface.h" -#include "imcvuiapp.hrh" -#include "imcvuiliterals.h" -#include "imcvlogger.h" -#include "cimcvappstatuspanehandler.h" -#include "cimcvappmessageextensionshandler.h" -#include "imcvuiapputils.h" -#include "imcvuiappnotemapper.h" -#include "mimcvenginemessagehandler.h" -#include "imcvuiapp.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -//brandingserver -#include -#include "conversations.h" - -#include -#include -#include -#include -// help launch -#include -#include -#include "meco.hlp.hrh" - -#include "imcvuicommonuids.h" -#include "cimcvappmessageeditor.h" -#include - -#include -#include -#include -#include "vimpstdetailsviewpluginuids.hrh" -#include "mimcvenginemessagecontainerinfo.h" -#include "mimcvenginemessageswriteinterface.h" -#include "cimcvenginefactory.h" -#include "mimcvenginefactory.h" -#include -#include - -// AIW Include Files -#include -#include -#include -#include -#include -#include -#include - - -// Dll Uid of vimpstui, to maintain uniqueness of help uid -const TUid KHelpUid = { 0x2001FDC2 } ; -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVAppView::CIMCVAppView() -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppView::CIMCVAppView() - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppView::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVAppView::ConstructL( TInt aAvkonViewResourceId, TUid aViewId, - CIMCVAppMessageExtensionsHandler& aMessageHandler ) - { - IM_CV_LOGS(TXT("CIMCVAppView::ConstructL() start") ); - - iRTContainerCache = CIMCVAppRichTextContainerCache::NewL(); - - iViewId = aViewId; - - BaseConstructL( aAvkonViewResourceId ); - - iExtensionHandler = &aMessageHandler; - - iFindContextMenu = new( ELeave ) CEikMenuBar; - iFindContextMenu->ConstructL( this, 0, R_CONVERSATIONVIEW_MENUBAR_FINDITEMUI ); - - iEngineFactory = CIMCVEngineFactory::InstanceL(); - iEngineFactory->RegisterServiceObserver( this ); - - iFindMenu = CFindItemMenu::NewL( EIMCVCmdFindMenuPlaceHolder ); - iFindMenu->AttachItemFinderMenuL( R_CONVERSATIONVIEW_VIEW_MENU ); - iFindMenu->AttachItemFinderMenuL( R_CONVERSATIONVIEW_MENUBAR_FINDITEMUI ); - // automatic finder on by default - iFindMenu->HandleItemFinderCommandL( EFindItemCmdEnableAutoFind ); - iItemFinder = CItemFinder::NewL(); - - iAppUi = static_cast ( CCoeEnv::Static()->AppUi() ); - - iRecipientUserId = HBufC::NewL(512); - - // to set the tile, label icon in title pane - iStatusPane = CIMCVAppStatusPaneHandler::NewL(*iEngineFactory) ; - - if ( AknLayoutUtils::PenEnabled() ) - { - Toolbar()->SetToolbarObserver(this); - } - iFromMe = NULL; - iToMe = NULL; - - //Creates manager for menu extension - iMenuExtManager = CIMCVMenuExtensionManager::NewL(); - iAiwServiceHandler = CAiwServiceHandler::NewL(); - iAiwServiceHandler->AttachL( AIW_INTERNETCALL); - iAiwServiceHandler->AttachMenuL( R_CONVERSATIONVIEW_VIEW_MENU,AIW_INTERNETCALL ); - - iConvViewDel = EFalse; - iDetailViewOpen = EFalse; - IM_CV_LOGS(TXT("CIMCVAppView::ConstructL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppView::~CIMCVAppView() -// --------------------------------------------------------- -// -CIMCVAppView::~CIMCVAppView() - { - if( iEngineFactory ) - { - iEngineFactory->UnRegisterServiceObserver(); - iEngineFactory = NULL; - } - - if(iRTContainerCache) - { - delete iRTContainerCache; - } - delete iStatusPane; - if ( iContainer && iAppUi ) - { - iAppUi->RemoveFromViewStack( *this, iContainer ); - delete iContainer; - iContainer = NULL; - } - if ( iFindContextMenu && iAppUi ) - { - iAppUi->RemoveFromStack( iFindContextMenu ); - } - delete iFindContextMenu; - - delete iFindMenu; - delete iItemFinder; - delete iRecipientUserId; - - if(iParameter) - { - iParameter->Close(); - iParameter = NULL; - } - if(iConnection) - { - iConnection->Close(); - iConnection = NULL; - } - if(iFromMe) - { - delete iFromMe; - } - if(iToMe) - { - delete iToMe; - } - if(iMenuExtManager) - { - delete iMenuExtManager; - } - if (iAiwServiceHandler) - { - iAiwServiceHandler->Reset(); - delete iAiwServiceHandler; - iAiwServiceHandler = NULL; - } - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppView::HandleCbaChangeL() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppView::HandleCbaChangeL( TInt aResourceId ) - { - IM_CV_LOGS(TXT("CIMCVAppView::HandleCbaChangeL() start") ); - Cba()->SetCommandSetL( aResourceId ); - Cba()->DrawNow(); - IM_CV_LOGS(TXT("CIMCVAppView::HandleCbaChangeL() end") ); - } - - -// --------------------------------------------------------- -// CIMCVAppView::DynInitMenuPaneL -// Called when menupane is about to be shown. -// --------------------------------------------------------- -// -void CIMCVAppView::DynInitMenuPaneL( - TInt aResourceId,CEikMenuPane* aMenuPane ) - { - IM_CV_LOGS(TXT("CIMCVAppView::DynInitMenuPaneL() start") ); - if( !iContainer ) - { - return; - } - switch( aResourceId ) - { - case R_CONVERSATIONVIEW_VIEW_MENU: - { - if(iActiveEngine->IsVoipServiceL())// internet call - { - aMenuPane->SetItemDimmed(KAiwCmdCall, EFalse); - CAiwDialDataExt* dialDataExt = CAiwDialDataExt::NewL(); - CleanupStack::PushL( dialDataExt ); - dialDataExt->SetServiceId( iServiceId ); - CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL(); - dialDataExt->FillInParamListL( paramList ); - TAiwGenericParam param (EGenericParamSIPAddress); - paramList.AppendL( param ); - iAiwServiceHandler->InitializeMenuPaneL( *aMenuPane, - R_CONVERSATIONVIEW_VIEW_MENU,EIMCVCmdInternetCall,paramList ); - CleanupStack::PopAndDestroy( dialDataExt ); - } - else - { - aMenuPane->SetItemDimmed(KAiwCmdCall, ETrue); - } - if( iContainer->Editor().Editor().TextLength() > 0 ) - { - aMenuPane->SetItemDimmed(EIMCVCmdSend, EFalse); - } - else - { - aMenuPane->SetItemDimmed(EIMCVCmdSend, ETrue); - } - // "insert smiley" - if( !iContainer->Editor().Editor().IsFocused() ) - { - aMenuPane->SetItemDimmed( - EIMCVCmdSmiley, ETrue ); - } - else - { - aMenuPane->SetItemDimmed( EIMCVCmdSmiley, EFalse ); - } - // item finder menu - aMenuPane->SetItemDimmed( EIMCVCmdFindMenuPlaceHolder, ETrue); - - if( iContainer->IsStopped() ) - { - UpdateItemTypeL(); - iFindMenu->AddItemFindMenuL( iItemFinder, aMenuPane, - EIMCVCmdFindMenuPlaceHolder, - KNullDesC ); // we can ignore the sender here - } - //offers CV MenuPane to plugins to add their options - iMenuExtManager->OfferMenuPaneToPlugins(EIMCVCmdSmiley,*aMenuPane,iServiceId); - break; - } - case R_CONVERSATIONVIEW_FINDITEMUI_MENU : - { - if( iContainer->IsStopped() ) - { - UpdateItemTypeL(); - iFindMenu->AddItemFindMenuL( iItemFinder, aMenuPane, - EIMCVCmdFindMenuPlaceHolder, - KNullDesC, // we can ignore the sender here - EFalse, ETrue ); // context menu - } - break; - } - - default: - { - // update find menu - iFindMenu->UpdateItemFinderMenuL( aResourceId, aMenuPane ); - break; - } - - } - IM_CV_LOGS(TXT("CIMCVAppView::DynInitMenuPaneL() end") ); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::LaunchCcaL -// -------------------------------------------------------------------------- -// -void CIMCVAppView::LaunchCcaL() - { - - - if(!iConnection) - { - iConnection = TCCAFactory::NewConnectionL(); - } - - if ( iParameter ) - { - iParameter->Close(); - iParameter = NULL; - } - - // The lifetime of this cmd object is too short to hold - // iParameterRef, caller of this must own it - iParameter = TCCAFactory::NewParameterL(); - iParameter->SetConnectionFlag(MCCAParameter::ENormal); - iParameter->SetContactDataFlag(MCCAParameter::EContactLink); - - TUid uid( TUid::Null() ); - uid.iUid = KVIMPSTDetailsViewPluginImplmentationUid + iServiceId ; // service details view implementation uid - iParameter->SetLaunchedViewUid( uid ); - - // RProperty::Set(KMeCoPropertyUid, KMeCoConvViewServiceIdKey, iServiceId ); - MIMCVEngineMessageReadInterface& readInterface = - iActiveChatInterface->MessageReadInterfaceL( iServiceId, *iRecipientUserId ); - HBufC8* link8 = readInterface.ContactLink().AllocLC(); - HBufC16* link16 = HBufC16::NewLC( link8->Length() ); - link16->Des().Copy( *link8 ); - iParameter->SetContactDataL( *link16 ); - CleanupStack::PopAndDestroy( 2 ); //pop and destroy link8 and link16 - - // Sync call - iConnection->LaunchApplicationL(*iParameter); - - iDetailViewOpen = ETrue; - } -// --------------------------------------------------------- -// CIMCVAppView::HandleCommandL(TInt aCommand) -// Handles commands -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppView::HandleCommandL( TInt aCommand ) - { - IM_CV_LOGS(TXT("CIMCVAppView::HandleCommandL() start") ); - - //Offer commands to menu extension plugins - if(iMenuExtManager->OfferHandleCommandToPlugins(aCommand)) - { - //command is executed, hence return. - return; - } - - switch ( aCommand ) - { - case EIMCVCmdInternetCall: - { - // Truncating till ':' if exists - Extracting Userid from "ServiceName:Userid". - TInt indexposition = iRecipientUserId->Locate(':'); - HBufC* phonenumber = NULL; // Phonenumber = Userid - if ( KErrNotFound != indexposition ) - { - phonenumber = iRecipientUserId->Right(iRecipientUserId->Length() - (indexposition+1)).AllocLC(); - } - else - { - phonenumber = iRecipientUserId->AllocLC(); // does't contain ':' - } - TPtr phonenumberptr( phonenumber->Des ()); - CommonPhoneParser::ParsePhoneNumber ( phonenumberptr,CommonPhoneParser::EPhoneClientNumber); - CAiwDialDataExt* dialDataExt = CAiwDialDataExt::NewLC(); - dialDataExt->SetPhoneNumberL ( phonenumber->Des ()); - dialDataExt->SetServiceId(iServiceId); - dialDataExt->SetCallType( CAiwDialData::EAIWVoiP); - dialDataExt->SetWindowGroup ( CCoeEnv::Static()->RootWin().Identifier() ); - CAiwGenericParamList& paramList = iAiwServiceHandler->InParamListL(); - dialDataExt->FillInParamListL ( paramList); - iAiwServiceHandler->ExecuteServiceCmdL ( KAiwCmdCall,paramList, - iAiwServiceHandler->OutParamListL(),0,NULL); - CleanupStack::PopAndDestroy(dialDataExt); - CleanupStack::PopAndDestroy(phonenumber); - break; - } - case EIMCVCmdToolbarDetails: - //Launch the cca - LaunchCcaL(); - break; - // flow through - case EIMCVCmdSend: - case EIMCVCmdToolbarSend: - case EAknSoftkeySend: - { - if( iContainer ) - { - iContainer->SendMessageL(); - } - break; - } - case EIMCVCmdToolbarInsertSmiley: - case EIMCVCmdSmiley : - { - TBool dialogCancelled = EFalse; - TSize size (iContainer->TextRect ().Height(), iContainer->TextRect ().Height() ); - iContainer->SmileyDialogLaunched (ETrue); - iExtensionHandler->InsertExtensionL( iContainer->Editor().Editor(), - iServiceId, - EMessageExtensionSmiley, - dialogCancelled, - size); - iContainer->UpdateCbaL(); - // Resize icons, use reading pane text line element as parent - - if ( !dialogCancelled ) - { - iContainer->RefreshEditorL(); - iContainer->Editor().SetFocus(ETrue); - } - iContainer->SmileyDialogLaunched (EFalse); - iContainer->UpdateChatViewL(); - - break; - } - case EIMCVCmdCloseConversation: - { - HBufC* queryTxt = StringLoader::LoadLC( R_CHAT_CQUERY_CLOSE_CONV, *iRecipientUserId ); - TInt response = DisplayQueryDialogL( - R_GENERIC_YES_NO_CONFIRMATION_QUERY, - *queryTxt ); - CleanupStack::PopAndDestroy( queryTxt ); - if(response) - { - iViewDeactivated = ETrue; - TInt error = iContainer->CloseConversationL( *iRecipientUserId ); - iActiveChatInterface->DeleteChatL( iServiceId, *iRecipientUserId ); - ViewRefreshL(); - // set this to KNullDesC since conversation is getting closed. - iRecipientUserId->Des().Copy( KNullDesC()); - // after closing conversation application will go to servicetab - if( error== KErrNone ) - { - iAppUi->HandleCommandL( EAknSoftkeyBack ); - } - } - break; - } - // flow through - case EFindItemCmdEnableAutoFind: - case EFindItemCmdDisableAutoFind: - { - if( iContainer ) - { - iContainer->SetItemHighlightL( - aCommand == EFindItemCmdEnableAutoFind ); - iFindMenu->HandleItemFinderCommandL( aCommand ); - if( MenuBar()->IsDisplayed() ) - { - MenuBar()->StopDisplayingMenuBar(); - } - if( iFindContextMenu->IsDisplayed() ) - { - iFindContextMenu->StopDisplayingMenuBar(); - } - } - break; - } - case EIMCVCmdCall: - { - UpdateItemTypeL(); - CItemFinder::CFindItemExt& item = iItemFinder->CurrentItemExt(); - if(item.iItemType == CItemFinder::EEmailAddress) - { - iFindMenu->HandleVoIPCallL( *iItemFinder->CurrentItemExt().iItemDescriptor ); - } - else - { - iFindMenu->HandleCallL( *iItemFinder->CurrentItemExt().iItemDescriptor ); - } - break; - } - case EAknCmdHelp: - { - LaunchHelpL( KSERVTAB_HLP_CONVERSATION ); - break; - } - - case EEikCmdExit: - case EAknSoftkeyExit: - case EAknCmdExit: - case EAknSoftkeyBack: - { - iViewDeactivated = ETrue; - if( iFindMenu->CommandIsValidL( aCommand ) ) - { - iFindMenu->HandleItemFinderCommandL( aCommand ); - } - iContainer->StoreEditorMessageL(); - ViewRefreshL(); - iAppUi->HandleCommandL( aCommand ); - break; - } - - default: - { - //As per new UI spec change own status is not avilable in conversation - //view menu - // check if it is find menu command - if( iFindMenu->CommandIsValidL( aCommand ) ) - { - Toolbar()->HideItemsAndDrawOnlyBackground(ETrue); - iFindMenu->HandleItemFinderCommandL( aCommand ); - Toolbar()->HideItemsAndDrawOnlyBackground(EFalse); - - } - else - { - iAppUi->HandleCommandL( aCommand ); - } - - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppView::HandleCommandL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppView::HandleForegroundEventL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppView::HandleForegroundEventL( TBool aForeground ) - { - IM_CV_LOGS(TXT("CIMCVAppView::HandleForegroundEventL() start") ); - - if(aForeground && iDetailViewOpen) - { - iDetailViewOpen = EFalse; - } - - if(iConvViewDel) - { - TApaTask task(iEikonEnv->WsSession()); - task.SetWgId( CEikonEnv::Static()->RootWin().Identifier()); - task.SendToBackground(); - iConvViewDel = EFalse; - return; - } - - if (!aForeground) - { - if (iStatusPane) - { - iStatusPane->SendBackGroundL(); - } - iViewDeactivated = ETrue; - } - else - { - iActiveEngine->MessageHandler().StartNewConversationL (*iRecipientUserId); - SetStatusPaneIconsL(); - if (iStatusPane) - { - iStatusPane->BringToForegroundL(); - } - iViewDeactivated = EFalse; - } - IM_CV_LOGS(TXT("CIMCVAppView::HandleForegroundEventL() end") ); - } - - - -// --------------------------------------------------------- -// CIMCVAppView::DoActivateL(...) -// Handles view activation -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppView::DoActivateL( - const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/, - const TDesC8& aCustomMessage) - { - IM_CV_LOGS(TXT("CIMCVAppView::DoActivateL() start") ); - // Register switch back if conversation view is opened from phonebook im service tab - // in case if something lost - - ActivateViewL(ViewId()); - - - TPckgBuf params; - params.Copy( aCustomMessage ); - - //Get the service id - this property is published by imcvlauncher - TInt error = RProperty::Get( KMeCoPropertyUid, KMeCoConvViewServiceIdKey, iServiceId ); - User::LeaveIfError(error); - - TPtrC recieptId = params().iBuddyId; - TPtrC buddyName = params().iBuddyName; - TPtrC8 contactlinkPtr = params().iContactLink; - //CCH has logged in, but conversation is not binded to the connection - //so we need to login in conversation view, for the user to use this view to - //send the message - iActiveEngine = &iEngineFactory->GetServiceEngineL( iServiceId ); - iActiveEngine->ResolveServiceStateL(); - /* Get the active chat recipient id from the engine factory so that we check if - container should switch */ - - TPtrC activeRecipientId = iEngineFactory->GetActiveItemL (); - // store previous view details if launch from service tab - iAppUi->StorePreviousViewDetails(params().iAppUid, params().iViewUid ); - - iRecipientUserId->Des().Copy(recieptId); - - // subscribe for presence notification - if ( iActiveEngine->IsLoggedIn() ) - { - IM_CV_LOGS(TXT("CIMCVAppView::DoActivateL() LOGGED IN.. BEFORE subscribing.. *****************") ); - iActiveEngine->MessageHandler().SubscribePresenceL( recieptId ); - IM_CV_LOGS(TXT("CIMCVAppView::DoActivateL() LOGGED IN.. AFTER subscribing.. *****************") ); - } - iActiveChatInterface = &iActiveEngine->ChatInterface(); - // To prevent looping between this view and refresh view - // resolve message read interface - MIMCVEngineMessageReadInterface& readInterface = - iActiveChatInterface->MessageReadInterfaceL( iServiceId, *iRecipientUserId, buddyName, contactlinkPtr ); - MIMCVEngineMessageWriteInterface& writeInterface = - iActiveChatInterface->MessageWriteInterfaceL( iServiceId, *iRecipientUserId, buddyName, contactlinkPtr ); - - TPtrC displayId = readInterface.Name(); - - if (iStatusPane) - { - iStatusPane->SetTitleL( displayId ); - //hide navi pane decorators - - iStatusPane->IMessageIndicator()->AddObserver( this ); - //if activation is from contact list and not from switching between - //tabs then create tabs and show them - iStatusPane->ShowTabGroupL( iRecipientUserId->Des()); - iStatusPane->AddObserver(this) ; - } - SetStatusPaneIconsL(); - // When forwarding from contact to contact DoDeactivate is never called. - // We have to cleanup the necessary stuff ourself. - - if( !iContainer ) - { - iContainer = CIMCVAppViewContainer::NewL( ClientRect(),iActiveEngine, - &readInterface,&writeInterface, - this, *iExtensionHandler,Cba(), - *iRecipientUserId,this, iRTContainerCache, - iFromMe, iToMe); - iAppUi->AddToViewStackL( *this, iContainer ); - iAppUi->AddToStackL( *this, iFindContextMenu, ECoeStackPriorityDefault, - ECoeStackFlagRefusesFocus ); - - IM_CV_LOGS(TXT("CIMCVAppView::DoActivateL() creating iContainer") ); - - } - else - { - IM_CV_LOGS(TXT("CIMCVAppView::DoActivateL() CONTAINER exist******************************") ); - // If the recipient ID does not match the active chat, then switch the container */ - if (0 != recieptId.Compare(activeRecipientId)) - { - IM_CV_LOGS(TXT("CIMCVAppView::DoActivateL() SWITCHING TAB ******************************") ); - iContainer->SwitchViewL (&readInterface, &writeInterface, recieptId); - } - } - // Restore find state - TInt findState = IMCVUiAppUtils::CRKeyL( KCRUidCommonUi, KCuiAutomaticHighlight ); - iContainer->SetItemHighlightL( findState ); - - - // start a conversation since we have single conversation at a time - - iContainer->StartConversationL (); - - readInterface.SetActive (ETrue); - if( recieptId == KNullDesC ) - { - // open from idle - // not valid user id selected - // Construct view identification for buddylist view activation - // launch servicetab for buddy list selection - TVwsViewId viewIdentification(KPhonebook2AppUid,KUidIMServiceTabViewUid ); - ActivateViewL( viewIdentification ); - // close cv ,no user defined for this - iAppUi->ShutDownAndCloseApplicationL(); - } - MenuBar()->SetContextMenuTitleResourceId( R_CONVERSATIONVIEW_MENUBAR_FINDITEMUI ); - UpdateToolbarButtonsStateL(); - IM_CV_LOGS(TXT("CIMCVAppView::DoActivateL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppView::HandleCommandL() -// Handles view deactivation -// --------------------------------------------------------- -// -void CIMCVAppView::DoDeactivate() - { - IM_CV_LOGS(TXT("CIMCVAppView::DoDeactivate() start") ); - //TSW bug Id - KBAA-6TM946 - if (iStatusPane) - { - iStatusPane->RemoveObserver(this); - iStatusPane->IMessageIndicator()->AddObserver( NULL ); - iStatusPane->HideFadeText(); - } - - if ( iContainer ) - { - iAppUi->RemoveFromViewStack( *this, iContainer ); - // not in a middle of sending message - delete iContainer; - iContainer = NULL; - - } - if ( iFindContextMenu ) - { - iAppUi->RemoveFromViewStack( *this, iFindContextMenu ); - } - - IM_CV_LOGS(TXT("CIMCVAppView::DoDeactivate() end") ); - } - -// --------------------------------------------------------- -// CIMCVAPPView::Id() -// (other items were commented in a header). -// --------------------------------------------------------- -// -TUid CIMCVAppView::Id() const - { - return iViewId; - } -// --------------------------------------------------------- -// CIMCVAppView::ActiveEngine() -// (other items were commented in a header). -// --------------------------------------------------------- -// -CIMCVEngine& CIMCVAppView::ActiveEngine() const - { - return *iActiveEngine; - } -// --------------------------------------------------------- -// CIMCVAppView::SetStatusPaneIconsL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppView::SetStatusPaneIconsL() - { - IM_CV_LOGS(TXT("CIMCVAppView::SetStatusPaneIconsL() Start ") ); - if(! iStatusPane ) - { - return; - } - - if (!iActiveEngine) - return; - // if the status is EServiceOut then no need to set the icon, only title needs to be set. - if(EServiceOut == iActiveEngine->MessageHandler().GetPresenceStatus()) - { - return; - } - // Load status icon - CGulIcon* connStatusIcon = LoadBitmapL( ); - connStatusIcon->SetBitmapsOwnedExternally( EFalse ); - CleanupStack::PushL( connStatusIcon ); - - // in portrait mode we are setting the status icon to status pane - iStatusPane->SetPicture( connStatusIcon->Bitmap(), - connStatusIcon->Mask() - ); - // ownership was transferred - connStatusIcon->SetBitmapsOwnedExternally( ETrue ); - - CleanupStack::PopAndDestroy( connStatusIcon ); - - IM_CV_LOGS(TXT("CIMCVAppView::SetStatusPaneIconsL() End ") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppView::LoadDefaultBitmapL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CGulIcon* CIMCVAppView::LoadBitmapL( ) - { - IM_CV_LOGS(TXT("CIMCVAppView::LoadBitmapL() Start ") ); - CGulIcon* gulIcon; - HBufC8* brandIconId = HBufC8::NewLC(KVIMPSTUISPSMaxPropertyLength); - TPtr8 brandIconIdPtr = brandIconId->Des(); - TIMCVOnlineStatus status = iActiveEngine->MessageHandler().GetPresenceStatus(); - // default offline - switch( status ) - { - case EOnline: - { - brandIconIdPtr.Copy(KEMbmConversationsQgnpropimfriendon); - break; - } - case EInvisible: - { - brandIconIdPtr.Copy(KEMbmConversationsQgnpropimfriendinvisible); - break; - } - case EAway: - { - brandIconIdPtr.Copy(KEMbmConversationsQgnpropimfriendaway); - break; - } - case EBusy: - case EDoNotDisturb: - { - brandIconIdPtr.Copy(KEMbmConversationsQgnpropimfriendbusy); - break; - } - case EOnPhone: - { - brandIconIdPtr.Copy(KEMbmConversationsQgnpropimfriendonmobile); - break; - } - case EBlock: - { - brandIconIdPtr.Copy(KEMbmConversationsQgnpropimuserblocked); - break; - } - case ECallForward: - { - brandIconIdPtr.Copy(KEMbmConversationsQgnpropimusercallforward); - break; - } - case EOffline : - default: - { - brandIconIdPtr.Copy(KEMbmConversationsQgnpropimfriendoff); - // offline only - } - } - - - IM_CV_LOGS(TXT("CIMCVAppView::LoadBitmapL()::if(iAppUi->BrandingAccess()) Start ") ); - gulIcon = iActiveEngine->GetPresenceIconL( *brandIconId ); - IM_CV_LOGS(TXT("CIMCVAppView::LoadBitmapL()::if(iAppUi->BrandingAccess()) End ") ); - - CleanupStack::PopAndDestroy(brandIconId); - IM_CV_LOGS(TXT("CIMCVAppView::LoadBitmapL() End ") ); - return gulIcon; - } - -// --------------------------------------------------------- -// CIMCVAppView::UpdateItemTypeL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppView::UpdateItemTypeL() - { - if( !iContainer ) - { - return; - } - CItemFinder::CFindItemExt& item = iItemFinder->CurrentItemExt(); - switch( iContainer->SelectedItemType() ) - { - case CFindItemEngine::EFindItemSearchPhoneNumberBin: - { - item.iItemType = CItemFinder::EPhoneNumber; - break; - } - case CFindItemEngine::EFindItemSearchMailAddressBin: - { - item.iItemType = CItemFinder::EEmailAddress; - break; - } - case CFindItemEngine::EFindItemSearchURLBin: - { - item.iItemType = CItemFinder::EUrlAddress; - break; - } - case CFindItemEngine::EFindItemSearchScheme: - { - item.iItemType = CItemFinder::EUriScheme; - break; - } - case KErrNotFound: // flowthrough - default: - { - item.iItemType = CItemFinder::ENoneSelected; - break; - } - } - delete item.iItemDescriptor; - item.iItemDescriptor = NULL; - item.iItemDescriptor = iContainer->SelectedItemL(); // takes the ownership - - // this logic comes from CItemFinder::ResolveAndSetItemTypeL. - // should be in ItemFinder engine, but for some reason it isn't, - // so, next few lines are copypasted from AknItemFinder.cpp.. - if( item.iItemType == CItemFinder::EUrlAddress ) - { - // old url types need prefix in order to work w/ schemehandler - const TDesC& pref = item.iItemDescriptor->Des().Left( 4 ); - - //fix for bug id TJUO-79NETM ( Instant Messaging - - // IM opening rtsp link from message don't work) - //To avoid adding :http://" to rtsp links, we check it before it is done - //and return. - if (pref.CompareF (KIMRTSP().Left (4)) == 0) - { - return; - } - - if ( pref.CompareF( KIMHTTPPREFIX().Left( 4 ) ) != 0 ) - { - HBufC* tmp = item.iItemDescriptor->ReAlloc( - item.iItemDescriptor->Length() + KIMHTTPPREFIX().Length() ); - if( tmp ) - { - // realloc succeeded - item.iItemDescriptor = tmp; - item.iItemDescriptor->Des().Insert( 0, KIMHTTPPREFIX ); - } - } - } - if( item.iItemType == CItemFinder::EUriScheme ) - { - // some schemes (ie. "old ones") have special handling - const TDesC& pref = item.iItemDescriptor->Des().Left( 4 ); - if ( pref.CompareF( KIMHTTPPREFIX().Left( 4 ) ) == 0 - || pref.CompareF( KIMRTSP ) == 0 ) - { - item.iItemType = CItemFinder::EUrlAddress; - } - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppView::DisplayQueryDialogL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppView::DisplayQueryDialogL( TInt aDialogResourceId, - const TDesC& aPrompt ) - { - CAknQueryDialog* dlg = new (ELeave) CAknQueryDialog( - CAknQueryDialog::ENoTone ); - CleanupStack::PushL( dlg ); - if( aPrompt != KNullDesC ) - { - dlg->SetPromptL( aPrompt ); - } - CleanupStack::Pop( dlg ); - return dlg->ExecuteLD( aDialogResourceId ); - } - -// --------------------------------------------------------- -// CIMCVAppView::ShowPopUpMenuL() -// This method shows popup menu -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppView::ShowPopUpMenuL( ) - { - if( iContainer && iContainer->SelectedItemType() != KErrNotFound ) - { -#ifndef RD_30_DISABLE_TOUCH - MenuBar()->StopDisplayingMenuBar(); - MenuBar()->TryDisplayContextMenuBarL(); -#else - iFindContextMenu->StopDisplayingMenuBar(); - iFindContextMenu->TryDisplayMenuBarL(); -#endif - } - } - -// --------------------------------------------------------- -// CIMCVAppView::SwitchTabL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppView::SwitchTabL(TInt aActiveServiceId ,const TDesC& aChatId, const TInt /*aTabIndex*/) - { - //change the contact id based on tteh currenttab - iRecipientUserId->Des().Copy(aChatId); - if( aActiveServiceId != iServiceId ) - { - SwitchToValidServiceL( aActiveServiceId ); - } - // subscribe for presence notification - if (iActiveEngine->IsLoggedIn()) - { - iActiveEngine->MessageHandler().SubscribePresenceL( aChatId ); - } - // To prevent looping between this view and refresh view - // resolve message read interface - MIMCVEngineMessageReadInterface& readInterface = - iActiveChatInterface->MessageReadInterfaceL( iServiceId, *iRecipientUserId ); - MIMCVEngineMessageWriteInterface& writeInterface = - iActiveChatInterface->MessageWriteInterfaceL( iServiceId, *iRecipientUserId ); - - TPtrC displayId = readInterface.Name(); - - if (iStatusPane) - { - iStatusPane->SetTitleL( displayId ); - } - SetStatusPaneIconsL(); - - //remove the controls from view stack - if ( iContainer ) - { - iAppUi->RemoveFromViewStack( *this, iContainer ); - } - - if ( iFindContextMenu ) - { - iAppUi->RemoveFromViewStack( *this, iFindContextMenu ); - } - - //again add those controls to view stack - if ( iContainer ) - { - iContainer->SwitchViewL(&readInterface, &writeInterface, *iRecipientUserId ); - iAppUi->AddToViewStackL( *this, iContainer ); - } - - if ( iFindContextMenu ) - { - iAppUi->AddToStackL( *this, iFindContextMenu, ECoeStackPriorityDefault, - ECoeStackFlagRefusesFocus ); - } - UpdateToolbarButtonsStateL(); - } - - -// --------------------------------------------------------- -// CIMCVAppView::NotifyWhenCompleted() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppView::NotifyWhenCompleted() - { - MAknEditingStateIndicator* editStateIndicator = - CAknEnv::Static()->EditingStateIndicator(); - - if ( editStateIndicator ) - { - CAknIndicatorContainer* indicatorContainer = editStateIndicator->IndicatorContainer(); - - if (( indicatorContainer ) && (iStatusPane)) - { - iStatusPane->HideFadeText(); - iStatusPane->HideNavipaneIndicators(); - } - } - - if ( iContainer ) - { - CEikRichTextEditor& editor = iContainer->Editor().Editor(); - - if (!editor.IsFocused()) - { - editor.SetAknEditorFlags( editor.AknEdwinFlags()|EAknEditorFlagNoEditIndicators ); - if (iStatusPane) - { - TRAP_IGNORE( iStatusPane->ShowTabL() ); - } - } - else - { - editor.SetAknEditorFlags( editor.AknEdwinFlags()&~EAknEditorFlagNoEditIndicators ); - } - } - - - } - - -// --------------------------------------------------------- -// CIMCVAppView::NotifyWhenStarted() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppView::NotifyWhenStarted() - { - if ( iContainer ) - { - CEikRichTextEditor& editor = iContainer->Editor().Editor(); - if (editor.IsFocused()) - { - editor.SetAknEditorFlags( editor.AknEdwinFlags()|EAknEditorFlagNoEditIndicators ); - } - } - } - -// --------------------------------------------------------- -// CIMCVAppView::ViewRefresh() -// This method refreshes the view. -// (other items were commented in a header). -// --------------------------------------------------------- -void CIMCVAppView::ViewRefreshL() - { - IM_CV_LOGS(TXT("CIMCVAppView::ViewRefreshL() start") ); - - if ( iContainer ) - { - iAppUi->RemoveFromViewStack( *this, iContainer ); - // not in a middle of sending message - delete iContainer; - iContainer = NULL; - } - if ( iFindContextMenu ) - { - iAppUi->RemoveFromViewStack( *this, iFindContextMenu ); - } - - UpdateToolbarButtonsStateL(); - IM_CV_LOGS(TXT("CIMCVAppView::ViewRefreshL() End") ); - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::LaunchHelpL() -// Function launches help application using the HlpLauncher. -// @params: Reference to a descriptor, serves as context. -// --------------------------------------------------------- -// - - -void CIMCVAppView::LaunchHelpL( const TDesC& aContext ) - { - CArrayFix< TCoeHelpContext >* cntx = new( ELeave ) CArrayFixFlat< TCoeHelpContext >( KHelpContextSize ); - CleanupStack::PushL( cntx ); - - cntx->AppendL( TCoeHelpContext( KHelpUid, aContext ) ); - CleanupStack::Pop( cntx ); - - //and launch help - takes ownership of context array - HlpLauncher::LaunchHelpApplicationL( CEikonEnv::Static()->WsSession(), cntx ); - } -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::ShowMeL() -// Function launches help application using the HlpLauncher. -// @params: Reference to a descriptor, serves as context. -// --------------------------------------------------------- -// -void CIMCVAppView::ShowMeL( const TDesC8& aParamData ) - { - IM_CV_LOGS(TXT("CIMCVAppView::ShowMeL() Start" )); - TPckgBuf params; - params.Copy( aParamData ); - - if(iAppUi) - { - IM_CV_LOGS(TXT("CIMCVAppView::ShowMeL() Inside if(iAppUi)" )); - if(iConnection) - { - iConnection->Close(); - iConnection = NULL; - } - // show me may called before ActivateViewL is called - //Get the service id - this property is published by imcvlauncher - TInt error = RProperty::Get( KMeCoPropertyUid, KMeCoConvViewServiceIdKey, iServiceId ); - User::LeaveIfError(error); - TInt serviceId = iActiveEngine->GetServiceId(); - if( serviceId != iServiceId ) - { - SwitchToValidServiceL( iServiceId ); - } - /* Get the current active REcipient ID, if that is not matching, then launch cv */ - TPtrC activeRecipientId = iEngineFactory->GetActiveItemL (); - // IM_CV_LOGS(TXT("CIMCVAppView::SHOWMEL() ACTIVE RECIPIENT ID %S *****************"), &activeRecipientId ); - - TPtrC recieptId = params().iBuddyId; - TPtrC displayName = params().iBuddyName; - iRecipientUserId->Des().Copy(recieptId); - // show me may called before ActivateViewL is called - // if its only update, which is true only when a contact is edited. - IM_CV_LOGS(TXT("CIMCVAppView::ShowMeL() Inside if(iAppUi) : %d" ), params().iUpdate); - - if(params().iUpdate ) - { - IM_CV_LOGS(TXT("CIMCVAppView::ShowMeL() if(params().iUpdate)" )); - - MIMCVEngineMessageWriteInterface& messageWriteInterface = iActiveChatInterface-> - MessageWriteInterfaceL(params().iServiceId,recieptId); - messageWriteInterface.SetNameL(displayName); - if(iStatusPane) - { - // refresh the view if the update has tacke place when the conversation view is open. - IM_CV_LOGS(TXT("CIMCVAppView::ShowMeL() calling RefreshTabL)" )); - iStatusPane->RefreshTabL(recieptId,displayName); - } - - } - else - { - IM_CV_LOGS(TXT("CIMCVAppView::ShowMeL() else" )); - iAppUi->StorePreviousViewDetails(params().iAppUid, params().iViewUid ); - if ( (!iViewDeactivated) && (iRecipientUserId) && - (serviceId == iServiceId) && - (0 == recieptId.Compare(activeRecipientId)) ) - { - SetStatusPaneIconsL(); - if (iStatusPane) - { - iStatusPane->BringToForegroundL(); - } - iAppUi->BringToForeground(TUid::Uid(KIMCVUIAPPEXEUID3)); - // when view moved to background ,active conversation was deactivated - // comming to forground activate it - iActiveEngine->MessageHandler().StartNewConversationL( recieptId ); - } - else - { - IM_CV_LOGS(TXT("CIMCVAppView::ShowMeL() NOT MATCHING AT ALL" )); - iAppUi->ActivateLocalViewL(KUidConversationsView, KNullUid, aParamData); - } - UpdateToolbarButtonsStateL(); - } - } - IM_CV_LOGS(TXT("CIMCVAppView::ShowMeL() End" )); - } -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::SwitchToValidServiceL() -// Function launches help application using the HlpLauncher. -// @params: Reference to a descriptor, serves as context. -// --------------------------------------------------------- -// -void CIMCVAppView::SwitchToValidServiceL( TInt aServiceId ) - { - if( aServiceId <= 0 ) - { - return; - } - iServiceId = aServiceId; - iActiveEngine = &iEngineFactory->GetServiceEngineL( iServiceId ); - iActiveEngine->ResolveServiceStateL(); - iActiveChatInterface = &iActiveEngine->ChatInterface(); - if( iContainer ) - { - // resolve message read interface - iContainer->SetServiceParametersL( iActiveEngine ); - } - } -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::OfferTabEventL() -// Function launches help application using the HlpLauncher. -// @params: Reference to a descriptor, serves as context. -// --------------------------------------------------------- -// -TKeyResponse CIMCVAppView::OfferTabEventL(const TKeyEvent& aKeyEvent,TEventCode aType) - { - TKeyResponse keyResponse = EKeyWasConsumed; - - CAknTabGroup* tabGroup= NULL; - if(iStatusPane) - { - tabGroup = iStatusPane->TabGroup(); - - - if(tabGroup) - { - keyResponse = tabGroup->OfferKeyEventL(aKeyEvent,aType); - } - } - - return keyResponse; - - } - -// --------------------------------------------------------------------------- -// CIMCVAppView::UpdateToolbarButtonsState -// --------------------------------------------------------------------------- -// -void CIMCVAppView::UpdateToolbarButtonsStateL() - { - if ( iContainer && iRecipientUserId ) - { - MIMCVEngineMessageReadInterface& readInterface = - iActiveChatInterface->MessageReadInterfaceL( iServiceId, *iRecipientUserId ); - - if ( readInterface.ContactLink().Length()> 0 ) - { - Toolbar()->SetItemDimmed(EIMCVCmdToolbarDetails, EFalse, ETrue); - } - else { - Toolbar()->SetItemDimmed(EIMCVCmdToolbarDetails, ETrue, ETrue); - } - - TBool needToDimSendBtn = ETrue; - if(iContainer->Editor().TextLength()> 0) - { - needToDimSendBtn = EFalse; - } - Toolbar()->SetItemDimmed( EIMCVCmdToolbarSend, needToDimSendBtn, ETrue ); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppView: HandleNewServiceL -// ----------------------------------------------------------------------------- -// -void CIMCVAppView::HandleNewServiceL( TInt aServiceId ) - { - if( iExtensionHandler ) - { - iExtensionHandler->CreateServiceSmileyL( aServiceId ); - } - } -// ----------------------------------------------------------------------------- -// CIMCVAppView: HandleServiceDeletedL -// ----------------------------------------------------------------------------- -// -void CIMCVAppView::HandleServiceDeletedL( TInt aServiceId ) - { - if( iExtensionHandler ) - { - iExtensionHandler->DeleteServiceSmileyL( aServiceId ); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppView::HandlePresenceChangedL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppView::HandlePresenceChangedL(TInt aServiceId, const TDesC& aBuddyId ) - { - IM_CV_LOGS(TXT("CIMCVAppView::HandlePresenceChangedL() start") ); - if ( (iServiceId == aServiceId ) && ( iRecipientUserId->Compare( aBuddyId ) == 0 ) ) - { - SetStatusPaneIconsL(); - } - if (iContainer) - { - CIMCVEngine& engine = iEngineFactory->GetServiceEngineL( aServiceId ); - iContainer->InsertStatusChangedMessageL(engine, aServiceId, aBuddyId ); - } - IM_CV_LOGS(TXT("CIMCVAppView::HandlePresenceChangedL() End") ); - } -// --------------------------------------------------------- -// CIMCVAppView::HandleOperationCompletdL -// Handles operation completion -// --------------------------------------------------------- -// -void CIMCVAppView::HandleOperationCompletdL(TInt /*aServiceId*/, MIMCVEngineMessage::TMessagerType /*aType*/ , TInt aResult ) - { - IM_CV_LOGS(TXT("CIMCVAppView::HandleOperationCompletdL() start") ); - - if( aResult!= KErrNone ) - { - // show the corresponding error or information note - IMCVUiAppNoteMapper::ShowNoteL( aResult,*iRecipientUserId ); - } - - IM_CV_LOGS(TXT("CIMCVAppView::HandleOperationCompletdL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppView::HandleConnectionTerminatedL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppView::HandleConnectionEventL( TInt aServiceId, TIMCVConnectionState aState, TInt aReason ) - { - IM_CV_LOGS(TXT("CIMCVAppView::HandleConnectionEventL() start") ); - - switch (aState) - { - case EUnKnown: - break; - case ELoggedIn: - // Nothing to be done. - break; - case ELoggedOut: - case EForcedLoggedOut: - { - /* - * Only when the application is in Foreground, we need to show the note - * before closing the application. Once after that we need to shutdown the - * application - */ - if ( iAppUi->IsAppInForeground() && ( aServiceId == iServiceId ) ) - { - // active service - if (KErrNone != aReason) - IMCVUiAppNoteMapper::ShowNoteL( aReason , KNullDesC ); - } - // if application is in the background, then on logout - // clean up the container, and if the cca was open then close. - // only for the logged out service. - if( aServiceId == iServiceId ) - { - if(iConnection) - { - iConnection->Close(); - iConnection = NULL; - } - if(iViewDeactivated) - { - ViewRefreshL(); - // set this to KNullDesC since conversation is getting closed. - iRecipientUserId->Des().Copy( KNullDesC()); - } - } - - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppView::HandleConnectionEventL() End") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppView: HandleChatListEvent -// ----------------------------------------------------------------------------- -// -void CIMCVAppView::HandleChatListEvent(TInt aServiceId,TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* aContainerInfo - ) - { - IM_CV_LOGS (TXT("CIMCVAPPVIEW ")); - // Handles the close Conversation event triggered from service tab. - switch (aEvent) - { - case EChatItemDeleted: - { - DeleteContainerCache( aContainerInfo->TargetId().Target(),aServiceId ); - break; - } - case EChatAllItemDeleted: - { - IM_CV_LOGS (TXT("CIMCVAPPVIEW :: DELETE ALL CHATS ***************************")); - - if(iViewDeactivated) - { - iRTContainerCache->DeleteAllServiceContainer( aServiceId ); - } - - break; - } - default: - break; - } - - } - -//-------------------------------------------------------------------------------- -//CIMCVAppView::DeleteContainerCache -//-------------------------------------------------------------------------------- -void CIMCVAppView::DeleteContainerCache(const TDesC& aPrimaryKey, TInt aServiceId ) - { - iRTContainerCache->DeleteContainer( aPrimaryKey,aServiceId ); - //iActiveEngine->MessageHandler().CloseConversationL( *iRecipientUserId ); - ViewRefreshL(); - iRecipientUserId->Des().Copy( KNullDesC()); - - if( !iViewDeactivated ) //if conv. view is active, we should go back to ST.. - { - //this will execute when Back operation from Detail view is performed before call back (xsp id deletion call back) - //reaches the conv. view. - //In this case Conv. view will be active view and Conv. view need to be closed in this scenario. - TApaTask task(iEikonEnv->WsSession()); - task.SetWgId( CEikonEnv::Static()->RootWin().Identifier()); - task.SendToBackground(); - } - else //if view is not active (Current view is detail view). - { - if(iDetailViewOpen) - { - //xsp id deleted from detail view. - //conv. view need to be closed when doing back operation from detail view. - iConvViewDel = ETrue; - } - } - - iViewDeactivated = ETrue; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappviewcontainer.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappviewcontainer.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1306 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - -// INCLUDE FILES -#include "cimcvappviewcontainer.h" - -#include "cimcvengine.h" -#include "mimcvenginemessagesreadinterface.h" -#include "mimcvenginemessageswriteinterface.h" -#include "cimcvappviewcontrol.h" -#include "cimcvenginemessagecreator.h" -#include "mimcvenginemessage.h" -#include "cimcvappui.h" -#include "imcvuiappnotemapper.h" -#include "mimcvapplayoutinfo.h" -#include "imcvlogger.h" -#include "cimcvappbitmapmapping.h" -#include "mimcvuiappskinvariant.h" -#include "imcvuiapputils.h" -#include "cimcvappmessageextensionshandler.h" -#include "mimcvenginemessagecontainerinfo.h" -#include "mimcvenginemessagehandler.h" -#include "mimcvrecipientobserver.h" -#include "imcvuiapp.hrh" -//consts -#include "imcvuiliterals.h" -#include "imcvuiapp.h" -#include -#include -#include //cdl -#include //cdl -#include -#include -#include -#include // for EAknFepSoftkeySpell -#include - -#include -#include - -#include "conversations.h" - -#include "cimcvapplogineventlistener.h" -#include "cimcvappwaitnote.h" -#include -#include - -#include "mimcvenginecchhandler.h" -#include "mimcvenginemessageswriteinterface.h" -#include "mimcvenginechatinterface.h" - -#include - -#include -#include "cimcvappview.h" - - - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// CIMCVAppViewContainer::NewL -// Symbian constructor can leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppViewContainer* CIMCVAppViewContainer::NewL( - const TRect& aRect, - CIMCVEngine* aEngine, - MIMCVEngineMessageReadInterface* aReadInterface, - MIMCVEngineMessageWriteInterface* aWriteInterface, - CIMCVAppView* aParent, - CIMCVAppMessageExtensionsHandler& aMessageHandler, - CEikButtonGroupContainer* aCba, - const TDesC& aRecipientId, - MIMCVRecipientObserver* aRecipientObserver, - CIMCVAppRichTextContainerCache* aRTContainerCache, - CGulIcon* aFromMe, CGulIcon* aToMe) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::NewL() start") ); - CIMCVAppViewContainer* self = new ( ELeave ) - CIMCVAppViewContainer(aEngine,aReadInterface,aWriteInterface, - aMessageHandler, aCba, aRecipientObserver,*aParent, aRTContainerCache ); - - CleanupStack::PushL( self ); - self->ConstructL( aRect, aParent, aFromMe, aToMe,aRecipientId); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::NewL() end") ); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewContainer::CIMCVAppViewContainer -// Default constructor must not leave -// ----------------------------------------------------------------------------- -// -CIMCVAppViewContainer::CIMCVAppViewContainer(CIMCVEngine* aEngine, - MIMCVEngineMessageReadInterface* aReadInterface, - MIMCVEngineMessageWriteInterface* aWriteInterface, - CIMCVAppMessageExtensionsHandler& aMessageHandler, - CEikButtonGroupContainer* aCba, - MIMCVRecipientObserver* aRecipientObserver, - CIMCVAppView& aAppView, - CIMCVAppRichTextContainerCache* aRTContainerCache): - iActiveEngine(aEngine), - iReadInterface(aReadInterface), - iWriteInterface(aWriteInterface), - iMessageExtensionsHandler( aMessageHandler ), - iCba( aCba ), - iRecipientObserver( aRecipientObserver ), - iAppView(aAppView), - iRTContainerCache(aRTContainerCache) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::CIMCVAppViewContainer() start") ); - // take virtual ownership of interfaces, so that they are not deleted - IM_CV_LOGS(TXT("CIMCVAppViewContainer::CIMCVAppViewContainer() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewContainer::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewContainer::ConstructL( const TRect& aRect, - MObjectProvider* aParent, - CGulIcon* aFromMe, CGulIcon* aToMe, - const TDesC& aRecipientId ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::ConstructL() start") ); - // for getting mbm path from CIMCVAPPAppUi - iRecipientId = aRecipientId.AllocL(); - - iAppUi = static_cast( CEikonEnv::Static()->AppUi() ); - iAppUi->AddLayoutChangeObserver( this ); - - // This must be done first. - SetMopParent( aParent ); - CreateWindowL(); - - iSkinVaiant = iAppUi->SkinVariantL(); - - iFromMe = aFromMe; - iToMe = aToMe; - //Load from-me and to-me icons - if(!iFromMe) - { - iFromMe = LoadBitmapL(KEMbmImcvuiappQgnpropimfrom,EMbmImcvuiappQgn_prop_im_from,EMbmImcvuiappQgn_prop_im_from_mask); - } - if(!iToMe) - { - iToMe = LoadBitmapL(KEMbmImcvuiappQgnpropimtome,EMbmImcvuiappQgn_prop_im_tome,EMbmImcvuiappQgn_prop_im_tome_mask ); - } - - - iMsgEditor = CIMCVAppMessageEditor::NewL(this, iAppUi->MbmFullPath(), iAppView, - iMessageExtensionsHandler ); - iMsgEditor->SetMessageEditorObserver(this); - //Sets the previously typed message in the editor - iMsgEditor->SetTextL( iReadInterface->GetEditerMessage() ); - iChatView = CIMCVAppViewControl::NewL( aRect, - *this, - *iReadInterface, - iMessageExtensionsHandler, - iFromMe, - iToMe, - *iRTContainerCache, - *iActiveEngine ); - iChatView->SetObserver( this ); - iMsgEditor->SetObserver( this ); - - iAppUi->LayoutInfo()->SetLayoutID( TChatListBoxLayout::EWithEditor ); - iAppUi->LayoutInfo()->SetEditorVisibility( ETrue ); - - SetRect( aRect ); - - iMsgEditor->Editor().SetCursorPosL(0, EFalse); - iChatView->SetFocus( EFalse ); - iMsgEditor->SetFocus(EFalse); - - ActivateL(); - - iChatView->SetTapObserver( this, EMessageList ); - iMsgEditor->SetTapObserver( this, EMessageEditor ); - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::ConstructL() end") ); - } - - -// --------------------------------------------------------- -// CIMCVAppViewContainer::~CIMCVAppViewContainer() -// --------------------------------------------------------- -// -CIMCVAppViewContainer::~CIMCVAppViewContainer() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::DESTRUCTING() DESTRUCTER GETTING CALLED end") ); - if(iChatView) - { - delete iChatView; - } - if(iEditorMessage) - { - delete iEditorMessage; - } - delete iMsgEditor; - if( iAppUi ) - { - if( !iAppUi->IsUnderDestruction() ) - { - iAppUi->LayoutInfo()->SetEditorVisibility( EFalse ); - iAppUi->RemoveLayoutChangeObserver( this ); - } - } - } -// --------------------------------------------------------- -// CIMCVAppViewContainer::SetServiceParametersL() -// This method is called when scrolling is started again -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::SetServiceParametersL( - CIMCVEngine* aNewEngine ) - { - iActiveEngine = aNewEngine; - } -// --------------------------------------------------------- -// CIMCVAppViewContainer::StartScrollingL() -// This method is called when scrolling is started again -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::StartScrollingL() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::StartScrollingL() start") ); - // disable highlight and set focus to editor - if( iChatView->Highlighted() ) - { - iChatView->DisableHighlightL(); - } - iMsgEditor->SetFocus( ETrue, EDrawNow ); - iMsgEditor->DrawDeferred(); - UpdateCbaL(); - iAppView.UpdateToolbarButtonsStateL(); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::StartScrollingL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::StopScrollingL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::StopScrollingL() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::StopScrollingL() start") ); - // unfocus editor (highlighting is enabled - // automatically in OfferKeyEvent of ChatView) - iMsgEditor->SetFocus( EFalse, EDrawNow ); - iMsgEditor->DrawDeferred(); - // Set editor cursor pos to end of text - iMsgEditor->Editor().SetCursorPosL( iMsgEditor->TextLength(), EFalse ); - UpdateCbaL(); - iAppView.UpdateToolbarButtonsStateL(); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::StopScrollingL() end") ); - } - -void CIMCVAppViewContainer :: SmileyDialogLaunched (TBool aLaunched) - { - iChatView->SmileyDialogLaunched (aLaunched); - } -void CIMCVAppViewContainer :: UpdateChatViewL () - { - iChatView->UpdateChatViewL (); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::UpdateCbaL() -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::UpdateCbaL() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::UpdateCbaL() start") ); - if( iChatView->Highlighted() ) - { - // focus on chatview - HBufC* item = iChatView->SelectedItemL(); - CleanupStack::PushL( item ); - if( item && item->Length() > 0 ) - { - // automatic find item selected - TInt cbaRes = R_CV_SOFTKEYS_OPTIONS_BACK__CONTEXTOPTIONS; - iCba->SetCommandSetL( cbaRes ); - iCba->DrawNow(); - } - CleanupStack::PopAndDestroy( item ); - } - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::UpdateCbaL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::HandleMessageEditorEventL() -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::HandleMessageEditorEventL( TEditorEvent aEvent ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::HandleMessageEditorEventL() start") ); - - switch( aEvent ) - { - case EEditorContentCleared: - { - // Call StartScrollingL to update CBA if needed - StartScrollingL(); - break; - } - case EEditorContentChanged: - { - // Call StartScrollingL to update CBA if needed - if(!iMsgEditor->IsFocused())//!iEditor->IsFocused()) - { - StartScrollingL(); - } - break; - } - default: - { - break; - } - } - // need to implements - IM_CV_LOGS(TXT("CIMCVAppViewContainer::HandleMessageEditorEventL() end") ); - } - - -void CIMCVAppViewContainer::StartConversationL() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::StartConversationL() start") ); - // start a conversation with selected user id, - // exist cache info fetch that - - iActiveEngine->MessageHandler().StartNewConversationL( *iRecipientId ); - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::StartConversationL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::CloseConversationL() -// This method handles message sending to engine -// --------------------------------------------------------- -// -TInt CIMCVAppViewContainer::CloseConversationL(const TDesC& aBuddyId ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::CloseConversationL()") ); - // close the conversation with selected user id, - // exist cache info fetch that - iRTContainerCache->DeleteContainer(iReadInterface->Name() ,iActiveEngine->GetServiceId() ); - return iActiveEngine->MessageHandler().CloseConversationL( aBuddyId ); - } -// --------------------------------------------------------- -// CIMCVAppViewContainer::DeactivateConversationL() -// This method handles message sending to engine -// --------------------------------------------------------- -// -TInt CIMCVAppViewContainer::DeactivateConversationL() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::DeactivateConversationL()") ); - // start a conversation with selected user id, - // exist cache info fetch that - return iActiveEngine->MessageHandler().DeactivateConversationL(); - } -// --------------------------------------------------------- -// CIMCVAppViewContainer::SendMessageL() -// This method handles message sending to engine -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::SendMessageL() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SendMessageL() start") ); - - TBool loggedIn = IsLoggedIn(); - if( !loggedIn ) - { - // load the promp from lOC file + server name - HBufC* prompt = StringLoader::LoadLC( R_SERVTAB_CONNECTION_NEEDED_TO, - iActiveEngine->ServiceName() ); - - TInt ret = IMCVUiAppNoteMapper::DisplayQueryDialogL( R_GENERIC_YES_NO_CONFIRMATION_QUERY, - *prompt ); - - CleanupStack::PopAndDestroy( prompt ); - - - if( ( ret == EAknSoftkeyOk ) || ( ret == EAknSoftkeyYes ) ) - { - // load the promp from lOC file + server name - HBufC* prompt = StringLoader::LoadLC( R_SERVTAB_LOGIN_ONGOING, - iActiveEngine->ServiceName() ); - - CIMCVAppWaitNote* waitDialog = CIMCVAppWaitNote::ShowWaitNoteL( - *prompt, - ETrue ); - - CleanupStack::PushL(waitDialog); - - // start capturing the events - iAppUi->CaptureEventsL(); - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SendMessageL() BEFORE CALLING LOGIN") ); - TRAPD(error, iActiveEngine->LoginL()); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SendMessageL() AFTER CALLING LOGIN") ); - // stop capturing the events - iAppUi->ReleaseCapturingL(); - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SendMessageL() start") ); - loggedIn = IsLoggedIn(); - if (KErrNone != error) - { - IMCVUiAppNoteMapper::ShowNoteL( KImErrServiceGeneralError , KNullDesC ); - } - else - { - // subscribe for presence notification - iActiveEngine->MessageHandler().SubscribePresenceL( *iRecipientId ); - } - - CleanupStack::PopAndDestroy(); //waitDialog - CleanupStack::PopAndDestroy(); //prompt - } - } - - if( loggedIn ) - { - if(iEditorMessage) - { - delete iEditorMessage; - iEditorMessage = NULL; - } - iEditorMessage = iMessageExtensionsHandler.ProcessMessageLC( iMsgEditor->Editor(), - iActiveEngine->GetServiceId() ); - - TPtr msgPtr( iEditorMessage->Des() ); - CleanupStack::Pop();//iEditorMessage - - if( msgPtr.Length() == 0 ) - { - return; - } - - TPtrC ownUserId = iActiveEngine->GetLoggedInUserId() ; - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - ownUserId, - *iRecipientId, // Recipient - msgPtr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message = iActiveEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - - iWriteInterface->AppendL(message ); - - iActiveEngine->MessageHandler().SendMessageL( *message ); - - ResetAfterSendL(); - StopScrollingL(); - } - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SendMessageL() end") ); - } - - -// --------------------------------------------------------- -// CIMCVAppViewContainer::InsertStatusChangedMessageL() -// This method handles message sending to engine -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::InsertStatusChangedMessageL(CIMCVEngine& aEngine , - TInt aServiceId, - const TDesC& aBuddyId ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::InsertStatusChangedMessageL() start") ); - - TIMCVOnlineStatus status = aEngine.MessageHandler().GetPresenceStatus(); - TInt resourceId(0); - switch( status ) - { - case EOnline: - { - resourceId = R_SERVTAB_STATUS_CHANGE_ONLINE; - break; - } - case EInvisible: - { - resourceId = R_SERVTAB_STATUS_CHANGE_ONTHEPHONE; - break; - } - case EAway: - { - resourceId = R_SERVTAB_STATUS_CHANGE_AWAY; - break; - } - case EBusy: - { - resourceId = R_SERVTAB_STATUS_CHANGE_DND; - break; - } - case EOnPhone: - { - resourceId = R_SERVTAB_STATUS_CHANGE_ONTHEPHONE; - break; - } - case EDoNotDisturb: - { - resourceId = R_SERVTAB_STATUS_CHANGE_DND; - break; - } - case EBlock: - { - resourceId = R_SERVTAB_STATUS_CHANGE_BLOCKED; - break; - } - case EOffline : - default: - { - resourceId = R_SERVTAB_STATUS_CHANGE_OFFLINE; - // default offline always - } - } - // not owned , chat interface - MIMCVEngineChatInterface* chatInterface = &(aEngine.ChatInterface() ); - MIMCVEngineMessageReadInterface& readInterface = chatInterface->MessageReadInterfaceL( aServiceId, aBuddyId ); - - // cleanup stack - HBufC* textmessage = StringLoader::LoadLC( resourceId, readInterface.Name() ); - TPtrC textmessagePtr( textmessage->Des() ); - - TPtrC ownUserId = aEngine.GetLoggedInUserId() ; - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - ownUserId, - aBuddyId, // Recipient - textmessagePtr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageOther - }; - MIMCVEngineMessage* message = aEngine.MessageHandler().MessageCreator().CreateMessageL( data ); - - MIMCVEngineMessageWriteInterface& writeInterface = chatInterface->MessageWriteInterfaceL( aServiceId, aBuddyId ); - writeInterface.AppendL( message ); - - // append message to cache , this is not sent/recieve message - // based on status change message is automatically created - aEngine.MessageHandler().AppendToCacheL( aBuddyId, textmessagePtr ); - - CleanupStack::PopAndDestroy();// textmessage - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::InsertStatusChangedMessageL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::ResetAfterSendL() -// Resets arrays, lines and nick length after send -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::ResetAfterSendL() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::ResetAfterSendL() start") ); - iMsgEditor->SetTextL(KNullDesC()); - StartScrollingL(); // Call to update CBA - IM_CV_LOGS(TXT("CIMCVAppViewContainer::ResetAfterSendL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::IsLoggedIn() -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CIMCVAppViewContainer::IsLoggedIn() const - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::IsLoggedIn() ") ); - - if (!iActiveEngine->IsLoggedIn()) - { - return EFalse; - } - - return ETrue; - } -// --------------------------------------------------------- -// CIMCVAppViewContainer::IsStopped() -// This method checks if scroll mode is on or off -// --------------------------------------------------------- -// -TBool CIMCVAppViewContainer::IsStopped() const - { - return iChatView->Highlighted(); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::DisplayInfoNoteL() -// Displays info note for corresponding resource id -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::DisplayInfoNoteL( const TInt aResourceId ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::DisplayInfoNoteL() start") ); - CAknNoteDialog* infoNote = new (ELeave) CAknNoteDialog( CAknNoteDialog:: - EConfirmationTone,CAknNoteDialog::EShortTimeout ); - - infoNote->ExecuteLD( aResourceId ); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::DisplayInfoNoteL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::LayoutChangedL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::LayoutChangedL( TInt aType ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::LayoutChangedL() start") ); - TRect mainPaneRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect ); - SetRect( mainPaneRect ); - // Update skin context of editor - if ( iMsgEditor ) - { - iMsgEditor->HandleFindSizeChanged(); - } - if (iRTContainerCache && aType == KAknsMessageSkinChange) - { - iRTContainerCache->UpdateSkinTextColorL (); - } - CCoeControl::HandleResourceChange( aType ); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::LayoutChangedL() end") ); - } - - -// --------------------------------------------------------- -// CIMCVAppViewContainer::SelectedItem() -// --------------------------------------------------------- -// -HBufC* CIMCVAppViewContainer::SelectedItemL() - { - return iChatView->SelectedItemL(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewContainer::SelectedItemType -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppViewContainer::SelectedItemType() - { - return iChatView->SelectedItemType(); - } -// ----------------------------------------------------------------------------- -// CIMCVAppViewContainer::SetItemHighlightL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewContainer::SetItemHighlightL( TBool aHighlight ) - { - iChatView->SetHighlight( aHighlight ); - DrawNow (); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::HandleEdwinSizeEventL( CEikEdwin* aEdwin, -// TEdwinSizeEvent aEventType, TSize aDesirableEdwinSize ) -// This method is called when editor is extended to two lines -// --------------------------------------------------------- -// -TBool CIMCVAppViewContainer::HandleEdwinSizeEventL( CEikEdwin* /*aEdwin*/, - TEdwinSizeEvent aEventType, TSize /*aDesirableEdwinSize*/ ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::HandleEdwinSizeEventL() start") ); - if (aEventType == EEventSizeChanging ) - { - iMsgEditor->HandleFindSizeChanged(); - DrawNow(); - return ETrue; - } - IM_CV_LOGS(TXT("CIMCVAppViewContainer::HandleEdwinSizeEventL() end") ); - return EFalse; - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::HandleControlEventL -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::HandleControlEventL( CCoeControl* aControl, - TCoeEvent aEventType ) - { - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::HandleControlEventL() start") ); - if( EEventRequestFocus == aEventType ) - { - if( aControl == static_cast(iMsgEditor) ) - { - // Focus to editor - StartScrollingL(); - } - else // aControl == iChatView - { - // Focus to messagelist - StopScrollingL(); - } - } - - if( IMCVUiAppUtils::PenEnabled() ) - { - if( EEventStateChanged == aEventType ) - { - if( aControl == (CCoeControl*)iMsgEditor ) - { - // Update MSK - When using virtual keyboard - // on touch enabled devices, one is bound to receive - // EEventStateChanged. Hence handle the same - UpdateCbaL(); - } - } - } - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::HandleControlEventL() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::SizeChanged() -// Called by framework when the view size is changed -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::SizeChanged() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SizeChanged() start") ); - - TAknLayoutRect rp; - - rp.LayoutRect( Rect(), AknLayoutScalable_Apps::im_reading_pane( - TChatListBoxLayout::EWithEditor2Lines) ); - // Set icon sizes, do this before setting the rect for - // chat view to prevent icon sizes from changing after chat - - // view rect is set. - ResizeIcons( TextRect() ); - - // set rect for chat view - iChatView->SetRect( rp.Rect() ); - // and editor - iMsgEditor->HandleFindSizeChanged(); - DrawNow(); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SizeChanged() end") ); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::CountComponentControls() const -// --------------------------------------------------------- -// -TInt CIMCVAppViewContainer::CountComponentControls() const - { - // We have 2 controls - return 2; - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::ComponentControl(TInt aIndex) const -// --------------------------------------------------------- -// -CCoeControl* CIMCVAppViewContainer::ComponentControl( TInt aIndex ) const - { - //returns control with aIndex - switch ( aIndex ) - { - case 0: - { - return iChatView; - } - case 1: - { - return iMsgEditor; - } - default: - { - return NULL; - } - } - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::Draw(const TRect& aRect) const -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::Draw( const TRect& aRect ) const - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::Draw() const start") ); - CWindowGc& gc = SystemGc(); - - iSkinVaiant->ClearChatListBoxBackGround( - gc, aRect, - iSkinVaiant->MainPaneBackgroundContext() ); - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::Draw() const end") ); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, -// TEventCode aType ) -// Handles keyevents -// --------------------------------------------------------- -// -TKeyResponse CIMCVAppViewContainer::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::OfferKeyEventL() start") ); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::OfferKeyEventL() is EKeyPhoneSend Event = %d") , aKeyEvent.iCode ); - - //Consume the EEventKeyUp event for send key so that it will not launch the dialler before sending the actual message. - if ( aKeyEvent.iScanCode == EStdKeyYes && aType != EEventKey ) - { - return EKeyWasConsumed; - } - - if( (iChatView->Highlighted() ) || ( !iMsgEditor->IsFocused()) ) - { - if( (aKeyEvent.iScanCode >= '0' && aKeyEvent.iScanCode <= '9') || - (aKeyEvent.iScanCode >= 'a' && aKeyEvent.iScanCode <= 'z') || - (aKeyEvent.iScanCode >= 'A' && aKeyEvent.iScanCode <= 'Z') || - (aKeyEvent.iScanCode >= EStdKeyComma && aKeyEvent.iScanCode <= EStdKeyNkpPlus) || - aKeyEvent.iScanCode == EStdKeySpace || aKeyEvent.iScanCode == EStdKeyLeftShift ) - { - // stop the automatic scrolling and start manual - // if user presses any of the number keys (0-9) - // or user presses any key on the QWERT - key pad - StartScrollingL(); - return EKeyWasConsumed; - } - } - - - switch( aKeyEvent.iCode ) - { - // flowthrough - case EKeyEnter: - case EKeyOK: - case EKeyPhoneSend: - { - if( iMsgEditor->IsFocused() ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::OfferKeyEventL() message editor Focused ") ); - // trapping error so that focus can be returned to editor - SendMessageL() ; - IM_CV_LOGS(TXT("CIMCVAppViewContainer::OfferKeyEventL() message Sent ") ); - iMsgEditor->SetFocus( ETrue ); - } - else if( aKeyEvent.iCode == EKeyEnter || aKeyEvent.iCode == EKeyOK - && iChatView->Highlighted() && iChatView->SelectedItemType() - != CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - StopScrollingL(); - iRecipientObserver->ShowPopUpMenuL(); - } - else if ( aKeyEvent.iCode == EKeyPhoneSend - && iChatView->Highlighted() - && (iChatView->SelectedItemType() - == (CFindItemEngine::EFindItemSearchPhoneNumberBin) - ||(CFindItemEngine::EFindItemSearchMailAddressBin)) ) - { - // Phone number highlighted, send key pressed -> call - iAppUi->ProcessCommandL( EIMCVCmdCall ); - } - //iAppView.UpdateToolbarButtonsStateL(); - StopScrollingL(); - return EKeyWasConsumed; - } - - case EKeyBackspace: - { - // if bitmap is selected, it is deleted "normally" in - // iEditor's OfferKeyEvent - if( iMsgEditor->Editor().SelectionLength() > 0 ) - { - break; - } - - TInt cursorPos( iMsgEditor->Editor().CursorPos() ); - if( cursorPos > 0 ) // at least one char in editor - { - TPtrC ptr = iMsgEditor->Editor().RichText()->Read( ( cursorPos - 1 ), 1 ); - // if a char to be "backspaced" is a picture - if( ptr[ 0 ] == CEditableText::EPictureCharacter ) - { - iMessageExtensionsHandler.DeleteExtensionL( iMsgEditor->Editor(), iActiveEngine->GetServiceId(), - EMessageExtensionSmiley, cursorPos - 1 ); - iAppView.UpdateToolbarButtonsStateL(); - return EKeyWasConsumed; - } - } - - if( cursorPos < 2 ) - { - cursorPos = 2; - } - - break; - } - - // flowthrough - case EKeyLeftArrow: - case EKeyRightArrow: - { - if( !iMsgEditor->IsFocused() ) - { - iAppView.UpdateToolbarButtonsStateL(); - return iAppView.OfferTabEventL(aKeyEvent, aType); - } - break; - } - - case EKeyDownArrow: // flowthrough - case EKeyUpArrow: - { - if( iMsgEditor->IsFocused() ) - { - iAppView.UpdateToolbarButtonsStateL(); - // editor is focused, try to offer the key - if( iMsgEditor->OfferKeyEventL( aKeyEvent, aType ) - == EKeyWasConsumed ) - { - // editor took it - return EKeyWasConsumed; - } - } - - // offer the key to our chat control - TKeyResponse res = static_cast(iChatView) - ->OfferKeyEventL( aKeyEvent, aType ); - - if( iChatView->Highlighted() ) - { - // change the cba - StopScrollingL(); - } - else - { - // change the cba - StartScrollingL(); - } - iAppView.UpdateToolbarButtonsStateL(); - return res; - } - - default: - { - break; - } - } - if ( iMsgEditor->IsFocused() ) - { - - TKeyResponse res = iMsgEditor->OfferKeyEventL( aKeyEvent, aType ); - iAppView.UpdateToolbarButtonsStateL(); - // Update CBA only when there is not a shift held down - if ( !( aKeyEvent.iModifiers & EModifierShift ) ) - { - UpdateCbaL(); - } - //If focus is on editer and its empty, and if user presses left arrow or right arrow keys. - //Move the focus to Message list to switch the tabs - if((res == EKeyWasNotConsumed)&& (iMsgEditor->TextLength() == 0) && (aType == EEventKeyDown) && - ((aKeyEvent.iScanCode == EStdKeyLeftArrow) || (aKeyEvent.iScanCode == EStdKeyRightArrow))) - { - StopScrollingL(); //Move the focus to Message list - } - iAppView.UpdateToolbarButtonsStateL(); - return res; - } - return EKeyWasNotConsumed; - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::Editor -// Handles operation completion -// -CIMCVAppMessageEditor& CIMCVAppViewContainer::Editor() const - { - return *iMsgEditor; - } -// --------------------------------------------------------- -// CIMCVAppViewContainer::RefreshEditorL -// Handles operation completion -// -void CIMCVAppViewContainer::RefreshEditorL() - { - //iMsgEditor->Editor().TextView()->HandleCharEditL(CTextLayout::EFCharacterInsert) ; - iMsgEditor->Editor().DrawDeferred(); - iAppView.UpdateToolbarButtonsStateL(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppSmileIconUtility::LoadBitmapL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CGulIcon* CIMCVAppViewContainer::LoadBitmapL(const TDesC8& /*aId*/,const TInt aBitmapId,const TInt aMaskId) - { - - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::LoadBitmapL() start") ); - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - CGulIcon* gulIcon; - - if(0) - { - /* PPARTH - TRAPD(err_bitmap, iBrandingAccess->GetBitmapL( aId, bitmap, mask )); - if(KErrNone != err_bitmap) - { - User::Leave( err_bitmap ); - } - gulIcon = CGulIcon::NewL(bitmap,mask); - */ - } - else - { - TRgb* aCustomColor = NULL; - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - TAknsItemID itemId( KAknsIIDNone ); - TInt colorGroupId( 0 ); - - MapFromBitmapIdToAknsItemId( aBitmapId, itemId, colorGroupId ); - - if( colorGroupId == 0 ) - { - - // Special case, these icons are using the same color - // and color group as text - if ( aCustomColor ) - { - // If user has set a special color for text - AknIconUtils::CreateIconLC( bitmap, mask, iAppUi->MbmFullPath() , - aBitmapId, aMaskId ); - AknIconUtils::SetIconColor( bitmap, *aCustomColor ); - } - else - { - AknsUtils::CreateColorIconLC( skin, - itemId, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6, - bitmap, mask, iAppUi->MbmFullPath() , - aBitmapId, - aMaskId, - KRgbBlack ); - } - - } - else - { - AknsUtils::CreateIconLC( skin, - itemId, - bitmap, mask, iAppUi->MbmFullPath(), - aBitmapId, - aMaskId ); - } - gulIcon = CGulIcon::NewL( bitmap, mask ); - CleanupStack::Pop( 2 ); // bitmap, mask - } - - IM_CV_LOGS(TXT("CIMCVAppSmileIconUtility::LoadBitmapL() End") ); - return gulIcon; - - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppViewContainer::MapFromBitmapIdToAknsItemId -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewContainer::MapFromBitmapIdToAknsItemId( TInt aBitmapId, - TAknsItemID& aItemId, TInt& aColorGroupId ) - { - for( TInt i( 0 ); KCABitmaps[i].iBitmapId != KErrNotFound; i++ ) - { - if( KCABitmaps[ i ].iBitmapId == aBitmapId ) - { - // found it - - aItemId = *(KCABitmaps[ i ].iItemId); - aColorGroupId = KCABitmaps[ i ].iColorGroupId; - return; - } - } - - // not found - - IM_CV_LOGS(TXT("!!!!!!!! every bitmap enumeration should be found from \ - CABitmapMapping.h !!!!!!!! ") ); - - } - - -// --------------------------------------------------------- -// CIMCVAppViewContainer::ResizeIcons -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::ResizeIcons( TRect aParentRect ) - { - TSize size( aParentRect.Height(), aParentRect.Height() ); - AknIconUtils::SetSize( iFromMe->Bitmap(), size ); - AknIconUtils::SetSize( iToMe->Bitmap(), size ); - - iMessageExtensionsHandler.SizeChanged( size, iActiveEngine->GetServiceId() ); - } - - -// --------------------------------------------------------- -// CIMCVAppViewContainer::TextRect -// --------------------------------------------------------- -// -const TRect CIMCVAppViewContainer::TextRect() const - - { - TAknLayoutRect rp; - rp.LayoutRect( Rect(), AknLayoutScalable_Apps::im_reading_pane( - TChatListBoxLayout::EWithEditor2Lines ) ); - TAknLayoutText text; - text.LayoutText( rp.Rect(), - AknLayoutScalable_Apps::im_reading_pane_t1( 1 ).LayoutLine() ); - - return text.TextRect(); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::HandleTapEventL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::HandleTapEventL( TTapEvent aEvent, - TUint aControlId ) - { - // Handle the tap events which occur in our child controls: - // Message list and Message editor. - switch( aControlId ) - { - case EMessageList: - { - // Focused message was double tapped - if( aEvent == MIMCVTapEventObserver::EDoubleTap ) - { - // To be implemented later - } - // Message or item was tapped - else if( aEvent == MIMCVTapEventObserver::ESingleTap - || aEvent == MIMCVTapEventObserver::EStartTap) - { - StopScrollingL(); - // Find objects activate with single tap - iRecipientObserver->ShowPopUpMenuL(); - } - break; - } - case EMessageEditor: - { - // Nothing to do here ATM. - // Focus transition is handled in HandleControlEventL - iMsgEditor->SetFocus(ETrue, EDrawNow); - iAppView.UpdateToolbarButtonsStateL(); - break; - } - default: - { - break; - } - } - } - -//added for multitab support - -// --------------------------------------------------------- -// CIMCVAppViewContainer::SwitchViewL -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::SwitchViewL( MIMCVEngineMessageReadInterface* aReadInterface, - MIMCVEngineMessageWriteInterface* aWriteInterface, - const TDesC& aRecipientId ) - { - if(iEditorMessage) - { - delete iEditorMessage; - iEditorMessage = NULL; - } - iEditorMessage = iMessageExtensionsHandler.ProcessMessageLC( iMsgEditor->Editor(),iActiveEngine->GetServiceId() ); - CleanupStack::Pop(); // iEditorMessage - iReadInterface->StoreEditerMessageL( *iEditorMessage ); - - //Clears any highlght from the chat before switching away from it - if( iChatView->Highlighted() ) - { - iChatView->DisableHighlightL(); - } - - delete iChatView; - //iChatView is assigned NULL as NewL may leave - iChatView = NULL; - - iReadInterface = aReadInterface; - iWriteInterface = aWriteInterface; - - delete iRecipientId; - iRecipientId = NULL; - iRecipientId = aRecipientId.AllocL(); - - iChatView = CIMCVAppViewControl::NewL( Rect(), - *this, - *iReadInterface, - iMessageExtensionsHandler, - iFromMe, - iToMe, - *iRTContainerCache, - *iActiveEngine ); - - iChatView->SetObserver( this ); - - // Fix of TSW Bug Id - EJWU-72CB2C - UpdateCbaL(); - - SizeChanged(); - - // Observe tap events - iChatView->SetTapObserver( this, EMessageList ); - - iAppUi->LayoutInfo()->SetLayoutID( TChatListBoxLayout::EWithEditor ); - iAppUi->LayoutInfo()->SetEditorVisibility( ETrue ); - - iActiveEngine->MessageHandler().StartNewConversationL( *iRecipientId ); - - const TDesC& message = iReadInterface->GetEditerMessage(); - - iMsgEditor->SetTextL( message); - - iAppView.UpdateToolbarButtonsStateL(); - } - -// --------------------------------------------------------- -// CIMCVAppViewContainer::FetchMessages -// --------------------------------------------------------- -// -void CIMCVAppViewContainer::FetchMessages( TBool aFetch ) - { - if(iActiveEngine->IsLoggedIn()) - { - iChatView->FetchMessages( aFetch ); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewContainer: StoreEditorMessage -// ----------------------------------------------------------------------------- -//TODO: move this function to cimcvappviewcontainer -void CIMCVAppViewContainer::StoreEditorMessageL() - { - // save message typed in the editor. -/* HBufC* EditorMessage = NULL; - CIMCVAppMessageEditor& MsgEditor = iContainer->Editor(); - EditorMessage = iExtensionHandler->ProcessMessageLC( MsgEditor.Editor(), iActiveEngine->GetServiceId() ); - - // Getting the readInterface - MIMCVEngineMessageReadInterface& readInterface = - iActiveChatInterface->MessageReadInterfaceL( iServiceId, *iRecipientUserId ); - readInterface.StoreEditerMessageL( *EditorMessage ); - - CleanupStack::PopAndDestroy();// EditorMessage*/ - - if(iEditorMessage) - { - delete iEditorMessage; - iEditorMessage = NULL; - } - iEditorMessage = iMessageExtensionsHandler.ProcessMessageLC( iMsgEditor->Editor(),iActiveEngine->GetServiceId() ); - CleanupStack::Pop(); // iEditorMessage - iReadInterface->StoreEditerMessageL( *iEditorMessage ); - } - - - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappviewcontrol.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappviewcontrol.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,358 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: text view control container -* -*/ - - -// INCLUDE FILES -#include "cimcvappviewcontrol.h" - -#include "cimcvapprichtextcontainer.h" -#include "cimcvappui.h" -#include "cimcvappmessageflowhandler.h" -#include -#include -#include -#include -#include -#include -#include "imcvlogger.h" -#include "mimcvtapeventobserver.h" -#include "mimcvenginemessagesreadinterface.h" -#include "mimcvenginemessagecontainerinfo.h" -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::CIMCVAppViewControl -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppViewControl::CIMCVAppViewControl() - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewControl::ConstructL( const TRect& aRect, - const CCoeControl& aParent, - MIMCVEngineMessageReadInterface& aReadInterface, - CIMCVAppMessageExtensionsHandler& aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - CIMCVAppRichTextContainerCache& aRTContainerCache, - CIMCVEngine& aActiveEngine, - TBool aScrollOver ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::ConstructL() start") ); - - CWindowGc& gc = SystemGc(); - CBitmapDevice* device = static_cast( gc.Device() ); - - TInt serviceId = aActiveEngine.GetServiceId(); - // text container - // Load the container from the cache - iTextContainer = aRTContainerCache.LoadContainer(serviceId, aReadInterface.TargetId().Target() ); - if(NULL == iTextContainer ) - { - //If container not found in cache, create a new and add it to cache - iTextContainer = CIMCVAppRichTextContainer::NewL(static_cast( iEikonEnv->AppUi() ), - this, - &aExtensionsHandler, - aFromMe, aToMe,device, - aReadInterface.TargetId().Target(), - serviceId, - aScrollOver - ); - - aRTContainerCache.StoreContainer(iTextContainer); - } - else - { - //If container is loaded from the cache, Then Provide it with the Parent's object address - iTextContainer->Initialize( static_cast( iEikonEnv->AppUi() ), - this, - &aExtensionsHandler, - aFromMe, aToMe,device, - aScrollOver ); - } - - - // construct base class - CIMCVAppTextViewControl::ConstructL( aRect, aParent, - iTextContainer->TextLayout() ); - - // create flow handler and fetch messages - // Use aScrollOver to determine is this recorded chat or not, - // it is EFalse only with recorded chats. - SetPenBehaviour( EPenProcessEvent ); - iFlowHandler = CIMCVAppMessageFlowHandler::NewL( *iTextContainer, - aReadInterface, - aActiveEngine, - !aScrollOver ); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::ConstructL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::SetTapObserver -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewControl::SetTapObserver( MIMCVTapEventObserver* aObserver, TUint aId ) - { - iTapObserver = aObserver; - iTapControlId = aId; - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppViewControl* CIMCVAppViewControl::NewL( const TRect& aRect, - const CCoeControl& aParent, - MIMCVEngineMessageReadInterface& aReadInterface, - CIMCVAppMessageExtensionsHandler& aExtensionsHandler, - CGulIcon* aFromMe, - CGulIcon* aToMe, - CIMCVAppRichTextContainerCache& aRTContainerCache, - CIMCVEngine& aActiveEngine, - TBool aScrollOver /*= ETrue*/ ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::NewL() start") ); - CIMCVAppViewControl* self = new( ELeave ) CIMCVAppViewControl; - CleanupStack::PushL( self ); - self->ConstructL( aRect, aParent, aReadInterface, - aExtensionsHandler,aFromMe, aToMe,aRTContainerCache, - aActiveEngine, - aScrollOver ); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::NewL() end") ); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::~CIMCVAppViewControl -// Destructor -// ----------------------------------------------------------------------------- - -CIMCVAppViewControl::~CIMCVAppViewControl() - { - delete iFlowHandler; - } - - - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::SelectedItem -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -HBufC* CIMCVAppViewControl::SelectedItemL() - { - return iTextContainer->SelectedItemL(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::SelectedItemType -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppViewControl::SelectedItemType() - { - return iTextContainer->SelectedItemType(); - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::DisableHighlightL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewControl::DisableHighlightL() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::DisableHighlightL() start") ); - iTextContainer->DisableHighlightL(); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::DisableHighlightL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::Highlighted -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVAppViewControl::Highlighted() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::Highlighted() start") ); - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::Highlighted() end") ); - return iTextContainer->Highlighted(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::SetHighlight -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewControl::SetHighlight( TBool aHighlight ) - { - iTextContainer->SetItemHighlight( aHighlight ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::OfferKeyEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TKeyResponse CIMCVAppViewControl::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::OfferKeyEventL() start") ); - if( aType != EEventKey ) - { - return EKeyWasNotConsumed; - } - - CIMCVAppRichTextContainer::THighlightMovement movement( - CIMCVAppRichTextContainer::ENext ); - - switch( aKeyEvent.iCode ) - { - case EKeyUpArrow: - { - movement = CIMCVAppRichTextContainer::EPrevious; - // flowthrough - } - case EKeyDownArrow: - { - return iTextContainer->MoveHighlightL( movement ) == KErrNone ? - EKeyWasConsumed : EKeyWasNotConsumed; - } - - default: - { - // No handling for other events - break; - } - } - IM_CV_LOGS(TXT("CIMCVAppViewContainer::OfferKeyEventL() end") ); - return EKeyWasNotConsumed; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::ProcessStylusEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewControl::ProcessStylusEventL( - const TPointerEvent& aPointerEvent ) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::ProcessStylusEventL() start") ); - // We end up here only if the pointer event started inside - // the text area. - if( aPointerEvent.iType == TPointerEvent::EButton1Down || - aPointerEvent.iType == TPointerEvent::EDrag ) - { - // Reset poiter flags - if( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - iWaitForDoubleTap = iWaitForSingleTap; - iWaitForSingleTap = ETrue; - } - - TInt pos = FindDocPos( aPointerEvent.iPosition ); - if( pos != KErrNotFound ) - { - TInt res = iTextContainer->HighlightItemAtPosL( pos ); - if( res == KErrNone ) - - { - // New item/message was highlighted - if( aPointerEvent.iType == TPointerEvent::EDrag ) - { - // Single tap is not possible if highlight was changed - // with draging - iWaitForSingleTap = EFalse; - } - // doubletap is not possible for now - iWaitForDoubleTap = EFalse; - } - } - } - - if( iTapObserver ) - { - if( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - // Start - iTapObserver->HandleTapEventL( - MIMCVTapEventObserver::EStartTap, iTapControlId ); - } - } - - IM_CV_LOGS(TXT("CIMCVAppViewContainer::ProcessStylusEventL() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::SizeChanged -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewControl::SizeChanged() - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SizeChanged() start") ); - SetHighlighted( Highlighted() ); - CIMCVAppTextViewControl::SizeChanged(); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SizeChanged() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::MoveHighlightL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewControl::MoveHighlightL( - CIMCVAppRichTextContainer::THighlightMovement aMovement) - { - IM_CV_LOGS(TXT("CIMCVAppViewContainer::MoveHighlightL() start") ); - iWaitForSingleTap = ETrue; - iTextContainer->MoveHighlightL( aMovement ); - IM_CV_LOGS(TXT("CIMCVAppViewContainer::MoveHighlightL() end") ); - } -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::GetMessageCount -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVAppViewControl::GetMessageCount() - { - return iTextContainer->GetMessageCount(); - } - -// ----------------------------------------------------------------------------- -// CIMCVAppViewControl::FetchMessages -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppViewControl::FetchMessages( TBool aFetch ) - { - iFlowHandler->FetchMessages( aFetch ); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvappwaitnote.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvappwaitnote.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* Copyright (c) 2008 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: Helper class for wait notes -* -*/ - - - -// INCLUDE FILES -#include "cimcvappwaitnote.h" - -#include - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVAppWaitNote::CIMCVAppWaitNote -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVAppWaitNote::CIMCVAppWaitNote() - { - } - -// ----------------------------------------------------------------------------- -// CIMCVAppWaitNote::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVAppWaitNote::ConstructL( const TDesC& aText, - TBool aShowImmediately, - TBool /*aCanBeCanceledByUser*/, - MIMCVWaitNoteObserver* aObserver ) - { - // don't give dialog pointer as a parameter because - // it gets invalid after deletion of this instance - iWaitDialog = new( ELeave )CAknWaitDialog( NULL, aShowImmediately ); - - iWaitDialog->PrepareLC( R_SERVTAB_WAIT_NOTE_TEMPLATE ); - - iWaitDialog->SetTone( CAknNoteDialog::ENoTone ); - iWaitDialog->SetTextL( aText ); - iWaitDialog->SetCallback( this ); - - SetObserver( aObserver ); - iWaitDialog->RunLD(); // CSI: 50 # iWaitDialog is not owned by us - } - -// ----------------------------------------------------------------------------- -// CIMCVAppWaitNote::ShowWaitNoteL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppWaitNote* CIMCVAppWaitNote::ShowWaitNoteL( const TDesC& aText, - TBool aShowImmediately /*= EFalse*/, - TBool aCanBeCanceledByUser /*= EFalse*/, - MIMCVWaitNoteObserver* aObserver /*= NULL*/ ) - { - CIMCVAppWaitNote* self = new( ELeave ) CIMCVAppWaitNote(); - CleanupStack::PushL( self ); - self->ConstructL( aText, aShowImmediately, aCanBeCanceledByUser, aObserver ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppWaitNote::ShowWaitNoteLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppWaitNote* CIMCVAppWaitNote::ShowWaitNoteLC( TInt aTextResource, - TBool aShowImmediately /*= EFalse*/, - TBool aCanBeCanceledByUser /*= EFalse*/, - MIMCVWaitNoteObserver* aObserver /*= NULL*/ ) - { - CIMCVAppWaitNote* self = new( ELeave ) CIMCVAppWaitNote(); - CleanupStack::PushL( self ); - - HBufC* text = CCoeEnv::Static()->AllocReadResourceLC( aTextResource ); - self->ConstructL( *text, aShowImmediately, aCanBeCanceledByUser, aObserver ); - CleanupStack::PopAndDestroy( text ); - - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVAppWaitNote::ShowWaitNoteL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVAppWaitNote* CIMCVAppWaitNote::ShowWaitNoteL( TInt aTextResource, - TBool aShowImmediately /*= EFalse*/, - TBool aCanBeCanceledByUser /*= EFalse*/, - MIMCVWaitNoteObserver* aObserver /*= NULL*/ ) - { - CIMCVAppWaitNote* self = ShowWaitNoteLC( aTextResource, - aShowImmediately, - aCanBeCanceledByUser, - aObserver ); - - CleanupStack::Pop( self ); - return self; - } - - - - -// Destructor -CIMCVAppWaitNote::~CIMCVAppWaitNote() - { - DismissDialog(); - } - - -// ----------------------------------------------------------------------------- -// CIMCVAppWaitNote::DialogDismissedL -// Called when dialog is dismissed -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppWaitNote::DialogDismissedL( TInt aButtonId ) - { - - iWaitDialog = NULL; - if( iObserver ) - { - iObserver->NoteCanceled( aButtonId ); - } - - } - -// ----------------------------------------------------------------------------- -// CIMCVAppWaitNote::DismissDialog -// Dismisses the dialog -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppWaitNote::DismissDialog() - { - - if( iWaitDialog ) - { - iWaitDialog->SetCallback( NULL ); - TRAPD( err, iWaitDialog->ProcessFinishedL() ); - - - if( err != KErrNone ) - { - // don't know for sure that ProcessFinishedL deletes the dialog - // in all cases, so let's delete it - delete iWaitDialog; - iWaitDialog = NULL; - CActiveScheduler::Current()->Error( err ); - } - - TRAP_IGNORE( DialogDismissedL( 0 ) ); - } - - } - -// ----------------------------------------------------------------------------- -// CIMCVAppWaitNote::SetObserver -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVAppWaitNote::SetObserver( MIMCVWaitNoteObserver* aObserver ) - { - iObserver = aObserver; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvcommandinfo.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvcommandinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: command info -* -*/ - -// INCLUDE FILES -#include -#include "cimcvcommandinfo.h" - - -// ==================== MEMBER FUNCTIONS ==================== -// ---------------------------------------------------------------------------- -// CIMCVCommandInfo::CIMCVCommandInfo -// ---------------------------------------------------------------------------- -// -CIMCVCommandInfo::CIMCVCommandInfo( TInt32 aPluginId ) : iPluginId( aPluginId ) - { - } -// ---------------------------------------------------------------------------- -// CIMCVCommandInfo::~CIMCVCommandInfo -// ---------------------------------------------------------------------------- -// -CIMCVCommandInfo::~CIMCVCommandInfo() - { - } -// ---------------------------------------------------------------------------- -// CIMCVCommandInfo::NewLC -// ---------------------------------------------------------------------------- -// -CIMCVCommandInfo* CIMCVCommandInfo::NewLC( TResourceReader& aReader, - TInt32 aPluginId, - TInt& aNewCommandIds ) - { - CIMCVCommandInfo* self = new (ELeave) CIMCVCommandInfo( aPluginId ); - CleanupStack::PushL(self); - self->ConstructL( aReader, aNewCommandIds ); - return self; - } -// ---------------------------------------------------------------------------- -// CIMCVCommandInfo::ConstructL -// ---------------------------------------------------------------------------- -// -void CIMCVCommandInfo::ConstructL( TResourceReader& aReader, - TInt& aNewCommandIds ) - { - iOldCommandId = aReader.ReadInt32(); - iNewCommandId = aNewCommandIds++; - } -// ---------------------------------------------------------------------------- -// CIMCVCommandInfo::PliginId -// ---------------------------------------------------------------------------- -// -TInt32 CIMCVCommandInfo::PluginId() const - { - return iPluginId; - } -// ---------------------------------------------------------------------------- -// CIMCVCommandInfo::NewCommandId -// ---------------------------------------------------------------------------- -// -TInt32 CIMCVCommandInfo::NewCommandId() const - { - return iNewCommandId; - } -// ---------------------------------------------------------------------------- -// CIMCVCommandInfo::OldCommandId -// ---------------------------------------------------------------------------- -// -TInt32 CIMCVCommandInfo::OldCommandId() const - { - return iOldCommandId; - } - - -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvmenuextensionmanager.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvmenuextensionmanager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,319 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Class that provides centralized access for UI classes -* to logic handling -* -*/ - -// INCLUDE FILES - -#include -#include -#include -#include -#include - - -#include "cimcvmenuextensionmanager.h" -#include "cimcvcommandinfo.h" - -#include "cvmenucommandinfo.hrh" -#include "vimpstcustomcleanupapi.h" - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::CIMCVMenuExtensionManager -// --------------------------------------------------------------------------- -// -CIMCVMenuExtensionManager::CIMCVMenuExtensionManager( ) -: iNewCommands( ECVMenuExtensionFirstFreeCommand ) - { - - } - -// --------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::ConstructL -// --------------------------------------------------------------------------- -// -void CIMCVMenuExtensionManager::ConstructL() - { - LoadPluginL( ); - } - -// --------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::NewL -// --------------------------------------------------------------------------- -// -CIMCVMenuExtensionManager* CIMCVMenuExtensionManager::NewL( ) - { - CIMCVMenuExtensionManager* self = NewLC( ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::NewLC -// --------------------------------------------------------------------------- -// -CIMCVMenuExtensionManager* CIMCVMenuExtensionManager::NewLC() - { - CIMCVMenuExtensionManager* self = - new (ELeave) CIMCVMenuExtensionManager( ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::~CIMCVMenuExtensionManager -// --------------------------------------------------------------------------- -// -CIMCVMenuExtensionManager::~CIMCVMenuExtensionManager() - { - iCommandIdMap.ResetAndDestroy(); - iCommandIdMap.Close(); - // Reset and destroy the contents of the owned arrays, - // this will delete the plugins. - iPlugins.ResetAndDestroy(); - iPlugins.Close(); - - // Close the ECOM interface - REComSession::FinalClose(); - } - -// ---------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::LoadPluginL -// Loads all plugins -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// -void CIMCVMenuExtensionManager::LoadPluginL( ) - { - // plugininfo array, Owned - RImplInfoPtrArray pluginInfo; - CustomCleanupResetAndDestroyPushL(pluginInfo); - iPlugins.ResetAndDestroy(); - REComSession::ListImplementationsL( KMenuCustomisationInterfaceUid,pluginInfo ); - TInt pluginCount = pluginInfo.Count(); - - for ( TInt pluginIndex(0); pluginIndex < pluginCount; ++pluginIndex ) - { - TUid pluginUid = pluginInfo[pluginIndex]->ImplementationUid(); - // Creates the plugin and transfers ownership of the services - // object to the plugin. - CIMCVMenuExtension* plugin = NULL; - TRAPD(error, plugin = CIMCVMenuExtension::CreateImplementationL( pluginUid )); - - if(KErrNone != error) - { - // handle the error here. - } - else - { - //if its here its sure that plugin is not null; - CleanupStack::PushL( plugin); - - //map the plugin commands to CV commands, - //assings the command maintained in the commandpool, - //for more details see - MapCommandL(*plugin,pluginUid.iUid); - - //add the plugin to the array - CPluginInfo* newPlugin = new ( ELeave ) CIMCVMenuExtensionManager::CPluginInfo( plugin, pluginUid); - CleanupStack::PushL( newPlugin ); - iPlugins.AppendL( newPlugin ); - CleanupStack::Pop( newPlugin ); - - CleanupStack::Pop( plugin ); - } - - } - - CleanupStack::PopAndDestroy(); - - } - - -// ---------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::OfferMenuPaneToPluginsL -// Generates the list of active plugins -// ---------------------------------------------------------------------------- -// -void CIMCVMenuExtensionManager::OfferMenuPaneToPlugins(TInt aPreviousId, CEikMenuPane& aMenuPane,TUint aServiceId) - { - // Get the number of plugins - const TInt count = iPlugins.Count(); - // Loop though all the command handlers, If DynInitMenuPaneL leaves for one plugin, a plugin - // error message will be displayed and the loop will continue with - // the next command handler. If none of the plugins leave, there will - // be only one TRAP used. - for ( TInt index = 0; index < count; ++index ) - { - //trap is required if one plugin leaves then it should continue with other plugins. - TRAPD(error,iPlugins[index]->Plugin().DynInitMenuPaneL( aPreviousId, - aMenuPane,aServiceId )); - if(KErrNone != error) - { - //display the appropriate error note for leaving; - } - - } - - } -// ---------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::OfferHandleCommandToPluginsL -// Generates the list of active plugins -// ---------------------------------------------------------------------------- -// -TBool CIMCVMenuExtensionManager::OfferHandleCommandToPlugins(TInt aCommandId) - { - //Get the number of plugins loaded - const TInt count = iPlugins.Count(); - - TBool retval = EFalse; - // Loop though all the command handlers, - // If HandleCommandL leaves for one plugin, a plugin - // error message will be displayed and the loop will continue with - // the next plugin. If none of the plugins leave, there will - // be only one TRAP used. - for ( TInt index = 0; index < count; ++index ) - { - TRAPD( error,retval = iPlugins[index]->Plugin().HandleCommandL( aCommandId )); - - if ( KErrNone != error ) - { - // Report a problem with plugin. - } - } - return retval; - } - -// ---------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::CPluginInfo::CPluginInfo( -// C++ constructor -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// -CIMCVMenuExtensionManager::CPluginInfo::CPluginInfo( - CIMCVMenuExtension* aPlugin, - TUid aPluginUid ) -: iPlugin( aPlugin ), -iPluginUid( aPluginUid ) - { - - } -// ---------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::CPluginInfo::~CPluginInfo( -// C++ destructor -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// - -CIMCVMenuExtensionManager::CPluginInfo::~CPluginInfo() - { - delete iPlugin; - } - -// ---------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::CPluginInfo::Plugin -// returns a reference to the plugin -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// -CIMCVMenuExtension& CIMCVMenuExtensionManager::CPluginInfo::Plugin() - { - return *iPlugin; - } - - -// ---------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::MapCommandL -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// -void CIMCVMenuExtensionManager::MapCommandL( CIMCVMenuExtension& aMenuExtension, TInt32 aPluginId ) - { - TInt res = aMenuExtension.CommandInfoResource(); - if( res != KErrNotFound ) - { - TResourceReader reader; - CCoeEnv::Static()->CreateResourceReaderLC( reader, res ); - TInt resCount = reader.ReadInt16(); - for( TInt j = 0; j < resCount; j++ ) - { - CIMCVCommandInfo* commandInfo = NULL; - commandInfo = CIMCVCommandInfo::NewLC( reader, - aPluginId, - iNewCommands ); - User::LeaveIfError( iCommandIdMap.Append( commandInfo ) ); - CleanupStack::Pop(); // commandInfo - } - CleanupStack::PopAndDestroy(); // reader - aMenuExtension.RegisterCommandMapper( *this ); - - } - } -// ---------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::GetNewCommand -// from MComandMapper -// ---------------------------------------------------------------------------- -// - -TInt CIMCVMenuExtensionManager::GetOldCommand( TInt32 aPluginId, TInt aNewCommand, - TInt& aOldCommand ) const - { - TInt mapCount = iCommandIdMap.Count(); - TInt err( KErrNotFound ); - for( TInt i = 0; i < mapCount && err; i++ ) - { - CIMCVCommandInfo* info = iCommandIdMap[i]; - if( info->PluginId() == aPluginId && info->NewCommandId() == aNewCommand ) - { - aOldCommand = info->OldCommandId(); - err = KErrNone; - break; - } - } - return err; - } -// ---------------------------------------------------------------------------- -// CIMCVMenuExtensionManager::GetNewCommand -// from MComandMapper -// ---------------------------------------------------------------------------- -// - -TInt CIMCVMenuExtensionManager::GetNewCommand( TInt32 aPluginId, TInt aOldCommand, - TInt& aNewCommand ) const - { - TInt mapCount = iCommandIdMap.Count(); - TInt err( KErrNotFound ); - - for( TInt i = 0; i < mapCount && err; i++ ) - { - CIMCVCommandInfo* info = iCommandIdMap[i]; - if( info->PluginId() == aPluginId && info->OldCommandId() == aOldCommand ) - { - aNewCommand = info->NewCommandId(); - err = KErrNone; - break; - } - } - - return err; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvnewmsgfadecontrol.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvnewmsgfadecontrol.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,465 +0,0 @@ -/* -* Copyright (c) 2008-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: Fader control in navi pane -* -*/ - - -// INCLUDE FILES -#include "cimcvnewmsgfadecontrol.h" -#include "mimcvnewmsgfadecontrolobserver.h" - -#include "cimcvappui.h" -#include "mimcvapplayoutinfo.h" - -#include -#include -#include -#include -#include -#include -#include -#include - - -//CONSTANTS -const TInt KLafCount( 10 ); //Count of LAF indexes -const TInt KDelayColorIndex( 5 ); //From LAF: Color 0 is in index 5 -const TTimeIntervalMicroSeconds32 KIndicationDelay( 4000000 ); //4 seconds waiting -const TUint16 KAIMMessageIcon( 0xF808 ); //PUA icon code for AIMMESSAGE - -// ========================= MEMBER FUNCTIONS ================================ - -// ----------------------------------------------------------------------------- -// CIMCVNewMsgFadeControl::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVNewMsgFadeControl* CIMCVNewMsgFadeControl::NewL( const TRect& aRect ) - { - CIMCVNewMsgFadeControl* self = CIMCVNewMsgFadeControl::NewLC( aRect ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVNewMsgFadeControl::NewLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVNewMsgFadeControl* CIMCVNewMsgFadeControl::NewLC( const TRect& aRect ) - { - CIMCVNewMsgFadeControl* self = new ( ELeave ) CIMCVNewMsgFadeControl(); - CleanupStack::PushL( self ); - self->ConstructL( aRect ); - return self; - } - -// --------------------------------------------------------------------------- -// CIMCVNewMsgFadeControl::ConstructL(const TRect& aRect) -// Symbian OS two phased constructor -// -// --------------------------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::ConstructL( const TRect& aRect ) - { - - iLayoutInfo = static_cast( iEikonEnv->AppUi() )-> - LayoutInfo(); - // Currently we have 2 observers, so granularity of 2 is logical choice. - iObserverArray = new ( ELeave ) CArrayPtrSeg(2); - iIMessage = HBufC::NewL( 512 + 1);//1 is indication character - iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - - iBgContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgNavipaneSolid, aRect, EFalse ); - iViewRect = TRect( aRect ); - CreateWindowL(); - MakeVisible( EFalse ); - } - -// Constructor -CIMCVNewMsgFadeControl::CIMCVNewMsgFadeControl() - :iTimerState( ETimerStopped ) - { - - } - -// Destructor -CIMCVNewMsgFadeControl::~CIMCVNewMsgFadeControl() - { - - if( iObserverArray ) - { - iObserverArray->Reset(); - delete iObserverArray; - } - delete iTimer; - delete iIMessage; - delete iClippedMessage; - delete iBgContext; - iTextLayouts.Close(); - } - -// --------------------------------------------------------------------------- -// CIMCVNewMsgFadeControl::SizeChanged() -// called by framework when the view size is changed -// -// --------------------------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::SizeChanged() - { - TRect myNavePaneRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::ENaviPane, - myNavePaneRect ); - - - myNavePaneRect.Move( -myNavePaneRect.iTl.iX, -myNavePaneRect.iTl.iY ); - - iTextLayouts.Reset(); - for ( TInt i( 0 ); i < KLafCount; i++ ) - { - TAknLayoutText text; - TAknTextLineLayout textLayout; - textLayout= iLayoutInfo->IM_navi_pane_texts_Line_1( i, 0 ); - - text.LayoutText( myNavePaneRect, textLayout ); - iTextLayouts.Append( text ); - - } - TAknWindowLineLayout navipaneLayout = - AknLayout::Status_pane_elements_Line_1(); - iNavipaneRect.LayoutRect( myNavePaneRect, navipaneLayout ); - - UpdateClippedMessage(); - } - -// --------------------------------------------------------------------------- -// CIMCVNewMsgFadeControl::CountComponentControls() const -// -// -// --------------------------------------------------------------------------- -// -TInt CIMCVNewMsgFadeControl::CountComponentControls() const - { - return 0; - } - -// --------------------------------------------------------------------------- -// CIMCVNewMsgFadeControl::ComponentControl(TInt aIndex) const -// -// -// --------------------------------------------------------------------------- -// -CCoeControl* CIMCVNewMsgFadeControl::ComponentControl(TInt /*aIndex*/) const - { - return NULL; - } - -// --------------------------------------------------------------------------- -// CIMCVNewMsgFadeControl::Draw(const TRect& aRect) const -// -// -// --------------------------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::Draw( const TRect& /*aRect*/ ) const - { - CWindowGc& gc = SystemGc(); - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = iBgContext; - if ( !AknsDrawUtils::Background( skin, cc, gc, iViewRect ) ) - { - gc.Clear( iViewRect ); - } - iTextLayouts[iColorIndex].DrawText( gc, *iClippedMessage ); - - } - -// --------------------------------------------------------------------------- -// CIMCVNewMsgFadeControl::HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType) -// -// -// --------------------------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::HandleControlEventL(CCoeControl* /*aControl*/, - TCoeEvent /*aEventType*/) - { - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::FadeText() -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CIMCVNewMsgFadeControl::FadeText( TAny* aAnyPtr ) - { - if ( !aAnyPtr ) - { - return EFalse; - } - - CIMCVNewMsgFadeControl* view = reinterpret_cast< CIMCVNewMsgFadeControl* >( aAnyPtr ); - - if( view->iColorIndex < KLafCount - 1 ) - { - view->iColorIndex++; - view->ReportChange(); - if ( view->iColorIndex == KDelayColorIndex ) - { - //Delayed color is displayed 4 seconds - view->StartTicker( KIndicationDelay ); - } - return ETrue; - } - - view->iColorIndex = 0; - view->Stop(); - TInt count( view->iObserverArray->Count() ); - for( TInt i(0); i < count; ++i ) - { - MIMCVNewMsgFadeControlObserver* obs = view->iObserverArray->At( i ); - if( obs ) - { - obs->NotifyWhenCompleted(); - } - } - return EFalse; - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::Start() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::Start() - { - TRect myNavePaneRect; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::ENaviPane, - myNavePaneRect ); - myNavePaneRect.Move( -myNavePaneRect.iTl.iX, -myNavePaneRect.iTl.iY ); - - TAknWindowLineLayout navipanelayout = AknLayout::navi_pane( 0 ); - AknLayoutUtils::LayoutControl( this, myNavePaneRect, navipanelayout ); - - iTimerTick = 10000; //KTimerInterval; - - TInt count( iObserverArray->Count() ); - for( TInt i(0); i < count; ++i ) - { - MIMCVNewMsgFadeControlObserver* obs = iObserverArray->At( i ); - if( obs ) - { - obs->NotifyWhenStarted(); - } - } - - if ( !IsActivated() ) - { - TRAPD( err, ActivateL() ); - if( err != KErrNone ) - { - CActiveScheduler::Current()->Error( err ); - } - } - - if ( !IsVisible() ) - { - MakeVisible( ETrue ); - } - - StartTicker( 0 ); - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::StartTicker() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::StartTicker( - const TTimeIntervalMicroSeconds32 aDelayInternal ) - { - if ( iTimerState == ETimerActivated ) - { - iTimer->Cancel(); - iTimerState = ETimerStopped; - } - TCallBack cb( FadeText, this ); - iTimer->Start( aDelayInternal, iTimerTick, cb ); - iTimerState = ETimerActivated; - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::Stop() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::Stop() - { - if ( IsVisible() ) - { - MakeVisible( EFalse ); - } - StopTicker(); - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::AddObserver() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::AddObserver( MIMCVNewMsgFadeControlObserver* aObserver ) - { - TRAPD( err, iObserverArray->AppendL( aObserver ) ); - HandleError( err ); - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::SetMessage() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::SetMessage( TDesC& aMsg ) - { - HBufC* temp = NULL; - TRAPD( err, temp = HBufC::NewL( aMsg.Length() + 1 ) ); - HandleError( err ); - if( temp ) - { - delete iIMessage; - iIMessage = temp; - TPtr imMsgPtr( iIMessage->Des() ); - imMsgPtr.Append( TChar( KAIMMessageIcon ) ); - imMsgPtr.Append( aMsg ); - - UpdateClippedMessage(); - } - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::Message() -// (other items were commented in a header). -// --------------------------------------------------------- -// -TPtrC CIMCVNewMsgFadeControl::Message() const - { - return *iIMessage; - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::IsActive() -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CIMCVNewMsgFadeControl::IsActive() - { - if ( iTimer ) - { - return iTimer->IsActive(); - } - return EFalse; - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::Reset() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::Reset() - { - if ( iIMessage ) - { - TPtr mesgPtr( iIMessage->Des() ); - mesgPtr.Zero(); - } - - if( iClippedMessage ) - { - TPtr clipPtr( iClippedMessage->Des() ); - clipPtr.Zero(); - DrawNow(); - } - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::StopTicker() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::StopTicker() - { - if ( iTimerState == ETimerActivated ) - { - iTimer->Cancel(); - iTimerState = ETimerStopped; - } - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::ReportChange() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::ReportChange() - { - TRAPD( err, ReportEventL( MCoeControlObserver::EEventStateChanged ) ); - HandleError( err ); - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::HandleError -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::HandleError( TInt aError ) - { - - if( (aError < KErrNone) ) - { - // propagate system errors to current active scheduler, - // it should show a note - CActiveScheduler::Current()->Error( aError ); - } - - // imps errors are ignored at the moment as we don't have any - // notes specified for them - } - -// --------------------------------------------------------- -// CIMCVNewMsgFadeControl::UpdateClippedMessage -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVNewMsgFadeControl::UpdateClippedMessage() - { - HBufC* temp = NULL; - TRAPD( err, temp = iIMessage->AllocL() ); - if ( err ) - { - delete temp; - HandleError( err ); - } - - if ( temp ) - { - delete iClippedMessage; - iClippedMessage = temp; - TPtr clipPtr( iClippedMessage->Des() ); - - const CFont* font = iTextLayouts[iColorIndex].Font(); - AknTextUtils::ClipToFit( clipPtr, *font, Rect().Width() ); - } - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvnewmsgfadecontrol.h --- a/imstutils/imconversationview/imcvuiapp/src/cimcvnewmsgfadecontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +0,0 @@ -/* -* Copyright (c) 2008-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: This class encapsulates logic that is needed for text fading -* -*/ - - - -#ifndef CIMCVNewMsgFadeControl_H -#define CIMCVNewMsgFadeControl_H - - -// INCLUDES -#include -#include - -// CONSTANTS - -// MACROS - -// DATA TYPES - -// FUNCTION PROTOTYPES - -// FORWARD DECLARATIONS -class MAknsControlContext; -class MIMCVAppLayoutInfo; -class MIMCVNewMsgFadeControlObserver; - -// CLASS DECLARATION - -/** -* This class declares text fader component -* -* @lib imcvuiapp.exe -* @since 5.0 -*/ -class CIMCVNewMsgFadeControl : public CCoeControl, - public MCoeControlObserver - { - public: - - /* - * Used to control fading timer - */ - enum TTimerStates - { - ETimerStopped = 0, - ETimerActivated - }; - - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aRect TRect - * @return instance of class - */ - static CIMCVNewMsgFadeControl* NewL( const TRect& aRect ); - - /** - * Two-phased costructor. Leaves object into stack - * @param aRect TRect - * @return instance of class - */ - static CIMCVNewMsgFadeControl* NewLC( const TRect& aRect ); - - - /** - * Destructor. - */ - ~CIMCVNewMsgFadeControl(); - - public: //New Functions - - /** - * Starts fading text - * @since 5.0 - */ - void Start(); - - /** - * Stops fading - * @since 5.0 - */ - void Stop(); - - /** - * Registers observer - * @since 5.0 - * @param aObserver Observer instance - */ - void AddObserver( MIMCVNewMsgFadeControlObserver* aObserver ); - - /** - * Sets the fade message - * @since 5.0 - * @param aMsg Descriptor containing message - */ - void SetMessage( TDesC& aMsg ); - - /** - * Returns message - * @since 5.0 - * @return descriptor that contains message - */ - TPtrC Message() const; - - /** - * Tells if fading is active - * @since 5.0 - * @return ETrue if active else EFalse - */ - TBool IsActive(); - - /** - * Resets the faded string - * @since 5.0 - */ - void Reset(); - - /** - * Does the actual changing of text color - * @since 5.0 - * @param aAnyPtr pointer of this object - * @return ETrue if this should be called again - */ - static TInt FadeText( TAny* aAnyPtr ); - - /** - * Starts the timer - * @param aDelayInternal delay - * @since 5.0 - */ - void StartTicker( const TTimeIntervalMicroSeconds32 aDelayInternal ); - - /** - * Stops the timer - * @since 5.0 - */ - void StopTicker(); - - /** - * Reports that this CoeControl has changed - * @since 5.0 - */ - void ReportChange(); - - private: // Functions from base classes - - /** - * From CCoeControl - * @see CCoeControl - */ - void SizeChanged(); - - /** - * From CCoeControl - * @see CCoeControl - */ - TInt CountComponentControls() const; - - /** - * From CCoeControl - * @see CCoeControl - */ - CCoeControl* ComponentControl(TInt aIndex) const; - - /** - * From CCoeControl - * @see CCoeControl - */ - void Draw(const TRect& aRect) const; - - /** - * From CCoeControl - * @see CCoeControl - */ - void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); - - - private: - - /** - * C++ default constructor. - */ - CIMCVNewMsgFadeControl(); - - /** - * By default Symbian 2nd phase constructor is private. - * @param aRect the rect of this component - */ - void ConstructL( const TRect& aRect ); - - /* - * Error handling method - * @param aError Error id - */ - void HandleError( TInt aError ); - - /** - * Updates clipped text so that it fits to the current - * the navi pane - * @return None - */ - void UpdateClippedMessage(); - - - private: //data - - /* - * Periodic timer is used to drive fade control. Owns - */ - CPeriodic* iTimer; - - /* - * Index to color array. - */ - TInt iColorIndex; - - /* - * Timer interval. - */ - TInt iTimerTick; - - /* - * Font that is used - */ - const CFont* iFadeFont; - //View rectangle - TRect iViewRect; - - //Observer array - CArrayPtrSeg* iObserverArray; - //Layouts for texts - RArray iTextLayouts; - - TAknLayoutRect iNavipaneRect; - - MAknsControlContext* iBgContext; - - /* - * Message to fade - */ - HBufC* iIMessage; - - /* - * Owned. Message which will fit the screen. - */ - HBufC* iClippedMessage; - - /* - * State of timer - */ - TTimerStates iTimerState; - - //does not own - MIMCVAppLayoutInfo* iLayoutInfo; - }; - -#endif // CIMCVNewMsgFadeControl_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvuiappiconfileprovider.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvuiappiconfileprovider.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2008 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: Icon file provider. - * -*/ - - -// INCLUDE FILES -#include "cimcvuiappiconfileprovider.h" -#include -#include - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVUiAppIconFileProvider::CIMCVUiAppIconFileProvider -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVUiAppIconFileProvider::CIMCVUiAppIconFileProvider() - { - } -// ----------------------------------------------------------------------------- -// CIMCVUiAppIconFileProvider::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVUiAppIconFileProvider::ConstructL(RFile& aFile) - { - User::LeaveIfError( iFile.Duplicate( aFile ) ); - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppIconFileProvider::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVUiAppIconFileProvider* CIMCVUiAppIconFileProvider::NewL( - RFile& aFile ) - { - CIMCVUiAppIconFileProvider* self = new( ELeave ) CIMCVUiAppIconFileProvider(); - - CleanupStack::PushL( self ); - self->ConstructL(aFile); - CleanupStack::Pop( self ); - return self; - } - - -// Destructor -CIMCVUiAppIconFileProvider::~CIMCVUiAppIconFileProvider() - { - iFile.Close(); - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppIconFileProvider::RetrieveIconFileHandleL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVUiAppIconFileProvider::RetrieveIconFileHandleL( - RFile& aFile, const TIconFileType /*aType*/ ) - { - aFile.Duplicate( iFile ); - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppIconFileProvider::Finished -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVUiAppIconFileProvider::Finished() - { - // commit suicide because Avkon Icon Server said so - delete this; - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/cimcvuiappskinvariant.cpp --- a/imstutils/imconversationview/imcvuiapp/src/cimcvuiappskinvariant.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,231 +0,0 @@ -/* -* Copyright (c) 2008 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: skin variation class implementation -* -*/ - - -// INCLUDE FILES -#include "cimcvuiappskinvariant.h" - -#include "cimcvappbitmapmapping.h" -#include -#include // skins -#include -#include -#include -#include -#include -// logs -#include "imcvlogger.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::CIMCVUiAppSkinVariant -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMCVUiAppSkinVariant::CIMCVUiAppSkinVariant() - { - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVUiAppSkinVariant::ConstructL( ) - { - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::ConstructL() start") ) ; - TRect mainPane( 0,0,0,0 ); - - // Return value can be safely ignored. - // from AknLayoutUtils::LayoutMetricsRect documentation: - // - // Returns EFalse for status pane descendants if requested - // layout component is not available in current layout. For - // other components returns always ETrue (returned rectangle is - // from layout definition). - // - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, mainPane ); - - iBgContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMain, mainPane, EFalse ); - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::ConstructL() start") ) ; - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMCVUiAppSkinVariant* CIMCVUiAppSkinVariant::NewL() - { - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::NewL() start") ); - CIMCVUiAppSkinVariant* self = new( ELeave ) CIMCVUiAppSkinVariant(); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::NewL() end") ); - return self; - } -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::~CIMCVUiAppSkinVariant() -// Destructor -// ----------------------------------------------------------------------------- -// -CIMCVUiAppSkinVariant::~CIMCVUiAppSkinVariant() - { - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::~CIMCVUiAppSkinVariant() start") ); - delete iBgContext; - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::~CIMCVUiAppSkinVariant() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::ClearChatListBoxBackGround -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVUiAppSkinVariant::ClearChatListBoxBackGround( CWindowGc& aGc, - const TRect& aUsedPortionOfViewRect, - MAknsControlContext* aContext ) - { - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::ClearChatListBoxBackGround() start") ); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - AknsDrawUtils::Background( skin, aContext, NULL, aGc, - aUsedPortionOfViewRect ); - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::ClearChatListBoxBackGround() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::MainPaneBackgroundContext -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -MAknsControlContext* CIMCVUiAppSkinVariant::MainPaneBackgroundContext() const - { - return iBgContext; - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::UpdateLayout -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVUiAppSkinVariant::UpdateLayout() - { - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::UpdateLayout() start") ); - TRect screen( 0, 0, 0, 0 ); - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screen ); - iBgContext->SetRect( screen ); - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::UpdateLayout() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::DrawSkinnedEditor -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CIMCVUiAppSkinVariant::DrawSkinnedEditor( const CCoeControl* aControl, - CWindowGc& aGc, - TRect& /*aParentRect*/, - TRect& aEditorRect, - TRect& aOutlineRect ) - { - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::DrawSkinnedEditor() start") ); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - // draw editor surroundings - AknsDrawUtils::BackgroundBetweenRects( skin, MainPaneBackgroundContext(), - aControl, aGc, aOutlineRect, - aEditorRect ); - - TRect innerRect( aOutlineRect ); - //why 6 ? don't ask me. It was 3x3 for 176x208. - innerRect.Shrink( TSize( 6, 6 ) ); - // draw editor frames - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::DrawSkinnedEditor() end") ); - return AknsDrawUtils::DrawFrame( skin, aGc, aOutlineRect, innerRect, - KAknsIIDQsnFrInput, KAknsIIDQsnFrInputCenter ); - - } - - -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::LoadBitmapL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CGulIcon* CIMCVUiAppSkinVariant::LoadBitmapL( TInt aBitmapId, TInt aMaskId, - const TDesC& aFullPath, TBool /*aOverrideBrand*/, - TRgb* /*aCustomColor*/ ) -{ - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::LoadBitmapL() start") ); - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - TAknsItemID itemId( KAknsIIDNone ); - TInt colorGroupId( 0 ); - - MapFromBitmapIdToAknsItemId( aBitmapId, itemId, colorGroupId ); - - if( colorGroupId != 0 ) - { - - AknsUtils::CreateColorIconLC( skin, - itemId, KAknsIIDQsnIconColors, colorGroupId, - bitmap, mask, aFullPath, aBitmapId, aMaskId, KRgbBlack ); - } - else - { - AknsUtils::CreateIconLC( skin, - itemId, - bitmap, mask, aFullPath, aBitmapId, aMaskId ); - } - - CGulIcon* gulIcon = CGulIcon::NewL( bitmap, mask ); - CleanupStack::Pop( 2 ); // bitmap, mask - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::LoadBitmapL() end") ); - return gulIcon; - } - -// ----------------------------------------------------------------------------- -// CIMCVUiAppSkinVariant::MapFromBitmapIdToAknsItemId -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVUiAppSkinVariant::MapFromBitmapIdToAknsItemId( TInt aBitmapId, - TAknsItemID& aItemId, TInt& aColorGroupId ) - { - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::MapFromBitmapIdToAknsItemId() start") ); - for( TInt i( 0 ); KCABitmaps[i].iBitmapId != KErrNotFound; i++ ) - { - if( KCABitmaps[ i ].iBitmapId == aBitmapId ) - { - // found it - aItemId = *(KCABitmaps[ i ].iItemId); - aColorGroupId = KCABitmaps[ i ].iColorGroupId; - return; - } - } - - IM_CV_LOGS(TXT("CIMCVUiAppSkinVariant::MapFromBitmapIdToAknsItemId() start") ); - //__ASSERT_DEBUG( EFalse ); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/imcvuiappnotemapper.cpp --- a/imstutils/imconversationview/imcvuiapp/src/imcvuiappnotemapper.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* Copyright (c) 2008 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: note mapper class implementation -* -*/ - - -// INCLUDE FILES -#include "imcvuiappnotemapper.h" - -#include -#include -#include -#include -#include -// global errors -#include -#include "imcvlogger.h" -// --------------------------------------------------------- -// IMCVUiAppNoteMapper::ShowNoteL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void IMCVUiAppNoteMapper::ShowNoteL( const TInt aErrorCode , const TDesC& aAdditionalData ) - { - IM_CV_LOGS(TXT("IMCVUiAppNoteMapper::ShowNoteL start") ); - TInt resourceId( 0 ); - TBool aditionalInfo = EFalse; - - switch( aErrorCode ) - { - case KErrNoMemory: - { - resourceId = R_CHAT_CEDITOR_MEMLO; - break; - } - case KErrDiskFull: - { - resourceId = R_CHAT_CEDITOR_MEMFULL; - break; - } - // flowthrough - case KImApiErrSenderBlocked : - case KImErrServiceRequestTypeNotSupported: // Service not supported - { - resourceId = R_CHAT_ERROR_SERVICE_ERR; - break; - } - // flowthrough - case KImApiErrRecipientNotLogged: // Message recipient not logged in - { - aditionalInfo = ETrue; - resourceId = R_CHAT_ERROR_NOT_REACH; - break; - } - // flowthrough - case KImErrServiceForceClosedSession: // force logged out - { - resourceId = R_CHAT_ERROR_DISCONNECT_ERROR; - break; - } - - case KErrNone: - { - resourceId = 0; - break; - } - case KImErrServiceGeneralError: // flowthrough - default: // Unknown error -> show general note - { - resourceId = R_CHAT_ERROR_GEN_ERROR; - break; - } - } - - if( resourceId != 0 ) - { - HBufC* prompt = NULL; - - if( aditionalInfo && aAdditionalData != KNullDesC ) - { - prompt = StringLoader::LoadLC( resourceId, aAdditionalData ); - } - else - { - prompt = StringLoader::LoadLC( resourceId ); - } - - CAknErrorNote* errorNote = new (ELeave) CAknErrorNote; - errorNote->ExecuteLD(*prompt); - - CleanupStack::PopAndDestroy( prompt ); - - } - IM_CV_LOGS(TXT("IMCVUiAppNoteMapper::ShowNoteL End") ); - } - -// --------------------------------------------------------- -// IMCVUiAppNoteMapper::DisplayQueryDialogL -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt IMCVUiAppNoteMapper::DisplayQueryDialogL( TInt aDialogResourceId, - const TDesC& aPrompt ) - { - CAknQueryDialog* dlg = new (ELeave) CAknQueryDialog( - CAknQueryDialog::ENoTone ); - if( aPrompt != KNullDesC ) - { - CleanupStack::PushL( dlg ); - dlg->SetPromptL( aPrompt ); - CleanupStack::Pop( dlg ); - } - - return dlg->ExecuteLD( aDialogResourceId ); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiapp/src/imcvuiapputils.cpp --- a/imstutils/imconversationview/imcvuiapp/src/imcvuiapputils.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2008 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: utils helper class -* -*/ - - -#include "imcvuiapputils.h" -#include -#include - - -// --------------------------------------------------------- -// IMCVUiAppUtils::GetCRKeyL -// (other items were commented in a header). -// --------------------------------------------------------- -// -TUint32 IMCVUiAppUtils::CRKeyL( TUid aUid, TUint32 aKey ) - { - TInt val( 0 ); - - TRAPD( err, - CRepository* rep = CRepository::NewL( aUid ); - rep->Get( aKey, val ); - delete rep; - ); - - if( err != KErrNotFound && err != KErrPathNotFound ) - { - // "Not found" errors are ignored, because it's ok to - // return zero if key is not found - User::LeaveIfError( err ); - } - - return val; - } - - -// --------------------------------------------------------------------------- -// IMCVUiAppUtils::PenEnabled -// --------------------------------------------------------------------------- -// -TBool IMCVUiAppUtils::PenEnabled() - { -#ifndef RD_30_DISABLE_TOUCH - return AknLayoutUtils::PenEnabled(); - -#else - // In 3.0 mode we don't have pen support - return EFalse; - -#endif //RD_30_DISABLE_TOUCH - } - -// End of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/bwins/imcvengineu.def --- a/imstutils/imconversationview/imcvuiengine/bwins/imcvengineu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -EXPORTS - ?ReadyForShutdown@CIMCVEngine@@QAEHXZ @ 1 NONAME ; int CIMCVEngine::ReadyForShutdown(void) - ?LoginL@CIMCVEngine@@QAEHXZ @ 2 NONAME ; int CIMCVEngine::LoginL(void) - ?GetSmileStringArray@CIMCVEngine@@QAE?AV?$RPointerArray@VHBufC16@@@@XZ @ 3 NONAME ; class RPointerArray CIMCVEngine::GetSmileStringArray(void) - ?OpenChats@CIMCVEngine@@QAEAAVMIMCVEngineOpenChats@@XZ @ 4 NONAME ; class MIMCVEngineOpenChats & CIMCVEngine::OpenChats(void) - ?MessageHandler@CIMCVEngine@@QBEAAVMIMCVEngineMessageHandler@@XZ @ 5 NONAME ; class MIMCVEngineMessageHandler & CIMCVEngine::MessageHandler(void) const - ?GetLanguageId@CIMCVEngine@@QAEHXZ @ 6 NONAME ; int CIMCVEngine::GetLanguageId(void) - ?ServiceName@CIMCVEngine@@QAEABVTDesC16@@XZ @ 7 NONAME ; class TDesC16 const & CIMCVEngine::ServiceName(void) - ?GetPresenceIconL@CIMCVEngine@@QAEPAVCGulIcon@@ABVTDesC8@@@Z @ 8 NONAME ; class CGulIcon * CIMCVEngine::GetPresenceIconL(class TDesC8 const &) - ?ResolveServiceStateL@CIMCVEngine@@QAEXXZ @ 9 NONAME ; void CIMCVEngine::ResolveServiceStateL(void) - ?CCHHandler@CIMCVEngine@@QAEAAVMIMCVEngineCchHandler@@XZ @ 10 NONAME ; class MIMCVEngineCchHandler & CIMCVEngine::CCHHandler(void) - ?GetSmileyIconArray@CIMCVEngine@@QAE?AV?$RPointerArray@VCGulIcon@@@@XZ @ 11 NONAME ; class RPointerArray CIMCVEngine::GetSmileyIconArray(void) - ?ChatInterface@CIMCVEngine@@QBEAAVMIMCVEngineChatInterface@@XZ @ 12 NONAME ; class MIMCVEngineChatInterface & CIMCVEngine::ChatInterface(void) const - ?InstanceL@CIMCVEngineFactory@@SAPAVMIMCVEngineFactory@@XZ @ 13 NONAME ; class MIMCVEngineFactory * CIMCVEngineFactory::InstanceL(void) - ?GetLoggedInUserId@CIMCVEngine@@QAEABVTDesC16@@XZ @ 14 NONAME ; class TDesC16 const & CIMCVEngine::GetLoggedInUserId(void) - ?GetServiceId@CIMCVEngine@@QAEHXZ @ 15 NONAME ; int CIMCVEngine::GetServiceId(void) - ?Release@CIMCVEngineFactory@@SAXXZ @ 16 NONAME ; void CIMCVEngineFactory::Release(void) - ?IsLoggedIn@CIMCVEngine@@QBEHXZ @ 17 NONAME ; int CIMCVEngine::IsLoggedIn(void) const - ?ReleaseConnectionL@CIMCVEngine@@QAEXXZ @ 18 NONAME ; void CIMCVEngine::ReleaseConnectionL(void) - ?GetBrandId@CIMCVEngine@@QAEABVTDesC8@@XZ @ 19 NONAME ; class TDesC8 const & CIMCVEngine::GetBrandId(void) - ?IsVoipServiceL@CIMCVEngine@@QAEHXZ @ 20 NONAME ; int CIMCVEngine::IsVoipServiceL(void) - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/eabi/imcvengineu.def --- a/imstutils/imconversationview/imcvuiengine/eabi/imcvengineu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -EXPORTS - _ZN11CIMCVEngine10CCHHandlerEv @ 1 NONAME - _ZN11CIMCVEngine10GetBrandIdEv @ 2 NONAME - _ZN11CIMCVEngine11ServiceNameEv @ 3 NONAME - _ZN11CIMCVEngine12GetServiceIdEv @ 4 NONAME - _ZN11CIMCVEngine13GetLanguageIdEv @ 5 NONAME - _ZN11CIMCVEngine16GetPresenceIconLERK6TDesC8 @ 6 NONAME - _ZN11CIMCVEngine16ReadyForShutdownEv @ 7 NONAME - _ZN11CIMCVEngine17GetLoggedInUserIdEv @ 8 NONAME - _ZN11CIMCVEngine18GetSmileyIconArrayEv @ 9 NONAME - _ZN11CIMCVEngine18ReleaseConnectionLEv @ 10 NONAME - _ZN11CIMCVEngine19GetSmileStringArrayEv @ 11 NONAME - _ZN11CIMCVEngine20ResolveServiceStateLEv @ 12 NONAME - _ZN11CIMCVEngine6LoginLEv @ 13 NONAME - _ZN11CIMCVEngine9OpenChatsEv @ 14 NONAME - _ZN18CIMCVEngineFactory7ReleaseEv @ 15 NONAME - _ZN18CIMCVEngineFactory9InstanceLEv @ 16 NONAME - _ZNK11CIMCVEngine10IsLoggedInEv @ 17 NONAME - _ZNK11CIMCVEngine13ChatInterfaceEv @ 18 NONAME - _ZNK11CIMCVEngine14MessageHandlerEv @ 19 NONAME - _ZTI11CIMCVEngine @ 20 NONAME - _ZTI18CIMCVEngineFactory @ 21 NONAME - _ZTI20CIMCVEngineOpenChats @ 22 NONAME - _ZTI22CIMCVEngineMessageBase @ 23 NONAME - _ZTI22CIMCVEngineTextMessage @ 24 NONAME - _ZTI24CIMCVEngineChatContainer @ 25 NONAME - _ZTI25CIMCVEngineMessageCreator @ 26 NONAME - _ZTI25CIMCVEngineMessageHandler @ 27 NONAME - _ZTI26CIMCVEngineContextObserver @ 28 NONAME - _ZTI26CIMCVEngineStorageListener @ 29 NONAME - _ZTI27CIMCVEngineMessageContainer @ 30 NONAME - _ZTV11CIMCVEngine @ 31 NONAME - _ZTV18CIMCVEngineFactory @ 32 NONAME - _ZTV20CIMCVEngineOpenChats @ 33 NONAME - _ZTV22CIMCVEngineMessageBase @ 34 NONAME - _ZTV22CIMCVEngineTextMessage @ 35 NONAME - _ZTV24CIMCVEngineChatContainer @ 36 NONAME - _ZTV25CIMCVEngineMessageCreator @ 37 NONAME - _ZTV25CIMCVEngineMessageHandler @ 38 NONAME - _ZTV26CIMCVEngineContextObserver @ 39 NONAME - _ZTV26CIMCVEngineStorageListener @ 40 NONAME - _ZTV27CIMCVEngineMessageContainer @ 41 NONAME - _ZN11CIMCVEngine14IsVoipServiceLEv @ 42 NONAME - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/group/bld.inf --- a/imstutils/imconversationview/imcvuiengine/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: build information file -* -*/ - - -PRJ_MMPFILES - -imcvuiengine.mmp - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/group/imcvuiengine.mmp --- a/imstutils/imconversationview/imcvuiengine/group/imcvuiengine.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,100 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: mmp file -* -*/ - - -#include -#include -#include "../../inc/imcvuicommonuids.h" - -CAPABILITY CAP_GENERAL_DLL - -TARGET imcvengine.dll -TARGETTYPE dll -UID KIMCVUIENGINEDLLUID2 KIMCVUIENGINEDLLUID3 - -VENDORID VID_DEFAULT - -VERSION 10.0 - -SOURCEPATH ../src - -SOURCE cimcvenginefactory.cpp -SOURCE cimcvengine.cpp -SOURCE cimcvengineopenchats.cpp -SOURCE cimcvenginechatcontainer.cpp -SOURCE cimcvenginecontextobserver.cpp -SOURCE cimcvenginemessagebase.cpp -SOURCE cimcvenginemessagecontainer.cpp -SOURCE cimcvenginemessagecreator.cpp -SOURCE cimcvenginemessagehandler.cpp -SOURCE cimcvenginetextmessage.cpp -SOURCE imcvenginemessageutils.cpp -SOURCE cimcvenginecchhandler.cpp -SOURCE cimcvenginestoragelistener.cpp - - -SOURCEPATH ../group - -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../../../group - -APP_LAYER_SYSTEMINCLUDE - -LANG SC - -// common libraries -LIBRARY commonengine.lib // StringLoader -LIBRARY bafl.lib // Desc arrays -LIBRARY cone.lib // Coe env -LIBRARY euser.lib // Common usage. -LIBRARY estor.lib // For stream usage -LIBRARY charconv.lib // unicode -> utf8 -LIBRARY imageconversion.lib // Image decoding and encoding -LIBRARY fbscli.lib // CFBsBitmap -LIBRARY efsrv.lib // fileserver -LIBRARY bitmaptransforms.lib// Image scaling. -LIBRARY inetprotutil.lib // for escapeutils used in CAUtils.cpp -LIBRARY hal.lib // HAL -LIBRARY ecom.lib -LIBRARY flogger.lib -LIBRARY apgrfx.lib // aptasklist -LIBRARY ws32.lib - - -// new presence cache libraries -LIBRARY presencecacheclient2.lib -LIBRARY presencecacheutils.lib - -// imcachelibray -LIBRARY imcacheclient.lib -// cch settings -LIBRARY serviceprovidersettings.lib - -LIBRARY cch.lib - -// xmpp settings -LIBRARY jabbersettings.lib -LIBRARY bsclient.lib -LIBRARY egul.lib -//end of file - - - - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvengine.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvengine.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,371 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: owner class of this dll -* -*/ - -#ifndef CIMCVENGINE_H -#define CIMCVENGINE_H - -// INCLUDES -#include - -#include -#include -#include -#include -#include "mimcvenginecchhandler.h" -#include "mimcvengineopenchats.h" -#include "mimcvenginecchobserver.h" - -// FORWARD DECLARATIONS - -class MIMCVEngineChatInterface; -class CIMCVEngineMessageHandler; -class MIMCVEngineMessageCreator; -class CIMCVEngineContextObserver; -class MIMCVEngineMessageHandler; -class MIMCVEngineConnectionHandler; -class CIMCVEngineCchHandler; -class MBSAccess; -class CBSFactory; -class CGulIcon; -class CFbsBitmap; -class CIMCVEngineFetchSmiley; -/** - * CIMCVEngine provides one of the interfaces to the engine. - * This interface is used by UI to access network services i.e. - * sending messages and joining to groups e.g. This class is - * also used to get different interfaces to the services - * offered by the imcvengine.dll. - * - * @lib imcvengine.lib - * @since 5.0 - */ -class CIMCVEngine : public CActive, - public MIMCVEngineCCHObserver - { - - //from MIMCVEngineCCHObserver - void ServiceStatusChanged( TInt aServiceId, - TServiceState aServiceStatus ); - - - private: - /** - * Issues Request - */ - void IssueRequest(); - - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIMCVEngine* NewL(TInt aServiceId, - MIMCVEngineMessageCreator& aMessageCreater, - CBSFactory& aBrandingFactory); - - /** - * Destructor. - */ - virtual ~CIMCVEngine(); - - - /** - * Get interface for chat interface. - */ - IMPORT_C MIMCVEngineChatInterface& ChatInterface() const; - - - /** - * Get interface to message handler - */ - IMPORT_C MIMCVEngineMessageHandler& MessageHandler() const ; - - /** - * IsLoggedIn - * Return ETrue if loggedin else EFalse - */ - IMPORT_C TBool IsLoggedIn() const; - - /** - * GetLoggedInUserId - * Return logged in user id - */ - IMPORT_C const TDesC& GetLoggedInUserId() ; - - /** - * ReleaseConnectionL - * Release the connection from server - */ - IMPORT_C void ReleaseConnectionL() ; - - - /** - * Checks engine if its ready for shutdown. - * @return ETrue if ready. - */ - IMPORT_C TBool ReadyForShutdown(); - - - /** - * DeleteContextL - */ - void DeleteContextL() ; - - /** - * CreateContextL - */ - void CreateContextL() ; - - /** - * GetLoggedInUserId - * Return logged in user id - */ - IMPORT_C const TDesC8& GetBrandId() ; - - /** - * Get Service Specific Array of Smiley Strings - * Return array - * ownership not transferred - */ - IMPORT_C RPointerArray GetSmileStringArray(); - - /** - * Get Service Specific Icon Array of Smiley's - * Return array - * ownership not transferred - */ - IMPORT_C RPointerArray GetSmileyIconArray(); - - - IMPORT_C CGulIcon* GetPresenceIconL(const TDesC8& aIconid); - - /** - * GetLoggedInUserId - * Return logged in user id - */ - IMPORT_C TInt GetLanguageId() ; - - - /** - * CCHHandler - * Returns handler to CCH - */ - IMPORT_C MIMCVEngineCchHandler& CCHHandler() ; - - - /** - * ServiceName - * Returns Name of the Service - */ - IMPORT_C const TDesC& ServiceName() ; - - - /** - * Returns the M-Interface class for list of Open Conversations - * Returns MIMCVEngineOpenChats - */ - IMPORT_C MIMCVEngineOpenChats& OpenChats() ; - - - /** - * ServiceId - * Returns Service Id of the Engine - */ - IMPORT_C TInt GetServiceId() ; - - - /** - * Resolves the CCH service state to and does a bindl to - * ximpfw if required. - */ - IMPORT_C void ResolveServiceStateL(); - - /** - * Login to the Service - * - */ - IMPORT_C TInt LoginL(); - - /** - * CreateConnectionL - */ - void CreateConnectionL() ; - - /* - * close all open chats - */ - void CloseAllOpenChatsL(); - - /** - * Check whether the service is VOIP Enabled Service - * - * @since S60 5.0 - * @return ETrue/EFalse - */ - IMPORT_C TBool IsVoipServiceL(); - - private: - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(MIMCVEngineMessageCreator& aMessageCreater ); - - /** - * C++ default constructor. - * @see CIMCVEngine::NewL. - */ - CIMCVEngine(TInt aServiceId,CBSFactory& aBrandingFactory); - - - /** - * Returns property brand language. - * - * @since S60 5.0 - * @param aServiceId, service id - * @return TLanguage, brand language - */ - TLanguage PropertyBrandLanguageL( - TUint32 aServiceId ); - - - /** - * Gets brand id - * - * @since S60 5.0 - * @param aServiceId service id - * @param aBrandId brand id - * @return None - */ - void GetBrandIdL( TUint32 aServiceId, TDes8& aBrandId ); - - /** - * Gets the Settings ID - * - * @since S60 5.0 - * @param aServiceId, service id - * @return settings id - */ - TInt PropertySettingsIdL( TUint32 aServiceId ); - - - /** - * Gets the User Id ID - * - * @since S60 5.0 - * @param aUserId holds the user id - * @return None - */ - void GetUserIdL(TPtr& aUserId ) ; - - /** - * Gets the ServiceName - * - * @since S60 5.0 - * @param aServiceId, service id - * @param aServiceName holds the ServiceName - * @return None - */ - void GetServiceNameL( TUint32 aServiceId, TDes& aServiceName ); - /** - *consturct's the brandaccess specific to service engine - */ - void ConstructBrandL(); - - /** - *utility function to parse the smiley string received from branding server - * for example if smiley string is ":-) [8]" - * it forms an array of each smiley string - */ - void ParseAllSmileyStringL(TInt aTotalCount, const TDesC& aAllSmileyString); - - private: // From CActive - void RunL(); - void DoCancel(); - TInt RunError( - TInt aError ); - - private: // Data - - /// Process states - enum TState - { - ELogin, - EOperationComplete, - EOperationInComplete - }; - - - // service id to use - TInt iServiceId; - - // own user id - HBufC* iOwnUserId; - - // Owns,Settings id of the service.. - HBufC8* iBrandId; - - // Language id - TInt iLanguageId; - - // Owns , reference to message handler - CIMCVEngineMessageHandler* iMessageHandler; - - - //owned, Chat interface - MIMCVEngineChatInterface* iChatInterface; - - // own , client for ximp framework - MXIMPClient* iClient; - // own ,presence context to ximp framework - MXIMPContext* iPresenceContext; - - //owned, observre for ximp call back - CIMCVEngineContextObserver* iContextEventObserver; - - //Stores the XIMPFw EventTypes Subscribed for - RArray< TInt32 > iAcceptedEventTypes; - - //owns the handler for CCH - CIMCVEngineCchHandler* iCCHHandler; - - //Owns the ServiceName - HBufC* iServiceName; - - /// Own: State of the command - TState iState; - - // own active sheduler - CActiveSchedulerWait iWait; - //doesn't own - CBSFactory& iBrandingFactory; - - //owns: branding access specific to service - MBSAccess* iBrandingAccess; - // not owned array of smiley strings - RPointerArray iSmileyArray; - // not owned ,array of smiley icons - RPointerArray iSmileyDlgIconArray; - // ETrue if array owned - TBool iSmileyArrayOwned; - // ETrue if array owned - TBool iSmileyDlgIconArrayOwned; - }; - -#endif // CIMCVENGINE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginecchhandler.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginecchhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -/* -* Copyright (c) 2008 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: Class handling the use of Cch -* -*/ - - -#ifndef C_CIMCVENGINECCHHANDLER_H -#define C_CIMCVENGINECCHHANDLER_H - -// INCLUDES -#include -#include - -#include "cimcvengine.h" -#include "mimcvenginecchhandler.h" -#include "mimcvenginecchobserver.h" -class CSPSettings; -// CLASS DECLARATION -/** - * CCH handler - * This class implements the handling of CCH - * - * @lib imcvengine.lib - * @since S60 5.0 - */ - - -NONSHARABLE_CLASS( CIMCVEngineCchHandler ) : public CBase, - public MIMCVEngineCchHandler, - public MCchServiceStatusObserver - { - public: - - /** - * Two-phased constructor. - * @param aServiceId, service id to monitor - */ - static CIMCVEngineCchHandler* NewL(TUint aServiceId, - CIMCVEngine& aEngine); - - /** - * Two-phased constructor. - * @param aServiceId, service id to monitor - */ - static CIMCVEngineCchHandler* NewLC(TUint aServiceId, - CIMCVEngine& aEngine); - - /** - * Standard C++ destructor - */ - ~CIMCVEngineCchHandler(); - - /** - * Register for CCh Events - * @param aObserver - Observer - */ - void RegisterObserver(MIMCVEngineCCHObserver* aObserver); - - /** - * UnRegister for CCh Events - * - */ - void UnRegisterObserver(); - - /** - * Gets service state - * - * @since S60 5.0 - * @param aCCHState service state (result) - * @return TInt Standard Symbian error code - */ - TInt GetServiceState(TCCHSubserviceState& aCCHState); - - /** - * Enables service - * - * @since S60 5.0 - * @return TInt, error code - */ - TInt EnableService(); - - - /** - * Returns the User Id for this service - * Returns HbufC* and the caller of this function should deallocate the same - * @since S60 5.0 - * @return HBufC* - */ - HBufC* GetUserIdL(); - - /** - * Returns the XimpFw Protocol UID for this service - * Returns TInt - * @since S60 5.0 - * @return TInt , error code - */ - TInt GetAdapterUidL(); - - /** - * Disables service - * - * @since S60 5.0 - * @return TInt, error code - */ - TInt DisableService(); - - - /** - * IsServiceLoggedIn - * - * @since S60 5.0 - * - * @return ETrue - if Service Logged In, EFalse - Service Not Logged In - */ - TBool IsServiceLoggedIn(); - - private: - // methods from MCchServiceStatusObserver - - /** - * @see MCchServiceStatusObserver - */ - void ServiceStatusChanged( - TInt aServiceId, - const TCCHSubserviceType aType, - const TCchServiceStatus& aServiceStatus ); - - void DoHandleServiceStatusChangedL( - TInt aServiceId, - const TCCHSubserviceType aType, - const TCchServiceStatus& aServiceStatus ); - private: // Implementation - - /** - * Standard C++ constructor - */ - CIMCVEngineCchHandler(TUint aServiceId, - CIMCVEngine& aEngine); - - /** - * Performs the 2nd phase of construction. - * - */ - void ConstructL(); - - - private: // Data - - // Own: CCH Client - CCch* iCchClient; - - TUint iServiceId; //Service Id - - CIMCVEngine& iEngine; //engine - - //doesnt own - MIMCVEngineCCHObserver* iObserver; - - TInt iPrevNwError; - - }; - -#endif // C_CIMCVENGINECCHHANDLER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginechatcontainer.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginechatcontainer.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,258 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: -* prior written consent of Nokia Corporation. -* ============================================================================== -*/ - -#ifndef CIMCVENGINECHATCONTAINER_H -#define CIMCVENGINECHATCONTAINER_H - -#include "mimcvenginebuffermemoryhandler.h" -#include "mimcvenginechatinterface.h" -#include "mimcvenginenewmsgobserver.h" -#include "mimcvenginechatlistobserver.h" - - -// FORWARD CLASS DECLERATIONS -class CIMCVEngineMessageContainer; - - -// CLASS DECLARATION - -/** - * Container for message containers - * - * @lib imcvengine.dll - * @since 5.0 - */ -class CIMCVEngineChatContainer : public CBase, - public MIMCVEngineChatInterface, - public MIMCVEngineBufferMemoryHandler, - public MIMCVEngineNewMsgObserver - { - public: // Construction - - /** - * Construction - */ - static CIMCVEngineChatContainer* NewL(TInt aServiceId); - - /** - * Destruction - */ - ~CIMCVEngineChatContainer(); - - - - - private: // Construction - - /** - * Constructor - */ - CIMCVEngineChatContainer( TInt aServiceId ); - - private: // Methods from MIMCVEngineChatInterface - - - /** - * @see MIMCVEngineChatInterface - */ - MIMCVEngineBufferMemoryHandler& MemoryHandler(); - - - /** - * @see MIMCVEngineChatInterface - */ - MIMCVEngineMessageReadInterface& MessageReadInterfaceL( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineMessageReadInterface::TContainerType aType ); - - /** - * @see MIMCVEngineChatInterface - */ - MIMCVEngineMessageWriteInterface& MessageWriteInterfaceL( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineMessageReadInterface::TContainerType aType ); - - /** - * @see MIMCVEngineChatInterface - */ - void DeleteChatL( - TInt aServiceId, - const TDesC& aTargetId ); - - /** - * @see MIMCVEngineChatInterface - */ - void CloseAllContainers(); - - - - /** - * @see MIMCVEngineChatInterface - */ - TInt ChatCount() const; - - - /** - * @see MIMCVEngineChatInterface - */ - void RegisterNewMsgObserver( MIMCVEngineNewMsgObserver* aObserver ); - - /** - * @see MIMCVEngineChatInterface - */ - void UnregisterNewMsgObserver(); - - - /** - * @see MIMCVEngineNewMsgObserver - */ - TInt RegisterChatListObserver( MIMCVEngineChatListObserver* aObserver ); - - /** - * @see MIMCVEngineNewMsgObserver - */ - TInt UnregisterChatListObserver( MIMCVEngineChatListObserver* aObserver ); - - - /** - * @see MIMCVEngineNewMsgObserver - */ - TInt MessagesPendingCount( TInt& aCountOfChats, - MIMCVEngineMessageReadInterface::TUnreadFilter aUnreadFilter = - MIMCVEngineMessageReadInterface::EUnreadAll ) const; - - - - private: // Methods from MIMCVEngineBufferMemoryHandler - - /** - * @see MIMCVEngineBufferMemoryHandler - */ - TBool FreeMemoryIfNeededL( TInt aSize ); - - - - /** - * return the chat interface at given index - */ - MIMCVEngineMessageReadInterface& ChatAt( TInt aIndex ) const; - - private: // Methods from MIMCVEngineNewMsgObserver - - /** - * @see MIMCVEngineNewMsgObserver - */ - void HandleChatEventL( TChatEventType aEvent, - MIMCVEngineMessage* aMessage = NULL ); - - - - private: // New helper methods - - /** - * Return index to chat. Try to create if does not exists. - * Leave if not possible. e.g. KErrNoMemory. - * @param aServiceId Part of identifier to identify container. - * @param aTargetId Part of identifier to identify container. - * @return Index of container. - */ - TInt ChatL( TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineMessageReadInterface::TContainerType aType = - MIMCVEngineMessageReadInterface::ENoneContainer ); - - /** - * Returns latest found item by index. - * FindChat or ChatL( id, type ) must be called before this one. - * @param aIndex, Index of needed item. - * @param aResetLatest. Reset type of latest found container. - * ETrue, Reset, EFalse, No reseting. - * @return Pointer to right container. - */ - CIMCVEngineMessageContainer* ChatL( TInt aIndex, TBool aResetLatest = ETrue ); - - /** - * FindChat or ChatL( id, type ) must be called before this one. - * @param aIndex, Index of needed item. - * @param aResetLatest. Reset type of latest found container. - * ETrue, Reset, EFalse, No reset. - */ - void RemoveChat( TInt aIndex, TBool aResetLatest = ETrue ); - - /** - * Finds if container exists and returns index. - * @param aChat Reference chat. - * @return Index of container. If container is not found, - * KErrNotFound is returned. - */ - TInt FindChat( const CIMCVEngineMessageContainer& aChat ); - - /** - * Create new container. userid - * current ones, if KNullDesC used. - * @see CIMCVEngineMessageContainer - */ - CIMCVEngineMessageContainer* CreateContainerLC( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineBufferMemoryHandler& aMemoryHandler, - MIMCVEngineMessageReadInterface::TContainerType aType ); - - private: - /** - * helper method - */ - void HandleChatListEvent( TChatListEventType aEvent, - MIMCVEngineMessageReadInterface& aContainerInfo ); - - - private: // Member data - // service Id - TInt iServiceId; - /// Container of chats. Owns items. - RPointerArray< CIMCVEngineMessageContainer > iChatContainer; - - // Container of send buffers. Owns items. - RPointerArray< CIMCVEngineMessageContainer > iSendContainer; - - /// Container of observers. Does not own items. - MIMCVEngineNewMsgObserver* iNewMsgObserver; - - /// External memory handler if set. - MIMCVEngineBufferMemoryHandler* iExternalMemoryHandler; - - /// Last found item type - MIMCVEngineMessageReadInterface::TContainerType iLatestType; - - /// Container of observers. Does not own items. - RPointerArray< MIMCVEngineChatListObserver > iChatListObservers; - - }; - - -#endif // CIMCVENGINECHATCONTAINER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginecontextobserver.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginecontextobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: single entry context observer implementation class -* -*/ - - -#ifndef CIMCVENGINECONTEXTOBSERVER_H_ -#define CIMCVENGINECONTEXTOBSERVER_H_ - - -// INCLUDES -#include -#include -#include -#include -#include "mimcvenginenewmessagehandler.h" - -// CLASS DESCRIPTION - -class TIMCVStateEnums - { -public: - enum TIMCVOpersationState - { - EIMCVUnknown = -1, - EIMCVLogging, - EIMCVLoggingOut, - EIMCVSendingMsg - }; - }; - -/** - * ximp context observer for usage scenario tests. - */ -class CIMCVEngineContextObserver : public CBase, - public MXIMPContextObserver, - public MIMCVEngineServiceSessionObserver - - - - { - - enum TXIMPReqType - { - EReqUnknown = -1, - ELoginReq, - ELogoutReq - }; - -public: - - - /** - * Two-phased constructor. - */ - static CIMCVEngineContextObserver* NewL(); - /** - * Two-phased constructor. - */ - static CIMCVEngineContextObserver* NewLC(); - - /** - * CIMCVEngineContextObserver - */ - CIMCVEngineContextObserver(); - - /** - * ~CIMCVEngineContextObserver - */ - ~CIMCVEngineContextObserver(); - - /** - * GetConnectedSessionL - * bind to the same session to the ximpfw - *@param aContext, context to ximpfw - *@param aProtocolUid, uid of protocol used - */ - - void GetConnectedSessionL(MXIMPContext& aContext, TInt aServiceId, TUid aProtocolUid ); - /** - * ReleaseConnectionL - * releasse the session to the ximpfw - *@param aContext, context to ximpfw - */ - void ReleaseConnectionL(MXIMPContext& aContext); - - /** - * IsLoggedIn - * return ETrue if binded - */ - TBool IsLoggedIn() const; - - /** - * SetLoggedIn - * ETrue if binded - */ - void SetLoggedIn(TBool aState) ; - -public : // MIMCVEngineServiceSessionObserver - - /** - * RegisterObserver - * register to listen the new message - */ - void RegisterObserver(MIMCVEngineServiceSessionHandler* aObserver) ; - /** - * UnRegisterObserver - * unregister the message observer - */ - void UnRegisterObserver(MIMCVEngineServiceSessionHandler* aObserver) ; - - -public: - - /** - * HandleximpContextEvent method from context obsrver - * ximp framework - * @param aContext - * @param aEvent, event - */ - - void HandlePresenceContextEvent( const MXIMPContext& aContext, - const MXIMPBase& aEvent ); - - -private: - - - /** - *constructL - */ - void ConstructL(); - -private: //Data - - - //OWN: Result code from waited request - // owned - TBool iLoggedIn; - // login state - - //owned , to handle the recieving ,messages - MIMCVEngineServiceSessionHandler* iSessionObserver; - - // owned, wait for login\logout to complete - CActiveSchedulerWait iWait; - - // ongoing reuest id - TIMCVStateEnums::TIMCVOpersationState iOngoingOperation; - - TXIMPRequestId iCurrentXIMPReq; - - TXIMPReqType iCurrentReqType; - - }; - - - -#endif //CConversationContextObserver_H_ - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginefactory.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginefactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,285 +0,0 @@ -/* -* Copyright (c) 2008-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: service engine factory class -* -*/ - - -#ifndef CIMCVENGINEFACTORY_H -#define CIMCVENGINEFACTORY_H - -// INCLUDES -#include -#include "mimcvenginefactory.h" -#include "mimcvengineopenchats.h" -#include -#include "mimcvenginemessagehandlerobserver.h" -#include "mimcvenginechatlistobserver.h" - -// FORWARD DECLARATIONS -class CIMCVEngine; -class MIMCVEngineConnectionHandler; -class MIMCVEngineOpenChatsObserver; -class CSPSettings; -class MIMCVEngineMessageCreator; -class CBSFactory; -class CSPNotifyChange; -class MIMCVEngineChatListObserver; -class CIMCVEngineStorageListener; - -// CLASS DECLARATION -/** - * Factory to create engine. - * This class implements the factory for creating engine - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ - -class CIMCVEngineFactory : public CBase, - public MIMCVEngineFactory, - public MIMCVEngineOpenChatsObserver, - public MSPNotifyChangeObserver, - public MIMCVEngineMessageHandlerObserver, - public MIMCVEngineChatListObserver - { - public: // Two-phased constructors and destructor - - /** - * @returns a single instance of MVIMPSTEngineFactory - */ - IMPORT_C static MIMCVEngineFactory* InstanceL(); - - /** - * Release - * dont call delete - */ - IMPORT_C static void Release(); - - /** - * c++ default destructor - * dont call delete - */ - virtual ~CIMCVEngineFactory(); - - private: - - /** - * NewLC two phase constructor. - * dont call delete call close - */ - static CIMCVEngineFactory* NewLC(); - - /** - * Second phase construction - * ConstructL - */ - void ConstructL(); - - /** - * C++ constructor. - */ - CIMCVEngineFactory(); - - - void CreateServiceEngineL( TInt aServiceId ); - - - TBool CheckValidIMServiceL(CSPSettings& aSettings , TInt aServiceId) ; - - TUint32 ContactViewUidL(CSPSettings& aSettings, TUint32 aServiceId ); - - void ReadAndCreateAllValidServiceL(); - - - public: //From MVIMPSTEngineFactory - - /** - * return the engine instance for aServiceId. - */ - CIMCVEngine& GetServiceEngineL( TInt aServiceId ) ; - - /** - * find and release the engine instance for aServiceId. - */ - void ReleaseServiceEngine( TInt aServiceId ); - - /** - * @see MVIMPSTEngineFactory - */ - TPtrC GetDisplayNameL(TInt aIndex) const; - - - /** - * @see MVIMPSTEngineFactory - */ - const TDesC& GetTargetIdL(TInt aIndex) const; - - - /** - * @see MVIMPSTEngineFactory - */ - TInt Count() const; - - /** - * @see MVIMPSTEngineFactory - */ - void SetActiveItemL( const TInt aIndex ); - - /** - * @see MVIMPSTEngineFactory - */ - const TDesC& GetActiveItemL() const; - - /** - * @see MVIMPSTEngineFactory - */ - TBool IsMsgPendingL( const TInt aIndex ) const; - - /** - * @see MVIMPSTEngineFactory - */ - TInt FindIndexL(const TDesC& aItem); - - /** - * @see MVIMPSTEngineFactory - */ - void ResetL(); - - /** - * @see MVIMPSTEngineFactory - */ - void RegisterOpenChatObserver(MIMCVEngineOpenChatsObserver* aChatObserver); - - /** - * @see MVIMPSTEngineFactory - */ - void UnRegisterOpenChatObserver(); - - - TInt GetActiveServiceId(); - /* - * return all service engines array - */ - RPointerArray& GetServiceEngines(); - - /** - * @see MVIMPSTEngineFactory - */ - void RegisterServiceObserver(MIMCVEngineServiceChangeObserver* aServiceObserver) ; - /** - * @see MVIMPSTEngineFactory - */ - void UnRegisterServiceObserver() ; - - - private : - - /** - * @see handle the presence change notification - * to handle the connection lost - */ - void HandlePresenceChangedL(TInt aServiceId, const TDesC& aBuddyId ) ; - - /** - * Handle message send operation completion. - * @param aResult result to handle. - */ - void HandleOperationCompletdL(TInt aserviceId, MIMCVEngineMessage::TMessagerType aType , TInt aResult) ; - - /** - * @see HandleConnectionTerminatedL - * to handle the connection lost - * @param aReason, reason report - */ - void HandleConnectionEventL(TInt aServiceId, TIMCVConnectionState aState, TInt aReason ) ; - - /** - * Handle events. - * @param aEvent Event to handle. - * @param aContainerInfo, Container - */ - void HandleChatListEvent(TInt aServiceId, TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* aContainerInfo - ) ; - - - private: // From MSPNotifyChangeObserver - - /** - * From MSPNotifyChangeObserver - * Callback when service has changed - * - * @since S60 5.0 - * @param aServiceId changed service - * @return None - */ - void HandleNotifyChange( TServiceId aServiceId ); - - /** - * From MSPNotifyChangeObserver - * Callback when service error occures - * - * @since S60 5.0 - * @param aError error code - * @return None - */ - void HandleError( TInt aError ); - - /* - * end the cv process - */ - void ShutDownConversationviewL(); - - private: - /** - * @see MIMCVEngineOpenChatsObserver - */ - void HandleChangeL(TInt aServiceId , TInt aIndex, TOpenChatsEventType aChangeType) ; - - /** - * @see MIMCVEngineOpenChatsObserver - */ - void SetStatusMsgL(TInt aServiceId, TInt aIndex,const TDesC & aMsg); - - private : - /* - * helper method to for service table change - */ - void DoHandleServiceChangeL( TInt aServiceId ); - - private : - // Owns : message creater - MIMCVEngineMessageCreator* iMessageCreator; - //owns array of services - RPointerArray iServiceEngines; - // not owns - MIMCVEngineOpenChatsObserver* iChatObserver; - // active service Id - TInt iActiveServiceId; - // active chat index - TInt iActiveChatIndex; - //owns brandingfactory for service specific icons - CBSFactory* iBrandingFactory; - // Own: service observer - CSPNotifyChange* iSpNotifyChange; - // not own - MIMCVEngineServiceChangeObserver* iServiceChangeObserver; - }; - -#endif //CIMCVENGINEFACTORY_H - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginemessagebase.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginemessagebase.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: base class for messages -* -*/ - - -#ifndef CIMCVENGINEMESSAGEBASE_H -#define CIMCVENGINEMESSAGEBASE_H - -#include -#include - -#include "mimcvenginemessage.h" -#include "mimcvenginemessagecreator.h" -#include -// FORWARD CLASS DECLERATIONS -class MIMCVEngineMessageContainerInfo; - -// CLASS DECLARATION - -/** - * Message Base class - */ -class CIMCVEngineMessageBase : public CBase, - public MIMCVEngineMessage - { - - public: // Construction - - /** - * Destruction - */ - ~CIMCVEngineMessageBase(); - - protected: // Construction - - /** - * Constructor - */ - CIMCVEngineMessageBase(); - - /** - * Remember to call this one as last line of child ConstructL - * @param aSender, sender user id - * @param aRecipient, recipient id - */ - void ConstructL( const TDesC& aSender, - const TDesC& aRecipient ); - - protected: // From MIMCVEngineMessage - - /** - * @see MIMCVEngineMessage - */ - const TTime& TimeStamp() const; - /** - * @see MIMCVEngineMessage - */ - void SetTimeStamp(TTime aTime ) ; - - /** - * @see MIMCVEngineMessage - */ - TMessageType MessageType() const; - - /** - * @see MIMCVEngineMessage - */ - TMessagerType MessagerType() const; - - /** - * @see MIMCVEngineMessage - */ - TXIMPRequestId OperationCode() const; - - /** - * @see MIMCVEngineMessage - * @param aOpId, operation code - */ - void SetOperationCode( TXIMPRequestId aRequestId ); - - /** - * @see MIMCVEngineMessage - */ - const TDesC& Recipient() const; - - /** - * @see MIMCVEngineMessage - */ - const TDesC& Sender() const; - - - /** - * @see MIMCVEngineMessage - */ - const TDesC& Text() const; - - - /** - * @see MIMCVEngineMessage - */ - //const TDesC& UserId() const; - - - /** - * @see MIMCVEngineMessage - * @param aInfo, message container info - */ - void SetContainerInfo( MIMCVEngineMessageContainerInfo* aInfo ); - - - - /** - * @see MIMCVEngineMessage - */ - TInt SizeInBytes() const; - - /** - * @see MIMCVEngineMessage - */ - TBool FailedMessage() const; - - - /** - * @see MIMCVEngineMessage - */ - TSystemMessage SystemMessageType(); - - - /** - * @see MIMCVEngineMessage - */ - void IncreaseOwnerCount(); - - /** - * @see MIMCVEngineMessage - */ - TBool DecreaseOwnerCount(); - - - public: // New methods - - - - /** - * Set message type - * @param aNewType New message type. - */ - virtual void SetMessageType( TMessageType aNewType ); - - /** - * Set messager type - * @param aNewType New messager type. - */ - virtual void SetMessagerType( TMessagerType aNewType ); - - /** - * Set message as system message - * @param aType Type of system message - */ - void SetSystem( TSystemMessage aType ); - - - - protected: - - /** - * Set failed message - * @param aFailed, by default it will set ETrue - */ - virtual void SetFailed( TBool aFailed = ETrue ); - - - - protected: // Member variables - - /// Type of message - TMessageType iMessageType; - // messager type - TMessagerType iMessagerType; - - /// Owns Message sender - HBufC* iSender; - - /// Owns Recipient of message - HBufC* iRecipient; - - - /// Timestamp. - TTime iTime; - - /// Operation code - TXIMPRequestId iOperationCode; - - - /// Owns. Textual content. - HBufC* iText; - - /// Does not own. Container information - MIMCVEngineMessageContainerInfo* iInfo; - - - /// Is message failed message or not. - TBool iFailed; - - /// If this is a system message, this defines the type - TSystemMessage iSystemMessageType; - - // Message's version used in internalizing/externalizing - TUint16 iMessageVersion; - - /// Ownercount to count owners. - TInt iOwnerCount; - }; - -#endif // CIMCVENGINEMESSAGEBASE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginemessagecontainer.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginemessagecontainer.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,366 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message container class -* -*/ - - -#ifndef __CIMCVENGINEMESSAGECONTAINER_H__ -#define __CIMCVENGINEMESSAGECONTAINER_H__ - -#include "mimcvenginemessagesreadinterface.h" -#include "mimcvenginemessageswriteinterface.h" -#include "mimcvenginemessagecontainerinfo.h" -#include "mimcvenginemessageobserver.h" - -// FORWARD CLASS DECLERATIONS -class MIMCVEngineBufferMemoryHandler; -class MIMCVEngineNewMsgObserver; -class MCAMessage; - -// CLASS DECLARATION - -/** - * Container class for messages. - * - * @lib imcvengine.dll - * @since 5.0 - */ - - -class CIMCVEngineMessageContainer : public CBase, - public MIMCVEngineMessageReadInterface, - public MIMCVEngineMessageWriteInterface, - public MIMCVEngineMessageContainerInfo - { - public: // Construction - - /** - * Construction - * @param aServiceId - ServiceId - * @param aTargetId, Identifier of container - * @param aMemoryHandler Handles memory - * @param aType Type of container. EChatContainer - * @return Pointer to new created instance of CIMCVEngineMessageContainer - */ - static CIMCVEngineMessageContainer* NewL( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineBufferMemoryHandler& aMemoryHandler, - TContainerType aType ); - - /** - * Construction - * @param aServiceId - ServiceId - * @param aTargetId, Identifier of container - * @param aMemoryHandler Handles memory - * @param aType Type of container. EChatContainer - * @return Pointer to new created instance of CIMCVEngineMessageContainer - */ - static CIMCVEngineMessageContainer* NewLC( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineBufferMemoryHandler& aMemoryHandler, - TContainerType aType ); - - /** - * Destruction - */ - ~CIMCVEngineMessageContainer(); - - private: // Construction - - /** - * Constructor - * @param aMemoryHandler Handles memory - */ - CIMCVEngineMessageContainer( MIMCVEngineBufferMemoryHandler& aMemoryHandler ); - - /** - * Constructor - * @param aServiceId - ServiceId - * @param aTargetId, Identifier of container - * @param aType Type of container. EChatContainer - */ - void ConstructL( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - TContainerType aType ); - - private: // Methods from MIMCVEngineMessageReadInterface - - /** - * @see MIMCVEngineMessageReadInterface - */ - TInt UnreadCount( TUnreadFilter aUnreadFilter = EUnreadAll ) const; - - /** - * @see MIMCVEngineMessageReadInterface - */ - TInt MessageCount() const; - - /** - * @see MIMCVEngineMessageReadInterface - */ - void StoreEditerMessageL( const TDesC& aEditorMessage ); - - /** - * @see MIMCVEngineMessageReadInterface - */ - const TDesC& GetEditerMessage(); - - /** - * @see MIMCVEngineMessageReadInterface - */ - void Read( TReadType aReadType, TInt aReadAmount = 0 ); - - /** - * @see MIMCVEngineMessageReadInterface - */ - MIMCVEngineMessage& Message( TInt aIndex ) const; - - /** - * @see MIMCVEngineMessageReadInterface - */ - MIMCVEngineMessage& ReadNextUnread(); - - /** - * @see MIMCVEngineMessageReadInterface - */ - MIMCVEngineMessage& ReadUnreadFromIndex( TInt aIndex ); - - /** - * @see MIMCVEngineMessageReadInterface - */ - void SetObserver( MIMCVEngineMessageObserver* aObserver ); - - /** - * @see MIMCVEngineMessageReadInterface - */ - TPtrC Name() const; - - /** - * @see MIMCVEngineMessageReadInterface - */ - TDesC DisplayName() const; - - - /** - * @see MIMCVEngineMessageReadInterface - */ - void DeleteMessage( TInt aIndex ); - - - /** - * @see MIMCVEngineMessageReadInterface - */ - MIMCVEngineMessageContainerInfo& TargetId(); - - /** - * @see MIMCVEngineMessageReadInterface - */ - void Lock( TBool aLocked ); - - /** - * @see MIMCVEngineMessageReadInterface - */ - void SetActive( TBool aActiveChat ); - - /** - * @see MIMCVEngineMessageReadInterface - */ - TBool IsActive(); - - - - private: // Methods from MIMCVEngineMessageWriteInterface - - /** - * @see MIMCVEngineMessageWriteInterface - */ - void AppendL( MIMCVEngineMessage* aMessage, TBool aSharedOwnership ); - - - - - /** - * @see MIMCVEngineMessageWriteInterface - */ - TTime Time(); - - /** - * sets the display name - * @param aDispalyName. updated display name - */ - void SetNameL( const TDesC& aDispalyName ); - public: - /** - * sets the contactlink - * @param aContactLink. updated contactlink - */ - void SetLinkL(const TDesC8& aContactLink); - - /** - * @see MIMCVEngineMessageReadInterface - */ - TPtrC8 ContactLink() const; - - private: // From MIMCVEngineMessageContainerInfo - - - /** - * @see MIMCVEngineMessageContainerInfo - */ - const TDesC& Target() const; - - /** - * Returns target id to be used for - * comparisons. - * @return Target id. - */ - const TDesC& ComparableTarget() const; - - - - - public: // New methods - - /** - * Ordering function for ordering Message containers - * @param aSourceA First compare item. - * @param aSourceB Second compare item. - * @return -1, 0 or +1, like CompareC. - */ - static TInt OrderUid( const CIMCVEngineMessageContainer& aSourceA, - const CIMCVEngineMessageContainer& aSourceB ); - - /** - * Type of container - * @return Type of container. EChatContainer - */ - TContainerType ContainerType() const; - - - /** - * Set chat observer. - * @param aObserver. Observer to set. - */ - void SetChatObserver( MIMCVEngineNewMsgObserver* aObserver ); - - private: // New helper methods - - /** - * Resolve type of container by identifier. - * @param aType, new type. If ENoneContainer, Resolved automaticly. - */ - void ResolveType( TContainerType aType ); - - /** - * display id it remove the domain part if any - * @param aId id to extarct - * @param aDomainHiding , hiding the domain part - */ - static TPtrC DisplayId( const TDesC& aId, TBool aDomainHiding = ETrue ); - - - - public: - - /** - * Get count of all messages. Unread and read. - * @return Count of messages - */ - TInt AllMessagesCount() const; - - /** - * Access to any message. Also unread. - * @param aIndex Index of message - * @return Reference to message. - */ - MIMCVEngineMessage& MessageFromAll( TInt aIndex ) const; - - /** - * Delete from all messages. Unread and read messages available. - * @param aIndex. Index of message. - */ - void DeleteMessageFromAll( TInt aIndex ); - - /** - * Is container locked or not. ETrue locked, EFalse not. - * @return Locked status. - */ - TBool IsLocked() const; - - /** - * Sizes of messages in container in bytes. - * @return Size in bytes. - */ - TInt ContainerSizeInBytes() const; - - private: // Member data - - /// conversation party id Owns - HBufC* iTargetId; - - // Owns , conversation party name - HBufC* iBuddyDisplayName; - - // Owns ,contact link info of chat. - HBufC8* iContactLink; - - // owns - HBufC* iDecodedTargetId; - // owns : reference to previous entered message - HBufC* iEditerMessge; - - /// Offset to last unread message - TInt iUnreadOffset; - - /// Array of messages. - RPointerArray< MIMCVEngineMessage > iMessageContainer; - - /// Reference to memory handler - MIMCVEngineBufferMemoryHandler& iMemoryHandler; - - /// Observer class - Doesnt Own - MIMCVEngineMessageObserver* iObserver; - - /// Type of container - TContainerType iContainerType; - - /// Not own. Chat observer - MIMCVEngineNewMsgObserver* iChatObserver; - - // Locked status - TBool iLocked; - - - // Size of contained messages in bytes - TInt iContainerSizeInBytes; - - //Active Chat - TBool iActiveChat; - - }; - - -#endif // __CIMCVENGINEMESSAGECONTAINER_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginemessagecreator.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginemessagecreator.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message creater class -* -*/ - - -#ifndef CIMCVENGINEMESSAGECREATOR_H -#define CIMCVENGINEMESSAGECREATOR_H - -#include "mimcvenginemessagecreator.h" - - -// CLASS DECLARATION - -/** - * Creator class for messages. - * - * @lib imcvengine.dll - * @since 5.0 - */ - -class CIMCVEngineMessageCreator : public CBase, public MIMCVEngineMessageCreator - { - public: // Construction - - /** - * Construction - * @return Pointer to new created instance of CIMCVEngineMessageCreator - */ - static CIMCVEngineMessageCreator* NewL(); - - - /** - * Destruction - */ - ~CIMCVEngineMessageCreator(); - - private: // Construction - - /** - * Constructor - */ - CIMCVEngineMessageCreator(); - - private: // From MIMCVEngineMessageCreator - - /** - * @see MIMCVEngineMessageCreator - */ - MIMCVEngineMessage* CreateMessageL( const SMessageData& aData ) const; - - - /** - * Create failed text message. - * @param MIMCVEngineMessage, which has been failed to deliver - * @return new MIMCVEngineMessage. Ownership is passed to caller - */ - MIMCVEngineMessage* CreateFailedMessageL( - const MIMCVEngineMessage* pSource ) const ; - - private: // New helper methods - - /** - * Create text message. - * @param aData Data for message. - * @return new MIMCVEngineMessage. Ownership is passed to caller - */ - MIMCVEngineMessage* CreateTextMessageL( const SMessageData& aData ) const; - - - - - }; - -#endif // CIMCVENGINEMESSAGECREATOR_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginemessagehandler.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginemessagehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,373 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message handler class declaration -* -*/ - - -#ifndef __CIMCVENGINEMESSAGEHANDLER_H__ -#define __CIMCVENGINEMESSAGEHANDLER_H__ - -#include "mimcvenginemessage.h" -#include "mimcvenginemessagecreator.h" // For SMessageData -#include "mimcvenginemessagehandler.h" -#include "mimcvenginenewmessagehandler.h" - -#include // im cache -#include -#include - -#include -#include // handling the presence cache events -#include // buddy info class -#include "cimcvenginestoragelistener.h" - -// FORWARD CLASS DECLERATIONS -class MIMCVEngineChatInterface; -class MIMCVEngineMessageUtils; -class MIMCVEngineMessageReadInterface; -class MIMCVEngineMessageHandler; -class MIMCVEngineNewMessageHandler; -class MIMCVEngineMessageHandlerObserver; - -// ximp im -class MImFeatures; -class MPresenceCacheReader2; -class MXIMPIdentity; -// im cache -class MIMCacheUpdater; -class CIMCacheFactory; - -class CIMCVEngineOpenChats; -class CIMCVEngineStorageListener; -class MIMCVEngineStorageObserver; -// CLASS DECLARATION - -/** - * Handler class for incoming and outgoing messages - * - * @lib imcvengine.dll - * @since 5.0 - */ - -class CIMCVEngineMessageHandler : public CBase, - public MIMCVEngineMessageHandler, - public MIMCVEngineServiceSessionHandler, - public MIMCacheEventHandler, - public MPresenceCacheReadHandler2, - public MIMCVEngineStorageObserver - { - friend class CIMCVUiEngine_TestSendMessage; - - public: // Construction - - /** - * Construction - * @param aMessageUtils Access to message utils ( Message creator, - * @param aContext, Access to Context - * @param aServiceId , Service Id - * @param aOwnId - OwnUserId - * @return Pointer to new created instance of CIMCVEngineMessageCreator - */ - static CIMCVEngineMessageHandler* NewL( MIMCVEngineChatInterface& aChatInterface, - MIMCVEngineMessageCreator& aMessageCreator, - MXIMPContext* aContext, - TInt aServiceId , - const TDesC& aOwnId); - - /** - * two phase Construction - * @param aMessageUtils Access to message utils ( Message creator, - * @param aContext, Access to Context - * @param aServiceId , Service Id - * @param aOwnId - OwnUserId - * @return Pointer to new created instance of CIMCVEngineMessageCreator - */ - static CIMCVEngineMessageHandler* NewLC( MIMCVEngineChatInterface& aChatInterface, - MIMCVEngineMessageCreator& aMessageCreator, - MXIMPContext* aContext, - TInt aServiceId , - const TDesC& aOwnId); - - /** - * Destruction - */ - ~CIMCVEngineMessageHandler(); - - - /** - * ResetContextL - * @param aContext, new context - */ - void ResetContextL(MXIMPContext* aContext); - - - private: // Construction - - /** - * Constructor - * @see CIMCVEngineMessageHandler::NewL - * @param aChatInterface, reference to chat interface - * @param aMessageUtils, reference to the message utils - * @param aContext, reference to ximpfw context - */ - CIMCVEngineMessageHandler( MIMCVEngineChatInterface& aChatInterface, - MIMCVEngineMessageCreator& aMessageCreator, - MXIMPContext* aContext , - TInt aServiceId); - - /** - * Constructor - */ - void ConstructL(const TDesC& aOwnId ); - - /** - * read service name from csp settings - * @param aServiceId, service id. - */ - void ReadServiceNameL(TInt aServiceId ); - - - /** - * handle the failed messages - * @param aMessage, message - */ - void HandleMessageSentFailedL( MIMCVEngineMessage& aMessage ) ; - - - public: // From MIMCVEngineServiceSessionHandler - - - /** - * @see HandleDeliveryReportL - * to handle the new message delivery report - * @param aResultError, delivery report - * @param aText, msg to send - */ - void HandleDeliveryReportL( TXIMPRequestId aOperatioCode, - TInt aResultError ) ; - - - - /** - * @see HandleConnectionTerminatedL - * to handle the connection lost - * @param aReason, reason report - */ - void HandleConnectionEventL( TIMCVConnectionState aState, TInt aReason ) ; - - public : //MIMCVEngineMessageHandler - - MIMCVEngineMessageCreator& MessageCreator() const ; - - /** SendMessageL - * api to send the message to below layer - * @param aMessage, message to be send - */ - void SendMessageL(MIMCVEngineMessage& message); - - /** append to cache - * api to send the message to below layer - * @param aBuddyId, a buddyId - * @param aTextMessage, message to be saved - */ - void AppendToCacheL(const TDesC& aBuddyId, const TDesC& aTextMessage ); - - - /** - * @see MIMCVEngineMessageHandler - */ - void StartNewConversationL(const TDesC& aRecipientId ); - - - /** - * @see MIMCVEngineMessageHandler - */ - TInt CloseConversationL(const TDesC& aBuddyId); - - /** - * @see MIMCVEngineMessageHandler - */ - void CloseAllConversationL(); - - /** - * @see MIMCVEngineMessageHandler - */ - TInt DeactivateConversationL(); - - - void UnSubscribePresenceL(const TDesC& aRecipientId); - /** - * @see MIMCVEngineMessageHandler - */ - void SubscribePresenceL(const TDesC& aWVID); - - /** - * @see MIMCVEngineMessageHandler - */ - void SetObserver( MIMCVEngineMessageHandlerObserver* aObserver ) ; - - /** - * @see MIMCVEngineMessageHandler - */ - void RemoveObserver(); - - /** - * @see MIMCVEngineMessageHandler - */ - TIMCVOnlineStatus GetPresenceStatus(); - - /** - * @see MIMCVEngineMessageHandler - */ - RArray GetChatListL( TInt aServiceId ); - - /** - * @see MIMCVEngineMessageHandler - */ - CIMCVEngineOpenChats& OpenChats() ; - - TInt ServiceId() const ; - - - public: // MIMCacheMessageChangeObserver - - /** - * Gets called when data update is available. - * Client can then decide wether to use the old one - * or the updated one. - * @param aNewMessage, new message details - */ - void HandleIMCacheEventL(TIMCacheEventType aEvent, TAny* aChatMessage = NULL ) ; - - public: // prescachereadhandler - - /** - * Handler for Asynchronous methods of MPresenceCacheReader. - * @param aErrorCode - * @param aPresenceBuddyInfoList presence infos for all buddies requested. - * Ownership to callee. Can be null if not found. - */ - void HandlePresenceReadL(TInt aErrorCode, - RPointerArray& aPresenceBuddyInfoList); - - /** - * Handler for Buddy presence change notifications. - * @param aErrorCode - * @param aPresenceBuddyInfo presence info for buddy. - * Ownership to callee. Can be NULL if aErrorCode exist. - */ - void HandlePresenceNotificationL(TInt aErrorCode, - MPresenceBuddyInfo2* aPresenceBuddyInfo); - - - - - - private : - - /** NotifyOperationCompletdL - * @param aResult, aResult to be send - */ - void NotifyOperationCompletdL(MIMCVEngineMessage::TMessagerType aType , TInt aResult ); - - /** Helper Functions - * - */ - MIMCVEngineMessage::TMessageType GetEngineMessageType(TIMCacheMessageType aType ); - MIMCVEngineMessage::TMessagerType GetEngineMessagerType(TIMCacheMessagerType aType ); - MIMCVEngineMessage::TContentType GetEngineContentType(TIMCacheContentType aType ); - - /** - * ReadPresenceStatusL, - * read the presence status and text from presence cache - * @param aIdentity , identity in the XSP format - **/ - void ReadPresenceStatusL(const TDesC& aIdentity ); - /** - * ConvertStringToStatus,converts the string to enums for presence status - * aAvailabilityEnum enum value indicating the presence status. - * aAvailabilityText, availability text to support multiple presence. - * @return staus. - **/ - TIMCVOnlineStatus ConvertPresenceCacheEnums(MPresenceBuddyInfo2::TAvailabilityValues aAvailabilityEnum, TPtrC aAvailabilityText); - - /** - * Converts the presence cache extension keys - * user for block and pending states to client supported presence status. - * - * @since 5.0 - * @param aPresenceBuddyInfo presence buddy info class. - */ - void GetKeyFiledsAndValuesL(MPresenceBuddyInfo2& aPresenceBuddyInfo); - - /* - * call back after fetching the display name and link - */ - void HandleServiceBuddyDetailsFetchedL(TInt aServiceId, - const TDesC& aXspId, - const TDesC8 & aContactLink, - const TDesC & aDisplayName ) ; - - private: // Member data - - // Owns , reference to message creator - MIMCVEngineMessageCreator& iMessageCreator; - - /// Does not own. Access to message containers - MIMCVEngineChatInterface& iChatInterface; - - // owns : storage change listener - CIMCVEngineStorageListener* iStorageListener; - - // not woned - MXIMPContext* iContext; - - // woned ,delet it - MImFeatures* iImFeatures; - - /// Messages which are send to the server - // removed once delivered successfully to server - RPointerArray< MIMCVEngineMessage > iHoldingMessages; - - // not owned , send observers - MIMCVEngineMessageHandlerObserver* iObserver; - - // owned, access to accesss/update interface - // call realease of factory - CIMCacheFactory* iIMCacheFactory; - - // owned, access/update to imcache - MIMCacheUpdater* iIMCacheUpdater; - - //owns - MPresenceCacheReader2* iPresenceCacheReader; - - // owns , presence status - TIMCVOnlineStatus iPresenceStatus; - - // owns , service name - HBufC* iServiceName; - - // owns - CIMCVEngineOpenChats* iOpenChats; - - TInt iServiceId; - - - }; - -#endif // __CIMCVENGINEMESSAGEHANDLER_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvengineopenchats.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvengineopenchats.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/* -* Copyright (c) 2008-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: Openchats -* -*/ - - -#ifndef CIMCVENGINEOPENCHATS_H -#define CIMCVENGINEOPENCHATS_H - -//includes -#include -#include - - -#include "mimcvengineopenchats.h" -#include "mimcvenginenewmsgobserver.h" -#include "mimcvenginechatlistobserver.h" - - -//forward declarations -class CCAConversationItemPC; -class CIMCVEngineMessageHandler; -class MIMCVEngineChatInterface; -class MIMCVEngineMessageReadInterface; - - -// CLASS DECLARATION - -/** - * CIMCVEngineOpenChats - * - * @lib imcvuiengine.dll - * @since 5.0 - */ -class CIMCVEngineOpenChats : public CBase, - public MIMCVEngineOpenChats, - public MIMCVEngineNewMsgObserver, - public MIMCVEngineChatListObserver - - { - - public: // From MIMCVEngineOpenChats - - /** - * @see MIMCVEngineOpenChats - */ - TPtrC GetDisplayNameL(TInt aIndex) const; - - - /** - * @see MIMCVEngineOpenChats - */ - const TDesC& GetTargetIdL(TInt aIndex) const; - - - /** - * @see MIMCVEngineOpenChats - */ - TInt Count() const; - - /** - * @see MIMCVEngineOpenChats - */ - void SetActiveItemL( const TInt aIndex ); - - /** - * @see MIMCVEngineOpenChats - */ - const TDesC& GetActiveItem() const; - - /** - * @see MIMCVEngineOpenChats - */ - TBool IsMsgPendingL( const TInt aIndex ) const; - - /** - * @see MIMCVEngineOpenChats - */ - TInt FindIndexL(const TDesC& aItem); - - /** - * @see MIMCVEngineOpenChats - */ - void RegisterObserver(MIMCVEngineOpenChatsObserver* aChatObserver); - - - /** - * @see MIMCVEngineOpenChats - */ - void UnRegisterObserver(); - - void ResetL(); - - private: - - /** - * Inserts the chat container into the Conversations List - * @param aContainerInfo - Conversation/Chat Container Info - */ - void Insert( MIMCVEngineMessageReadInterface* aContainerInfo ); - - /** - * Delets the chat container from the Conversations List - * @param aContainerInfo - Conversation/Chat Container Info - */ - void RemoveL( MIMCVEngineMessageReadInterface& aContainerInfo ); - - - private: - - /** - * @see MIMCVEngineChatListObserver - */ - void HandleChatListEvent( TInt aServiceId , TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* aContainerInfo - ) ; - - public: - - /** - * NewL - returns the instance to CIMCVEngineOpenChats - */ - static CIMCVEngineOpenChats* NewL(CIMCVEngineMessageHandler& aMessageHandler, - MIMCVEngineChatInterface& aChatInterface, - TInt aServiceId ); - - - /** - * Destructor - */ - virtual ~CIMCVEngineOpenChats(); - - - private: - /** - * @see MIMCVEngineNewMsgObserver - */ - void HandleChatEventL( TChatEventType aEvent, MIMCVEngineMessage* aMessage = NULL ) ; - - private: //Two phased ctor - - /** - *CIMCVEngineOpenChats - ctor - */ - CIMCVEngineOpenChats(CIMCVEngineMessageHandler& aMessageHandler, - MIMCVEngineChatInterface& aChatInterface); - - - /** - *ConstructL - */ - void ConstructL( TInt aServiceId ); - - private: //Data - - //Doesn't own - RPointerArray iOpenChatsArray; - - //holds the index of the active tab item - TInt iActiveItem; - - CIMCVEngineMessageHandler& iMessageHandler; - - //Doesnt Own - MIMCVEngineOpenChatsObserver* iChatObserver; - - //Doesnt Own- Chat Interface - MIMCVEngineChatInterface& iChatInterface; - - }; - -#endif // CIMCVENGINEOPENCHATS_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginestoragelistener.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginestoragelistener.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2008-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: active object class for interacting with servicetab for link and Display Name -* -*/ - -#ifndef CIMCVENGINESTORAGELISTENER_H -#define CIMCVENGINESTORAGELISTENER_H - -#include -#include -#include -#include "cimcvkeys.h" - -_LIT(KDelimiter, ":"); -/** - * constant to define the size of the contact link - */ -#define KMaxDisplayNameContactLinkLength 512 -/** - * constant to define the size of the contact link - */ -#define KMaxServiceIdLength 3 - -//forword declaration. -class MIMCVEngineStorageObserver - { - public : - virtual void HandleServiceBuddyDetailsFetchedL(TInt aServiceId, - const TDesC& aXspId, - const TDesC8 & aContactLink, - const TDesC & aDisplayName ) = 0 ; - - }; - -class CIMCVEngineStorageListener : public CActive - { -public : - // Constructor - /** - * Creates a new CIMCVEngineStorageListener. - * @param aTabbedView, reference to tabbedview - * @return New instance of this class - */ - static CIMCVEngineStorageListener* NewL(MIMCVEngineStorageObserver& aObserver); - - /** - * Standard C++ destructor. - */ - ~CIMCVEngineStorageListener(); - - - /** - * Get the Display name and Contact link information. - * @param aServiceId, service id for which info requested. - * @param aXspID, xsp Id of contact. - */ - void GetContactLinkInfoL(TInt aServiceId, const TDesC& aXspID); - -private : // From CActive - - /** - * RunL - */ - void RunL(); - - /** - * DoCancel - */ - void DoCancel(); - - /* - * RunError - */ - TInt RunError ( TInt aError ); - -private: // Implementation - /** - * Standard C++ constructor - * @param aTabbedView, reference to tabbedview - */ - CIMCVEngineStorageListener(MIMCVEngineStorageObserver& aObserver); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - /** - * start listening - */ - void StartListening(); - - /** - * stop listening - */ - void StopListening(); - -private : - - // owns , property to use - RProperty iProperty; - // not owned - MIMCVEngineStorageObserver& iObserver; - - // own active sheduler - CActiveSchedulerWait iWait; - - }; - -#endif /*CIMCVENGINESTORAGELISTENER_H*/ diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/cimcvenginetextmessage.h --- a/imstutils/imconversationview/imcvuiengine/inc/cimcvenginetextmessage.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: text message -* -*/ - - -#ifndef CIMCVENGINETEXTMESSAGE_H -#define CIMCVENGINETEXTMESSAGE_H - -#include -#include "cimcvenginemessagebase.h" - -// CLASS DECLARATION - -/** - * Message containing text - * - * @lib imcvengine.dll - * @since 5.0 - */ -class CIMCVEngineTextMessage : public CIMCVEngineMessageBase - { - - public: // Construction - - /** - * Construction - * @param aSender, sender user id - * @param aRecipient, recipient id - * @param aData, text message - * @return Pointer to new created instance of CIMCVEngineTextMessage - */ - static CIMCVEngineTextMessage* NewL( - const TDesC& aSender, - const TDesC& aRecipient, - const TDesC& aData ); - - - /** - * two phase construction - * @param aSender, sender user id - * @param aRecipient, recipient id - * @param aData, text message - * @return Pointer to new created instance of CIMCVEngineTextMessage - */ - static CIMCVEngineTextMessage* NewLC( - const TDesC& aSender, - const TDesC& aRecipient, - const TDesC& aData ); - - /** - * Destruction - */ - ~CIMCVEngineTextMessage(); - - public : - - void SetFailedL(); - - private: // Construction - - /** - * Constructor - */ - CIMCVEngineTextMessage(); - - /** - * Constructor - * @param aData, text message - */ - void ConstructL( const TDesC& aData ); - - private: // From MIMCVEngineMessage - - /** - * @see MIMCVEngineMessage - */ - TInt SizeInBytes() const; - - /** - * @see MIMCVEngineMessage - */ - TContentType ContentType() const; - - - }; - -#endif // CIMCVENGINETEXTMESSAGE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/imcvenginemessageutils.h --- a/imstutils/imconversationview/imcvuiengine/inc/imcvenginemessageutils.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message utils class -* -*/ - - -#ifndef IMCVENGINEMESSAGEUTILS_H -#define IMCVENGINEMESSAGEUTILS_H -#include -// FORWARD DECLARATIONS -class TTime; -class MIMCVEngineMessage; -class MIMCVEngineMessageCreator; -class MIMCVEngineMessageWriteInterface; - -/** - * General message handling methods. - * - * General message handling methods which are to be used in both - * messagehandler and chatgroupmanager, to avoid duplicate code. - * - * @lib imcvengine.dll - * @since S60 v5.0 - */ -class IMCVEngineMessageUtils - { -public: - - /** - * Appends a datestamp to writeinterface if needed. - * New time is compared to the previous message in the interface. - * If the time values are from different date then datestamp is created - * Otherwise this does nothing. - * - * @since S60 v5. - * @param aNewTime Time of the new message - * @param aWriteInterface Interface to write the date message - * @param aMessageCreator for creating the date message - * @param aSettingsAPI Settings interface to determine if datestamps - * are required. - */ - static void AppendDateStampL( TTime aNewTime, - MIMCVEngineMessageWriteInterface& aWriteInterface, - MIMCVEngineMessageCreator& aMessageCreator ); - - - /** - * Appends a datestamp and message to interface. Datestamp is added only - * if the date has changed between previous and current message. - * Ownership of the message is transferred or shared, so it doesn't - * need to be in cleanupstack. - * - * @since S60 v5.0 - * @param aNewMessage New message - * @param aWriteInterface Interface to write the date message - * @param aMessageCreator for creating the date message - * @param aSettingsAPI Settings interface to determine if datestamps - * are required. - * @param aSharedOwnership EFalse - ownership is transferred - * ETrue - ownership is shared - */ - static void AppendMessageWithDateStampL( - MIMCVEngineMessage& aNewMessage, - MIMCVEngineMessageWriteInterface& aWriteInterface, - MIMCVEngineMessageCreator& aMessageCreator, - TBool aSharedOwnership = EFalse ); - - /** - * used to load the resource - * @param aResourceId The id to read - * @return The string for given resource id - */ - static HBufC* LoadResourceL( TInt aResourceId , const TDesC& aText ); - }; - - -#endif // IMCVENGINEMESSAGEUTILS_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginebuffermemoryhandler.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginebuffermemoryhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2008-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: For handling memory status. -* -*/ - - -#ifndef __MIMCVEngineBUFFERMEMORYHANDLER_H__ -#define __MIMCVEngineBUFFERMEMORYHANDLER_H__ - -#include - -// FORWARD CLASS DECLERATIONS -class MIMCVEngineChatInterface; - -// CLASS DECLARATION - -/** - * For handling memory status. - * - * @lib imcvuiengine.dll - * @since 5.0 - */ -class MIMCVEngineBufferMemoryHandler - { - public: - /** - * Free memory if needed. - * @param aSize Size needed. - * @return ETrue, if successfull, EFalse if not. - */ - virtual TBool FreeMemoryIfNeededL( TInt aSize ) = 0; - - - }; -#endif // __MIMCVEngineBUFFERMEMORYHANDLER_H__ - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginecchhandler.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginecchhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2008 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: M-Class handling the use of Cch -* -*/ - - -#ifndef M_CIMCVENGINECCHHANDLER_H -#define M_CIMCVENGINECCHHANDLER_H - -// INCLUDES -#include -#include - - -// CLASS DECLARATION -/** - * CCH handler - * This class implements the handling of CCH - * - * @lib imcvengine.lib - * @since S60 5.0 - */ - - -NONSHARABLE_CLASS( MIMCVEngineCchHandler ) - { - public: - - - /** - * Standard C++ destructor - */ - virtual ~MIMCVEngineCchHandler() - { - - } - - /** - * Gets service state - * - * @since S60 5.0 - * @param aCCHState service state (result) - * @return TInt Standard Symbian error code - */ - virtual TInt GetServiceState( - TCCHSubserviceState& aCCHState - ) = 0; - - /** - * Enables service - * - * @since S60 5.0 - * @return TInt, error code - */ - virtual TInt EnableService() = 0; - - - /** - * Returns the User Id for this service - * Returns HbufC* and the caller of this function should deallocate the same - * @since S60 5.0 - * @return HBufC* - */ - virtual HBufC* GetUserIdL() = 0 ; - - /** - * Returns the XimpFw Protocol UID for this service - * Returns TInt - * @since S60 5.0 - * @return TInt , error code - */ - virtual TInt GetAdapterUidL()= 0 ; - /** - * Disables service - * - * @since S60 5.0 - * @return TInt, error code - */ - virtual TInt DisableService() = 0; - - - /** - * IsServiceLoggedIn - * - * @since S60 5.0 - * - * @return ETrue - if Service Logged In, EFalse - Service Not Logged In - */ - virtual TBool IsServiceLoggedIn() = 0; - - }; - -#endif // M_CIMCVENGINECCHHANDLER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginecchobserver.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginecchobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2008 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: Observer class -* -*/ - - - -#ifndef MIMCVENGINE_CCH_OBSERVERH -#define MIMCVENGINE_CCH_OBSERVERH - - - -/** - * Observer class for getting service status change messages - * - * @lib imcvengine.lib - */ -class MIMCVEngineCCHObserver - { - -public: - /// Process states - enum TServiceState - { - ELogin, - EConnecting, - EDisconnecting, - ENotLoggedIn - }; - - /** - * Signaled when service status or error changes - * - * @param aServiceId Id of the service - * @param aServiceStatus Service status - */ - virtual void ServiceStatusChanged( TInt aServiceId, - TServiceState aServiceStatus ) = 0; - - }; - - - -#endif // MIMCVENGINE_CCH_OBSERVERH diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginechatinterface.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginechatinterface.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: chat interface -* -*/ - - -#ifndef MIMCVENGINECHATINTERFACE_H -#define MIMCVENGINECHATINTERFACE_H - -#include "mimcvenginemessagesreadinterface.h" - -// FORWARD CLASS DECLERATIONS -class MIMCVEngineMessageWriteInterface; -class MIMCVEngineNewMsgObserver; -class MIMCVEngineMessageReadInterface; -class MIMCVEngineBufferMemoryHandler; -class MIMCVEngineChatListObserver; - - -/** - * Internal buffer ids, these must be specified so that they can't appear in - * wireless village ids. And they must also be non-matchable to KNullDesC when - * comparing with neutral compare. - * - * From WV_CSP_v1.1.pdf: - * As per URI [RFC2396], certain reserved characters must be escaped if they - * occur within the User-ID, Resource,. This includes the characters - * ";", "?", ":", "&", "=", "+", "$" and ",". - * - * When using neutral compare, atleast ";", "?", ":", "&", "=", "+", "#" and "," - * are invalid. - */ -_LIT( KSendBufferId, "$" ); - -// CLASS DECLARATION - -/** - * Interface for getting access to message containers. - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineChatInterface - { - public: // Interface - - /** - * Provide access to chat messages. If messageContainer does not exists - * creates one. - * @param aServiceId Part of identifier to identify container. - * @param aTargetId Part of identifier to identify container. - * @param aType. Preferred type of container. If ENoneContainer, - * resolved by container. - * @return Read interface to container - */ - virtual MIMCVEngineMessageReadInterface& MessageReadInterfaceL( - TInt aServiceId, - const TDesC& aTargetId = KSendBufferId, - const TDesC& aDisplayName = KNullDesC , - const TDesC8& aContactLink = KNullDesC8, - MIMCVEngineMessageReadInterface::TContainerType aType = MIMCVEngineMessageReadInterface::ENoneContainer - ) = 0; - - /** - * Provide access to append chat messages. - * If messageContainer does not exists, creates one. - * @param aServiceId Part of identifier to identify container. - * @param aTargetId Part of identifier to identify container. - * @param aType. Preferred type of container. If ENoneContainer, - * resolved by container. - * @return Write interface to container - */ - virtual MIMCVEngineMessageWriteInterface& MessageWriteInterfaceL( - TInt aServiceId, - const TDesC& aTargetId = KSendBufferId, - const TDesC& aDisplayName = KNullDesC , - const TDesC8& aContactLink = KNullDesC8 , - MIMCVEngineMessageReadInterface::TContainerType aType = - MIMCVEngineMessageReadInterface::ENoneContainer ) = 0; - - - /** - * Delete identified chat container - * @param aServiceId Part of identifier to identify container. - * @param aTargetId Part of identifier to identify container. - */ - virtual void DeleteChatL( TInt aServiceId, - const TDesC& aTargetId = KSendBufferId ) = 0; - - - - /** - * @see MIMCVEngineNewMsgObserver - */ - virtual TInt ChatCount() const = 0 ; - - /** - * Close all open containers. - */ - virtual void CloseAllContainers() = 0; - - - /** - * Returns the Memory Handler - * @return Reference to MIMCVEngineBufferMemoryHandler - */ - virtual MIMCVEngineBufferMemoryHandler& MemoryHandler() = 0; - - /** - * Register observer for chat events. Remember to unregister - * when not needed - * @param aObserver Observer which is registered. - * @return KErrNone if succeed. - */ - virtual void RegisterNewMsgObserver( MIMCVEngineNewMsgObserver* aObserver ) = 0; - - /** - * Unregister observer for chat events. - * @param aObserver Observer which is unregistered - * @return KErrNone if found and unregistered. - */ - virtual void UnregisterNewMsgObserver() = 0; - - - /** - * Register observer for conversations added/deleted events. Remember to unregister - * when not needed - * @param aObserver Observer which is registered. - * @return KErrNone if succeed. - */ - virtual TInt RegisterChatListObserver( MIMCVEngineChatListObserver* aObserver ) = 0; - - /** - * Unregister observer for conversations added/deleted. - * @param aObserver Observer which is unregistered - * @return KErrNone if found and unregistered. - */ - virtual TInt UnregisterChatListObserver( MIMCVEngineChatListObserver* aObserver ) = 0; - - /** - * @see MIMCVEngineChatInterface - */ - virtual ~MIMCVEngineChatInterface() - { - - }; - - }; - -#endif // MIMCVENGINECHATINTERFACE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginechatlistobserver.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginechatlistobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2008-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: Observer interface to handle chat container changes. -* -*/ - - -#ifndef __MIMCVEngineChatListObserverOBSERVER_H__ -#define __MIMCVEngineChatListObserverOBSERVER_H__ - -// INCLUDES -#include - -// FORWARD CLASS DECLERATIONS -class MIMCVEngineMessageReadInterface; - -// CLASS DECLARATION - - -enum TChatListEventType - { - EChatItemAdded, - EChatItemDeleted, - EChatAllItemDeleted, - EEventNotSpecified - }; -/** - * Observer interface to handle messages container changes. - * - * @lib imcvuiengine.dll - * @since 5.0 - */ -class MIMCVEngineChatListObserver - { - - public: // Interface - - /** - * Handle events. - * @param aEvent Event to handle. - * @param aContainerInfo, Container - */ - virtual void HandleChatListEvent( TInt aServiceId, TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* aContainerInfo - ) = 0; - - protected: // For protection. - - /** - * Destructor - */ - virtual ~MIMCVEngineChatListObserver(){} - }; - -#endif // __MIMCVEngineChatListObserverOBSERVER_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginefactory.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginefactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* Copyright (c) 2008-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: service engine factory class interface -* -*/ - -#ifndef MIMCVENGINEFACTORY_H -#define MIMCVENGINEFACTORY_H -#include - -//FORWARD DECLARATION -class CIMCVEngine; -class MIMCVEngineConnectionHandler; -class MIMCVEngineOpenChatsObserver; -class MIMCVEngineServiceChangeObserver; -//CLASS DECLARATION -/** - * - * This class list the M-Class for Engine factory - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -class MIMCVEngineFactory - { - -public: - - /** - * return the engine instance for aServiceId. - */ - virtual CIMCVEngine& GetServiceEngineL( TInt aServiceId ) = 0 ; - - /** - * find and release the engine instance for aServiceId. - */ - virtual void ReleaseServiceEngine( TInt aServiceId ) = 0 ; - - - /** - * GetDisplayNameL: returns the Identification - * @param aIndex - Index of the item for which Identification - * is required - * @return TPtrC - Identification - */ - virtual TPtrC GetDisplayNameL(TInt aIndex) const = 0; - - - /** - * GetTargetIdL: returns the Conversation Party ID - * @param aIndex - Index of the item - * @return Conversation Party ID - */ - virtual const TDesC& GetTargetIdL(TInt aIndex) const = 0; - - - /** - * Count: Returns the number of items - * @return TInt - Total number of openchats item - */ - virtual TInt Count() const = 0; - - - /** - * SetActiveItemL: Sets the item as the current active one - * @param aIndex - Index of the item - * @return void - */ - virtual void SetActiveItemL( const TInt aIndex ) = 0; - - - /** - * GetActiveItem: Gets the current active conversation - * @return Active Conversation Party Id - */ - virtual const TDesC& GetActiveItemL() const = 0; - - /** - * Returns the pending messages status of the contact item - * @param aIndex - Index of the item - * @return bool: true if the conversation item has pending messages - * else return false - */ - virtual TBool IsMsgPendingL( const TInt aIndex ) const = 0; - - /** - * Find the index of the item in the Conversation List - * @param aItem - Conversation Party Id - * @return aIndex - Index of the item - */ - virtual TInt FindIndexL(const TDesC& aItem) = 0; - - virtual void ResetL() = 0; - - /** - * @see MVIMPSTEngineFactory - */ - virtual void RegisterOpenChatObserver(MIMCVEngineOpenChatsObserver* aChatObserver) = 0 ; - /** - * @see MVIMPSTEngineFactory - */ - virtual void UnRegisterOpenChatObserver() = 0 ; - - - virtual TInt GetActiveServiceId() = 0 ; - /* - * return all availabe service engines - */ - virtual RPointerArray& GetServiceEngines() = 0; - /** - * @see MVIMPSTEngineFactory - */ - virtual void RegisterServiceObserver(MIMCVEngineServiceChangeObserver* aServiceObserver) = 0 ; - /** - * @see MVIMPSTEngineFactory - */ - virtual void UnRegisterServiceObserver() = 0 ; - - /** - * ~CVIMPSTEngineFactory - * dont call delete - */ - virtual ~MIMCVEngineFactory() - { - - } - - }; - -#endif //MIMCVENGINEFACTORY_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessage.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessage.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,238 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message interface -* -*/ - - -#ifndef MIMCVENGINEMESSAGE_H -#define MIMCVENGINEMESSAGE_H - -#include -#include - -// FORWARD CLASS DECLERATIONS -class MIMCVEngineMessageContainerInfo; -class TXIMPRequestId; -// MDesCArray must not be fwd declared, or compiling test code will break -// since it's a MACRO. hence the include to badesca.h - -// CLASS DECLARATION - -/** - * Interface for handling one message - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineMessage - { - public: // Definitions - - /** - * Different message types - */ - enum TMessageType - { - EMessagePTOP, - EMessageWhisper, - EMessageGroup, - EMessageSystem, - EMessageInvalid - }; - - /** - * System message enumerations. - */ - enum TSystemMessage - { - ESystemMessageNone, - ESystemMessageWelcome, - ESystemMessageNewUsers, - ESystemMessageTopicChanged, - ESystemMessagePrivatChanged, - ESystemMessageLeftUsers, - ESystemMessageDateChange - }; - - /** - * Direction of message. Coming or going or other. - */ - enum TMessagerType - { - EMessageSent, - EMessageReceived, - EMessageOther, - EMessageStarted - }; - - /** - * Different message content types - */ - enum TContentType - { - EContentText, - EContentPicture, - EContentOther, - EContentInvalid - }; - - /** - * Content processing states - */ - enum TContentProcessState - { - EContentNotProcessed = 0, - EContentNotSupported, - EContentNotSupportedDrm, - EContentCorrupted, - EBitmapDecoded, - EBitmapScaled, - EContentReady, - EContentDecoded, - EThumbnailReady - }; - - public: // General information - - /** - * Get timestamp when this message has been created. - * For prioritization of message deletion and timestamping - * chat messages - */ - virtual const TTime& TimeStamp() const = 0; - - /** - * @see MIMMessageBase - */ - virtual void SetTimeStamp(TTime aTime ) = 0 ; - - /** - * Message size in bytes. - * @return Size of message in bytes. - */ - virtual TInt SizeInBytes() const = 0; - - public: // Type of message - /** - * Type of message - * @return Type of message. EMessageGroup, EMessagePersonal, - * EMessageSystem - */ - virtual TMessageType MessageType() const = 0; - - /** - * Type of messager - * @return Type of message. EMessageFrom, EMessageTo, EMessageOther - */ - virtual TMessagerType MessagerType() const = 0; - - /** - * Type of content of message - * @return Type of message. EMessageText, EMessagePicture - */ - virtual TContentType ContentType() const = 0; - - /** - * Is message failed or not - * @return ETrue if is, EFalse if not. - */ - virtual TBool FailedMessage() const = 0; - - /** - * Returns the type of system message. - * @return type of system message or - * TSystemMessageNone if not system message - */ - virtual TSystemMessage SystemMessageType() = 0; - - /** - * Increase owner count. There can be multiply owners for one message. - * This method is for increasing the count. Every owner class - * must use also DecreaseOwnerCount. - */ - virtual void IncreaseOwnerCount() = 0; - - /** - * Decrease owner count. There can be multiply owners for one message. - * This method is for decreasing the count. Every owner class - * must have called IncreaseOwnerCount before calling this method. - * @return ETrue if owner can delete message. EFalse if not. - */ - virtual TBool DecreaseOwnerCount() = 0; - - - public: // Identification of message - /** - * Operation code of message. One way to identify message. - * @return Operation code of message. - */ - virtual TXIMPRequestId OperationCode() const = 0; - - /** - * Set operation code of message. - * @param aOpId, new operation code for message - */ - virtual void SetOperationCode(TXIMPRequestId aRequestId ) = 0; - - - - /** - * Part of container identifier which contains this message - * @return User id to identify container which contains this message - */ - //virtual const TDesC& UserId() const = 0; - - - /** - * Set containerinfo of message. Needed for identifying of message. - * @param aInfo. ContainerInfo. - */ - virtual void SetContainerInfo( MIMCVEngineMessageContainerInfo* aInfo ) = 0; - - public: // Content of message - - /** - * Recipient of message. - * @return Recipient of message. To whom the message is sent. - */ - virtual const TDesC& Recipient() const = 0; - - /** - * Sender of message - * @return Sender of message. To who has sent the message. - */ - virtual const TDesC& Sender() const = 0; - - - /** - * Textual content of message - * @return Textual content. - */ - virtual const TDesC& Text() const = 0; - - - - public: - - /** - * Virtual destructor - */ - virtual ~MIMCVEngineMessage(){} - }; - -#endif // MIMCVENGINEMESSAGE_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagecontainer.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagecontainer.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message container interface -* -*/ - - -#ifndef MIMCVENGINEMESSAGECONTAINER_H -#define MIMCVENGINEMESSAGECONTAINER_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class MIMCVEngineMessage; - -// CLASS DECLARATION - -/** -* UI side message container interface -* -* imcvuiapp.exe -* @since Series 60 3.0 -*/ -class MIMCVEngineMessageContainer - { - public: // New functions - - /** - * Add new message to container - * @param aMessage Message - */ - virtual void AddMessageL( MIMCVEngineMessage& aMessage ) = 0; - - - - /** - * Insert message to container start. - * @since S60 v3.2 - * @param aMessage Message to be inserted. - */ - virtual void InsertMessageL( MIMCVEngineMessage& aMessage ) = 0; - - protected: - - /** - * Destructor. - */ - virtual ~MIMCVEngineMessageContainer() {}; - - }; - -#endif // MIMCVENGINEMESSAGECONTAINER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagecontainerinfo.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagecontainerinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message container info interface -* -*/ - - -#ifndef __MIMCVENGINEMESSAGECONTAINERINFO_H__ -#define __MIMCVENGINEMESSAGECONTAINERINFO_H__ - -// FORWARD CLASS DECLERATIONS - -// CLASS DECLARATION - -/** - * Message container information provider - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineMessageContainerInfo - { - - public: // Interface - - - /** - * Part of Id of container - * @return Conversation Party id of container. - */ - virtual const TDesC& Target() const = 0; - - /** - * Returns target id to be used for - * comparisons. - * @since S60 v3.1 - * @return Target id. - */ - virtual const TDesC& ComparableTarget() const = 0; - - - protected: // For protection. - - /** - * Destructor - */ - virtual ~MIMCVEngineMessageContainerInfo(){} - }; - -#endif // __MIMCVENGINEMESSAGECONTAINERINFO_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagecreator.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagecreator.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message creater interface -* -*/ - - -#ifndef __MIMCVENGINEMESSAGECREATOR_H__ -#define __MIMCVENGINEMESSAGECREATOR_H__ - -#include -#include - -#include "mimcvenginemessage.h" -// FORWARD CLASS DECLERATIONS - -// CLASS DECLARATION - -/** - * Interface for creating message - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineMessageCreator - { - public: // Definitions - - /** - * SMessageData - * Struct to contain data of message - */ - struct SMessageData - { - TInt iVersion; - const TDesC& iSenderId; - const TDesC& iTargetId; - const TDesC& iText; - const MIMCVEngineMessage::TContentType iContentType; - MIMCVEngineMessage::TMessagerType iMessager; - }; - - public: - - /** - * Create message. - * @param aData, Structure to contain data for message. - * @return New message. - */ - virtual MIMCVEngineMessage* CreateMessageL( const SMessageData& aData ) const = 0; - - /** - * Create failed text message. - * @param MIMCVEngineMessage, which has been failed to deliver - * @return new MIMCVEngineMessage. Ownership is passed to caller - */ - virtual MIMCVEngineMessage* CreateFailedMessageL( - const MIMCVEngineMessage* pSource ) const = 0 ; - - /** - * Virtual destructor - */ - virtual ~MIMCVEngineMessageCreator(){} - }; - -/// Current version of message creator messages. -const TInt KMessageDataVersion = 0; - -#endif // __MIMCVENGINEMESSAGECREATOR_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagehandler.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message handler interface -* -*/ - -#ifndef MIMCVENGINEMESSAGEHANDLER_H -#define MIMCVENGINEMESSAGEHANDLER_H - -// INCLUDES -#include -#include "mimcvenginemessagehandlerobserver.h" -// FORWARD CLASS DECLERATIONS -class MIMCVEngineMessage; -class MIMCVEngineMessageCreator; - -// CLASS DECLARATION - -/** - * Observer interface to handle message container changes. - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineMessageHandler - { - - public: // Definitions - - /** - * @see message creator class - */ - virtual MIMCVEngineMessageCreator& MessageCreator() const = 0 ; - - /** SendMessageL - * api to send the message to below layer - * @param aMessage, message to be send - */ - virtual void SendMessageL(MIMCVEngineMessage& aMessage) = 0 ; - - /** append to cache - * api to send the message to below layer - * @param aBuddyId, aBuddyId to be saved - * @param aTextMessage, message to be saved - */ - virtual void AppendToCacheL(const TDesC& aBuddyId , const TDesC& aTextMessage ) = 0 ; - - - /** - * @see MIMCVEngineMessageHandler - */ - virtual void StartNewConversationL(const TDesC& aRecipientId )= 0; - - - /** - * @see MIMCVEngineMessageHandler - */ - virtual TInt CloseConversationL(const TDesC& aBuddyId) = 0 ; - - - /** - * @see MIMCVEngineMessageHandler - */ - virtual void CloseAllConversationL() = 0 ; - - - /** - * @see MIMCVEngineMessageHandler - */ - virtual TInt DeactivateConversationL() = 0; - - virtual void UnSubscribePresenceL(const TDesC& aRecipientId) = 0; - /** - * @see MIMCVEngineMessageHandler - */ - virtual void SubscribePresenceL(const TDesC& aWVID) = 0 ; - - /** - * @see MIMCVEngineMessageHandler - */ - virtual void SetObserver( MIMCVEngineMessageHandlerObserver* aObserver ) = 0; - - /** - * @see MIMCVEngineMessageHandler - */ - virtual void RemoveObserver() = 0; - - /** - * @see MIMCVEngineMessageHandler - */ - virtual TIMCVOnlineStatus GetPresenceStatus() = 0 ; - - virtual TInt ServiceId() const = 0 ; - - public: // For protection. - - /** - * Destructor for protection - */ - virtual ~MIMCVEngineMessageHandler(){} - }; - -#endif // MIMCVENGINEMESSAGEHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagehandlerobserver.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagehandlerobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2008-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: message handler observer -* -*/ - -#ifndef MIMCVENGINEMESSAGEHANDLEROBSERVER_H -#define MIMCVENGINEMESSAGEHANDLEROBSERVER_H - -// INCLUDES -#include -#include -#include "imcvuiliterals.h" -#include "mimcvenginemessage.h" -// FORWARD CLASS DECLERATIONS - - -// CLASS DECLARATION -/** - * presence handler interface - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineMessageHandlerObserver - { - public: - - /** - * @see handle the presence change notification - * to handle the connection lost - */ - virtual void HandlePresenceChangedL(TInt aServiceId, const TDesC& aBuddyId ) = 0 ; - - /** - * Handle message send operation completion. - * @param aResult result to handle. - */ - virtual void HandleOperationCompletdL(TInt aserviceId, MIMCVEngineMessage::TMessagerType aType , TInt aResult) = 0 ; - - /** - * @see HandleConnectionTerminatedL - * to handle the connection lost - * @param aReason, reason report - */ - virtual void HandleConnectionEventL(TInt aServiceId, TIMCVConnectionState aState, TInt aReason ) = 0 ; - - protected: // For protection. - - /** - * Destructor for protection - */ - virtual ~MIMCVEngineMessageHandlerObserver(){} - -}; -#endif // MIMCVENGINEHANDLEROBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessageobserver.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessageobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: messge observer interface -* -*/ - - -#ifndef __MIMCVENGINEMESSAGEOBSERVER_H__ -#define __MIMCVENGINEMESSAGEOBSERVER_H__ - -// INCLUDES -#include - -// FORWARD CLASS DECLERATIONS - -// CLASS DECLARATION - -/** - * Observer interface to handle message container changes. - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineMessageObserver - { - - public: // Definitions - - /** - * Events for observer to handle. - */ - enum TMessageEventType - { - ENewMessage, - EMessageChanged, - EMessageDeleted, - EChatDeleted - }; - - public: // Interface - - /** - * Handle events. - * @param aEvent Event to handle. - * @param aIndex, Index of message which is affected by event. - */ - virtual void HandleMessageEvent( TMessageEventType aEvent, TInt aIndex = -1 ) = 0; - - - - protected: // For protection. - - /** - * Destructor for protection - */ - virtual ~MIMCVEngineMessageObserver(){} - }; - -#endif // __MIMCVENGINEMESSAGEOBSERVER_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagesreadinterface.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessagesreadinterface.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,194 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message read interface -* -*/ - -#ifndef __MIMCVENGINEMESSAGESREADINTERFACE_H__ -#define __MIMCVENGINEMESSAGESREADINTERFACE_H__ - -#include - -// FORWARD CLASS DECLERATIONS -class MIMCVEngineMessage; -class MIMCVEngineMessageObserver; -class MIMCVEngineMessageContainerInfo; - -// CLASS DECLARATION - -/** - * Interface for getting access to messages. - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineMessageReadInterface - { - - public: // Definitions - - /** - * How many messages we want to change from unread to read. - */ - enum TReadType - { - EReadAll, - EReadAmount, - EReadOne, - EReadInvalid - }; - - /** - * Type of container - */ - enum TContainerType - { - ENoneContainer, - EChatContainer, - ESendContainer - }; - - /** - * - */ - enum TUnreadFilter - { - EUnreadAll, - EUnreadReceived - }; - - public: // Interface - - /** - * Get count of unread messages. - * @param aUnreadFilter Show only received messages as unread or all. - * @return Amount of unread messages. - */ - virtual TInt UnreadCount( TUnreadFilter aUnreadFilter = EUnreadAll ) const = 0; - - /** - * Get count of readable messages. - * @return Amount of readable messages. Does not include unread messages. - */ - virtual TInt MessageCount() const = 0; - - /** - * Get stores the previously typed message before switching the tab - * - */ - virtual void StoreEditerMessageL(const TDesC& aEditorMessage ) = 0; - - /** - * Gets the previously stored message - * @return the message - */ - virtual const TDesC& GetEditerMessage() = 0; - - - /** - * Move unread messages to read. - * @param aReadType Type of read. EReadAll, EReadAmount, EReadOne - * @param aReadAmount Amount of messages to move from unread to read. - * Default 0, Needed if TReadAmount is used. - */ - virtual void Read( TReadType aReadType, TInt aReadAmount = 0 ) = 0; - - /** - * Get message. - * @param aIndex, Index of message in messagearray. - * @return Reference to message. - */ - virtual MIMCVEngineMessage& Message( TInt aIndex ) const = 0; - - /** - * Get next unread message - * @return Reference to next unread message. - */ - virtual MIMCVEngineMessage& ReadNextUnread() = 0; - - /** - * Read one unread message from index aIndex. - * @since S60 v3.2 - * @param aIndex Index to wanted message. - * @return Reference to last unread message. - */ - virtual MIMCVEngineMessage& ReadUnreadFromIndex( TInt aIndex ) = 0; - - /** - * Set observer for observing changes in messages container. - * Observer can handle different situations like e.g. - * containers destruction, messages arrival etc. - * @param aObserver Observer class to get notifications. - * Uninstall observer with passing NULL as parameter. - */ - virtual void SetObserver( MIMCVEngineMessageObserver* aObserver ) = 0; - - /** - * Get name of chat. - * @return Name of chat. - */ - virtual TPtrC Name() const = 0; - - /** - * Delete message in index. - * @param aIndex, Index of message to be deleted. - * @param aFreeMemory, ETrue if message should be deleted. EFalse if ownership of message - * is transferred to caller. Remember to achieve - * @return Pointer to message if not ownership is tranferred to caller. NULL if not. - */ - virtual void DeleteMessage( TInt aIndex ) = 0; - /** - * Id information of message container. - * @return Container information. - */ - virtual MIMCVEngineMessageContainerInfo& TargetId() = 0; - - /** - * Lock/unlock messages from deletion - * @param aLocked, ETrue locks, EFalse unlocks. - */ - virtual void Lock( TBool aLocked ) = 0; - - /** - * Sets whether the Conversation is Currently Active in UI - * @param aActiveChat, ETrue ActiveConversation, EFalse InActiveConversation. - */ - virtual void SetActive( TBool aActiveChat ) = 0; - - /** - * Gets whether the Conversation is Currently Active in UI - * @return ETrue ActiveConversation in UI, EFalse InActiveConversation. - */ - virtual TBool IsActive() = 0; - - /* - * return contact link. - */ - virtual TPtrC8 ContactLink() const = 0; - - /** - * returns displayname - */ - virtual TDesC DisplayName() const = 0; - - protected: // For protection - /** - * Destructor for protection - */ - virtual ~MIMCVEngineMessageReadInterface(){} - }; - -#endif // __MIMCVENGINEMESSAGESREADINTERFACE_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessageswriteinterface.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginemessageswriteinterface.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Interface for write access to messages. -* -*/ - -#ifndef __MIMCVENGINEMESSAGESWRITEINTERFACE_H__ -#define __MIMCVENGINEMESSAGESWRITEINTERFACE_H__ - -// FORWARD CLASS DECLERATIONS -class MIMCVEngineMessage; - -// CLASS DECLARATION - -/** - * Interface for write access to messages. - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineMessageWriteInterface - { - public: // Interface - - /** - * Append one message to container. - * @param aMessage. New message to container. - * @param aSharedOwnerShip EFalse if ownership is tranferred, ETrue if shared. - */ - virtual void AppendL( MIMCVEngineMessage* aMessage, TBool aSharedOwnership = EFalse ) = 0; - - - - - /** - * Get the time and date of the last message written to this interface, - * Time is used to determine the need of datestamp. - * @return Date and time of the last message. if there are no - * previous messages, then returns Time::NullTTime() - */ - virtual TTime Time() = 0; - - - /** - * sets the display name - * @param aDispalyName. updated display name - */ - virtual void SetNameL( const TDesC& aDispalyName ) = 0; - - /** - * sets the contactlink - * @param aContactLink. updated contactlink - */ - virtual void SetLinkL(const TDesC8& aContactLink) = 0; - /** - * Virtual destructor - */ - virtual ~MIMCVEngineMessageWriteInterface(){} - }; - -#endif // __MIMCVENGINEMESSAGESWRITEINTERFACE_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginenewmessagehandler.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginenewmessagehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: interface for message handling -* -*/ - -#ifndef MIMCVENGINESERVICESESSIONHANDLER_H -#define MIMCVENGINESERVICESESSIONHANDLER_H - -// INCLUDES -#include -#include -#include - -#include "imcvuiliterals.h" - -// CLASS DECLARATION -class TXIMPRequestId; -/** - * Observer interface to handle message container changes. - * - * @lib imcvengine.dll - * @since 5.0 - */ -// FORWARD CLASS DECLERATIONS - -class MIMCVEngineServiceSessionHandler - { - -public: - - /** - * @see HandleDeliveryReportL - * to handle the new message delivery report - * @param aResultError, delivery report - * @param aText, msg to send - */ - virtual void HandleDeliveryReportL(TXIMPRequestId aOperatioCode, TInt aResult ) = 0 ; - - /** - * @see HandleConnectionTerminatedL - * to handle the connection lost - * @param aReason, reason report - */ - virtual void HandleConnectionEventL( TIMCVConnectionState aState, TInt aReason ) = 0 ; - -public: // For protection. - - /** - * Destructor for protection - */ - virtual ~MIMCVEngineServiceSessionHandler(){} - }; - -/** - * Observer interface to handle message container changes. - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineServiceSessionObserver - { - - public: - /** - * register MIMCVEngineServiceSessionHandler class to listen the event - */ - virtual void RegisterObserver(MIMCVEngineServiceSessionHandler* aObserver) = 0 ; - /** - * unregister MIMCVEngineServiceSessionHandler class to avoid the event - */ - virtual void UnRegisterObserver(MIMCVEngineServiceSessionHandler* aObserver) = 0 ; - - public: // For protection. - - /** - * Destructor for protection - */ - virtual ~MIMCVEngineServiceSessionObserver(){} - }; -#endif // MIMCVENGINESERVICESESSIONHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvenginenewmsgobserver.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvenginenewmsgobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: chat observer interface -* -*/ - - -#ifndef __MIMCVENGINECHATOBSERVER_H__ -#define __MIMCVENGINECHATOBSERVER_H__ - -// INCLUDES -#include - -// FORWARD CLASS DECLERATIONS -class MIMCVEngineMessage; - -// CLASS DECLARATION - -/** - * Observer interface to handle messages container changes. - * - * @lib imcvengine.dll - * @since 5.0 - */ -class MIMCVEngineNewMsgObserver - { - - public: // Definitions - - /** - * Events for observer to handle. - */ - enum TChatEventType - { - EUnreadCountChanged, // Happens with new message and when messages are read. - EMemoryLow, - EEventNotSpecified - }; - - public: // Interface - - /** - * Handle events. - * @param aEvent Event to handle. - * @param aMessage, Event occurred because of message - */ - virtual void HandleChatEventL( TChatEventType aEvent, MIMCVEngineMessage* aMessage = NULL ) = 0; - - protected: // For protection. - - /** - * Destructor - */ - virtual ~MIMCVEngineNewMsgObserver(){} - }; - -#endif // __MIMCVENGINECHATOBSERVER_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvengineopenchats.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvengineopenchats.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2008-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: Open Conversations -* -*/ - - - -#ifndef MIMCVENGINEOPENCHATS_H_H -#define MIMCVENGINEOPENCHATS_H_H - - -//forward declarations - - -enum TOpenChatsEventType - { - EUnReadCountChanged, - ENewChat, - EChatClosed, - EChatAllClosed, - EReadCountChanged - }; - - -//Observer Class -class MIMCVEngineOpenChatsObserver - { - public: - - /** - * Handle Chnage events for Open Conversations - * @param aIndex Index of the Item Change. - * @param aChangeType, Change Type listed above - */ - virtual void HandleChangeL(TInt aServiceId, TInt aIndex, TOpenChatsEventType aChangeType) = 0; - - /*set the status msg.When uses is in conversation one user and receive - *msg from some other user. - *@param aIndex Index of the Item which sent message. - */ - virtual void SetStatusMsgL(TInt aServiceId, TInt aIndex,const TDesC & aMsg)= 0; - - /** - * Virtual destructor - */ - virtual ~MIMCVEngineOpenChatsObserver() - { - - }; - }; - - - -// CLASS DECLARATION - -/** - * Interface for Open Conversations - * - * @lib imcvuiengine.dll - * @since 5.0 - */ -class MIMCVEngineOpenChats - { - - public: - - /** - * GetDisplayNameL: returns the Identification - * @param aIndex - Index of the item for which Identification - * is required - * @return TPtrC - Identification - */ - virtual TPtrC GetDisplayNameL(TInt aIndex) const = 0; - - - /** - * GetTargetIdL: returns the Conversation Party ID - * @param aIndex - Index of the item - * @return Conversation Party ID - */ - virtual const TDesC& GetTargetIdL(TInt aIndex) const = 0; - - - /** - * Count: Returns the number of items - * @return TInt - Total number of openchats item - */ - virtual TInt Count() const = 0; - - - /** - * SetActiveItemL: Sets the item as the current active one - * @param aIndex - Index of the item - * @return void - */ - virtual void SetActiveItemL( const TInt aIndex ) = 0; - - - /** - * GetActiveItem: Gets the current active conversation - * @return Active Conversation Party Id - */ - virtual const TDesC& GetActiveItem() const = 0; - - /** - * Returns the pending messages status of the contact item - * @param aIndex - Index of the item - * @return bool: true if the conversation item has pending messages - * else return false - */ - virtual TBool IsMsgPendingL( const TInt aIndex ) const = 0; - - /** - * Find the index of the item in the Conversation List - * @param aItem - Conversation Party Id - * @return aIndex - Index of the item - */ - virtual TInt FindIndexL(const TDesC& aItem) = 0; - - /** - * Register observer for chat events. Remember to unregister - * when not needed - * @param aObserver Observer which is registered. - */ - virtual void RegisterObserver(MIMCVEngineOpenChatsObserver* aChatObserver) = 0; - - - /** - * Unregister observer for chat events. - * - */ - virtual void UnRegisterObserver() = 0; - - virtual void ResetL() = 0; - - - /** - * Virtual destructor - */ - virtual ~MIMCVEngineOpenChats() - { - }; - - - }; - -#endif // MIMCVENGINEOPENCHATS_H_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/inc/mimcvngineservicechangeobserver.h --- a/imstutils/imconversationview/imcvuiengine/inc/mimcvngineservicechangeobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2008-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: service change observer -* -*/ - - -#ifndef MIMCVENGINESERVICECHANGEOBSERVER_H -#define MIMCVENGINESERVICECHANGEOBSERVER_H - -#include "mimcvenginechatlistobserver.h" - -class MIMCVEngineMessageReadInterface; - -/** - * Observer class for getting service status change - * - * @lib imcvengine.lib - */ -class MIMCVEngineServiceChangeObserver - { - -public: - - /* - * new service has been installed - */ - virtual void HandleNewServiceL( TInt aServiceId ) = 0 ; - /* - * service has been deleted - */ - virtual void HandleServiceDeletedL( TInt aServiceId )= 0 ; - - /** - * @see handle the presence change notification - * to handle the connection lost - */ - virtual void HandlePresenceChangedL(TInt aServiceId, const TDesC& aBuddyId ) = 0 ; - - /** - * Handle message send operation completion. - * @param aResult result to handle. - */ - virtual void HandleOperationCompletdL(TInt aserviceId, MIMCVEngineMessage::TMessagerType aType , TInt aResult) = 0 ; - - /** - * @see HandleConnectionTerminatedL - * to handle the connection lost - * @param aReason, reason report - */ - virtual void HandleConnectionEventL(TInt aServiceId, TIMCVConnectionState aState, TInt aReason ) = 0 ; - - - /** - * Handle events. - * @param aEvent Event to handle. - * @param aContainerInfo, Container - */ - virtual void HandleChatListEvent(TInt aServiceId, TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* aContainerInfo - ) = 0; - - -protected: - - virtual ~MIMCVEngineServiceChangeObserver() - { - - } - - }; - - - -#endif // MIMCVENGINESERVICECHANGEOBSERVER_H diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvengine.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvengine.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,867 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: engine class -* -*/ - -// INCLUDE FILES -#include "cimcvengine.h" - -#include "cimcvenginechatcontainer.h" -#include "cimcvenginemessagehandler.h" -#include "cimcvenginemessagecreator.h" -#include -#include -#include -//ximp includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// local includes -#include "cimcvenginecontextobserver.h" -#include "cimcvenginechatcontainer.h" -#include "imcvlogger.h" -#include "imcvuiliterals.h" -//settings -#include -#include -#include - -#include "cimcvengineopenchats.h" -#include "cimcvenginecchhandler.h" -#include "conversations.h" - -#include -//branding related header files -#include -#include -#include -#include -#include - -#define KMAX_SMILEY_COUNT 20 - -// ================= MEMBER FUNCTIONS ======================= - -// Two-phased constructor. - CIMCVEngine* CIMCVEngine::NewL(TInt aServiceId, MIMCVEngineMessageCreator& aMessageCreater, - CBSFactory& aBrandingFactory ) - { - IM_CV_LOGS(TXT("CIMCVAppView::CIMCVEngine::NewL() start") ); - CIMCVEngine* self = new ( ELeave ) CIMCVEngine(aServiceId,aBrandingFactory); - - CleanupStack::PushL( self ); - self->ConstructL(aMessageCreater ); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVAppView::CIMCVEngine::NewL() end") ); - return self; - } - - -// --------------------------------------------------------- -// CIMCVEngine::~CIMCVEngine() -// Note the destruction order of objects. -// --------------------------------------------------------- -// - CIMCVEngine::~CIMCVEngine() - { - IM_CV_LOGS(TXT("CIMCVEngine destructor START") ); - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - Cancel(); - delete iCCHHandler; - iAcceptedEventTypes.Reset(); - iAcceptedEventTypes.Close(); - - delete iOwnUserId; - delete iServiceName; - delete iBrandId; - - if(iPresenceContext) - { - iPresenceContext->UnregisterObserver( *iContextEventObserver ); - delete iPresenceContext; - iPresenceContext = NULL; - } - if(iClient) - { - delete iClient; - iClient = NULL; - } - if(iContextEventObserver) - { - iContextEventObserver->UnRegisterObserver(iMessageHandler); - delete iContextEventObserver; - iContextEventObserver = NULL; - } - if(iMessageHandler) - { - delete iMessageHandler; - iMessageHandler = NULL; - } - delete iChatInterface; - - if( iBrandingAccess ) - { - iBrandingAccess->Close(); - iBrandingAccess = NULL; - } - IM_CV_LOGS(TXT("CIMCVEngine destructor END") ); - -#if 0 - if( iSmileyArrayOwned ) - { - IM_CV_LOGS(TXT("CIMCVEngine::deleting icon STRING array owned") ); - iSmileyArray.ResetAndDestroy(); - } - IM_CV_LOGS(TXT("CIMCVEngine::RESETTING icon STRING array ") ); - iSmileyArray.Reset(); - - if( iSmileyDlgIconArrayOwned ) - { - IM_CV_LOGS(TXT("CIMCVEngine::deleting icon array owned") ); - iSmileyDlgIconArray.ResetAndDestroy(); - } - IM_CV_LOGS(TXT("CIMCVEngine::deleting icon array ") ); - iSmileyDlgIconArray.Reset(); -#endif - IM_CV_LOGS(TXT("CIMCVAppViewContainer::SendMessageL() start") ); - - } - -// --------------------------------------------------------- -// CIMCVEngine::CIMCVEngine() -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------- -// -CIMCVEngine::CIMCVEngine(TInt aServiceId,CBSFactory& aBrandingFactory) : -CActive( CActive::EPriorityStandard ), -iServiceId( aServiceId ), -iBrandingFactory( aBrandingFactory ), -iSmileyArrayOwned( ETrue ), -iSmileyDlgIconArrayOwned( ETrue ) - { - iOwnUserId = NULL; - CActiveScheduler::Add( this ); - } -// --------------------------------------------------------- -// CIMCVEngine::ConstructL() -// Symbian OS default constructor can leave. -// --------------------------------------------------------- -// -void CIMCVEngine::ConstructL(MIMCVEngineMessageCreator& aMessageCreater) - { - IM_CV_LOGS(TXT("CIMCVAppView::CIMCVEngine::ConstructL() start") ); - iClient = MXIMPClient::NewClientL(); - //Create new sink to receive ximp context events - iContextEventObserver = CIMCVEngineContextObserver::NewL(); - - iChatInterface = CIMCVEngineChatContainer::NewL( iServiceId ); - //Read the logged in status from CCH True/False - TBool isCchEnebled = EFalse; - iCCHHandler = CIMCVEngineCchHandler::NewL(iServiceId, *this); - isCchEnebled = iCCHHandler->IsServiceLoggedIn(); - - // Read User Id from CCH - iOwnUserId = HBufC::NewL(KMAXUSERIDLENGTH); - TPtr owndataPtr = iOwnUserId->Des(); - GetUserIdL(owndataPtr ) ; - - //Read Servicename from CCH - iServiceName = HBufC::NewL(KMAXUSERIDLENGTH); - TPtr srvNamePtr( iServiceName->Des() ); - GetServiceNameL( iServiceId, srvNamePtr ); - - //Read the service state from CCH - TCCHSubserviceState serviceState = ECCHUninitialized; - TInt error = iCCHHandler->GetServiceState( - serviceState ); - - if ( ECCHEnabled == serviceState || isCchEnebled ) - { - // register this to prsence context - LoginL(); - } - // Read the BrandId from SPsettings - iBrandId = HBufC8::NewL( KVIMPSTUISPSMaxPropertyLength ); - TPtr8 brandidPtr(iBrandId->Des()); - GetBrandIdL( iServiceId, brandidPtr ); - - //Read BrandLanguage id from SPsettings - iLanguageId = PropertyBrandLanguageL(iServiceId); - - ConstructBrandL(); - - if ( ECCHEnabled == serviceState || isCchEnebled ) - { - iMessageHandler = CIMCVEngineMessageHandler::NewL( *iChatInterface, - aMessageCreater, - iPresenceContext, - iServiceId, - owndataPtr ); - } - else - { - iMessageHandler = CIMCVEngineMessageHandler::NewL( *iChatInterface, - aMessageCreater, - NULL, - iServiceId, - owndataPtr ); - - } - - iContextEventObserver->RegisterObserver(iMessageHandler); - IM_CV_LOGS(TXT("CIMCVAppView::CIMCVEngine::ConstructL() end") ); - } - -// --------------------------------------------------------- -// CIMCVEngine::ConstructBrandL() -// --------------------------------------------------------- -// -void CIMCVEngine::ConstructBrandL() - { - if(iBrandingAccess) - { - iBrandingAccess->Close(); - iBrandingAccess = NULL; - } - iBrandingAccess = iBrandingFactory.CreateAccessL( GetBrandId(), (TLanguage)GetLanguageId() ); - if(iBrandingAccess) - { - TInt totalCount = iBrandingAccess->GetIntL(KSmileycount); - - // Restricting the maximum number of smileys to KMAX_SMILEY_COUNT. - if( totalCount > KMAX_SMILEY_COUNT ) - totalCount = KMAX_SMILEY_COUNT; - HBufC* allSmileyString = iBrandingAccess->GetTextL(KSmileytext); - CleanupStack::PushL(allSmileyString); - allSmileyString->Des().Delete(0, 1); - allSmileyString->Des().Delete(((allSmileyString->Length())-1), 2); - ParseAllSmileyStringL(totalCount, *allSmileyString); - CleanupStack::PopAndDestroy(allSmileyString); - - TInt iconCount = iSmileyArray.Count(); - CGulIcon* icon = NULL; - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - HBufC* iconString = NULL; - TInt err = KErrNotFound; - for( TInt index = 0; index< iconCount; index++ ) - { - iconString = iSmileyArray[index]; - TPtrC iconStringPtr = iconString->Des(); - TBuf8<16> aUtf8; // - CnvUtfConverter::ConvertFromUnicodeToUtf8(aUtf8, iconStringPtr); - iBrandingAccess->GetBitmapL(aUtf8, bitmap, mask ); - CleanupStack::PushL( bitmap ); - CleanupStack::PushL( mask ); - icon = CGulIcon::NewL( bitmap, mask ); - CleanupStack::Pop( 2 ); // bitmap ,mask - - err = iSmileyDlgIconArray.Append( icon ); - - if( err < 0) - { - delete icon; - icon = NULL; - } - } - } - } - -// --------------------------------------------------------- -// CIMCVEngine::GetSmileStringArray() -// --------------------------------------------------------- -// -EXPORT_C RPointerArray CIMCVEngine::GetSmileStringArray() - { - iSmileyArrayOwned = EFalse; - return iSmileyArray;// ownership transfered - } - -// --------------------------------------------------------- -// CIMCVEngine::ParseAllSmileyStringL() -// --------------------------------------------------------- -// -EXPORT_C RPointerArray CIMCVEngine::GetSmileyIconArray( ) - { - iSmileyDlgIconArrayOwned = EFalse; - return iSmileyDlgIconArray; // ownership transfered - } -// --------------------------------------------------------- -// CIMCVEngine::ParseAllSmileyStringL() -// --------------------------------------------------------- -// -void CIMCVEngine::ParseAllSmileyStringL(TInt aTotalCount , const TDesC& aAllSmileyString) - { - TInt location = KErrNotFound; - HBufC* string = aAllSmileyString.AllocLC(); - TPtr mainBufferPtr = string->Des(); - //make sure everything is fresh - iSmileyArray.ResetAndDestroy(); - for(TInt i=0; iGetBitmapL(aIconid, bitmap, mask ); - CleanupStack::PushL( bitmap ); - CleanupStack::PushL( mask ); - icon = CGulIcon::NewL( bitmap, mask ); - CleanupStack::Pop( 2 ); // bitmap ,mask - return icon; - } -// --------------------------------------------------------- -// CIMCVEngine::CreateConnectionL() -// --------------------------------------------------------- -// -void CIMCVEngine::CreateConnectionL() - { - iPresenceContext = iClient->NewPresenceContextLC(); - // ignore code scanner warning, it gives panic - CleanupStack::Pop();// because of LC method - // Read the ximpfw adaptation uid from SPsettings - TInt protocolUidValue = iCCHHandler->GetAdapterUidL(); ; - // filter the event from ximpfw ,interested only login and request complete - iAcceptedEventTypes.Reset(); - iAcceptedEventTypes.AppendL( MXIMPRequestCompleteEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MXIMPContextStateEvent::KInterfaceId ); - - TArray< TInt32 > eventFilterArray = iAcceptedEventTypes.Array(); - // register this to prsence context - iPresenceContext->RegisterObserverL( *iContextEventObserver, &eventFilterArray ); - TUid protocolUid =TUid::Uid( protocolUidValue ); - iContextEventObserver->GetConnectedSessionL(*iPresenceContext,iServiceId, protocolUid ); - } -// --------------------------------------------------------- -// CIMCVEngine::ChatInterface() -// --------------------------------------------------------- -// -EXPORT_C MIMCVEngineChatInterface& CIMCVEngine::ChatInterface() const - { - return *iChatInterface; - } - -// --------------------------------------------------------- -// CIMCVEngine::ChatInterface() -// --------------------------------------------------------- -// -EXPORT_C MIMCVEngineMessageHandler& CIMCVEngine::MessageHandler() const - { - return *iMessageHandler; - } - -// --------------------------------------------------------- -// CIMCVEngine::ReadyForShutdown() -// --------------------------------------------------------- -// -EXPORT_C TBool CIMCVEngine::ReadyForShutdown() - { - return !iContextEventObserver->IsLoggedIn(); - } - -// --------------------------------------------------------- -// CIMCVEngine::IsLoggedIn() -// --------------------------------------------------------- -// -EXPORT_C TBool CIMCVEngine::IsLoggedIn() const - { - return iContextEventObserver->IsLoggedIn(); - } - -// --------------------------------------------------------- -// CIMCVEngine::GetLoggedInUserId() -// --------------------------------------------------------- -// -EXPORT_C const TDesC& CIMCVEngine::GetLoggedInUserId() - { - if(iOwnUserId) - { - return *iOwnUserId; - } - return KNullDesC; - } -// --------------------------------------------------------- -// CIMCVEngine::ReleaseConnectionL() -// --------------------------------------------------------- -// -EXPORT_C void CIMCVEngine::ReleaseConnectionL() - { - if (iPresenceContext) - { - iContextEventObserver->ReleaseConnectionL(*iPresenceContext); - } - } - -// --------------------------------------------------------- -// CIMCVEngine::DeleteContextL() -// --------------------------------------------------------- -// -void CIMCVEngine::DeleteContextL() - { - if(iPresenceContext) - { - iPresenceContext->UnregisterObserver( *iContextEventObserver ); - delete iPresenceContext; - iPresenceContext = NULL; - - } - - } - -// --------------------------------------------------------- -// CIMCVEngine::CreateContextL() -// --------------------------------------------------------- -// -void CIMCVEngine::CreateContextL() - { - if(!iPresenceContext) - { - CreateConnectionL(); - iMessageHandler->ResetContextL(iPresenceContext); - } - } -// --------------------------------------------------------- -// CIMCVEngine::GetLoggedInUserId() -// --------------------------------------------------------- -// -EXPORT_C const TDesC8& CIMCVEngine::GetBrandId() - { - if(iBrandId) - { - return *iBrandId; - } - return KNullDesC8; - } -// --------------------------------------------------------- -// CIMCVEngine::GetLoggedInUserId() -// --------------------------------------------------------- -// -EXPORT_C TInt CIMCVEngine::GetLanguageId() - { - return iLanguageId; - } - - -// --------------------------------------------------------- -// CIMCVEngine::CCHHandler() -// --------------------------------------------------------- -// -EXPORT_C MIMCVEngineCchHandler& CIMCVEngine::CCHHandler() - { - return *iCCHHandler; - } - -// --------------------------------------------------------- -// CIMCVEngine::ServiceName() -// --------------------------------------------------------- -// -EXPORT_C const TDesC& CIMCVEngine::ServiceName() - { - return *iServiceName; - } - - -// --------------------------------------------------------- -// CIMCVEngine::GetLoggedInUserId() -// --------------------------------------------------------- -// - -EXPORT_C MIMCVEngineOpenChats& CIMCVEngine::OpenChats() - { - return iMessageHandler->OpenChats(); - } - - -// --------------------------------------------------------- -// CIMCVEngine::GetServiceId() -// --------------------------------------------------------- -// -EXPORT_C TInt CIMCVEngine::GetServiceId() - { - return iServiceId; - } - -// --------------------------------------------------------------------------- -// CIMCVEngine::GetServiceNameL() -// --------------------------------------------------------------------------- -// -void CIMCVEngine::GetServiceNameL( - TUint32 aServiceId, TDes& aServiceName ) - { - - CSPSettings* settings = CSPSettings::NewLC(); - CSPEntry* entry = CSPEntry::NewLC(); - TRAPD( err, settings->FindEntryL( aServiceId, *entry ) ); - if ( !err ) - { - aServiceName = entry->GetServiceName(); - } - - CleanupStack::PopAndDestroy( 2 ); - } -// --------------------------------------------------------------------------- -// CIMCVEngine::IsVoipServiceL() -// --------------------------------------------------------------------------- -// -EXPORT_C TBool CIMCVEngine::IsVoipServiceL() - { - TBool isvoipservice = EFalse; - CSPSettings* settings = CSPSettings::NewLC(); - CSPProperty* property = CSPProperty::NewLC(); - settings->FindPropertyL(iServiceId, ESubPropertyVoIPEnabled, *property); - if (property) - { - isvoipservice = ETrue; - } - CleanupStack::PopAndDestroy(2); //property,settings - return isvoipservice; - } - - - -// --------------------------------------------------------------------------- -// CIMCVEngine::GetBrandIdL() -// --------------------------------------------------------------------------- -// -void CIMCVEngine::GetBrandIdL( - TUint32 aServiceId, TDes8& aBrandId ) - { - HBufC* ret = HBufC::NewL( KVIMPSTUISPSMaxPropertyLength ); - CleanupStack::PushL( ret ); - TPtr retPtr( ret->Des() ); - - CSPSettings* settings = CSPSettings::NewLC(); - CSPProperty* property = CSPProperty::NewLC(); - settings->FindPropertyL( aServiceId, - EPropertyBrandId, - *property ); - if ( property ) - { - property->GetValue( retPtr ); - aBrandId.Copy( retPtr ); - } - CleanupStack::PopAndDestroy( 3 ); //property,settings,ret - } - - - -// --------------------------------------------------------------------------- -// CIMCVEngine::PropertyBrandLanguageL() -// --------------------------------------------------------------------------- -// -TLanguage CIMCVEngine::PropertyBrandLanguageL( - TUint32 aServiceId ) - { - - // default to english - TInt brandLanguage = ELangInternationalEnglish; - CSPSettings* settings = CSPSettings::NewLC(); - CSPProperty* property = CSPProperty::NewLC(); - settings->FindPropertyL( aServiceId, - EPropertyBrandLanguage, - *property ); - if ( property ) - { - property->GetValue( brandLanguage ); - } - CleanupStack::PopAndDestroy( 2 ); // property,settings - - return ((TLanguage) (brandLanguage) ); - } - - - -// --------------------------------------------------------------------------- -// CIMCVEngine::PropertySettingsIdL() -// --------------------------------------------------------------------------- -// -TInt CIMCVEngine::PropertySettingsIdL( - TUint32 aServiceId ) - { - - // default to english - TInt settingsId = 0; - CSPSettings* settings = CSPSettings::NewLC(); - CSPProperty* property = CSPProperty::NewLC(); - settings->FindPropertyL( aServiceId, - ESubPropertyIMSettingsId, - *property ); - if ( property ) - { - property->GetValue( settingsId ); - } - CleanupStack::PopAndDestroy( 2 ); // property,settings - - return (settingsId); - } - - -// --------------------------------------------------------------------------- -// CIMCVEngine::ResolveServiceStateL() -// --------------------------------------------------------------------------- -// -EXPORT_C void CIMCVEngine::ResolveServiceStateL() - { - - if ((!IsLoggedIn()) && (iCCHHandler->IsServiceLoggedIn())) - { - IM_CV_LOGS(TXT("CIMCVEngine::ResolveServiceState() NOT LOGGED IN") ); - iChatInterface->CloseAllContainers(); - CreateContextL(); - } - - } -// --------------------------------------------------------------------------- -// CIMCVEngine::GetUserIdL() -// --------------------------------------------------------------------------- -// -void CIMCVEngine::GetUserIdL(TPtr& aUserId ) - { - - HBufC* userId = iCCHHandler->GetUserIdL(); - - if(userId) - { - TPtr userIdPtr( userId->Des() ); - - aUserId.Copy( userIdPtr ); - } - delete userId; - - } - - -// --------------------------------------------------------------------------- -// CIMCVEngine::LoginL() -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CIMCVEngine::LoginL() - { - if (!IsLoggedIn()) - { - iState = ELogin; - IssueRequest(); - // ignore codescanner warning ignored. - if( !iWait.IsStarted() ) - { - // Code scanner warning "active object called without checking - // whether it is active or cancelling it first" ignored because - // CActiveSchedulerWait is not an active object - iWait.Start(); // CSI: 10 # See above - } - - if ( EOperationInComplete == iState ) - { - return KErrGeneral; - } - } - return KErrNone; - } - - -// -------------------------------------------------------------------------- -// CIMCVEngine::RunL -// -------------------------------------------------------------------------- -// -void CIMCVEngine::RunL() - { - switch( iState ) - { - case ELogin: - { - //cch is not logged in - if (!iCCHHandler->IsServiceLoggedIn()) - { - TInt error = iCCHHandler->EnableService(); - if (KErrNone != error) - { - iState = EOperationInComplete; - IssueRequest(); - } - else - { - iCCHHandler->RegisterObserver(this); - } - } - else - { - //cch logged in but the ximp context is not logged in - if (!IsLoggedIn()) - { - TRAPD(err,CreateConnectionL()); - if(KErrNone == err ) - { - iState = EOperationComplete; - } - else - { - iState = EOperationInComplete; - } - IssueRequest(); - } - } - break; - } - - case EOperationInComplete: - { - iCCHHandler->UnRegisterObserver(); - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - break; - } - - case EOperationComplete: - { - iCCHHandler->UnRegisterObserver(); - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - break; - } - - default: - { - // Do nothing - break; - } - } - } - -// -------------------------------------------------------------------------- -// CIMCVEngine::DoCancel -// -------------------------------------------------------------------------- -// -void CIMCVEngine::DoCancel() - { - } - -// -------------------------------------------------------------------------- -// CIMCVEngine::RunError -// -------------------------------------------------------------------------- -// -TInt CIMCVEngine::RunError( TInt /*aError*/ ) - { - return KErrNone; - } - - -// -------------------------------------------------------------------------- -// CIMCVEngine::IssueRequest -// -------------------------------------------------------------------------- -// -void CIMCVEngine::IssueRequest() - { - if (IsActive()) - { - Cancel(); - } - - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone ); - SetActive(); - } - - -// -------------------------------------------------------------------------- -// CIMCVEngine::ServiceStatusChanged -// -------------------------------------------------------------------------- -// -void CIMCVEngine::ServiceStatusChanged( TInt /*aServiceId*/, - TServiceState aServiceStatus ) - { - - switch(aServiceStatus) - { - case MIMCVEngineCCHObserver::ENotLoggedIn: - { - iState = EOperationInComplete; - IssueRequest(); - break; - } - case MIMCVEngineCCHObserver::EConnecting: - { - //Nothing to be done - break; - } - case MIMCVEngineCCHObserver::ELogin: - { - iState = EOperationComplete; - IssueRequest(); - break; - } - case MIMCVEngineCCHObserver::EDisconnecting: - { - //nothing to be done - break; - } - - default: - { - break; - } - } - } -// -------------------------------------------------------------------------- -// CIMCVEngine::CloseAllOpenChatsL -// -------------------------------------------------------------------------- -// -void CIMCVEngine::CloseAllOpenChatsL() - { - IM_CV_LOGS(TXT("CIMCVEngine::CloseAllOpenChatsL() ***************************** START") ); - iMessageHandler->CloseAllConversationL(); - IM_CV_LOGS(TXT("CIMCVEngine::CloseAllOpenChatsL() ***************************** END") ); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginecchhandler.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginecchhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,389 +0,0 @@ -/* -* Copyright (c) 2008 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: Class handling the use of Cch -* -*/ - - -// INCLUDE FILES -#include -#include -#include -#include -#include -#include "cimcvenginefactory.h" - -#include "cimcvenginecchhandler.h" -#include "imcvuiliterals.h" - -#include "imcvlogger.h" - -// CONSTANTS - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::CIMCVEngineCchHandler -// --------------------------------------------------------------------------- -// -CIMCVEngineCchHandler::CIMCVEngineCchHandler(TUint aServiceId, - CIMCVEngine& aEngine) -: iServiceId(aServiceId), -iEngine(aEngine) - { - } - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CIMCVEngineCchHandler::ConstructL( ) - { - // Create service selection here - iCchClient = CCch::NewL(); - - if (iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - - if( service ) - { - service->SetObserver( *this ); - } - } - iPrevNwError = 0; - - } - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::NewL -// --------------------------------------------------------------------------- -// -CIMCVEngineCchHandler* - CIMCVEngineCchHandler::NewL( TUint aServiceId, CIMCVEngine& aEngine ) - { - CIMCVEngineCchHandler* self = NewLC(aServiceId, aEngine); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::NewLC -// --------------------------------------------------------------------------- -// -CIMCVEngineCchHandler* - CIMCVEngineCchHandler::NewLC(TUint aServiceId, CIMCVEngine& aEngine ) - { - CIMCVEngineCchHandler* self = - new (ELeave) CIMCVEngineCchHandler(aServiceId, aEngine); - CleanupStack::PushL(self); - self->ConstructL( ); - return self; - } - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::~CIMCVEngineCchHandler -// --------------------------------------------------------------------------- -// -CIMCVEngineCchHandler::~CIMCVEngineCchHandler() - { - - if(iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - service->RemoveObserver(); - } - delete iCchClient; - } - - } - - - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::GetServiceState -// --------------------------------------------------------------------------- -// -TInt CIMCVEngineCchHandler::GetServiceState( - TCCHSubserviceState& aCCHState - ) - { - TInt err = KErrNone; - CCchService* service = iCchClient->GetService( iServiceId ); - TCchServiceStatus status; - status.SetState(ECCHUninitialized); - - if( service ) - { - // Get status from the client - err = service->GetStatus( ECCHIMSub, status ); - } - - aCCHState = status.State(); - - return err; - } - - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::EnableService -// --------------------------------------------------------------------------- -// -TInt CIMCVEngineCchHandler::EnableService() - { - - // Retrieve service interface from the CCH client to be used to - // enable aServiceType - CCchService* service = iCchClient->GetService( iServiceId ); - //Allowing Connectivity Dialogs for cch - iCchClient->SetConnectivityDialogsAllowed( ETrue ); - - // By default set to fault value; if service pointer is valid then we - // return the disable value, otherwise we return KErrNotFound - TInt error = KErrNotFound; - if( service ) - { - - error = service->Enable( ECCHUnknown ); - - } - - - return error; - } - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::GetAdapterUidL() -// --------------------------------------------------------------------------- -// -TInt CIMCVEngineCchHandler::GetAdapterUidL() - { - TInt ret = KErrNotFound; - CSPProperty* property = CSPProperty::NewLC(); - CSPSettings* settings = CSPSettings::NewLC(); - TInt err = settings->FindPropertyL( iServiceId, - EPropertyPCSPluginId,*property ); - if (KErrNone == err) - { - property->GetValue( ret ); - } - CleanupStack::PopAndDestroy( settings ); - CleanupStack::PopAndDestroy( property ); - return ret; - } - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::GetUserIdL -// --------------------------------------------------------------------------- -// -HBufC* CIMCVEngineCchHandler::GetUserIdL() - { - HBufC* temp = NULL; - CCchService* service = iCchClient->GetService( iServiceId ); - // By default set to fault value; if service pointer is valid then we - // return the disable value, otherwise we return KErrNotFound - TInt error = KErrNotFound; - if( service ) - { - RBuf username; - username.Create(KMAXUSERIDLENGTH); - CleanupClosePushL( username ); - error = service->GetConnectionParameter(ECCHIMSub,ECchUsername,username); - User::LeaveIfError( error); - if( username.Length() > 0) - { - temp = username.AllocL(); // ownership transferred - } - CleanupStack::PopAndDestroy( &username ); - } - return temp; - } - - - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::DisableService -// --------------------------------------------------------------------------- -// -TInt CIMCVEngineCchHandler::DisableService() - { - - // Retrieve service interface from the CCH client to be used to - // enable aServiceType - CCchService* service = iCchClient->GetService( iServiceId ); - // By default set to fault value; if service pointer is valid then we - // return the disable value, otherwise we return KErrNotFound - TInt error = KErrNotFound; - if( service ) - { - error = service->Disable( ECCHUnknown ); - } - - - return error; - } - - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::IsServiceLoggedIn -// --------------------------------------------------------------------------- -// -TBool CIMCVEngineCchHandler::IsServiceLoggedIn() - { - TCCHSubserviceState serviceState = ECCHUninitialized; - - TInt error = GetServiceState( serviceState ); - - if ( !error && ECCHEnabled == serviceState ) - { - return ETrue; - } - - return EFalse; - - } - - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::ServiceStatusChanged -// --------------------------------------------------------------------------- -// -void CIMCVEngineCchHandler::ServiceStatusChanged( - TInt aServiceId, - const TCCHSubserviceType aType, - const TCchServiceStatus& aServiceStatus ) - { - TRAP_IGNORE(DoHandleServiceStatusChangedL(aServiceId, aType, aServiceStatus)); - } - - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::DoHandleServiceStatusChanged -// --------------------------------------------------------------------------- -// -void CIMCVEngineCchHandler::DoHandleServiceStatusChangedL( - TInt aServiceId, - const TCCHSubserviceType aType, - const TCchServiceStatus& aServiceStatus ) - { - - IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL ") ); - IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL:TCCHSubserviceType=%d"),aType); - IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL:aServiceStatus.Error()=%d"),aServiceStatus.Error()); - if (aType == ECCHPresenceSub) - { - /* SIP Adaptation -- sends error in Network Lost. This is added so that once we get it, we will unbindL and delete the context - * This happens only in case of SIP as it does not send the event in IM Subservice. - */ - if (aServiceStatus.Error() && ECCHDisabled != aServiceStatus.State()) - { - iEngine.ReleaseConnectionL (); - iEngine.DeleteContextL (); - } - } - else if (aType == ECCHIMSub) - { - MIMCVEngineCCHObserver::TServiceState notifyEvent = - MIMCVEngineCCHObserver::ENotLoggedIn; - switch (aServiceStatus.State()) - { - case ECCHUninitialized: - { - //Nothing to be done - break; - } - case ECCHDisabled: - { - IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL DISABLED")); - if(iPrevNwError != KCCHErrorNetworkLost) - { - iEngine.CloseAllOpenChatsL (); - } - iEngine.ReleaseConnectionL(); - iEngine.DeleteContextL (); - break; - } - case ECCHConnecting: - { - IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL ECCHConnecting") ); - iPrevNwError = aServiceStatus.Error(); - notifyEvent = MIMCVEngineCCHObserver::EConnecting; - break; - } - case ECCHEnabled: - { - IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL ECCHEnabled") ); - notifyEvent = MIMCVEngineCCHObserver::ELogin; - iEngine.CreateContextL(); - break; - } - case ECCHDisconnecting: - { - // If NetworkErrorLost error is received by CCH on this state, then do not close all chats - // as user would loose all the on-going conversation when the network connection is - // restored. - IM_CV_LOGS(TXT("CVEngineCCHHnadler::DoHandleServiceStatusChangedL ECCHDisconnecting") ); -// if (aServiceStatus.Error () != KCCHErrorNetworkLost ) -// { -// iEngine.CloseAllOpenChatsL(); -// iEngine.ReleaseConnectionL (); -// iEngine.DeleteContextL (); -// } - notifyEvent = MIMCVEngineCCHObserver::EDisconnecting; - break; - } - default: - { - break; - } - } - - if (iObserver) - { - iObserver->ServiceStatusChanged( aServiceId, - notifyEvent ); - - } - - } - } - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::RegisterObserver -// --------------------------------------------------------------------------- -// -void CIMCVEngineCchHandler::RegisterObserver(MIMCVEngineCCHObserver* aObserver) - { - if (aObserver) - { - iObserver = aObserver; - } - } - - - -// --------------------------------------------------------------------------- -// CIMCVEngineCchHandler::UnRegisterObserver -// --------------------------------------------------------------------------- -// -void CIMCVEngineCchHandler::UnRegisterObserver() - { - iObserver = NULL; - } - - -// End of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginechatcontainer.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginechatcontainer.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,579 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: container class for im messages -* -*/ - - -#include "cimcvenginechatcontainer.h" - -#include "cimcvenginemessagecontainer.h" -#include "mimcvenginenewmsgobserver.h" -#include "mimcvenginemessage.h" -#include -#include "imcvlogger.h" -#include "mimcvenginechatlistobserver.h" - - -#include - -const TInt KMinAvailableMemory = 0x32000; // 200kb - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::CIMCVEngineChatContainer -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineChatContainer::CIMCVEngineChatContainer(TInt aServiceId): - iServiceId( aServiceId ) - { - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::CIMCVEngineChatContainer -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineChatContainer::~CIMCVEngineChatContainer() - { - iChatContainer.ResetAndDestroy(); - iSendContainer.ResetAndDestroy(); - iNewMsgObserver = NULL; - iChatListObservers.Reset(); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::NewL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineChatContainer* CIMCVEngineChatContainer::NewL(TInt aServiceId) - { - CIMCVEngineChatContainer* self = - new ( ELeave ) CIMCVEngineChatContainer(aServiceId); - - return self; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::MessageReadInterfaceL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessageReadInterface& CIMCVEngineChatContainer::MessageReadInterfaceL( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineMessageReadInterface::TContainerType aType ) - { - return *ChatL( ChatL( aServiceId, aTargetId,aDisplayName,aContactLink,aType ) ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::MessageWriteInterfaceL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessageWriteInterface& CIMCVEngineChatContainer::MessageWriteInterfaceL( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineMessageReadInterface::TContainerType aType ) - { - return *ChatL( ChatL( aServiceId, aTargetId, aDisplayName, aContactLink , aType ) ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::DeleteChatL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineChatContainer::DeleteChatL( - TInt aServiceId, - const TDesC& aTargetId ) - { - // Find out if chat exist or not. ChatExists() not used, - // because we need index. - CIMCVEngineMessageContainer* tempChat = CreateContainerLC( - aServiceId, - aTargetId, - KNullDesC, - KNullDesC8, - *this, - MIMCVEngineMessageReadInterface::ENoneContainer ); - TInt index( FindChat( *tempChat ) ); - CleanupStack::PopAndDestroy( tempChat ); - - // If index is positive value, Chat exists and we can remove it. - if( index >= 0 ) - { - CIMCVEngineMessageContainer* target = ChatL( index, EFalse ); - - // Get count of pending messages before removing chat - TInt ignore; - TInt pendignMsgs = MessagesPendingCount( ignore ); - - RemoveChat( index ); - - // Check if removed chat had unread messages - if( pendignMsgs != MessagesPendingCount( ignore ) ) - { - // Notify about changed unread count - HandleChatEventL( EUnreadCountChanged ); - } - - // Observers are notified, delete target. - delete target; - } - else if( index != KErrNotFound ) - { - // some other error than not found occurred. Inform caller. - User::Leave( index ); - } - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::CloseAllContainers -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineChatContainer::CloseAllContainers() - { - IM_CV_LOGS(TXT("CIMCVEngineChatContainer::CloseAllContainers() START") ); - TInt count( iChatListObservers.Count() ); - for( TInt a( 0 ); a < count; ++a ) - { - IM_CV_LOGS(TXT("CIMCVEngineChatContainer::CloseAllContainers() closing container ") ); - iChatListObservers[ a ]->HandleChatListEvent( iServiceId, EChatAllItemDeleted, NULL ); - } - //iChatContainer.ResetAndDestroy(); - IM_CV_LOGS(TXT("CIMCVEngineChatContainer::CloseAllContainers() End") ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::ChatCount -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineChatContainer::ChatCount() const - { - return iChatContainer.Count(); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::ChatAt -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessageReadInterface& CIMCVEngineChatContainer::ChatAt( TInt aIndex ) const - { - //__CHAT_ASSERT_DEBUG( aIndex >= 0 && aIndex < ChatCount() ) - return *iChatContainer[ aIndex ]; - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::RegisterNewMsgObserver -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineChatContainer::RegisterNewMsgObserver( MIMCVEngineNewMsgObserver* aObserver ) - { - iNewMsgObserver = aObserver; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::UnregisterNewMsgObserver -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineChatContainer::UnregisterNewMsgObserver() - { - iNewMsgObserver = NULL; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::RegisterChatListObserver -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineChatContainer::RegisterChatListObserver( MIMCVEngineChatListObserver* aObserver ) - { - TInt index = iChatListObservers.Find( aObserver ); - if( index == KErrNotFound ) - { - return iChatListObservers.Append( aObserver ); - } - return KErrAlreadyExists; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::UnregisterChatListObserver -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineChatContainer::UnregisterChatListObserver( MIMCVEngineChatListObserver* aObserver ) - { - TInt index = iChatListObservers.Find( aObserver ); - if( index >= 0 ) - { - iChatListObservers.Remove( index ); - return KErrNone; - } - return index; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::PendingMessagesCount -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineChatContainer::MessagesPendingCount( TInt& aCountOfChats, - MIMCVEngineMessageReadInterface::TUnreadFilter aUnreadFilter - /*= MIMCVEngineMessageReadInterface::EUnreadAll*/ ) const - { - TInt count( ChatCount() ); - TInt pendingCount( 0 ); - aCountOfChats = 0; - for( TInt a( 0 ); a < count; ++a ) - { - TInt unreadCount = ChatAt( a ).UnreadCount( aUnreadFilter ); - if( unreadCount > 0 ) - { - pendingCount += unreadCount; - ++aCountOfChats; - } - } - return pendingCount; - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::MessageInterface -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TBool CIMCVEngineChatContainer::FreeMemoryIfNeededL( TInt aSize ) - { - //CHAT_DP_FUNC_ENTER( "CIMCVEngineChatContainer::FreeMemoryIfNeededL" ); - - TInt halSize; - TInt biggestBlock; - - HAL::Get( HALData::EMemoryRAMFree, halSize ); - TInt maxHeap = Min( User::Heap().MaxLength(), halSize ); - TInt available = maxHeap - ( User::Heap().Size() - User::Heap().Available( biggestBlock ) ); - TInt memoryNeed = KMinAvailableMemory + aSize; - - TTime oldestUnread; - TInt unreadIndex; - - IM_CV_LOGS(TXT( "CIMCVEngineChatContainer::FreeMemoryIfNeededL, heapSize = %d"), maxHeap ); - IM_CV_LOGS(TXT( "****heapSize, available, need = %d, %d, %d"), - maxHeap, available, memoryNeed ); - - TBool ready = EFalse; - TBool memLowNotified = EFalse; - while( !ready ) - { - TBool freeMemoryNeeded( EFalse ); - if( iExternalMemoryHandler ) - { - freeMemoryNeeded = !iExternalMemoryHandler->FreeMemoryIfNeededL( aSize ); - } - if( freeMemoryNeeded || memoryNeed > available ) - { - // we have to react. - TInt count = ChatCount(); - - // Check how much memory can be made free - TInt freeableBytes = 0; - for( TInt i = 0; i < count; ++i ) - { - TBool locked = iChatContainer[i]->IsLocked(); - if ( iChatContainer[i]->AllMessagesCount() && !locked ) - { - freeableBytes += iChatContainer[i]->ContainerSizeInBytes(); - } - } - - if ( ( ( available + freeableBytes ) < memoryNeed ) - && !memLowNotified ) - { - // Can't free enough memory - return EFalse; - } - - oldestUnread.HomeTime(); - unreadIndex = KErrNotFound; - - for( TInt a( 0 ); a < count; ++a ) - { - MIMCVEngineMessageReadInterface& chat = ChatAt( a ); - TBool locked = iChatContainer[ a ]->IsLocked(); - if( iChatContainer[ a ]->AllMessagesCount() && !locked ) - { - MIMCVEngineMessage& message = iChatContainer[ a ]->MessageFromAll( 0 ); - if( oldestUnread > message.TimeStamp() ) - { - oldestUnread = message.TimeStamp(); - unreadIndex = a; - } - } - } - - if( unreadIndex == KErrNotFound ) - { - return EFalse; - } - else - { - // Inform observers about memory handling - if ( !memLowNotified ) - { - HandleChatEventL( EMemoryLow ); - memLowNotified = ETrue; - } - iChatContainer[ unreadIndex ]->DeleteMessageFromAll( 0 ); - } - available = maxHeap - ( User::Heap().Size() - User::Heap().Available( biggestBlock ) ); - IM_CV_LOGS(TXT( "****heapSize, available, need = %d, %d, %d"), - maxHeap, available, memoryNeed ); - } - else - { - ready = ETrue; - } - } - //CHAT_DP_FUNC_DONE( "CIMCVEngineChatContainer::FreeMemoryIfNeededL" ); - return ETrue; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::HandleChatEventL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineChatContainer::HandleChatEventL( TChatEventType aEvent, - MIMCVEngineMessage* aMessage ) - { - if( iNewMsgObserver ) - { - iNewMsgObserver->HandleChatEventL( aEvent, aMessage ); - } - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::ChatL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineChatContainer::ChatL( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineMessageReadInterface::TContainerType aType - /*= MIMCVEngineMessageReadInterface::ENoneContainer*/ ) - { - IM_CV_LOGS(TXT("CIMCVEngineChatContainer::ChatL aName= %S"),&aDisplayName ); - - IM_CV_LOGS(TXT("CIMCVEngineChatContainer::ChatL aLink= %S"),&aContactLink); - - CIMCVEngineMessageContainer* tempChat = - CreateContainerLC( aServiceId, aTargetId, aDisplayName, aContactLink, *this, aType ); - - TInt index( FindChat( *tempChat ) ); - if( index == KErrNotFound ) - { - IM_CV_LOGS(TXT("CIMCVEngineChatContainer::ChatL,Chat not found creating with aName %S"),&aDisplayName ); - IM_CV_LOGS(TXT("CIMCVEngineChatContainer::ChatL,Chat not found creating with xspId %S"),&aTargetId ); - - TLinearOrder< CIMCVEngineMessageContainer > order( - CIMCVEngineMessageContainer::OrderUid ); - // User::LeaveIfError returns value if value is positive. - iLatestType = tempChat->ContainerType(); - switch( iLatestType ) - { - case MIMCVEngineMessageReadInterface::EChatContainer: - { - User::LeaveIfError( iChatContainer.InsertInOrder( tempChat, - order ) ); - index = FindChat( *tempChat ); - iChatContainer[ index ]->SetChatObserver( this ); - - HandleChatListEvent( EChatItemAdded, *tempChat ); - break; - } - case MIMCVEngineMessageReadInterface::ESendContainer: - { - User::LeaveIfError( iSendContainer.InsertInOrder( tempChat, - order ) ); - - index = FindChat( *tempChat ); - break; - } - default: - { - User::Leave( KErrArgument ); - break; - } - } - CleanupStack::Pop( tempChat ); - } - else - { - // if contact link is null - if(!(iChatContainer[ index ]->ContactLink().Length())) - { - if( (aContactLink.Length() > 0) && (iLatestType == MIMCVEngineMessageReadInterface::EChatContainer)) - { - iChatContainer[ index ]->SetLinkL(aContactLink); - } - } - CleanupStack::PopAndDestroy( tempChat ); - } - - return User::LeaveIfError( index ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::ChatL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageContainer* CIMCVEngineChatContainer::ChatL( TInt aIndex, - TBool aResetLatest /* = ETrue*/ ) - { - MIMCVEngineMessageReadInterface::TContainerType type = iLatestType; - - if( aResetLatest ) - { - iLatestType = MIMCVEngineMessageReadInterface::ENoneContainer; - } - - switch( type ) - { - - case MIMCVEngineMessageReadInterface::EChatContainer: - { - return iChatContainer[ aIndex ]; - } - case MIMCVEngineMessageReadInterface::ESendContainer: - { - return iSendContainer[ aIndex ]; - } - default: - { - User::Leave( KErrArgument ); - break; - } - } - // Can never get this far - //__CHAT_ASSERT_DEBUG( EFalse ); - return NULL; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::RemoveChatL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineChatContainer::RemoveChat( TInt aIndex, - TBool aResetLatest /* = ETrue */ ) - { - MIMCVEngineMessageReadInterface::TContainerType type = iLatestType; - - if( aResetLatest ) - { - iLatestType = MIMCVEngineMessageReadInterface::ENoneContainer; - } - - switch( type ) - { - case MIMCVEngineMessageReadInterface::EChatContainer: - { - HandleChatListEvent( EChatItemDeleted, *iChatContainer[aIndex] ); - iChatContainer.Remove( aIndex ); - break; - } - case MIMCVEngineMessageReadInterface::ESendContainer: - { - - iSendContainer.Remove( aIndex ); - break; - } - default: - { - break; - } - } - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::FindChat -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineChatContainer::FindChat( const CIMCVEngineMessageContainer& aChat ) - { - - TInt index( 0 ); - TLinearOrder< CIMCVEngineMessageContainer > order( CIMCVEngineMessageContainer::OrderUid ); - TInt status = iChatContainer.FindInOrder( &aChat, index, order ); - if( status == KErrNone ) - { - iLatestType = MIMCVEngineMessageReadInterface::EChatContainer; - return index; - } - - iLatestType = MIMCVEngineMessageReadInterface::ESendContainer; - status = iSendContainer.FindInOrder( &aChat, index, order ); - return ( status == KErrNone ? index : status ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineChatContainer::CreateContainerLC -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageContainer* CIMCVEngineChatContainer::CreateContainerLC( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineBufferMemoryHandler& aMemoryHandler, - MIMCVEngineMessageReadInterface::TContainerType aType ) - { - - CIMCVEngineMessageContainer* messageContainer = CIMCVEngineMessageContainer::NewL( - aServiceId, - aTargetId, - aDisplayName, - aContactLink, - aMemoryHandler, - aType ); - CleanupStack::PushL( messageContainer ); - return messageContainer; - } - - -// --------------------------------------------------------- -// CIMCVEngineChatContainer::MemoryHandler -// --------------------------------------------------------- -// -MIMCVEngineBufferMemoryHandler& CIMCVEngineChatContainer::MemoryHandler() - { - return *this; - } - - -// --------------------------------------------------------- -// CIMCVEngineChatContainer::HandleChatListEvent -// --------------------------------------------------------- -// -void CIMCVEngineChatContainer::HandleChatListEvent( TChatListEventType aEvent, - MIMCVEngineMessageReadInterface& aContainerInfo ) - { - IM_CV_LOGS (TXT("CIMCVENGINECHATCONTAINER :: HANDLECHATLISTEVENT")); - // Inform all observer about chat event. - //TInt count( iChatListObservers.Count() ); //kept for reference - for( TInt a( 0 ); a < iChatListObservers.Count() ; ++a ) - { - iChatListObservers[ a ]->HandleChatListEvent( iServiceId, aEvent, &aContainerInfo ); - } - } -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginecontextobserver.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginecontextobserver.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,298 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: single context observer implementation -* -*/ - -#include "cimcvenginecontextobserver.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "imcvuiliterals.h" -#include "mimcvenginenewmessagehandler.h" -#include "imcvlogger.h" -#include -// ============================ MEMBER FUNCTIONS ============================== - -// --------------------------------------------------------- -// CIMCVEngineContextObserver::NewL -// two phase construction -// --------------------------------------------------------- -CIMCVEngineContextObserver* CIMCVEngineContextObserver::NewL() - { - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::NewL() start") ); - CIMCVEngineContextObserver* self = - CIMCVEngineContextObserver::NewLC(); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::NewL() end") ); - return self; - } - -// --------------------------------------------------------- -// CIMCVEngineContextObserver::NewLC -// two phase construction -// --------------------------------------------------------- -CIMCVEngineContextObserver* CIMCVEngineContextObserver::NewLC() - { - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::NewLC() start") ); - CIMCVEngineContextObserver* self = new - (ELeave) CIMCVEngineContextObserver(); - CleanupStack::PushL( self ); - self->ConstructL(); - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::NewLC() end") ); - return self; - } - -// --------------------------------------------------------- -// CIMCVEngineContextObserver::ConstructL -// two phase construction -// --------------------------------------------------------- -void CIMCVEngineContextObserver::ConstructL() - { - } - -// --------------------------------------------------------- -// CIMCVEngineContextObserver::~CIMCVEngineContextObserver -// destructor -// --------------------------------------------------------- -CIMCVEngineContextObserver::~CIMCVEngineContextObserver() - { - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::~CIMCVEngineContextObserver() start") ); - if(iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::~CIMCVEngineContextObserver() end") ); - } - -// --------------------------------------------------------- -// CIMCVEngineContextObserver::CIMCVEngineContextObserver -// --------------------------------------------------------- -CIMCVEngineContextObserver::CIMCVEngineContextObserver() : -iCurrentReqType(EReqUnknown) - { - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::CIMCVEngineContextObserver() start") ); - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::CIMCVEngineContextObserver() end") ); - } - -// =========================================================================== -// FROM MPRFWximpCONTEXTOBSERVER -// =========================================================================== -// -// --------------------------------------------------------- -// CIMCVEngineContextObserver::HandleximpContextEvent -// --------------------------------------------------------- -void CIMCVEngineContextObserver::HandlePresenceContextEvent( - const MXIMPContext& /*aContext*/, - const MXIMPBase& aEvent ) - { - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::HandlePresenceContextEvent() start") ); - const TInt32 eventType = aEvent.GetInterfaceId(); - - switch( eventType ) - { - case MXIMPRequestCompleteEvent::KInterfaceId: - { - const MXIMPRequestCompleteEvent* event = - TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( aEvent, MXIMPBase::EPanicIfUnknown ); - - TXIMPRequestId reqId = event->RequestId(); - - const MXIMPStatus& status = event->CompletionResult(); - - TInt err = status.ResultCode(); - //Login request has been issued - if ((iCurrentXIMPReq == reqId) && (ELoginReq == iCurrentReqType)) - { - //Login is an synchronous call - if ( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - if(KErrNone == err ) - { - iLoggedIn = ETrue; - } - else - { - iLoggedIn = EFalse; - } - - iCurrentReqType = EReqUnknown; - if(iSessionObserver) - { - TRAP_IGNORE( iSessionObserver->HandleConnectionEventL( ELoggedIn, KErrNone ) ); - } - } - //Logout request has been issued - else if ((iCurrentXIMPReq == reqId) && (ELogoutReq == iCurrentReqType)) - { - //Login is an synchronous call - if ( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - iLoggedIn = EFalse; - iCurrentReqType = EReqUnknown; - if(iSessionObserver) - { - TRAP_IGNORE( iSessionObserver->HandleConnectionEventL(ELoggedOut, KErrNone ) ); - } - } - //SendMessage request has been issued - else - { - // for message delivery report - if( iSessionObserver && iLoggedIn ) - { - TRAP_IGNORE( iSessionObserver->HandleDeliveryReportL(reqId, status.ResultCode() ) ); - } - } - break; - } - - case MXIMPContextStateEvent::KInterfaceId: - { - // what do we do with context state event - // state of the context can be associated with the - const MXIMPContextStateEvent* ctxtStateEvent = - TXIMPGetInterface< const MXIMPContextStateEvent >::From( aEvent, - MXIMPBase::EPanicIfUnknown ); - const MXIMPStatus* fwStatus = ctxtStateEvent->StateChangeReason(); - const MXIMPContextState& cState = ctxtStateEvent->ContextState(); - MXIMPContextState::TState state = cState.ContextState(); - - if (MXIMPContextState::EInactive == state ) - { - //No request of Login/Logout has been issued by CV - //Hence this might be a server initiated disconnect - //handle properly - if( (iSessionObserver) && (EReqUnknown == iCurrentReqType) ) - { - TRAP_IGNORE( iSessionObserver->HandleConnectionEventL(EForcedLoggedOut, KImErrServiceForceClosedSession ) ); - } - - } - break; - } - default: - { - - break; - } - } - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::HandlePresenceContextEvent() end") ); - } - - -// --------------------------------------------------------- -// CIMCVEngineContextObserver::GetCompletedReqResult -// -// --------------------------------------------------------- -void CIMCVEngineContextObserver::GetConnectedSessionL(MXIMPContext& aContext, TInt aServiceId, TUid aProtocolUid) - { - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::GetConnectedSessionL() start") ); - //TUid protocolUid = TUid::Uid( KProtocolUidTelepathy ); - if ( (!iLoggedIn) && (EReqUnknown == iCurrentReqType) ) - { - //iOngoingOperation = TIMCVStateEnums::EIMCVLogging; - iCurrentXIMPReq = aContext.BindToL( aProtocolUid, aServiceId ) ; - iCurrentReqType = ELoginReq; - - if( !iWait.IsStarted() ) - { - // Code scanner warning "active object called without checking - // whether it is active or cancelling it first" ignored because - // CActiveSchedulerWait is not an active object - iWait.Start(); // CSI: 10 # See above - } - - //iOngoingOperation = TIMCVStateEnums::EIMCVUnknown; - } - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::GetConnectedSessionL() end") ); - - } -// --------------------------------------------------------- -// CIMCVEngineContextObserver::GetCompletedReqResult -// -// --------------------------------------------------------- -void CIMCVEngineContextObserver::ReleaseConnectionL(MXIMPContext& aContext) - { - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::ReleaseConnectionL() start") ); - if ( (iLoggedIn) && (EReqUnknown == iCurrentReqType) ) - { - //iOngoingOperation = TIMCVStateEnums::EIMCVLoggingOut; - iCurrentXIMPReq = aContext.UnbindL() ; - iCurrentReqType = ELogoutReq; - if( !iWait.IsStarted() ) - { - // Code scanner warning "active object called without checking - // whether it is active or cancelling it first" ignored because - // CActiveSchedulerWait is not an active object - iWait.Start(); // CSI: 10 # See above - } - } - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::ReleaseConnectionL() end") ); - - } - -// --------------------------------------------------------- -// CIMCVEngineContextObserver::IsLoggedIn -// -// --------------------------------------------------------- -TBool CIMCVEngineContextObserver::IsLoggedIn() const - { - return iLoggedIn; - } -// --------------------------------------------------------- -// CIMCVEngineContextObserver::RegisterObserver -// -// --------------------------------------------------------- -void CIMCVEngineContextObserver::RegisterObserver(MIMCVEngineServiceSessionHandler* aObserver) - { - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::RegisterObserver() start") ); - iSessionObserver = aObserver; - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::RegisterObserver() end") ); - } -// --------------------------------------------------------- -// CIMCVEngineContextObserver::UnRegisterObserver -// -// --------------------------------------------------------- -void CIMCVEngineContextObserver::UnRegisterObserver(MIMCVEngineServiceSessionHandler* /*aObserver*/) - { - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::UnRegisterObserver() start") ); - // do not call delete - // not owned by this class - iSessionObserver = NULL; - IM_CV_LOGS(TXT("CIMCVEngineContextObserver::UnRegisterObserver() end") ); - } -// --------------------------------------------------------- -// CIMCVEngine::SetLoggedIn() -// --------------------------------------------------------- -// -void CIMCVEngineContextObserver::SetLoggedIn(TBool aState) - { - iLoggedIn = aState; - } - -// end of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginefactory.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginefactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,755 +0,0 @@ -/* -* Copyright (c) 2008-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: service engine factory implementation -* -*/ - -// INCLUDE FILES -#include "cimcvenginefactory.h" - -#include "mimcvenginefactory.h" -#include "cimcvengine.h" -#include "imcvuiliterals.h" -#include -#include -#include -#include -#include -#include "mimcvenginemessagecreator.h" -#include -#include "cimcvenginemessagecreator.h" -#include -#include "mimcvngineservicechangeobserver.h" -#include -#include -#include "imcvuiparams.h" -#include "mimcvenginemessagehandler.h" -#include "mimcvenginechatinterface.h" - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory::InstanceL -// Create an instance of the ximp manager -// behaving as singleton object already created then return same instance. -// ----------------------------------------------------------------------------- -// -EXPORT_C MIMCVEngineFactory* CIMCVEngineFactory::InstanceL() - { - CIMCVEngineFactory* singleton; - singleton = static_cast (Dll::Tls()); - if( !singleton ) - { - singleton = CIMCVEngineFactory::NewLC(); - User::LeaveIfError( Dll::SetTls( static_cast (singleton ) )); - CleanupStack::Pop(singleton); - } - return (MIMCVEngineFactory*)singleton; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory::Release -// Release the singelton -// ----------------------------------------------------------------------------- -// -EXPORT_C void CIMCVEngineFactory::Release() - { - CIMCVEngineFactory* singleton; - singleton = static_cast(Dll::Tls()); - if( singleton ) - { - delete singleton; - Dll::SetTls( NULL ) ; - } - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory::NewLC -// Object creation using two phase construction -// ----------------------------------------------------------------------------- -// -CIMCVEngineFactory* CIMCVEngineFactory::NewLC() - { - CIMCVEngineFactory* self = new (ELeave) CIMCVEngineFactory(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory::ConstructL -// Symbian OS default constructor can leave. -// ----------------------------------------------------------------------------- -// -void CIMCVEngineFactory::ConstructL() - { - iMessageCreator = CIMCVEngineMessageCreator::NewL(); - iBrandingFactory = CBSFactory::NewL( KDefaultBrandIdForBrand, KAppIdForBrand ); - __ASSERT_ALWAYS((iBrandingFactory != NULL),User::Leave(KErrArgument)); - ReadAndCreateAllValidServiceL(); - //register for service table notifications - RArray serviceIds; - CleanupClosePushL( serviceIds ); - iSpNotifyChange = CSPNotifyChange::NewL( *this ); - iSpNotifyChange->NotifyChangeL( serviceIds ); - CleanupStack::PopAndDestroy( &serviceIds ) ; - } - -// --------------------------------------------------------- -// CIMCVEngineFactory::CIMCVEngineFactory -// --------------------------------------------------------- -CIMCVEngineFactory::CIMCVEngineFactory(): - iActiveChatIndex( KErrNotFound ) - { - - } - -// --------------------------------------------------------- -// CIMCVEngineFactory::~CIMCVEngineFactory -// --------------------------------------------------------- -CIMCVEngineFactory::~CIMCVEngineFactory() - { - delete iSpNotifyChange; - //delete all the create engine instances - //delete iBrandingFactory; - iServiceEngines.ResetAndDestroy(); - iServiceEngines.Close(); - delete iMessageCreator; - delete iBrandingFactory; - } -// --------------------------------------------------------- -// CIMCVEngineFactory::ReadAndCreateAllValidServiceL -// --------------------------------------------------------- -void CIMCVEngineFactory::ReadAndCreateAllValidServiceL() - { - CSPSettings* settings = CSPSettings::NewLC(); - - RArray services; - CleanupClosePushL( services ); - settings->FindServiceIdsL( services ); - const TInt serviceCount = services.Count(); - - for ( TInt i( 0 ); i < serviceCount; i++ ) - { - TInt serviceId = services[ i ]; - TUint32 refContactUid = ContactViewUidL(*settings , serviceId ); - if ( TUid::Uid( refContactUid ) == - TUid::Uid( 0x20012423 ) - || TUid::Uid( refContactUid ) == - TUid::Uid( 0x20007B6D ) - || TUid::Uid( refContactUid ) == - TUid::Uid( 0x2002B334 ) ) - { - if( CheckValidIMServiceL(*settings , serviceId ) ) - { - CreateServiceEngineL( serviceId ); - } - } - } - CleanupStack::PopAndDestroy( &services ); - CleanupStack::PopAndDestroy( settings ); - } - -// --------------------------------------------------------------------------- -// CIMCVEngineFactory::ContactViewUidL() -// --------------------------------------------------------------------------- -// -TUint32 CIMCVEngineFactory::ContactViewUidL(CSPSettings& aSettings, TUint32 aServiceId ) - { - TInt contactViewUid = KErrNotFound; - CSPProperty* property = CSPProperty::NewLC(); - TInt err = aSettings.FindPropertyL( aServiceId, - EPropertyContactViewPluginId, - *property ); - if ( KErrNone == err ) - { - property->GetValue( contactViewUid ); - } - CleanupStack::PopAndDestroy( property ); - return contactViewUid; - } -//----------------------------------------------------------------------------- -// CIMCVEngineFactory::CheckValidIMServiceL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TBool CIMCVEngineFactory::CheckValidIMServiceL(CSPSettings& aSettings , TInt aServiceId) - { - //check whether it has IMSubservice - TBool ret = ETrue; - CSPProperty* property = CSPProperty::NewLC(); - TInt err = aSettings.FindPropertyL( aServiceId, - ESubPropertyIMEnabled, - *property ); - if ( err ) - { - ret = EFalse; - } - CleanupStack::PopAndDestroy( property ); - return ret; - } - -// --------------------------------------------------------------------------- -// CIMCVEngineFactory::CreateServiceEngineL() -// --------------------------------------------------------------------------- -// -void CIMCVEngineFactory::CreateServiceEngineL( TInt aServiceId ) - { - TInt count = iServiceEngines.Count(); - CIMCVEngine* engine = NULL; - for(int i=0 ; iGetServiceId() == aServiceId) - { - engine = iServiceEngines[i]; - break; - } - } - if( !engine ) - { - engine = CIMCVEngine::NewL( aServiceId , *iMessageCreator, *iBrandingFactory ); - CleanupStack::PushL(engine); - iServiceEngines.AppendL(engine); - CleanupStack::Pop(engine); - } - } -// --------------------------------------------------------------------------- -// CIMCVEngineFactory::GetServiceEngine() -// --------------------------------------------------------------------------- -// -CIMCVEngine& CIMCVEngineFactory::GetServiceEngineL( TInt aServiceId ) - { - TInt count = iServiceEngines.Count(); - CIMCVEngine* engine = NULL; - for(int i=0 ; iGetServiceId() == aServiceId) - { - engine = iServiceEngines[i]; - break; - } - } - if( !engine ) - { - engine = CIMCVEngine::NewL( aServiceId , *iMessageCreator, *iBrandingFactory ); - CleanupStack::PushL(engine); - iServiceEngines.AppendL(engine); - CleanupStack::Pop(engine); - engine->OpenChats().RegisterObserver( this ); - engine->MessageHandler().SetObserver( this ); - engine->ChatInterface().RegisterChatListObserver( this ); - } - return *engine; - } -// --------------------------------------------------------------------------- -// CIMCVEngineFactory::ReleaseServiceEngine() -// --------------------------------------------------------------------------- -// -void CIMCVEngineFactory::ReleaseServiceEngine( TInt aServiceId ) - { - TInt count = iServiceEngines.Count(); - for(int i=0 ; iGetServiceId() == aServiceId ) - { - CIMCVEngine* engine = iServiceEngines[i]; - iServiceEngines.Remove( i ); - delete engine; - engine = NULL; - iServiceEngines.Compress(); - break; - } - } - } -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: GetDisplayNameL -// ----------------------------------------------------------------------------- -// -TPtrC CIMCVEngineFactory::GetDisplayNameL(TInt aIndex) const - { - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats(); - TInt openChatCount = openChat.Count(); - if( aIndex < openChatCount ) - { - return openChat.GetDisplayNameL( aIndex ); - } - else - { - aIndex = aIndex - openChatCount; - } - } - return KNullDesC(); - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: GetTargetIdL -// ----------------------------------------------------------------------------- -// -const TDesC& CIMCVEngineFactory::GetTargetIdL(TInt aIndex) const - { - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats(); - TInt openChatCount = openChat.Count(); - if( aIndex < openChatCount ) - { - return openChat.GetTargetIdL( aIndex ); - } - else - { - aIndex = aIndex - openChatCount; - } - } - return KNullDesC; - } - - - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: FindIndexL -// ----------------------------------------------------------------------------- -// -TInt CIMCVEngineFactory::FindIndexL(const TDesC& aItem ) - { - TInt index = KErrNotFound; - TInt validIndex = 0; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats(); - TInt openChatCount = openChat.Count(); - index = openChat.FindIndexL( aItem ) ; - if( index != KErrNotFound ) - { - validIndex = validIndex + index; - break; - } - else - { - validIndex = openChatCount; - } - } - return validIndex; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: Count -// ----------------------------------------------------------------------------- -// -TInt CIMCVEngineFactory::Count() const - { - TInt chatCount = 0; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats(); - chatCount = chatCount + openChat.Count(); - } - return chatCount; - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: SetActiveItemL -// ----------------------------------------------------------------------------- -// -void CIMCVEngineFactory::SetActiveItemL( const TInt aIndex ) - { - iActiveChatIndex = aIndex; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: GetActiveItem -// ----------------------------------------------------------------------------- -// -const TDesC& CIMCVEngineFactory::GetActiveItemL() const - { - TInt index = iActiveChatIndex ; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats(); - TInt openChatCount = openChat.Count(); - if( index < openChatCount ) - { - return openChat.GetTargetIdL( index ); - } - else - { - index = index - openChatCount; - } - } - return KNullDesC; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: GetServiceEngines -// ----------------------------------------------------------------------------- -// -RPointerArray& CIMCVEngineFactory::GetServiceEngines() - { - return iServiceEngines; - } -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: GetActiveServiceId -// ----------------------------------------------------------------------------- -// -TInt CIMCVEngineFactory::GetActiveServiceId() - { - TInt index = iActiveChatIndex; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats(); - TInt openChatCount = openChat.Count(); - if( index < openChatCount ) - { - return iServiceEngines[i]->GetServiceId(); - } - else - { - index = index - openChatCount; - } - } - return KErrNotFound; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: IsMsgPendingL -// ----------------------------------------------------------------------------- -// -TBool CIMCVEngineFactory::IsMsgPendingL( const TInt aIndex ) const - { - TInt index = aIndex; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats(); - TInt openChatCount = openChat.Count(); - if( index < openChatCount ) - { - openChat.IsMsgPendingL( index ); - } - else - { - index = index - openChatCount; - } - } - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: ResetL -// ----------------------------------------------------------------------------- -// -void CIMCVEngineFactory::ResetL() - { - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats().ResetL(); - } - iActiveServiceId = KErrNotFound; - } -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: RegisterOpenChatObserver -// ----------------------------------------------------------------------------- -// -void CIMCVEngineFactory::RegisterOpenChatObserver(MIMCVEngineOpenChatsObserver* aChatObserver) - { - iChatObserver = aChatObserver; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats().RegisterObserver( this ); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: UnRegisterOpenChatObserver -// ----------------------------------------------------------------------------- -// -void CIMCVEngineFactory::UnRegisterOpenChatObserver() - { - iChatObserver = NULL; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iOpenChats().UnRegisterObserver(); - } - } - - -// --------------------------------------------------------- -// CIMCVEngineFactory::HandleChangeL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVEngineFactory::HandleChangeL(TInt aServiceId, TInt aIndex, TOpenChatsEventType aChangeType) - { - if( iChatObserver ) - { - TInt validIndex = KErrNotFound; - MIMCVEngineOpenChats& openChat = GetServiceEngineL( aServiceId ).OpenChats(); - TInt chatCount = openChat.Count(); - if( aIndex < chatCount && aIndex>=0 ) - { - validIndex = FindIndexL( openChat.GetTargetIdL( aIndex ) ); - } - if(validIndex >=0 ) - { - iChatObserver->HandleChangeL( aServiceId, validIndex, aChangeType ); - } - } - } - -// --------------------------------------------------------- -// CIMCVEngineFactory::SetStatusMsgL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMCVEngineFactory::SetStatusMsgL(TInt aServiceId, TInt aIndex,const TDesC & aMsg) - { - if( iChatObserver ) - { - TInt validIndex = KErrNotFound; - MIMCVEngineOpenChats& openChat = GetServiceEngineL( aServiceId ).OpenChats(); - TInt chatCount = openChat.Count(); - if( aIndex < chatCount && aIndex>=0 ) - { - validIndex = FindIndexL( openChat.GetTargetIdL( aIndex ) ); - } - if( validIndex >= 0 ) - { - iChatObserver->SetStatusMsgL( aServiceId, validIndex, aMsg ); - } - } - } -// --------------------------------------------------------------------------- -// CIMCVEngineFactory::RegisterServiceObserver() -// --------------------------------------------------------------------------- -// -void CIMCVEngineFactory::RegisterServiceObserver(MIMCVEngineServiceChangeObserver* aServiceObserver) - { - iServiceChangeObserver = aServiceObserver; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iChatInterface().RegisterChatListObserver( this ); - iServiceEngines[i]->MessageHandler().SetObserver( this ); - } - } -// --------------------------------------------------------------------------- -// CIMCVEngineFactory::UnRegisterServiceObserver() -// --------------------------------------------------------------------------- -// -void CIMCVEngineFactory::UnRegisterServiceObserver() - { - iServiceChangeObserver = NULL; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iChatInterface().UnregisterChatListObserver( this ); - iServiceEngines[i]->MessageHandler().RemoveObserver(); - } - } - -////////////////////////////////////////////////////////////// -// --------------------------------------------------------------------------- -// CIMCVEngineFactory::HandleNotifyChange() -// --------------------------------------------------------------------------- -// -void CIMCVEngineFactory::HandleNotifyChange( - TServiceId aServiceId ) - { - TRAP_IGNORE( DoHandleServiceChangeL(aServiceId ) ); - } - -// --------------------------------------------------------------------------- -// CIMCVEngineFactory::DoHandleServiceChangeL() -// --------------------------------------------------------------------------- -// -void CIMCVEngineFactory::DoHandleServiceChangeL( TInt aServiceId ) - { - // check service Id exist intable - CSPSettings* settings = CSPSettings::NewLC(); - RArray services; - CleanupClosePushL( services ); - settings->FindServiceIdsL( services ); - const TInt serviceCount = services.Count(); - TBool serviceExist = EFalse; - for ( TInt i( 0 ); i < serviceCount; i++ ) - { - TInt serviceId = services[ i ]; - TUint32 refContactUid = ContactViewUidL(*settings , serviceId ); - if ( TUid::Uid( refContactUid ) == - TUid::Uid( 0x20012423 ) - || TUid::Uid( refContactUid ) == - TUid::Uid( 0x20007B6D ) - || TUid::Uid( refContactUid ) == - TUid::Uid( 0x2002B334 ) ) - { - if( aServiceId == serviceId ) - { - serviceExist = ETrue; - } - } - } - CleanupStack::PopAndDestroy( &services ); - - // if service does not exist delete the engine if created - if( !serviceExist ) - { - // delete if already created - TInt count = iServiceEngines.Count(); - for( TInt i=0; iGetServiceId() == aServiceId ) - { - if( iServiceChangeObserver ) - { - // this will delete the new branding icosn for smile etc. - iServiceChangeObserver->HandleServiceDeletedL( aServiceId ); - } - CIMCVEngine* engine = iServiceEngines[i]; - engine->OpenChats().UnRegisterObserver(); - engine->MessageHandler().RemoveObserver(); - engine->ChatInterface().UnregisterChatListObserver( this ); - - iServiceEngines.Remove(i); - delete engine; - engine = NULL; - iServiceEngines.Compress(); - break; - } - } - if( !iServiceEngines.Count() ) - { - ShutDownConversationviewL(); - } - } - else - { - // service exist check whether we have service engine or not - // create if we dont have - TBool newService = ETrue; - TInt count = iServiceEngines.Count(); - for( TInt i=0; iGetServiceId() == aServiceId ) - { - newService = EFalse; - break; - } - } - if ( newService && CheckValidIMServiceL( *settings, aServiceId ) ) - { - // create if NULL and return - GetServiceEngineL( aServiceId ); - if( iServiceChangeObserver ) - { - // this will create the new branding icosn for smile etc. - iServiceChangeObserver->HandleNewServiceL( aServiceId ); - } - } - } - CleanupStack::PopAndDestroy( settings ); - } - -// --------------------------------------------------------------------------- -// CIMCVEngineFactory::HandleError() -// --------------------------------------------------------------------------- -// -void CIMCVEngineFactory::HandleError( TInt /*aError*/ ) - { - } - // --------------------------------------------------------------------------- -// CIMCVEngineFactory::ShutDownConversationviewL() -// --------------------------------------------------------------------------- -// -void CIMCVEngineFactory::ShutDownConversationviewL() - { - // Kills cv if running - RWsSession ws; - User::LeaveIfError( ws.Connect() ); - CleanupClosePushL( ws ); - TApaTaskList list( ws ); - TApaTask task( list.FindApp( KConversationViewAppUid ) ); - if ( task.Exists() ) - { - task.EndTask(); - } - CleanupStack::PopAndDestroy( &ws ); // ws - } -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory::HandlePresenceChangedL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVEngineFactory::HandlePresenceChangedL(TInt aServiceId, const TDesC& aBuddyId ) - { - if( iServiceChangeObserver ) - { - // this will create the new branding icosn for smile etc. - iServiceChangeObserver->HandlePresenceChangedL( aServiceId , aBuddyId ); - } - } -// --------------------------------------------------------- -// CIMCVEngineFactory::HandleOperationCompletdL -// Handles operation completion -// --------------------------------------------------------- -// -void CIMCVEngineFactory::HandleOperationCompletdL(TInt aServiceId , MIMCVEngineMessage::TMessagerType aType , TInt aResult ) - { - if( iServiceChangeObserver ) - { - // this will create the new branding icosn for smile etc. - iServiceChangeObserver->HandleOperationCompletdL( aServiceId , aType, aResult ); - } - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory::HandleConnectionTerminatedL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVEngineFactory::HandleConnectionEventL( TInt aServiceId, TIMCVConnectionState aState, TInt aReason ) - { - if( iServiceChangeObserver ) - { - // this will create the new branding icosn for smile etc. - iServiceChangeObserver->HandleConnectionEventL( aServiceId , aState, aReason ); - } - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineFactory: HandleChatListEvent -// ----------------------------------------------------------------------------- -// -void CIMCVEngineFactory::HandleChatListEvent(TInt aServiceId, TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* aContainerInfo - ) - { - if( iServiceChangeObserver ) - { - // this will create the new branding icosn for smile etc. - iServiceChangeObserver->HandleChatListEvent( aServiceId , aEvent, aContainerInfo ); - } - } -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginemessagebase.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginemessagebase.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,282 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Base class for message -* -*/ - -#include "cimcvenginemessagebase.h" -#include "mimcvenginemessagecontainerinfo.h" -#include "imcvuiliterals.h" -#include -#include -#include -#include "imcvlogger.h" - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::CIMCVEngineMessageBase -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageBase::CIMCVEngineMessageBase() - { - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::ConstructL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageBase::ConstructL(const TDesC& aSender, - const TDesC& aRecipient ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::ConstructL() start") ); - - iSender = aSender.AllocL(); - iRecipient = aRecipient.AllocL(); - - - iMessagerType = EMessageOther; - iSystemMessageType = ESystemMessageNone; - iTime.HomeTime(); - iMessageVersion = KVersionNum; - iMessageType = EMessagePTOP; - - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::ConstructL() end") ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::~CIMCVEngineMessageBase -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageBase::~CIMCVEngineMessageBase() - { - //__CHAT_ASSERT_DEBUG( iOwnerCount == 0 ); - delete iSender; - delete iRecipient; - delete iText; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::TimeStamp -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -const TTime& CIMCVEngineMessageBase::TimeStamp() const - { - return iTime; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::SetTimeStamp -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageBase::SetTimeStamp(TTime aTime ) - { - iTime = aTime ; - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::MessageType -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage::TMessageType CIMCVEngineMessageBase::MessageType() const - { - return iMessageType; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::MessagerType -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage::TMessagerType CIMCVEngineMessageBase::MessagerType() const - { - return iMessagerType; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::OperationCode -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TXIMPRequestId CIMCVEngineMessageBase::OperationCode() const - { - return iOperationCode; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::Recipient -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageBase::SetOperationCode(TXIMPRequestId aOperationId ) - { - iOperationCode = aOperationId; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::Recipient -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -const TDesC& CIMCVEngineMessageBase::Recipient() const - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::Recipient() start") ); - if( iRecipient ) - { - return *iRecipient; - } - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::Recipient() end") ); - return KNullDesC; - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::SetMessageContainerInfo -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageBase::SetContainerInfo( MIMCVEngineMessageContainerInfo* aInfo ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetContainerInfo() start") ); - iInfo = aInfo; - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetContainerInfo() end") ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::Text -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -const TDesC& CIMCVEngineMessageBase::Text() const - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::Text() start") ); - if( iText ) - { - return *iText; - } - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::Text() end") ); - return KNullDesC; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::Sender -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -const TDesC& CIMCVEngineMessageBase::Sender() const - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::Sender() start") ); - if( iSender ) - { - return *iSender; - } - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::Sender() end") ); - return KNullDesC; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::SizeInBytes -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineMessageBase::SizeInBytes() const - { - return iSender->Size() + - iRecipient->Size(); - } - -// --------------------------------------------------------- -// CIMCVEngineMessageBase::FailedMessage() -// --------------------------------------------------------- -// -TBool CIMCVEngineMessageBase::FailedMessage() const - { - return iFailed; - } - -// --------------------------------------------------------- -// CIMCVEngineMessageBase::FailedMessage() -// --------------------------------------------------------- -// -void CIMCVEngineMessageBase::SetFailed( TBool aFailed /* = ETrue */ ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetFailed() start") ); - iFailed = aFailed; - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetFailed() end") ); - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::SetMessageType -// ----------------------------------------------------------------------------- -// -void CIMCVEngineMessageBase::SetMessageType( TMessageType aNewType ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetMessageType() start") ); - iMessageType = aNewType; - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetMessageType() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::SetMessagerType -// ----------------------------------------------------------------------------- -// -void CIMCVEngineMessageBase::SetMessagerType( TMessagerType aNewType ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetMessagerType() start") ); - iMessagerType = aNewType; - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetMessagerType() end") ); - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::SetSystem -// ----------------------------------------------------------------------------- -// -void CIMCVEngineMessageBase::SetSystem( TSystemMessage aType ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetSystem() start") ); - iSystemMessageType = aType; - iMessagerType = EMessageSent; - iMessageType = EMessageSystem; - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SetSystem() end") ); - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::SystemMessageType -// ----------------------------------------------------------------------------- -// -MIMCVEngineMessage::TSystemMessage CIMCVEngineMessageBase::SystemMessageType() - { - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SystemMessageType() start") ); - if( iMessageType != EMessageSystem ) - { - // not a system message - return ESystemMessageNone; - } - IM_CV_LOGS(TXT("CIMCVEngineMessageBase::SystemMessageType() end") ); - return iSystemMessageType; - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageBase::IncreaseOwnerCount -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageBase::IncreaseOwnerCount() - { - ++iOwnerCount; - } - -//----------------------------------------------------------------------------- -// CCAMessageBase::DecreaseOwnerCount -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TBool CIMCVEngineMessageBase::DecreaseOwnerCount() - { - return ( --iOwnerCount <= 0 ); - } - - -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginemessagecontainer.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginemessagecontainer.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,738 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message container class implementation -* -*/ - -#include "cimcvenginemessagecontainer.h" -#include "mimcvenginemessageobserver.h" -#include "mimcvenginechatinterface.h" // KSendBufferId -#include "cimcvenginemessagebase.h" -#include -#include "imcvuiliterals.h" -#include "imcvlogger.h" -#include -#include "mimcvenginebuffermemoryhandler.h" -#include "mimcvenginenewmsgobserver.h" - -// needed to skip domains in domain-neutral comparison (TUint version) -const TUint KAtUInt( '@' ); - -// general colon needed in various places -_LIT( KColon, ":" ); - -// general slash needed in various places -_LIT( KSlash, "/" ); - -// needed to skip domains in domain-neutral comparison -_LIT( KAt, "@" ); - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::CIMCVEngineMessageContainer -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageContainer::CIMCVEngineMessageContainer( - MIMCVEngineBufferMemoryHandler& aMemoryHandler ) -: iMemoryHandler( aMemoryHandler ) - { - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::~CIMCVEngineMessageContainer -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageContainer::~CIMCVEngineMessageContainer() - { - - - for( TInt a( 0 ); a < iMessageContainer.Count(); ++a ) - { - if( iMessageContainer[ a ]->DecreaseOwnerCount() ) - { - delete iMessageContainer[ a ]; - } - } - iMessageContainer.Reset(); - - - delete iTargetId; - delete iBuddyDisplayName; - delete iDecodedTargetId; - delete iEditerMessge; - delete iContactLink; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::NewL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageContainer* CIMCVEngineMessageContainer::NewL( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineBufferMemoryHandler& aMemoryHandler, - TContainerType aType ) - { - CIMCVEngineMessageContainer* self = CIMCVEngineMessageContainer::NewLC( - aServiceId, - aTargetId, - aDisplayName, - aContactLink, - aMemoryHandler, - aType ); - CleanupStack::Pop( self ); - return self; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::NewLC -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageContainer* CIMCVEngineMessageContainer::NewLC( - TInt aServiceId, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - MIMCVEngineBufferMemoryHandler& aMemoryHandler, - TContainerType aType ) - { - CIMCVEngineMessageContainer* self = - new ( ELeave ) CIMCVEngineMessageContainer( aMemoryHandler ); - CleanupStack::PushL( self ); - self->ConstructL( aServiceId, aTargetId,aDisplayName,aContactLink, aType ); - return self; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ConstructL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::ConstructL( - TInt /*aServiceId*/, - const TDesC& aTargetId, - const TDesC& aDisplayName, - const TDesC8& aContactLink, - TContainerType aType ) - { - iTargetId = aTargetId.AllocL(); - iBuddyDisplayName = aDisplayName.AllocL(); - iContactLink = aContactLink.Alloc(); - iDecodedTargetId = EscapeUtils::EscapeDecodeL( *iTargetId ); - ResolveType( aType ); - - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::UnreadCount -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineMessageContainer::UnreadCount( - MIMCVEngineMessageReadInterface::TUnreadFilter aUnreadFilter ) const - { - TInt countOfAll = iMessageContainer.Count(); - TInt unreadCount = countOfAll - iUnreadOffset; - if( aUnreadFilter != EUnreadAll ) - { - for( TInt a = countOfAll - 1; a >= iUnreadOffset; --a ) - { - if( iMessageContainer[ a ]->MessagerType() == MIMCVEngineMessage::EMessageSent ) - { - unreadCount--; - } - } - } - return unreadCount; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::StoreEditerMessageL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::StoreEditerMessageL(const TDesC& aEditorMessage ) - { - if( iEditerMessge) - { - delete iEditerMessge; - iEditerMessge = NULL; - } - iEditerMessge = aEditorMessage.AllocL(); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::GetEditerMessage -// ( Other items commented in header ) -//----------------------------------------------------------------------------- - -const TDesC& CIMCVEngineMessageContainer::GetEditerMessage() - { - if( iEditerMessge) - { - return *iEditerMessge; - } - return KNullDesC; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::MessageCount -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineMessageContainer::MessageCount() const - { - // Offset is index to first unread message. It is exatly same as count of - // read messages. - return iUnreadOffset; - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::Read -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::Read( TReadType aReadType, TInt aAmount /* = 0 */ ) - { - TInt messageCount( iMessageContainer.Count() ); - TInt originalUnreadCount = UnreadCount( ); - - switch( aReadType ) - { - case EReadAll: - iUnreadOffset = messageCount; - break; - case EReadAmount: - iUnreadOffset+= aAmount; - break; - case EReadOne: - ++iUnreadOffset; - break; - default: - return; - } - - // Cannot be more than messageCount - if( iUnreadOffset > messageCount ) - { - iUnreadOffset = messageCount; - } - - // Inform observers only if unreadcount is changed. - if( originalUnreadCount != UnreadCount() ) - { - if (( iChatObserver ) && (!iActiveChat)) - { - TRAP_IGNORE( iChatObserver->HandleChatEventL( - MIMCVEngineNewMsgObserver::EUnreadCountChanged ) ); - } - } - - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::Message -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage& CIMCVEngineMessageContainer::Message( TInt aIndex ) const - { - //__CHAT_ASSERT_DEBUG( aIndex >= 0 && aIndex < MessageCount() ); - return *iMessageContainer[ aIndex ]; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ReadNextUnread -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage& CIMCVEngineMessageContainer::ReadNextUnread() - { - //__CHAT_ASSERT_DEBUG( UnreadCount() != 0 ); - Read( EReadOne ); - return *iMessageContainer[ MessageCount() - 1 ]; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ReadUnreadFromIndex -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage& CIMCVEngineMessageContainer::ReadUnreadFromIndex( TInt aIndex ) - { - //__CHAT_ASSERT_DEBUG( UnreadCount() != 0 ); - //__CHAT_ASSERT_DEBUG( aIndex >= 0 && aIndex < iMessageContainer.Count() ); - Read( EReadOne ); - return *iMessageContainer[aIndex]; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::SetObserver -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::SetObserver( MIMCVEngineMessageObserver* aObserver ) - { - iObserver = aObserver; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::SetObserver -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TPtrC CIMCVEngineMessageContainer::Name() const - { - IM_CV_LOGS(TXT("CIMCVEngineMessageContainer::Name Start")); - if( iBuddyDisplayName && iBuddyDisplayName->Length()) - { - IM_CV_LOGS(TXT("to_del CIMCVEngineMessageContainer::Name iBuddyDisplayName= %S"),&(*iBuddyDisplayName) ); - //IM_CV_LOGS(TXT("to_del CIMCVEngineMessageContainer::Name iBuddyDisplayName length = %d"),iBuddyDisplayName->Length() ); - return *iBuddyDisplayName; - } - if( iTargetId ) - { - IM_CV_LOGS(TXT("to_del CIMCVEngineMessageContainer::target iTargetId= %S"), &(*iTargetId)); - return DisplayId( *iTargetId ); - } - return KNullDesC(); - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::DisplayName -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TDesC CIMCVEngineMessageContainer::DisplayName() const - { - IM_CV_LOGS(TXT("CIMCVEngineMessageContainer::DisplayName Start" )); - if( iBuddyDisplayName && iBuddyDisplayName->Length()) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageContainer::DisplayName EChatContainer: %s"), &(*iBuddyDisplayName)); - return *iBuddyDisplayName; - } - return KNullDesC(); - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::SetName -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::SetNameL(const TDesC& aDisplayName) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageContainer::SetNameL Start")); - //if the iBuddydisplayName is same as aDisplayName - // then no need to set it again. - if(iBuddyDisplayName && (aDisplayName.Compare(*iBuddyDisplayName)!=0)) - { - delete iBuddyDisplayName; - iBuddyDisplayName = NULL; - IM_CV_LOGS(TXT("CIMCVEngineMessageContainer::SetName=%S"),&aDisplayName); - iBuddyDisplayName = aDisplayName.AllocL(); - } - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::SetName -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::SetLinkL(const TDesC8& aContactLink) - { - IM_CV_LOGS(TXT(" CIMCVEngineMessageContainer::SetLinkL Start")); - //if the iContactLink is same as aContactLink - // then no need to set it again. - if(iContactLink && (aContactLink.Compare(*iContactLink)!=0)) - { - delete iContactLink; - iContactLink = NULL; - IM_CV_LOGS(TXT(" CIMCVEngineMessageContainer::SetLinkL=%S"),&aContactLink); - iContactLink = aContactLink.AllocL(); - } - - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ContactLink -// ( Other items commented in header ) -//----------------------------------------------------------------------------- - -TPtrC8 CIMCVEngineMessageContainer::ContactLink() const - { - return *iContactLink; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::DeleteMessage -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::DeleteMessage( TInt aIndex ) - { - MIMCVEngineMessage* target = &Message( aIndex ); - iMessageContainer.Remove( aIndex ); - iContainerSizeInBytes -= target->SizeInBytes(); - --iUnreadOffset; - - if( iObserver ) - { - iObserver->HandleMessageEvent( MIMCVEngineMessageObserver::EMessageDeleted, - aIndex ); - } - - if( target->DecreaseOwnerCount() ) - { - delete target; - } - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::AppendL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::AppendL( MIMCVEngineMessage* aMessage, TBool aSharedOwnership ) - { - if( !aMessage ) - { - User::Leave( KErrArgument ); - } - - if( !aSharedOwnership ) - { - CleanupDeletePushL( aMessage ); - } - - // Check memory status - // if failes, leave with KErrNoMemory - if( !iMemoryHandler.FreeMemoryIfNeededL( aMessage->SizeInBytes() ) ) - { - User::Leave( KErrNoMemory ); - } - - iMessageContainer.AppendL( aMessage ); - iContainerSizeInBytes += aMessage->SizeInBytes(); - - if( !aSharedOwnership ) - { - CleanupStack::Pop( aMessage ); - } - - aMessage->IncreaseOwnerCount(); - - aMessage->SetContainerInfo( this ); - - IM_CV_LOGS(TXT( "Sender %s, Recipient %s" ), - &aMessage->Sender(), - &aMessage->Recipient() ); - - - if( iObserver ) - { - iObserver->HandleMessageEvent( MIMCVEngineMessageObserver::ENewMessage ); - } - - if ( ( iChatObserver ) && (!iActiveChat) ) - { - iChatObserver->HandleChatEventL( MIMCVEngineNewMsgObserver::EUnreadCountChanged, - aMessage ); - } - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ServerAddress -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -// -TTime CIMCVEngineMessageContainer::Time() - { - TTime time = Time::NullTTime(); - TInt count = iMessageContainer.Count(); - if( count == 0 ) - { - // no messages, return null - return time; - } - return iMessageContainer[count - 1]->TimeStamp(); - } - - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::Target -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -const TDesC& CIMCVEngineMessageContainer::Target() const - { - if( !iTargetId ) - { - return KNullDesC; - } - return *iTargetId; - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::OrderUid -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineMessageContainer::OrderUid( const CIMCVEngineMessageContainer& aSourceA, - const CIMCVEngineMessageContainer& aSourceB ) - { - - // points to user part of id - TPtrC ptrId1( aSourceA.ComparableTarget() ); - TPtrC ptrId2( aSourceB.ComparableTarget() ); - - // find out if we have domains in the ids - TInt domainPos1( ptrId1.Locate( KAtUInt ) ); - TInt domainPos2( ptrId2.Locate( KAtUInt ) ); - - TBool domainIn1( KErrNotFound != domainPos1 ); - TBool domainIn2( KErrNotFound != domainPos2 ); - - // points to domains in the neutral id - TPtrC ptrDom1( KNullDesC ); - TPtrC ptrDom2( KNullDesC ); - - // points to user parts in the neutral id - TPtrC ptrUid1( ptrId1 ); - TPtrC ptrUid2( ptrId2 ); - - // separate user id parts and domain parts - if ( domainIn1 ) - { - ptrDom1.Set( ptrId1.Mid( domainPos1 + 1) ); - ptrUid1.Set( ptrId1.Mid( 0, domainPos1 ) ); - } - - if ( domainIn2 ) - { - ptrDom2.Set( ptrId2.Mid( domainPos2 + 1) ); - ptrUid2.Set( ptrId2.Mid( 0, domainPos2 ) ); - } - - // Create custom collation method to ignore punctuations - // index 0 gets the default method - TCollationMethod collation = - *Mem::CollationMethodByIndex( 0 ); - collation.iFlags |= TCollationMethod::EIgnoreNone; - - // domains are compared only when it is really needed - // check if userid part is the same in both ids - TInt idResult = ptrUid1.CompareC( ptrUid2, KCollationLevel, &collation ); - - if( idResult != 0 ) - { - return idResult; - } - - // id part is same, we have to compare domain - - // If domain comparison is neutral and one id is without domain - // -> Domains are same. Other situation domainResult stays valid. - if ( domainIn1 ^ domainIn2 ) - { - return 0; - } - else - { - return ptrDom1.CompareC( ptrDom2, KCollationLevel, &collation ); - } - } - - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ContainerType -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessageReadInterface::TContainerType CIMCVEngineMessageContainer::ContainerType() const - { - return iContainerType; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ResolveType -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::SetChatObserver( MIMCVEngineNewMsgObserver* aObserver ) - { - iChatObserver = aObserver; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ResolveType -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageContainer::ResolveType( TContainerType aType ) - { - if( aType != ENoneContainer ) - { - iContainerType = aType; - } - else if( iTargetId->Compare( KSendBufferId ) == 0 ) - { - iContainerType = ESendContainer; - } - else - { - iContainerType = EChatContainer; - } - } - - - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::TargetId -// ( Other items commented in header ) -// ----------------------------------------------------------------------------- -// -MIMCVEngineMessageContainerInfo& CIMCVEngineMessageContainer::TargetId() - { - return *this; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::Lock -// locks messagecontainer if needed. -// ----------------------------------------------------------------------------- -// -void CIMCVEngineMessageContainer::Lock( TBool aLocked ) - { - iLocked = aLocked; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ComparableTarget -// ( Other items commented in header ) -// ----------------------------------------------------------------------------- -// -const TDesC& CIMCVEngineMessageContainer::ComparableTarget() const - { - if ( !iDecodedTargetId ) - { - return KNullDesC; - } - return *iDecodedTargetId; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::AllMessagesCount -// ( Other items commented in header ) -// ----------------------------------------------------------------------------- -// -TInt CIMCVEngineMessageContainer::AllMessagesCount() const - { - return iMessageContainer.Count(); - } - -// ----------------------------------------------------------------------------- -// CCABufferManager::NotifyContactForPending -// ( Other items commented in header ) -// ----------------------------------------------------------------------------- -// -MIMCVEngineMessage& CIMCVEngineMessageContainer::MessageFromAll( TInt aIndex ) const - { - //__CHAT_ASSERT_DEBUG( aIndex >= 0 && aIndex < AllMessagesCount() ); - return *iMessageContainer[ aIndex ]; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::DeleteMessageFromAll -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -// -void CIMCVEngineMessageContainer::DeleteMessageFromAll( TInt aIndex ) - { - MIMCVEngineMessage* target = &MessageFromAll( aIndex ); - iMessageContainer.Remove( aIndex ); - iContainerSizeInBytes -= target->SizeInBytes(); - if( iUnreadOffset > aIndex ) - { - --iUnreadOffset; - } - - if( iObserver ) - { - iObserver->HandleMessageEvent( MIMCVEngineMessageObserver::EMessageDeleted, - aIndex ); - } - - if( target->DecreaseOwnerCount() ) - { - delete target; - } - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::IsLocked -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -// -TBool CIMCVEngineMessageContainer::IsLocked() const - { - return iLocked ; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ContainerSizeInBytes -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -// -TInt CIMCVEngineMessageContainer::ContainerSizeInBytes() const - { - return iContainerSizeInBytes; - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::SetActive -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -// -void CIMCVEngineMessageContainer::SetActive( TBool aActiveChat ) - { - iActiveChat = aActiveChat; - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::IsActive -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -// -TBool CIMCVEngineMessageContainer::IsActive() - { - return iActiveChat; - } - - - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::DisplayId -// ----------------------------------------------------------------------------- -// -TPtrC CIMCVEngineMessageContainer::DisplayId( const TDesC& aId, TBool aDomainHiding ) - { - TPtrC ret( aId ); - - // locate ":" for userid, groupid. - // locate "/" for list id. - TInt pos = aId.FindC( aDomainHiding ? KSlash : KColon ); - - if ( ( pos != KErrNotFound) && ( pos != aId.Length()-1) ) - { - // contains the special character, and it is not the last char - // remove everything before the special char (including the char) - ret.Set( aId.Mid( pos + 1 ) ); - } - if( aDomainHiding) - { - // remove also the domain part - TInt domainPos = ret.FindC( KAt ); - if ( ( domainPos != KErrNotFound ) && ( domainPos != 0 ) ) - { - ret.Set( ret.Mid( 0, domainPos ) ); - } - - } - - return ret; - } - - -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginemessagecreator.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginemessagecreator.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message creater class implementation -* -*/ - - -#include "cimcvenginemessagecreator.h" -#include "cimcvenginetextmessage.h" -#include "imcvuiliterals.h" -#include "imcvlogger.h" - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageCreator::CIMCVEngineMessageCreator -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageCreator::CIMCVEngineMessageCreator() - { - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::CIMCVEngineMessageCreator() start") ); - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::CIMCVEngineMessageCreator() end") ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageCreator::~CIMCVEngineMessageCreator -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageCreator::~CIMCVEngineMessageCreator() - { - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageCreator::NewL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageCreator* CIMCVEngineMessageCreator::NewL() - { - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::NewL() start") ); - CIMCVEngineMessageCreator* self = new ( ELeave ) CIMCVEngineMessageCreator(); - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::NewL() end") ); - return self; - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageCreator::CreateMessageL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage* CIMCVEngineMessageCreator::CreateMessageL( const SMessageData& aData ) const - { - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::CreateMessageL() start") ); - if( aData.iContentType == MIMCVEngineMessage::EContentText ) // Text message - { - return CreateTextMessageL( aData ); - } - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::CreateMessageL() end") ); - return NULL; - } - - - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageCreator::CreateTextMessageL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage* CIMCVEngineMessageCreator::CreateTextMessageL( - const SMessageData& aData ) const - { - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::CreateTextMessageL() start") ); - CIMCVEngineTextMessage* message = CIMCVEngineTextMessage::NewL( - aData.iSenderId, - aData.iTargetId, - aData.iText ); - message->SetMessagerType( aData.iMessager ); - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::CreateTextMessageL() end") ); - return message; - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageCreator::CreateFailedMessageL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage* CIMCVEngineMessageCreator::CreateFailedMessageL( - const MIMCVEngineMessage* pSource ) const - { - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::CreateFailedMessageL() start") ); - CIMCVEngineTextMessage* message = CIMCVEngineTextMessage::NewLC( - pSource->Sender(), - pSource->Recipient(), - pSource->Text() ); - message->SetFailedL(); - CleanupStack::Pop( message ); - message->SetMessagerType( pSource->MessagerType() ); - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::CreateFailedMessageL() end") ); - - return message; - } - - - -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginemessagehandler.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginemessagehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,958 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: message handler class implementation -* -*/ - -#include "cimcvenginemessagehandler.h" - -#include "mimcvenginechatinterface.h" -#include "mimcvenginemessageswriteinterface.h" -#include "imcvlogger.h" -#include "mimcvenginenewmessagehandler.h" -#include "imcvenginemessageutils.h" -#include "imcvuiliterals.h" - -// presence cache -#include - - -#include -#include -#include -#include -#include -#include -#include - -#include // KMaxDataTypeLength -#include // CnvUtfConverter - -// imcache related headers -#include -#include -#include - -#include -#include - -#include "cimcvengineopenchats.h" -#include "mimcvenginebuffermemoryhandler.h" -#include "cimcvenginestoragelistener.h" - -const TInt KMemorySafeValue = 1024; // One kbyte for safe memory allocation. - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::CIMCVEngineMessageHandler -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageHandler::CIMCVEngineMessageHandler( MIMCVEngineChatInterface& aChatInterface, - MIMCVEngineMessageCreator& aMessageCreator, - MXIMPContext* aContext, - TInt aServiceId ) - : iMessageCreator( aMessageCreator ), - iChatInterface( aChatInterface ), - iContext(aContext), - iServiceId( aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::CIMCVEngineMessageHandler() start") ); - iPresenceStatus =EUnknown; // default status - iServiceName = NULL; - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::CIMCVEngineMessageHandler() end") ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::~CIMCVEngineMessageHandler -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageHandler::~CIMCVEngineMessageHandler() - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::~CIMCVEngineMessageHandler() start") ); - delete iStorageListener; - - iObserver = NULL; - delete iServiceName; - delete iPresenceCacheReader ; - if( iIMCacheUpdater ) - { - iIMCacheUpdater->UnRegisterObserver(*this); - } - if( iIMCacheFactory ) - { - CIMCacheFactory::Release(); - iIMCacheUpdater = NULL; - iIMCacheFactory = NULL; - } - if(iImFeatures ) - { - delete iImFeatures; - iImFeatures = NULL; - } - iHoldingMessages.Close(); - delete iOpenChats; - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::~CIMCVEngineMessageHandler() end") ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::NewL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageHandler* CIMCVEngineMessageHandler::NewL( - MIMCVEngineChatInterface& aChatInterface, - MIMCVEngineMessageCreator& aMessageCreator, - MXIMPContext* aContext, - TInt aServiceId, - const TDesC& aOwnId) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::NewL() start") ); - CIMCVEngineMessageHandler* self = CIMCVEngineMessageHandler::NewLC( - aChatInterface, - aMessageCreator, - aContext, - aServiceId, - aOwnId ); - CleanupStack::Pop( self ); - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::NewL() end") ); - return self; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::NewLC -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineMessageHandler* CIMCVEngineMessageHandler::NewLC( - MIMCVEngineChatInterface& aChatInterface, - MIMCVEngineMessageCreator& aMessageCreator, - MXIMPContext* aContext, - TInt aServiceId, - const TDesC& aOwnId) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::NewLC() start") ); - CIMCVEngineMessageHandler* self = new ( ELeave ) CIMCVEngineMessageHandler( - aChatInterface, - aMessageCreator, - aContext, - aServiceId ); - CleanupStack::PushL( self ); - self->ConstructL(aOwnId); - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::NewLC() end") ); - return self; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::ConstructL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::ConstructL( const TDesC& aOwnId ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ConstructL() start") ); - iStorageListener = CIMCVEngineStorageListener::NewL(*this); - // read the service name - ReadServiceNameL( iServiceId ); - // ximp im plugin - if (iContext) - { - iImFeatures = MImFeatures::NewL(iContext); - } - //initialize the presence cache. - iPresenceCacheReader = MPresenceCacheReader2::CreateReaderL(); - iPresenceCacheReader->SetObserverForSubscribedNotifications(this); - - // im cache factory - iIMCacheFactory = CIMCacheFactory::InstanceL(); - // im cache update interface - iIMCacheUpdater = iIMCacheFactory->CreateUpdaterL(iServiceId, aOwnId, ETrue );//registration required (ETrue). - iIMCacheUpdater->RegisterObserverL(*this); - - iOpenChats = CIMCVEngineOpenChats::NewL(*this, iChatInterface,iServiceId ); - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ConstructL() end") ); - } - -// --------------------------------------------------------- -// CIMCVEngineMessageHandler::ReadServiceNameL() -// --------------------------------------------------------- -// -void CIMCVEngineMessageHandler::ReadServiceNameL(TInt aServiceId ) - { - CSPSettings* settings = CSPSettings::NewLC(); - // read service name - CSPEntry* entry = CSPEntry::NewLC(); - settings->FindEntryL( aServiceId, *entry ) ; - - iServiceName = NULL; - iServiceName = entry->GetServiceName().AllocL(); - CleanupStack::PopAndDestroy(2); // entry, settings - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::HandleDeliveryReportL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::HandleDeliveryReportL(TXIMPRequestId aOperatioCode, TInt aResult) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandleDeliveryReportL() start") ); - - TInt holdingMessages = iHoldingMessages.Count(); - MIMCVEngineMessage* message = NULL; - // Check if holding messages hold one ready message - for(TInt index= 0 ; index < holdingMessages && !message; ++index ) - { - MIMCVEngineMessage* msg = iHoldingMessages[ index ]; - if( msg->OperationCode() == aOperatioCode ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler:: pending message index = %d "), index ); - message = msg; - if( aResult != KErrNone ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler:: message failed to deliver") ); - HandleMessageSentFailedL( *iHoldingMessages[ index ] ); - } - iHoldingMessages.Remove(index); - NotifyOperationCompletdL(message->MessagerType(), aResult ); - } - } - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandleDeliveryReportL() end") ); - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::HandleIMCacheMessageEventL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- - void CIMCVEngineMessageHandler::HandleConnectionEventL( TIMCVConnectionState aState, TInt aReason ) - { - if( iObserver ) - { - iObserver->HandleConnectionEventL( iServiceId, aState, aReason ); - } - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::HandleIMCacheMessageEventL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::HandleIMCacheEventL(TIMCacheEventType aEvent, TAny* aChatMessage ) - { - switch (aEvent) - { - case EIMCacheNewMessage: - { - if (!aChatMessage) - { - return; - } - SIMCacheMessageData* chatMesssge = static_cast( aChatMessage ) ; - - MIMCVEngineMessage::TMessageType messageType = GetEngineMessageType( chatMesssge->iMessageType ) ; - MIMCVEngineMessage::TMessagerType messagerType = GetEngineMessagerType( chatMesssge->iMessagerType ); - MIMCVEngineMessage::TContentType contentType = GetEngineContentType( chatMesssge->iContentType ) ; - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandleIMCacheMessageEventL() Msg ") ); - - TTime time = chatMesssge->iTime; - - TPtrC buddyId = chatMesssge->iBuddyId->Des(); - - if ( buddyId != KNullDesC ) - { - - if( !iChatInterface.MemoryHandler().FreeMemoryIfNeededL( KMemorySafeValue + chatMesssge->iText->Size() ) ) - { - //NotifyMessageError( KErrNoMemory, NULL ); - User::Leave( KErrNoMemory ); - } - } - - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandleIMCacheMessageEventL() Msg %S"), &buddyId ); - - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KNullDesC, - buddyId, - chatMesssge->iText->Des(), - contentType, - messagerType - }; - MIMCVEngineMessageWriteInterface& messageContainer = - iChatInterface.MessageWriteInterfaceL(iServiceId, buddyId ); - - MIMCVEngineMessage* message = iMessageCreator.CreateMessageL( data ); - message->SetTimeStamp(time); - - // Add message - IMCVEngineMessageUtils::AppendMessageWithDateStampL( - *message, - messageContainer, - iMessageCreator ); - - - break; - } - case EIMCacheNewChat: - { - if (!aChatMessage) - { - return; - } - - SIMCacheChatItem* chatItem = static_cast( aChatMessage ) ; - - iStorageListener->GetContactLinkInfoL( chatItem->iServiceId,*(chatItem->iBuddyId)); - - - MIMCVEngineMessageReadInterface& messageContainer = - iChatInterface.MessageReadInterfaceL( chatItem->iServiceId, - chatItem->iBuddyId->Des() ); - break; - } - case EIMCacheChatClosed: - { - if (!aChatMessage) - { - return; - } - SIMCacheChatItem* chatItem = static_cast( aChatMessage ) ; - iChatInterface.DeleteChatL( chatItem->iServiceId, chatItem->iBuddyId->Des() ); - break; - } - case EIMCacheAllChatClosed: - { - IM_CV_LOGS (TXT("CIMCVEngineMessageHandler :: HandleChatList Event AL CHAT DELETED")); - iChatInterface.CloseAllContainers(); - break; - } - case EIMCacheRequestCompleted : - { - NotifyOperationCompletdL(MIMCVEngineMessage::EMessageStarted, KErrNone ) ; - break; - } - default: - break; - - } - - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::GetEngineMessageType -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage::TMessageType CIMCVEngineMessageHandler::GetEngineMessageType(TIMCacheMessageType aType ) - { - MIMCVEngineMessage::TMessageType messageType = MIMCVEngineMessage::EMessageInvalid; - switch( aType ) - { - case EIMCMessagePTOP: - { - messageType = MIMCVEngineMessage::EMessagePTOP; - break; - } - case EIMCMessageSystem: - { - messageType = MIMCVEngineMessage::EMessageSystem; - break; - } - default : - { - break; - } - } - return messageType; - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::GetEngineMessagerType -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage::TMessagerType CIMCVEngineMessageHandler::GetEngineMessagerType(TIMCacheMessagerType aType ) - { - MIMCVEngineMessage::TMessagerType messagerType = MIMCVEngineMessage::EMessageOther; - switch( aType ) - { - case EIMCMessageSent: - { - messagerType = MIMCVEngineMessage::EMessageSent; - break; - } - case EIMCMessageReceived: - { - messagerType = MIMCVEngineMessage::EMessageReceived; - break; - } - default : - { - break; - } - } - return messagerType; - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::GetEngineContentType -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage::TContentType CIMCVEngineMessageHandler::GetEngineContentType(TIMCacheContentType aType ) - { - MIMCVEngineMessage::TContentType contentType = MIMCVEngineMessage::EContentInvalid; - switch( aType ) - { - case EIMCContentText: - { - contentType = MIMCVEngineMessage::EContentText; - break; - } - case EIMCContentOther: - { - contentType = MIMCVEngineMessage::EContentOther; - break; - } - default : - { - break; - } - } - return contentType; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::MessageCreator -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessageCreator& CIMCVEngineMessageHandler::MessageCreator() const - { - return iMessageCreator; - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::StartNewConversationL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::StartNewConversationL(const TDesC& aRecipientId ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::StartNewConversationL() start") ); - if(iIMCacheUpdater) - { - iIMCacheUpdater->StartNewConversationL(aRecipientId); - } - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::StartNewConversationL() end") ); - } - - //----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::CloseConversationL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineMessageHandler::CloseConversationL(const TDesC& aBuddyId ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::CloseConversationL() start ") ); - if(iIMCacheUpdater) - { - iIMCacheUpdater->CloseConversationL( aBuddyId );; - } - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::CloseConversation () %S ************"), &aBuddyId); - UnSubscribePresenceL (aBuddyId); - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::CloseConversationL() end ") ); - return KErrNone; - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::CloseAllConversationL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::CloseAllConversationL() - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::CloseAllConversationL() start") ); - iPresenceStatus = EOffline; - if(iIMCacheUpdater ) - { - iIMCacheUpdater->CloseAllConversationL(); - } - TInt count = iOpenChats->Count (); - - for (TInt i = 0; i < count; i++) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::CloseAllConversationL() CLOSING %d, CHAT ************"), i ); - UnSubscribePresenceL (iOpenChats->GetTargetIdL (i)); - } - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::CloseAllConversationL() end") ); - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::DeactivateConversationL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineMessageHandler::DeactivateConversationL() - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::DeactivateConversation()") ); - if(iIMCacheUpdater) - { - return iIMCacheUpdater->DeactivateConversationL(); - } - return KErrNone; - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::SendMessage -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::SendMessageL(MIMCVEngineMessage& message ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::SendMessageL() start") ); - if(iContext == NULL || iImFeatures == NULL) - { - return; - } - - MXIMPObjectFactory& objFactory = iContext->ObjectFactory(); - MImConversation& imconversation = iImFeatures->ImConversation(); - - MImConversationInfo* imMessage = iImFeatures->ImObjectFactory().NewImConversationInfoLC(); - - MXIMPIdentity* identity = objFactory.NewIdentityLC(); - identity->SetIdentityL( KMsgId ); - - imMessage->SetMessageIdL(identity); - - imMessage->SetTextMessageL( message.Text() ); - - CDesCArrayFlat* recipients = new ( ELeave )CDesCArrayFlat( 2 ); - CleanupStack::PushL( recipients); //userid's - recipients->AppendL( message.Recipient() ); - - imMessage->SetRecipientL(recipients); - - TXIMPRequestId reqId = imconversation.SendMessageL(*imMessage); - // must set operation code - message.SetOperationCode(reqId); - // must append message to holding until it get delivered - iHoldingMessages.Append( &message ); - - CleanupStack::PopAndDestroy();// recipients - // ownership is transfer to ximpfw - CleanupStack::Pop(); //identity - CleanupStack::PopAndDestroy();//imMessage - - if(iIMCacheUpdater) - { - iIMCacheUpdater->AppendSendMessageL( message.Text() ); - } - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::SendMessageL() end") ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::AppendToCacheL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::AppendToCacheL(const TDesC& aBuddyId, const TDesC& aTextMessage ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::AppendToCacheL() start") ); - if(iIMCacheUpdater) - { - iIMCacheUpdater->AppendMessageL(aBuddyId, aTextMessage ); - } - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::AppendToCacheL() End") ); - } - //----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::HandleMessageSentFailedL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::HandleMessageSentFailedL( MIMCVEngineMessage& aMessage ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::HandleMessageSentFailedL() end") ); - MIMCVEngineMessage* failMessage = - iMessageCreator.CreateFailedMessageL( &aMessage ); - CleanupDeletePushL( failMessage ); - MIMCVEngineMessageWriteInterface& messageContainer = - iChatInterface.MessageWriteInterfaceL( - 0, - aMessage.Recipient() ); - CleanupStack::Pop( failMessage ); - messageContainer.AppendL( failMessage ); - - // text will be Failed:text - if(iIMCacheUpdater) - { - iIMCacheUpdater->AppendSendMessageL( failMessage->Text() ); - } - - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::HandleMessageSentFailedL() end") ); - } - //----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::NotifyOperationCompletdL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- - void CIMCVEngineMessageHandler::NotifyOperationCompletdL(MIMCVEngineMessage::TMessagerType aType , TInt aResult ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::NotifyOperationCompletdL() start") ); - if( iObserver ) - { - iObserver->HandleOperationCompletdL(iServiceId, aType, aResult ); - } - IM_CV_LOGS(TXT("CIMCVEngineMessageCreator::NotifyOperationCompletdL() end") ); - } - //----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::ResetContextL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::ResetContextL(MXIMPContext* aContext) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ResetContextL() start") ); - iContext = NULL; - iContext = aContext; - if(iContext) - { - delete iImFeatures; - iImFeatures = NULL; - iImFeatures = MImFeatures::NewL(iContext); - } - else - { - if( iIMCacheUpdater ) - { - iIMCacheUpdater->UnRegisterObserver(*this); - } - if( iIMCacheFactory ) - { - CIMCacheFactory::Release(); - iIMCacheUpdater = NULL; - iIMCacheFactory = NULL; - } - } - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ResetContextL() end") ); - } - - -void CIMCVEngineMessageHandler::UnSubscribePresenceL(const TDesC& aRecipientId) -{ - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::UnSubscribePresenceL() start %S"), &aRecipientId); - if( !iServiceName ) - { - return; - } - iPresenceStatus = EUnknown; // default status - - HBufC* name = HBufC::NewLC( aRecipientId.Length() + iServiceName->Length() + KCVColon().Length() ); - TPtr namePtr( name->Des() ); - namePtr.Zero(); - - // append the service name followed by user id ,seperated by colon - namePtr.Append(*iServiceName); - namePtr.Append(KCVColon); - namePtr.Append(aRecipientId); - - - IM_CV_LOGS(TXT("***************CIMCVEngineMessageHandler::UnSubscribePresenceL() %S ***************************"), &(name->Des ())); - // subscribe for presence change notification - iPresenceCacheReader->UnSubscribePresenceBuddyChangeL(*name); - - CleanupStack::PopAndDestroy(); // name - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::UnSubscribePresenceL() End") ); -} - -// --------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::SubscribePresenceL -// --------------------------------------------------------------------------- -// -void CIMCVEngineMessageHandler::SubscribePresenceL(const TDesC& aRecipientId) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::SubscribePresenceL() start %S"), &aRecipientId ); - if( !iServiceName ) - { - return; - } - iPresenceStatus = EUnknown; // default status - - HBufC* name = HBufC::NewLC( aRecipientId.Length() + iServiceName->Length() + KCVColon().Length() ); - TPtr namePtr( name->Des() ); - namePtr.Zero(); - - // append the service name followed by user id ,seperated by colon - namePtr.Append(*iServiceName); - namePtr.Append(KCVColon); - namePtr.Append(aRecipientId); - - // read the cache status - ReadPresenceStatusL( *name ); - - IM_CV_LOGS(TXT("***************CIMCVEngineMessageHandler::SubscribePresenceL() %S ***************************"), &(name->Des ())); - // subscribe for presence change notification - iPresenceCacheReader->SubscribePresenceBuddyChangeL(*name); - - CleanupStack::PopAndDestroy(); // name - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::SubscribePresenceL() End") ); - } -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::SetPresenceObserver -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::SetObserver( MIMCVEngineMessageHandlerObserver* aObserver ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::SetPresenceObserver() start") ); - iObserver = NULL; - iObserver = aObserver; - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::SetPresenceObserver() end") ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineMessageContainer::RemovePresenceObserver -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineMessageHandler::RemoveObserver() - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::RemovePresenceObserver() start") ); - iObserver = NULL; - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::RemovePresenceObserver() end") ); - } -// --------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::ReadPresenceStatusL -// --------------------------------------------------------------------------- -// -void CIMCVEngineMessageHandler::ReadPresenceStatusL(const TDesC& aIdentity ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ReadPresenceStatusL() start") ); - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ReadPresenceStatusL() : buddy Id = %s"), &aIdentity ); - MPresenceBuddyInfo2* presenceInfo = iPresenceCacheReader->PresenceInfoLC( aIdentity ); //pushed into cleanup stack - if( presenceInfo ) - { - MPresenceBuddyInfo2::TAvailabilityValues availabilityEnum = presenceInfo->Availability(); - TPtrC availabilityText = presenceInfo->AvailabilityText(); - iPresenceStatus = ConvertPresenceCacheEnums( availabilityEnum ,availabilityText ); - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ReadPresenceStatusL():ConvertPresenceCacheEnums: %d"),iPresenceStatus); - if(EUnknown ==iPresenceStatus) - { - GetKeyFiledsAndValuesL(*presenceInfo); - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ReadPresenceStatusL()::GetKeyFiledsAndValuesL: %d"),iPresenceStatus); - } - CleanupStack::PopAndDestroy(); //presenceInfo - } - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ReadPresenceStatusL() End") ); - } - -// --------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::HandlePresenceReadL -// --------------------------------------------------------------------------- -// -void CIMCVEngineMessageHandler::HandlePresenceReadL(TInt /*aErrorCode*/, - RPointerArray& /*aPresenceBuddyInfoList*/) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandlePresenceReadL() start") ); - // this is notification for all budy presence - // not interested for all - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandlePresenceReadL() End") ); - } -// --------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::HandlePresenceNotificationL -// --------------------------------------------------------------------------- -// -void CIMCVEngineMessageHandler::HandlePresenceNotificationL(TInt /*aErrorCode*/, - MPresenceBuddyInfo2* aPresenceBuddyInfo ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandlePresenceNotificationL() start") ); - - if ( aPresenceBuddyInfo ) - { - CleanupDeletePushL( aPresenceBuddyInfo ); - TPtrC xspId = aPresenceBuddyInfo->BuddyId(); - // extract user id from xsp id - TPtrC userId = xspId.Right(xspId.Length() - iServiceName->Length() - KCVColon().Length() ); - - // read the availability /presence state enum value - MPresenceBuddyInfo2::TAvailabilityValues availabilityEnum = aPresenceBuddyInfo->Availability(); - TPtrC availabilityText = aPresenceBuddyInfo->AvailabilityText(); - iPresenceStatus = ConvertPresenceCacheEnums( availabilityEnum ,availabilityText); - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandlePresenceNotificationL() : status = %d "), iPresenceStatus); - if(EUnknown == iPresenceStatus) - { - GetKeyFiledsAndValuesL(*aPresenceBuddyInfo); - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandlePresenceNotificationL():GetKeyFiledsAndValuesL : status = %d "), iPresenceStatus); - } - // check if the display is already there, - // else get it from the servicetab - MIMCVEngineMessageReadInterface& readContainer = - iChatInterface.MessageReadInterfaceL(iServiceId, userId ); - IM_CV_LOGS(TXT(" CIMCVEngineMessageHandler::HandlePresenceNotificationL() before if") ); - if(readContainer.DisplayName().Length() == 0) - { - - // before informing ui about the hnages, - // create the chat if it is already not created, - // hence we can always have the first name and the contact link before ui gets notified. - IM_CV_LOGS(TXT("1 CIMCVEngineMessageHandler::HandlePresenceNotificationL() before call GetContactLinkInfoL") ); - iStorageListener->GetContactLinkInfoL( iServiceId,userId ); - IM_CV_LOGS(TXT(" CIMCVEngineMessageHandler::HandlePresenceNotificationL() after call GetContactLinkInfoL uid = %S"),&userId ); - - } - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandlePresenceNotificationL::GetContactLinkInfoL() End ") ); - if( iObserver ) - { - iObserver->HandlePresenceChangedL( iServiceId, userId ); - } - CleanupStack::PopAndDestroy(); // aPresenceBuddyInfo - } - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::HandlePresenceNotificationL() End ") ); - } - -// --------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::ConvertStringToStatus -// --------------------------------------------------------------------------- -// -TIMCVOnlineStatus CIMCVEngineMessageHandler::ConvertPresenceCacheEnums(MPresenceBuddyInfo2::TAvailabilityValues aAvailabilityEnum ,TPtrC aAvailabilityText) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ConvertStringToStatus() Start ") ); - - // convert the presence cache enums to conversation view enumvalues - // by default if the enum doesnot match then its TVIMPSTEnums::UnKnown - TIMCVOnlineStatus status; - switch( aAvailabilityEnum ) - { - case MPresenceBuddyInfo2::EBusy: - { - status = EBusy; - if(0==aAvailabilityText.Compare(KAwayState)) - { - status = EAway; - } - if(0==aAvailabilityText.Compare(KOnPhoneState)) - { - status = EOnPhone; - } - if(0==aAvailabilityText.Compare(KDndState)) - { - status = EDoNotDisturb; - } - break; - } - case MPresenceBuddyInfo2::EAvailable: - { - status = EOnline; - break; - } - case MPresenceBuddyInfo2::ENotAvailable: - { - status = EOffline; - break; - } - case MPresenceBuddyInfo2::EUnknownAvailability: - { - status = EUnknown; - if(0==aAvailabilityText.Compare(KInvisibleState)) - { - status = EInvisible; - } - break; - } - default: - { - status = EUnknown; - break; - } - } - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::ConvertStringToStatus() End ") ); - return status; - } - -// --------------------------------------------------------- -// CIMCVEngineMessageHandler::GetPresenceStatus -// -// --------------------------------------------------------- -TIMCVOnlineStatus CIMCVEngineMessageHandler::GetPresenceStatus() - { - // current presence status - return iPresenceStatus; - } - -// --------------------------------------------------------- -// CIMCVEngineMessageHandler::GetChatListL -// -// --------------------------------------------------------- -RArray CIMCVEngineMessageHandler::GetChatListL( TInt aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::StartNewConversationL() start") ); - - IM_CV_LOGS(TXT("CIMCVEngineMessageHandler::StartNewConversationL() end") ); - - return iIMCacheUpdater->GetChatListL(aServiceId); - - } - -// --------------------------------------------------------- -// CIMCVEngineMessageHandler::OpenChats -// -// --------------------------------------------------------- -CIMCVEngineOpenChats& CIMCVEngineMessageHandler::OpenChats() - { - return *iOpenChats; - } - - -// --------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::GetKeyFiledsAndValuesL -// --------------------------------------------------------------------------- -// -void CIMCVEngineMessageHandler::GetKeyFiledsAndValuesL(MPresenceBuddyInfo2& aPresenceBuddyInfo) - { - TPtrC8 value = aPresenceBuddyInfo.GetAnyField( KExtensionKey()); - // At any point of time fro remote and blocked contact only one of the keys - // KPendingRequestExtensionValue/KBlockedExtensionValue will be assigned, and not both the keys. - if(value.Compare( KPendingRequestExtensionValue) == 0 ) - { - iPresenceStatus = EPending; - } - else if(value.Compare( KBlockedExtensionValue ) == 0 ) - { - iPresenceStatus = EBlock; - } - else if(value.Compare( KServiceExtensionValue ) == 0) - { - iPresenceStatus = EServiceOut; - } - else if(value.Compare( KCallForwardExtensionValue ) == 0) - { - iPresenceStatus = ECallForward; - } - } -// --------------------------------------------------------------------------- -// CIMCVEngineMessageHandler::ServiceId -// --------------------------------------------------------------------------- -// -TInt CIMCVEngineMessageHandler::ServiceId() const - { - return iServiceId; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineMessageHandler: HandleServiceBuddyDetailsFetchedL -// ----------------------------------------------------------------------------- -// -void CIMCVEngineMessageHandler::HandleServiceBuddyDetailsFetchedL(TInt aServiceId, - const TDesC& aXspId, - const TDesC8 & aContactLink, - const TDesC & aDisplayName ) - { - IM_CV_LOGS(TXT("HandleServiceBuddyDetailsFetchedL Start") ); - IM_CV_LOGS(TXT("HandleServiceBuddyDetailsFetchedL aName= %S"),&aDisplayName ); - IM_CV_LOGS(TXT("HandleServiceBuddyDetailsFetchedL aLink= %S"),&aContactLink); - MIMCVEngineMessageWriteInterface& messageContainer = - iChatInterface.MessageWriteInterfaceL(aServiceId, aXspId, aDisplayName, aContactLink ); - messageContainer.SetNameL(aDisplayName); - messageContainer.SetLinkL(aContactLink); - IM_CV_LOGS(TXT("HandleServiceBuddyDetailsFetchedL End") ); - } - // end of file - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvengineopenchats.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvengineopenchats.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,386 +0,0 @@ -/* -* Copyright (c) 2006 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: Implementation for Open ConversationList -* -*/ - - -// INCLUDE FILES - -#include "cimcvengineopenchats.h" -#include "cimcvenginemessagehandler.h" -#include "mimcvenginechatinterface.h" -#include "mimcvenginemessagecontainerinfo.h" - -#include -#include -#include "imcvuiliterals.h" -#include "imcvlogger.h" - - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats : Ctor -// -// ----------------------------------------------------------------------------- -// -CIMCVEngineOpenChats::CIMCVEngineOpenChats(CIMCVEngineMessageHandler& aMessageHandler, - MIMCVEngineChatInterface& aChatInterface) : - iActiveItem(-1), - iMessageHandler(aMessageHandler), - iChatInterface(aChatInterface) - { - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats : NewL -// -// ----------------------------------------------------------------------------- -// -CIMCVEngineOpenChats* CIMCVEngineOpenChats::NewL(CIMCVEngineMessageHandler& aMessageHandler, - MIMCVEngineChatInterface& aChatInterface,TInt aServiceId ) - { - CIMCVEngineOpenChats* self = new ( ELeave ) CIMCVEngineOpenChats(aMessageHandler, aChatInterface); - self->ConstructL(aServiceId); - return self; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats : Destructor -// -// ----------------------------------------------------------------------------- -// -CIMCVEngineOpenChats::~CIMCVEngineOpenChats() - { - iChatInterface.UnregisterNewMsgObserver(); - iChatInterface.UnregisterChatListObserver(this); - iOpenChatsArray.Reset(); - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: GetDisplayNameL -// ----------------------------------------------------------------------------- -// -TPtrC CIMCVEngineOpenChats::GetDisplayNameL(TInt aIndex) const - { - if ( (aIndex >= iOpenChatsArray.Count()) || (aIndex <0) ) - { - User::LeaveIfError(KErrArgument); - } - else - { - - MIMCVEngineMessageReadInterface* arrayItem = - (MIMCVEngineMessageReadInterface*) iOpenChatsArray[aIndex]; - - if (arrayItem) - { - return arrayItem->Name(); - } - } - - return TPtrC(KNullDesC); - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: GetTargetIdL -// ----------------------------------------------------------------------------- -// -const TDesC& CIMCVEngineOpenChats::GetTargetIdL(TInt aIndex) const - { - if ( ( aIndex < iOpenChatsArray.Count() ) && (aIndex >= 0 ) ) - { - MIMCVEngineMessageReadInterface* arrayItem = - (MIMCVEngineMessageReadInterface *)iOpenChatsArray[aIndex]; - if (arrayItem) - { - return arrayItem->TargetId().Target(); - } - } - return (KNullDesC); - } - - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: FindIndexL -// ----------------------------------------------------------------------------- -// -TInt CIMCVEngineOpenChats::FindIndexL(const TDesC& aItem) - { - - HBufC* decodedItemId = EscapeUtils::EscapeDecodeL( aItem ); - - // Create custom collation method to ignore punctuations - // index 0 gets the default method - TCollationMethod collation = - *Mem::CollationMethodByIndex( 0 ); - - collation.iFlags |= TCollationMethod::EIgnoreNone; - - for (TInt index=0; indexDes() ); - - // domains are compared only when it is really needed - // check if userid part is the same in both ids - TInt idResult = ptrId1.CompareC( ptrId2, KCollationLevel, &collation ); - - if( !idResult ) - { - delete decodedItemId; - return index; - } - } - - delete decodedItemId; - return KErrNotFound; - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: Count -// ----------------------------------------------------------------------------- -// -TInt CIMCVEngineOpenChats::Count() const - { - return iOpenChatsArray.Count(); - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: SetActiveItemL -// ----------------------------------------------------------------------------- -// -void CIMCVEngineOpenChats::SetActiveItemL( const TInt aIndex ) - { - - if ( (aIndex >= iOpenChatsArray.Count()) || (aIndex <0) ) - { - User::LeaveIfError(KErrArgument); - } - - iActiveItem = aIndex; - - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: GetActiveItem -// ----------------------------------------------------------------------------- -// -const TDesC& CIMCVEngineOpenChats::GetActiveItem() const - { - - if ( (iActiveItem < iOpenChatsArray.Count()) && (iActiveItem >= 0) ) - { - MIMCVEngineMessageReadInterface *arrayItem = - (MIMCVEngineMessageReadInterface *)iOpenChatsArray[iActiveItem]; - if (arrayItem) - { - return arrayItem->TargetId().Target(); - } - } - return (KNullDesC); - - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: IsMsgPendingL -// ----------------------------------------------------------------------------- -// -TBool CIMCVEngineOpenChats::IsMsgPendingL( const TInt aIndex ) const - { - if(aIndex >= (iOpenChatsArray.Count()) || aIndex <0) - { - User::LeaveIfError(KErrArgument); - } - else - { - MIMCVEngineMessageReadInterface *arrayItem = - (MIMCVEngineMessageReadInterface *)iOpenChatsArray[aIndex]; - if (arrayItem) - { - return arrayItem->UnreadCount(); - } - } - return EFalse; - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: ConstructL -// ----------------------------------------------------------------------------- -// -void CIMCVEngineOpenChats::ConstructL( TInt aServiceId ) - { - IM_CV_LOGS(TXT("CIMCVEngineOpenChats ::CONSTRUCTL () ") ); - iChatInterface.RegisterNewMsgObserver( this ); - iChatInterface.RegisterChatListObserver( this ); - - RArray chatItem = iMessageHandler.GetChatListL( aServiceId ); - IM_CV_LOGS(TXT("CIMCVEngineOpenChats :: CHAT ITEMS COUNT %d"), chatItem.Count () ); - - for (int index=0; indexHandleChangeL(iMessageHandler.ServiceId(), iOpenChatsArray.Count()-1, ENewChat) ); - } - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: RemoveL -// ----------------------------------------------------------------------------- -// -void CIMCVEngineOpenChats::RemoveL( MIMCVEngineMessageReadInterface& aContainerInfo ) - { - TInt index = FindIndexL(aContainerInfo.TargetId().Target()); - - if (KErrNotFound != index) - { - iOpenChatsArray.Remove(index); - iOpenChatsArray.Compress(); - if (iChatObserver) - { - iChatObserver->HandleChangeL(iMessageHandler.ServiceId(), index, EChatClosed); - } - } - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: RegisterObserver -// ----------------------------------------------------------------------------- -// -void CIMCVEngineOpenChats::RegisterObserver(MIMCVEngineOpenChatsObserver* aChatObserver) - { - iChatObserver = aChatObserver; - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: UnRegisterObserver -// ----------------------------------------------------------------------------- -// -void CIMCVEngineOpenChats::UnRegisterObserver() - { - iChatObserver = NULL; - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: HandleChatEventL -// ----------------------------------------------------------------------------- -// -void CIMCVEngineOpenChats::HandleChatEventL( TChatEventType /*aEvent*/, - MIMCVEngineMessage* aMessage /*= NULL*/ ) - { - if (aMessage) - { - TInt index = KErrNotFound; - - index = FindIndexL(aMessage->Recipient()) ; - - if (KErrNotFound != index) - { - MIMCVEngineMessageReadInterface *arrayItem = - (MIMCVEngineMessageReadInterface *)iOpenChatsArray[index]; - if (arrayItem && iChatObserver) - { - TInt serviceId = iMessageHandler.ServiceId(); - iChatObserver->SetStatusMsgL(serviceId, index,aMessage->Text()); - iChatObserver->HandleChangeL(serviceId, index, EUnReadCountChanged); - } - } - } - } - - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: HandleChatListEvent -// ----------------------------------------------------------------------------- -// -void CIMCVEngineOpenChats::HandleChatListEvent( TInt aServiceId ,TChatListEventType aEvent, - MIMCVEngineMessageReadInterface* aContainerInfo - ) - { - - switch (aEvent) - { - case EChatItemAdded: - { - Insert(aContainerInfo); - break; - } - - case EChatItemDeleted: - { - TRAP_IGNORE(RemoveL(*aContainerInfo)); - break; - } - case EChatAllItemDeleted: - { - // not owns - iOpenChatsArray.Reset(); - if (iChatObserver) - { - TRAP_IGNORE( iChatObserver->HandleChangeL( aServiceId, KErrNotFound, EChatAllClosed ) ); - } - } - default: - break; - } - - } - -// ----------------------------------------------------------------------------- -// CIMCVEngineOpenChats: ResetL -// ----------------------------------------------------------------------------- -// -void CIMCVEngineOpenChats::ResetL() - { - iOpenChatsArray.Reset(); - iActiveItem = -1; - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginestoragelistener.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginestoragelistener.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,282 +0,0 @@ -/* -* Copyright (c) 2008-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: active object class for interacting with servicetab for link and Display Name -* -*/ - -// INCLUDE FILES - -#include "cimcvenginestoragelistener.h" -#include "cimcvenginemessagehandler.h" -#include "imcvlogger.h" - -//system includes - -// ================= MEMBER FUNCTIONS ======================= - -// -------------------------------------------------------------------------- -// CIMCVEngineStorageListener::CIMCVEngineStorageListener -// -------------------------------------------------------------------------- -// -CIMCVEngineStorageListener::CIMCVEngineStorageListener(MIMCVEngineStorageObserver& aObserver ) - : CActive( CActive::EPriorityStandard ), - iObserver( aObserver ) - { - CActiveScheduler::Add( this ); - } - - -// -------------------------------------------------------------------------- -// CIMCVEngineStorageListener::ConstructL -// -------------------------------------------------------------------------- -// -void CIMCVEngineStorageListener::ConstructL() - { - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::ConstructL : start")); - TInt err = RProperty::Define(KConvViewUID,KXspIdServiceIDKey,RProperty::EText); - if(KErrAlreadyExists != err && KErrNone != err ) - { - User::LeaveIfError(err); - } - //define properties that engine will publish. - err = RProperty::Define(KConvViewUID,KContactLinkDisplayNameKey,RProperty::ELargeText); - if(KErrAlreadyExists != err && KErrNone != err ) - { - User::LeaveIfError(err); - } - //Attaching iProperty with the property published by engine to get contact link and display name. - err = iProperty.Attach(KConvViewUID,KContactLinkDisplayNameKey); - User::LeaveIfError(err); - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::ConstructL : end")); - } -// -------------------------------------------------------------------------- -// CIMCVEngineStorageListener::NewL -// -------------------------------------------------------------------------- -// -CIMCVEngineStorageListener* CIMCVEngineStorageListener::NewL(MIMCVEngineStorageObserver& aObserver) - { - CIMCVEngineStorageListener* self = new(ELeave) CIMCVEngineStorageListener( aObserver ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } -// -------------------------------------------------------------------------- -// CIMCVEngineStorageListener::GetContactLinkInfoL -// -------------------------------------------------------------------------- -// -void CIMCVEngineStorageListener::GetContactLinkInfoL(TInt aServiceId, const TDesC& aXspID) - { - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::GetContactLinkInfoL : start")); - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::GetContactLinkInfoL aServiceId= %d"),aServiceId ); - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::GetContactLinkInfoL aXspID= %S"),&aXspID ); - StartListening(); - - TInt length = KMaxServiceIdLength + aXspID.Length() + KDelimiter().Length(); - HBufC* userDetails = HBufC::NewLC(length); - - TPtr userDetailsPtr = userDetails->Des(); - userDetailsPtr.Zero(); - userDetailsPtr.AppendNum(aServiceId); - userDetailsPtr.Append(KDelimiter()); - userDetailsPtr.Append(aXspID); - - RProperty::Set(KConvViewUID,KXspIdServiceIDKey,userDetails->Des()); - if( !iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // CActiveSchedulerWait. - iWait.Start(); - } - CleanupStack::PopAndDestroy(userDetails); - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::GetContactLinkInfoL : end")); - } - -// --------------------------------------------------------- -// CIMCVEngineStorageListener::~CIMCVEngineStorageListener() -// C++ Destructor -// --------------------------------------------------------- -// -CIMCVEngineStorageListener::~CIMCVEngineStorageListener() - { - if( iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // this is CActiveSchedulerWait. - iWait.AsyncStop(); - } - StopListening(); // Cancel any request, if outstanding - // delete the earlier defined property - RProperty::Delete(KConvViewUID,KXspIdServiceIDKey); - RProperty::Delete(KConvViewUID,KContactLinkDisplayNameKey); - iProperty.Close(); // Destroy the property object - } - -// --------------------------------------------------------- -// CIMCVEngineStorageListener::RunL() -// --------------------------------------------------------- -// -void CIMCVEngineStorageListener::RunL() - { - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::RunL : start")); - if( iStatus.Int() == KErrNone ) - { - // TBuf servId_usrId_name_link; - HBufC16* servId_usrId_name_link = HBufC16::New(KMaxDisplayNameContactLinkLength); - TPtr servId_usrId_name_linkPtr( servId_usrId_name_link->Des() ); - //Get the property in "ServiceId:UserId:Name:ContactLink" formate - iProperty.Get(KConvViewUID,KContactLinkDisplayNameKey,servId_usrId_name_linkPtr ); - - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::RunL received property = %S"),&servId_usrId_name_linkPtr ); - - TInt posOfDelimiter = servId_usrId_name_link->Find(KDelimiter); - if(KErrNotFound != posOfDelimiter ) - { - TInt serviceId; - HBufC16* userID = NULL; - HBufC16* contactLink = NULL; - HBufC16* displayName = NULL; - - TBuf serviceIdBuf; - TPtrC ptr(servId_usrId_name_link->Left(posOfDelimiter)); - serviceIdBuf = ptr; - TLex16 lex(serviceIdBuf); - lex.Val(serviceId); - - TPtrC usrId_name_link = servId_usrId_name_link->Right(servId_usrId_name_link->Length() - (posOfDelimiter+ 1) ); - posOfDelimiter = usrId_name_link.Find(KDelimiter); - //extracting user id - if(KErrNotFound != posOfDelimiter ) - { - userID = (usrId_name_link.Left(posOfDelimiter)).AllocLC(); - } - - //extracting display name. - TPtrC name_link = usrId_name_link.Right(usrId_name_link.Length() - (posOfDelimiter+ 1) ); - posOfDelimiter = name_link.Find(KDelimiter); - if(KErrNotFound != posOfDelimiter ) - { - displayName = (name_link.Left(posOfDelimiter)).AllocLC(); - } - - //extracting contact link - TPtrC link = name_link.Right(name_link.Length() - (posOfDelimiter+ 1) ); - contactLink = link.AllocLC(); - - HBufC8* convertedLink = NULL; - - if(contactLink) - { - convertedLink = HBufC8::NewLC(contactLink->Length()); - TPtr8 convertedLinkPtr = convertedLink->Des(); - convertedLinkPtr.Copy(*contactLink); - } - if( !convertedLink ) - { - convertedLink = KNullDesC8().AllocLC(); - } - - if(convertedLink && userID && displayName) - { - iObserver.HandleServiceBuddyDetailsFetchedL( serviceId,*userID,*convertedLink,*displayName); - - IM_CV_LOGS(TXT("storage listener RunL userID = %S"),&(*userID) ); - IM_CV_LOGS(TXT("storage listener RunL convertedLink = %S"),&(*convertedLink) ); - IM_CV_LOGS(TXT("storage listener RunL displayName = %S"),&(*displayName) ); - - } - delete (servId_usrId_name_link); - //delete all alocated memory - if(convertedLink) - { - CleanupStack::PopAndDestroy(convertedLink); - } - if(contactLink) - { - CleanupStack::PopAndDestroy(contactLink); - } - if(displayName) - { - CleanupStack::PopAndDestroy(displayName); - } - if(userID) - { - CleanupStack::PopAndDestroy(userID); - } - } - } - if( iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // this is CActiveSchedulerWait. - iWait.AsyncStop(); - } - - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::RunL : end")); - } - -// --------------------------------------------------------- -// CIMCVEngineStorageListener::RunL() -// --------------------------------------------------------- -// -void CIMCVEngineStorageListener::DoCancel() - { - iProperty.Cancel(); - } - -// --------------------------------------------------------- -// CIMCVEngineStorageListener::StartListening() -// --------------------------------------------------------- -// -void CIMCVEngineStorageListener::StartListening() - { - if( !IsActive() ) - { - iProperty.Subscribe(iStatus); - SetActive(); // Tell scheduler a request is active - } - } - -// --------------------------------------------------------- -// CIMCVEngineStorageListener::StopListening() -// --------------------------------------------------------- -// -void CIMCVEngineStorageListener::StopListening() - { - if( IsActive() ) - { - Cancel(); // Cancel any request, if outstanding - } - } - -// --------------------------------------------------------- -// CIMCVEngineStorageListener::StopListening() -// --------------------------------------------------------- -// -TInt CIMCVEngineStorageListener::RunError( TInt aError ) - { - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::RunError : start")); - IM_CV_LOGS(TXT("CIMCVEngineStorageListener::RunError : end")); - if( iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // this is CActiveSchedulerWait. - iWait.AsyncStop(); - } - return aError; - } - - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/cimcvenginetextmessage.cpp --- a/imstutils/imconversationview/imcvuiengine/src/cimcvenginetextmessage.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: text message implementation -* -*/ - -#include "cimcvenginetextmessage.h" -#include -#include "imcvenginemessageutils.h" -#include -// logs -#include "imcvlogger.h" - -//----------------------------------------------------------------------------- -// CIMCVEngineTextMessage::CIMCVEngineTextMessage -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineTextMessage::CIMCVEngineTextMessage() - { - } - -//----------------------------------------------------------------------------- -// CIMCVEngineTextMessage::~CIMCVEngineTextMessage -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineTextMessage::~CIMCVEngineTextMessage() - { - } - -//----------------------------------------------------------------------------- -// CIMCVEngineTextMessage::NewL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineTextMessage* CIMCVEngineTextMessage::NewL( - const TDesC& aSender, - const TDesC& aRecipient, - const TDesC& aData ) - { - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::NewL() start") ); - CIMCVEngineTextMessage* self = CIMCVEngineTextMessage::NewLC( - aSender, - aRecipient, - aData ); - CleanupStack::Pop( self ); - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::NewL() end") ); - return self; - } - - -//----------------------------------------------------------------------------- -// CIMCVEngineTextMessage::NewLC -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CIMCVEngineTextMessage* CIMCVEngineTextMessage::NewLC( - const TDesC& aSender, - const TDesC& aRecipient, - const TDesC& aData ) - { - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::NewLC() start") ); - CIMCVEngineTextMessage* self = new ( ELeave ) CIMCVEngineTextMessage(); - CleanupStack::PushL( self ); - self->ConstructL( aData ); - self->CIMCVEngineMessageBase::ConstructL( - aSender, - aRecipient - ); - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::NewLC() end") ); - return self; - } - -//----------------------------------------------------------------------------- -// CIMCVEngineTextMessage::ConstructL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineTextMessage::ConstructL( const TDesC& aData ) - { - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::ConstructL() start") ); - - iText = aData.AllocL(); - - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::ConstructL() end") ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineTextMessage::SizeInBytes -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CIMCVEngineTextMessage::SizeInBytes() const - { - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::SizeInBytes() start") ); - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::SizeInBytes() end") ); - return CIMCVEngineMessageBase::SizeInBytes() + - iText->Size() + - sizeof( *this ); - } - -//----------------------------------------------------------------------------- -// CIMCVEngineTextMessage::ContentType -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MIMCVEngineMessage::TContentType CIMCVEngineTextMessage::ContentType() const - { - return EContentText; - } - -//----------------------------------------------------------------------------- -// CCATextMessage::SetFailed -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CIMCVEngineTextMessage::SetFailedL() - { - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::SetFailedL() start") ); - SetFailed(); - HBufC* failed = NULL; - if( iText ) - { - failed = IMCVEngineMessageUtils::LoadResourceL( R_QTN_CONVIEW_FAILED, *iText); - delete iText; - iText = NULL; - iText = failed; - } - IM_CV_LOGS(TXT("CIMCVEngineTextMessage::SetFailedL() end") ); - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/imcvuiengine/src/imcvenginemessageutils.cpp --- a/imstutils/imconversationview/imcvuiengine/src/imcvenginemessageutils.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: utils class for engine -* -*/ - -#include "imcvenginemessageutils.h" - -#include -#include -#include "mimcvenginemessage.h" -#include "mimcvenginemessagecreator.h" -#include "mimcvenginemessageswriteinterface.h" -#include -#include "imcvuiliterals.h" -#include "imcvlogger.h" -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// IMCVEngineMessageUtils::AppendDateStampL -// --------------------------------------------------------------------------- -// -void IMCVEngineMessageUtils::AppendDateStampL( - TTime /*aNewTime*/, - MIMCVEngineMessageWriteInterface& aWriteInterface, - MIMCVEngineMessageCreator& /*aMessageCreator */) - { - // DateStamp is NOT appended if: - // 1. There are no previous messages - // 2. Previous message is from the same day as aNewTime - IM_CV_LOGS(TXT("IMCVEngineMessageUtils::AppendDateStampL() start") ); - - TTime lastTime = aWriteInterface.Time(); - - if( lastTime == Time::NullTTime() ) - { - // no previous messages - return; - } - else - { - // implementation needed - } - IM_CV_LOGS(TXT("IMCVEngineMessageUtils::AppendDateStampL() end") ); - } - - -// --------------------------------------------------------------------------- -// CIMCVEngineMessageUtils::AppendMessageWithDateStampL -// --------------------------------------------------------------------------- -// -void IMCVEngineMessageUtils::AppendMessageWithDateStampL( - MIMCVEngineMessage& aNewMessage, - MIMCVEngineMessageWriteInterface& aWriteInterface, - MIMCVEngineMessageCreator& aMessageCreator, - TBool aSharedOwnership ) - { - // Make sure this does not leave before the new message is - // appended to interface, - IM_CV_LOGS(TXT("IMCVEngineMessageUtils::AppendMessageWithDateStampL() start") ); - TRAP_IGNORE( AppendDateStampL( aNewMessage.TimeStamp(), - aWriteInterface, - aMessageCreator ) ); - aWriteInterface.AppendL( &aNewMessage, aSharedOwnership ); - IM_CV_LOGS(TXT("IMCVEngineMessageUtils::AppendMessageWithDateStampL() end") ); - } - -// ----------------------------------------------------------------------------- -// IMCVEngineMessageUtils::LoadResourceL -// give ownership to caller -// ----------------------------------------------------------------------------- -// -HBufC* IMCVEngineMessageUtils::LoadResourceL( TInt aResourceId, const TDesC& aText ) - { - CCoeEnv* env = CCoeEnv::Static(); - HBufC* ret = NULL; - if(env) - { - ret = StringLoader::LoadL( aResourceId, aText ); - } - return ret; - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/inc/imcvlogger.h --- a/imstutils/imconversationview/inc/imcvlogger.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Logger implementation -* -*/ - - - - -#ifndef IMCVLOGGER_H -#define IMCVLOGGER_H - -#include -#include -#include - -// enable logs printing -// into c:\\logs\\imcv\\imcv.txt -#ifdef __WINS__ - #ifdef _DEBUG - #define ENABLE_DEBUG_LOGS // for WINS UDEB - #endif -#else - #ifdef _DEBUG - #define ENABLE_DEBUG_LOGS // for device UDEB - #endif -#endif - -/** -* Usage of Log MACRO'S -* _LIT( KExample, "Example" ); -* TXT(s) _L(s) -* IM_CV_LOGS(TXT("Some text.") ); -* IM_CV_LOGS(TXT("Some text: %d"), 100 ); -* IM_CV_LOGS(TXT("Some text: %S"), &KExample ); -*/ - -_LIT( KTAdaptDebugOutputDir, "imcv" ); -_LIT( KTAdaptDebugOutputFileName, "imcv.txt" ); -const TInt KTAdaptMaxLogLineLength = 250 ; -#define TXT(s) _L(s) -#define IM_CV_LOGS TIMCVLogger::WriteLog -#define PLUGIN_UNUSED_PARAM(p) (void) p - - -/** - * IM Conversation View logger. - */ -class TIMCVLogger - { - public: //Logging functions - /* - * WriteLog, write the message into c:\\logs\\imcv\\imcv.txt - * need to create imcv folder into c:\\logs - * @param aFmt, list of messges to print - */ - static void WriteLog( TRefByValue aFmt,... ); - - private: //Prohibited - /* - * construtor - */ - TIMCVLogger(); - /* - * destructor - */ - ~TIMCVLogger(); - }; - -#endif // IMCVLOGGER_H - - - -/** - * Handler used by logger to truncate the string - * rather than panic in case of buffer overflow. -*/ - -NONSHARABLE_CLASS ( TAdaptOverflowTruncate ) : public TDes16Overflow - { - -public: - void Overflow ( TDes16& /*aDes*/ ) {} - }; - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// TIMCVLogger::WriteLog() -// ----------------------------------------------------------------------------- -// -inline void TIMCVLogger::WriteLog ( TRefByValue aFmt, ... ) - { - #ifdef ENABLE_DEBUG_LOGS - ( void ) aFmt;//Suppress unused formal parameter warning - TBuf< KTAdaptMaxLogLineLength > buffer; - buffer.Append ( _L ( "[" ) ); // CSI: 78 # - buffer.Append ( RThread().Name() ); - buffer.Append ( _L ( "] " ) ); // CSI: 78 # - TAdaptOverflowTruncate overflow; - VA_LIST list; - VA_START ( list, aFmt ); - buffer.AppendFormatList ( aFmt, list, &overflow ); - RFileLogger logger; - - if ( logger.Connect() == KErrNone ) - { - logger.SetDateAndTime ( ETrue, ETrue ); - logger.CreateLog ( KTAdaptDebugOutputDir, KTAdaptDebugOutputFileName, - EFileLoggingModeAppend ); - logger.Write ( buffer ); - logger.CloseLog(); - logger.Close(); - } - - RDebug::Print( _L("%S"), &buffer ); - #endif - - } - - -// End of File - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/inc/imcvuicommonuids.h --- a/imstutils/imconversationview/inc/imcvuicommonuids.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Common UID constants for conversationview. -* -*/ - - -// uids for all component - -#ifndef __IMCVUICOMMONUIDS_H -#define __IMCVUICOMMONUIDS_H - -// MACROS -//Uid3:s part of imcvuiengine.dll -#define KIMCVUIENGINEDLLUID2 0x1000008d -#define KIMCVUIENGINEDLLUID3 0x20012426 - -// part of imcvuiapp.exe -#define KIMCVUIAPPEXEUID2 0x100039CE -#define KIMCVUIAPPEXEUID3 0x20012425 - -// imcvlauncher uids -#define KIMCVLAUNCHERUid2 0x1000008d -#define KIMCVLAUNCHERUid3 0x20012427 - -#endif // __IMCVUICOMMONUIDS_H - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/inc/imcvuiliterals.h --- a/imstutils/imconversationview/inc/imcvuiliterals.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: literal collection file -* -*/ - - -#ifndef IMCVUILITERALS_H -#define IMCVUILITERALS_H - - -const TUid KUidconversationviewApp = {0x20012425}; -const TUid KUidIMCViewSoftNoteActivationId = {42}; -const TUid KUidConversationsView = {1}; - -/// Constants -_LIT8( KMimeJpeg, "image/jpeg" ); -_LIT8( KMimeGif, "Image/gif" ); - -_LIT( KCVTab, "\t" ); - -_LIT( KIMHTTPPREFIX, "http://"); -_LIT( KIMRTSP, "rtsp"); - -_LIT(KCVColon,":"); - -//Used In Chat View -//Length of "http" -const TInt KHttpLength( 4 ); - -//constants -const TInt KCVProtocolUidTelepathy = 0x101FB3E7;//0x111fffff; // telepathy. - -const TInt32 KCVAppId = 1; - -_LIT( KGroupIdPart, "/" ); - -const TInt KSystemOperationCode = -1; - -// "test character identity and accents, ignore case" -const TInt KCollationLevel = 1; - -_LIT( KMsgId, "MessageID1"); - -// CONSTANTS -const TInt KMaxDateStringLength = 25; // max length of date message - -const TUint16 KVersionNum( 1 ); - -// Panic definitions -_LIT( KIMCVUIEnginePanicCategory, "IMCV Engine " ); - -// Application UID -const TUid KUidConversationView = {1}; - -//maximum 100 character for text limit in editer -#define KMAXTEXTLIMIT 100 - -// maximum two line for message editor -#define KMAXEDITORLINE 2 - -#define KMAXUSERIDLENGTH 512 - -#define KMAX_STATUS_LENGTH 1024 - - -const TUid KPhonebook2AppUid = { 0x101F4CCE }; -const TUid KUidIMServiceTabViewUid = {10001}; - -const TInt KDefaultMsgLength = 400; - -// constants declaration -const TInt KAMaxResourcePathLength = 512; -_LIT( KADefaultIconFile, "\\resource\\apps\\imcvuiapp.mif" ); -_LIT8(KAppIdForBrand,"xsp"); -_LIT8(KDefaultBrandIdForBrand,"xsp"); - -const TInt KVIMPSTUISPSMaxPropertyLength = 512; - -const TUid KIMCVPropertyUid = { 0x101FB3E7 }; -const TUint KIMCVConnectedKey = 0x00000001; -/** - * used enum's for exiting application from conversation view - */ -enum TIMCVUiPropertyEvent - { - EIMCVUiEventNone = 0, - EIMCVUiEventExitOnly, - EIMCVUiEventLogoutExit - }; - -enum TIMCVConnectionState - { - EUnKnown, - ELoggedOut, - ELoggedIn, - EForcedLoggedOut - }; - -enum TIMCVOnlineStatus - { - EUnknown = -1, - EOffline, - EOnline, - EInvisible, - EAway, - EBusy, - EOnPhone, - EDoNotDisturb, - EPending, - EBlock, - EServiceOut, - ECallForward - }; -#endif // IMCVUILITERALS_H - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/rom/imconversationview.iby --- a/imstutils/imconversationview/rom/imconversationview.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: imconversationview IBY file. -* -*/ - - -#ifndef __IMCONVERSATIONVIEW_IBY__ -#define __IMCONVERSATIONVIEW_IBY__ - -//im conversation view - -// imcvuiapp application -S60_APP_EXE(imcvuiapp) - - -//Publish application registration resource file -data=DATAZ_\private\10003a3f\apps\imcvuiapp_reg.rsc private\10003a3f\Import\Apps\imcvuiapp_reg.rsc - -//component dll -file=ABI_DIR\BUILD_DIR\imcvengine.dll SHARED_LIB_DIR\imcvengine.dll -file=ABI_DIR\BUILD_DIR\imcvlauncher.dll SHARED_LIB_DIR\imcvlauncher.dll - -// ECom plug-ins -ECOM_PLUGIN(imcmslauncherplugin.dll,imcmslauncherplugin.rsc) - -// stub SIS, provides support for SIS upgrading -data=DATAZ_\system\install\imcvuiappstub.sis system\install\imcvuiappstub.sis - -#endif //__IMCONVERSATIONVIEW_IBY__ - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/rom/imconversationviewresources.iby --- a/imstutils/imconversationview/rom/imconversationviewresources.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: imconversationviewresources IBY file. -* -*/ - - -#ifndef __IMCONVERSATIONVIEW_RESOURCES_IBY__ -#define __IMCONVERSATIONVIEW_RESOURCES_IBY__ - -// Application resources -S60_APP_RESOURCE(imcvuiapp) -S60_APP_CAPTION(imcvuiapp) - - -data=DATAZ_\BITMAP_DIR\imcvuiapp.mif BITMAP_DIR\imcvuiapp.mif - - - -#endif //__IMCONVERSATIONVIEW_RESOURCES_IBY__ - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/sis/imcvuiapp.pkg --- a/imstutils/imconversationview/sis/imcvuiapp.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -; -; 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: pkg file for imcvuiapp -; -; imcvuiapp.pkg -; -;Language - standard language definitions -&EN - -; standard SIS file header -#{"conversationview"},(0x20012425),1,1,0, TYPE=SA,RU - -;Supports Series 60 v 5.2; Needs to be updated when platform is changed -(0x20022E6D ), 0, 0, 0, {"Series60ProductID"} - -;Localized Vendor Name -%{"Nokia"} - -;Unique Vendor name -:"Nokia" - -; Files to copy -"/epoc32/release/armv5/urel/imcvuiapp.exe" -"!:/sys/bin/imcvuiapp.exe" -"/epoc32/data/z/private/10003a3f/apps/imcvuiapp_reg.rsc" -"!:/private/10003a3f/import/apps/imcvuiapp_reg.rsc" -"/epoc32/data/z/resource/apps/imcvuiapp.rsc" -"!:/resource/apps/imcvuiapp.Rsc" -"/epoc32/release/armv5/urel/imcvengine.dll" -"!:/sys/bin/imcvengine.dll" -"/epoc32/release/armv5/urel/imcvlauncher.dll" -"!:/sys/bin/imcvlauncher.dll" -;"/epoc32/data/z/resource/imcvuiapp.mbm" -"!:/resource/imcvuiapp.mbm" -"/epoc32/data/z/resource/apps/imcvuiapp.mif" -"!:/resource/apps/imcvuiapp.mif" -"/EPOC32/RELEASE/ARMV5/UREL/imcmslauncherplugin.dll" -"!:/sys/bin/imcmslauncherplugin.dll" -"/EPOC32/DATA/Z/Resource/Plugins/imcmslauncherplugin.rsc" -"!:/resource/plugins/imcmslauncherplugin.rsc" diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/sis/imcvuiappstub.pkg --- a/imstutils/imconversationview/sis/imcvuiappstub.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -; -; 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: -; -;Language -&EN - -;Header -#{"conversationview"}, (0x20012425), 1, 0, 0, TYPE=SA - -;Localised VendorID -%{"Nokia"} - -;VendorID -:"Nokia" - - -;im conversation view -"" -"z:\sys\bin\imcvuiapp.exe" -"" -"z:\private\10003a3f\import\apps\imcvuiapp_reg.rsc" -"" -"z:\resource\apps\imcvuiapp.r*" -"" -"z:\sys\bin\imcvengine.dll" -"" -"z:\sys\bin\imcvlauncher.dll" -"" -"z:\resource\imcvuiapp.mif" -"" -"z:\resource\imcvuiapp.mbm" -"" -"z:\sys\bin\imcmslauncherplugin.dll" -"" -"z:\resource\plugins\imcmslauncherplugin.rsc" - -; end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/sis/imcvuiappstub.sis Binary file imstutils/imconversationview/sis/imcvuiappstub.sis has changed diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/sis/metadata.xml --- a/imstutils/imconversationview/sis/metadata.xml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ - - - ABC:ABC - - - - - 1 - - ConversationView - - ConversationView - - - - - - S60 - - - 5 - 2 - - - 2007 - 1 - - - - - 2 - 0 - - 2009 - 52 - - - - - - - - 0x20012425 - - - 1 - 0 - 0 - - - - 2 - 2 - 2 - - - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/bwins/imcvuiengine_testu.def --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/bwins/imcvuiengine_testu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -EXPORTS - ?ReadyForShutdown@CIMCVEngine@@QAEHXZ @ 1 NONAME ; int CIMCVEngine::ReadyForShutdown(void) - ?OpenChats@CIMCVEngine@@QAEAAVMIMCVEngineOpenChats@@XZ @ 2 NONAME ; class MIMCVEngineOpenChats & CIMCVEngine::OpenChats(void) - ?MessageHandler@CIMCVEngine@@QBEAAVMIMCVEngineMessageHandler@@XZ @ 3 NONAME ; class MIMCVEngineMessageHandler & CIMCVEngine::MessageHandler(void) const - ?GetValue@CSPProperty@@QBEHAAW4TOnOff@@@Z @ 4 NONAME ; int CSPProperty::GetValue(enum TOnOff &) const - ?FindServiceIdsL@CSPSettings@@QAEHAAV?$RArray@I@@@Z @ 5 NONAME ; int CSPSettings::FindServiceIdsL(class RArray &) - ?NewLC@CSPProperty@@SAPAV1@XZ @ 6 NONAME ; class CSPProperty * CSPProperty::NewLC(void) - ?PropertyType@CSPProperty@@SA?AW4TSPItemType@@W4TServicePropertyName@@@Z @ 7 NONAME ; enum TSPItemType CSPProperty::PropertyType(enum TServicePropertyName) - ?NewLC@CCch@@SAPAV1@XZ @ 8 NONAME ; class CCch * CCch::NewLC(void) - ?GetServices@CCch@@QAEHW4TCCHSubserviceType@@AAV?$RPointerArray@VCCchService@@@@@Z @ 9 NONAME ; int CCch::GetServices(enum TCCHSubserviceType, class RPointerArray &) - ?GetSmileyIconArray@CIMCVEngine@@QAE?AV?$RPointerArray@VCGulIcon@@@@XZ @ 10 NONAME ; class RPointerArray CIMCVEngine::GetSmileyIconArray(void) - ?SetServiceName@CSPEntry@@QAEHABVTDesC16@@@Z @ 11 NONAME ; int CSPEntry::SetServiceName(class TDesC16 const &) - ?ChatInterface@CIMCVEngine@@QBEAAVMIMCVEngineChatInterface@@XZ @ 12 NONAME ; class MIMCVEngineChatInterface & CIMCVEngine::ChatInterface(void) const - ?GetPropertyType@CSPProperty@@QBE?AW4TSPItemType@@XZ @ 13 NONAME ; enum TSPItemType CSPProperty::GetPropertyType(void) const - ?GetProperty@CSPEntry@@QBEHAAPBVCSPProperty@@H@Z @ 14 NONAME ; int CSPEntry::GetProperty(class CSPProperty const * &, int) const - ?AddPropertyL@CSPEntry@@QAEHABVCSPProperty@@@Z @ 15 NONAME ; int CSPEntry::AddPropertyL(class CSPProperty const &) - ?GetValue@CSPProperty@@QBEHAAH@Z @ 16 NONAME ; int CSPProperty::GetValue(int &) const - ?FindPropertyL@CSPSettings@@QAEHIW4TServicePropertyName@@AAVCSPProperty@@@Z @ 17 NONAME ; int CSPSettings::FindPropertyL(unsigned int, enum TServicePropertyName, class CSPProperty &) - ?SetValue@CSPProperty@@QAEHABVTDesC16@@@Z @ 18 NONAME ; int CSPProperty::SetValue(class TDesC16 const &) - ?State@TCchServiceStatus@@QBE?AW4TCCHSubserviceState@@XZ @ 19 NONAME ; enum TCCHSubserviceState TCchServiceStatus::State(void) const - ?UpdateEntryL@CSPSettings@@QAEHABVCSPEntry@@@Z @ 20 NONAME ; int CSPSettings::UpdateEntryL(class CSPEntry const &) - ?NewL@CSPProperty@@SAPAV1@XZ @ 21 NONAME ; class CSPProperty * CSPProperty::NewL(void) - ??0TCchServiceStatus@@QAE@XZ @ 22 NONAME ; TCchServiceStatus::TCchServiceStatus(void) - ??1CSPSettings@@UAE@XZ @ 23 NONAME ; CSPSettings::~CSPSettings(void) - ?Release@CIMCVEngineFactory@@SAXXZ @ 24 NONAME ; void CIMCVEngineFactory::Release(void) - ?ReleaseConnectionL@CIMCVEngine@@QAEXXZ @ 25 NONAME ; void CIMCVEngine::ReleaseConnectionL(void) - ?DeleteProperty@CSPEntry@@QAEHW4TServicePropertyName@@@Z @ 26 NONAME ; int CSPEntry::DeleteProperty(enum TServicePropertyName) - ?SetConnectivityDialogsAllowed@CCch@@QAEXH@Z @ 27 NONAME ; void CCch::SetConnectivityDialogsAllowed(int) - ?SetError@TCchServiceStatus@@QAEXH@Z @ 28 NONAME ; void TCchServiceStatus::SetError(int) - ?AddEntryL@CSPSettings@@QAEHAAVCSPEntry@@@Z @ 29 NONAME ; int CSPSettings::AddEntryL(class CSPEntry &) - ?CopyL@CSPProperty@@QAEXABV1@@Z @ 30 NONAME ; void CSPProperty::CopyL(class CSPProperty const &) - ?GetValue@CSPProperty@@QBEHAAVTDes16@@@Z @ 31 NONAME ; int CSPProperty::GetValue(class TDes16 &) const - ?NewLC@CSPSettings@@SAPAV1@XZ @ 32 NONAME ; class CSPSettings * CSPSettings::NewLC(void) - ?GetSmileStringArray@CIMCVEngine@@QAE?AV?$RPointerArray@VHBufC16@@@@XZ @ 33 NONAME ; class RPointerArray CIMCVEngine::GetSmileStringArray(void) - ?LoginL@CIMCVEngine@@QAEHXZ @ 34 NONAME ; int CIMCVEngine::LoginL(void) - ?SettingsCountL@CSPSettings@@QAEHXZ @ 35 NONAME ; int CSPSettings::SettingsCountL(void) - ?GetLanguageId@CIMCVEngine@@QAEHXZ @ 36 NONAME ; int CIMCVEngine::GetLanguageId(void) - ?UpdateProperty@CSPEntry@@QAEHW4TServicePropertyName@@ABVTDesC16@@@Z @ 37 NONAME ; int CSPEntry::UpdateProperty(enum TServicePropertyName, class TDesC16 const &) - ?ResolveServiceStateL@CIMCVEngine@@QAEXXZ @ 38 NONAME ; void CIMCVEngine::ResolveServiceStateL(void) - ?CCHHandler@CIMCVEngine@@QAEAAVMIMCVEngineCchHandler@@XZ @ 39 NONAME ; class MIMCVEngineCchHandler & CIMCVEngine::CCHHandler(void) - ?GetAllProperties@CSPEntry@@QBEABV?$RPointerArray@VCSPProperty@@@@XZ @ 40 NONAME ; class RPointerArray const & CSPEntry::GetAllProperties(void) const - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 41 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) - ?FindEntryL@CSPSettings@@QAEHIAAVCSPEntry@@@Z @ 42 NONAME ; int CSPSettings::FindEntryL(unsigned int, class CSPEntry &) - ?GetService@CCch@@QAEPAVCCchService@@H@Z @ 43 NONAME ; class CCchService * CCch::GetService(int) - ?GetServiceName@CSPEntry@@QBEABVTDesC16@@XZ @ 44 NONAME ; class TDesC16 const & CSPEntry::GetServiceName(void) const - ?InstanceL@CIMCVEngineFactory@@SAPAVMIMCVEngineFactory@@XZ @ 45 NONAME ; class MIMCVEngineFactory * CIMCVEngineFactory::InstanceL(void) - ?GetLoggedInUserId@CIMCVEngine@@QAEABVTDesC16@@XZ @ 46 NONAME ; class TDesC16 const & CIMCVEngine::GetLoggedInUserId(void) - ?GetServiceId@CIMCVEngine@@QAEHXZ @ 47 NONAME ; int CIMCVEngine::GetServiceId(void) - ?UpdateProperty@CSPEntry@@QAEHW4TServicePropertyName@@W4TOnOff@@@Z @ 48 NONAME ; int CSPEntry::UpdateProperty(enum TServicePropertyName, enum TOnOff) - ?SetValue@CSPProperty@@QAEHH@Z @ 49 NONAME ; int CSPProperty::SetValue(int) - ?Error@TCchServiceStatus@@QBEHXZ @ 50 NONAME ; int TCchServiceStatus::Error(void) const - ?DeleteProperty@CSPEntry@@QAEHH@Z @ 51 NONAME ; int CSPEntry::DeleteProperty(int) - ?PropertyCount@CSPEntry@@QBEHXZ @ 52 NONAME ; int CSPEntry::PropertyCount(void) const - ?SetState@TCchServiceStatus@@QAEXW4TCCHSubserviceState@@@Z @ 53 NONAME ; void TCchServiceStatus::SetState(enum TCCHSubserviceState) - ??1CSPProperty@@UAE@XZ @ 54 NONAME ; CSPProperty::~CSPProperty(void) - ?ConnectivityDialogsAllowed@CCch@@QBEHXZ @ 55 NONAME ; int CCch::ConnectivityDialogsAllowed(void) const - ?NewL@CSPSettings@@SAPAV1@XZ @ 56 NONAME ; class CSPSettings * CSPSettings::NewL(void) - ?NewL@CCch@@SAPAV1@XZ @ 57 NONAME ; class CCch * CCch::NewL(void) - ?SetName@CSPProperty@@QAEHW4TServicePropertyName@@@Z @ 58 NONAME ; int CSPProperty::SetName(enum TServicePropertyName) - ?UpdateProperty@CSPEntry@@QAEHW4TServicePropertyName@@H@Z @ 59 NONAME ; int CSPEntry::UpdateProperty(enum TServicePropertyName, int) - ?GetServiceId@CSPEntry@@QBEIXZ @ 60 NONAME ; unsigned int CSPEntry::GetServiceId(void) const - ?DataType@CSPProperty@@SA?AW4TPropertyDataType@@W4TServicePropertyName@@@Z @ 61 NONAME ; enum TPropertyDataType CSPProperty::DataType(enum TServicePropertyName) - ?NewLC@CSPEntry@@SAPAV1@XZ @ 62 NONAME ; class CSPEntry * CSPEntry::NewLC(void) - ?ServiceName@CIMCVEngine@@QAEABVTDesC16@@XZ @ 63 NONAME ; class TDesC16 const & CIMCVEngine::ServiceName(void) - ?GetPresenceIconL@CIMCVEngine@@QAEPAVCGulIcon@@ABVTDesC8@@@Z @ 64 NONAME ; class CGulIcon * CIMCVEngine::GetPresenceIconL(class TDesC8 const &) - ?GetDataType@CSPProperty@@QBE?AW4TPropertyDataType@@XZ @ 65 NONAME ; enum TPropertyDataType CSPProperty::GetDataType(void) const - ??8CSPProperty@@QBEHABV0@@Z @ 66 NONAME ; int CSPProperty::operator==(class CSPProperty const &) const - ?SetValue@CSPProperty@@QAEHW4TOnOff@@@Z @ 67 NONAME ; int CSPProperty::SetValue(enum TOnOff) - ??1CSPEntry@@UAE@XZ @ 68 NONAME ; CSPEntry::~CSPEntry(void) - ?NewL@CSPEntry@@SAPAV1@XZ @ 69 NONAME ; class CSPEntry * CSPEntry::NewL(void) - ?AddOrUpdatePropertyL@CSPSettings@@QAEHIABVCSPProperty@@@Z @ 70 NONAME ; int CSPSettings::AddOrUpdatePropertyL(unsigned int, class CSPProperty const &) - ?IsLoggedIn@CIMCVEngine@@QBEHXZ @ 71 NONAME ; int CIMCVEngine::IsLoggedIn(void) const - ?GetProperty@CSPEntry@@QBEHAAPBVCSPProperty@@W4TServicePropertyName@@@Z @ 72 NONAME ; int CSPEntry::GetProperty(class CSPProperty const * &, enum TServicePropertyName) const - ?GetBrandId@CIMCVEngine@@QAEABVTDesC8@@XZ @ 73 NONAME ; class TDesC8 const & CIMCVEngine::GetBrandId(void) - ?GetName@CSPProperty@@QBE?AW4TServicePropertyName@@XZ @ 74 NONAME ; enum TServicePropertyName CSPProperty::GetName(void) const - ?GetServiceIds@CCch@@QBEHAAV?$RArray@H@@@Z @ 75 NONAME ; int CCch::GetServiceIds(class RArray &) const - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/conf/imcvuiengine_test.cfg --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/conf/imcvuiengine_test.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,252 +0,0 @@ -/* -* ============================================================================== -* Name : imcvuiengine_test.cfg -* Part of : conversationview / imcvuiengine_test -* -* Description : conversationview/vimcvuiengine related test cases -* Version: %version:1 % -* -* Copyright (C) 2002 - 2007 Nokia Corporation. -* This material, including documentation and any related -* computer programs, is protected by copyright controlled by -* Nokia Corporation. All rights are reserved. Copying, -* including reproducing, storing, adapting or translating, any -* or all of this material requires the prior written consent of -* Nokia Corporation. This material also contains confidential -* information which may not be disclosed to others without the -* prior written consent of Nokia Corporation. -* -* ============================================================================ -*/ -//////////////////////////////////////////// - -[Test] -title 1. StartNewConvesationL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj StartNewConvesationL -delete imcvuiengineObj -[Endtest] - -[Test] -title 2. CloseConvesationL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj CloseConvesationL -delete imcvuiengineObj -[Endtest] - -[Test] -title 3. SendNullMessageL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj SendNullMessageL -delete imcvuiengineObj -[Endtest] - -[Test] -title 4. SendTextMessageL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj SendTextMessageL -delete imcvuiengineObj -[Endtest] - -[Test] -title 5. SendSplCharMessageL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj SendSplCharMessageL -delete imcvuiengineObj -[Endtest] - - -[Test] -title 6. SendCosMessageL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj SendCosMessageL -delete imcvuiengineObj -[Endtest] - -[Test] -title 7. DeactivateConvesationL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj DeactivateConvesationL -delete imcvuiengineObj -[Endtest] - - -[Test] -title 8. TestMultipleSendMessageL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestMultipleSendMessageL -delete imcvuiengineObj -[Endtest] - -[Test] -title 9. TestSendRecieveMsgL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestSendRecieveMsgL -delete imcvuiengineObj -[Endtest] - -[Test] -title 10. TestSendFetchSendMsgL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestSendFetchSendMsgL -delete imcvuiengineObj -[Endtest] - - -[Test] -title 11. TestFailedMsgL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestFailedMsgL -delete imcvuiengineObj -[Endtest] - -[Test] -title 12. TestConnectionTerminationL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestConnectionTerminationL -delete imcvuiengineObj -[Endtest] - -[Test] -title 13. TestLoginStateL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestLoginStateL -delete imcvuiengineObj -[Endtest] - - -[Test] -title 14. TestLoginUserIdL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestLoginUserIdL -delete imcvuiengineObj -[Endtest] - -[Test] -title 15. TestChatInterfaceL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestChatInterfaceL -delete imcvuiengineObj -[Endtest] - -[Test] -title 16. TestMessageCoundL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestMessageCoundL -delete imcvuiengineObj -[Endtest] - -[Test] -title 17. TestMessageUnreadCoundL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestMessageUnreadCoundL -delete imcvuiengineObj -[Endtest] - -[Test] -title 18. TestDeleteContextL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestDeleteContextL -delete imcvuiengineObj -[Endtest] - -[Test] -title 19. TestCreateContextL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestCreateContextL -delete imcvuiengineObj -[Endtest] - - -[Test] -title 20. TestSubscribePresenceL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestSubscribePresenceL -delete imcvuiengineObj -[Endtest] - -[Test] -title 21. TestAppendInfoMessageL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestAppendInfoMessageL -delete imcvuiengineObj -[Endtest] - -[Test] -title 22. TestGetPresenceStatusL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestGetPresenceStatusL -delete imcvuiengineObj -[Endtest] - -[Test] -title 23. TestGetBrandIdL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestGetBrandIdL -delete imcvuiengineObj -[Endtest] - -[Test] -title 24. TestGetLanguageIdL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestGetLanguageIdL -delete imcvuiengineObj -[Endtest] - -[Test] -title 25. TestCCHHandlerL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestCCHHandlerL -delete imcvuiengineObj -[Endtest] - - -[Test] -title 26. ReadyForShutdownTestL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj ReadyForShutdownTestL -delete imcvuiengineObj -[Endtest] - -[Test] -title 27. ServiceNameTestL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj ServiceNameTestL -delete imcvuiengineObj -[Endtest] - -[Test] -title 28. OpenChatsTestL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj OpenChatsTestL -delete imcvuiengineObj -[Endtest] - - - [Test] -title 29. GetServiceIdTestL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj GetServiceIdTestL -delete imcvuiengineObj -[Endtest] - -[Test] -title 30. TestClosAllContainerL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestClosAllContainerL -delete imcvuiengineObj -[Endtest] - -[Test] -title 31. TestDeleteChatL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestDeleteChatL -delete imcvuiengineObj -[Endtest] - -[Test] -title 32. TestEditorMessageL -create imcvuiengine_test imcvuiengineObj -imcvuiengineObj TestEditorMessageL -delete imcvuiengineObj -[Endtest] diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/conf/test.xml --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/conf/test.xml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ - - - 1001 - MeCo Nightly Testing--Conversation view - - - - - - - - - - - - - - - - - - makedir - - - - - - - execute - - - - - - - - execute - - - - - - - makedir - - - - - - - install - - - - - - - - - - install - - - - - - - - - - - install - - - - - - - - - install - - - - - - - - - - - run-cases - - - - - - - - - - - execute - - - - - - - fetch-log - - - - - - - fetch-log - - - - - - - - fetch-log - - - - - - - - - - - - - - armv5_urel\imcvuiengine_test.dll - armv5_urel\system.conf - armv5_urel\TestFramework.ini - armv5_urel\imcvuiengine_test.cfg - build\MeCo.fpsx - build\MeCo_udaerase.fpsx - - - - FileStoreAction - - - - - - - STIF_COMPONENT_REPORT_ALL_CASES - ram.chauhan@nokia.com - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/group/bld.inf --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2007 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: Build information file for project ossprotocoladaptation -* -*/ - - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -PRJ_MMPFILES - -dummytestadaptation.mmp - - - -PRJ_TESTMMPFILES - -PRJ_TESTEXPORTS diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/group/dummytestadaptation.mmp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/group/dummytestadaptation.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2007 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: Project definition file for OSSProtocolAdaptation -* -*/ - -// To get the MW_LAYER_SYSTEMINCLUDE-definition -#include -#include "../inc/ossprotocoladaptationuids.h" - -TARGET dummytestadaptation.dll -TARGETTYPE Plugin -UID KEComRecognitionDllUid2 KEComRecognitionDllUid3 -VENDORID VID_DEFAULT -CAPABILITY CAP_ECOM_PLUGIN - -START RESOURCE ../rss/dummytestadaptation.rss -TARGET dummytestadaptation.rsc -END - -SOURCEPATH ../src -SOURCE cossprotocolplugin.cpp -SOURCE cossprotocolconnection.cpp -SOURCE cossprotocolconnectionmanager.cpp -SOURCE cossprotocolimfeatures.cpp - -// Im operations source -SOURCE cossprotocolimconversation.cpp - -// user includes -USERINCLUDE . -USERINCLUDE ../inc - -// Default system include paths for middleware layer modules. -MW_LAYER_SYSTEMINCLUDE - -//SYSTEMINCLUDE /epoc32/include/libc -SYSTEMINCLUDE /epoc32/include/ecom - -//SYSTEMINCLUDE /epoc32/include/stdapis -//SYSTEMINCLUDE /epoc32/include/osextensions/stdapis -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY flogger.lib -LIBRARY bafl.lib - - - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolconnection.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolconnection.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: oss plugin implementation for XIMP Framework -* -*/ - - -#ifndef __COSSPROTOCOLCONNECTION_H__ -#define __COSSPROTOCOLCONNECTION_H__ - -//#include "OSSProtocloLiterals.h" - -#include -#include -#include -#include -#include - - -// FORWARD DECLARATIONS - -class MXIMPServiceInfo; - -class MXIMPContextClientInfo; - -class MXIMPProtocolConnection; - -class COSSProtocolConnectionManager; - -class COSSProtocolImFeatures; - -/** - * COSSProtocolConnection - * - * OSS Protocol Connection Object. Protocol Connection Object has connection Manager. - * - * - * - */ - -class COSSProtocolConnection : - public CBase, - public MXIMPProtocolConnection - { - - public: - - static COSSProtocolConnection* NewL ( const MXIMPServiceInfo& aServiceInfo, - const MXIMPContextClientInfo& aClientCtxInfo ); - - - ~COSSProtocolConnection(); - - - - void ReleaseConnectionL(); - - - private: - - COSSProtocolConnection(); - - - void ConstructL ( const MXIMPServiceInfo& aServiceInfo, - const MXIMPContextClientInfo& aClientCtxInfo ); - - - public: // from MXIMPBase - - TAny* GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ); - - const TAny* GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) const; - - - TInt32 GetInterfaceId() const; - - - public: // from CPrFwProtocolConnection - - // Common - void PrimeHost ( MXIMPProtocolConnectionHost& aHost ); - - - // session management.for comments see MXIMPProtocolConnection - void OpenSessionL ( const MXIMPContextClientInfo& aClientCtxInfo, - TXIMPRequestId aOpId ); - - void OpenSessionL ( const TInt& aSettingsId, - TXIMPRequestId aReqId ); - void OpenSessionL ( - const MXIMPContextClientInfo& aContextClient, - const TInt& aSettingsId, - TXIMPRequestId aReqId ); - - void CloseSession ( const MXIMPContextClientInfo& aClientCtxInfo, - TXIMPRequestId aOpId ); - void LogoutRequestL(TXIMPRequestId aOpId); - - void ReOpenSessionsL ( TXIMPRequestId aReqId ); - - void GetSupportedFeaturesL ( CDesC8Array& aFeatures ) const; - - MProtocolPresenceFeatures& ProtocolPresenceFeatures(); - - //MProtocolImFeatures* ProtocolImFeatures(); - TAny* GetProtocolInterface(TInt aInterfaceId); - - - private: // data members - /** - * OWN: - */ - COSSProtocolConnectionManager* iConnMan; - - /** - * OWN: - */ - COSSProtocolImFeatures* iImFeatures; - /** - * OWN: - */ - TXIMPRequestId iRequestId; - - - TInt iConntectionCreated; - - MProtocolPresenceFeatures* iPresenceFeature; - - - }; - - -#endif // __COSSPROTOCOLCONNECTION_H__ diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolconnectionmanager.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolconnectionmanager.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: connection manager -* -*/ - -#ifndef __COSSPROTOCOLCONNECTIONMANAGER_H__ -#define __COSSPROTOCOLCONNECTIONMANAGER_H__ - -// INCLUDES -#include -#include -#include -#include "mossprotocolconnectionmanager.h" -#include "creceivemessagehandler.h" - -#include - -// FORWARD DECLARATIONS - -class MXIMPServiceInfo; - -class MXIMPProtocolConnectionHost; - -class MOSSProtocolConnectionManager; -class MProtocolImDataHost; - -/** - * COSSProtocolConnectionManager - * - * Every XIMPFW-OSS Connection has Connection Manager Object. - * - * - * - */ -NONSHARABLE_CLASS ( COSSProtocolConnectionManager ) : public CBase, - public MOSSProtocolConnectionManager - // implement session status observer callback - { - -public: - - static COSSProtocolConnectionManager* NewL(); - virtual ~COSSProtocolConnectionManager(); - - -private: - - COSSProtocolConnectionManager(); - void ConstructL(); - - -public: // MOSSProtocolConnectionManager - - - MXIMPProtocolConnectionHost& HandleToHost(); - -public: // new methods - - /** - * set protocol connection host - * @param aHost protocol connection host - */ - void SetHost ( MXIMPProtocolConnectionHost& aHost ); - - void SetImHost(MProtocolImDataHost& aHost); - - MProtocolImDataHost& GetImHost() ; - -private: // data - - - MXIMPProtocolConnectionHost* iHostHandle; - // not own - MProtocolImDataHost *iHost ; - - }; - - -#endif // __COSSPROTOCOLCONNECTIONMANAGER_H__ diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolimconversation.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolimconversation.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Oss protocol im conversation -* -*/ - -#ifndef COSSPROTOCOLIMCONVERSATION_H__ -#define COSSPROTOCOLIMCONVERSATION_H__ - - -#include -#include - - -class MOSSProtocolConnectionManager; - - -/** - * COSSProtocolImConversation - * - * ?more_complete_description - * - * @lib ?library - * @since S60 v4.0 - */ -class COSSProtocolImConversation : public CBase, - public MProtocolImConversation - { - -public: - - static COSSProtocolImConversation* NewL( MOSSProtocolConnectionManager& aConnManager ); - ~COSSProtocolImConversation(); - - -private: - - COSSProtocolImConversation( MOSSProtocolConnectionManager& aConnManager ); - void ConstructL(); - -public: - - // MXIMPBase Start - - TAny* GetInterface( TInt32 aInterfaceId, - TIfGetOps aOptions ); - - const TAny* GetInterface( TInt32 aInterfaceId, - TIfGetOps aOptions ) const; - - - TInt32 GetInterfaceId() const; - - // MXIMPBase End - -public: // From MProtocolImConversation - // Manage Im operations.For comments,see MProtocolImConversation - void DoSendMessageL( - const MImConversationInfo& aImMessage, - TXIMPRequestId aReqId ); - void DoForwardMessageL( - const MImConversationInfo& aImMessage, - TXIMPRequestId aReqId); - void DoSendMessageToGroupL( - const MImConversationInfo& aImMessage, - const TDesC* aGroupId,TXIMPRequestId aReqId ); - TXIMPRequestId DoBlockUsersL( - const MDesCArray* aUserIds, - TXIMPRequestId aReqId); - TXIMPRequestId DoUnBlockUsersL( - const MDesCArray* aUserIds, - TXIMPRequestId aReqId ); - void DoGetBlockedListRequestL( - const MXIMPIdentity& aImMessageId, - TXIMPRequestId aReqId ); - void DoGetMessageListL( - const MXIMPIdentity& aImMessageId, - const TDesC* aGroupId, - const TInt aMessageCount, - TBool aDeliveryReportWanted, - TXIMPRequestId aReqId); - void DoRejectMessageL( - const MXIMPIdentity& aImMessageId, - const TDesC& aMessageID, - TXIMPRequestId aReqId ); -private: - /** - * Creates data handler - */ - void CreateDataHandlerL(); - -private: // data members - /** - * Oss Protocol Plugin Connection Manager - * Not own. *** Write "Not own" if some other class owns this object. - */ - MOSSProtocolConnectionManager& iConnMan; - - }; - -#endif // COSSPROTOCOLIMCONVERSATION_H__ diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolimfeatures.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolimfeatures.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: oss presence features implementation for XIMP Framework -* -*/ - - -#ifndef __COSSPROTOCOLIMFEATURES_H__ -#define __COSSPROTOCOLIMFEATURES_H__ - -// INCLUDES -#include -#include -//#include -//#include -//#include -//#include -//#include -#include "cossprotocolconnectionmanager.h" - -class COSSProtocolImConversation; -/** - * COSSProtocolImFeatures - * - * OSS Protocol Connection Object. Protocol Connection Object has connection Manager. - * - * @lib ?library - * @since S60 v4.0 - */ - -class COSSProtocolImFeatures : - public CBase, - public MProtocolImFeatures - { - - public: - - static COSSProtocolImFeatures* NewL ( COSSProtocolConnectionManager& aConnMan ); - - - ~COSSProtocolImFeatures(); - - private: - - COSSProtocolImFeatures(COSSProtocolConnectionManager& aConnMan ); - - - void ConstructL ( COSSProtocolConnectionManager& aConnMan ); - - public: // from MXIMPBase - - TAny* GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ); - - const TAny* GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) const; - - - TInt32 GetInterfaceId() const; - - public : - - // From MProtocolImFeatures.for comments,see MProtocolImFeatures - MProtocolImGroup& ImGroup(); - MProtocolImConversation& ImConversation(); - MProtocolImInvitation& ImInvitation(); - MProtocolImSearch& ImSearch(); - void SetHost(MProtocolImDataHost& aHost ); - - private : //data members - /** - * OWN: - */ - COSSProtocolImConversation* iImConversation; - - // not owned - MProtocolImDataHost *iHost ; - // not owned - COSSProtocolConnectionManager &iConnMan ; - - }; - -#endif //__COSSPROTOCOLIMFEATURES_H__ - -// end of file \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolloginrequest.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolloginrequest.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Login Request to the Network Server. -* -*/ - - - -#ifndef _COSSPROTOCOLLOGINREQUEST_H_ -#define _COSSPROTOCOLLOGINREQUEST_H_ - -// INCLUDES -#include -#include -#include - -#include "ossprotocloliterals.h" -// FORWARD DECLARATIONS - -class MOSSProtocolConnectionManager; - -class COSSProtocolConnectionManager; - - -const TInt KImpsMaxResourceIdLen = 64; // maximum Resource ID, this is not sure! - -/** - * COSSProtocolLoginRequest - * - * Issue Login Request to the Network Server - * - * @lib ?library - * @since S60 v4.0 - */ -NONSHARABLE_CLASS ( COSSProtocolLoginRequest ) : public CActive - - - { - -public: - - static COSSProtocolLoginRequest* NewLC ( MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ); - static COSSProtocolLoginRequest* NewL ( MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ); - virtual ~COSSProtocolLoginRequest(); - - -private: - - COSSProtocolLoginRequest ( MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ); - void ConstructL(); - - -private: // from CActive - - void DoCancel(); - /* - * RunL() function also deletes the request object once the activity is done - * - */ - void RunL(); - TInt RunError ( TInt aError ); - -private: // new methods - - /** - * Resource Id Generator - * Leaves with KErrNotFound if no value - * @return ResourceId - */ - TPtrC GenResourceId( const TDesC& aResourceId ); -public: - - /** - * Issue login request to the isolation server - */ - void IssueLoginRequestL(); - - -private: // data - - /** - * OWN:Request Id from PrFw - */ - TXIMPRequestId iRequestId; - /** - * Send data request to pure data handler generates the id - */ - TInt iSendId; - /* OSS Protocol Plugin Connection Manager - * Not own. - */ - MOSSProtocolConnectionManager& iConnMan; - - - TBuf iResourceId; // Resource ID Implementation - }; - - -#endif // _COSSPROTOCOLLOGINREQUEST_H_ - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocollogoutrequest.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocollogoutrequest.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Login Request to the Network Server. -* -*/ - - - -#ifndef __COSSPROTOCOLLOGOUTREQUEST_H_ -#define __COSSPROTOCOLLOGOUTREQUEST_H_ - -// INCLUDES -#include -#include -#include -#include "ossprotocloliterals.h" -// FORWARD DECLARATIONS - -class MOSSProtocolConnectionManager; - -class COSSProtocolConnectionManager; - - -/** - * COSSProtocolLogoutRequest - * - * Issue Login Request to the Network Server - * - * @lib ?library - * @since S60 v4.0 - */ -NONSHARABLE_CLASS ( COSSProtocolLogoutRequest ) : public CActive - - - { - -public: - - static COSSProtocolLogoutRequest* NewLC ( MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ); - static COSSProtocolLogoutRequest* NewL ( MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ); - virtual ~COSSProtocolLogoutRequest(); - - -private: - - COSSProtocolLogoutRequest ( MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ); - void ConstructL(); - - -private: // from CActive - - void DoCancel(); - /* - * RunL() function also deletes the request object once the activity is done - * - */ - void RunL(); - TInt RunError ( TInt aError ); - -public: - /** - * Issue logout request to the isolation server - */ - void IssueLogoutRequestL(); - - -private: // data - - /** - * OWN: Request Id - */ - - TXIMPRequestId iRequestId; - /** - * OSS Protocol Plugin Connection Manager - * Not own. - */ - MOSSProtocolConnectionManager& iConnMan; - - /** - * Send data request to pure data handler generates the id - */ - TInt iSendId; - - }; - - -#endif // __COSSPROTOCOLLOGOUTREQUEST_H_ - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolplugin.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cossprotocolplugin.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: adaptation for open source -* -*/ - - -#ifndef __COSSPROTOCOLPLUGIN_H__ -#define __COSSPROTOCOLPLUGIN_H__ - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS - -class MXIMPServiceInfo; - -class MXIMPContextClientInfo; - -class COSSProtocolConnection; - -class CProcessLauncher; - - - - -/** - * OSS protocol Plugin - * - * OSS plugin is ECOM plugin and shall be loaded by PrFw. - * OSS has one or many connections. - * @lib ?library - * @since S60 v4.0 - */ - -class COSSProtocolPlugin : public CXIMPProtocolPluginBase - { - - public: - - static COSSProtocolPlugin* NewL(); - static COSSProtocolPlugin* NewLC(); - - ~COSSProtocolPlugin(); - - private: - - COSSProtocolPlugin(); - void ConstructL(); - - public: // From MXIMPProtocolPlugin - // For comments,see MXIMPProtocolPlugin - void PrimeHost ( MXIMPProtocolPluginHost& aHost ); - - MXIMPProtocolConnection& AcquireConnectionL ( - const MXIMPServiceInfo& aServiceInfo, - const MXIMPContextClientInfo& aClientCtxInfo ); - void ReleaseConnection ( - MXIMPProtocolConnection& aConnection ); - - public: // from MXIMPBase - - TAny* GetInterface ( - TInt32 aInterfaceId, - TIfGetOps aOptions ); - - const TAny* GetInterface ( - TInt32 aInterfaceId, - TIfGetOps aOptions ) const; - - TInt32 GetInterfaceId() const; - - private: // Data - /** - * Prime host - * Not own. - */ - MXIMPProtocolPluginHost* iHost; - /** - * protocol connections - * Own. - */ - RPointerArray< COSSProtocolConnection > iConnections; - - // owned pointer to imp - CProcessLauncher *iIsoServerLauncher; - - - }; - -#endif // __COSSPROTOCOLPLUGIN_H__ diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cosssendmessagerequest.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/cosssendmessagerequest.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Oss Protocol send massage request -* -*/ - - -#ifndef __COSSSENDMESSAGEREQUEST_H__ -#define __COSSSENDMESSAGEREQUEST_H__ - - -// INCLUDES -#include -#include -#include "ossprotocloliterals.h" - -// FORWARD DECLARATIONS - -class MOSSProtocolConnectionManager; - -class MImConversationInfo; -/** - * COSSSendMessageRequest - * - * Issue Send Message Request to Network Server - * - * @lib ?library - * @since S60 v4.0 - */ - -class COSSSendMessageRequest: public CActive - - - { - - public: - - static COSSSendMessageRequest* NewL ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ); - - static COSSSendMessageRequest* NewLC ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ); - - virtual ~COSSSendMessageRequest(); - - private: - - COSSSendMessageRequest ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ); - void ConstructL(); - - private: // from CActive - - void DoCancel(); - /* - * RunL() function also deletes the request object once the activity is done - * - */ - void RunL(); - TInt RunError ( TInt aError ); - - public: - /** - * Send message to the recipients - * @param aImMessage stucture stores message,recipients - */ - void SendMessageL ( const MImConversationInfo& aImMessage ); - - private: // data - - /** - * Request Id from PrFw - */ - TXIMPRequestId iRequestId; - /** - * Send data request to pure data handler generates the id - */ - TInt iSendId; - - HBufC16* iListId; - /** - * Oss Protocol Plugin Connection Manager - * Not own. *** Write "Not own" if some other class owns this object. - */ - MOSSProtocolConnectionManager& iConnMan; - - }; - - -#endif // __COSSSENDMESSAGEREQUEST_H__ - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/creceivemessagehandler.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/creceivemessagehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Implementation of reicive message handler -* -*/ - - -#ifndef __CRECEIVEMESSAGEHANDLER_H__ -#define __CRECEIVEMESSAGEHANDLER_H__ - - -// INCLUDES -#include -#include - - - -// FORWARD DECLARATIONS - -class MOSSProtocolConnectionManager; -/*class MPEngXMLParser; -class MPEngXmlSerializer;*/ - -/** - * CReceiveMessageHandler - * - * - * - * @lib ?library - */ - -class CReceiveMessageHandler: public CActive - - - { - - public: - - static CReceiveMessageHandler* NewL ( - MOSSProtocolConnectionManager& aConnMan - ); - - - virtual ~CReceiveMessageHandler(); - - private: - - CReceiveMessageHandler ( MOSSProtocolConnectionManager& aConnMan ); - void ConstructL(); - - private: // from CActive - - void DoCancel(); - void RunL(); - TInt RunError ( TInt aError ); - - public: - - /** - * start listening recieved massages - */ - void StartListeningL(); - /** - * parse the data and update the data cache of ximp.send event back to ximp - */ - void ProcessIncomingDataL(); - - private: // data - - /** - * Send data request to pure data handler generates the id - */ - TInt iSendId; - - /** - * Oss Protocol Plugin Connection Manager - * Not own. *** Write "Not own" if some other class owns this object. - */ - MOSSProtocolConnectionManager& iConnMan; - - }; - - -#endif // __CRECEIVEMESSAGEHANDLER_H__ - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/mossprotocolconnectionmanager.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/mossprotocolconnectionmanager.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: oss protocol plugin connection manager interface -* -*/ - -#ifndef __MOSSCONNNECTIONMANAGERCONTROL_H__ -#define __MOSSCONNNECTIONMANAGERCONTROL_H__ - - -// FORWARD DECLARATIONS - -class MXIMPProtocolConnectionHost; - -/** - * MTelepathyPrtPluginConnectionManager - * - * Telepathy Plugin Connection Manager's Interface - * - */ -class MOSSProtocolConnectionManager - { - -public: - - - /** - * @since S60 ?S60_version - * access to protocol connection host - * @return protocol connection host - */ - virtual MXIMPProtocolConnectionHost& HandleToHost() = 0; - -protected: - - /** - * Protected destructor. - * Instancies can't be destroyed via this interface. - */ - virtual ~MOSSProtocolConnectionManager() {} - - }; - -#endif // __MOSSCONNNECTIONMANAGERCONTROL_H__ - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/ossprotocloliterals.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/ossprotocloliterals.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: OSS adapter plugin -* -*/ - -#ifndef __OSSPROTOCOLLITERALS_H__ -#define __OSSPROTOCOLLITERALS_H__ - -#include - -#define CONNMGR_BUS "org.freedesktop.Telepathy.ConnectionManager.gabble" -#define CONNMGR_PATH "/org/freedesktop/Telepathy/ConnectionManager/gabble" -#define PROTOCOL "jabber" -#define TP_IFACE_CONN_MGR_INTERFACE \ - "org.freedesktop.Telepathy.ConnectionManager" -#define TestId "mytest" -#define ServerStr "server" -#define ResourceStr "resource" -#define AccountStr "account" -#define PasswdStr "password" -#define PortStr "port" -#define OldsslStr "old-ssl" -#define PORT 443 - -_LIT(KOSSProtocolConnection, "COSSProtocolConnection"); -_LIT8(KConnectionFeature, "telepathy/connection "); -_LIT( KZeroId, "0" ); -_LIT(KSlash,"/"); -_LIT(KEnd,"\0"); - -enum TRegRespState - { - ERequestDelivered = 0, - EResponseRecieved - }; - - -#endif //__OSSPROTOCOLLITERALS_H__ - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/ossprotocoladaptationuids.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/ossprotocoladaptationuids.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: OSSProtocolAdaptationUids -* NOTE!! Don't change / edit any UID values!!! -* -*/ - -#ifndef __OSSPROTOCOLADAPTATIONUIDS_H_ -#define __OSSPROTOCOLADAPTATIONUIDS_H_ -// MACROS - -//Uid2:s -#define KEComRecognitionDllUid2 0x10009D8D // CSI: 8 # - -//Uid3:s -#define KEComRecognitionDllUid3 0x20007B6D // 0x10282EE9 - - - -#endif // __OSSPROTOCOLADAPTATIONUIDS_H_ - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/ossprotocolpluginpanics.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/inc/ossprotocolpluginpanics.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: OSs adapter plugin panics -* -*/ - -#ifndef __OSSPROTOCOLPLUGINPANICS_H__ -#define __OSSPROTOCOLPLUGINPANICS_H__ - -// INCLUDES -#include - - -// CONSTANTS -/** -* OSS Adaptation Library panic category. -*/ -_LIT( KOSSProtocolPluginPanic, "OSSProtocolPlugin" ); - -/** -* OSS Adaptation Library Auth interface -*/ - -_LIT(KOSSProtocolPresenceAuthorization, "COSSProtocolPresenceAuthorization"); - -/** -* OSS Adaptation Library Publishing interface -*/ - -_LIT(KOSSProtocolPresencePublishing, "COSSProtocolPresencePublishing"); - -/** -* OSS Adaptation Library watching interface. -*/ - -_LIT(KOSSProtocolPresenceWatching, "COSSProtocolPresenceWatching"); - -/** -* OSS Adaptation Library panic presentity groups interface. -*/ - -_LIT(KOSSProtocolPresentityGroups, "COSSProtocolPresentityGroups"); - -/** -* OSS Adaptation Library panic conversation interface. -*/ - -_LIT(KOSSProtocolConversation, "COSSProtocolImConversation"); - - -/** -* Telepathy adapter plugin library panic reasons. -* -* Following panic reasons are used in -* OSS adapter plugin library panics. -* -* @since 3.0 -*/ -enum TOSSAdapterPluginPanics - { - ESesionConsistencyLost = 1, - EOpIdConsistencyLost = 2, - ENoActiveOperations = 3, - EUnknownUnumeration = 4, - EReferenceCountUnderflow = 5, - EIlegalSingletonDeletion = 6, - EAccessHandlerObserversUnregistered = 7, - EUnknowPureData = 8, - EListenerAlreadyActive = 9, - ELogInDataNotValid = 10 - - }; - - -#endif //__OSSPROTOCOLPLUGINPANICS_H__ - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/rss/dummytestadaptation.rss --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/rss/dummytestadaptation.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2006 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: ECOM registery info for Presence Framework Test Protocol -* -*/ - - -#include - -#include - -// --------------------------------------------------------------------------- -// ECOM registery info for XIMP Framework ECOM hook -// --------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO theInfo - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = 0x20007B6D; // dll's own uid - - interfaces = - { - INTERFACE_INFO - { // implemented interface - interface_uid = XIMP_ECOM_IF_UID_PROTOCOL_PLUGIN_BASE_INTERFACE; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0x20007B6D; // implementation's identifier uid - version_no = 1; - display_name = "XMPP"; // Protocol display name - default_data = "XMPP"; // Protocol Id string - - } - }; - } - }; - } - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolconnection.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolconnection.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,305 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: oss protocol plugin connection -* -*/ - -#include "cossprotocolconnection.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cossprotocolconnectionmanager.h" -#include "cossprotocolimfeatures.h" - -#include "cossprotocolloginrequest.h" -#include "mossprotocolconnectionmanager.h" - -#include "cossprotocollogoutrequest.h" -#include - - -// ======== COSSProtocolConnection - MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::COSSProtocolConnection() -// --------------------------------------------------------------------------- -// -COSSProtocolConnection::COSSProtocolConnection() - { - //LOGGER ( TXT ( "COSSProtocolConnection::COSSProtocolConnection() Start-End" ) ); - } - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::ConstructL() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnection::ConstructL ( - const MXIMPServiceInfo& /*aServiceInfo*/ , - const MXIMPContextClientInfo& /*aClientCtxInfo*/ ) - { - //LOGGER ( TXT ( "COSSProtocolConnection::ConstructL() Start" ) ); - -// PLUGIN_UNUSED_PARAM ( aClientCtxInfo ); - iConnMan = COSSProtocolConnectionManager::NewL(); - -// iPresFeatures = COSSProtocolPresenceFeatures::NewL ( *iConnMan ); - iImFeatures = COSSProtocolImFeatures::NewL ( *iConnMan ); - //LOGGER ( TXT ( "COSSProtocolConnection::ConstructL() End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::NewL() -// --------------------------------------------------------------------------- -// -COSSProtocolConnection* COSSProtocolConnection::NewL ( - const MXIMPServiceInfo& aServiceInfo, - const MXIMPContextClientInfo& aClientCtxInfo ) - { - //LOGGER ( TXT ( "COSSProtocolConnection::NewL() Start" ) ); - - COSSProtocolConnection* self = new ( ELeave ) COSSProtocolConnection; - CleanupStack::PushL ( self ); - self->ConstructL ( aServiceInfo, aClientCtxInfo ); - CleanupStack::Pop ( self ); - - //LOGGER ( TXT ( "COSSProtocolConnection::NewL() End" ) ); - return self; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::~COSSProtocolConnection() -// --------------------------------------------------------------------------- -// -COSSProtocolConnection::~COSSProtocolConnection() - { - //LOGGER ( TXT ( "COSSProtocolConnection::~COSSProtocolConnection() Start" ) ); - - delete iConnMan; - delete iImFeatures; - //LOGGER ( TXT ( "COSSProtocolConnection::~COSSProtocolConnection() End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::GetInterface() -// --------------------------------------------------------------------------- -// -TAny* COSSProtocolConnection::GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) - { - //LOGGER ( TXT ( "COSSProtocolConnection::GetInterface() Start" ) ); - - if ( aInterfaceId == MXIMPProtocolConnection::KInterfaceId ) - { - MXIMPProtocolConnection* self = this; - return self; - } - - if ( aOptions == MXIMPBase::EPanicIfUnknown ) - - { - User::Panic ( KOSSProtocolConnection, KErrExtensionNotSupported ); - } - - //LOGGER ( TXT ( "COSSProtocolConnection::GetInterface() End" ) ); - - return NULL; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::GetInterface() const -// --------------------------------------------------------------------------- -// -const TAny* COSSProtocolConnection::GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) const - { - //LOGGER ( TXT ( "COSSProtocolConnection::GetInterface() const Start" ) ); - - if ( aInterfaceId == MXIMPProtocolConnection::KInterfaceId ) - { - const MXIMPProtocolConnection* self = this; - return self; - } - - if ( aOptions == MXIMPBase::EPanicIfUnknown ) - { - User::Panic ( KOSSProtocolConnection, KErrExtensionNotSupported ); - } - - //LOGGER ( TXT ( "COSSProtocolConnection::GetInterface() const End" ) ); - - return NULL; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::GetInterfaceId() const -// --------------------------------------------------------------------------- -// -TInt32 COSSProtocolConnection::GetInterfaceId() const - { - //LOGGER ( TXT ( "COSSProtocolConnection::GetInterfaceId() Start-End" ) ); - return MXIMPProtocolConnection::KInterfaceId; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::PrimeHost() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnection::PrimeHost ( MXIMPProtocolConnectionHost& aHost ) - { - //LOGGER ( TXT ( "COSSProtocolConnection::PrimeHost() Start" ) ); - - iConnMan->SetHost ( aHost ); - - //LOGGER ( TXT ( "COSSProtocolConnection::PrimeHost() Start" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::OpenSessionL() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnection::OpenSessionL ( - const MXIMPContextClientInfo& /*aClientCtxInfo*/, - TXIMPRequestId aOpId ) - { - - iConnMan->HandleToHost().HandleRequestCompleted(aOpId,KErrNone); - - //LOGGER ( TXT ( "COSSProtocolConnection::OpenSessionL() End" ) ); - } - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::OpenSessionL() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnection::OpenSessionL ( const TInt& /*aSettingsId*/, - TXIMPRequestId aReqId ) - { - //LOGGER ( TXT ( "COSSProtocolConnection::OpenSessionLsettingsid \n" ) ); - - iConnMan->HandleToHost().HandleRequestCompleted(aReqId,KErrNone); - - - //LOGGER ( TXT ( "COSSProtocolConnection::OpenSessionLsettingsid() End" ) ); - } - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::OpenSessionL() -// --------------------------------------------------------------------------- -// - -void COSSProtocolConnection::OpenSessionL ( - const MXIMPContextClientInfo& /*aContextClient*/, - const TInt& /*aSettingsId*/, - TXIMPRequestId /*aReqId*/ ) - { - - } - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::CloseSession() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnection::CloseSession ( - const MXIMPContextClientInfo& /*aClientCtxInfo*/, - TXIMPRequestId aOpId ) - { - iConnMan->HandleToHost().HandleRequestCompleted(aOpId,KErrNone); - //LOGGER ( TXT ( "COSSProtocolConnection::CloseSession() End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::ReOpenSessionsL() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnection::ReOpenSessionsL ( TXIMPRequestId /*aOpId*/ ) - { - //LOGGER ( TXT ( "COSSProtocolConnection::ReOpenSessionsL() Start" ) ); - - //LOGGER ( TXT ( "COSSProtocolConnection::ReOpenSessionsL() End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::GetSupportedFeaturesL() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnection::GetSupportedFeaturesL ( CDesC8Array& aFeatures ) const - { - //LOGGER ( TXT ( "COSSProtocolConnection::GetSupportedFeaturesL() Start End" ) ); - // first empty the whole array - aFeatures.Reset(); - - // then add our features there - aFeatures.AppendL ( KConnectionFeature ); - //LOGGER ( TXT ( "COSSProtocolConnection::GetSupportedFeaturesL" ) ); - } - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::ProtocolPresenceFeatures() -// --------------------------------------------------------------------------- -// -MProtocolPresenceFeatures& COSSProtocolConnection::ProtocolPresenceFeatures() - { - //LOGGER ( TXT ( "COSSProtocolConnection::ProtocolPresenceFeatures() Start " ) ); - //LOGGER ( TXT ( "COSSProtocolConnection::ProtocolPresenceFeatures() End " ) ); - return *iPresenceFeature; - } -// --------------------------------------------------------------------------- -// COSSProtocolConnection::ProtocolImFeatures() -// --------------------------------------------------------------------------- -// -/* -MProtocolImFeatures* COSSProtocolConnection::ProtocolImFeatures() - { - LOGGER ( TXT ( "COSSProtocolConnection::ProtocolImFeatures() Start " ) ); - return iImFeatures; - }*/ - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::ReleaseConnectionL() -// --------------------------------------------------------------------------- -// - -void COSSProtocolConnection::ReleaseConnectionL() - { - //LOGGER ( TXT ( "COSSProtocolConnection::ReleaseConnectionL() Start " ) ); - - //LOGGER ( TXT ( "COSSProtocolConnection::ReleaseConnectionL() End" ) ); - } -TAny* COSSProtocolConnection::GetProtocolInterface(TInt aInterfaceId) - { - if(aInterfaceId == MProtocolImFeatures::KInterfaceId) - { - return iImFeatures->GetInterface(aInterfaceId, MXIMPBase::EPanicIfUnknown ); - } - return NULL; - } - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolconnectionmanager.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolconnectionmanager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: connection manager -* -*/ - -#include "cossprotocolconnectionmanager.h" - -#include -#include -#include -#include -#include - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// COSSProtocolConnectionManager::COSSProtocolConnectionManager() -// --------------------------------------------------------------------------- -// -COSSProtocolConnectionManager::COSSProtocolConnectionManager() - { - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnectionManager::ConstructL() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnectionManager::ConstructL() - { - - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnectionManager::NewL() -// --------------------------------------------------------------------------- -// -COSSProtocolConnectionManager* COSSProtocolConnectionManager::NewL() - { - - COSSProtocolConnectionManager* self = new ( ELeave ) - COSSProtocolConnectionManager(); - - CleanupStack::PushL ( self ); - - self->ConstructL(); - CleanupStack::Pop ( self ); - - return self; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnectionManager::~COSSProtocolConnectionManager() -// --------------------------------------------------------------------------- -// -COSSProtocolConnectionManager::~COSSProtocolConnectionManager() - { - - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnectionManager::HandleToHost() -// --------------------------------------------------------------------------- -// -MXIMPProtocolConnectionHost& COSSProtocolConnectionManager::HandleToHost() - { - return *iHostHandle; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolConnectionManager::SetHost() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnectionManager::SetHost ( MXIMPProtocolConnectionHost& aHost ) - { - iHostHandle = &aHost; - } - -// --------------------------------------------------------------------------- -// COSSProtocolConnectionManager::SetHost() -// --------------------------------------------------------------------------- -// -void COSSProtocolConnectionManager::SetImHost(MProtocolImDataHost& aHost) - { - iHost = &aHost ; - } - -// --------------------------------------------------------------------------- -// COSSProtocolConnectionManager::SetHost() -// --------------------------------------------------------------------------- -// -MProtocolImDataHost& COSSProtocolConnectionManager::GetImHost() - { - return *iHost; - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolimconversation.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolimconversation.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,268 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Oss Protocol im conversation implementation -* -*/ - -#include -#include -#include -#include "cossprotocolimconversation.h" -#include "cossprotocolconnectionmanager.h" -#include "cosssendmessagerequest.h" -#include "mossprotocolconnectionmanager.h" -#include "ossprotocolpluginpanics.h" -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::GetInterface() -// --------------------------------------------------------------------------- -// -TAny* COSSProtocolImConversation::GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) - { - //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterface() Start" ) ); - - if ( aInterfaceId == MProtocolImConversation::KInterfaceId ) - { - MProtocolImConversation* self = this; - return self; - } - - if ( aOptions == MXIMPBase::EPanicIfUnknown ) - - { - User::Panic ( KOSSProtocolConversation, KErrExtensionNotSupported ); - } - - //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterface() End" ) ); - - return NULL; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::GetInterface() -// --------------------------------------------------------------------------- -// -const TAny* COSSProtocolImConversation::GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) const - { - //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterface() Start" ) ); - - if ( aInterfaceId == MProtocolImConversation::KInterfaceId ) - { - const MProtocolImConversation* self = this; - return self; - } - - if ( aOptions == MXIMPBase::EPanicIfUnknown ) - - { - User::Panic ( KOSSProtocolConversation, KErrExtensionNotSupported ); - } - - //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterface() End" ) ); - - return NULL; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::GetInterfaceId() -// --------------------------------------------------------------------------- -// -TInt32 COSSProtocolImConversation::GetInterfaceId() const - { - //LOGGER ( TXT ( "COSSProtocolImConversation::GetInterfaceId() Start-End" ) ); - return MProtocolImConversation::KInterfaceId; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::COSSProtocolImConversation() -// --------------------------------------------------------------------------- -// -COSSProtocolImConversation::COSSProtocolImConversation ( - MOSSProtocolConnectionManager& aConnMan ) - : iConnMan ( aConnMan ) - { - //LOGGER ( TXT ( "Groups::COSSProtocolImConversation() Start-End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::ConstructL() -// --------------------------------------------------------------------------- -// -void COSSProtocolImConversation::ConstructL() - { - //LOGGER ( TXT ( "COSSProtocolImConversation::ConstructL() Start" ) ); - //LOGGER ( TXT ( "COSSProtocolImConversation::ConstructL() End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::NewL() -// --------------------------------------------------------------------------- -// -COSSProtocolImConversation* COSSProtocolImConversation::NewL ( - MOSSProtocolConnectionManager& aConnMan ) - { - //LOGGER ( TXT ( "COSSProtocolImConversation::NewL() Start" ) ); - - COSSProtocolImConversation* self = - new ( ELeave ) COSSProtocolImConversation ( aConnMan ); - CleanupStack::PushL ( self ); - self->ConstructL( ); - CleanupStack::Pop ( self ); - - //LOGGER ( TXT ( "COSSProtocolImConversation::NewL() End" ) ); - return self; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::~COSSProtocolImConversation() -// --------------------------------------------------------------------------- -// -COSSProtocolImConversation::~COSSProtocolImConversation() - { - //LOGGER ( TXT ( "Groups::~COSSProtocolImConversation() Start" ) ); - - //LOGGER ( TXT ( "Groups::~COSSProtocolImConversation() End" ) ); - } - - - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::DoSendMessageL() -// --------------------------------------------------------------------------- -// -void COSSProtocolImConversation::DoSendMessageL ( - const MImConversationInfo& aImMessage, - TXIMPRequestId aReqId ) - { - _LIT(KInvaliedReciepient,"Invalied Recipient"); //String to be sent - //LOGGER ( TXT ( "Groups::DoSendMessageL() Start" ) ); - TPtrC16 message = aImMessage.TextMessage(); - const MDesCArray& recipients = aImMessage.RecipientL(); - if(message == KInvaliedReciepient) - { - iConnMan.HandleToHost().HandleRequestCompleted ( aReqId, KErrArgument ); - return; - } - - iConnMan.HandleToHost().HandleRequestCompleted ( aReqId, KErrNone ); - - - //LOGGER ( TXT ( "Groups::DoSendMessageL() End" ) ); - } - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::DoForwardMessageL() -// --------------------------------------------------------------------------- -// -void COSSProtocolImConversation::DoForwardMessageL ( - const MImConversationInfo& /*aImMessage*/, - TXIMPRequestId /*aReqId*/ ) - { - - } - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::DoSendMessageToGroupL() -// --------------------------------------------------------------------------- -// -void COSSProtocolImConversation::DoSendMessageToGroupL ( - const MImConversationInfo& /*aImMessage*/, - const TDesC* /*aGroupId*/, TXIMPRequestId /*aReqId*/ ) - { - - } - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::DoBlockUsersL() -// --------------------------------------------------------------------------- -// -TXIMPRequestId COSSProtocolImConversation::DoBlockUsersL ( - const MDesCArray* /*aUserIds*/, - TXIMPRequestId aReqId ) - { - return aReqId; - } - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::DoUnBlockUsersL() -// --------------------------------------------------------------------------- -// -TXIMPRequestId COSSProtocolImConversation::DoUnBlockUsersL ( - const MDesCArray* /*aUserIds*/, - TXIMPRequestId aReqId ) - { - return aReqId; - } - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::DoGetBlockedListRequestL() -// --------------------------------------------------------------------------- -// -void COSSProtocolImConversation::DoGetBlockedListRequestL ( - const MXIMPIdentity& /*aImMessageId*/, - TXIMPRequestId /*aReqId*/ ) - { - - } - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::DoGetMessageListL() -// --------------------------------------------------------------------------- -// -void COSSProtocolImConversation::DoGetMessageListL ( - const MXIMPIdentity& /*aImMessageId*/, - const TDesC* /*aGroupId*/, - const TInt /*aMessageCount*/, - TBool /*aDeliveryReportWanted*/, - TXIMPRequestId /*aReqId*/ ) - { - - } - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::DoRejectMessageL() -// --------------------------------------------------------------------------- -// -void COSSProtocolImConversation::DoRejectMessageL ( - const MXIMPIdentity& /*aImMessageId*/, - const TDesC& /*aMessageID*/, - TXIMPRequestId /*aReqId*/ ) - { - - } - -// --------------------------------------------------------------------------- -// COSSProtocolImConversation::CreateDataHandlerL() -// --------------------------------------------------------------------------- -// -void COSSProtocolImConversation::CreateDataHandlerL() - { - //LOGGER ( TXT ( "COSSProtocolImConversation::CreateDataHandler() Start" ) ); - - //LOGGER ( TXT ( "COSSProtocolImConversation::CreateDataHandler() End" ) ); - } - -// End of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolimfeatures.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolimfeatures.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: oss protocol plugin im features -* -*/ - -#include "cossprotocolimfeatures.h" -#include -#include -#include "cossprotocolimconversation.h" - -_LIT ( KOSSProtocolImFeatures, "COSSProtocolImFeatures" ); - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// COSSProtocolConnection::COSSProtocolImFeatures() -// --------------------------------------------------------------------------- -// -COSSProtocolImFeatures::COSSProtocolImFeatures(COSSProtocolConnectionManager& aConnMan) : iConnMan (aConnMan) - { - } - -// --------------------------------------------------------------------------- -// COSSProtocolImFeatures::ConstructL() -// --------------------------------------------------------------------------- -// -void COSSProtocolImFeatures::ConstructL ( - COSSProtocolConnectionManager& aConnMan ) - { - iImConversation = COSSProtocolImConversation::NewL ( aConnMan ); - } - -// --------------------------------------------------------------------------- -// COSSProtocolImFeatures::NewL() -// --------------------------------------------------------------------------- -// -COSSProtocolImFeatures* COSSProtocolImFeatures::NewL ( - COSSProtocolConnectionManager& aConnMan ) - { - - COSSProtocolImFeatures* self = new ( ELeave ) COSSProtocolImFeatures(aConnMan); - CleanupStack::PushL ( self ); - self->ConstructL ( aConnMan ); - CleanupStack::Pop ( self ); - - return self; - } - -// --------------------------------------------------------------------------- -// COSSProtocolImFeatures::~COSSProtocolImFeatures() -// --------------------------------------------------------------------------- -// -COSSProtocolImFeatures::~COSSProtocolImFeatures() - { - delete iImConversation; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImFeatures::GetInterface() -// --------------------------------------------------------------------------- -// -TAny* COSSProtocolImFeatures::GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) - { - if ( aInterfaceId == MProtocolImFeatures::KInterfaceId ) - { - MProtocolImFeatures* self = this; - return self; - } - - if ( aOptions == MXIMPBase::EPanicIfUnknown ) - - { - User::Panic ( KOSSProtocolImFeatures, KErrExtensionNotSupported ); - } - - return NULL; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImFeatures::GetInterface() -// --------------------------------------------------------------------------- -// -const TAny* COSSProtocolImFeatures::GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) const - { - - if ( aInterfaceId == MProtocolImFeatures::KInterfaceId ) - { - const MProtocolImFeatures* self = this; - return self; - } - - if ( aOptions == MXIMPBase::EPanicIfUnknown ) - { - User::Panic ( KOSSProtocolImFeatures, KErrExtensionNotSupported ); - } - - return NULL; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImFeatures::GetInterfaceId() const -// --------------------------------------------------------------------------- -// -TInt32 COSSProtocolImFeatures::GetInterfaceId() const - { - return MProtocolImFeatures::KInterfaceId; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolImFeatures::ImConversation() -// --------------------------------------------------------------------------- -// -MProtocolImConversation& COSSProtocolImFeatures::ImConversation() - { - return *iImConversation; - } - -MProtocolImGroup& COSSProtocolImFeatures::ImGroup() - { - MProtocolImGroup* group = NULL; - return *group; - } -// --------------------------------------------------------------------------- -// COSSProtocolImFeatures::ImInvitation() -// --------------------------------------------------------------------------- -// -MProtocolImInvitation& COSSProtocolImFeatures::ImInvitation() - { - MProtocolImInvitation* invitation = NULL; - return *invitation; - } - -// --------------------------------------------------------------------------- -// COSSProtocolImFeatures::ImSearch() -// --------------------------------------------------------------------------- -// -MProtocolImSearch& COSSProtocolImFeatures::ImSearch() - { - MProtocolImSearch* search = NULL; - return *search; - } - -void COSSProtocolImFeatures::SetHost(MProtocolImDataHost& aHost ) - { - iHost = &aHost ; - iConnMan.SetImHost(aHost) ; - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolloginrequest.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolloginrequest.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Login Request to the Network Server. -* -*/ - - -#include "COSSProtocolLoginRequest.h" -#include -#include "mossprotocolconnectionmanager.h" -#include "COSSProtocolConnection.h" -#include "cossprotocolconnectionmanager.h" -#include - -#include - -#include - -/** -* operations state enums variables -*/ - -enum LoginStates - { - EAuthFailed = 3, - ETpConnError = -6997, - // add if required - }; -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// COSSProtocolLoginRequest::COSSProtocolLoginRequest() -// --------------------------------------------------------------------------- -// -COSSProtocolLoginRequest::COSSProtocolLoginRequest ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ) : - CActive ( CActive::EPriorityStandard ), - iRequestId ( aRequestId ), - iConnMan ( aConnMan ) - { - //LOGGER ( TXT ( "COSSProtocolLoginRequest::COSSProtocolLoginRequest Start" ) ); - CActiveScheduler::Add ( this ); - //LOGGER ( TXT ( "COSSProtocolLoginRequest::COSSProtocolLoginRequest End" ) ); - } - -// COSSProtocolLoginRequest::ConstructL() -// --------------------------------------------------------------------------- -// -void COSSProtocolLoginRequest::ConstructL() - { - //LOGGER ( TXT ( "COSSProtocolLoginRequest::COSSProtocolLoginRequest Start-End" ) ); - //LOGGER ( TXT ( "COSSProtocolLoginRequest::COSSProtocolLoginRequest End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLoginRequest::NewL() -// --------------------------------------------------------------------------- -// -COSSProtocolLoginRequest* COSSProtocolLoginRequest::NewL ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ) - { - //LOGGER ( TXT ( "COSSProtocolLoginRequest::NewL Start" ) ); - - COSSProtocolLoginRequest* self = - new ( ELeave ) COSSProtocolLoginRequest ( aConnMan, aRequestId ); - CleanupStack::PushL ( self ); - self->ConstructL(); - CleanupStack::Pop ( self ); - - //LOGGER ( TXT ( "COSSProtocolLoginRequest::NewL End" ) ); - return self; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLoginRequest::NewLC() -// --------------------------------------------------------------------------- -// -COSSProtocolLoginRequest* COSSProtocolLoginRequest::NewLC ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ) - { - //LOGGER ( TXT ( "COSSProtocolLoginRequest::NewLC Start" ) ); - - COSSProtocolLoginRequest* self = - COSSProtocolLoginRequest::NewL ( aConnMan, aRequestId ); - CleanupStack::PushL ( self ); - - //LOGGER ( TXT ( "COSSProtocolLoginRequest::NewLC End" ) ); - return self; - } - -// --------------------------------------------------------------------------- -// COSSProtocolLoginRequest::~COSSProtocolLoginRequest() -// --------------------------------------------------------------------------- -// -COSSProtocolLoginRequest::~COSSProtocolLoginRequest() - { - //LOGGER ( TXT ( "::~COSSProtocolLoginRequest Start-End" ) ); - Cancel(); - //LOGGER ( TXT ( "::~COSSProtocolLoginRequest End\n" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLoginRequest::DoCancel() -// --------------------------------------------------------------------------- -// -void COSSProtocolLoginRequest::DoCancel() - { - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLoginRequest::RunL() -// --------------------------------------------------------------------------- -// -void COSSProtocolLoginRequest::RunL() - { - //LOGGER ( TXT ( "COSSProtocolLoginRequest::RunL Start" ) ); - - iConnMan.HandleToHost().HandleRequestCompleted ( iRequestId, KErrNone ); - - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLoginRequest::RunError() -// --------------------------------------------------------------------------- -// -TInt COSSProtocolLoginRequest::RunError ( TInt aError ) - { - //LOGGER ( TXT ( "COSSProtocolLoginRequest::RunError Start" ) ); - - iConnMan.HandleToHost().HandleRequestCompleted ( iRequestId, aError ); - - delete this; - //LOGGER ( TXT ( "COSSProtocolLoginRequest::RunError End" ) ); - return KErrNone; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLoginRequest::IssueLoginRequestL() -// --------------------------------------------------------------------------- -// -void COSSProtocolLoginRequest::IssueLoginRequestL() - { - //LOGGER ( TXT ( "COSSProtocolLoginRequest::IssueLoginRequestL Start" ) ); - - //LOGGER ( TXT ( "COSSProtocolConnection::OpenSessionL() End" ) ); - } -// --------------------------------------------------------------------------- -// COSSProtocolLoginRequest::GenResourceId() -// --------------------------------------------------------------------------- -// -TPtrC COSSProtocolLoginRequest::GenResourceId( const TDesC& aResourceId ) - { - - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocollogoutrequest.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocollogoutrequest.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Login Request to the Network Server. -* -*/ - - -#include "COSSProtocolLogoutRequest.h" -#include -#include "mossprotocolconnectionmanager.h" -#include "COSSProtocolConnection.h" -#include "cossprotocolconnectionmanager.h" -#include - - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// COSSProtocolLogoutRequest::COSSProtocolLogoutRequest() -// --------------------------------------------------------------------------- -// -COSSProtocolLogoutRequest::COSSProtocolLogoutRequest ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ) : - CActive ( CActive::EPriorityStandard ), - iRequestId ( aRequestId ), - iConnMan ( aConnMan ) - { - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::COSSProtocolLogoutRequest Start" ) ); - CActiveScheduler::Add ( this ); - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::COSSProtocolLogoutRequest End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLogoutRequest::ConstructL() -// --------------------------------------------------------------------------- -// -void COSSProtocolLogoutRequest::ConstructL() - { - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::COSSProtocolLogoutRequest Start-End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLogoutRequest::NewL() -// --------------------------------------------------------------------------- -// -COSSProtocolLogoutRequest* COSSProtocolLogoutRequest::NewL ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ) - { - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::NewL Start" ) ); - - COSSProtocolLogoutRequest* self = - new ( ELeave ) COSSProtocolLogoutRequest ( aConnMan, aRequestId ); - CleanupStack::PushL ( self ); - self->ConstructL(); - CleanupStack::Pop ( self ); - - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::NewL End" ) ); - return self; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLogoutRequest::NewLC() -// --------------------------------------------------------------------------- -// -COSSProtocolLogoutRequest* COSSProtocolLogoutRequest::NewLC ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ) - { - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::NewLC Start" ) ); - - COSSProtocolLogoutRequest* self = - COSSProtocolLogoutRequest::NewL ( aConnMan, aRequestId ); - CleanupStack::PushL ( self ); - - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::NewLC End" ) ); - return self; - } - -// --------------------------------------------------------------------------- -// COSSProtocolLogoutRequest::~COSSProtocolLogoutRequest() -// --------------------------------------------------------------------------- -// -COSSProtocolLogoutRequest::~COSSProtocolLogoutRequest() - { - //LOGGER ( TXT ( "::~COSSProtocolLogoutRequest Start" ) ); - Cancel(); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLogoutRequest::DoCancel() -// --------------------------------------------------------------------------- -// -void COSSProtocolLogoutRequest::DoCancel() - { - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLogoutRequest::RunL() -// --------------------------------------------------------------------------- -// -void COSSProtocolLogoutRequest::RunL() - { - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::RunL Start" ) ); - - iConnMan.HandleToHost().HandleRequestCompleted ( iRequestId, KErrNone ); - - - delete this; - - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::RunL End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLogoutRequest::RunError() -// --------------------------------------------------------------------------- -// -TInt COSSProtocolLogoutRequest::RunError ( TInt aError ) - { - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::RunError Start" ) ); - - iConnMan.HandleToHost().HandleRequestCompleted ( iRequestId, aError ); - - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::RunError - id: %d" ), aError ); - - delete this; - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::RunError End" ) ); - return KErrNone; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolLogoutRequest::IssueLogoutRequestL() -// --------------------------------------------------------------------------- -// -void COSSProtocolLogoutRequest::IssueLogoutRequestL() - { - //LOGGER ( TXT ( "COSSProtocolLogoutRequest::IssueLogoutRequestL Start" ) ); - - //LOGGER ( TXT ( "COSSProtocolConnection::IssueLogoutRequestL() End" ) ); - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolplugin.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cossprotocolplugin.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,281 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: adaptation for open source -* -*/ - -#include "cossprotocolplugin.h" - -#include "cossprotocolconnection.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// ======== MEMBER FUNCTIONS ======== - - -// --------------------------------------------------------------------------- -// Key value pair table to identify correct constructor -// function for the requested interface. -// --------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY ( 0x20007B6D, COSSProtocolPlugin::NewL ) - }; - - -// --------------------------------------------------------------------------- -// Exported function to return the implementation proxy table -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy ( TInt& aTableCount ) - { - - aTableCount = sizeof ( ImplementationTable ) / sizeof ( TImplementationProxy ); - - return ImplementationTable; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::COSSProtocolPlugin() -// --------------------------------------------------------------------------- -// -COSSProtocolPlugin::COSSProtocolPlugin() - { - - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::ConstructL() -// --------------------------------------------------------------------------- -// -void COSSProtocolPlugin::ConstructL() - { - - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::NewLC() -// --------------------------------------------------------------------------- -// -COSSProtocolPlugin* COSSProtocolPlugin::NewLC() - { - //LOGGER ( TXT ( "COSSProtocolPlugin::NewLC() Start" ) ); - - COSSProtocolPlugin* self = COSSProtocolPlugin::NewL(); - CleanupStack::PushL ( self ); - - //LOGGER ( TXT ( "COSSProtocolPlugin::NewLC() End" ) ); - return self; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::NewL() -// --------------------------------------------------------------------------- -// -COSSProtocolPlugin* COSSProtocolPlugin::NewL() - { - //LOGGER ( TXT ( "=============================START=========================================" ) ); - //LOGGER ( TXT ( "COSSProtocolPlugin::NewL() Start" ) ); - - COSSProtocolPlugin* self = new ( ELeave ) COSSProtocolPlugin(); - CleanupStack::PushL ( self ); - self->ConstructL(); - CleanupStack::Pop ( self ); - - //LOGGER ( TXT ( "COSSProtocolPlugin::NewL() End :Address of %d" ), &self ); - return self; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::~COSSProtocolPlugin() -// --------------------------------------------------------------------------- -// -COSSProtocolPlugin::~COSSProtocolPlugin() - { - //LOGGER ( TXT ( "COSSProtocolPlugin::~COSSProtocolPlugin() Start" ) ); - //delete iIsoServerLauncher; - - iConnections.ResetAndDestroy(); - - //LOGGER ( TXT ( "COSSProtocolPlugin::~COSSProtocolPlugin() End" ) ); - //LOGGER ( TXT ( "=============================END=========================================" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::PrimeHost() -// --------------------------------------------------------------------------- -// -void COSSProtocolPlugin::PrimeHost ( MXIMPProtocolPluginHost& aHost ) - { - //LOGGER ( TXT ( "COSSProtocolPlugin::PrimeHost() Start" ) ); - - iHost = &aHost; - - //LOGGER ( TXT ( "COSSProtocolPlugin::PrimeHost() End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::AcquireConnectionL() -// --------------------------------------------------------------------------- -// -MXIMPProtocolConnection& COSSProtocolPlugin::AcquireConnectionL ( - const MXIMPServiceInfo& aServiceInfo, - const MXIMPContextClientInfo& aClientCtxInfo ) - { - //LOGGER ( TXT ( "COSSProtocolPlugin::AcquireConnectionL() Start" ) ); - - TInt count = iConnections.Count(); - //COSSProtocolConnection* connection = NULL; - // count how many connections are there in plugin - // create new connection if array is empty - // create existing connection based on check if it - if ( count == 0 ) - { - COSSProtocolConnection* connection = COSSProtocolConnection::NewL ( aServiceInfo, aClientCtxInfo ); - CleanupStack::PushL ( connection ); - iConnections.AppendL ( connection ); - CleanupStack::Pop ( connection ); - // iIsoServerLauncher->LaunchProcessL(); - //LOGGER ( TXT ( "COSSProtocolPlugin::isoserver launched" ) ); - //LOGGER ( TXT ( "COSSProtocolPlugin::AcquireConnectionL() End" ) ); - return *connection; - - } - else if ( count == 1 ) - { - //LOGGER(TXT("COSSProtocolPlugin::AcquireConnectionL() End") ); - return *iConnections[0]; - } - else - { - // even if there are many connection objects, we just return - // the reference to the first connection object which is - // initiated by CCH - return *iConnections[0]; - //LOGGER(TXT("COSSProtocolPlugin::AcquireConnectionL() End") ); - } - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::ReleaseConnection() -// --------------------------------------------------------------------------- -// -void COSSProtocolPlugin::ReleaseConnection ( MXIMPProtocolConnection& aConnection ) - { - //LOGGER ( TXT ( "COSSProtocolPlugin::ReleaseConnection() Start" ) ); - - TInt connectionsCount = iConnections.Count(); - - for ( TInt i ( connectionsCount - 1 ); i >= 0; i-- ) - { - MXIMPProtocolConnection* tmp = iConnections[i]; - - if ( tmp == &aConnection ) - { - TRAP_IGNORE( iConnections[i]->ReleaseConnectionL() ); - delete iConnections[i]; - iConnections.Remove ( i ); - } - } - - //LOGGER ( TXT ( "COSSProtocolPlugin::ReleaseConnection() End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::GetInterface() -// --------------------------------------------------------------------------- -// -TAny* COSSProtocolPlugin::GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) - { - //LOGGER ( TXT ( "COSSProtocolPlugin::GetInterface() Start" ) ); - - if ( aInterfaceId == MXIMPProtocolPlugin::KInterfaceId ) - { - MXIMPProtocolPlugin* self = this; - return self; - } - - if ( aOptions == MXIMPBase::EPanicIfUnknown ) - - { - // User::Panic ( KOSSProtocolPlugin, KErrExtensionNotSupported ); - } - - //LOGGER ( TXT ( "COSSProtocolPlugin::GetInterface() End" ) ); - - return NULL; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::GetInterface() -// --------------------------------------------------------------------------- -// -const TAny* COSSProtocolPlugin::GetInterface ( TInt32 aInterfaceId, - TIfGetOps aOptions ) const - { - //LOGGER ( TXT ( "COSSProtocolPlugin::GetInterface() const Start" ) ); - - if ( aInterfaceId == MXIMPProtocolPlugin::KInterfaceId ) - { - const MXIMPProtocolPlugin* self = this; - return self; - } - - if ( aOptions == MXIMPBase::EPanicIfUnknown ) - - { - // User::Panic ( KOSSProtocolPlugin, KErrExtensionNotSupported ); - } - - //LOGGER ( TXT ( "COSSProtocolPlugin::GetInterface() const End" ) ); - - return NULL; - } - - -// --------------------------------------------------------------------------- -// COSSProtocolPlugin::GetInterfaceId() const -// --------------------------------------------------------------------------- -// -TInt32 COSSProtocolPlugin::GetInterfaceId() const - { - //LOGGER ( TXT ( "COSSProtocolPlugin::GetInterface() without parameters Start-End" ) ); - return MXIMPProtocolPlugin::KInterfaceId; - } - - -// End of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cosssendmessagerequest.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/cosssendmessagerequest.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: Send message Request to the Network Server -* -*/ - -#include "cosssendmessagerequest.h" -#include -#include "cossprotocolconnectionmanager.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -/** -* operations state enums variables -*/ - -enum ImStates - { - RecipientOffline = 1, - SenderBlocked = 3, - NotSupported = 5, - - // add if required - }; -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// COSSSendMessageRequest::COSSSendMessageRequest() -// --------------------------------------------------------------------------- -// -COSSSendMessageRequest::COSSSendMessageRequest ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ) : - - CActive ( EPriorityNormal ), - iRequestId ( aRequestId ), - iConnMan ( aConnMan ) - { - //LOGGER ( TXT ( "COSSSendMessageRequest::COSSSendMessageRequest Start" ) ); - CActiveScheduler::Add ( this ); - - //LOGGER ( TXT ( "COSSSendMessageRequest::COSSSendMessageRequest End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSSendMessageRequest::ConstructL() -// --------------------------------------------------------------------------- -// -void COSSSendMessageRequest::ConstructL() - { - //LOGGER ( TXT ( "COSSSendMessageRequest::ConstructL Start-End" ) ); - - - } - - -// --------------------------------------------------------------------------- -// COSSSendMessageRequest::NewL() -// --------------------------------------------------------------------------- -// -COSSSendMessageRequest* COSSSendMessageRequest::NewL ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ) - { - //LOGGER ( TXT ( "COSSSendMessageRequest::NewL Start" ) ); - - COSSSendMessageRequest* self = new ( ELeave ) - COSSSendMessageRequest ( aConnMan, aRequestId ); - CleanupStack::PushL ( self ); - self->ConstructL(); - CleanupStack::Pop ( self ); - - //LOGGER ( TXT ( "COSSSendMessageRequest::NewL End" ) ); - return self; - } - - -// --------------------------------------------------------------------------- -// COSSSendMessageRequest::NewLC() -// --------------------------------------------------------------------------- -// -COSSSendMessageRequest* COSSSendMessageRequest::NewLC ( - MOSSProtocolConnectionManager& aConnMan, - TXIMPRequestId aRequestId ) - { - //LOGGER ( TXT ( "COSSSendMessageRequest::NewLC Start" ) ); - - COSSSendMessageRequest* self = - COSSSendMessageRequest::NewL ( aConnMan, aRequestId ); - CleanupStack::PushL ( self ); - - //LOGGER ( TXT ( "COSSSendMessageRequest::NewLC End" ) ); - return self; - } - -// --------------------------------------------------------------------------- -// COSSSendMessageRequest::~COSSSendMessageRequest() -// --------------------------------------------------------------------------- -// -COSSSendMessageRequest::~COSSSendMessageRequest() - { - //LOGGER ( TXT ( "COSSSendMessageRequest::~COSSSendMessageRequest Start" ) ); - //LOGGER ( TXT ( "COSSSendMessageRequest::~COSSSendMessageRequest End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSSendMessageRequest::DoCancel() -// --------------------------------------------------------------------------- -// -void COSSSendMessageRequest::DoCancel() - { - } - - -// --------------------------------------------------------------------------- -// COSSSendMessageRequest::RunL() -// --------------------------------------------------------------------------- -// -void COSSSendMessageRequest::RunL() - { - - iConnMan.HandleToHost().HandleRequestCompleted ( iRequestId, KErrNone ); - - //LOGGER ( TXT ( "COSSSendMessageRequest::RunL End" ) ); - } - - -// --------------------------------------------------------------------------- -// COSSSendMessageRequest::RunError() -// --------------------------------------------------------------------------- -// -TInt COSSSendMessageRequest::RunError ( TInt aError ) - { - //LOGGER ( TXT ( "COSSSendMessageRequest::RunError Start" ) ); - - iConnMan.HandleToHost().HandleRequestCompleted ( iRequestId, aError ); - - delete this; - //LOGGER ( TXT ( "COSSSendMessageRequest::RunError End" ) ); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// COSSSendMessageRequest::SendMessageL() -// --------------------------------------------------------------------------- -// -void COSSSendMessageRequest::SendMessageL ( const MImConversationInfo& aImMessage ) - { - //LOGGER ( TXT ( "COSSSendMessageRequest::SendMessageL Start" ) ); - SetActive(); - - User::RequestComplete( iStatus, KErrNone); - - //LOGGER ( TXT ( "COSSSendMessageRequest::SendMessageL End" ) ); - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/creceivemessagehandler.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/dummytestadaptation/src/creceivemessagehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,197 +0,0 @@ -/* -* Copyright (c) 2007-2008 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: implementation of receive message handler -* -*/ - - -#include -#include "creceivemessagehandler.h" -#include "mossprotocolconnectionmanager.h" - -#include "cossprotocolconnectionmanager.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CReceiveMessageHandler::CReceiveMessageHandler -// --------------------------------------------------------------------------- -// -CReceiveMessageHandler::CReceiveMessageHandler ( - MOSSProtocolConnectionManager& aConnMan ) : - - CActive ( EPriorityNormal ), - iConnMan ( aConnMan ) - { - //LOGGER ( TXT ( "::CReceiveMessageHandler Start" ) ); - CActiveScheduler::Add ( this ); - - //LOGGER ( TXT ( "::CReceiveMessageHandler End" ) ); - } - - -// --------------------------------------------------------------------------- -// CReceiveMessageHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CReceiveMessageHandler::ConstructL() - { - //LOGGER ( TXT ( "CReceiveMessageHandler::ConstructL Start-End" ) ); - - - } - - -// --------------------------------------------------------------------------- -// CReceiveMessageHandler::NewL -// --------------------------------------------------------------------------- -// -CReceiveMessageHandler* CReceiveMessageHandler::NewL ( - MOSSProtocolConnectionManager& aConnMan ) - { - //LOGGER ( TXT ( "CReceiveMessageHandler::NewL Start" ) ); - - CReceiveMessageHandler* self = new ( ELeave ) - CReceiveMessageHandler ( aConnMan ); - CleanupStack::PushL ( self ); - self->ConstructL(); - CleanupStack::Pop ( self ); - - //LOGGER ( TXT ( "CReceiveMessageHandler::NewL End" ) ); - return self; - } - - - -// --------------------------------------------------------------------------- -// CReceiveMessageHandler::~CReceiveMessageHandler -// --------------------------------------------------------------------------- -// -CReceiveMessageHandler::~CReceiveMessageHandler() - { - //LOGGER ( TXT ( "::~CReceiveMessageHandler Start" ) ); - - Cancel(); - - //LOGGER ( TXT ( "::~CReceiveMessageHandler End" ) ); - } - - -// --------------------------------------------------------------------------- -// CReceiveMessageHandler::DoCancel() -// --------------------------------------------------------------------------- -// -void CReceiveMessageHandler::DoCancel() - { - //LOGGER ( TXT ( "CReceiveMessageHandler::DoCancel Start" ) ); - -// iConnMan.DataHandler().CancelListeningMsg(); - - //LOGGER ( TXT ( "CReceiveMessageHandler::DoCancel End" ) ); - } - -// --------------------------------------------------------------------------- -// CReceiveMessageHandler::RunL() -// --------------------------------------------------------------------------- -// -void CReceiveMessageHandler::RunL() - { - //LOGGER ( TXT ( "CReceiveMessageHandler::RunL Start" ) ); - - // something is coming from the xmpp server - User::LeaveIfError ( iStatus.Int() ); - - TRAPD( error, ProcessIncomingDataL() ); - if ( error != KErrNone ) - { - Cancel(); - } - - // start listening again for next incoming message - StartListeningL(); - - //LOGGER ( TXT ( "CReceiveMessageHandler::RunL End" ) ); - } - -// --------------------------------------------------------------------------- -// CReceiveMessageHandler::ProcessIncomingDataL() -// --------------------------------------------------------------------------- -// -void CReceiveMessageHandler::ProcessIncomingDataL() - { - //LOGGER ( TXT ( "CReceiveMessageHandler::ProcessIncomingDataL Start" ) ); - //LOGGER ( TXT ( "CReceiveMessageHandler::ProcessIncomingDataL End" ) ); - } - - -// --------------------------------------------------------------------------- -// CReceiveMessageHandler::RunError -// --------------------------------------------------------------------------- -// -TInt CReceiveMessageHandler::RunError ( TInt aError ) - { - //LOGGER ( TXT ( "CReceiveMessageHandler::RunError Start %d" ), aError ); - - //LOGGER ( TXT ( "CReceiveMessageHandler::RunError End" ) ); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CReceiveMessageHandler::StartListeningL -// --------------------------------------------------------------------------- -// -void CReceiveMessageHandler::StartListeningL() - { - //LOGGER ( TXT ( "CReceiveMessageHandler::StartListeningL Start" ) ); - - // Ready to receive notification from the server - - // signal the scheduler - - - //LOGGER ( TXT ( "CReceiveMessageHandler::StartListeningL End" ) ); - } - - - -// End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/eabi/imcvuiengine_testu.def --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/eabi/imcvuiengine_testu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - _ZN11CIMCVEngine10CCHHandlerEv @ 2 NONAME - _ZN11CIMCVEngine10GetBrandIdEv @ 3 NONAME - _ZN11CIMCVEngine11ServiceNameEv @ 4 NONAME - _ZN11CIMCVEngine12GetServiceIdEv @ 5 NONAME - _ZN11CIMCVEngine13GetLanguageIdEv @ 6 NONAME - _ZN11CIMCVEngine16GetPresenceIconLERK6TDesC8 @ 7 NONAME - _ZN11CIMCVEngine16ReadyForShutdownEv @ 8 NONAME - _ZN11CIMCVEngine17GetLoggedInUserIdEv @ 9 NONAME - _ZN11CIMCVEngine18GetSmileyIconArrayEv @ 10 NONAME - _ZN11CIMCVEngine18ReleaseConnectionLEv @ 11 NONAME - _ZN11CIMCVEngine19GetSmileStringArrayEv @ 12 NONAME - _ZN11CIMCVEngine20ResolveServiceStateLEv @ 13 NONAME - _ZN11CIMCVEngine6LoginLEv @ 14 NONAME - _ZN11CIMCVEngine9OpenChatsEv @ 15 NONAME - _ZN18CIMCVEngineFactory7ReleaseEv @ 16 NONAME - _ZN18CIMCVEngineFactory9InstanceLEv @ 17 NONAME - _ZNK11CIMCVEngine10IsLoggedInEv @ 18 NONAME - _ZNK11CIMCVEngine13ChatInterfaceEv @ 19 NONAME - _ZNK11CIMCVEngine14MessageHandlerEv @ 20 NONAME - _ZTI11CIMCVEngine @ 21 NONAME - _ZTI12MyCchService @ 22 NONAME - _ZTI18CIMCVEngineFactory @ 23 NONAME - _ZTI20CIMCVEngineOpenChats @ 24 NONAME - _ZTI22CIMCVEngineMessageBase @ 25 NONAME - _ZTI22CIMCVEngineTextMessage @ 26 NONAME - _ZTI24CIMCVEngineChatContainer @ 27 NONAME - _ZTI25CIMCVEngineMessageCreator @ 28 NONAME - _ZTI25CIMCVEngineMessageHandler @ 29 NONAME - _ZTI26CIMCVEngineContextObserver @ 30 NONAME - _ZTI26CIMCVEngineStorageListener @ 31 NONAME - _ZTI27CIMCVEngineMessageContainer @ 32 NONAME - _ZTI4CCch @ 33 NONAME - _ZTV11CIMCVEngine @ 34 NONAME - _ZTV12MyCchService @ 35 NONAME - _ZTV18CIMCVEngineFactory @ 36 NONAME - _ZTV20CIMCVEngineOpenChats @ 37 NONAME - _ZTV22CIMCVEngineMessageBase @ 38 NONAME - _ZTV22CIMCVEngineTextMessage @ 39 NONAME - _ZTV24CIMCVEngineChatContainer @ 40 NONAME - _ZTV25CIMCVEngineMessageCreator @ 41 NONAME - _ZTV25CIMCVEngineMessageHandler @ 42 NONAME - _ZTV26CIMCVEngineContextObserver @ 43 NONAME - _ZTV26CIMCVEngineStorageListener @ 44 NONAME - _ZTV27CIMCVEngineMessageContainer @ 45 NONAME - _ZTV4CCch @ 46 NONAME - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/group/bld.inf --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: bld.inf -* -*/ - - - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these -DEFAULT - -PRJ_TESTEXPORTS -../init/TestFramework.ini /epoc32/winscw/c/TestFramework/TestFramework.ini -../conf/imcvuiengine_test.cfg /epoc32/winscw/c/TestFramework/imcvuiengine_test.cfg -PRJ_EXPORTS - - -PRJ_TESTMMPFILES -../dummytestadaptation/group/dummytestadaptation.mmp - -imcvuiengine_test.mmp - -PRJ_MMPFILES - - - -// End of File \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/group/imcvuiengine_test.mmp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/group/imcvuiengine_test.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imcvuiengine_test.mmp -* -*/ - -#include -#include - -TARGET imcvuiengine_test.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -CAPABILITY ALL -TCB -EPOCALLOWDLLDATA - -//TARGETPATH ?target_path -DEFFILE imcvuiengine_test.def - -SOURCEPATH ../src -SOURCE imcvuiengine_test.cpp -SOURCE imcvuiengine_testBlocks.cpp -SOURCE imcvuiengine_testsendmessage.cpp -SOURCE s_cch.cpp -SOURCE s_spsettings.cpp -SOURCE s_spproperty.cpp -SOURCE s_spentry.cpp - -SOURCEPATH ../../../imcvuiengine/src -SOURCE cimcvenginefactory.cpp -SOURCE cimcvengineopenchats.cpp -SOURCE cimcvengine.cpp -SOURCE cimcvenginechatcontainer.cpp -SOURCE cimcvenginecontextobserver.cpp -SOURCE cimcvenginemessagebase.cpp -SOURCE cimcvenginemessagecontainer.cpp -SOURCE cimcvenginemessagecreator.cpp -SOURCE cimcvenginemessagehandler.cpp -SOURCE cimcvenginetextmessage.cpp -SOURCE imcvenginemessageutils.cpp -SOURCE cimcvenginecchhandler.cpp -SOURCE cimcvenginestoragelistener.cpp - - - -USERINCLUDE ../../../inc -USERINCLUDE ../inc -USERINCLUDE ../../../imcvuiengine/inc -USERINCLUDE ../../../../../group - -APP_LAYER_SYSTEMINCLUDE -LIBRARY commonengine.lib // StringLoader -LIBRARY bafl.lib // Desc arrays -LIBRARY cone.lib // Coe env -LIBRARY euser.lib // Common usage. -LIBRARY estor.lib // For stream usage -LIBRARY charconv.lib // unicode -> utf8 -LIBRARY imageconversion.lib // Image decoding and encoding -LIBRARY fbscli.lib // CFBsBitmap -LIBRARY EFSRV.LIB // fileserver -LIBRARY BitmapTransforms.lib// Image scaling. -LIBRARY inetprotutil.lib // for escapeutils used in CAUtils.cpp -LIBRARY hal.lib // HAL -LIBRARY ecom.lib -LIBRARY flogger.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib -//LIBRARY cch.lib -// new presence cache libraries -LIBRARY presencecacheclient2.lib -LIBRARY presencecacheutils.lib - -// imcachelibray -LIBRARY imcacheclient.lib -LIBRARY bsclient.lib -LIBRARY egul.lib -LIBRARY apgrfx.lib // aptasklist -LIBRARY ws32.lib -// cch settings -LIBRARY serviceprovidersettings.lib -LANG SC - - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/group/imcvuiengine_test.pkg --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/group/imcvuiengine_test.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -; -; 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: imcvuiengine_test.pkg -; -;Header -#{"Testcv"}, (0x101FB3E3), 1, 2, 3, TYPE=SA - -;Language - standard language definitions -&EN - -;Vendor ID -:"Nokia Corporation" - -;Localised vendor -%{"Vendor-EN"} - -;Supports Series 60 v 0.9 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - -;rom will not allow to update it ,if name is testframework, after install need to rename it to testframework.ini -;INI FILE -"..\init\testframework.ini" -"c:\Testframework\ttestframework.ini" - -;CFG FILES - "..\conf\imcvuiengine_test.cfg" -"c:\Testframework\imcvuiengine_test.cfg" - -;imcvuiengine_test dll files - - "\epoc32\release\armv5\urel\imcvuiengine_test.dll" - "!:\Sys\Bin\imcvuiengine_test.dll" - - "\epoc32\RELEASE\ARMV5\UREL\dummytestadaptation.dll" -"!:\sys\bin\dummytestadaptation.dll" - - "\epoc32\DATA\Z\Resource\Plugins\dummytestadaptation.rsc" -"!:\Resource\Plugins\dummytestadaptation.rsc" - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/inc/imcvuiengine_test.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/inc/imcvuiengine_test.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,416 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imcvuiengine_test.h -* -*/ - - - -#ifndef IMCVUIENGINE_TEST_H -#define IMCVUIENGINE_TEST_H - -// INCLUDES -#include -#include -#include - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def -// Logging path -_LIT( Kimcvuiengine_testLogPath, "\\logs\\testframework\\imcvuiengine_test\\" ); -// Log file -_LIT( Kimcvuiengine_testLogFile, "imcvuiengine_test.txt" ); -_LIT( Kimcvuiengine_testLogFileWithTitle, "imcvuiengine_test_[%S].txt" ); - -// FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; -class Cimcvuiengine_test; -class CIMCVUiEngine_TestSendMessage; - -// DATA TYPES -//enum ?declaration -//typedef ?declaration -//extern ?data_type; - -// CLASS DECLARATION - -/** -* Cimcvuiengine_test test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS(Cimcvuiengine_test) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static Cimcvuiengine_test* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~Cimcvuiengine_test(); - - public: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - - private: - - /** - * C++ default constructor. - */ - Cimcvuiengine_test( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - /** - * Test methods are listed below. - */ - - - /** - * StartNewConvesationL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt StartNewConvesationL( CStifItemParser& aItem ); - - /** - * CloseConvesationL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt CloseConvesationL( CStifItemParser& aItem ); - - - /** - * SendNullMessageL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt SendNullMessageL( CStifItemParser& aItem ); - - /** - * SendTextMessageL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt SendTextMessageL( CStifItemParser& aItem ); - - /** - * SendSplCharMessageL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt SendSplCharMessageL( CStifItemParser& aItem ); - - /** - * SendCosMessageL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt SendCosMessageL( CStifItemParser& aItem ); - - /** - * DeactivateConvesationL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt DeactivateConvesationL( CStifItemParser& aItem ); - - - /** - * TestRecievedMessageL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestMultipleSendMessageL( CStifItemParser& aItem ); - - /** - * TestSendRecieveMsgL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestSendRecieveMsgL( CStifItemParser& aItem ); - - /** - * TestSendFetchSendMsgL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestSendFetchSendMsgL( CStifItemParser& aItem ); - - - /** - * TestFailedMsgL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestFailedMsgL( CStifItemParser& aItem ); - - - /** - * TestConnectionTerminationL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestConnectionTerminationL( CStifItemParser& aItem ); - - /** - * TestLoginStateL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestLoginStateL( CStifItemParser& aItem ); - - /** - * TestLoginUserIdL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestLoginUserIdL( CStifItemParser& aItem ); - /** - * TestLoginUserIdL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestGetBrandIdL( CStifItemParser& aItem ); - /** - * TestLoginUserIdL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestGetLanguageIdL( CStifItemParser& aItem ); - - /** - * TestChatInterfaceL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestChatInterfaceL( CStifItemParser& aItem ); - - - /** - * TestMessageCoundL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestMessageCoundL( CStifItemParser& aItem ); - - /** - * TestMessageUnreadCoundL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestMessageUnreadCoundL( CStifItemParser& aItem ); - - - /** - * TestDeleteContextL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestDeleteContextL( CStifItemParser& aItem ); - - /** - * TestCreateContextL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestCreateContextL( CStifItemParser& aItem ); - - - - /** - * TestSubscribePresenceL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestSubscribePresenceL( CStifItemParser& aItem ); - - - /** - * TestAppendInfoMessageL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestAppendInfoMessageL( CStifItemParser& aItem ); - - /** - * TestGetPresenceStatusL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestGetPresenceStatusL( CStifItemParser& aItem ); - - - /** - * TestCCHHandlerL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt TestCCHHandlerL( CStifItemParser& aItem ); - - - /** - * TestCCHHandlerL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt ReadyForShutdownTestL( CStifItemParser& aItem ); - - - /** - * TestCCHHandlerL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt ServiceNameTestL( CStifItemParser& aItem ); - - - /** - * TestCCHHandlerL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt OpenChatsTestL( CStifItemParser& aItem ); - - - /** - * TestCCHHandlerL test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt GetServiceIdTestL( CStifItemParser& aItem ); - - virtual TInt TestClosAllContainerL( CStifItemParser& aItem ); - - virtual TInt TestDeleteChatL( CStifItemParser& aItem ); - - virtual TInt TestEditorMessageL( CStifItemParser& aItem ); - virtual TInt TestConvertPresCacheEnum( CStifItemParser& aItem ); - - //ADD NEW METHOD DEC HERE - //[TestMethods] - Do not remove - - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; - CIMCVUiEngine_TestSendMessage* iSender; - protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - private: // Data - - - public: // Friend classes - //?friend_class_declaration; - protected: // Friend classes - //?friend_class_declaration; - private: // Friend classes - //?friend_class_declaration; - - }; - -#endif // IMCVUIENGINE_TEST_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/inc/imcvuiengine_testsendmessage.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/inc/imcvuiengine_testsendmessage.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imcvuiengine_test test module. -* -*/ - - -#ifndef _IMCVENGINESENDMESSAGE_H_ -#define _IMCVENGINESENDMESSAGE_H_ - -// INCLUDE FILES -#include -#include -#include "cimcvengine.h" -#include "mimcvenginemessagehandlerobserver.h" - -class MIMCVEngineFactory; - -class CSPSettings; - -NONSHARABLE_CLASS(CIMCVUiEngine_TestSendMessage) : public CBase, - public MIMCVEngineMessageHandlerObserver - - { - public: // Constructors and destructor - - - /** - * Two-phased constructor. - */ - static CIMCVUiEngine_TestSendMessage* NewL(); - - /** - * Destructor. - */ - virtual ~CIMCVUiEngine_TestSendMessage(); - - void CreateConnectionL(); - - void ReleaseConnectionL(); - - public: // MImCommandObserver - - - /** - * StartNewConvesationL test method. - * @return Symbian OS error code. - */ - TInt StartNewConvesationL(); - - /** - * CloseConvesationL test method. - * @return Symbian OS error code. - */ - TInt CloseConvesationL(); - - - /** - * SendNullMessageL test method. - * @return Symbian OS error code. - */ - TInt SendNullMessageL(); - - /** - * SendTextMessageL test method. - * @return Symbian OS error code. - */ - TInt SendTextMessageL(); - - /** - * SendSplCharMessageL test method. - * @return Symbian OS error code. - */ - TInt SendSplCharMessageL(); - - /** - * SendCosMessageL test method. - * @return Symbian OS error code. - */ - TInt SendCosMessageL(); - - /** - * DeactivateConvesationL test method. - * @return Symbian OS error code. - */ - TInt DeactivateConvesationL(); - - /** - * SendToInvaliedRecipientL test method. - * @return Symbian OS error code. - */ - TInt SendToInvaliedRecipientL(); - - /** - * TestRecievedMessageL test method. - * @return Symbian OS error code. - */ - TInt TestMultipleSendMessageL( ); - - /** - * TestSplCharRecieveMsgL test method. - * @return Symbian OS error code. - */ - TInt TestSendRecieveMsgL(); - - /** - * TestCosRecieveMsgL test method. - */ - TInt TestSendFetchSendMsgL(); - - TInt TestConnectionTerminationL(); - - TInt TestLoginStateL(); - - TInt TestLoginUserIdL(); - - TInt TestGetLanguageIdL(); - - TInt TestGetBrandIdL(); - - TInt TestChatInterfaceL(); - - TInt GetResult() const ; - - TInt TestMessageCoundL(); - - TInt TestMessageUnreadCoundL(); - - TInt TestSubscribePresenceL(); - - TInt TestGetPresenceStatusL(); - - TInt TestAppendInfoMessageL(); - - - TInt DeleteContextL(); - - TInt CreateContextL(); - - TInt TestCCHHandlerL(); - - - TInt ReadyForShutdownTestL(); - TInt ServiceNameTestL(); - TInt OpenChatsTestL(); - TInt GetServiceIdTestL(); - - TInt TestClosAllContainerL(); - TInt TestDeleteChatL(); - TInt TestEditorMessageL(); - - TInt TestConvertPresCacheEnum(); - - - public : - - /** - * @see handle the presence change notification - * to handle the connection lost - */ - void HandlePresenceChangedL(TInt aServiceId, const TDesC& aBuddyId ) ; - - /** - * Handle message send operation completion. - * @param aResult result to handle. - */ - void HandleOperationCompletdL(TInt aserviceId, MIMCVEngineMessage::TMessagerType aType , TInt aResult) ; - - /** - * @see HandleConnectionTerminatedL - * to handle the connection lost - * @param aReason, reason report - */ - void HandleConnectionEventL(TInt aServiceId, TIMCVConnectionState aState, TInt aReason ) ; - - - private: - - /** - * C++ default constructor. - */ - CIMCVUiEngine_TestSendMessage(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - /** - * read the service id - */ - void ReadServiceDetalsL(); - - - private: - - //OWN: Active scheduler wait for waiting the completion - MIMCVEngineFactory* iEngineFactory; - - //not owns - CIMCVEngine* iEngine ; - - CActiveSchedulerWait iWait; - - TInt iResult; - - TInt iServiceId; - - //owns : reference to setting - CSPSettings* iSettings; - }; - -#endif // _IMCVENGINESENDMESSAGE_H_ - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/inc/s_cch.h --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/inc/s_cch.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ -/* -* 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: s_cch.h -* -*/ - -#ifndef MyCchServiceH -#define MyCchServiceH - -// EXTERNAL INCLUDES -#include -#define KMECOIMPLEMENTATIONUID 0x20012423 -const TInt KTestServiceId = 255; - -_LIT( KTestServiceName, "TEST_SERVICE" ); -_LIT(KTestUserName, "testlm123@gmail.com"); -_LIT(KOwnUserNameMatch,"gizmo:Sharath"); // dont change this value -_LIT(KTestPassword, "password"); -_LIT(KTestDescription, "error"); - -TInt CreateSpEntryL( TInt aServiceId ); -class MyCchService : public CCchService - { - TInt Enable( TCCHSubserviceType aType ); - - /** - * Launches service disable. See MCchServiceObserver for status changes. - * - * @param aType Type of service - * @return Symbian error - */ - TInt Disable( TCCHSubserviceType aType ); - - /** - * Returns the current service state - * - * @param aType Type of service - * @param aStatus Status of the service, return value - * @return Symbian error code - */ - TInt GetStatus( TCCHSubserviceType aType, - TCchServiceStatus& aStatus ) const ; - - /** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt GetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, TInt& aValue ) const; - - /** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt GetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, RBuf& aValue ) const; - - /** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt SetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, TInt aValue ); - - /** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt SetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, const TDesC& aValue ); - - /** - * Reserves the service for exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt Reserve( TCCHSubserviceType aType ); - - /** - * Frees the service of exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt Free( TCCHSubserviceType aType ); - - /** - * Is the service reserved - * - * @param aType Type of service - * @param aReserved True if the service is reserved - * @return Symbian error code - */ - TInt IsReserved( TCCHSubserviceType aType, TBool& aReserved ) const; - - /** - * Returns the service id - * - * @return The id of the service - */ - TInt ServiceId() const; - - /** - * @deprecated Do not use this anymore, change to AddObserver! - * - * Adds observer for listening service events - * - * @param aObserver Event observing class - */ - void SetObserver( MCchServiceStatusObserver& aObserver ); - - /** - * @deprecated Do not use this anymore, change to - * RemoveObserver method with paramater - * - * Removes the observer of service events - */ - void RemoveObserver( ); - - /** - * Adds observer for listening service events - * - * @param aObserver Event observing class - * @return KErrAlreadyExist Observer already added - * KErrNone Observer was added - */ - TInt AddObserver( MCchServiceStatusObserver& aObserver ); - - /** - * Removes the observer of service events - * - * @param aObserver Event observing class - * @return KErrNotFound Observer was not found - * KErrNone Observer was removed - */ - TInt RemoveObserver( MCchServiceStatusObserver& aObserver ); - - /** - * Checks if the type is supported - * - * @param aType Type of service - * @param aSupported True if the service type is supported - * @return Symbian error code - */ - TInt IsSupported( TCCHSubserviceType aType, TBool& aSupported ) const; - - private: - MCchServiceStatusObserver* iObserver; - - }; - - -#endif //MyCchService - - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/init/TestFramework.ini --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/init/TestFramework.ini Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -# -# This is STIFTestFramework initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', - 'TestCases' or 'FullReport' - -CreateTestReport= YES # Possible values: YES or NO - -TestReportFilePath= C:\LOGS\TestFramework\ -TestReportFileName= TestReport - -TestReportFormat= TXT # Possible values: TXT or HTML -TestReportOutput= FILE # Possible values: FILE or RDEBUG -TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting - -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start - -[New_Module] -ModuleName= testscripter -TestCaseFile= C:\testframework\imcvuiengine_test.cfg -[End_Module] - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -[Logger_Defaults] - -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/src/imcvuiengine_test.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/src/imcvuiengine_test.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imcvuiengine_test.cpp -* -*/ - - - -// INCLUDE FILES -#include -#include "imcvuiengine_test.h" -#include -#include "imcvuiengine_testsendmessage.h" -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::Cimcvuiengine_test -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -Cimcvuiengine_test::Cimcvuiengine_test( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void Cimcvuiengine_test::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); - TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(Kimcvuiengine_testLogFileWithTitle, &title); - } - else - { - logFileName.Copy(Kimcvuiengine_testLogFile); - } - - iLog = CStifLogger::NewL( Kimcvuiengine_testLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - iSender = CIMCVUiEngine_TestSendMessage::NewL(); - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -Cimcvuiengine_test* Cimcvuiengine_test::NewL( - CTestModuleIf& aTestModuleIf ) - { - Cimcvuiengine_test* self = new (ELeave) Cimcvuiengine_test( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -Cimcvuiengine_test::~Cimcvuiengine_test() - { - delete iSender; - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) Cimcvuiengine_test::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/src/imcvuiengine_testBlocks.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/src/imcvuiengine_testBlocks.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,607 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imcvuiengine_testBlocks.cpp -* -*/ - - - -// [INCLUDE FILES] - do not remove -#include -#include -#include -#include "imcvuiengine_test.h" -#include "imcvuiengine_testsendmessage.h" -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void Cimcvuiengine_test::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - ENTRY( "StartNewConvesationL", Cimcvuiengine_test::StartNewConvesationL ), - ENTRY( "CloseConvesationL", Cimcvuiengine_test::CloseConvesationL ), - ENTRY( "SendNullMessageL", Cimcvuiengine_test::SendNullMessageL ), - ENTRY( "SendTextMessageL", Cimcvuiengine_test::SendTextMessageL ), - ENTRY( "SendSplCharMessageL", Cimcvuiengine_test::SendSplCharMessageL ), - ENTRY( "SendCosMessageL", Cimcvuiengine_test::SendCosMessageL ), - ENTRY( "DeactivateConvesationL", Cimcvuiengine_test::DeactivateConvesationL ), - ENTRY( "TestMultipleSendMessageL", Cimcvuiengine_test::TestMultipleSendMessageL ), - ENTRY( "TestSendRecieveMsgL", Cimcvuiengine_test::TestSendRecieveMsgL ), - ENTRY( "TestSendFetchSendMsgL", Cimcvuiengine_test::TestSendFetchSendMsgL ), - // newly added test cases - ENTRY( "TestFailedMsgL", Cimcvuiengine_test::TestFailedMsgL ), - ENTRY( "TestConnectionTerminationL", Cimcvuiengine_test::TestConnectionTerminationL ), - ENTRY( "TestLoginStateL", Cimcvuiengine_test::TestLoginStateL ), - ENTRY( "TestLoginUserIdL", Cimcvuiengine_test::TestLoginUserIdL ), - ENTRY( "TestChatInterfaceL", Cimcvuiengine_test::TestChatInterfaceL ), - - ENTRY( "TestMessageCoundL", Cimcvuiengine_test::TestMessageCoundL ), - ENTRY( "TestMessageUnreadCoundL", Cimcvuiengine_test::TestMessageUnreadCoundL ), - - ENTRY( "TestDeleteContextL", Cimcvuiengine_test::TestDeleteContextL ), - ENTRY( "TestCreateContextL", Cimcvuiengine_test::TestCreateContextL ), - - ENTRY( "TestSubscribePresenceL", Cimcvuiengine_test::TestSubscribePresenceL ), - ENTRY( "TestAppendInfoMessageL", Cimcvuiengine_test::TestAppendInfoMessageL ), - ENTRY( "TestGetPresenceStatusL", Cimcvuiengine_test::TestGetPresenceStatusL ), - ENTRY( "TestGetBrandIdL", Cimcvuiengine_test::TestGetBrandIdL ), - ENTRY( "TestGetLanguageIdL", Cimcvuiengine_test::TestGetLanguageIdL ), - - // ======================================================================= - ENTRY( "TestCCHHandlerL", Cimcvuiengine_test::TestCCHHandlerL ), - ENTRY( "ReadyForShutdownTestL", Cimcvuiengine_test::ReadyForShutdownTestL ), - ENTRY( "ServiceNameTestL", Cimcvuiengine_test::ServiceNameTestL ), - ENTRY( "OpenChatsTestL", Cimcvuiengine_test::OpenChatsTestL ), - ENTRY( "GetServiceIdTestL", Cimcvuiengine_test::GetServiceIdTestL ), - ENTRY( "TestClosAllContainerL", Cimcvuiengine_test::TestClosAllContainerL ), - ENTRY( "TestDeleteChatL", Cimcvuiengine_test::TestDeleteChatL ), - ENTRY( "TestEditorMessageL", Cimcvuiengine_test::TestEditorMessageL ), - ENTRY( "TestConvertPresCacheEnum", Cimcvuiengine_test::TestConvertPresCacheEnum ), - - //ADD NEW ENTRY HERE - // [test cases entries] - Do not remove - - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::StartNewConvesationL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::StartNewConvesationL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->StartNewConvesationL(); - iSender->ReleaseConnectionL(); - return err; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::CloseConvesationL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::CloseConvesationL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->CloseConvesationL(); - iSender->ReleaseConnectionL(); - return err ; - } - - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::SendTextMessageL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::SendTextMessageL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->SendTextMessageL(); - iSender->ReleaseConnectionL(); - return err; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::SendNullMessageL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::SendNullMessageL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->SendNullMessageL(); - iSender->ReleaseConnectionL(); - return err ; - } - - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::SendSplCharMessageL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::SendSplCharMessageL( CStifItemParser& /*aItem*/ ) - { - - iSender->CreateConnectionL(); - TInt err = iSender->SendSplCharMessageL(); - iSender->ReleaseConnectionL(); - return err; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::SendCosMessageL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::SendCosMessageL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->SendCosMessageL(); - iSender->ReleaseConnectionL(); - return err ; - } - - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::DeactivateConvesationL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::DeactivateConvesationL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->DeactivateConvesationL(); - iSender->ReleaseConnectionL(); - return err; - } - - - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestMultipleSendMessageL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestMultipleSendMessageL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestMultipleSendMessageL(); - iSender->ReleaseConnectionL(); - return err; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestSendRecieveMsgL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestSendRecieveMsgL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestSendRecieveMsgL(); - iSender->ReleaseConnectionL(); - return err ; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestSendFetchSendMsgL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestSendFetchSendMsgL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestSendFetchSendMsgL(); - iSender->ReleaseConnectionL(); - return err ; - } - - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestFailedMsgL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestFailedMsgL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->SendToInvaliedRecipientL(); - iSender->ReleaseConnectionL(); - return err ; - } - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestConnectionTerminationL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestConnectionTerminationL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestConnectionTerminationL(); - iSender->ReleaseConnectionL(); - return err ; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestLoginStateL -// Example test method function.TestLoginStateL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestLoginStateL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestLoginStateL(); - iSender->ReleaseConnectionL(); - return err ; - } - - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestLoginUserIdL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestLoginUserIdL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestLoginUserIdL(); - iSender->ReleaseConnectionL(); - return err ; - } -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestGetBrandIdL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestGetBrandIdL( CStifItemParser& /*aItem*/ ) - { - - TInt err = iSender->TestGetBrandIdL(); - return err ; - } -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestGetLanguageIdL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestGetLanguageIdL( CStifItemParser& /*aItem*/ ) - { - TInt err = iSender->TestGetLanguageIdL(); - return err ; - } - - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestChatInterfaceL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestChatInterfaceL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestChatInterfaceL(); - iSender->ReleaseConnectionL(); - return err ; - } - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestLoginUserIdL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestMessageCoundL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestMessageCoundL(); - iSender->ReleaseConnectionL(); - return err ; - } - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestChatInterfaceL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestMessageUnreadCoundL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestMessageUnreadCoundL(); - iSender->ReleaseConnectionL(); - return err ; - } - - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestDeleteContextL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestDeleteContextL( CStifItemParser& /*aItem*/ ) - { - TInt err = iSender->DeleteContextL(); - iSender->ReleaseConnectionL(); - return err ; - } - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestCreateContextL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestCreateContextL( CStifItemParser& /*aItem*/ ) - { - TInt err = iSender->CreateContextL(); - iSender->ReleaseConnectionL(); - return err ; - } - - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestSubscribePresenceL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestSubscribePresenceL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestSubscribePresenceL(); - iSender->ReleaseConnectionL(); - return err ; - } - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestAppendInfoMessageL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestAppendInfoMessageL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestAppendInfoMessageL(); - iSender->ReleaseConnectionL(); - return err ; - } - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestGetPresenceStatusL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestGetPresenceStatusL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestGetPresenceStatusL(); - iSender->ReleaseConnectionL(); - return err ; - } - - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestCCHHandlerL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestCCHHandlerL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestCCHHandlerL(); - iSender->ReleaseConnectionL(); - return err ; - } - - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::ReadyForShutdownTestL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::ReadyForShutdownTestL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->ReadyForShutdownTestL(); - iSender->ReleaseConnectionL(); - return err; - } -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::ServiceNameTestL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::ServiceNameTestL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->ServiceNameTestL(); - iSender->ReleaseConnectionL(); - return err ; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::OpenChatsTestL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::OpenChatsTestL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->OpenChatsTestL(); - iSender->ReleaseConnectionL(); - return err ; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::GetServiceIdTestL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::GetServiceIdTestL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->GetServiceIdTestL(); - iSender->ReleaseConnectionL(); - return err ; - } - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestClosAllContainerL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestClosAllContainerL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestClosAllContainerL(); - iSender->ReleaseConnectionL(); - return err ; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestDeleteChatL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Cimcvuiengine_test::TestDeleteChatL( CStifItemParser& /*aItem*/ ) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestDeleteChatL(); - iSender->ReleaseConnectionL(); - return err ; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestEditorMessageL() -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- - -TInt Cimcvuiengine_test::TestEditorMessageL(CStifItemParser& /*aItem*/) - { - iSender->CreateConnectionL(); - TInt err = iSender->TestEditorMessageL(); - iSender->ReleaseConnectionL(); - return err ; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestConvertPresCacheEnum() -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- - -TInt Cimcvuiengine_test::TestConvertPresCacheEnum(CStifItemParser& /*aItem*/) - { - TInt err = iSender->TestConvertPresCacheEnum(); - iSender->ReleaseConnectionL(); - return err ; - } -// [End of File] - Do not remove diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/src/imcvuiengine_testsendmessage.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/src/imcvuiengine_testsendmessage.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1423 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: imcvuiengine_testsendmessage.cpp -* -*/ - - -// [INCLUDE FILES] - do not remove -#include -#include "imcvuiengine_testsendmessage.h" -#include "cimcvengine.h" -#include "mimcvenginemessagecontainerinfo.h" -#include "mimcvenginemessagecreator.h" -#include "cimcvenginemessagehandler.h" -#include -#include -#include "mimcvenginechatinterface.h" -#include "mimcvenginemessageswriteinterface.h" -#include "mimcvengineopenchats.h" - -#include "cimcvenginemessagehandler.h" -#include - -#include -#include -#include -#include "s_cch.h" -#include "cimcvenginefactory.h" -#include "mimcvenginefactory.h" -#include "cimcvenginemessagecreator.h" -#include "mimcvenginemessagecreator.h" - -_LIT(KOwnUser,"testlm123@gmail.com"); -_LIT8(KBrandId,"YAHOO"); - -const TInt KProtocolUid = 0x20007B6D; -const TUid KIMPropertyUid = { 0x0D334E82 }; - -const TUint KIMConnectedKey = 0x00000001; -const TUint KIMServiceIdKey = 0x00000002; -const TUint KIMServiceProtocolUidKey = 0x00000003; -const TUint KIMOwnUserIdKey = 0x00000004; - -_LIT(KRecipientID,"testui123@gmail.com"); -_LIT(KRecipientID2,"testlm123@gmail.com"); - -_LIT(KInvalidRecipientID,"abcsddd@gmail.com"); - -// meco service uid -#define KMECOIMPLEMENTATIONUID 0x20012423 - - -//const TInt ProcessInterval = 2000000; //2 seconds - -// -------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::CIMCVUiEngine_TestSendMessage -// -------------------------------------------------------------------------- -// -CIMCVUiEngine_TestSendMessage::CIMCVUiEngine_TestSendMessage() - { - - } - - -// CIMCommands_TestLogin::~CIMCommands_TestLogin -// -------------------------------------------------------------------------- -// -CIMCVUiEngine_TestSendMessage::~CIMCVUiEngine_TestSendMessage() - { - delete iSettings; - CIMCVEngineFactory::Release(); - } - - -// -------------------------------------------------------------------------- -// CIMCommands_TestLogin::NewL -// -------------------------------------------------------------------------- -// -CIMCVUiEngine_TestSendMessage* CIMCVUiEngine_TestSendMessage::NewL() - { - CIMCVUiEngine_TestSendMessage* self = new(ELeave) CIMCVUiEngine_TestSendMessage(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::ConstructL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -void CIMCVUiEngine_TestSendMessage::ConstructL() - { - // define the property for upper layer to use serivceid , - // servicesetting id and loggedin user id - // servicesetting id and loggedin user id - - CreateSpEntryL(KTestServiceId); - ReadServiceDetalsL(); - - - TInt err = RProperty::Define(KIMPropertyUid, KIMServiceIdKey, RProperty::EInt, - ECapabilityReadUserData ,ECapabilityWriteUserData); - //User::LeaveIfError(err); - - - err = RProperty::Define(KIMPropertyUid, KIMServiceProtocolUidKey, RProperty::EInt, - ECapabilityReadUserData ,ECapabilityWriteUserData ); - //User::LeaveIfError(err); - - err = RProperty::Define(KIMPropertyUid, KIMConnectedKey, RProperty::EInt, - ECapabilityReadUserData ,ECapabilityWriteUserData ); - //User::LeaveIfError(err); - - // write into defined property for upper layer to use serivceid , - - RProperty::Set( KIMPropertyUid, KIMServiceIdKey, KTestServiceId ); - RProperty::Set( KIMPropertyUid, KIMServiceProtocolUidKey, KProtocolUid ); - RProperty::Set( KIMPropertyUid, KIMConnectedKey, ETrue ); - - iEngineFactory = CIMCVEngineFactory::InstanceL(); - - iEngine = &iEngineFactory->GetServiceEngineL( KTestServiceId ); - - // for send operation - iEngine->MessageHandler().SetObserver(this); - - //iEngine->CCHHandler().EnableService(); - } -// ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::ReadServiceDetalsL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -void CIMCVUiEngine_TestSendMessage::ReadServiceDetalsL() - { - iSettings = CSPSettings::NewL(); // CCH Login - iServiceId = KErrNotFound; - ///////////////////////Get Service Id//////////////// - RArray services; - CleanupClosePushL( services ); - iSettings->FindServiceIdsL( services ); - const TInt serviceCount = services.Count(); - for ( TInt i( 0 ); i < serviceCount; i++ ) - { - TInt refContactUid = KErrNotFound; - CSPProperty* property = CSPProperty::NewLC(); - iSettings->FindPropertyL( services[i],EPropertyContactViewPluginId,*property ); - if ( property ) - { - property->GetValue( refContactUid ); - } - CleanupStack::PopAndDestroy( property ); - if ( (TUid::Uid( refContactUid ) == TUid::Uid( KMECOIMPLEMENTATIONUID )) - || (TUid::Uid( refContactUid ) == TUid::Uid( 0x20007B6D ) )) - { - iServiceId = services[i]; - break; - } - } - CleanupStack::PopAndDestroy( &services ); - - } - - -// ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::CreateConnectionL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -void CIMCVUiEngine_TestSendMessage::CreateConnectionL() - { - // TODO : allready loggedin in local mode enable when login to n/w - //if(!iEngine->IsLoggedIn() ) - // { - // iEngine->CreateContextL(); - // } - } - -// ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::ReleaseConnectionL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -void CIMCVUiEngine_TestSendMessage::ReleaseConnectionL() - { - if(iEngine->IsLoggedIn() ) - { - iEngine->ReleaseConnectionL(); - } -// iEngine->DeleteContextL(); - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::SendTextMessageL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::SendTextMessageL() - { - _LIT(KSomeStr,"hello"); //String to be sent - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - write.AppendL(message ); - iEngine->MessageHandler().SendMessageL( *message ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - return iResult; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::SendNullMessageL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::SendNullMessageL() - { - _LIT(KSomeStr,""); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - write.AppendL(message ); - iEngine->MessageHandler().SendMessageL( *message ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - return iResult; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::StartNewConvesationL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::StartNewConvesationL() - { - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - return iResult; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::CloseConvesationL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::CloseConvesationL() - { - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - iEngine->MessageHandler().CloseConversationL( KRecipientID ); - - return iResult; - } - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::SendSplCharMessageL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::SendSplCharMessageL() - { - _LIT(KSomeSplStr,"@&!`$?#"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeSplStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - - write.AppendL(message ); - - iEngine->MessageHandler().SendMessageL( *message ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - return iResult; - } -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::SendCosMessageL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::SendCosMessageL() - { - _LIT(KSomeSplStr,"asdscmdsdsvndv dsvndsfnv dfkdsfkd vkdsfvkdsj dsfdsjfkdsjf dsfjkdsjfkds dskfjdskfjdsk dfjkdsjfds dsfkdsjfkds dsfkdmfkds safdsajhf asfsajfnha adsfjndajsnhfd dsafnajdsfnh adsfjdajf ajfajfnhj fajadsjfa asasjfjafja afnajf asjfjdsaf"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeSplStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - - write.AppendL(message ); - - iEngine->MessageHandler().SendMessageL( *message ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - return iResult; - } -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::DeactivateConvesationL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::DeactivateConvesationL() - { - - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - iEngine->MessageHandler().DeactivateConversationL(); - - return iResult; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::SendToInvaliedRecipientL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::SendToInvaliedRecipientL() - { - _LIT(KSomeSplStr,"Invalied Recipient"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - iEngine->MessageHandler().StartNewConversationL( KInvalidRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KInvalidRecipientID, - KSomeSplStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - - write.AppendL(message ); - - iEngine->MessageHandler().SendMessageL( *message ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - if(iResult == KErrArgument ) - { - iResult = KErrNone; - } - return iResult; - } - // ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestRecievedMessageL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestMultipleSendMessageL() - { - _LIT(KSomeSplStr1,"this is recieved message 1"); //String to be sent - _LIT(KSomeSplStr2,"this is recieved message 2"); //String to be sent - _LIT(KSomeSplStr3,"this is recieved message 3"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data1 = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeSplStr1, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message1 = iEngine->MessageHandler().MessageCreator().CreateMessageL( data1 ); - write.AppendL(message1); - iEngine->MessageHandler().SendMessageL( *message1 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data2 = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeSplStr2, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message2 = iEngine->MessageHandler().MessageCreator().CreateMessageL( data2 ); - write.AppendL(message2); - iEngine->MessageHandler().SendMessageL( *message2 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data3 = - { - KMessageDataVersion, - KOwnUser, - KInvalidRecipientID, - KSomeSplStr3, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message3 = iEngine->MessageHandler().MessageCreator().CreateMessageL( data3 ); - write.AppendL(message3); - iEngine->MessageHandler().SendMessageL( *message3 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - return iResult; - } -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestSendRecieveMsgL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestSendRecieveMsgL() - { - - _LIT(KSomeSplStr1,"this is send recieved message 1"); //String to be sent - _LIT(KSomeSplStr2,"this is send recieved message 2"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data1 = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeSplStr1, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message1 = iEngine->MessageHandler().MessageCreator().CreateMessageL( data1 ); - write.AppendL(message1 ); - iEngine->MessageHandler().SendMessageL( *message1 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data2 = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeSplStr2, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message2 = iEngine->MessageHandler().MessageCreator().CreateMessageL( data2 ); - - write.AppendL(message2 ); - iEngine->MessageHandler().SendMessageL( *message2 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - iEngine->MessageHandler().DeactivateConversationL(); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - return iResult; - } -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestSendFetchSendMsgL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestSendFetchSendMsgL() - { - _LIT(KSomeSplStr1,"this is send recieved message 1"); //String to be sent - _LIT(KSomeSplStr2,"this is send recieved message 2"); //String to be sent - _LIT(KSomeSplStr3,"this is send recieved message 3 after fetched im from cache"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data1 = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeSplStr1, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message1 = iEngine->MessageHandler().MessageCreator().CreateMessageL( data1 ); - write.AppendL(message1); - iEngine->MessageHandler().SendMessageL( *message1 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data2 = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeSplStr2, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message2 = iEngine->MessageHandler().MessageCreator().CreateMessageL( data2 ); - write.AppendL(message2); - iEngine->MessageHandler().SendMessageL( *message2 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - iEngine->MessageHandler().DeactivateConversationL(); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data3 = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeSplStr3, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message3 = iEngine->MessageHandler().MessageCreator().CreateMessageL( data3 ); - write.AppendL(message3); - iEngine->MessageHandler().SendMessageL( *message3 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - return iResult; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::PrintTest -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::GetResult() const - { - return iResult; - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::HandleOperationCompletdL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -void CIMCVUiEngine_TestSendMessage::HandleOperationCompletdL( TInt aserviceId, MIMCVEngineMessage::TMessagerType aType , TInt aResult ) - { - iResult = aResult; - if ( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - } -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestConnectionTerminationL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestConnectionTerminationL() - { - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::HandleConnectionTerminatedL -// Simple printing to UI test. -// ----------------------------------------------------------------------------- -// -void CIMCVUiEngine_TestSendMessage::HandleConnectionEventL(TInt aServiceId, TIMCVConnectionState aState, TInt aReason ) - { - iResult = aReason; - if ( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - } - -// ----------------------------------------------------------------------------- -// Cimcvuiengine_test::TestLoginStateL -// Example test method function.TestLoginStateL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestLoginStateL() - { - - if(iEngine->IsLoggedIn() ) - { - return KErrNone; - } - return KErrServerTerminated ; - } - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestLoginUserIdL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestLoginUserIdL() - { - - TPtrC userId = iEngine->GetLoggedInUserId(); - - if(! userId.Compare(KOwnUser ) ) - { - return KErrNone; - } - return KErrArgument ; - } -// ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestGetBrandIdL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestGetBrandIdL() - { - TPtrC8 BrandId = iEngine->GetBrandId(); - - if( BrandId.Length() ) - { - return KErrNone; - } - return KErrArgument ; - } -// ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestGetLanguageIdL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestGetLanguageIdL() - { - TInt languageId = iEngine->GetLanguageId(); - - if(KErrNone != languageId ) - { - return KErrNone; - } - return KErrArgument ; - } - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestChatInterfaceL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestChatInterfaceL() - { - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - - MIMCVEngineMessageReadInterface& read = chat.MessageReadInterfaceL(1, KRecipientID) ; - read.Lock(ETrue); // to make sure ,valid ref - - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - write.Time();// to make sure ,valid ref - - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestMessageCoundL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestMessageCoundL() - { - _LIT(KSomeStr,"hello"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageSent - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - - write.AppendL(message ); - - iEngine->MessageHandler().SendMessageL( *message ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageReadInterface& read = chat.MessageReadInterfaceL(1, KRecipientID) ; - - // in case of send this must be zero , except unread - // this is the ReadOffset not the actaul message count - TInt count = read.MessageCount(); - - if(count == 0 ) - { - return KErrNone; - } - - return KErrNotFound; - } - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestMessageUnreadCoundL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestMessageUnreadCoundL() - { - _LIT(KSomeStr,"hello"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageReceived - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - - write.AppendL(message ); - - iEngine->MessageHandler().SendMessageL( *message ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageReadInterface& read = chat.MessageReadInterfaceL(1, KRecipientID) ; - - TInt count = read.UnreadCount(MIMCVEngineMessageReadInterface::EUnreadAll); - - if(count == 1) - { - return KErrNone; - } - - return KErrNotFound; - - } - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::DeleteContextL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::DeleteContextL() - { - //by default engine's context needs to be binded - iEngine->CreateContextL() ; - - TRAPD(err, iEngine->DeleteContextL() ); - - return err; - } - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::CreateContextL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::CreateContextL() - { - // by default presence must be EOffline - TRAPD(err, iEngine->CreateContextL() ); - - return err; - } - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestSubscribePresenceL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestSubscribePresenceL() - { - TRAPD(err, iEngine->MessageHandler().SubscribePresenceL(KRecipientID) ); - return err; - } - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestGetPresenceStatusL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestGetPresenceStatusL() - { - - // by default presence must be EOffline - TIMCVOnlineStatus status = iEngine->MessageHandler().GetPresenceStatus(); - if(status == EOffline ) - { - return KErrNone; - } - - return KErrArgument; - - } - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestAppendInfoMessageL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestAppendInfoMessageL() - { - _LIT(KSomeStr,"hello this is information message "); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageOther - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - - write.AppendL(message ); - - TRAPD(err, iEngine->MessageHandler().AppendToCacheL(KRecipientID, message->Text() ) ); - - return err; - } - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::HandlePresenceChangedL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMCVUiEngine_TestSendMessage::HandlePresenceChangedL(TInt aServiceId, const TDesC& /*aBuddyId*/ ) - { - // do nothings - } - - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestCCHHandlerL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestCCHHandlerL() - { - TInt error = KErrNone; - - MIMCVEngineCchHandler& cchHandler = iEngine->CCHHandler(); - - if ( cchHandler.IsServiceLoggedIn() ) - { - error = KErrArgument ; - } - HBufC* user = cchHandler.GetUserIdL(); - - if( user ) - { - delete user; - error = KErrNone ; - } - else - { - error = KErrArgument ; - } - return error; - } - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::ReadyForShutdownTestL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::ReadyForShutdownTestL() - { - if( !iEngine->ReadyForShutdown() ) - { - // loggedin - return KErrNone; - } - return KErrArgument; - } - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::ServiceNameTestL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::ServiceNameTestL() - { - if (iEngine->ServiceName().Length() ) - { - return KErrNone ; - } - return KErrArgument; - } - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::OpenChatsTestL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::OpenChatsTestL() - { - if ( &iEngine->OpenChats() ) - { - MIMCVEngineOpenChats& openchat = iEngine->OpenChats() ; - if( !openchat.Count()) - { - return KErrNone ; - } - } - return KErrArgument; - } - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::GetServiceIdTestL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::GetServiceIdTestL() - { - if ( iEngine->GetServiceId() > 0 ) - { - return KErrNone ; - } - return KErrArgument; - } - - - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestClosAllContainerL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestClosAllContainerL() - { - _LIT(KSomeStr,"hello"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageReceived - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - - write.AppendL(message ); - - iEngine->MessageHandler().SendMessageL( *message ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - if( chat.ChatCount() ) - { - chat.CloseAllContainers(); - - } - if( !chat.ChatCount() ) - { - return KErrNone; - - } - - return KErrArgument; - - - } - - - // ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestDeleteChatL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestDeleteChatL() - { - _LIT(KSomeStr,"hello"); //String to be sent - - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID ); - - MIMCVEngineMessageWriteInterface& write = chat.MessageWriteInterfaceL(1, KRecipientID ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data = - { - KMessageDataVersion, - KOwnUser, - KRecipientID, - KSomeStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageReceived - }; - MIMCVEngineMessage* message = iEngine->MessageHandler().MessageCreator().CreateMessageL( data ); - - write.AppendL(message ); - - iEngine->MessageHandler().SendMessageL( *message ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageWriteInterface& write2 = chat.MessageWriteInterfaceL(1, KRecipientID2 ); - - iEngine->MessageHandler().StartNewConversationL( KRecipientID2 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - MIMCVEngineMessageCreator::SMessageData data1 = - { - KMessageDataVersion, - KOwnUser, - KRecipientID2, - KSomeStr, - MIMCVEngineMessage::EContentText, - MIMCVEngineMessage::EMessageReceived - }; - MIMCVEngineMessage* message1 = iEngine->MessageHandler().MessageCreator().CreateMessageL( data1 ); - - write2.AppendL(message1 ); - - iEngine->MessageHandler().SendMessageL( *message1 ); - - if ( !iWait.IsStarted() ) - { - iWait.Start(); - } - - if( chat.ChatCount() == 2 ) - { - chat.DeleteChatL( 1, KRecipientID2 ); - } - if( chat.ChatCount() == 1) - { - return KErrNone; - - } - - return KErrArgument; - - - } -// ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestEditorMessageL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestEditorMessageL() - { - - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - - MIMCVEngineMessageReadInterface& read = chat.MessageReadInterfaceL(1, KRecipientID) ; - read.Lock(ETrue); // to make sure ,valid ref - read.StoreEditerMessageL(_L("Test Message")); - TBuf<15> receiveData; - receiveData = read.GetEditerMessage(); - - if(0 == receiveData.Compare(_L("Test Message"))) - return KErrNone; - - return KErrArgument; - } - -// ----------------------------------------------------------------------------- -// CIMCVUiEngine_TestSendMessage::TestEditorMessageL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMCVUiEngine_TestSendMessage::TestConvertPresCacheEnum() - { - TInt err; - MIMCVEngineMessageUtils* aMessageUtils = NULL; - MIMCVEngineChatInterface& chat = iEngine->ChatInterface(); - MIMCVEngineMessageCreator* messageCreator = CIMCVEngineMessageCreator::NewL(); - CIMCVEngineMessageHandler* handler = CIMCVEngineMessageHandler::NewL( chat, *messageCreator, NULL, 1 ,KNullDesC); - MPresenceBuddyInfo2::TAvailabilityValues value = MPresenceBuddyInfo2::EUnknownAvailability; - TIMCVOnlineStatus status; - - // the ConvertPresenceCacheEnums does not have the support for block and pending, - // hence should be added in the new test cases. - - /*TBuf<50> buf1(KBlockedState); - TPtrC Ptr1 (buf1); - TIMCVOnlineStatus status = handler->ConvertPresenceCacheEnums(value, Ptr1); - if(EUnknown != status) - { - return KErrNotFound; - } - */ - value = MPresenceBuddyInfo2::EUnknownAvailability; - TBuf<50> buf2(KInvisibleState); - TPtrC Ptr2 (buf2); - status = handler->ConvertPresenceCacheEnums(value, Ptr2); - if(EInvisible != status) - { - return KErrNotFound; - } - - value = MPresenceBuddyInfo2::EBusy; - TBuf<50> buf3(KAwayState); - TPtrC Ptr3 (buf3); - status = handler->ConvertPresenceCacheEnums(value, Ptr3); - if(EAway != status) - { - return KErrNotFound; - } - - value = MPresenceBuddyInfo2::EBusy; - TBuf<50> buf4(KOnPhoneState); - TPtrC Ptr4 (buf4); - status = handler->ConvertPresenceCacheEnums(value, Ptr4); - if(EOnPhone != status) - { - return KErrNotFound; - } - - value = MPresenceBuddyInfo2::EBusy; - TBuf<50> buf5(KDndState); - TPtrC Ptr5 (buf5); - status = handler->ConvertPresenceCacheEnums(value, Ptr5); - if(EDoNotDisturb != status) - { - return KErrNotFound; - } - - /*value = MPresenceBuddyInfo2::EUnknownAvailability; - TBuf<50> buf6(KPendingRequestState); - TPtrC Ptr6 (buf6); - status = handler->ConvertPresenceCacheEnums(value, Ptr6); - if(EUnknown != status) - { - return KErrNotFound; - } - */ - value = MPresenceBuddyInfo2::EAvailable; - _LIT(KAnyMsg,"Any msg"); - TBuf<50> buf7(KAnyMsg); - TPtrC Ptr7 (buf7); - status = handler->ConvertPresenceCacheEnums(value, Ptr7); - if(EOnline != status) - { - return KErrNotFound; - } - - value = MPresenceBuddyInfo2::ENotAvailable; - status = handler->ConvertPresenceCacheEnums(value, Ptr7); - if(EOffline != status) - { - return KErrNotFound; - } - - value = MPresenceBuddyInfo2::EUnknownAvailability; - status = handler->ConvertPresenceCacheEnums(value, Ptr7); - if(EUnknown != status) - { - return KErrNotFound; - } - - return KErrNone; - } - - -// end of file - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/src/s_cch.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/src/s_cch.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,413 +0,0 @@ -/* -* 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: s_cch.cpp -* -*/ - -// EXTERNAL INCLUDES - -#include -#include -#include -#include -#include -#include "s_cch.h" - -CCchService* myService = NULL; - - - -TInt CreateSpEntryL( TInt aServiceId ) - { - CSPSettings* myCSPSettings = CSPSettings::NewL(); - CSPEntry* entry = CSPEntry::NewLC(); - entry->SetServiceId( aServiceId ); - User::LeaveIfError( entry->SetServiceName( KTestServiceName ) ); - CSPProperty* property = NULL; - // set voip enabled property - property = CSPProperty::NewLC(); - property->SetName( ESubPropertyVoIPEnabled ); - property->SetValue( EOn ); - entry->AddPropertyL( *property ); - CleanupStack::PopAndDestroy( property ); - - // set presence settings id property - property = CSPProperty::NewLC(); - property->SetName( ESubPropertyPresenceSettingsId ); - property->SetValue( 1 ); - entry->AddPropertyL( *property ); - CleanupStack::PopAndDestroy( property ); - - // set im settings id property - property = CSPProperty::NewLC(); - property->SetName( ESubPropertyIMSettingsId ); - property->SetValue( 1 ); - entry->AddPropertyL( *property ); - CleanupStack::PopAndDestroy( property ); - - // set Presence FW PSC plugin UID - property = CSPProperty::NewLC(); - property->SetName( EPropertyPCSPluginId ); - property->SetValue( 0x20007B6D ); - entry->AddPropertyL( *property ); - CleanupStack::PopAndDestroy( property ); - - property = CSPProperty::NewLC(); - property->SetName( EPropertyContactViewPluginId ); - property->SetValue( KMECOIMPLEMENTATIONUID ); - entry->AddPropertyL( *property ); - CleanupStack::PopAndDestroy( property ); - - - myCSPSettings->AddEntryL( *entry ); - TInt createdServiceId = entry->GetServiceId(); - CleanupStack::PopAndDestroy( entry ); - - return createdServiceId; - } - - -/*************** Stubs ****************/ -CCchService* CCch::GetService( TInt /*aServiceId*/ ) - { - if( !myService ) - { - myService = new ( ELeave ) MyCchService(); - return myService; - } - return myService; - } -/*************** Stubs ****************/ - -CCch::CCch() - { - - } - -CCch::~CCch() - { - if(myService) - { - myService = NULL; - } - - } -// --------------------------------------------------------------------------- -// CCch::NewL -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CCch* CCch::NewL( ) - { - CCch* self = CCch::NewLC( ); - CleanupStack::Pop( self ); - return self; - } -// --------------------------------------------------------------------------- -// CCch::ConstructL -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CCch::ConstructL() - { - //iImplementation = CCchImpl::NewL( this ); - - } -// --------------------------------------------------------------------------- -// CCch::NewLC -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CCch* CCch::NewLC( ) - { - CCch* self = new (ELeave) CCch( ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CCchUIHandler::GetServiceIds -// --------------------------------------------------------------------------- -// -TInt CCch::GetServiceIds( RArray& aIds ) const -{ - -} - -// --------------------------------------------------------------------------- -// CCchUIHandler::GetServiceIds -// --------------------------------------------------------------------------- -// -TInt CCch::GetServices( TCCHSubserviceType aType, - RPointerArray& aServices ) - { - - } - -// --------------------------------------------------------------------------- -// CCchUIHandler::ConnectivityDialogsAllowed -// --------------------------------------------------------------------------- -// -TBool CCch::ConnectivityDialogsAllowed() const -{ - -} - -// --------------------------------------------------------------------------- -// CCchUIHandler::SetConnectivityDialogsAllowed -// --------------------------------------------------------------------------- -// -void CCch::SetConnectivityDialogsAllowed( - TBool aConnectivityDialogsAllowed ) - { - } -// ========================== OTHER EXPORTED FUNCTIONS ========================= -// -------------------------------------------------------------------------- -// TCchServiceStatus::TCchServiceStatus -// -------------------------------------------------------------------------- -// -TCchServiceStatus::TCchServiceStatus() -: iState( ECCHUninitialized ) -, iError( KErrNone ) - { - } - -// -------------------------------------------------------------------------- -// TCchServiceStatus::State -// -------------------------------------------------------------------------- -// -TCCHSubserviceState TCchServiceStatus::State() const -{ -return iState; -} - -// -------------------------------------------------------------------------- -// TCchServiceStatus::Error -// -------------------------------------------------------------------------- -// -TInt TCchServiceStatus::Error() const -{ -return iError; -} - -// -------------------------------------------------------------------------- -// TCchServiceStatus::SetState -// -------------------------------------------------------------------------- -// -void TCchServiceStatus::SetState( TCCHSubserviceState aState ) - { - iState = aState; - } - -// -------------------------------------------------------------------------- -// TCchServiceStatus::SetError -// -------------------------------------------------------------------------- -// -void TCchServiceStatus::SetError( TInt aError ) - { - iError = aError; - } -// End of File - -/************* End of Stubs ************/ - - - -TInt MyCchService::Enable( TCCHSubserviceType aType ) - { - return KErrNone; - } - -/** - * Launches service disable. See MCchServiceObserver for status changes. - * - * @param aType Type of service - * @return Symbian error - */ -TInt MyCchService::Disable( TCCHSubserviceType /*aType*/ ){ return KErrNone; } - -/** - * Returns the current service state - * - * @param aType Type of service - * @param aStatus Status of the service, return value - * @return Symbian error code - */ -TInt MyCchService::GetStatus( TCCHSubserviceType aType, - TCchServiceStatus& aStatus ) const - - { - if ( (ECCHIMSub == aType) ) - { - aStatus.SetState(ECCHEnabled); - aStatus.SetError(KErrNone); - return KErrNone; - } - - return KErrNotFound ; - - } - -/** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ -TInt MyCchService::GetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, TInt& /*aValue*/ ) const{ return KErrNone;} - -/** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ -TInt MyCchService::GetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter aParameter, RBuf& aValue ) const - - { - if (aParameter == ECchUsername) - { - TBuf<512> username; - username = KTestUserName; - aValue.Copy(username); - return KErrNone; - } - - return KErrNotFound; - } - -/** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ -TInt MyCchService::SetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, TInt /*aValue*/ ) - - { - return KErrNone; - } - -/** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ -TInt MyCchService::SetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, const TDesC& /*aValue*/ ) - { - return KErrNone; - } - -/** - * Reserves the service for exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ -TInt MyCchService::Reserve( TCCHSubserviceType /*aType*/ ){ return KErrNone; } - -/** - * Frees the service of exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ -TInt MyCchService::Free( TCCHSubserviceType /*aType*/ ){ return KErrNone; } - -/** - * Is the service reserved - * - * @param aType Type of service - * @param aReserved True if the service is reserved - * @return Symbian error code - */ -TInt MyCchService::IsReserved( TCCHSubserviceType /*aType*/, TBool& /*aReserved*/ ) const{ return KErrNone; } - -/** - * Returns the service id - * - * @return The id of the service - */ -TInt MyCchService::ServiceId() const{ return KErrNone; } - -/** - * @deprecated Do not use this anymore, change to AddObserver! - * - * Adds observer for listening service events - * - * @param aObserver Event observing class - */ -void MyCchService::SetObserver( MCchServiceStatusObserver& aObserver ) - { - iObserver = &aObserver; - } - -/** - * @deprecated Do not use this anymore, change to - * RemoveObserver method with paramater - * - * Removes the observer of service events - */ -void MyCchService::RemoveObserver( ) - { - iObserver = NULL; - } - - -/** - * Adds observer for listening service events - * - * @param aObserver Event observing class - * @return KErrAlreadyExist Observer already added - * KErrNone Observer was added - */ -TInt MyCchService::AddObserver( MCchServiceStatusObserver& /*aObserver*/ ){ return KErrNone; } - -/** - * Removes the observer of service events - * - * @param aObserver Event observing class - * @return KErrNotFound Observer was not found - * KErrNone Observer was removed - */ -TInt MyCchService::RemoveObserver( MCchServiceStatusObserver& /*aObserver*/ ){ return KErrNone; } - -/** - * Checks if the type is supported - * - * @param aType Type of service - * @param aSupported True if the service type is supported - * @return Symbian error code - */ -TInt MyCchService::IsSupported( TCCHSubserviceType /*aType*/, TBool& /*aSupported*/ ) const{ return KErrNone; } - - -//end of file - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/src/s_spentry.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/src/s_spentry.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* 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: s_spentry.cpp -* -*/ - -#include -#include -#include -#include "s_cch.h" -CSPEntry* mycspentry = NULL; -extern CSPSettings* mycspsettings; -CSPEntry* CSPEntry::NewL() - { - CSPEntry* self = CSPEntry::NewLC( ); - CleanupStack::Pop( self ); - return self; - } -CSPEntry* CSPEntry::NewLC() - { - CSPEntry* self = new (ELeave) CSPEntry( ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -CSPEntry::~CSPEntry() - { - iServiceName.Close(); - iPropertyArray.ResetAndDestroy(); - iPropertyArray.Close(); - } - -TServiceId CSPEntry::GetServiceId() const - { - return iServiceId; - } - -void CSPEntry::SetServiceId( TServiceId aServiceId ) - { - iServiceId = aServiceId; - } - -const TDesC16& CSPEntry::GetServiceName() const - { - return KTestServiceName; - } - -TInt CSPEntry::SetServiceName( const TDesC16& aServiceName ) - { - iServiceName.Copy(aServiceName); - return KErrNone; - } - -TInt CSPEntry::AddPropertyL( const CSPProperty& aProperty ) - - { - return KErrNone; - } - - -TInt CSPEntry::UpdateProperty( TServicePropertyName /*aPropertyName*/, TInt /*aValue*/ ) - { - return KErrNone; - } - - -TInt CSPEntry::UpdateProperty( TServicePropertyName /*aPropertyName*/, const TDesC& /*aValue*/ ) - { - return KErrNone; - } - -TInt CSPEntry::UpdateProperty( TServicePropertyName /*aPropertyName*/, TOnOff /*aValue*/ ) - { - return KErrNone; - } - -TInt CSPEntry::GetProperty( const CSPProperty*& aProperty, - TServicePropertyName aPropertyName ) const - { - - return KErrNotFound; - } - -TInt CSPEntry::GetProperty( const CSPProperty*& /*aProperty*/, - TInt /*aIndex*/ ) const - { - return KErrNone; - } - -TInt CSPEntry::DeleteProperty( TInt /*aIndex*/ ) - { - return KErrNone; - } - -TInt CSPEntry::DeleteProperty( TServicePropertyName /*aProperty*/ ) - { - return KErrNone; - } - -const RPropertyArray& CSPEntry::GetAllProperties() const - { - return iPropertyArray; - } - -TInt CSPEntry::PropertyCount() const - { - return KErrNone; - } - -CSPEntry::CSPEntry() - { - } - -void CSPEntry::ConstructL() - { - iServiceName.CreateL(100); - iServiceName.Copy(KTestServiceName); - iServiceId = KTestServiceId; - } - -TInt CSPEntry::SearchProperty( TServicePropertyName /*aProperty*/ ) const - { - return KErrNone; - } - - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/src/s_spproperty.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/src/s_spproperty.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* 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: s_spproperty.cpp -* -*/ -#include - -const TInt KMaxIntLen = 15; -CSPProperty* CSPProperty::NewL() - { - return new ( ELeave ) CSPProperty; - } -CSPProperty* CSPProperty::NewLC() - { - CSPProperty* self = new ( ELeave ) CSPProperty; - CleanupStack::PushL( self ); - return self; - } -CSPProperty::~CSPProperty(){} -TServicePropertyName CSPProperty::GetName() const - { - return iPropertyName; - } -TInt CSPProperty::SetName( TServicePropertyName aPropertyname ) - { - iPropertyName = aPropertyname; - return KErrNone; - } -TSPItemType CSPProperty::GetPropertyType() const - { - TSPItemType type = EItemTypeNotDefined; - return type; - } -TInt CSPProperty::SetPropertyType( TSPItemType /*aPropertyType*/ ){ return KErrNone; } -TPropertyDataType CSPProperty::GetDataType() const - { - TPropertyDataType type = EDataTypeNotSet; - return type; - } -void CSPProperty::SetDataType( TPropertyDataType /*aDataType*/ ){} -TInt CSPProperty::GetValue( TInt& aValue ) const - { - TInt protocolUidValue = 0x20007B6D; ////// dummy adaptation UID - aValue = protocolUidValue; - return KErrNone; - } -TInt CSPProperty::SetValue( TInt aValue ) - { - return KErrNone; - } - -TInt CSPProperty::GetValue( TDes& aValue ) const -{ -aValue.Zero(); - -if ( aValue.MaxLength() >= iPropertyValue.Length() ) - { - aValue.Copy( iPropertyValue ); - return KErrNone; - } - -} - -TInt CSPProperty::SetValue( const TDesC& aValue ) - { - TInt ret( 0 ); - iPropertyValue.Close(); - ret = iPropertyValue.Create( aValue ); - return ret; - } - -TInt CSPProperty::GetValue( TOnOff& aValue ) const - { - return KErrNone; - } -TInt CSPProperty::SetValue( TOnOff aValue ) - { - return KErrNone; - } -TInt CSPProperty::SetValueNoDataTypeCheck( const TDesC& /*aValue*/ ){ return KErrNone; } -TPropertyDataType CSPProperty::DataType( TServicePropertyName /*aProperty*/ ) - { - TPropertyDataType type = EDataTypeNotSet; - return type; - } -TSPItemType CSPProperty::PropertyType( TServicePropertyName /*aProperty*/ ) - { - TSPItemType type = EItemTypeNotDefined; - return type; - } -void CSPProperty::CopyL( const CSPProperty& aSource ) - { - } -TBool CSPProperty::CSPProperty::operator==( - const CSPProperty& /*aProperty*/ ) const{ return ETrue; } -CSPProperty::CSPProperty(){} -void CSPProperty::ConstructL(){} -TInt SetDefaultValue( TServicePropertyName /*aProperty*/ ){ return KErrNone; } - diff -r 2b7283837edb -r 3104fc151679 imstutils/imconversationview/tsrc/imcvuiengine_test/src/s_spsettings.cpp --- a/imstutils/imconversationview/tsrc/imcvuiengine_test/src/s_spsettings.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* 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: s_spsettings.cpp -* -*/ - -#include -#include -#include -#include "s_cch.h" -CSPSettings* mycspsettings = NULL; -extern CSPEntry* mycspentry ; -CSPSettings::CSPSettings() - { - } -CSPSettings* CSPSettings::NewL() - { - CSPSettings* self = CSPSettings::NewLC( ); - CleanupStack::Pop( self ); - return self; - } -CSPSettings* CSPSettings::NewLC() - { - CSPSettings* self = new (ELeave) CSPSettings( ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -CSPSettings::~CSPSettings() - { - } - - -TInt CSPSettings::AddEntryL( CSPEntry& aEntry ) - { - return KErrNone; - } -void CopyEntry( const CSPEntry& aOriginal, CSPEntry& aTarget ) - { - aTarget.SetServiceId( aOriginal.GetServiceId() ); - aTarget.SetServiceName( aOriginal.GetServiceName() ); - } - -TInt CSPSettings::FindEntryL( TServiceId aServiceId, CSPEntry& aEntry ) - { - aEntry.SetServiceName(KTestServiceName); - aEntry.SetServiceId(KTestServiceId); - return KErrNone; - } - - -TInt CSPSettings::UpdateEntryL( const CSPEntry& aEntry ) - { - return KErrNotFound; - } - -TInt CSPSettings::FindPropertyL( TServiceId aServiceId, - TServicePropertyName aPropertyName, - CSPProperty& aProperty ) - { - if(aPropertyName == EPropertyPCSPluginId) - { - TInt protocolUidValue = 0x20007B6D; - aProperty.SetValue(protocolUidValue ); - } - if(aPropertyName == EPropertyBrandId) - { - _LIT(brand,"MyBrand"); - aProperty.SetValue(brand); - } - return KErrNone; - - } -TInt CSPSettings::FindServiceIdsL( RIdArray& aServiceIds ) - { - return KErrNone; - } -void CSPSettings::ConstructL() - { - } -TInt CSPSettings::SettingsCountL() - { - return 0; - } -TInt CSPSettings::AddOrUpdatePropertyL( TServiceId /*aServiceId*/, - const CSPProperty& /*aProperty*/ ) - { - return KErrNone; - } - - - - diff -r 2b7283837edb -r 3104fc151679 imstutils/loc/meco.loc --- a/imstutils/loc/meco.loc Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1613 +0,0 @@ -/* -* Copyright (c) 2008 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: Localisation file for Instant messenger application -* -*/ - - - -// LOCALISATION STRINGS - - - -// d: Command in Options Menu -// d: Starts login sequence -// l: list_single_pane_t1_cp2 -// -#define qtn_chat_main_om_login "Login" - -// d: Command in Options Menu -// d: Starts change connection -// l: list_single_pane_t1_cp2 -// -#define qtn_servtab_change_connection "Change connection" - -// d: Command in Options Menu -// d: Opens settings view -// l: list_single_pane_t1_cp2 -// r: 5.0 -#define qtn_chat_settings "Settings" - -// d: Command in Options Menu -// d: Opens the contact cards, -// l: list_single_pane_t1_cp2 -// -#define qtn_servtab_open "Open" - -// d: Command in Contact Options Sub Menu -// d: used for adding a service contact to the PhoneBook -// l: list_single_popup_submenu_pane_t1 -// -#define qtn_servtab_add_to_phonebook_new "Add to phonebook" - -// d: Command in Options Menu -// d: Command is used for create new contact -// l: list_single_pane_t1_cp2 -// -#define qtn_servtab_add_to_pb_new "Create new" - - -// d: Command in Options Menu -// d: Starts logout sequence -// l: list_single_pane_t1_cp2 -// -#define qtn_chat_main_om_logout "Log out" - - -// d: Login Item. -// l: list_double_large_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_login_list_item "Login" - - -// d: Connecting Item shown in the List -// l: list_double_large_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_logging_list_item "Connecting" - -// d: Item showed in the list during fetching of contacts. -// l: list_double_large_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_updating_list_item "Updating" - -// d: Item showed in the list when connecition is not available -// l: list_double_large_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_waiting_list_item "Waiting" - -// d: Item showed in the list when logout is ongoing -// l: list_double_large_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_loggingout_list_item "Disconnecting" - -//d:Text for tooltip in Toolbar for VOIP Call -//r:5.0 -//l:popup_preview_text_window_t1 -// -#define qtn_servtab_toolbar_voip "Internet call" - -//d:Text for tooltip in Toolbar for IM -//r:5.0 -//l:popup_preview_text_window_t1 -// -#define qtn_servtab_toolbar_im "Chat" - -//d:Text for tooltip in Toolbar for Contact Card -//r:5.0 -//l:popup_preview_text_window_t1 -// -#define qtn_servtab_toolbar_details "Contact card" - -//d:Text for tooltip in Toolbar for Add Contact functionality -//r:5.0 -//l:popup_preview_text_window_t1 -// -#define qtn_servtab_toolbar_newcontact "Add contact" - -// d: Middle softkey label -// d: Middle softkey label when Focus in Login item:. -// l: control_pane_t3/opt7 -// r: 5.0 -// -#define qtn_msk_login "Login" - -// d: Middle softkey label -// d: Middle softkey label when focus is on Connecting item -// l: control_pane_t3/opt7 -// r: 5.0 -// -#define qtn_msk_cancel "Cancel" - - -// d: Middle softkey label -// d: Middle softkey label when Focus in "Waiting connection" -item: -// l: control_pane_t3/opt7 -// r: 5.0 -// -#define qtn_msk_change_conn "Change" - -// d: Middle softkey label -// d: Middle softkey label when focus is on own data item in IM contacts view. -// l: control_pane_t3/opt7 -// r: 5.0 -// -#define qtn_msk_change_status "Change" - - -// d: Middle softkey label -// d: Middle softkey label when focus is on contact in IM contact view. -// l: control_pane_t3/opt7 -// r: 5.0 -// -#define qtn_msk_chat "Chat" - -// d: Middle softkey label -// d: Middle softkey label when focus is on contact in IM contact view. -// l: control_pane_t3/opt7 -// r: 5.0 -// -#define qtn_msk_add_contact "Add" - -// d: Middle softkey label -// d: Middle softkey label when focus is on contact in IM contact view. -// l: control_pane_t3/opt7 -// r: 5.0 -// -#define qtn_msk_new_search "New search" - - - -// d: Error note -// d: Shown when trying to add contact and server doesn't accept the user id. -// l: popup_note_window/opt2 -// r: 5.0 -#define qtn_chat_validating_contact_failed "User ID is incorrect" - -// d: Label for note -// d: Used when system failed to connect to service -// l: popup_note_window/opt2 -// -#define qtn_im_login_conerror_note "No connection to service. try again later" - -// d: Label for note -// d: Used when network server has signalled about wrong user id or password -// l: popup_note_window/opt2 -// -#define qtn_im_login_passer_note "Please check your username and password and try again." - -// d: Error note label. -// d: Used when server is temporarily out of service (maintenance, overload, etc.) -// l: popup_note_window/opt2 -// -#define qtn_im_error_serv_busy "Temporary Server error" - - -// d: Command in Options Menu -// d: cancels the login -// l: list_single_pane_t1_cp2 -// r: 5.0 -#define qtn_servtab_cancel_login "Cancel login" - -// d: Command in Options Menu -// d: Command is used for deleting the focused contact -// l: list_single_popup_submenu_pane_t1 -// -#define qtn_servtab_delete "Delete" - - -// d: Label for menu item in friends list view's Options menu -// d: Command is used to launch 4 Step Add Contact operation -// l: list_single_popup_submenu_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_add_from_phonebook "Add from phonebook" - -// d: Label for menu item in single list view's Options menu -// d: Command is used to launch search operation for a contact from server -// l: list_single_popup_submenu_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_search "Search" - -// d: Command in Options Menu -// d: Command opens contact editing view -// l: list_single_popup_submenu_pane_t1 -// -#define qtn_servtab_add_manually "Add manually" - -// d: Command in Options Menu -// d: Command name for opening "edit options" submenu -// l: list_single_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_servtab_contactoptions "Contact options" - - -// d: Command in Options Menu of own data item -// d: Command is used on own data for opening own options submenu - Change Message, Details, Edit -// l: list_single_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_chat_friend_own_options "Own options" - -// d: Label for sub menu item in single list view's Own options menu option -// d: Command is used change the online status message of own data item -// l: list_single_popup_submenu_pane_t1 -// w: -// r: 5.0 -// -#define qtn_chat_friend_change_message "Change message" - -// d: Command in SubOptions Menu -// d: Command name for contact options -// l: list_single_popup_submenu_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_contact_details "Details" - - -// d: Command in Options Menu -// d: Command is used to Open the editing view from the phonebook application -// l: list_single_pane_t1_cp2 -// -#define qtn_chat_friend_om_edit "Edit" - -// d: Command in Options Menu -// d: Command is used for opening the contact editor to edit focused contact -// l: list_single_popup_submenu_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_edit "Edit" - -// d: Confirmation query text -// d: Shown when user deletes a contact there is shown a confirmation query -// d: %U is replaced with the identification of the contact. user name can be 100 characters max -// l: popup_note_window/opt1 -// r: 5.0 -#define qtn_servtab_delete_contact "Delete %U from the service contact list?" - -// d: Label for wait note -// d: Used when deleting contact -// l: popup_note_wait_window -// -#define qtn_chat_deleting_contact "Deleting" - - -//---------------------------status message----------------------------------------------------- - -// d: Command in Options Menu -// d: Command name for changing own status -// l: list_single_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_chat_friend_change_status "Set my status" - -// d: Data query -// d: Title of data query -// l: popup_query_data_window_t3/opt2 -// w: -// r: 5.0 -// -#define qtn_chat_change_status_message "Status message" - -// d: List query with graphic -// d: Title of a list query -// l: heading_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_set_my_status "Set my status" - -// d: List query item -// d: Item online -// l: list_single_graphic_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_chat_change_own_online "Online" - -// d: List query item -// d: Item away -// l: list_single_graphic_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_chat_change_own_away "Away" - -// d: List query item -// d: Item Do not disturb -// l: list_single_graphic_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_servtab_change_own_dnd "Do not disturb" - -// d: List query item -// d: Item offline -// l: list_single_graphic_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_chat_change_own_appear_offline "Appear offline" - - -// d: Status is online in contact details viewer -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_chat_cd_status_online "Online" - -// d: Status is Offline in contact details viewer -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_chat_cd_status_offline "Offline" - -// d: Status is away in contact details viewer -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_chat_cd_status_away "Away" - -// d: Status is Do not disturb in contact details viewer -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_servtab_cd_status_dnd "Do not disturb" - -// d: Status is On the phone in contact details viewer -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_servtab_cd_status_onthephone "On the phone" - -// d: List query item -// d: Item busy -// l: list_single_pane_t1_cp2 -// r: 5.0 -// -#define qtn_im_change_own_busy "Busy" - -// d: Status is unknown in contact details viewer -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_chat_cd_status_unknown "Unknown" - -// d: Data query prompt for "Nick Name" -// l: popup_query_data_window -// -#define qtn_servtab_nick_name "Nick name" - -// d: Warning note prompt when memory runs out and application starts to delete messages -// l: popup_note_window -// w: -// r: 5.0 -#define qtn_chat_memory_low_warning "Memory low. old messages are deleted automatically to be able to receive new ones." - - -// d: List query -// d: Title for list query. -// l: heading_pane_t1 -// w: -// r: 5.0 -// -#define qtn_chat_change_select_message "Status message:" - -// d: List query item -// d: Item New status message -// l: list_single_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_chat_change_new_message "(new status message)" - -// d: Wait note label -// d: Note is displayed when own status is changing" -// l: popup_note_wait_window -// w: -// r: 5.0 -// -#define qtn_chat_change_status_changing "Changing own status" - -// d: Confirmation note label. -// d: Note is displayed when own status change was successfull -// l: popup_note_window -// w: -// r: 5.0 -// -#define qtn_chat_change_status_changed "Status changed" - -// d: Error note label. -// d: Note is displayed when own status change failed -// l: popup_note_window/opt2 -// w: -// r: 5.0 -// -#define qtn_chat_change_status_failed "Changing status failed" - -// d: Wait note label -// d: Note is displayed when own status is changing -// l: popup_note_wait_window -// w: -// r: 5.0 -// -#define qtn_chat_change_message_changing "Changing status message" - - -// d: Wait note label -// d: Note is displayed when contac is saved to the contact list and subscribed. -// l: popup_note_wait_window -// w: -// r: 5.0 -// -#define qtn_servtab_saving_contact "Saving contact" - -// d: Confirmation note label. -// d: Note is displayed when own status change was successfull -// l: popup_note_window -// w: -// r: 5.0 -// -#define qtn_chat_change_message_changed "Status message changed" - -// d: Error note label. -// d: Note is displayed when own status change failed -// l: popup_note_window/opt2 -// w: -// r: 5.0 -// -#define qtn_chat_change_message_failed "Changing status message failed" - - -// d: Friend request item text. -// d: %U is the identification of the requester. -// l: list_double_large_graphic_pane_t1 -// r: 5.0 -#define qtn_servtab_friend_request " Friend request " - -// d: Yes/no query for when focus is on New received friend request -// d: %U is the identification of the sender. max 100 characters -// l: popup_note_window/opt1 -// r: 5.0 -// -#define qtn_servtab_contact_request_conf "Add %U to your contact list and allow presence sharing" - -// d:Softkey label -// l:control_pane_t1/opt7 -// r:5.0 -#define qtn_servtab_sk_accept "Accept" - -// d:Softkey label -// l:control_pane_t1/opt7 -// r:5.0 -#define qtn_servtab_sk_decline "Decline" - - -// d: Confirmation query text -// d: Shown when user sends message to offline contact -// d: %U is replaced with the identification of the contact. max 100 characters -// l: popup_note_window/opt1 -// r: 5.0 -#define qtn_chat_contact_may_not_receive_message "%U is offline, and may not receive the message. continue?" - - -// d: Command in Options Menu -// d: Command is used for opening I-message view -// l: list_single_pane_t1_cp2 -// -#define qtn_servtab_open_conversation "Open conversation" - -// d: Command in contact Options sub Menu -// d: -// l: list_single_popup_submenu_pane_t1 -// -#define qtn_servtab_add_to_phonebook_update "Link to phonebook" - -// d: Command in contact Options sub Menu -// d: -// l: list_single_popup_submenu_pane_t1 -// -#define qtn_servtab_block_presence "Block" - -// d: Command in contact Options sub Menu -// d: -// l: list_single_popup_submenu_pane_t1 -// -#define qtn_servtab_unblock_presence "Unblock" - -//d:Text for tooltip in Toolbar for Send Msg Opern -//r:5.0 -//l:popup_preview_text_window_t1 -// -#define qtn_servtab_toolbar_send "Send message" - -//d:Text for tooltip in Toolbar for Insert Smiley Opern -//r:5.0 -//l:popup_preview_text_window_t1 -// -#define qtn_servtab_toolbar_smiley "Insert smiley" - - -// d: Data query prompt for "Enter search string" -// l: popup_query_data_window -// -#define qtn_chat_search_data_prtx "Search criteria:" - -// d: Wait note label -// d: Note is displayed while searching -// d: %U is the entered search criteria. -// l: popup_note_wait_window -// w: -// r: 5.0 -// -#define qtn_servtab_searching "Searching contact %U" - -// d: List query with graphic -// d: Title of a search results -// l: title_pane_t2/opt9 -// w: -// r: 5.0 -// -#define qtn_servtab_search_results "Search results" - -// d: Label for Primary Text in Empty Search View -// w: -// l: main_pane_empty_t1/opt2 -// r: 5.0 -// -#define qtn_chat_empty_search_primary "No results found" - -// d: Text for empty search view -// l: main_list_empty_pane/opt2 -// r: 5.0 -// w: -// -#define qtn_chat_empty_search "Select new search from options to make a new search " - -// d: Command in Options Menu -// d: Command name for "New search" -// l: list_single_pane_t1_cp2 -// -#define qtn_chat_search_om_new "New search" - -// d: Command in Options Menu -// d: Command name for "Get more results" -// l: list_single_pane_t1_cp2 -// -#define qtn_chat_search_om_more "Get more results" - -// d: Command in Options Menu -// d: Command name for "Previous results" -// l: list_single_pane_t1_cp2 -// -#define qtn_chat_search_om_prev "Previous results" - -// d: Middle softkey label -// d: Middle softkey label when focus is on an item which is not present in contact list -// l: control_pane_t3/opt7 -// -#define qtn_msk_add_contacts "Add" - -// d: Command in Options Menu of Search Results View -// l: list_single_pane_t1_cp2 -// r: 5.0 -// -#define qtn_servtab_add_to_contacts "Add to contacts" - -// d: Command in Options Menu -// d: Command Opens the contact editing view from the phonebook application, -// l: list_single_pane_t1_cp2 -// -#define qtn_servtab_new_contact "New contact" - -// d: Error note label. -// d: Used when user tries to start functionality that is not supported by the network server -// l: popup_note_window/opt2 -// -#define qtn_chat_error_not_sup_functions "Selected function is not supported by the service provider" - -// d: Confirmation query text -// d: Shown when user tries to perform an action which requires network connection in -// d: offline state, there is shown a confirmation query -// l: popup_note_window/opt1 -// r: 5.0 -#define qtn_servtab_connection_needed "Connection needed. connect now?" - -// d: Error note label. -// d: Note is displayed when saving contact is failed -// l: popup_note_window/opt2 -// w: -// r: 5.0 -// -#define qtn_servtab_saving_contact_failed "Saving contact failed" - - -// d: This is inserted when user comes to online -// l: msg_body_pane/opt -#define qtn_servtab_status_change_online "%U changed his status to Online" - -// d: This is inserted when user goes to "Offline" -// l: msg_body_pane/opt -#define qtn_servtab_status_change_offline "%U changed his status to Offline" - -// d: This is inserted when user goes to "Away" -// l: msg_body_pane/opt -#define qtn_servtab_status_change_away "%U changed his status to Away" - -// d: This is inserted when user goes to "On the phone" -// l: msg_body_pane/opt -#define qtn_servtab_status_change_onthephone "%U changed his status to On the phone" - -// d: This is inserted when user goes to "Do not disturb" -// l: msg_body_pane/opt -#define qtn_servtab_status_change_dnd "%U changed his status to Do not disturb" - -// d: Information note label -// d: %0U will be replaced by string that contains user name -// d: %1U will be replaced by string that contains the message -// l: popup_preview_text_window/opt2 -// -#define qtn_chat_message_preview "%0U: %1U" - - -// d: Data query prompt for "Enter search string" -// l: popup_query_data_window_t3/opt2 -// -#define qtn_servtab_add_userid "Enter " - -// d: List query item -// d: Item select username -// l: list_single_graphic_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_servtab_add_contact_select_username "Select " - -// d: Label for info note -// d: Used when the contact list on server is full -// l: popup_note_window/opt2 -// -#define qtn_chat_contact_list_full "List is full. cannot add more contacts." - - - -// d: Error note -// d: Shown when the entered Nick name has too many or too less characters than -// d: server accepts, or includes characters that server doesn't support, there -// d: is shown an error notewhen trying to add contact and server doesn't accept the user id. -// l: popup_note_window/opt2 -// r: 5.0 -#define qtn_servtab_invalid_nick "Invalid nick name" - -// d: Label for info note -// d: Used when server changed the nick name user had entered -// l: popup_note_window/opt2 -// -#define qtn_chat_server_altered_nick "Server altered the nick name." - -// d: Label for confirmation note -// d: Shown when user tries to use a nick name which already exists in contact list -// l: popup_note_window/opt1 -// r: 5.0 -#define qtn_chat_same_nick_name "Nick name already in use. enter new nick name?" - -// d: Confirmation query for authorization recipient -// d: Recipient can add the sender to contacts list -// l: popup_note_window/opt1 -// r: 3.0 -// w: -// -#define qtn_chat_reactive_add_list "Add %U to IM contacts?" - -// d: Command in Options Menu -// d: Command name for "Send" -// l: list_single_pane_t1_cp2 -// r: 5.0 -#define qtn_im_ibox_om_send "Send" - - -// d: Command in Options Menu -// d: Command is used for showing smiley selecting popup -// l: list_single_pane_t1_cp2 -// -#define qtn_chat_conv_insert_smiley "Insert smiley" - - -// d: Text for smiley icon selection grid -// l: heading_pane_t1 -// -#define qtn_chat_conv_smiley "Select smiley:" - - - -// d:Softkey label, when scrolling of messages is stopped -// l:control_pane_t1/opt7 -// r:5.0 -#define qtn_chat_sk_write "Write" - - -// d: This is inserted at the beginning of failed message in message list pane -// l: msg_body_pane/opt -#define qtn_conview_failed "Failed: %U" - - -// d: Command in Options Menu -// d: Command for closing conversation -// l: list_single_pane_t1_cp2 -// -#define qtn_servtab_close_conversation "Close conversation" - - -// d: Error note label. -// d: Used when user has sent a message that can't be delivered to recipient -// l: popup_note_window/opt2 -// -#define qtn_chat_error_not_reach "Cannot reach %U" - - - -// d: Error note label. -// d: Used when server responds that it does not support the version that client tries to use -// l: popup_note_window/opt2 -// -#define qtn_chat_error_gen_error "Server error" - -// d: Error note label. -// d: Used when server responds that it does not support the version that client tries to use -// l: popup_note_window/opt2 -// -#define qtn_chat_error_disconnect_error "Service disconnected" - - -// d: This is the date message that is shown in message pane when the new -// d: message is from another date than the previous one. -// d: %U is the date of the new message in format qtn_date_usual_with_zero -// l: popup_info_list_pane_t1 -// r: 5.0 -// -#define qtn_chat_message_list_date "Date: %U" - -// d: Confirmation query text -// d: %U is replaced by string containing user name -// l: popup_note_window/opt1 -// -#define qtn_chat_cquery_close_conv "End conversation with %U?" - -// d: Error note label. -// d: Used when network server does not support the requested operation. -// l: popup_note_window/opt2 -// -#define qtn_chat_error_service_err "Service not available temporarily" - -// d: presence do not disturb status message. -// d: Used when server responds that it does not support the version that client tries to use -// l: control_pane_t1/opt7 -// -#define qtn_servtab_basic_search "Basic" - -// d: presence do not disturb status message. -// d: Used when server responds that it does not support the version that client tries to use -// l: control_pane_t1/opt7 -// -#define qtn_servtab_advanced_search "Advanced" - - -// d: qtn_servtab_search_firstname -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_firstname "First name" - - -// d: qtn_servtab_search_lastname -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_lastname "Last name" - - -// d: qtn_servtab_search_nickname -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_nickname "Nick name" - -// d: qtn_servtab_search_fullname -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_fullname "Full name" - - -// d: qtn_servtab_search_city -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_city "City" - -// d: qtn_servtab_search_state -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_state "State" - -// d: qtn_servtab_search_org -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_org "Organization" - -// d: qtn_servtab_search_orgunit. -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_orgunit "Organization unit" - - -// d: qtn_servtab_search_email -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_email "Email" - -// d: qtn_servtab_search_birthday -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_birthday "Birthday" - -// d: qtn_servtab_search_country -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_country "Country" - - -// d: qtn_servtab_search_user -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_user "User id" - - -// d: qtn_servtab_search_middlename -// d: Used when server responds that it does not support the version that client tries to use -// l: form_field_data_wide_pane_t1 -// -#define qtn_servtab_search_middlename "Middle name" - - -// d: qtn_servtab_search_basic -// d: Used when server responds that it does not support the version that client tries to use -// l: title_pane_t2/opt12 -// -#define qtn_servtab_search_title "Basic search" - - -// d: qtn_servtab_search_advanced -// d: Used when server responds that it does not support the version that client tries to use -// l: title_pane_t2/opt12 -// -#define qtn_servtab_search_adv_title "Advanced search" - -///////////////////////////////////////////////////////////////////////// -// Terms of Use -///////////////////////////////////////////////////////////////////////// - -// d: Title of Terms of use -dialog -// l: title_pane_t2/opt12 -// -#define qtn_servtab_tou_title "Terms of use" - -///////////////////////////////////////////////////////////////////////// -// url registration -///////////////////////////////////////////////////////////////////////// - -//d: LSK for URL registration popup -//l: control_pane_t1/opt7 -// -#define qtn_servtab_sk_register "Register" - -//d: RSK for URL registration popup -//l: control_pane_t1/opt7 -// -#define qtn_servtab_sk_ignnore "Ignore" - - -//d: Heading of the wap registration popup -//l: heading_pane_t1 -//r: 5.0 -#define qtn_servtab_title_url "Welcome" - -//d: Text to be shown when user is not registered with Ovi account on Nokia handset. -//l: popup_info_list_pane_t2/opt1 -//r: 5.0 -#define qtn_servtab_note_url "In order to use Messenger on your Nokia handset you need to have an Ovi account. If you do not have an account you may select Register to obtain one. Otherwise please chose Ignore." - -// d: Label for sub menu item in single list view's Own options menu option -// d: Command is used change the avatar of own data item -// l: list_single_popup_submenu_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_avatar_set "Set my avatar" - -// d: Label for sub menu item in single list view's Own options menu option -// d: Command is used to set default avatar for own data item -// l: list_single_popup_submenu_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_avatar_default "Reset to default" - -// d: Label for sub menu item in single list view's My Avatar submenu option -// d: Command is used to open the gallery to change the avatar -// l: list_single_popup_submenu_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_avatar_from_gallery "From photos" - -// d: Label for sub menu item in single list view's My Avatar submenu option -// d: Command is used to open the camera to change the avatar -// l: list_single_popup_submenu_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_avatar_new_photo "Take new photo" - -// d: Error note label. -// d: Note is displayed when user selects protected file for avatar. -// l: popup_note_window/opt2 -// w: -// r: 5.0 -// -#define qtn_servtab_gallery_error_drmfile "Unable to select.Image is protected." - -// d: Error note label. -// d: Note is displayed when user selects corrupted file for avatar. -// l: popup_note_window/opt2 -// w: -// r: 5.0 -// -#define qtn_servtab_gallery_error_badfile "Unable to select.Image is corrupted." - -// d: Error note label. -// d: Note is displayed when updating avatar is failed. -// l: popup_note_window/opt2 -// w: -// r: 5.0 -// -#define qtn_servtab_error_update_avatar "Changing avatar failed." - -// d: LSK label -// d: LSK label when user chooses from gallery. -// l: control_pane_t1/opt7 -// w: -// r: 5.0 -// -#define qtn_servtab_gallery_lsk_select "Select" - -// d: Title -// d: Title for gallery window when user opens for avatar. -// l: heading_pane_t1/opt2 -// w: -// r: 5.0 -// -#define qtn_servtab_gallery_title_avatar "Select avatar" - -// d: Wait note label -// d: Note is displayed when avatar is changing" -// l: popup_note_wait_window -// w: -// r: 5.0 -// -#define qtn_servtab_change_avatar_changing "Changing avatar" - -// d: Confirmation note label. -// d: Note is displayed when avatar change was successfull -// l: popup_note_window -// w: -// r: 5.0 -// -#define qtn_servtab_change_avatar_changed "Avatar changed" - -//d:Information note shown when there is already a login operation -//d:ongoing to certain server and user tries start another login operation. -//d:%U is the server name to where the login is already going on. -//l:popup_note_window/opt2 -// -#define qtn_chat_login_ongoing_note "Login to %U is ongoing." - - -// d: Connection to server query text -// d: here %u refers to the name of the service. example gizmo or ovi -// d: in case of voip %u is the name of the voip service -// l: popup_note_window/opt1 -// -#define qtn_chat_connection_needed_to "Connection needed. connect %U?" - -// d: poplist item -// d: stirng for i have an account -// l: list_single_graphic_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_servtab_query_register_new "Register new account" - -// d: poplist item -// d: stirng for Create new -// l: list_single_graphic_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_servtab_query_create_new "Create new" - -// d: Title -// d: Title for popup query -// l: heading_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_acc_creation_title "Select:" - -// d: poplist item -// d: stirng for i have an account -// l: list_single_graphic_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_servtab_query_use_existing "I have an account" - -// d: poplist item -// d: stirng for i have an account -// l: list_single_graphic_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_servtab_query_update_existing "Update existing" - -// d: multiline query dialog -// d: lable for multiline dialog -// l: popup_query_data_window_t3/opt2 -// w: -// r: 5.0 -// -#define qtn_servtab_add_password "Password:" - -// d: default status text for online status -// l: list_double_large_graphic_pane_t2 -// r:5.0 -// -#define qtn_servtab_default_statustext_online "Online" - -// d: default status text for offline status -// l: list_double_large_graphic_pane_t2 -// r:5.0 -// -#define qtn_servtab_default_statustext_offline "Offline" - -// d: default status text for invisible status -// l: list_double_large_graphic_pane_t2 -// r:5.0 -// -#define qtn_servtab_default_statustext_invisible "Invisible" - -// d: default status text for Do not disturb status -// l: list_double_large_graphic_pane_t2 -// r:5.0 -// -#define qtn_servtab_default_statustext_dnd "Do not disturb" - -// d: default status text for away status -// l: list_double_large_graphic_pane_t2 -// r:5.0 -// -#define qtn_servtab_default_statustext_away "Away" - -// d: default status text for blocked status -// l: list_double_large_graphic_pane_t2 -// r:5.0 -// -#define qtn_servtab_default_statustext_blocked "Blocked" - - -// d: Login Item. ( single style listbox ) -// l: list_single_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_single_line_login_list_item "Login" - -// d: Login Item with username. ( single style listbox ) -// d: %U is the username -// l: list_single_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_single_line_login_list_item_with_username "Login(%U)" - -// d: Connecting Item shown in the List ( single style listbox ) -// l: list_single_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_single_line_logging_list_item "Connecting" - -// d: Item showed in the list during fetching of contacts. ( single style listbox ) -// l: list_single_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_single_line_updating_list_item "Updating contacts" - -// d: Item showed in the list when connecition is not available ( single style listbox ) -// l: list_single_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_single_line_waiting_list_item "Waiting connection" - -// d: Item showed in the list when logout is ongoing ( single style listbox ) -// l: list_single_graphic_pane_t1 -// r:5.0 -// -#define qtn_servtab_single_line_loggingout_list_item "Disconnecting" -/** -* new qtn strings for service detail view -*/ - -// d: default Status text in details view -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_servdetail_statustext_online "Online" - - -// d: default Status text in details view -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_servdetail_statustext_offline "Offline" - -// d: default Status text in details view -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_servdetail_statustext_away "Away" - -// d: default Status text in details view -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_servdetail_statustext_dnd "Do not disturb" - -// d: default Status text in details view -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_servdetail_statustext_onthephone "On the phone" - -// d: default Status text in details view -// l: list_double_pane_t2 -// r: 5.0 -// -#define qtn_servdetail_statustext_busy "Busy" - -// d: default Status text in details view -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_servdetail_statustext_unknown "Unknown" - - -// d: qtn_servdetail_opt_copydetail -// d:Copy number command in details view options menu -// l:list_single_pane_t1_cp2 -// r:5.0 -// -#define qtn_servdetail_opt_copydetail "Copy detail" - -// d: qtn_servdetail_opt_delete -// d:Copy number command in details view options menu -// l:list_single_pane_t1_cp2 -// r:5.0 -// -#define qtn_servdetail_opt_delete "Delete" - -// d: qtn_servdetail_opt_edit -// d:Copy number command in details view options menu -// l:list_single_pane_t1_cp2 -// r:5.0 -// -#define qtn_servdetail_opt_edit "Edit" - -// d: qtn_servdetail_lbl_firstname -// d:details field list label -// l:form_field_data_wide_pane_t1 -// r:5.0 -// -#define qtn_servdetail_lbl_firstname "First Name" - -// d: qtn_servdetail_lbl_lastname -// d:details field list label -// l:form_field_data_wide_pane_t1 -// r:5.0 -// -#define qtn_servdetail_lbl_lastname "Last Name" - -// d: qtn_servdetail_lbl_statusmessage -// d:details field list label -// l:form_field_data_wide_pane_t1 -// r:5.0 -// -#define qtn_servdetail_lbl_statusmessage "Status Message" - -// d: qtn_servdetail_lbl_email -// d:details field list label -// l:form_field_data_wide_pane_t1 -// r:5.0 -// -#define qtn_servdetail_lbl_email "Email" - - -// d: qtn_servdetail_lbl_userid -// d:details field list label -// l:form_field_data_wide_pane_t1 -// r:5.0 -// -#define qtn_servdetail_lbl_userid "User Id" - -// d: qtn_servdetail_lbl_middlename -// d: details field list label -// l: form_field_data_wide_pane_t1 -// r:5.0 -// -#define qtn_servdetail_lbl_middlename "Middle Name" - -// d: qtn_servdetail_lbl_organisation -// d:details field list label -// l:form_field_data_wide_pane_t1 -// r:5.0 - -#define qtn_servdetail_lbl_organisation "Organisation" - -// d: qtn_servdetail_lbl_country -// d:details field list label -// l:form_field_data_wide_pane_t1 -// r:5.0 -// -#define qtn_servdetail_lbl_country "Country" - -// d: qtn_servdetail_lbl_nickname -// d:details field list label -// l:form_field_data_wide_pane_t1 -// r:5.0 -// -#define qtn_servdetail_lbl_nickname "Nick Name" - -//d: qtn_servdetail_backgroundtext -//l: main_pane_empty_t1/opt2 -//r: 5.0 -#define qtn_servdetail_backgroundtext_header "Contact not listed for this service." - - -// d: Error note -// d: Shown when adding a contact that already exists -// l: popup_note_window/opt2 -// r: 5.0 -#define qtn_sertab_contact_already_exists_error_note "Contact already exists" - -// d: Wait note label -// d: Note is displayed while Blocking -// d: %U is the contact to be blocked. -// l: popup_note_wait_window -// w: -// r: 5.0 -// -#define qtn_servtab_blocking "Blocking %U" - -// d: Wait note label -// d: Note is displayed while Blocking -// d: %U is the contact to be blocked. -// l: popup_note_wait_window -// w: -// r: 5.0 -// -#define qtn_chat_unblocking "Unblocking %U" - -// d: Error note label. -// d: Note is displayed when blocking is unsuccessfull. -// l: popup_note_window/opt2 -// w: -// r: 5.0 -// -#define qtn_chat_blocking_failed "Blocking contact failed" - -// d: Error note label. -// d: Note is displayed when unblocking is unsuccessfull. -// l: popup_note_window/opt2 -// w: -// r: 5.0 -// -#define qtn_chat_unblocking_failed "UnBlocking contact failed" - -// d: Status is invitation sent for the remote pending contact -// l: list_double_pane_t2 -// r: 5.0 -#define qtn_servtab_invitationsent "Invitation sent" - - -// d: unnamed title for a contact -// d: used as when first name is empty for a contact -// l: list_double_large_graphic_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_unnamed "(unnamed)" - - -// d: Command in Options Menu -// l: list_single_pane_t1_cp2 -// w: -// r: 5.0 -// -#define qtn_servtab_option_blockedlist "Blocked list" - -// d: Title -// l: heading_pane_t1 -// w: -// r: 5.0 -// -#define qtn_servtab_title_blockedlist "Blocked list" - -// d: Label for Primary Text in Empty block View -// w: -// l: main_pane_empty_t1/opt2 -// r: 5.0 -// -#define qtn_servtab_blocklist_bkgd "No blocked contacts" - - -//d:Summary title for general XMPP settings. -//l:msg_body_pane_t1 -//r:MeCo Rel5.0 -// -#define qtn_ipcomm_msg_title "Instant Messaging Settings" - -//d:Summary text for general XMPP settings. -//l:msg_body_pane/opt -//r:MeCO Rel5.0 -// -#define qtn_ipcomm_msg_text "New Service" - -// d: Label for Primary Text in block View while fetching list -// w: -// l: main_pane_empty_t1/opt2 -// r: 5.0 -// -#define qtn_servtab_blocklist_bkgdto "Updating blocked list" - -// d: Label for waiting note for declining invitation -// w: -// l: main_pane_empty_t1/opt2 -// r: 5.0 -// -#define qtn_servtab_declining_invite "Declining invitation" - -// d: Note for Adding a blocked contact. -// w: -// l: main_pane_empty_t1/opt2 -// r: 5.0 -// -#define qtn_servtab_add_friend_blocked "Already on blocked list" - -// d: Note for Adding a own data item. -// w: -// l: popup_note_window/opt2 -// r: 5.0 -// -#define qtn_servtab_error_addown "Own userID cannot be added as friend" - -// d: Note for truncating long received message. -// w: -// l: msg_body_pane/opt -// r: 5.0 -// - -#define qtn_conview_truncated "[Long message truncated]" - -/** -* new qtn strings for meco service widget -*/ -// WIDGET related qtn strings - -// d: Item showed in the meco service widget -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_login "Login" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_connecting "Connecting" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_loggingout "Disconnecting" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_updating "Updating" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_waiting "Waiting" - -// d: Item showed in the meco service widget. -// d: %u referes to maximum of 50 characters -// l: cell_ai5_widget_pane_t10/opt13 -// r:5.0 -// -#define qtn_servtab_widget_friend "%U :" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// d: %N min. 0 and max 3 digits in both the cases -// r:5.0 -// -#define qtn_servtab_widget_onlinestatus "Online:(%0N/%1N)" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_onependreq "1 Request" - -// d: Item showed in the meco service widget. -// d: %N referes to max length of integer -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_pendreq "%N Request" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_onenewmsg "1 new msg." - -// d: Item showed in the meco service widget. -// d: %N referes to max length of integer -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_newmsgs "%N new msgs." - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t10/opt13 -// r:5.0 -// -#define qtn_servtab_widget_invite "Request" - -// d: Item showed in the meco service widget. -// d: to be clarified -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_status "Status: %U" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_online "Online" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_offline "Offline" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_invisible "Invisible" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_away "Away" - -// d: Item showed in the list during fetching of contacts. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_busy "Busy" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_dnd "Do not disturb" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_onthephone "On the phone" - -// d: Item showed in the meco service widget. -// l: cell_ai5_widget_pane_t1/opt13 -// r:5.0 -// -#define qtn_servtab_widget_available "You are online" - - -// d: Singular content label for stylus activated popup. -// d: Popup is shown when user taps the IM indicator. -// l: list_single_touch_info_pane_t1 -// -#define qtn_servtab_unipane_onenewmsg "1 new message" - -// d: Plural content label for stylus activated popup. -// d: Popup is shown when user taps the IM indicator. -// d: %N is number of unread messages. max length of integer. -// l: list_single_touch_info_pane_t1 -// -#define qtn_servtab_unipane_newmsgs "%N new messages" - -// l: list_double_large_graphic_pane_t1 -//d: Displayed when the identity of the requester is unknown. -// r: 5.0 -#define qtn_servtab_unknown_buddy "Unknown" - -// d: Friend request item text. -// d: %U is the identification of the requester. -// l: list_double_large_graphic_pane_t1 -// r: 5.0 -#define qtn_servtab_add_as_friend "Add as friend" - -// d: default status text for callforward status -// l: list_double_large_graphic_pane_t2 -// r:5.0 -// -#define qtn_servtab_default_statustext_callforward "Call forward" - -// d: Item showed in HomeScreen's add content menu for meco service widget description -// l: listrow_wgtman_pane_t2 -// r: MCL -// -#define qtn_servtab_widget_servdesc "My online service" - -// d: Text shown when service tab is not usable after uninstall -// l: main_list_empty_pane/opt2 -// r: MCL -#define qtn_servtab_swupdate_restart "Please restart phone to use %U service" - -// d: Item showed when there is no XSP id present for the service contact in Uiservicetab -// d: Popup is shown when there is no XSP id -// l: popup_note_window/opt2 -// r: MCL -// -#define qtn_servtab_noxsp_error "Contact has no communication address. Add details to the contact." - - -//end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/data/0416013D.rss --- a/imstutils/xmppadapter/data/0416013D.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2006-2006 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: ECOM DLL interface & implementation description resource for - AlwaysOnAdapter OMA Provisioning adapter -* -*/ - - -// INCLUDES -#include - -// RESOURCE DEFINITIONS -// ----------------------------------------------------------------------------- -// -// theInfo -// ECOM DLL interface & implementation description resource. -// -// ----------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = 0x0A6A4E92; - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x101F84D5; // KProvisioningAdapterInterface; value taken from \s60\mw\devicecontentservices\omaprovisioning\Provisioning\Group - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0x0A6A4E93;//0x1020729E; - version_no = 1; - // Use short name to save RAM and ROM space - display_name = "MECO IM PA"; - default_data = ""; - opaque_data = "10"; // Adapter priority - } - }; - } - }; - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/data/wpgeneralxmppsettingsadapter.rss --- a/imstutils/xmppadapter/data/wpgeneralxmppsettingsadapter.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ - /* -* Copyright (c) 2005-2007 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: resource file -* -*/ - -// NAME ?resource_name -// RESOURCE IDENTIFIER -NAME XADA // 4 letter ID , im service details - -#include -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -// RSS_SIGNATURE -// --------------------------------------------------------------------------- -// -RESOURCE RSS_SIGNATURE { } - -STRUCT STRING{ -LTEXT text; -} - -// Rich text labels -RESOURCE STRING r_qtn_ipcomm_msg_text - { - text = qtn_ipcomm_msg_text; - } - -RESOURCE STRING r_qtn_ipcomm_msg_title - { - text = qtn_ipcomm_msg_title; - } - -// End of file. - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/group/bld.inf --- a/imstutils/xmppadapter/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2008 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: bld.inf file for Meco/XMPP settings adapter. -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -#ifdef FF_MECO_XMPP -../rom/xmppadapter.iby CORE_APP_LAYER_IBY_EXPORT_PATH(xmppadapter.iby) -../rom/xmppadapterresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(xmppadapterresources.iby) - -// ROM SIS stubs -//../sis/xmppadapterstub.sis /epoc32/data/Z/System/Install/xmppadapterstub.sis -#endif - -PRJ_MMPFILES -xmppadapter.mmp diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/group/xmppadapter.mmp --- a/imstutils/xmppadapter/group/xmppadapter.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2008 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: Project definition file for Meco/XMPP settings adapter. -* -*/ - - -#include -#include - -TARGET xmppadapter.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x0A6A4E92 - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -VERSION 10.0 - -SOURCEPATH ../src -SOURCE xmppadapter.cpp -SOURCE xmppadaptergroupproxy.cpp -SOURCE xmppadapterlogger.cpp - -SOURCEPATH ../data - -START RESOURCE 0416013D.rss -TARGET xmppadapter.rsc -TARGETPATH ECOM_RESOURCE_DIR -END - -START RESOURCE wpgeneralxmppsettingsadapter.rss -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - - -USERINCLUDE . -USERINCLUDE ../inc -USERINCLUDE ../../group -USERINCLUDE ../../imconnectionprovider/inc - -APP_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE /epoc32/include/ecom - -LIBRARY euser.lib -LIBRARY provisioningengine.lib -LIBRARY commonengine.lib -LIBRARY bafl.lib -LIBRARY efsrv.lib -LIBRARY cone.lib - -LIBRARY flogger.lib - -LIBRARY serviceprovidersettings.lib -LIBRARY jabbersettings.lib -LIBRARY servicehandler.lib -LIBRARY vimpstsettings.lib // application settings library - -//end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/inc/xmppadapter.h --- a/imstutils/xmppadapter/inc/xmppadapter.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,314 +0,0 @@ -/* -* Copyright (c) 2008-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: Handles Meco IM settings in OMA provisioning. -* -*/ - - -#ifndef C_XMPPADAPTER_H -#define C_XMPPADAPTER_H - -// INCLUDES -#include -#include -class CCoeEnv; - - -// CLASS DECLARATION - -/** - * CXMPPAdapter handles XMPP conifurations. - * The processes configurations are stored inside VENDORCONFIG element. - * - * @lib xmppadapter.lib - * @since S60 v5.0 - */ -class CXMPPAdapter : public CWPAdapter - { - - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aStorage Storage instance - * @param aObserver contact data container observer - * - */ - - static CXMPPAdapter* NewL(); - - /** - * Destructor - */ - virtual ~CXMPPAdapter(); - - public: // Functions from base classes - /** - * Reads resource corresponding to the aId - * - * @return Resource buffer - */ - - HBufC* ReadResourceL( TInt aId ); - - /** - * From CWPAdapter. - * Checks the number of settings items. - * - * @return Quantity of items (always one). - */ - TInt ItemCount() const; - - /** - * From CWPAdapter. - * Getter for the summary title of general IM settings item. Text is - * shown to the user in an opened configuration message. - * - * @param aIndex Not used. - * @return Summary title. - */ - const TDesC16& SummaryTitle( TInt aIndex ) const; - - - /** - * From CWPAdapter. - * Getter for the summary text of general IM settings. Text is shown - * to the user in opened configuration message. - * - * @param aIndex Not used. - * @return Summary text. - */ - const TDesC16& SummaryText( TInt aIndex ) const; - - /** - * From CWPAdapter. - * Query for detailed information about the general IM settings. - * This is not supported feature as in other adapters in the framework. - * - * @param aItem Not used but here because of inheritance. - * @param aVisitor Object for retrieveing details of a setting entry. - * @return KErrNotSupported if not supported. - */ - TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); - - /** - * From CWPAdapter. - * Saves general IM settings. - * - * @param aIndex Not used. - */ - void SaveL( TInt aItem ); - - /** - * From CWPAdapter. - * Returns EFalse since there can only be one set of general VoIP - * settings. - * - * @param aItem Location of the general IM settings item to - * be queried. Not used. - * @return Information whether these settings can be set as default. - */ - TBool CanSetAsDefault( TInt aItem ) const; - - /** - * From CWPAdapter. - * Adapter sets the settings as default. Not supported. - * - * @param aItem Location of the general IM settings item to be - * set as default. - */ - void SetAsDefaultL( TInt aItem ); - - /** - * From CWPAdapter. - * Visit method. Visits the adapter. Adapter checks from - * aCharacteristic if the data is targetet to it and acts according to - * that. - * - * @param aCharacteristic The characteristic found. - */ - void VisitL( CWPCharacteristic& aCharacteristic ); - - /** - * From CWPAdapter. - * Visit method. Visits the adapter. Method sets the iAppId value. - * - * @param aParameter The parameter found. - */ - void VisitL( CWPParameter& aParameter ); - - /** - * From CWPAdapter. - * Visit method. Not supported. - * - * @param aLink Link to the characteristic. - */ - void VisitLinkL( CWPCharacteristic& /*aLink*/ ); - - private: // Default constructors - - /** - * C++ default constructor. - */ - CXMPPAdapter(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // New functions - - /** - * Creates the settings from the received provisioning - */ - void CreateSettingsRecordL(); - - /** - * Updates the existing settings - */ - void UpdateServiceSettingsL(); - - /** - * Parses integer form Descriptor - * - * @param aPtr to be parsed. - * @param aInt parsed integer value is stored.. - */ - void ParseIntegerL( const TDesC& aPtr, TInt& aInt ); - /** - * writes the application specific settings into cenrep - * - * e.g. cancel login support : This writes if cancel lgin not supported. - */ - void WriteAppSettingsL(); - - /** - * This will check for the IM subservice in sp settings table - * if any service in spsettings is having IM Subservice - * this will return Etrue else it will return EFalse - * @Return - ETrue - if IM Subservice Exists else EFalse - **/ - TBool CheckforXmppserviceL(); - - private: // Data - /** - * user name for the current characteristic. - * Owned - */ - HBufC* iUserName; - /** - * password for the current characteristic. - * Owned - */ - HBufC* iPassword; - - /** - * user name the current characteristic. - * Owned - */ - HBufC* iProviderId; - - /** - * settingsrecordid for the current characteristic. - * Owned - */ - TUint32 iSettingsRecordId; - - /** - * service id for the current characteristic. - */ - TInt iServiceProviderId; - - /** - * Application ID of the current characteristic. - * Owned - */ - HBufC* iAppId; - - /** - * pointer to Application ID of the current characteristic. - */ - TPtrC iAppIdPtr; - - /** - * xmppserveraddress of the current characteristic. - * Owned - */ - HBufC* iXmppServerAddress; - /** - * protocol id of the current characteristic. - * Owned - */ - HBufC* iProtocol; - /** - * Sanp id of the current characteristic. - */ - TInt iSnapId; - - /** - * ssl of the current characteristic. - */ - TInt iSSL; - - /** - * port number of the current characteristic. - */ - TInt iPortNbr; - - /** - * Domain name the current characteristic. - * Owned - */ - HBufC* iDomainName; - - /** - * BranId for the service specific icons. - */ - HBufC* iBrandId; - - /** - * Reference Name. - */ - HBufC* iAppref; - - /** - * Default text - */ - HBufC* iDefaultName; - - /** - * Title - */ - HBufC* iTitle; - /** - * Confirms whether APPID is correct (w9033). - */ - TBool iIsAppIdOk; - - /* - * the user viewable name of general XMPP settings. - */ - HBufC* iAppName; - - /* - * Resource file to read - */ - RResourceFile iResFile; - - }; - -#endif // C_XMPPADAPTER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/inc/xmppadapterlogger.h --- a/imstutils/xmppadapter/inc/xmppadapterlogger.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* 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: XMPP Logger implementation -* -*/ - - -#ifndef XMPPADAPTERLOGGER_H -#define XMPPADAPTERLOGGER_H - -// INCLUDES -#include - -//#ifdef _DEBUG -#ifdef __WINS__ - #ifdef _DEBUG - #define ENABLE_DEBUG_LOGS // for WINS UDEB - #endif -#else - #ifdef _DEBUG - #define ENABLE_DEBUG_LOGS // for device UDEB - #endif -#endif - -/** -* Usage of Log MACRO'S -* _LIT( KExample, "Example" ); -* TXT(s) _L(s) -* LOGGER(TXT("Some text.") ); -* LOGGER(TXT("Some text: %d"), 100 ); -* LOGGER(TXT("Some text: %S"), &KExample ); -*/ - -_LIT( KTAdaptDebugOutputDir, "xa" ); -_LIT( KTAdaptDebugOutputFileName, "xa.txt" ); -const TInt KTAdaptMaxLogLineLength = 250 ; -//#ifdef _DEBUG - -#define TXT(s) _L(s) -#define LOGGER TLogger::WriteLog -#define PLUGIN_UNUSED_PARAM(p) (void) p -//#endif - -/** - * OSS Protocol Adaptation logger. - */ -class TLogger - { - public: //Logging functions - static void WriteLog( TRefByValue aFmt,... ); - private: //Prohibited construtor / destructor - TLogger(); - ~TLogger(); - }; -#endif //XMPPADAPTERLOGGER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/rom/xmppadapter.iby --- a/imstutils/xmppadapter/rom/xmppadapter.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: xmppadapter IBY file. -* -*/ - - - -#ifndef __XMPPADAPTER_IBY__ -#define __XMPPADAPTER_IBY__ - -//Xmppadapter -ECOM_PLUGIN( xmppadapter.dll, xmppadapter.rsc) - -data=DATAZ_\private\10202be9\1020E334.txt private\10202BE9\1020E334.txt //xmpp -data=DATAZ_\private\10202be9\200195A9.txt private\10202BE9\200195A9.txt //Key store adap - -// stub SIS, provides support for SIS upgrading -data=DATAZ_\system\install\xmppadapterstub.sis system\install\xmppadapterstub.sis - -#endif //__XMPPADAPTER_IBY__ - - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/rom/xmppadapterresources.iby --- a/imstutils/xmppadapter/rom/xmppadapterresources.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: xmppadapter IBY file. -* -*/ - - -#ifndef __XMPPADAPTERRESOURCES_IBY__ -#define __XMPPADAPTERRESOURCES_IBY__ - -#include - -data=DATAZ_\RESOURCE_FILES_DIR\wpgeneralxmppsettingsadapter.rsc RESOURCE_FILES_DIR\wpgeneralxmppsettingsadapter.rsc - -#endif //__XMPPADAPTERRESOURCES_IBY__ - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/sis/adapter.SISX Binary file imstutils/xmppadapter/sis/adapter.SISX has changed diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/sis/adapter.pkg --- a/imstutils/xmppadapter/sis/adapter.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -; -; 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: pkg file for xmpp adapter -; - -; xmppadaptor.pkg -; -;Languages -:"Nokia Corporation" -%{"Vendor-EN"} -&EN -;Header -#{"ProvMecoSettings"}, (0x0A6A4E92), 1, 0, 1, TYPE=SA,RU -(0x101F6F88), 0, 0, 0, {"Series60ProductID"} - -; xmpp adapter DLLs -"\EPOC32\RELEASE\ARMV5\UREL\xmppadapter.dll" -"!:\sys\bin\xmppadapter.dll" -"\EPOC32\DATA\Z\Resource\Plugins\xmppadapter.rsc" -"!:\Resource\Plugins\xmppadapter.rsc" -"\EPOC32\DATA\Z\Resource\wpgeneralxmppsettingsadapter.rsc" -"!:\Resource\wpgeneralxmppsettingsadapter.rsc" - - -; end of file diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/sis/adapter.sis Binary file imstutils/xmppadapter/sis/adapter.sis has changed diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/sis/createsisx.bat --- a/imstutils/xmppadapter/sis/createsisx.bat Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -rem -rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -rem All rights reserved. -rem This component and the accompanying materials are made available -rem under the terms of "Eclipse Public License v1.0" -rem which accompanies this distribution, and is available -rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -rem -rem Initial Contributors: -rem Nokia Corporation - initial contribution. -rem -rem Contributors: -rem -rem Description: bat file for xmppadapter -rem - -makesis adapter.pkg -signsis adapter.SIS adapter.SISX rd.cer rd-key.pem diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/sis/rd-key.pem --- a/imstutils/xmppadapter/sis/rd-key.pem Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXAIBAAKBgQDLRF+r1FGGkCwTrb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW4 -6Y+LWaA8HMlDdoHRB0FgASisYcFagwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh -7W7Dt9F5FZij8F7/9Pi6+FhhxZFIf1DD+yry9D7+Sp+BgdNALe4XOpf25QIBAwKB -gQCHgupyjYuvCsgNHn7PNtnvVxInrB5MQNoPli+O+uNJWUK/Q+57Rl+yO8AoEzDX -pFaLWiuVVhsdloDnAgabT/FXzYncs6uOHyEUV+dSXb78vtLPJqAX+Fg2i3hOXreB -yskcZ13/OsKVOu5wgrJkx2baZufkqMwOSytf5y9nwjEIKwJBAP+inobagVNrN62j -KQva3cC+UN/6XnKdTc0CA6bHyLOaJoH1xiMwG/VS2PGjHI0tiSMNtLn/QPpHJ003 -iabGhdUCQQDLjp/9UjFT6K6CF66Chqf30pZXhx+GTSQZmv/gvZiMly7X9fX9BGX3 -2MbJohBC4yI21XKTbisWywkF73Hwh+TRAkEAqmxprzxWN5zPyRdwspHpKymLP/w+ -9xOJM1atGdqFzRFvAU6EF3Vn+OHl9my9s3OwwgkjJqorUYTE3iUGby8D4wJBAIe0 -aqjhdjfwdFa6dFcEb/qMZDpaFQQzbWZnVUB+ZbMPdI/5TqitmU/l2dvBYCyXbCSO -TGJJcg8yBgP09qBamIsCQFL7j1tM0XPVQJQ89WpKCld7O9ORxRGVj1eG0tWijrH8 -mGbYh8SGCVoWV3vrKSS8GBrFVgQnqUaHuEdtM7tpCAQ= ------END RSA PRIVATE KEY----- diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/sis/rd.cer --- a/imstutils/xmppadapter/sis/rd.cer Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ ------BEGIN CERTIFICATE----- -MIICzDCCAjWgAwIBAgIBADANBgkqhkiG9w0BAQUFADArMRAwDgYDVQQKEwdSRCBD -ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZTAeFw0wNDExMTUxMjQyMDZaFw0z -NzA5MjMxMjQyMDZaMCsxEDAOBgNVBAoTB1JEIENlcnQxFzAVBgNVBAMTDlJEIENl -cnRpZmljYXRlMIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDLRF+r1FGGkCwT -rb420kbnAps7gi1yYUcXYUdWeFTuBeQe5eW46Y+LWaA8HMlDdoHRB0FgASisYcFa -gwno9+oFf4AJka4H1gWEs5XTGwAA1s0d8XGh7W7Dt9F5FZij8F7/9Pi6+FhhxZFI -f1DD+yry9D7+Sp+BgdNALe4XOpf25QIBA6OCAQAwgf0wDAYDVR0TBAUwAwEB/zAL -BgNVHQ8EBAMCAoQwHQYDVR0OBBYEFFi/kuGzxhVpjGxe9ZwlxC3fH9jFMFMGA1Ud -IwRMMEqAFFi/kuGzxhVpjGxe9ZwlxC3fH9jFoS+kLTArMRAwDgYDVQQKEwdSRCBD -ZXJ0MRcwFQYDVQQDEw5SRCBDZXJ0aWZpY2F0ZYIBADBsBgNVHSAEZTBjMGEGBFUd -IAAwWTATBggrBgEFBQcCARYHaHR0cDovLzBCBggrBgEFBQcCAjA2GjRGb3IgUiZE -IHVzYWdlIG9ubHkuIFRoaXMgY2VydGlmaWNhdGUgaXMgbm90IHRydXN0ZWQuMA0G -CSqGSIb3DQEBBQUAA4GBAHGB4RQMAgBdeT2hxfOr6f2nA/dZm+M5yX5daUtZnET9 -Ed0A9sazLawfN2G1KFQT9kxEParAyoAkpbMAsRrnRz/9cM3OHgFm/NiKRnf50DpT -7oCx0I/65mVD2kt+xXE62/Ii5KPnTufIkPi2uLvURCia1tTS8JmJ8dtxDGyQt8BR ------END CERTIFICATE----- diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/src/xmppadapter.cpp --- a/imstutils/xmppadapter/src/xmppadapter.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,847 +0,0 @@ -/* -* Copyright (c) 2008 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: Handles XMPPAdapter settings in OMA provisioning. -* -*/ - - -// INCLUDE FILES -#include -#include -#include -#include -#include - -#include "imconnectionprovideruids.hrh" - -#include "WPAdapterUtil.h" -#include "xmppadapter.h" - -#include "xmppservicesettingsapi.h" -#include "xmppparams.h" - -#include -#include -#include -#include -#include // application specific settings writer - -#include "xmppadapterlogger.h" -#include -#include -#include -#include -#include -#include // Adapter utils -#include -// CONSTANTS -_LIT( KMecoImAppID, "wXMPP" ); -//_LIT( KXMPPProtocol, "APROTOCOL" ); -//_LIT( KXMPPServerAddr, "AADDR" ); -_LIT(KSsl,"SSL"); -_LIT(KPortNbr, "APORTNBR"); -_LIT(KBrandId, "BRANDID"); -const TInt KGranularity = 4; - -_LIT( KResorcePathFolder, "\\resource\\"); -_LIT( KResorcePathFile, "WPGeneralXMPPSettingsAdapter.rsc"); - - -// ======== LOCAL FUNCTIONS ======== - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::CXMPPAdapter -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CXMPPAdapter::CXMPPAdapter() : iIsAppIdOk(EFalse) - { - LOGGER ( TXT ( "CXMPPAdapter::CXMPPAdapter() Start" ) ); - LOGGER ( TXT ( "CXMPPAdapter::CXMPPAdapter() Start" ) ); - - } - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CXMPPAdapter::ConstructL() - { - LOGGER ( TXT ( "CXMPPAdapter::ConstructL() Start" ) ); - iSnapId = 11; - iAppref = NULL; - iAppName = NULL; - RFs fs; - - TFileName resFilePath; - resFilePath.Zero(); - resFilePath.Append( KResorcePathFolder() ); - resFilePath.Append( KResorcePathFile() ); - - LOGGER ( TXT ( "CXMPPAdapter::ConstructL() End1" ) ); - TFileName path; - Dll::FileName( path ); - - User::LeaveIfError( fs.Connect() ); - - TDriveName drive( TParsePtrC( path ).Drive() ); - - HBufC* resourceFilePath = HBufC::NewLC( KMaxFileName ); - TPtr ptr( resourceFilePath->Des() ); - - - ptr.Append( resFilePath ); - ptr.Insert( 0, drive ); - - path.Zero(); - path.Append( *resourceFilePath ); - - - BaflUtils::NearestLanguageFile( fs, path ); - iResFile.OpenL( fs, path ); - //To decide on whether default name is needed or not - iDefaultName = ReadResourceL( R_QTN_IPCOMM_MSG_TEXT ); - iTitle = ReadResourceL( R_QTN_IPCOMM_MSG_TITLE ); - - CleanupStack::PopAndDestroy(); //resourceFilePath - iResFile.Close(); - - LOGGER ( TXT ( "CXMPPAdapter::ConstructL() End" ) ); - - - fs.Close(); - } - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CXMPPAdapter* CXMPPAdapter::NewL() - { - LOGGER ( TXT ( "CXMPPAdapter::NewL() Start" ) ); - CXMPPAdapter* self = new( ELeave ) CXMPPAdapter; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - LOGGER ( TXT ( "CXMPPAdapter::NewL() End" ) ); - return self; - } - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::~CXMPPAdapter -// Destructor -// ----------------------------------------------------------------------------- -// -CXMPPAdapter::~CXMPPAdapter() - { - LOGGER ( TXT ( "CXMPPAdapter::~CXMPPAdapter Start" ) ); - delete iUserName; - delete iPassword; - delete iProviderId; - delete iXmppServerAddress; - delete iProtocol; - delete iAppId; - delete iDomainName; - delete iBrandId; - delete iAppref; - - if ( iAppName ) - delete iAppName; - - delete iDefaultName; - delete iTitle; - LOGGER ( TXT ( "CXMPPAdapter::~CXMPPAdapter End" ) ); - } -// ----------------------------------------------------------------------------- -// CXMPPAdapter::ReadResourceLC Reads the resource without having to use a CCoeEnv -// ----------------------------------------------------------------------------- -// -HBufC* CXMPPAdapter::ReadResourceL( TInt aId ) - { - LOGGER ( TXT ( "CXMPPAdapter::ReadResourceL() " ) ); - iResFile.ConfirmSignatureL( aId ); - HBufC8* readBuffer = iResFile.AllocReadLC( aId ); - TResourceReader theReader; - theReader.SetBuffer( readBuffer ); - TPtrC textData = theReader.ReadTPtrC(); - - HBufC* textBuffer = HBufC::NewL( textData.Length() ); - *textBuffer = textData; - - CleanupStack::PopAndDestroy( readBuffer ); - LOGGER ( TXT ( "CXMPPAdapter::ReadResourceL() " ) ); - return textBuffer; - - } -// ----------------------------------------------------------------------------- -// CXMPPAdapter::ItemCount -// ----------------------------------------------------------------------------- -// -TInt CXMPPAdapter::ItemCount() const - { - LOGGER ( TXT ( "CXMPPAdapter::ItemCount() " ) ); - // SummaryTitle(), SummaryText(), SaveL(), SetAsDefaultL() and - // CanSetAsDefault() are called ItemCount() times - return (iUserName && iPassword && iProviderId && iXmppServerAddress && iDomainName && iProtocol) ? 1 : 0; - } - - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::DetailsL -// ----------------------------------------------------------------------------- -// -TInt CXMPPAdapter::DetailsL( TInt /*aItem*/, MWPPairVisitor& /*aVisitor*/ ) - { - LOGGER ( TXT ( "CXMPPAdapter::DetailsL() " ) ); - // Detail view is a feature for later release. - return KErrNotSupported; - } - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::SaveL -// ----------------------------------------------------------------------------- -// -void CXMPPAdapter::SaveL( TInt /*aItem*/ ) - { - LOGGER ( TXT ( "CXMPPAdapter::CanSetAsDefault() Start" ) ); - - __ASSERT_DEBUG( (iUserName && iPassword && iProviderId && iXmppServerAddress && iDomainName && iProtocol), User::Leave( KErrCorrupt ) ); - - CreateSettingsRecordL(); - LOGGER ( TXT ( "CXMPPAdapter::CanSetAsDefault() End" ) ); - } - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::CanSetAsDefault -// ----------------------------------------------------------------------------- -// -TBool CXMPPAdapter::CanSetAsDefault( TInt /*aItem*/ ) const - { - LOGGER ( TXT ( "CXMPPAdapter::CanSetAsDefault() t" ) ); - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::SetAsDefault -// ----------------------------------------------------------------------------- -// -void CXMPPAdapter::SetAsDefaultL( TInt /*aItem*/ ) - { - LOGGER ( TXT ( "CXMPPAdapter::SetAsDefaultL () Start" ) ); - // This shouldn't be called because CanSetAsDefault - // always returns EFalse. - LOGGER ( TXT ( "CXMPPAdapter::SetAsDefaultL() End" ) ); - } - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::VisitL -// ----------------------------------------------------------------------------- -// -void CXMPPAdapter::VisitL( CWPCharacteristic& aCharacteristic ) - { - LOGGER ( TXT ( "CXMPPAdapter::VisitL( CWPCharacteristic& aCharacteristic ) Start" ) ); - switch( aCharacteristic.Type() ) - { - case KWPApplication: - { - - aCharacteristic.AcceptL( *this ); - iIsAppIdOk = ETrue; - break; - } - case KWPResource: - { - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - aCharacteristic.AcceptL( *this ); - } - break; - } - case KWPAppAddr: - { - - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - aCharacteristic.AcceptL( *this ); - } - break; - } - default: - { - break; - } - } - LOGGER ( TXT ( "CXMPPAdapter::VisitL( CWPCharacteristic& aCharacteristic ) End" ) ); - } - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::VisitL -// -// Used to parse, the following always-on related provisioning settings -// -// -// -// -// -// -// -// ----------------------------------------------------------------------------- -// -void CXMPPAdapter::VisitL( CWPParameter& aParameter ) - { - LOGGER ( TXT ( "CXMPPAdapter::VisitL( CWPParameter& aParameter ) Start" ) ); - switch( aParameter.ID() ) - { - case EWPNamedParameter: - { - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - if(aParameter.Name().Compare(KSsl) == 0) - { - ParseIntegerL(aParameter.Value(),iSSL); - } - if(aParameter.Name().Compare(KPortNbr) == 0) - { - ParseIntegerL(aParameter.Value(),iPortNbr); - } - if(aParameter.Name().Compare(KBrandId) == 0) - { - if (iBrandId) - { - delete iBrandId; - iBrandId = NULL; - } - iBrandId = aParameter.Value().AllocL(); - } - } - break; - } - case EWPParameterName: - { - if ( iAppName ) - { - delete iAppName; - iAppName = NULL; - } - iAppName = aParameter.Value().AllocL(); - break; - } - - case EWPParameterAppID: - { - if (iAppId) - { - delete iAppId; - iAppId = NULL; - } - iAppId = aParameter.Value().AllocL(); - iAppIdPtr.Set(iAppId->Des()); - break; - } - - case EWPParameterAProtocol: - { - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - if (iProtocol) - { - delete iProtocol; - iProtocol = NULL; - } - iProtocol = aParameter.Value().AllocL(); - } - break; - } - case EWPParameterAddr: - { - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - if (iXmppServerAddress) - { - delete iXmppServerAddress; - iXmppServerAddress = NULL; - } - iXmppServerAddress = aParameter.Value().AllocL(); - } - break; - } - case EWPParameterAAuthName: - { - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - - if (iUserName) - { - delete iUserName; - iUserName = NULL; - } - iUserName = aParameter.Value().AllocL(); - } - break; - } - case EWPParameterAAuthSecret: - { - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - if (iPassword) - { - delete iPassword; - iPassword = NULL; - } - - iPassword = aParameter.Value().AllocL(); - } - break; - } - - case EWPParameterProviderID: - { - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - if (iProviderId) - { - delete iProviderId; - iProviderId = NULL; - } - - iProviderId = aParameter.Value().AllocL(); - } - break; - } - case EWPParameterDomain : - { - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - if (iDomainName) - { - delete iDomainName; - iDomainName = NULL; - } - - iDomainName = aParameter.Value().AllocL(); - } - break; - } - case EWPParameterAppRef: - { - if ( 0 == iAppIdPtr.Compare( KMecoImAppID() ) ) - { - if (iAppref) - { - delete iAppref; - iAppref = NULL; - } - iAppref= aParameter.Value().AllocL(); - } - break; - } - default: - break; - } - LOGGER ( TXT ( "CXMPPAdapter::VisitL( CWPParameter& aParameter ) End" ) ); - } - - -// --------------------------------------------------------------------------- -// From class CWPAdapter. -// CWPGeneralVoIPSettingsAdapter::SummaryTitle -// Returns the summary title of general XMPP settings item. -// --------------------------------------------------------------------------- -// -const TDesC16& CXMPPAdapter::SummaryTitle( - TInt /*aIndex*/ ) const - { - LOGGER ( TXT ( "CXMPPAdapter::SummaryText() " ) ); - if ( iIsAppIdOk ) - { - LOGGER ( TXT ( "returning CXMPPAdapter::SummaryText() " ) ); - //LOGGER ( TXT ( "CXMPPAdapter::ConstructL() Title in SummaryText is %s" ), *iTitle ); - return *iTitle; - } - return KNullDesC16; - } - -// --------------------------------------------------------------------------- -// CWPGeneralVoIPSettingsAdapter::SummaryText -// From class CWPAdapter. -// Returns the summary text of general XMPP settings. -// --------------------------------------------------------------------------- -// -const TDesC16& CXMPPAdapter::SummaryText( - TInt /*aIndex*/ ) const - { - LOGGER ( TXT ( "CXMPPAdapter::SummaryText() " ) ); - if ( iIsAppIdOk ) - { - LOGGER ( TXT ( " returnign CXMPPAdapter::SummaryText() " ) ); - if ( NULL == iAppName ) - { - return *iDefaultName; - } - return *iAppName; - } - LOGGER ( TXT ( "CXMPPAdapter::SummaryText() " ) ); - return KNullDesC16; - } - - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::VisitLinkL -// ----------------------------------------------------------------------------- -// -void CXMPPAdapter::VisitLinkL( CWPCharacteristic& /*aCharacteristic*/ ) - { - LOGGER ( TXT ( "CXMPPAdapter::VisitLinkL() " ) ); - } - -// ----------------------------------------------------------------------------- -// CXMPPAdapter::ParseIntegerL -// ----------------------------------------------------------------------------- -// -void CXMPPAdapter::ParseIntegerL( const TDesC& aPtr, TInt& aInt ) - { - LOGGER ( TXT ( "CXMPPAdapter::ParseIntegerL " ) ); - TLex lex( aPtr ); - User::LeaveIfError( lex.Val( aInt ) ); - } -// ----------------------------------------------------------------------------- -// CXMPPAdapter::CheckforXmppserviceL -// This function will check for the IM Subservice in sp settings table -// if it exists in any of the service it will return ETrue else it will return EFalse -// ----------------------------------------------------------------------------- -// -TBool CXMPPAdapter::CheckforXmppserviceL() - { - // get the existing services from sp settings table - CSPSettings* serviceSettings = CSPSettings::NewLC(); - RIdArray serviceIds; - User::LeaveIfError( serviceSettings->FindServiceIdsL( serviceIds ) ); - TBool xmppexists = EFalse; - TInt servicecount = serviceIds.Count(); - for ( TInt i( 0 ); i < servicecount; i++ ) - { - CSPProperty* property = CSPProperty::NewLC(); - TInt err = serviceSettings->FindPropertyL( serviceIds[ i ],EPropertyIMSubServicePluginId, - *property ); - CleanupStack::PopAndDestroy( property ); - if(!err) - { - xmppexists = ETrue; - break; // just to break the loop - } - } - CleanupStack::PopAndDestroy( serviceSettings ); - return xmppexists; - - } -//------------------------------------------------------------------------ -//CXMPPAdapter::::CreateSettingsRecordL() -//------------------------------------------------------------------------ -void CXMPPAdapter::CreateSettingsRecordL() - { - LOGGER ( TXT ( "CXMPPAdapter::CreateSettingsRecordL() Start" ) ); - CXmppSettingsApi* sapi = CXmppSettingsApi::NewLC(); - iSettingsRecordId=0; - TRAPD(err,sapi->DefaultSettingsRecordL(iSettingsRecordId)); - if( err == KErrNone && iSettingsRecordId > 0) - { - if(CheckforXmppserviceL()) - { - CleanupStack::PopAndDestroy( sapi ); - User::Leave(KErrNotSupported); - } - } - sapi->CreateSettingsRecordL( iSettingsRecordId ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamServerPort(),/*5223 443*/ iPortNbr); - - sapi->SetParamL( iSettingsRecordId, XmppParams::KXmppParamHttpsProxyServerPort(),8080 ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamSnapId(),5 ); - - sapi->SetParamL( iSettingsRecordId, XmppParams:: KXmppParamXmppServerAddress(), - *iXmppServerAddress ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamUsername(),*iUserName ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamPassword(),*iPassword ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamResource(), - _L("gtalk_resource") ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamHttpsProxyServerAddress(), - _L("172.16.42.135") ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamAlais(), _L("") ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamOldSSLRequired(),/*ETrue EFalse */ iSSL ); - sapi->SetParamL( iSettingsRecordId, XmppParams::KXmppParamRegisterRequired(),EFalse ); - - sapi->SetParamL( iSettingsRecordId, - XmppParams::KXmppParamConnMgrBus(), - _L("org.freedesktop.Telepathy.ConnectionManager.gabble" ) ); - - sapi->SetParamL( iSettingsRecordId, - XmppParams::KXmppParamConnMgrPath(), - _L("/org/freedesktop/Telepathy/ConnectionManager/gabble" ) ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamProtocol(),*iProtocol ); - - sapi->SetParamL( iSettingsRecordId, XmppParams::KXmppParamPresenceStatusFreeTextOnline(), - _L("") ); - - sapi->SetParamL( iSettingsRecordId, XmppParams::KXmppParamPresenceStatusFreeTextAway(), - _L("")); - - sapi->SetParamL( iSettingsRecordId, XmppParams::KXmppParamPresenceStatusFreeTextBusy(), - _L("")); - - sapi->SetParamL( iSettingsRecordId, XmppParams::KXmppParamPresenceStatusFreeTextOffline(), - _L("")); - - sapi->SetParamL( iSettingsRecordId, XmppParams::KXmppParamPresenceStatusFreeTextInvisible(), - _L("")); - - sapi->SetParamL( iSettingsRecordId, XmppParams::KXmppParamLastLoggedInUserName(), - _L("")); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamPresenceStatus(),0 ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamAutoAcceptBuddyReq(),EFalse ); - - sapi->SetParamL( iSettingsRecordId,XmppParams::KXmppParamDomain(),*iDomainName ); - UpdateServiceSettingsL(); - - WriteAppSettingsL(); - CleanupStack::PopAndDestroy( sapi ); - LOGGER ( TXT ( "CXMPPAdapter::CreateSettingsRecordL() End" ) ); - } - -// --------------------------------------------------------------------------- -//CXMPPAdapter::UpdateServiceSettingsL -// --------------------------------------------------------------------------- -// -void CXMPPAdapter::UpdateServiceSettingsL() - { - LOGGER ( TXT ( "CXMPPAdapter::UpdateServiceSettingsL() Start" ) ); - CSPSettings* serviceSettings = CSPSettings::NewLC(); - RIdArray serviceIds; - - User::LeaveIfError( serviceSettings->FindServiceIdsL( serviceIds ) ); - - - - if( serviceIds.Count() ) - { - CDesCArrayFlat* serviceNames = new( ELeave ) CDesCArrayFlat( KGranularity ); - CleanupStack::PushL( serviceNames ); - - User::LeaveIfError( serviceSettings->FindServiceNamesL( serviceIds, - *serviceNames) ); - - for ( TInt i=0; i < serviceNames->MdcaCount(); i++ ) - { - if ( ( serviceNames->MdcaPoint(i)).Compare( *iProviderId ) == 0 ) - { - - iServiceProviderId = serviceIds[i]; - break; - } - } - CleanupStack::PopAndDestroy( serviceNames ); - } - - if ( 0 >= iServiceProviderId ) - { - - CSPEntry* entry = CSPEntry::NewLC(); - entry->SetServiceName( *iProviderId ); - TInt entryRetvalue = serviceSettings->AddEntryL( *entry ); - User::LeaveIfError( entryRetvalue ); - iServiceProviderId = entry->GetServiceId(); - CleanupStack::PopAndDestroy( entry ); - } - - - // Add/Update properties - CSPProperty* property = CSPProperty::NewLC(); - - - property->SetName( ESubPropertyIMLaunchUid ); - property->SetValue( 0x200255D0 ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - property->SetName( EPropertyContactViewPluginId ); - property->SetValue( 0x20012423 ); // plugin view id - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - property->SetName( ESubPropertyIMSettingsId ); - property->SetValue( iSettingsRecordId ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - - property->SetName( EPropertyIMSubServicePluginId ); - property->SetValue( KIMConnectivityPluginImplUid ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - property->SetName( ESubPropertyIMPreferredIAPId ); - property->SetValue( iSnapId ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - - property->SetName( ESubPropertyIMPreferredSNAPId ); - property->SetValue( iSnapId ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - property->SetName( ESubPropertyIMEnabled ); - property->SetValue( EOff ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - RBuf brandId; - if( iBrandId ) - { - brandId.CreateL(*iBrandId ); - } - else - { - brandId.CreateL(KNullDesC); - } - CleanupClosePushL( brandId ); - property->SetName( EPropertyBrandId ); - property->SetValue( brandId ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - CleanupStack::PopAndDestroy( &brandId ); - - - property->SetName( EPropertyBrandLanguage ); - - // ELangInternationalEnglish is selected as Default Brand Language Id. - property->SetValue( ELangInternationalEnglish ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - RBuf contactDB; - TBuf <50> string; - // The store name should be service specific, and not hardcoded, hence we use iServiceProviderId to form uniqueness. - string.Format(_L("cntdb://c:vimpststore%d.cdb"), iServiceProviderId); - contactDB.CreateL (string); - CleanupClosePushL( contactDB ); - property->SetName( EPropertyContactStoreId ); - property->SetValue( contactDB ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - CleanupStack::PopAndDestroy( &contactDB ); - - /*PresenceSubservice*/ - property->SetName( ESubPropertyPresenceSettingsId ); - property->SetValue( iSettingsRecordId ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - - property->SetName( EPropertyPresenceSubServicePluginId ); - property->SetValue( KIMConnectivityPluginImplUid ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - property->SetName( ESubPropertyPresencePreferredIAPId ); - property->SetValue( iSnapId ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - - property->SetName( ESubPropertyPresencePreferredSNAPId ); - property->SetValue( iSnapId ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - property->SetName( ESubPropertyPresenceEnabled ); - property->SetValue( EOff ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - - - property->SetName( EPropertyPCSPluginId ); - property->SetValue( 0x101FB3E7 ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - property->SetName( ESubPropertyPresenceAddrScheme ); - property->SetValue( *iDomainName ); - - User::LeaveIfError( serviceSettings->AddOrUpdatePropertyL( iServiceProviderId, - *property ) ); - - //End of Presence Subservice - - CleanupStack::PopAndDestroy( property ); - CleanupStack::PopAndDestroy( serviceSettings ); - LOGGER ( TXT ( "CXMPPAdapter::UpdateServiceSettingsL() End" ) ); - } - -// --------------------------------------------------------------------------- -//CXMPPAdapter::WriteAppSettingsL -// --------------------------------------------------------------------------- -// -void CXMPPAdapter::WriteAppSettingsL() - { - MVIMPSTSettingsStore* settingsStore = CVIMPSTSettingsStore::NewLC(); - // write cancel login not supported : since xmpp doesnot have the support - settingsStore->SetL( iServiceProviderId , EServiceCancelLoginNotSupported , 1 ); - // write change connection not supported : since xmpp doesnot have the support - settingsStore->SetL( iServiceProviderId , EServiceChangeConnectionNotSupported , 1 ); - CleanupStack::PopAndDestroy();//settingStore - } -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/src/xmppadaptergroupproxy.cpp --- a/imstutils/xmppadapter/src/xmppadaptergroupproxy.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2008 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: Handles XMPPAdapter settings in OMA provisioning. -* -*/ - - -// INCLUDE FILES -#include -#include - - -#include "xmppadapter.h" - -// CONSTANTS -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( 0x0A6A4E93, CXMPPAdapter::NewL ) - }; - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// ImplementationProxy -// ECOM implementation table entry. -// ----------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/src/xmppadapterlogger.cpp --- a/imstutils/xmppadapter/src/xmppadapterlogger.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* -* Copyright (c) 2008 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: XMPP Logger implementation -* -*/ - -// INCLUDE FILES - -#include -#include -#include - -#include "xmppadapterlogger.h" - - -/** - * Handler used by logger to truncate the string - * rather than panic in case of buffer overflow. -*/ - -NONSHARABLE_CLASS ( TAdaptOverflowTruncate ) : public TDes16Overflow - { - -public: - void Overflow ( TDes16& /*aDes*/ ) {} - }; - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// TLogger::WriteLog() -// ----------------------------------------------------------------------------- -// -void TLogger::WriteLog ( TRefByValue aFmt, ... ) - { -#ifdef ENABLE_DEBUG_LOGS - ( void ) aFmt;//Suppress unused formal parameter warning - TBuf< KTAdaptMaxLogLineLength > buffer; - buffer.Append ( _L ( "[" ) ); // CSI: 78 # - buffer.Append ( RThread().Name() ); - buffer.Append ( _L ( "] " ) ); // CSI: 78 # - TAdaptOverflowTruncate overflow; - VA_LIST list; - VA_START ( list, aFmt ); - buffer.AppendFormatList ( aFmt, list, &overflow ); - RFileLogger logger; - - if ( logger.Connect() == KErrNone ) - { - logger.SetDateAndTime ( ETrue, ETrue ); - logger.CreateLog ( KTAdaptDebugOutputDir, KTAdaptDebugOutputFileName, - EFileLoggingModeAppend ); - logger.Write ( buffer ); - logger.CloseLog(); - logger.Close(); - } - -#endif - - } - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/S60_Module_Test.xls Binary file imstutils/xmppadapter/tsrc/S60_Module_Test.xls has changed diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/bwins/tstxmppadapteru.def --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/bwins/tstxmppadapteru.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/conf/xmppadapter.cfg --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/conf/xmppadapter.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -[Define] - - -[Enddefine] - -[Test] -title 1. xmppadapter_new -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_new -delete XmppAdpObj -[Endtest] - -[Test] -title 2. xmppadapter_visit_kwpapplication -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_kwpapplication -delete XmppAdpObj -[Endtest] - -[Test] -title 3. xmppadapter_visit_EWPParameterAppID -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPParameterAppID -delete XmppAdpObj -[Endtest] - -[Test] -title 4. xmppadapter_visit_KWPResource -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_KWPResource -delete XmppAdpObj -[Endtest] - -[Test] -title 5. xmppadapter_visit_EWPParameterNonAppID -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPParameterNonAppID -delete XmppAdpObj -[Endtest] - -[Test] -title 6. xmppadapter_visit_EWPParameterAAuthName -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPParameterAAuthName -delete XmppAdpObj -[Endtest] - -[Test] -title 7. xmppadapter_visit_EWPParameterAAuthSecret -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPParameterAAuthSecret -delete XmppAdpObj -[Endtest] - -[Test] -title 8. xmppadapter_visit_EWPParameterName_Protocol -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPParameterName_Protocol -delete XmppAdpObj -[Endtest] - -[Test] -title 9. xmppadapter_visit_EWPParameterProviderID -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPParameterProviderID -delete XmppAdpObj -[Endtest] - -[Test] -title 10. xmppadapter_visit_EWPParameterName_Server -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPParameterName_Server -delete XmppAdpObj -[Endtest] - -[Test] -title 11. xmppadapter_visitLink -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visitLink -delete XmppAdpObj -[Endtest] - -[Test] -title 12. xmppadapter_SummaryText -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_SummaryText -delete XmppAdpObj -[Endtest] - -[Test] -title 13. xmppadapter_SummaryTitle -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_SummaryTitle -delete XmppAdpObj -[Endtest] - -[Test] -title 14. xmppadapter_Save -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_Save -delete XmppAdpObj -[Endtest] - -[Test] -title 15. xmppadapter_ItemCount -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_ItemCount -delete XmppAdpObj -[Endtest] - -[Test] -title 16. xmppadapter_ItemZeroCount -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_ItemZeroCount -delete XmppAdpObj -[Endtest] - -[Test] -title 17. xmppadapter_Details -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_Details -delete XmppAdpObj -[Endtest] - -[Test] -title 18. xmppadapter_visit_KWPAppAddr -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_KWPAppAddr -delete XmppAdpObj -[Endtest] - -[Test] -title 19.xmppadapter_visit_EWPNamedParameter_KSsl -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPNamedParameter_KSsl -delete XmppAdpObj -[Endtest] - -[Test] -title 20. xmppadapter_visit_EWPNamedParameter_KPortNbr -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPNamedParameter_KPortNbr -delete XmppAdpObj -[Endtest] - -[Test] -title 21. xmppadapter_visit_EWPParameterDomainL -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPParameterDomainL -delete XmppAdpObj -[Endtest] - -[Test] -title 22. xmppadapter_visit_EWPNamedParameter_KBrandIdL -create tstxmppadapter XmppAdpObj -XmppAdpObj xmppadapter_visit_EWPNamedParameter_KBrandIdL -delete XmppAdpObj -[Endtest] - - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/eabi/tstxmppadapteru.def --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/eabi/tstxmppadapteru.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/group/bld.inf --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2002 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: bld.inf -* -*/ - - - - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these -DEFAULT - -PRJ_TESTEXPORTS -// NOTE: If using ARS requirements all export operations should be done under this. -// 'abld test export' -../init/TestFramework.ini /epoc32/winscw/c/TestFramework/TestFramework.ini -../conf/xmppadapter.cfg /epoc32/winscw/c/TestFramework/xmppadapter.cfg -PRJ_EXPORTS -//../init/TestFramework.ini /epoc32/winscw/c/TestFramework/TestFramework.ini -//../conf/xmppadapter.cfg /epoc32/winscw/c/TestFramework/xmppadapter.cfg -// Specify the source file followed by its destination here -// copy will be used to copy the source file to its destination -// If there's no destination then the source file will be copied -// to the same name in /epoc32/include -// Example: - - - -PRJ_TESTMMPFILES -// NOTE: If using ARS requirements .mmp file operation should be done under this. -// 'abld test build' -tstxmppadapter.mmp -PRJ_MMPFILES -// Specify the .mmp files required for building the important component -// releasables. -// -// Specify "tidy" if the component you need to build doesn't need to be -// released. Specify "ignore" if the MMP file exists but should be -// ignored. -// Example: - - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/group/tstxmppadapter.mmp --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/group/tstxmppadapter.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2008 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: tstxmppadapter.mmp -* -*/ - - -#include -#include - -TARGET tstxmppadapter.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E5 - -CAPABILITY ALL -TCB - - -//TARGETPATH ?target_path -//DEFFILE tstxmppadapter.def - -SOURCEPATH ../src -SOURCE tstxmppadapter.cpp -SOURCE tstxmppadapterblocks.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../../inc - -// its dependent upon other dll so need to hardcode once they fix we will also fix -USERINCLUDE /sf/mw/remotemgmt/omaprovisioning/provisioning/ProvisioningEngine/Inc - - - -APP_LAYER_SYSTEMINCLUDE -MW_LAYER_SYSTEMINCLUDE - - - - - - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY serviceprovidersettings.lib -LIBRARY jabbersettings.lib -LIBRARY ServiceHandler.lib -LIBRARY ProvisioningEngine.lib -LIBRARY CommonEngine.lib -LIBRARY bafl.lib -DEBUGLIBRARY flogger.lib -LIBRARY ecom.lib -LIBRARY apengine.lib - - - -LANG SC - -// End of File - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/group/xmppadapter_test.pkg --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/group/xmppadapter_test.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -; -; 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: tstxmppadapter.pkg -; -#{"Testxmppadapter"}, (0x101FB3E5), 0,0,0 - -;Language - standard language definitions -&EN - -;Vendor ID -:"Nokia Corporation" - -;Localised vendor -%{"Vendor-EN"} - -;Supports Series 60 v 0.9 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - -;rom will not allow to update it if name is testframework, after install need to rename it to testframework.ini - -;INI FILE -"..\init\TestFramework.ini" -"c:\Testframework\testframework.ini" - -;CFG FILES -"..\conf\xmppadapter.cfg" -"c:\Testframework\xmppadapter.cfg" - -;tstxmppadapter.dll - -"\EPOC32\RELEASE\ARMV5\UREL\tstxmppadapter.dll" -"!:\sys\bin\tstxmppadapter.dll" - diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/inc/tstxmppadapter.h --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/inc/tstxmppadapter.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* -* Copyright (c) 2002 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: tstxmppadapter.h -* -*/ - - - - -#ifndef TSTXMPPADAPTER_H -#define TSTXMPPADAPTER_H - -// INCLUDES -#include -#include -#include - - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def -// Logging path -_LIT( KtstXmppadapterLogPath, "\\logs\\testframework\\tstxmppadapter\\" ); -// Log file -_LIT( KtstxmppadapterLogFile, "tstxmppadapter.txt" ); - -// FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; -class CtstXmppAdapter; - -// DATA TYPES -//enum ?declaration -//typedef ?declaration -//extern ?data_type; - -// CLASS DECLARATION - -/** -* Ctstlm test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS(CtstXmppAdapter) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CtstXmppAdapter* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~CtstXmppAdapter(); - - public: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - - private: - - /** - * C++ default constructor. - */ - CtstXmppAdapter( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - /** - * Test methods are listed below. - */ - - /** - * Example test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - - virtual TInt xmppadapter_newL( CStifItemParser& aItem ); - - virtual TInt xmppadapter_visit_EWPParameterAppIDL(CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_kwpapplicationL(CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_KWPResourceL(CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_EWPParameterNonAppIDL(CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_EWPParameterAAuthNameL(CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_EWPParameterAAuthSecretL( CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_EWPParameterProviderIDL( CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_EWPParameterName_ProtocolL( CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_EWPParameterName_ServerL( CStifItemParser& aItem ); - virtual TInt xmppadapter_visitLinkL( CStifItemParser& aItem ); - virtual TInt xmppadapter_SummaryTextL( CStifItemParser& aItem ); - virtual TInt xmppadapter_SummaryTitleL( CStifItemParser& aItem ); - virtual TInt xmppadapter_SaveL( CStifItemParser& aItem ); - virtual TInt xmppadapter_ItemCountL( CStifItemParser& aItem ); - virtual TInt xmppadapter_ItemZeroCountL( CStifItemParser& aItem ); - virtual TInt xmppadapter_DetailsL( CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_KWPAppAddrL(CStifItemParser& aItem ); - virtual TInt xmppadapter_visit_EWPNamedParameter_KSslL(CStifItemParser& aItem); - virtual TInt xmppadapter_visit_EWPNamedParameter_KPortNbrL(CStifItemParser& aItem); - virtual TInt xmppadapter_visit_EWPNamedParameter_KBrandIdL(CStifItemParser& aItem); - virtual TInt xmppadapter_visit_EWPParameterDomainL(CStifItemParser& aItem ); - //virtual TInt xmppadapter_visit_withoutAppId_KWPResourceL( CStifItemParser& aItem ); - - - - - - private: // Data - TUid iEcomDtorID; - - // ?one_line_short_description_of_data - //?data_declaration; - - // Reserved pointer for future extension - //TAny* iReserved; - - }; - -#endif // TSTXMPPADAPTER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/init/TestFramework.ini --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/init/TestFramework.ini Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -# -# This is STIFTestFramework initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', - 'TestCases' or 'FullReport' - -CreateTestReport= YES # Possible values: YES or NO - -TestReportFilePath= C:\LOGS\TestFramework\ -TestReportFileName= TestReport - -TestReportFormat= TXT # Possible values: TXT or HTML -TestReportOutput= FILE # Possible values: FILE or RDEBUG -TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting - -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start - -[New_Module] -ModuleName= testscripter -TestCaseFile= C:\testframework\xmppadapter.cfg -[End_Module] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -[Logger_Defaults] - -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/src/tstxmppadapter.cpp --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/src/tstxmppadapter.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* Copyright (c) 2008 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: tstxmppadapter.cpp -* -*/ - - - - -// INCLUDE FILES -#include -#include "tstxmppadapter.h" -#include - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CtstXmppAdapter::CtstXmppAdapter -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CtstXmppAdapter::CtstXmppAdapter( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - - } - -// ----------------------------------------------------------------------------- -// CtstXmppAdapter::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CtstXmppAdapter::ConstructL() - { - iLog = CStifLogger::NewL( KtstXmppadapterLogPath, - KtstxmppadapterLogFile, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksMem ); - TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); - TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); - - - } - -// ----------------------------------------------------------------------------- -// CtstXmppAdapter::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CtstXmppAdapter* CtstXmppAdapter::NewL( - CTestModuleIf& aTestModuleIf ) - { - CtstXmppAdapter* self = new (ELeave) CtstXmppAdapter( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -CtstXmppAdapter::~CtstXmppAdapter() - { - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) CtstXmppAdapter::NewL( aTestModuleIf ); - - } - -// ----------------------------------------------------------------------------- -// E32Dll is a DLL entry point function. -// Returns: KErrNone -// ----------------------------------------------------------------------------- -// -#ifndef EKA2 // Hide Dll entry point to EKA2 -GLDEF_C TInt E32Dll( - TDllReason /*aReason*/) // Reason code - { - return(KErrNone); - - } -#endif // EKA2 - -// End of File diff -r 2b7283837edb -r 3104fc151679 imstutils/xmppadapter/tsrc/xmppadapter_test/src/tstxmppadapterblocks.cpp --- a/imstutils/xmppadapter/tsrc/xmppadapter_test/src/tstxmppadapterblocks.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,961 +0,0 @@ -/* -* Copyright (c) 2008 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: tstxmppadapterblocks.cpp -* -*/ - - - - -// INCLUDE FILES -#include -#include -#include -#include "tstxmppadapter.h" -#include "xmppadapter.h" -#include -#include -#include "WPElementFactory.h" -#include -#include - - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - - -//CONSTANTS -// Constants for setter methods. -_LIT8( KNameOK, "Test general IM settings" ); -_LIT8( KNameNotOK, "Test other settings" ); -_LIT( KMecoImAppID, "wXMPP" ); -_LIT( KMecoNotImAppID, "XMPP" ); -_LIT( KXMPPProtocol, "APROTOCOL" ); -_LIT( KXMPPServerAddr, "AADDR" ); -_LIT( KXMPPAuthName, "testui123@gmail.com" ); -_LIT( KXMPPAuthSecret, "testui_123" ); -_LIT( KXMPPDomain, "DOMAIN" ); -_LIT(KProviderID,"GTalk"); -_LIT(KProtocolvalue,"jabber"); -_LIT(KServer,"talk.google.com"); -_LIT(KDomain,"gmail.com"); -_LIT(KInteger,"121"); -_LIT(KSslvalue,"1"); -_LIT(KPortNbrvalue,"443"); -_LIT(KBrandIdvalue,"Gizmo"); - -_LIT(KSsl,"SSL"); -_LIT(KPortNbr, "APORTNBR"); -_LIT(KBrandId, "BRANDID"); - - - - - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CtstXmppAdapter::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void CtstXmppAdapter::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// CtstXmppAdapter::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::RunMethodL( - CStifItemParser& aItem ) - { - iLog->Log ( _L ( "In RunMethodL method" ) ); - - - //TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); - //TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); - - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - - ENTRY( "xmppadapter_new", CtstXmppAdapter::xmppadapter_newL ), - ENTRY( "xmppadapter_visit_kwpapplication", CtstXmppAdapter::xmppadapter_visit_kwpapplicationL ), - ENTRY( "xmppadapter_visit_EWPParameterAppID", CtstXmppAdapter::xmppadapter_visit_EWPParameterAppIDL ), - ENTRY( "xmppadapter_visit_KWPResource", CtstXmppAdapter::xmppadapter_visit_KWPResourceL ), - //ENTRY( "xmppadapter_visit_withoutAppId_KWPResource", CtstXmppAdapter::xmppadapter_visit_withoutAppId_KWPResourceL ), - - ENTRY( "xmppadapter_visit_EWPParameterNonAppID", CtstXmppAdapter::xmppadapter_visit_EWPParameterNonAppIDL ), - - ENTRY( "xmppadapter_visit_EWPParameterAAuthName", CtstXmppAdapter::xmppadapter_visit_EWPParameterAAuthNameL ), - ENTRY( "xmppadapter_visit_EWPParameterAAuthSecret", CtstXmppAdapter::xmppadapter_visit_EWPParameterAAuthSecretL ), - ENTRY( "xmppadapter_visit_EWPParameterName_Protocol", CtstXmppAdapter::xmppadapter_visit_EWPParameterName_ProtocolL ), - ENTRY( "xmppadapter_visit_EWPParameterProviderID", CtstXmppAdapter::xmppadapter_visit_EWPParameterProviderIDL ), - ENTRY( "xmppadapter_visit_EWPParameterName_Server", CtstXmppAdapter::xmppadapter_visit_EWPParameterName_ServerL ), - ENTRY( "xmppadapter_visitLink", CtstXmppAdapter::xmppadapter_visitLinkL ), - ENTRY( "xmppadapter_SummaryText", CtstXmppAdapter::xmppadapter_SummaryTextL ), - ENTRY( "xmppadapter_SummaryTitle", CtstXmppAdapter::xmppadapter_SummaryTitleL ), - ENTRY( "xmppadapter_Save", CtstXmppAdapter::xmppadapter_SaveL ), - ENTRY( "xmppadapter_ItemCount", CtstXmppAdapter::xmppadapter_ItemCountL ), - ENTRY( "xmppadapter_ItemZeroCount", CtstXmppAdapter::xmppadapter_ItemZeroCountL ), - ENTRY( "xmppadapter_Details", CtstXmppAdapter::xmppadapter_DetailsL ), - ENTRY( "xmppadapter_visit_KWPAppAddr", CtstXmppAdapter::xmppadapter_visit_KWPAppAddrL ), - ENTRY( "xmppadapter_visit_EWPNamedParameter_KSsl", CtstXmppAdapter::xmppadapter_visit_EWPNamedParameter_KSslL ), - ENTRY( "xmppadapter_visit_EWPNamedParameter_KPortNbr", CtstXmppAdapter::xmppadapter_visit_EWPNamedParameter_KPortNbrL ), - ENTRY( "xmppadapter_visit_EWPParameterDomainL", CtstXmppAdapter::xmppadapter_visit_EWPParameterDomainL ), - ENTRY( "xmppadapter_visit_EWPNamedParameter_KBrandIdL", CtstXmppAdapter::xmppadapter_visit_EWPNamedParameter_KBrandIdL ), - - - - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_newL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_newL( CStifItemParser& /*aItem */) - { - iLog->Log ( _L("In xmppadapter_newL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - if ( NULL == xmppadapter ) - { - iLog->Log ( _L( "xmppadapter_newL failed to allocate memory" ) ); - return KErrGeneral; - } - else - { - REComSession::DestroyedImplementation( iEcomDtorID ); - - iLog->Log ( _L( "xmppadapter_newL test case passed" ) ); - } - - return KErrNone; - } -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPParameterAppIDL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_kwpapplicationL(CStifItemParser& /*aItem*/ ) - { - - iLog->Log ( _L("xmppadapter_visit_kwpapplicationL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_kwpapplicationL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPCharacteristic* klf = - WPElementFactory::CreateCharacteristicLC( KWPApplication); - xmppadapter->VisitL(*klf); - iLog->Log ( _L( "xmppadapter_visit_kwpapplicationL test case passed" ) ); - CleanupStack::PopAndDestroy(klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPParameterAppIDL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPParameterAppIDL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPParameterAppIDL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPParameterAppIDL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - iLog->Log ( _L( "xmppadapter_visit_EWPParameterAppIDL test case passed" ) ); - CleanupStack::PopAndDestroy(klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_KWPResourceL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_KWPResourceL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_KWPResource" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_KWPResource test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPParameterAppID); - klf1->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf1); - - CWPCharacteristic* klf = - WPElementFactory::CreateCharacteristicLC( KWPResource); - xmppadapter->VisitL(*klf); - iLog->Log ( _L( "xmppadapter_visit_KWPResource test case Passed" ) ); - CleanupStack::PopAndDestroy(2,klf1); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -/* //---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_withoutAppId_KWPResourceL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_withoutAppId_KWPResourceL(CStifItemParser& /*aItem ) - { - iLog->Log ( _L("xmppadapter_visit_withoutAppId_KWPResourceL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_withoutAppId_KWPResourceL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPCharacteristic* klf = - WPElementFactory::CreateCharacteristicLC( KWPResource); - xmppadapter->VisitL(*klf); - iLog->Log ( _L( "xmppadapter_visit_withoutAppId_KWPResourceL test case Passed" ) ); - CleanupStack::PopAndDestroy(klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -*/ -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPParameterNonAppIDL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPParameterNonAppIDL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPParameterNonAppIDL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPParameterNonAppIDL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoNotImAppID); - xmppadapter->VisitL(*klf); - - iLog->Log ( _L( "xmppadapter_visit_EWPParameterNonAppIDL test case passed" ) ); - CleanupStack::PopAndDestroy(klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPParameterAAuthNameL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPParameterAAuthNameL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPParameterAAuthName" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPParameterAAuthName test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPParameterAAuthName); - klf1->SetValueL(KXMPPAuthName); - xmppadapter->VisitL(*klf1); - iLog->Log ( _L( "xmppadapter_visit_EWPParameterAAuthName test case passed" ) ); - CleanupStack::PopAndDestroy(2,klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPParameterAAuthSecretL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPParameterAAuthSecretL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPParameterAAuthSecret" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPParameterAAuthSecret test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPParameterAAuthSecret); - klf1->SetValueL(KXMPPAuthSecret); - xmppadapter->VisitL(*klf1); - iLog->Log ( _L( "xmppadapter_visit_EWPParameterAAuthSecret test case passed" ) ); - CleanupStack::PopAndDestroy(2,klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPParameterProviderIDL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPParameterProviderIDL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPParameterProviderID" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPParameterProviderID test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPParameterProviderID); - klf1->SetValueL(KProviderID); - xmppadapter->VisitL(*klf1); - iLog->Log ( _L( "xmppadapter_visit_EWPParameterProviderID test case passed" ) ); - CleanupStack::PopAndDestroy(2,klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPParameterName_ProtocolL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPParameterName_ProtocolL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPParameterProviderID" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPParameterName_ProtocolL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPParameterName); - klf1->SetNameL(KXMPPProtocol); - klf1->SetValueL(KProtocolvalue); - xmppadapter->VisitL(*klf1); - iLog->Log ( _L( "xmppadapter_visit_EWPParameterName_ProtocolL test case passed" ) ); - CleanupStack::PopAndDestroy(2,klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPParameterName_ServerL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPParameterName_ServerL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPParameterName_ServerL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPParameterName_ServerL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPParameterAddr); - klf1->SetNameL(KXMPPServerAddr); - klf1->SetValueL(KServer); - xmppadapter->VisitL(*klf1); - iLog->Log ( _L( "xmppadapter_visit_EWPParameterName_ServerL test case passed" ) ); - CleanupStack::PopAndDestroy(2,klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visitLinkL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visitLinkL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visitLinkL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visitLinkL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPCharacteristic* klf = - WPElementFactory::CreateCharacteristicLC( KWPResource); - xmppadapter->VisitLinkL(*klf); - iLog->Log ( _L( "xmppadapter_visitLinkL test case passed" ) ); - CleanupStack::PopAndDestroy(klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_SummaryTextL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_SummaryTextL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_SummaryText" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_SummaryText test case Failed" ) ); - return KErrGeneral; - } - else - { - if(xmppadapter->SummaryText(0).Compare(KNullDesC()) == 0) - { - iLog->Log ( _L( "xmppadapter_SummaryText test case passed" ) ); - } - else - { - REComSession::DestroyedImplementation( iEcomDtorID ); - iLog->Log ( _L( "xmppadapter_SummaryText test case Failed" ) ); - return KErrGeneral; - } - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_SummaryTitleL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_SummaryTitleL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_SummaryText" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_SummaryTitle test case Failed" ) ); - return KErrGeneral; - } - else - { - if(xmppadapter->SummaryTitle(0).Compare(KNullDesC()) == 0) - { - iLog->Log ( _L( "xmppadapter_SummaryTitle test case passed" ) ); - } - else - { - REComSession::DestroyedImplementation( iEcomDtorID ); - iLog->Log ( _L( "xmppadapter_SummaryTitle test case Failed" ) ); - return KErrGeneral; - } - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_SaveL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_SaveL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_SaveL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_SaveL test case Failed" ) ); - return KErrGeneral; - } - else - { - //1 appid - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPParameterAppID); - klf1->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf1); - - //2 user id - klf1->SetID(EWPParameterAAuthName); - klf1->SetValueL(KXMPPAuthName); - xmppadapter->VisitL(*klf1); - - //3 providerid - klf1->SetID(EWPParameterProviderID); - klf1->SetValueL(KProviderID); - xmppadapter->VisitL(*klf1); - - //4 password - klf1->SetID(EWPParameterAAuthSecret); - klf1->SetValueL(KXMPPAuthSecret); - xmppadapter->VisitL(*klf1); - - //5 parameter- protocol - klf1->SetID(EWPParameterAProtocol); - klf1->SetNameL(KXMPPProtocol); - klf1->SetValueL(KProtocolvalue); - xmppadapter->VisitL(*klf1); - - //6 parameter- serveraddress - klf1->SetID(EWPParameterAddr); - klf1->SetNameL(KXMPPServerAddr); - klf1->SetValueL(KServer); - xmppadapter->VisitL(*klf1); - - //7 parameter- ssl - klf1->SetID(EWPNamedParameter); - klf1->SetNameL(KSsl); - klf1->SetValueL(KSslvalue); - xmppadapter->VisitL(*klf1); - - //8 parameter- portnumber - klf1->SetID(EWPNamedParameter); - klf1->SetNameL(KPortNbr); - klf1->SetValueL(KPortNbrvalue); - xmppadapter->VisitL(*klf1); - - klf1->SetID(EWPParameterDomain); - klf1->SetNameL(KXMPPDomain); - klf1->SetValueL(KDomain); - xmppadapter->VisitL(*klf1); - - xmppadapter->SaveL(0); - iLog->Log ( _L( "xmppadapter_SaveL test case passed" ) ); - CleanupStack::PopAndDestroy(klf1); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_SaveL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_ItemCountL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_SaveL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_SaveL test case Failed" ) ); - return KErrGeneral; - } - else - { - //1 appid - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPParameterAppID); - klf1->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf1); - - //2 user id - klf1->SetID(EWPParameterAAuthName); - klf1->SetValueL(KXMPPAuthName); - xmppadapter->VisitL(*klf1); - - //3 providerid - klf1->SetID(EWPParameterProviderID); - klf1->SetValueL(KProviderID); - xmppadapter->VisitL(*klf1); - - //4 password - klf1->SetID(EWPParameterAAuthSecret); - klf1->SetValueL(KXMPPAuthSecret); - xmppadapter->VisitL(*klf1); - - //5 parameter- protocol - klf1->SetID(EWPParameterAProtocol); - klf1->SetValueL(KProtocolvalue); - xmppadapter->VisitL(*klf1); - - //6 parameter- serveraddress - klf1->SetID(EWPParameterAddr); - klf1->SetValueL(KServer); - xmppadapter->VisitL(*klf1); - - //7 parameter- ssl - klf1->SetID(EWPNamedParameter); - klf1->SetNameL(KSsl); - klf1->SetValueL(KSslvalue); - xmppadapter->VisitL(*klf1); - - //8 parameter- portnumber - klf1->SetID(EWPNamedParameter); - klf1->SetNameL(KPortNbr); - klf1->SetValueL(KPortNbrvalue); - xmppadapter->VisitL(*klf1); - klf1->SetID(EWPParameterDomain); - klf1->SetNameL(KXMPPDomain); - klf1->SetValueL(KDomain); - xmppadapter->VisitL(*klf1); - - - if(xmppadapter->ItemCount()) - { - iLog->Log ( _L( "xmppadapter_SaveL test case passed" ) ); - } - else - { - CleanupStack::PopAndDestroy(klf1); - REComSession::DestroyedImplementation( iEcomDtorID ); - iLog->Log ( _L( "xmppadapter_SaveL test case Failed" ) ); - return KErrGeneral; - } - - CleanupStack::PopAndDestroy(klf1); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_SaveL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_ItemZeroCountL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_SaveL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_SaveL test case Failed" ) ); - return KErrGeneral; - } - else - { - if(xmppadapter->ItemCount()) - { - REComSession::DestroyedImplementation( iEcomDtorID ); - iLog->Log ( _L( "xmppadapter_SaveL test case Failed" ) ); - return KErrGeneral; - } - else - { - iLog->Log ( _L( "xmppadapter_SaveL test case Passed" ) ); - } - - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_DetailsL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_DetailsL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_SaveL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_SaveL test case Failed" ) ); - return KErrGeneral; - } - else - { - // The DetailsL method is NOT supported by this adapter - MWPPairVisitor* tempPairVisitor = NULL; - TInt err = xmppadapter->DetailsL(0,*tempPairVisitor); - REComSession::DestroyedImplementation( iEcomDtorID ); - - if(KErrNotSupported != err ) - { - iLog->Log ( _L( "xmppadapter_SaveL test case Failed" ) ); - return KErrGeneral; - } - else - { - iLog->Log ( _L( "xmppadapter_SaveL test case Passed" ) ); - } - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_KWPAppAddrL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_KWPAppAddrL(CStifItemParser& /*aItem*/ ) - { - - iLog->Log ( _L("xmppadapter_visit_KWPAppAddrL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_KWPAppAddrL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPCharacteristic* klf = - WPElementFactory::CreateCharacteristicLC( KWPAppAddr); - xmppadapter->VisitL(*klf); - iLog->Log ( _L( "xmppadapter_visit_KWPAppAddrL test case passed" ) ); - CleanupStack::PopAndDestroy(klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPNamedParameter_KSslL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPNamedParameter_KSslL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPNamedParameter_KSslL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPNamedParameter_KSslL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPNamedParameter); - klf1->SetNameL(KSsl); - klf1->SetValueL(KSslvalue); - xmppadapter->VisitL(*klf1); - iLog->Log ( _L( "xmppadapter_visit_EWPNamedParameter_KSslL test case passed" ) ); - CleanupStack::PopAndDestroy(2,klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPNamedParameter_KPortNbrL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPNamedParameter_KPortNbrL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPNamedParameter_KPortNbrL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPNamedParameter_KPortNbrL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPNamedParameter); - klf1->SetNameL(KPortNbr); - klf1->SetValueL(KPortNbrvalue); - xmppadapter->VisitL(*klf1); - iLog->Log ( _L( "xmppadapter_visit_EWPNamedParameter_KPortNbrL test case passed" ) ); - CleanupStack::PopAndDestroy(2,klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -//---------------------------------------------------------------------------- -// CtstXmppAdapter::xmppadapter_visit_EWPNamedParameter_KBrandIdL -//---------------------------------------------------------------------------- -// -TInt CtstXmppAdapter::xmppadapter_visit_EWPNamedParameter_KBrandIdL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPNamedParameter_KBrandIdL" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPNamedParameter_KBrandIdL test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPNamedParameter); - klf1->SetNameL(KBrandId); - klf1->SetValueL(KBrandIdvalue); - xmppadapter->VisitL(*klf1); - iLog->Log ( _L( "xmppadapter_visit_EWPNamedParameter_KBrandIdL test case passed" ) ); - CleanupStack::PopAndDestroy(2,klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -TInt CtstXmppAdapter::xmppadapter_visit_EWPParameterDomainL(CStifItemParser& /*aItem*/ ) - { - iLog->Log ( _L("xmppadapter_visit_EWPParameterDomain" ) ); - iEcomDtorID = TUid::Null(); - CXMPPAdapter* xmppadapter = static_cast(REComSession::CreateImplementationL( TUid::Uid( 0x0A6A4E93 ), - iEcomDtorID )); - - if(!xmppadapter) - { - iLog->Log ( _L( "xmppadapter_visit_EWPParameterDomain test case Failed" ) ); - return KErrGeneral; - } - else - { - CWPParameter* klf = CWPParameter::NewLC(); - klf->SetID(EWPParameterAppID); - klf->SetValueL(KMecoImAppID); - xmppadapter->VisitL(*klf); - - CWPParameter* klf1 = CWPParameter::NewLC(); - klf1->SetID(EWPParameterDomain); - klf1->SetNameL(KXMPPDomain); - klf1->SetValueL(KDomain); - xmppadapter->VisitL(*klf1); - iLog->Log ( _L( "xmppadapter_visit_EWPParameterDomain test case passed" ) ); - CleanupStack::PopAndDestroy(2,klf); - REComSession::DestroyedImplementation( iEcomDtorID ); - } - return KErrNone; - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 inc/vimpstcustomcleanupapi.h --- a/inc/vimpstcustomcleanupapi.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* 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: inf file for conversations -* -*/ - -#ifndef VIMPSTCUSTOMCLEANUPAPI_H -#define VIMPSTCUSTOMCLEANUPAPI_H - - -/** -* @publishedAll -* @released -* Template class CleanupResetAndDestroy to clean up the array -* of implementation information from the cleanup stack. -*/ - -template -class CustomCleanupResetAndDestroy - { - public: - /** - * Puts an item on the cleanup stack. - * @param aRef - * The implementation information to be put on the cleanup stack. - */ - inline static void PushL(T& aRef); -private: - static void ResetAndDestroy(TAny *aPtr); - }; - -template - inline void CleanupResetAndDestroyPushL(T& aRef); - -template - inline void CustomCleanupResetAndDestroy::PushL(T& aRef) - { CleanupStack::PushL(TCleanupItem(&ResetAndDestroy,&aRef));} - -template - void CustomCleanupResetAndDestroy::ResetAndDestroy(TAny *aPtr) - {(STATIC_CAST(T*,aPtr))->ResetAndDestroy();} - -template - inline void CustomCleanupResetAndDestroyPushL(T& aRef) - {CustomCleanupResetAndDestroy::PushL(aRef);} - -#endif /*VIMPSTCUSTOMCLEANUPAPI_H*/ diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/bwins/instantmessagesalertu.def --- a/instantmessagesalert/bwins/instantmessagesalertu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -EXPORTS - ?SetVibra@CIMAlertManager@@UAEXH@Z @ 1 NONAME ; void CIMAlertManager::SetVibra(int) - ?RemoveObserver@CIMAlertManager@@UAEXPBVMIMAlertManagerObserver@@@Z @ 2 NONAME ; void CIMAlertManager::RemoveObserver(class MIMAlertManagerObserver const *) - ?SetVolume@CIMAlertManager@@UAEXH@Z @ 3 NONAME ; void CIMAlertManager::SetVolume(int) - ?CreateNotifierL@IMAlertNotifierFactory@@SAPAVMIMAlertNotifierInterface@@PAVMIMAlertNotifierKeyObserver@@@Z @ 4 NONAME ; class MIMAlertNotifierInterface * IMAlertNotifierFactory::CreateNotifierL(class MIMAlertNotifierKeyObserver *) - ?AddObserverL@CIMAlertManager@@UAEXPBVMIMAlertManagerObserver@@@Z @ 5 NONAME ; void CIMAlertManager::AddObserverL(class MIMAlertManagerObserver const *) - ?SetRingingType@CIMAlertManager@@UAEXW4TProfileRingingType@@@Z @ 6 NONAME ; void CIMAlertManager::SetRingingType(enum TProfileRingingType) - ?NewL@CIMAlertManager@@SAPAV1@XZ @ 7 NONAME ; class CIMAlertManager * CIMAlertManager::NewL(void) - ?PlayL@CIMAlertManager@@UAEXK@Z @ 8 NONAME ; void CIMAlertManager::PlayL(unsigned long) - ?Stop@CIMAlertManager@@UAEXXZ @ 9 NONAME ; void CIMAlertManager::Stop(void) - ?DoPlayL@CIMAlertManager@@AAEXK@Z @ 10 NONAME ; void CIMAlertManager::DoPlayL(unsigned long) - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/eabi/instantmessagesalertu.def --- a/instantmessagesalert/eabi/instantmessagesalertu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -EXPORTS - _ZN15CIMAlertManager12AddObserverLEPK23MIMAlertManagerObserver @ 1 NONAME - _ZN15CIMAlertManager14RemoveObserverEPK23MIMAlertManagerObserver @ 2 NONAME - _ZN15CIMAlertManager14SetRingingTypeE19TProfileRingingType @ 3 NONAME - _ZN15CIMAlertManager4NewLEv @ 4 NONAME - _ZN15CIMAlertManager4StopEv @ 5 NONAME - _ZN15CIMAlertManager5PlayLEm @ 6 NONAME - _ZN15CIMAlertManager7DoPlayLEm @ 7 NONAME - _ZN15CIMAlertManager8SetVibraEi @ 8 NONAME - _ZN15CIMAlertManager9SetVolumeEi @ 9 NONAME - _ZN22IMAlertNotifierFactory15CreateNotifierLEP27MIMAlertNotifierKeyObserver @ 10 NONAME - _ZTI15CIMAlertManager @ 11 NONAME - _ZTI20CIMAlertNotifierImpl @ 12 NONAME - _ZTV15CIMAlertManager @ 13 NONAME - _ZTV20CIMAlertNotifierImpl @ 14 NONAME - _ZThn20_N15CIMAlertManager12AddObserverLEPK23MIMAlertManagerObserver @ 15 NONAME - _ZThn20_N15CIMAlertManager14RemoveObserverEPK23MIMAlertManagerObserver @ 16 NONAME - _ZThn20_N15CIMAlertManager14SetRingingTypeE19TProfileRingingType @ 17 NONAME - _ZThn20_N15CIMAlertManager4StopEv @ 18 NONAME - _ZThn20_N15CIMAlertManager5PlayLEm @ 19 NONAME - _ZThn20_N15CIMAlertManager8SetVibraEi @ 20 NONAME - _ZThn20_N15CIMAlertManager9SetVolumeEi @ 21 NONAME - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/group/bld.inf --- a/instantmessagesalert/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2008 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: Build information file for instantmessagesalert -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -// for image creation: -../rom/instantmessagesalert.iby CORE_APP_LAYER_IBY_EXPORT_PATH(instantmessagesalert.iby) -// ROM SIS stubs -../sis/instantmessagesalertstub.sis /epoc32/data/Z/System/Install/instantmessagesalertstub.sis - -PRJ_MMPFILES - -instantmessagesalert.mmp diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/group/instantmessagesalert.mmp --- a/instantmessagesalert/group/instantmessagesalert.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2008 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: Project definition file for instantmessagesalert. -* -*/ - -#include -#include "../inc/imalertuids.h" - -CAPABILITY CAP_GENERAL_DLL -TARGET instantmessagesalert.dll -TARGETTYPE dll -UID KIMALERTUIDS1 KIMALERTUIDS2 -VENDORID VID_DEFAULT -VERSION 10.0 - -//used to allow binary compression by making use of BYTEPAIR algorithm -PAGED - -SOURCEPATH ../src - -SOURCE cimalertmanager.cpp -SOURCE cimalertnotifierimpl.cpp -SOURCE cimalertpropertyobserver.cpp -SOURCE imalertnotifierfactory.cpp - -USERINCLUDE ../inc -APP_LAYER_SYSTEMINCLUDE - - -#include "../inc/imalertbuilddefinitions.h" -#ifdef _ENABLE_DEBUG_PRINT -MACRO CHAT_ENABLE_DEBUG_PRINT - #ifdef _ENABLE_FILE_DEBUG -MACRO CHAT_DEBUG_OUTPUT_TO_FILE -LIBRARY flogger.lib - #endif // _ENABLE_FILE_DEBUG -#endif // _ENABLE_DEBUG_PRINT - -// BASIC TYPES -LIBRARY euser.lib -LIBRARY centralrepository.lib -LIBRARY cenrepnotifhandler.lib - -LIBRARY apgrfx.lib // for instantmessagesalert -LIBRARY mediaclientaudio.lib // for instantmessagesalert -LIBRARY apmime.lib // for instantmessagesalert -LIBRARY filelist.lib //filelist dialog, needed for tone setting item - -LIBRARY platformenv.lib -LIBRARY profileeng.lib -LIBRARY efsrv.lib -LIBRARY bafl.lib -LIBRARY hwrmvibraclient.lib -LIBRARY vimpstsettings.lib - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/cimalertmanager.h --- a/instantmessagesalert/inc/cimalertmanager.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,312 +0,0 @@ -/* -* 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: This class gives interface for playing IM message alert -* -*/ - -#ifndef CIMALERTMANAGER_H -#define CIMALERTMANAGER_H - -// INCLUDES -#include "mimalertnotifierkeyobserver.h" -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "mimalertinterface.h" - -// FORWARD DECLARATIONS -class CFLDRingingTonePlayer; -class MProfileEngine; -class MIMAlertManagerObserver; -class MIMAlertNotifierInterface; -class MProfile; -class CHWRMVibra; -class MVIMPSTSettingsStore; -class Ctestinstantmsgalert; //For Test code - -#include "mimalertinterface.h" - -const TInt KIMVibraDuration = 1000; // in milliseconds - -/** - * This class gives interface to play - * simple sounds - * - * @lib chat.app - * @since 1.2 - */ -class CIMAlertManager - : public CBase, - public MMdaAudioPlayerCallback, - public MIMAlertNotifierKeyObserver, - public MMdaAudioToneObserver, - public MCenRepNotifyHandlerCallback, - public MIMAlertInterface - { - protected: // Enumerations - - enum TAudioPlayerStatus - { - EAudioPlayerNotCreated, - EAudioPlayerInitializing, - EAudioPlayerReady, - EAudioPlayerPlaying, - EAudioPlayerInitialized - }; - - public: // Constructors and destructor - - /** - * Two-phased constructor. - * param aServiceId, service id to get the tone to be played. - */ - IMPORT_C static CIMAlertManager* NewL(); - - /** - * Destructor. - */ - virtual ~CIMAlertManager(); - - public: // New functions - - /** - * Starts playing the tone that has been set - * @since 1.2 - */ - IMPORT_C void PlayL(TUint32 aServiceId); - - /** - * Stops playing - * @since 1.2 - */ - IMPORT_C void Stop(); - - /** - * Set the volume level on which the sound is played - * If this method is not called, player uses the setting - * in active profile. - * @param aVolume The volume level - */ - IMPORT_C void SetVolume( TInt aVolume ); - - /** - * Sets the ringing type - * If this method is not called, player uses the setting - * in active profile. - * @param aRingingType The ringing type (see enum TProfileRingingType) - */ - IMPORT_C void SetRingingType( TProfileRingingType aRingingType ); - - /** - * Sets vibrating alert on or off. - * If this method is not called, player uses the - * setting in active profile. - * @param aVibra True: Vibra is on. False: Vibra is off. - */ - IMPORT_C void SetVibra( TBool aVibra ); - - /** - * Adds observer, which is informed when playing is completed - * @param aObserver observing object - */ - IMPORT_C void AddObserverL( const MIMAlertManagerObserver* aObserver ); - - /** - * Removes observer - * @param aObserver observing object - */ - IMPORT_C void RemoveObserver( const MIMAlertManagerObserver* aObserver ); - - private: // constructors - - /** - * C++ default constructor. - * @see CIMAlertManager::NewL - */ - CIMAlertManager(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: - /** - * Does the actual sound playing - * @since 2.1 - */ - void DoPlayL(TUint32 aServiceId); - - /** - * Starts playing the sound file - * @param aFileName The file to be processed - */ - void ProcessFileL( const TDesC& aFileName ); - - /** When audioplayer is ready, set its ringing type - * @param aRingingType The ringing type (see enum TRingingTypes) - */ - void DoSetRingingType( TInt aRingingType ); - - /** - * Converts volume from 1 to 10 to audio driver understandable value. - * @param aVolume Volume level to be converted. - * @return Returns converted volume level - */ - TInt ConvertVolume( TInt aVolume ); - - /** - * Passess error to current activescheluder if - * error = KErrNoMemory or KErrDiskFull - */ - void HandleError( TInt aError ); - - /** - * Gets tone file name from SAP settings - * @param aToneFileName After the call this will - * contain the tone file name - */ - void GetToneFileNameL( TDes& aToneFileName ,TUint32 aServiceId); - - private: // Methods derived from MMdaAudioPlayerCallback - - /** - * Derived from MMdaAudioPlayerCallback - * This method is called when the audio player initialisation is ready - * @see MMdaAudioPlayerCallback - */ - void MapcInitComplete( TInt aError, - const TTimeIntervalMicroSeconds& aDuration ); - - /** - * Derived from MMdaAudioPlayerCallback - * This method is called when the audio player has finished playing - * @see MMdaAudioPlayerCallback - */ - void MapcPlayComplete( TInt aError ); - - private: // Methods derived from MMdaAudioToneObserver - - /** - * Derived from MMdaAudioToneObserver - * This method is called when the tone player initialisation is ready - * @see MMdaAudioToneObserver - */ - virtual void MatoPrepareComplete( TInt aError ); - - /** - * Derived from MMdaAudioToneObserver - * This method is called when the tone player has finished playing - * @see MMdaAudioToneObserver - */ - virtual void MatoPlayComplete( TInt aError ); - - private: // Methods derived from MIMAlertNotifierKeyObserver - - /** - * Derived from MIMAlertNotifierKeyObserver - * Receive a notification from publish and subscribe keys - */ - void HandleKeyChange( TUpdatedKey& aUpdatedValues ); - - private: // Methods derived from MCenRepNotifyHandlerCallback - /** - * Derived from MCenRepNotifyHandlerCallback - * Receive a notification from central repository server - */ - void HandleNotifyInt(TUint32 aId, TInt aNewValue); - - private: // Data - - - // Doesn't own. Profile API if silent then there is no sounds - MProfileEngine* iProfileApi; - - // Used to play other audio files than ringing tones. Owned. - CMdaAudioPlayerUtility* iAudioPlayer; - TAudioPlayerStatus iAudioPlayerStatus; - - // Used to play ringing tones. Owned - CMdaAudioToneUtility* iTonePlayer; - TAudioPlayerStatus iTonePlayerStatus; - - // Used for follow if user stops audio playing, - // also for profile changes in volume level and vibrating alert - CCenRepNotifyHandler* iRingingVolumeNotifyHandler; - CCenRepNotifyHandler* iRingingTypeNotifyHandler; - CCenRepNotifyHandler* iVibraNotifyHandler; - - CRepository* iProfilesRepository; - CRepository* iVibraRepository; - - // Used to follow tone quit key - MIMAlertNotifierInterface* iNotifierAPI; - - // ringing settings - TInt iRingingVolume; - TInt iRingingType; - TBool iVibra; - - // Used when checking audio file type - RApaLsSession iApaSession; - - // Audiomanager observers - RPointerArray iObservers; - - // Used to keep track if current sound is default sound. - TBool iIsPlayingDefaultIMSound; - - // Tone file name - HBufC* iToneFileName; - - // File session for file operations - RFs iFs; - - // currently active profile (ownership transferred) - MProfile* iActiveProfile; - - // owned, vibra API - CHWRMVibra* iVibrator; - - // ETrue if Always Online is active, invoked from IM Launcher - TBool iIMLauncherInvoked; - - // Beep once ringing tone - HBufC* iBeepRingingTone; - - // owns. Access to central repository - CRepository* iCenRep; - - // ETrue if IMPSCUI Session Id should be preserved upon exit - TBool iPreserveSessionIdInExit; - - //service id - TUint32 iServiceId; - - MVIMPSTSettingsStore* iSettingsStore; - //for test cases - friend class Ctestinstantmsgalert; - }; - -#endif // CIMALERTMANAGER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/cimalertnotifierimpl.h --- a/instantmessagesalert/inc/cimalertnotifierimpl.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* 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: Publish and Subscribe implementation of notify services -* -*/ - - -#ifndef CIMALERTNOTIFIERIMPL_H -#define CIMALERTNOTIFIERIMPL_H - -// INCLUDES -#include "mimalertnotifierinterface.h" -#include "mimalertpropertynotificationobserver.h" - -// FORWARD DECLARATIONS -class MIMAlertNotifierKeyObserver; -class CIMAlertPropertyObserver; - -// CLASS DECLARATION -/** -* Class for notifying key changes, reading and changing the values of -* Pub&Sub keys. -* -* @since Series 60 Platform 3.0 -*/ -class CIMAlertNotifierImpl : public CBase, - public MIMAlertNotifierInterface, - public MIMAlertPropertyNotificationObserver - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CIMAlertNotifierImpl* NewL( MIMAlertNotifierKeyObserver* aObserver ); - - /** - * Destructor. - */ - virtual ~CIMAlertNotifierImpl(); - - public: // Functions from base classes - - TInt SetInt( TNotifyKey aKey, TInt aValue ); - TInt GetInt( TNotifyKey aKey, TInt& aValue ); - TInt ListenKeyChanges( TNotifyKey aKey ); - - private: // From MIMAlertPropertyNotificationObserver - - /** - * @see MIMAlertPropertyNotificationObserver - */ - void HandlePropertyNotificationEventL( TUid aCategory, TUint aKey ); - - private: - - /** - * C++ default constructor. - */ - CIMAlertNotifierImpl( MIMAlertNotifierKeyObserver* aObserver ); - - - private: // Data - - MIMAlertNotifierKeyObserver* iObserver; - CIMAlertPropertyObserver* iPropWatcher; - }; - -#endif // CIMALERTNOTIFIERIMPL_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/cimalertpropertyobserver.h --- a/instantmessagesalert/inc/cimalertpropertyobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* 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: Publish & Subscribe property change observer -* -*/ - -#ifndef CIMALERTPROPERTYOBSERVER_H -#define CIMALERTPROPERTYOBSERVER_H - -// INCLUDES -#include // CActive -#include // RProperty - -#include "mimalertpropertynotificationobserver.h" - - -// CLASS DECLARATION - -/** -* Implementation of the Publish & Subscribe property change observer -* -* @lib MGXMediaFileAPI.lib -* @since 2.6 -*/ -NONSHARABLE_CLASS(CIMAlertPropertyObserver) : public CActive - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aObserver Observer to be informed when observed - * property changes - */ - static CIMAlertPropertyObserver* NewL( - MIMAlertPropertyNotificationObserver& aObserver ); - - /** - * Destructor. - */ - virtual ~CIMAlertPropertyObserver(); - - public: // New functions - - /** - * Starts observing the given key for any changes - * Notifies the observer when the property changes - * @since 2.6 - * @param aCategory, Category of the observed property - * @param aKey, Observed property - */ - void ObservePropertyChangeL( TUid aCategory, TUint aKey ); - - /** - * Stops observing the key given with call ObserverPropertyChangeL - */ - void CancelObserve( ); - - /** - * Gets the uid this observer is observing - * @return the category - */ - TUid Category(); - - /** - * Gets the uid this observer is observing - * @return the key - */ - TUint Key(); - - - protected: // Functions from base classes - - /** - * From CActive - */ - void RunL(); - - /** - * From CActive - */ - void DoCancel(); - - private: - - /** - * C++ default constructor. - */ - CIMAlertPropertyObserver( MIMAlertPropertyNotificationObserver& aObserver ); - - - private: // Data - - // Owns: Observed property - RProperty iProperty; - - // Observer to be informed when property changes - MIMAlertPropertyNotificationObserver& iObserver; - - // the category this observer is attached to - TUid iCategory; - // the key this observer is attached to - TUint iKey; - - }; - -#endif // CIMALERTPROPERTYOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/imalertbuilddefinitions.h --- a/instantmessagesalert/inc/imalertbuilddefinitions.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* 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: Build definitions - * -*/ - - - -#ifndef IMPSBUILDDEFINITIONS_H -#define IMPSBUILDDEFINITIONS_H - -// variated features - -// For Testing -// Used for Testing -//#define CHAT_UNIT_TEST -// debugging - -// Enables debug print -//#define _ENABLE_DEBUG_PRINT -// Enabled file debug (Remember to create c\Logs\Chat folder!!!) -//#define _ENABLE_FILE_DEBUG - -// Enables layout debug print -// #define _ENABLE_LAYOUT_DEBUG_PRINT -// Enabled layout file debug (Remember to create c\Logs\Chat folder!!!) -// #define _ENABLE_LAYOUT_FILE_DEBUG - -// Enables sending not supported content. -//#define RD_SEND_NOT_SUPPORTED_CONTENT - -// Enables settings facelift -#define RD_SETTINGS_FACELIFT - -// Enables background fetching of contact lists. -#define IMPS_CONTACT_FETCH_BACKGROUND - -// Enables service enhancements -#define RD_SERVICE_ENHANCEMENTS - -// build-time variation flags - -// "IM.Block.Query" -#define IMPS_BLOCK_AFTER_DELETE - -// Enables send to many functionality -#define RD_SEND_TO_MANY - -// Enables message indication layout change -#define RD_MESSAGE_INDICATION_NEW - -// Enables new message indication in chat group list view and main view -#define RD_CHAT_GROUP_MESSAGE_INDICATION_NEW - -// IM.Collapse.Option.Focusing.Contact -// Remove 'Collapse' option from the Options menu, when focus is on a contact -#define RD_REMOVE_COLLAPSE_OPTION - -// This enables the IM to be compiled in S60 v3 0 platform -// Disables S60 Common features -// - Disabled MSK support -// - Disables Touch support -// -// NOTE: DO NOT ENABLE IN CCB -// -//#include "im30compatibility.h" - -#endif // IMPSBUILDDEFINITIONS_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/imalertdebugmacros.h --- a/instantmessagesalert/inc/imalertdebugmacros.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* 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: Debug macros for IM application -* -*/ - -#ifndef __CHATDEBUGMACROS_H__ -#define __CHATDEBUGMACROS_H__ - -// widen macros for unicode text -#define WIDEN2(x) L ## x -#define WIDEN(x) WIDEN2(x) -#define __WFILE__ WIDEN(__FILE__) - -#endif // __CHATDEBUGMACROS_H__ diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/imalertdebugprint.h --- a/instantmessagesalert/inc/imalertdebugprint.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,329 +0,0 @@ -/* -* 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: Debug print definitions -* -*/ - - -/* -* -* Description: -* -* Logging tools. Uniforms style to write debug data to -* screen using RDebug or to a file with RFileLogger. -* -* Usage: -* 1.Configuring: -* -* Logging and debug printing is configured with following macros -* CHAT_ENABLE_DEBUG_PRINT (defining this enables debug printing) -* CHAT_DEBUG_OUTPUT_TO_FILE (now debug printing goes to file) -* CHAT_DEBUG_FILENAME "Some.log" (file to store debug log) -* -* Debug printing can be configured on project level by defining desired -* macros in .mmp file like this -* //enable file logging -* MACRO CHAT_ENABLE_DEBUG_PRINT -* MACRO CHAT_DEBUG_OUTPUT_TO_FILE -* -* You may also automate the debug printing to follow current build -* variant like this: -* #ifdef _DEBUG -* MACRO CHAT_ENABLE_DEBUG_PRINT -* #endif // _DEBUG -* -* The file to write debug log needs to be defined in file level. -* (Defining it in mmp file causes errors to build procedure..) -* #define CHAT_DEBUG_FILENAME "Example.log" -* -* When using debug printing to file, flogger.lib needs to be added in -* mmp file -* LIBRARY flogger.lib -* and following directory must be manually done before loggin -* (no directory, not logs) Epoc32\Wins\c\logs\IMALERT\ -* -* -* 2.Printing: -* -* // normal string output: -* CHAT_DP( D_CHAT_LIT( "Some text." ) ); >> CHAT: Some text. -* CHAT_DP( D_PLAIN_LIT( "Some text." ) ); >> Some text. -* CHAT_DP_TXT( "Some text." ); >> CHAT: Some text. -* -* // string with variables -* TInt index( 99 ); -* _LIT( KExample, "Example" ); -* CHAT_DP( D_CHAT_LIT( "Some text: %d" ), 100 ); >> CHAT: Some text: 100 -* CHAT_DP( D_CHAT_LIT( "Some text: %d" ), index ); >> CHAT: Some text: 99 -* CHAT_DP( D_CHAT_LIT( "Some text: %S" ), &KExample ); >> CHAT: Some text: Example -* -* CHAT_DP( D_PLAIN_LIT( "Some text: %d" ), 100 ); >> Some text: 100 -* CHAT_DP( D_PLAIN_LIT( "Some text: %d" ), index ); >> Some text: 99 -* CHAT_DP( D_PLAIN_LIT( "Some text: %S" ), &KExample ); >> Some text: Example -* -* -* 3.Known issues: -* -* - If you use macros from .mmp file remember to abld makefile to -* change flags from project. -* - In statements like CHAT_DP( D_CHAT_LIT("Some text: %S"), &KExample ); -* parameters causes still some code to generated in release builds. -* Propably it is best to #ifdef all debugprint blocks -* with CHAT_ENABLE_DEBUG_PRINT statement. -* -* ============================================================================ -*/ - - -#ifndef __CHATDEBUGPRINT_H__ -#define __CHATDEBUGPRINT_H__ - -// Debug logging is enabled, you may enable debug printing in release builds also -#ifdef CHAT_ENABLE_DEBUG_PRINT - - // no include files if no debug printing --> faster compile time - // INCLUDES - #include - #include - #include - - #ifndef _DEBUG - // warn in release build - #if defined( __VC32__ ) - #pragma message( "Warning: CHAT debug printing is on in release build!" ) // CSI: 68 # Warning for rel builds - #else // __GCC32__ - #warning "CHAT debug printing is on in release build!" - #endif // __VC32__ - #endif - - /** - * Depending if the build is UNICODE or not, define the - * helper macros that insert CHAT prefix. - */ - #ifdef _UNICODE - #define CHAT_TOKEN_PASTING( s ) L##s - #define CHAT_TO_UNICODE( s ) CHAT_TOKEN_PASTING( s ) - #define CHAT_DEBUG_STR( m ) CHAT_TO_UNICODE( "CHAT: " ) L##m - #else - #define CHAT_DEBUG_STR "CHAT: " - #endif // _UNICODE - - - /** - * Helper macro for defining debug strings with plain debug text. - */ - #define D_PLAIN_LIT( s ) _L( s ) // CSI: 78 # Debug print - - - /** - * Helper macro for defining debug strings with "CHAT:" prefix. - */ - #define D_CHAT_LIT( s ) TPtrC( ( const TText * ) CHAT_DEBUG_STR( s ) ) - - - - #ifdef CHAT_DEBUG_OUTPUT_TO_FILE - - /** - * Method to handle file writing - */ - inline void CHATDebugWriteFormat( TRefByValue aFmt,... ) - { - _LIT( KDir, "IMALERT" ); - #ifdef CHAT_DEBUG_FILENAME - const static TLitC< sizeof( CHAT_DEBUG_FILENAME ) > KName={ - sizeof( CHAT_DEBUG_FILENAME)-1, - CHAT_TO_UNICODE( CHAT_DEBUG_FILENAME ) }; - #else - _LIT( KName, "ChatDebug.log" ); - #endif // CHAT_DEBUG_FILENAME - - // take the ellipsis parameters - VA_LIST args; - VA_START( args,aFmt ); - RFileLogger::WriteFormat( KDir, KName, EFileLoggingModeAppend, - aFmt, args ); - VA_END( args ); - } - - /** - * Actual debug printters. - * Output to log file. - */ - #define CHAT_DP CHATDebugWriteFormat - #define CHAT_DP_TXT( s ) CHATDebugWriteFormat( D_CHAT_LIT( s ) ) - - - - #else - /** - * Actual debug printters. - * Output to debugger output. - */ - #define CHAT_DP RDebug::Print - #define CHAT_DP_TXT( s ) RDebug::Print( D_CHAT_LIT( s ) ) - #endif - - -#else //CHAT_ENABLE_DEBUG_PRINT - - /** - * - * Empty implementations for non-debug printing build versions. - * - */ - - /** - * Dummy struct for checking that all CHAT_DP's define string - * literals using space-saving D_PLAIN_LIT or D_CHAT_LIT. - */ - struct TCHATEmptyDebugString { }; - - /** - * Macro for defining debug-only literal strings (empty release version) - */ - #define D_PLAIN_LIT( s ) TCHATEmptyDebugString() - - /** - * Macro for defining debug-only literal strings (empty release version) - */ - #define D_CHAT_LIT( s ) TCHATEmptyDebugString() - - /** - * Macro for empty debug print function - */ - #define CHAT_DP_TXT( s ) CHAT_DP( D_CHAT_LIT( s ) ) - - - /// Empty debug print function for release builds. - inline void CHAT_DP(TCHATEmptyDebugString) - { - } - - template< class T1 > - inline void CHAT_DP( TCHATEmptyDebugString, T1 ) - { - } - - template< class T1, class T2 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2 ) - { - } - - template< class T1, class T2, class T3 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3 ) - { - } - - template< class T1, class T2, class T3, class T4 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8, class T9 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8, - T9 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8, class T9, class T10 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8, - T9, T10 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8, class T9, class T10, class T11 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8, - T9, T10, T11 ) - { - } - -#endif // CHAT_ENABLE_DEBUG_PRINT - -/* Some general wrappers to CHAT_DP for convenience. - * - * Since these just wrap CHAT_DP, they work transparently: the macros write - * stuff to debug output or to a file, whichever you are using, - * you don't have to care. - * - * Since CHAT_DP is either defined or empty inline, these won't - * matter in either build (no, there is no noticeable penalty in compile time) - * - * There are three types of wrappers, output format is - * - * "filename:linenumber method - enter" when entering function - * "filename:linenumber method - message" when inside function - * "filename:linenumber method - done" when exiting function - * - * Example: - * TInt CSomeClass::SomeMethod() - * { - * CHAT_DP_FUNC_ENTER( "SomeMethod" ); - * - * TInt i = 41; - * - * CHAT_DP_FUNC_DP( "SomeMethod", "Doing intensive calculations" ); - * - * i++; - * - * CHAT_DP_FUNC_DONE( "SomeMethod" ); - * } - * - * You have to provide the method name yourself since the __FUNCTION__ - * preprocessor macro is not understood. - */ - -#include "imalertdebugmacros.h" // WFILE etc. - -// when entering a function -#define CHAT_DP_FUNC_ENTER( method ) \ - CHAT_DP( D_CHAT_LIT("%s:%d %s - enter" ), __WFILE__, __LINE__, L ## method ); - -// debug print -#define CHAT_DP_FUNC_DP( method,msg ) \ - CHAT_DP( D_CHAT_LIT( "%s:%d %s - %s" ), __WFILE__, __LINE__, L ## method, L ## msg ); - -// when exiting a function -#define CHAT_DP_FUNC_DONE(method) \ - CHAT_DP( D_CHAT_LIT( "%s:%d %s - done" ), __WFILE__, __LINE__, L ## method ); - -#endif // __CHATDEBUGPRINT_H__ - - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/imalertnotifierfactory.h --- a/instantmessagesalert/inc/imalertnotifierfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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: Publish and Subscribe or Shared data factory method implementation -* -*/ - -#ifndef IMALERTNOTIFIERFACTORY_H -#define IMALERTNOTIFIERFACTORY_H - -// INCLUDES -#include - - -// FORWARD DECLARATIONS -class MIMAlertNotifierInterface; -class MIMAlertNotifierKeyObserver; - -// CLASS DECLARATION - -/** -* Class for notifying key changes and changing the values of Pub&Sub- or shared data key changes, -* depending which is used in the platform. -* -* @since Series 60 Platform 3.0 -*/ -// This is not a C-class although it begins with a CA -class IMAlertNotifierFactory // CSI: 51 # see above - { - public: // New methods - - /** - * Instantiates a notifier object - * @param aObserver Observer class for the key - * @param aUid - */ - IMPORT_C static MIMAlertNotifierInterface* CreateNotifierL( - MIMAlertNotifierKeyObserver* aObserver ); - }; - -#endif // IMALERTNOTIFIERFACTORY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/imalertuids.h --- a/instantmessagesalert/inc/imalertuids.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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: Common UID constants for instantmessagesalert. -* -*/ - - -// uids for all component - -#ifndef __IMALERTUIDS_H -#define __IMALERTUIDS_H - -// MACROS - -//uids part of instantmessagesalert -#define KIMALERTUIDS1 0x1000008d -#define KIMALERTUIDS2 0x200255C3 - -#endif // __IMALERTUIDS_H - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/mimalertinterface.h --- a/instantmessagesalert/inc/mimalertinterface.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* 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: Interface for controlling msg tone -* -*/ - -#ifndef MIMALERTINTERFACE_H -#define MIMALERTINTERFACE_H - - -#include -#include -#include -#include - -#include -#include -#include -#include - -class MIMAlertManagerObserver; - -class MIMAlertInterface - - { - public: - - virtual void PlayL(TUint32 aServiceId) = 0; - - virtual void Stop() = 0; - - virtual void SetVolume( TInt aVolume ) = 0; - - - virtual void SetRingingType( TProfileRingingType aRingingType ) = 0; - - - virtual void SetVibra( TBool aVibra) = 0; - - virtual void AddObserverL( const MIMAlertManagerObserver* aObserver ) = 0; - - virtual void RemoveObserver( const MIMAlertManagerObserver* aObserver ) = 0; - - - - virtual ~MIMAlertInterface(){}; - - - }; - - -#endif //MIMALERTINTERFACE_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/mimalertmanagerobserver.h --- a/instantmessagesalert/inc/mimalertmanagerobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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: Interface class for observe audiomanager playing -* -*/ - -#ifndef MIMALERTMANAGEROBSERVER_H -#define MIMALERTMANAGEROBSERVER_H - -// CLASS DECLARATION - -/** -* Interface class for fadetext in navipane -* -* @lib chat.app -* @since 2.6 -*/ -class MIMAlertManagerObserver - { - public: - - /** - * This method notifies when playing is completed - */ - virtual void PlayCompleted() = 0; - - protected: - - /** - * Destructor - */ - virtual ~MIMAlertManagerObserver() {}; - - }; - -#endif // MIMALERTMANAGEROBSERVER_H - -//end of file - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/mimalertnotifierinterface.h --- a/instantmessagesalert/inc/mimalertnotifierinterface.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* 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: This interface describes structure of notify services -* -*/ - - -#ifndef MIMALERTNOTIFIERINTERFACE_H -#define MIMALERTNOTIFIERINTERFACE_H - -// INCLUDES -#include -#include -#include - - -// CLASS DECLARATION - -/** -* An interface for listening PS key changes -* -* @since Series 60 2.6 -*/ -class MIMAlertNotifierInterface - { - public: - enum TNotifyKey - { - EMSGToneQuitKey - }; - public: - - virtual ~MIMAlertNotifierInterface(){}; - - public: // New functions - - virtual TInt SetInt( TNotifyKey aKey, TInt aValue ) = 0; - virtual TInt GetInt( TNotifyKey aKey, TInt& aValue ) = 0; - virtual TInt ListenKeyChanges( TNotifyKey aKey ) = 0; - }; - -#endif // MIMALERTNOTIFIERINTERFACE_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/mimalertnotifierkeyobserver.h --- a/instantmessagesalert/inc/mimalertnotifierkeyobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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: Observes when key values are changed -* -*/ - -#ifndef MIMALERTNOTIFIERKEYOBSERVER_H -#define MIMALERTNOTIFIERKEYOBSERVER_H - -// INCLUDES -#include -#include - -class TUpdatedKey - { - public: - TUpdatedKey(){}; - public: - TUid iUid; - TUint32 iKey; - TInt iValue; - }; - -/** -* Notifier inteface for Pub&Sub or shared data key changes -* (depends on which system is used in the platform) -* -* @since Series 60 2.6 -*/ -class MIMAlertNotifierKeyObserver - { - public: // New functions - - /** - * This function is called when a PS or shared data key value is changed - * @param aUpdatedValues - */ - virtual void HandleKeyChange( TUpdatedKey& aUpdatedValues ) = 0; - - protected: // Destructor - virtual ~MIMAlertNotifierKeyObserver(){}; - }; -#endif // MIMALERTNOTIFIERKEYOBSERVER_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/inc/mimalertpropertynotificationobserver.h --- a/instantmessagesalert/inc/mimalertpropertynotificationobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* 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: Property notification handler observer interface -* -*/ - - -#ifndef MIMALERTPROPERTYNOTIFICATIONOBSERVER_H -#define MIMALERTPROPERTYNOTIFICATIONOBSERVER_H - -#include - -// CLASS DECLARATION - -/** -* Interface for receiving notifications from CIMAlertPropertyObserver when the -* value of the observed property changes -* -* @lib -* @since 3.0 -*/ - -NONSHARABLE_CLASS(MIMAlertPropertyNotificationObserver) - { - public: // New functions - - /** - * Called when the value of observed property has changed - * @since 2.6 - */ - virtual void HandlePropertyNotificationEventL( TUid aCategory, TUint aKey ) = 0; - - }; - -#endif // MIMALERTPROPERTYNOTIFICATIONOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/rom/instantmessagesalert.iby --- a/instantmessagesalert/rom/instantmessagesalert.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* 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: instantmessagesalert IBY file. -* -*/ - - -#ifndef __INSTANTMESSAGESALERT_IBY__ -#define __INSTANTMESSAGESALERT_IBY__ - -//im ui service tab - -file=ABI_DIR\BUILD_DIR\instantmessagesalert.dll SHARED_LIB_DIR\instantmessagesalert.dll - -// stub SIS, provides support for SIS upgrading -data=DATAZ_\system\install\instantmessagesalertstub.sis system\install\instantmessagesalertstub.sis - - -#endif //__INSTANTMESSAGESALERT_IBY__ - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/sis/instantmessagesalert.pkg --- a/instantmessagesalert/sis/instantmessagesalert.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -; -; 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: -; -;Language - standard language definitions -&EN - -;UID is the dll's UID -#{"instantmessagesalert"},(0x200255C3),1,0,0, TYPE=SA, RU - -;Supports Series 60 v 5.2; Needs to be updated when platform is changed -(0x20022E6D ), 1, 1, 0, {"Series60ProductID"} - -;Localised Vendor name -%{"Nokia"} - -;VendorID -:"Nokia" - -; Files to copy - -"\EPOC32\RELEASE\ARMV5\UREL\instantmessagesalert.dll" -"!:\sys\bin\instantmessagesalert.dll" - -; end of file diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/sis/instantmessagesalert.sis Binary file instantmessagesalert/sis/instantmessagesalert.sis has changed diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/sis/instantmessagesalertstub.pkg --- a/instantmessagesalert/sis/instantmessagesalertstub.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -; -; 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: -; -;Language -&EN - -;Header -#{"instantmessagesalert"}, (0x200255C3), 1, 0, 0, TYPE=SA - -;Localised VendorID -%{"Nokia"} - -;VendorID -:"Nokia" - -;uiservicetab components -"" -"z:\sys\bin\instantmessagesalert.dll" - - -; end of file diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/sis/instantmessagesalertstub.sis Binary file instantmessagesalert/sis/instantmessagesalertstub.sis has changed diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/sis/metadata.xml --- a/instantmessagesalert/sis/metadata.xml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ - - - ABC:ABC - - - - - 1 - - InstantMessagesAlert - - Update for InstantMessagesAlert - - - - - - S60 - - - 5 - 2 - - - 2007 - 1 - - - - - 5 - 2 - - 2009 - 52 - - - - - - - - 0x200255C3 - - - 1 - 0 - 0 - - - - 2 - 2 - 2 - - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/src/cimalertmanager.cpp --- a/instantmessagesalert/src/cimalertmanager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,920 +0,0 @@ -/* -* 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: This class gives interface to play IM message alert. -* -*/ - -// INCLUDE FILES -#include "cimalertmanager.h" -#include "imalertdebugprint.h" -#include "mimalertmanagerobserver.h" -#include "mimalertnotifierinterface.h" -#include "imalertnotifierfactory.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//to get message tone file -#include - - -// CONSTANTS -const TInt KMinVolumeLevel( 1 ); -const TInt KMaxVolumeLevel( 10 ); -const TInt KToneInterval( 1000000 ); // 1 second pause between tones - -_LIT( KChatRngMimeType, "application/vnd.nokia.ringing-tone" ); -_LIT( KBeepOnceSound, "beep.rng" ); -_LIT( KProfileSilentTone, "No_Sound.wav" ); - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMAlertManager::CIMAlertManager -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMAlertManager::CIMAlertManager() - : iAudioPlayerStatus( EAudioPlayerNotCreated ), - iTonePlayerStatus( EAudioPlayerNotCreated ), - iIsPlayingDefaultIMSound( EFalse ) - { - } - -// --------------------------------------------------------- -// CIMAlertManager::ConstructL -// (other items were commented in a header). -// --------------------------------------------------------- -// - -void CIMAlertManager::ConstructL() - { - CHAT_DP_FUNC_ENTER("ConstructL"); - iProfileApi = CreateProfileEngineL(); - - User::LeaveIfError( iFs.Connect() ); - - CHAT_DP_TXT("CMdaAudioPlayerUtility::NewL()" ); - - iAudioPlayer = CMdaAudioPlayerUtility::NewL( *this ); - iAudioPlayerStatus = EAudioPlayerReady; - - CHAT_DP_TXT("CMdaAudioToneUtility::NewL()" ); - iTonePlayer = CMdaAudioToneUtility::NewL( *this ); - iTonePlayerStatus = EAudioPlayerReady; - - iProfilesRepository = CRepository::NewL( KCRUidProfileEngine ); - iVibraRepository = CRepository::NewL( KCRUidVibraCtrl ); - - // Get initial settings from active profile - iRingingVolumeNotifyHandler = CCenRepNotifyHandler::NewL( *this, - *iProfilesRepository, - CCenRepNotifyHandler::EIntKey, - KProEngActiveRingingVolume ); - iRingingVolumeNotifyHandler->StartListeningL(); - - - iRingingTypeNotifyHandler = CCenRepNotifyHandler::NewL( *this, - *iProfilesRepository, - CCenRepNotifyHandler::EIntKey, - KProEngActiveRingingType ); - iRingingTypeNotifyHandler->StartListeningL(); - - - iVibraNotifyHandler = CCenRepNotifyHandler::NewL( *this, *iVibraRepository, - CCenRepNotifyHandler::EIntKey, - KVibraCtrlProfileVibraEnabled ); - iVibraNotifyHandler->StartListeningL(); - - User::LeaveIfError( iProfilesRepository->Get( KProEngActiveRingingVolume, - iRingingVolume ) ); - - User::LeaveIfError( iVibraRepository->Get( KVibraCtrlProfileVibraEnabled, - iVibra ) ); - - User::LeaveIfError( iApaSession.Connect() ); - - // register for changes in message Tone quitting - iNotifierAPI = IMAlertNotifierFactory::CreateNotifierL( this ); - iNotifierAPI->ListenKeyChanges( MIMAlertNotifierInterface::EMSGToneQuitKey ); - - iToneFileName = HBufC::NewL( KMaxPath ); - - // Get path to beep once ringing tone, first check simple sound folder. - TFileName beepFile = PathInfo::RomRootPath(); - beepFile.Append( PathInfo::SimpleSoundsPath() ); - beepFile.Append( KBeepOnceSound ); - RFile file; - TInt openErr = file.Open( iFs, beepFile, EFileRead ); - file.Close(); - - if ( openErr == KErrNotFound || openErr == KErrPathNotFound ) - { - // Check digital sounds folder - beepFile.Zero(); - beepFile.Append( PathInfo::RomRootPath() ); - beepFile.Append( PathInfo::DigitalSoundsPath() ); - beepFile.Append( KBeepOnceSound ); - openErr = file.Open( iFs, beepFile, EFileRead ); - file.Close(); - } - - CHAT_DP( D_PLAIN_LIT( "CIMAlertManager::ConstructL() openErr = %d" ), openErr ); - - if ( openErr == KErrNone ) - { - iBeepRingingTone = beepFile.AllocL(); - TPtrC ptr = iBeepRingingTone->Des(); - CHAT_DP( D_PLAIN_LIT( "CIMAlertManager::ConstructL() iBeepRingingTone = %S" ), &ptr ); - } - else - { - HandleError( openErr ); - } - - // get active ringing type, change events come to us later... - iActiveProfile = iProfileApi->ActiveProfileL(); - const MProfileTones& profileTones = iActiveProfile->ProfileTones(); - const TProfileToneSettings& profileSettings = profileTones.ToneSettings(); - iRingingType = profileSettings.iRingingType; - iActiveProfile->Release(); - iActiveProfile = NULL; // prevent further usage - // after this, active ringing type changes are notified via the cenrep - // notify handler callback through HandleNotifyInt - - // TRAP to catch leaves, leaves with KErrNotSupported if vibra - // is not supported - TRAPD( err, iVibrator = CHWRMVibra::NewL() ); - if ( err == KErrNotSupported ) - { - // Make sure it's NULL - iVibrator = NULL; - } - else - { - // Leave with other errors e.g. KErrNoMemory - User::LeaveIfError( err ); - } - iSettingsStore = CVIMPSTSettingsStore::NewL(); - CHAT_DP_FUNC_DONE("ConstructL"); - } - -// --------------------------------------------------------- -// CIMAlertManager::NewL -// (other items were commented in a header). -// --------------------------------------------------------- -EXPORT_C CIMAlertManager* CIMAlertManager::NewL() - { - CIMAlertManager* self = new( ELeave ) CIMAlertManager(); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// --------------------------------------------------------- -// CIMAlertManager::~CIMAlertManager -// (other items were commented in a header). -// --------------------------------------------------------- -CIMAlertManager::~CIMAlertManager() - { - CHAT_DP_FUNC_ENTER("~CIMAlertManager"); - Stop(); // Stops possible playback - - if ( iActiveProfile ) - { - iActiveProfile->Release(); - iActiveProfile = NULL; // prevent further usage - } - - if ( iProfileApi ) - { - iProfileApi->Release(); - iProfileApi = NULL; - } - - if ( iVibraNotifyHandler ) - { - iVibraNotifyHandler->StopListening(); - delete iVibraNotifyHandler; - iVibraNotifyHandler = NULL; - } - - if ( iRingingTypeNotifyHandler ) - { - iRingingTypeNotifyHandler->StopListening(); - delete iRingingTypeNotifyHandler; - iRingingTypeNotifyHandler = NULL; - } - - - if ( iRingingVolumeNotifyHandler ) - { - iRingingVolumeNotifyHandler->StopListening(); - delete iRingingVolumeNotifyHandler; - iRingingVolumeNotifyHandler = NULL; - } - if(iProfilesRepository) - { - delete iProfilesRepository; - iProfilesRepository = NULL; - } - if(iVibraRepository) - { - delete iVibraRepository; - iVibraRepository = NULL; - } - - iApaSession.Close(); - - if(iNotifierAPI) - { - delete iNotifierAPI; - iNotifierAPI = NULL; - } - - if(iAudioPlayer) - { - CHAT_DP_TXT( "delete CMdaAudioPlayerUtility" ); - iAudioPlayer->Close(); - delete iAudioPlayer; - iAudioPlayer = NULL; - } - if(iTonePlayer) - { - CHAT_DP_TXT( "delete CMdaAudioToneUtility" ); - delete iTonePlayer; - iTonePlayer = NULL; - } - - iObservers.Close(); - - if(iToneFileName) - { - delete iToneFileName; - iToneFileName = NULL; - } - - if(iVibrator) - { - delete iVibrator; - iVibrator = NULL; - } - - if(iBeepRingingTone) - { - delete iBeepRingingTone; - iBeepRingingTone = NULL; - } - - iFs.Close(); - - if(iSettingsStore) - { - delete iSettingsStore; - iSettingsStore = NULL; - } - - CHAT_DP_FUNC_DONE("~CIMAlertManager"); - } - - -// --------------------------------------------------------- -// CIMAlertManager::Play -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C void CIMAlertManager::PlayL(TUint32 aServiceId) - { - CHAT_DP_FUNC_ENTER("Play"); - TInt emergencyCallOngoing(0); - TInt err = RProperty::Get( KPSUidCtsyEmergencyCallInfo, KCTSYEmergencyCallInfo, emergencyCallOngoing ); - - if( !emergencyCallOngoing ) - { - Stop(); - TRAPD( err, DoPlayL(aServiceId) ); - if( err ) - { - HandleError( err ); - } - } - CHAT_DP_FUNC_DONE("Play"); - } - -// --------------------------------------------------------- -// CIMAlertManager::DoPlayL -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C void CIMAlertManager::DoPlayL(TUint32 aServiceId) - { - CHAT_DP_FUNC_ENTER("DoPlayL"); - - TBuf toneFileName; - - // check if we're silent or not - iActiveProfile = iProfileApi->ActiveProfileL(); - TBool isSilent = iActiveProfile->IsSilent(); - iActiveProfile->Release(); - iActiveProfile = NULL; // prevent further usage - - // vibrate, if it's allowed - CHWRMVibra::TVibraModeState vibraModeState = iVibrator->VibraSettings(); - CHWRMVibra::TVibraStatus vibraStatus = iVibrator->VibraStatus(); - - // TODO: Find from Nikhil what the behaviour should be if Vibra is already - // on and you get a new message. Aare you supposed to truncate the existing - // vibration and start afresh or let the existing vibration continue? - if ( vibraModeState == CHWRMVibra::EVibraModeON && - vibraStatus == CHWRMVibra::EVibraStatusStopped ) - { - iVibrator->StartVibraL( KIMVibraDuration ); - } - - // sound ordering: - // silent: get out. - // beep once: beep, and if ok, exit. - // if beep failed, or not active: try to play sound - // for this server. - // if it failed, play default sound. - - if ( isSilent ) - { - // Silent profile, get out. - CHAT_DP_TXT( "DoPlayL - Returning" ); - return; - } - - TInt err = KErrNone; - - if ( iRingingType == EProfileRingingTypeBeepOnce && iBeepRingingTone ) - { - // Play beep.rng - TRAP( err, ProcessFileL( *iBeepRingingTone ) ); - } - - if ( err != KErrNone || iRingingType != EProfileRingingTypeBeepOnce ) - { - err = KErrNone; - - // Beep once not active, or beep once failed. - // Try to play the sound set for this server - TBuf toneFileName; - GetToneFileNameL( toneFileName, aServiceId ); - TParsePtr parsedPtr( toneFileName ); - - CHAT_DP( D_CHAT_LIT(" file = [%S] "),&toneFileName); - - // If alert tone OFF, don't play anything - if( parsedPtr.NameAndExt().Compare( KProfileSilentTone ) != 0 ) - { - // Not OFF - TRAP( err, ProcessFileL( toneFileName ) ); - } - } - - // Not ringing once, but left - User::LeaveIfError( err ); - - CHAT_DP_FUNC_DONE("DoPlayL"); - } - -// --------------------------------------------------------- -// CIMAlertManager::Stop -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C void CIMAlertManager::Stop() - { - CHAT_DP_FUNC_ENTER("Stop"); - - if( iAudioPlayerStatus == EAudioPlayerPlaying ) - { - CHAT_DP_TXT( - "Audio player is playing. CMdaAudioPlayerUtility::Stop()" ); - iAudioPlayer->Stop(); - iAudioPlayer->Close(); - iAudioPlayerStatus = EAudioPlayerReady; - } - - if( iTonePlayerStatus == EAudioPlayerPlaying ) - { - CHAT_DP_TXT( - "Tone player is playing. CMdaAudioToneUtility::CancelPlay()" ); - iTonePlayer->CancelPlay(); - iTonePlayerStatus = EAudioPlayerReady; - } - - CHAT_DP_FUNC_DONE("Stop"); - } - -// --------------------------------------------------------- -// CIMAlertManager::SetVolume -// Set the volume at which the sound is played -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C void CIMAlertManager::SetVolume( TInt aVolume ) - { - iRingingVolumeNotifyHandler->StopListening(); - iRingingVolume = aVolume; - } - -// --------------------------------------------------------- -// CIMAlertManager::SetRingingType -// Sets the ringing type how the sound is played -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C void CIMAlertManager::SetRingingType( TProfileRingingType aRingingType ) - { - if(iRingingTypeNotifyHandler) - { - iRingingTypeNotifyHandler->StopListening(); - iRingingType = aRingingType; - } - } - -// --------------------------------------------------------- -// CIMAlertManager::SetVibra -// Sets the vibrating alert on or off -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C void CIMAlertManager::SetVibra( TBool aVibra ) - { - if(iVibraNotifyHandler) - { - iVibraNotifyHandler->StopListening(); - iVibra = aVibra; - } - } - -// --------------------------------------------------------- -// CIMAlertManager::AddObserverL -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C void CIMAlertManager::AddObserverL( const MIMAlertManagerObserver* aObserver ) - { - // make sure that aObserver does not get appended in release mode also. - if( aObserver ) - { - User::LeaveIfError( iObservers.Append( aObserver ) ); - } - } - -// --------------------------------------------------------- -// CIMAlertManager::RemoveObserver -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C void CIMAlertManager::RemoveObserver( const MIMAlertManagerObserver* aObserver ) - { - TInt index( iObservers.Find( aObserver ) ); - - if( index != KErrNotFound ) - { - iObservers.Remove( index ); - } - } - -// --------------------------------------------------------- -// CIMAlertManager::ProcessFileL -// If filename is defined, prepare the audioplayer. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMAlertManager::ProcessFileL( const TDesC& aFileName ) - { - CHAT_DP_FUNC_ENTER("ProcessFileL"); - - TFileName *fileName = new (ELeave) TFileName(); - CleanupStack::PushL( fileName ); - - // if filename is empty, use default sound - if ( aFileName.Length() == 0 ) - { - return; - } - else - { - *fileName = aFileName; - } - - TPtr filePtr( NULL, 0 ); - if( !BaflUtils::FileExists( iFs, *fileName ) ) - { - CHAT_DP( D_CHAT_LIT( "File does not exist ( %S )" ), &(*fileName) ); - User::Leave( KErrNotFound ); - } - - Stop(); // Stops possible playback - - TUid dummyUid( KNullUid ); - TDataType dataType; - - User::LeaveIfError( iApaSession.AppForDocument( *fileName, dummyUid, - dataType ) ); - - if( dataType.Des().CompareF( KChatRngMimeType ) == 0 ) - { - // making sure that another initializing is not already ongoing - if( iTonePlayerStatus == EAudioPlayerReady ) - { - CHAT_DP( D_CHAT_LIT( - "CMdaAudioToneUtility::PrepareToPlayFileSequence( %S )" ), - &(*fileName)); - iTonePlayerStatus = EAudioPlayerInitializing; - iTonePlayer->PrepareToPlayFileSequence( *fileName ); - } - } - else - { - // making sure that another initializing is not already ongoing - if( iAudioPlayerStatus == EAudioPlayerReady ) - { - CHAT_DP( D_CHAT_LIT( - "FileList - CMdaAudioPlayerUtility::OpenFileL( %S )" ), - &(*fileName)); - iAudioPlayerStatus = EAudioPlayerInitializing; - TRAPD( err, iAudioPlayer->OpenFileL( *fileName ) ); - CHAT_DP( D_CHAT_LIT( - "FileList - CMdaAudioPlayerUtility::OpenFileL err = %d" ), - err ); - if( err ) - { - iAudioPlayerStatus = EAudioPlayerReady; - User::Leave( err ); - } - } - } - - CleanupStack::PopAndDestroy( fileName ); - CHAT_DP_FUNC_DONE("ProcessFileL"); - } - -// --------------------------------------------------------- -// CIMAlertManager::DoSetRingingType -// When audioplayer is ready, set its ringing type -// (other items were commented in a header). -// --------------------------------------------------------- -// - -void CIMAlertManager::DoSetRingingType( TInt aRingingType ) - { - if( iAudioPlayerStatus == EAudioPlayerInitialized ) - { - switch( aRingingType ) - { - // Fall through - case EProfileRingingTypeRingingOnce: - { - iAudioPlayer->SetRepeats( 0, - TTimeIntervalMicroSeconds( KToneInterval ) ); - break; - } - case EProfileRingingTypeBeepOnce: - { - iAudioPlayer->SetRepeats( 0, - TTimeIntervalMicroSeconds( KToneInterval ) ); - break; - } - default: - { - break; - } - } - } - else if( iTonePlayerStatus == EAudioPlayerInitialized ) - { - switch( aRingingType ) - { - // Fall through - case EProfileRingingTypeRingingOnce: - { - iTonePlayer->SetRepeats( 0, - TTimeIntervalMicroSeconds( KToneInterval ) ); - break; - } - case EProfileRingingTypeBeepOnce: - { - iTonePlayer->SetRepeats( 0, - TTimeIntervalMicroSeconds( KToneInterval ) ); - break; - } - default: - { - break; - } - } - } - } - -// --------------------------------------------------------- -// CIMAlertManager::ConvertVolume -// Convert volume to the scale used by hardware. -// E.g. Profiles lets user select volume 1-10, but hw's scale is normally 1-9. -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CIMAlertManager::ConvertVolume( TInt aVolume ) - { - TInt result( 0 ); - // if ringing type is "silent" then volume - // is zero - if( iRingingType != EProfileRingingTypeSilent ) - { - if ( iAudioPlayerStatus == EAudioPlayerInitialized || - iAudioPlayerStatus == EAudioPlayerPlaying ) - { - result = iAudioPlayer->MaxVolume() * aVolume / KMaxVolumeLevel; - if ( aVolume == KMinVolumeLevel && result == 0 ) - { - result = 1; - } - } - else if( iTonePlayerStatus == EAudioPlayerInitialized || - iTonePlayerStatus == EAudioPlayerPlaying ) - { - result = iTonePlayer->MaxVolume() * aVolume / KMaxVolumeLevel; - if ( aVolume == KMinVolumeLevel && result == 0 ) - { - result = 1; - } - } - } - return result; - } - -// --------------------------------------------------------- -// CIMAlertManager::HandleError -// Notifies all observers that playing is completed -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMAlertManager::HandleError( TInt aError ) - { - if ( ( aError == KErrNoMemory ) || - ( aError == KErrDiskFull ) ) - { - CActiveScheduler::Current()->Error( aError ); - } - } - -// --------------------------------------------------------- -// CIMAlertManager::GetToneFileNameL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMAlertManager::GetToneFileNameL( TDes& aToneFileName ,TUint32 aServiceId) - { - RBuf buffer; - buffer.CreateL( RProperty::KMaxPropertySize ); - CleanupClosePushL( buffer ); - iSettingsStore->GetL(aServiceId, EServiceToneFileName, buffer); - aToneFileName.Copy( buffer ); - CleanupStack::PopAndDestroy(); //buffer - } - -// --------------------------------------------------------- -// CIMAlertManager::MapcInitComplete -// This method is called when the audioplayer initialisation is ready. -// If file format is supported, start playing the sound file. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMAlertManager::MapcInitComplete( - TInt aError, const TTimeIntervalMicroSeconds& /* aDuration */ ) - { - CHAT_DP( D_CHAT_LIT( - "MMdaAudioPlayerCallback::MapcInitComplete() callback, error == %d" ), - aError); - - if ( !aError && iAudioPlayerStatus == EAudioPlayerInitializing ) - { - iAudioPlayerStatus = EAudioPlayerInitialized; - // currently IM messages supports only this ringing type - // ringing once - DoSetRingingType( EProfileRingingTypeRingingOnce ); - CHAT_DP( D_CHAT_LIT("CMdaAudioPlayerUtility::SetVolume( %d )" ), - iRingingVolume); - - iAudioPlayer->SetVolume( ConvertVolume( iRingingVolume ) ); - - // TODO: please check the value KAudioPrefNewSpecialMessage. - // WHy does it have this particular value? What is the rationale. - // - CHAT_DP( D_CHAT_LIT("CMdaAudioPlayerUtility::SetPriority( %d, %d )" ), - KAudioPriorityRecvMsg, - TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) ); - - iAudioPlayer->SetPriority( KAudioPriorityRecvMsg, - TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) ); - - CHAT_DP_TXT("CMdaAudioPlayerUtility::Play()" ); - iAudioPlayer->Play(); - iAudioPlayerStatus = EAudioPlayerPlaying; - iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, - ECoreAppUIsTonePlaying ); - } - else - { - Stop(); - iAudioPlayerStatus = EAudioPlayerReady; - if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) )) - { - return; - } - else - { - HandleError( aError ); - iIsPlayingDefaultIMSound = EFalse; - } - } - } - -// --------------------------------------------------------- -// CIMAlertManager::MapcPlayComplete -// This method is called when the audioplayer has finished playing a sound -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMAlertManager::MapcPlayComplete( TInt aError ) - { - CHAT_DP( D_CHAT_LIT( - "MMdaAudioPlayerCallback::MapcPlayComplete() callback, error == %d" ), - aError); - iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, ECoreAppUIsTonePlayingUninitialized ); - iAudioPlayer->Close(); - iAudioPlayerStatus = EAudioPlayerReady; - - if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) ) - { - return; - } - else - { - HandleError( aError ); - iIsPlayingDefaultIMSound = EFalse; - } - } - -// --------------------------------------------------------- -// CIMAlertManager::HandleKeyChange -// This method receives notifications from the shared data server -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMAlertManager::HandleKeyChange( TUpdatedKey& aUpdatedValues ) - { - CHAT_DP_FUNC_ENTER("HandleKeyChange"); - - // If we have an event which changes the key value to - // ECoreAppUIsStopTonePlaying -> stop playing. - if( aUpdatedValues.iValue == ECoreAppUIsStopTonePlaying ) - { - // Message tone should be stopped - CHAT_DP_TXT( "**stop playing!**" ); - Stop(); - } - - CHAT_DP_FUNC_DONE("HandleKeyChange"); - } - -// --------------------------------------------------------- -// CIMAlertManager::HandleNotifyInt -// (other items were commented in a header). -// --------------------------------------------------------- -void CIMAlertManager::HandleNotifyInt( TUint32 aId, TInt aNewValue ) - { - CHAT_DP_FUNC_ENTER("HandleNotifyL"); - CHAT_DP( D_CHAT_LIT("aKey == %d" ), aId); - CHAT_DP( D_CHAT_LIT("aValue == %d" ), aNewValue); - - - if ( aId == KProEngActiveRingingVolume ) // Ringing volume has changed - { - iRingingVolume = aNewValue; - } - else if ( aId == KProEngActiveRingingType ) // Ringing type has changed - { - iRingingType = aNewValue; - } - - if ( aId == KVibraCtrlProfileVibraEnabled ) // Vibra setting has changed - { - iVibra = aNewValue; - } - - CHAT_DP_FUNC_DONE("HandleNotifyL"); - } - -// --------------------------------------------------------- -// CIMAlertManager::MatoPrepareComplete -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMAlertManager::MatoPrepareComplete( TInt aError ) - { - CHAT_DP( D_CHAT_LIT( - "MMdaAudioToneObserver::MatoPrepareComplete() callback, error == %d" ), - aError); - - if ( !aError && iTonePlayerStatus == EAudioPlayerInitializing ) - { - iTonePlayerStatus = EAudioPlayerInitialized; - // TODO: confirm with UI spec/Nikhil if only this ringing type is - // supported. If not in writing, get an entry into the UI spec done. - // TODO: where is this requirement specified? - - // currently IM messages supports only this ringing type - // ringing once - DoSetRingingType( EProfileRingingTypeRingingOnce ); - CHAT_DP( D_CHAT_LIT("CMdaAudioToneUtility::SetVolume( %d )" ), - ConvertVolume( iRingingVolume )); - iTonePlayer->SetVolume( ConvertVolume( iRingingVolume ) ); - - - CHAT_DP( D_CHAT_LIT("CMdaAudioToneUtility::SetPriority( %d, %d )" ), - KAudioPriorityRecvMsg, - TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) ); - - iTonePlayer->SetPriority( KAudioPriorityRecvMsg, - TMdaPriorityPreference( KAudioPrefNewSpecialMessage ) ); - - CHAT_DP_TXT("CMdaAudioToneUtility::Play()" ); - iTonePlayer->Play(); - iTonePlayerStatus = EAudioPlayerPlaying; - iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, - ECoreAppUIsTonePlaying ); - } - else - { - Stop(); - iTonePlayerStatus = EAudioPlayerReady; - - if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) ) - { - return; - } - else - { - HandleError( aError ); - iIsPlayingDefaultIMSound = EFalse; - } - } - } - -// --------------------------------------------------------- -// CIMAlertManager::MatoPlayComplete -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CIMAlertManager::MatoPlayComplete( TInt aError ) - { - CHAT_DP( D_CHAT_LIT( - "MMdaAudioToneObserver::MatoPlayComplete() callback, error == %d" ), - aError); - iNotifierAPI->SetInt( MIMAlertNotifierInterface::EMSGToneQuitKey, ECoreAppUIsTonePlayingUninitialized ); - iTonePlayerStatus = EAudioPlayerReady; - - if( ( ( aError == KErrNotSupported ) || ( aError == KErrCorrupt ) ) ) - { - return ; - } - else - { - HandleError( aError ); - iIsPlayingDefaultIMSound = EFalse; - } - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/src/cimalertnotifierimpl.cpp --- a/instantmessagesalert/src/cimalertnotifierimpl.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* 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: Publish and subscribe implementation. -* -*/ - -// INCLUDE FILES -#include "cimalertnotifierimpl.h" -#include "mimalertnotifierkeyobserver.h" -#include "cimalertpropertyobserver.h" -#include - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMAlertNotifierImpl::CIMAlertNotifierImpl -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMAlertNotifierImpl::CIMAlertNotifierImpl( MIMAlertNotifierKeyObserver* aObserver ) -:iObserver( aObserver ) - { - } - -// ----------------------------------------------------------------------------- -// CIMAlertNotifierImpl::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMAlertNotifierImpl* CIMAlertNotifierImpl::NewL( MIMAlertNotifierKeyObserver* aObserver ) - { - CIMAlertNotifierImpl* self = new( ELeave ) CIMAlertNotifierImpl( aObserver ); - return self; - } - - -// Destructor -CIMAlertNotifierImpl::~CIMAlertNotifierImpl() - { - delete iPropWatcher; - } - -// ----------------------------------------------------------------------------- -// CIMAlertNotifierImpl::SetInt -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMAlertNotifierImpl::SetInt( TNotifyKey aKey, TInt aValue ) - { - TInt err = KErrNone; - switch ( aKey ) - { - case EMSGToneQuitKey: - err = RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit, aValue ); - break; - default: - { - return KErrNotFound; - } - } - return err; - } - -// ----------------------------------------------------------------------------- -// CIMAlertNotifierImpl::GetInt -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMAlertNotifierImpl::GetInt( TNotifyKey aKey, TInt& aValue ) - { - TInt err = KErrNone; - switch ( aKey ) - { - case EMSGToneQuitKey: - { - err = RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit, aValue ); - break; - } - default: - { - err = KErrNotFound; - break; - } - } - return err; - } - -// ----------------------------------------------------------------------------- -// CIMAlertNotifierImpl::ListenKeyChanges -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CIMAlertNotifierImpl::ListenKeyChanges( TNotifyKey aKey ) - { - TInt err = KErrNone; - delete iPropWatcher; - iPropWatcher = NULL; - switch ( aKey ) - { - case EMSGToneQuitKey: - { - TRAP( err, iPropWatcher = CIMAlertPropertyObserver::NewL( *this ) ); - if( !err ) - { - TRAP( err, iPropWatcher->ObservePropertyChangeL( - KPSUidCoreApplicationUIs, KCoreAppUIsMessageToneQuit ) ); - } - break; - } - default: - { - err = KErrNotFound; - break; - } - } - return err; - } - -// ----------------------------------------------------------------------------- -// CIMAlertNotifierImpl::HandlePropertyNotificationEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMAlertNotifierImpl::HandlePropertyNotificationEventL( TUid /* aCategory */, TUint aKey ) - { - TInt value( 0 ); - User::LeaveIfError( - RProperty::Get( KPSUidCoreApplicationUIs, aKey, value ) ); - TUpdatedKey key; - key.iUid = KPSUidCoreApplicationUIs; - key.iKey = aKey; - key.iValue = value; - iObserver->HandleKeyChange( key ); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/src/cimalertpropertyobserver.cpp --- a/instantmessagesalert/src/cimalertpropertyobserver.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* 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: Publish & Subscribe property change observer implementation -* -*/ - -// INCLUDE FILES -#include "cimalertpropertyobserver.h" -#include "mimalertpropertynotificationobserver.h" - -#include -#include -#include - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CIMAlertPropertyObserver::CIMAlertPropertyObserver -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CIMAlertPropertyObserver::CIMAlertPropertyObserver( - MIMAlertPropertyNotificationObserver& aObserver ) - : CActive( CActive::EPriorityLow ), - iObserver( aObserver ) - { - CActiveScheduler::Add( this ); - } - - -// ----------------------------------------------------------------------------- -// CIMAlertPropertyObserver::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CIMAlertPropertyObserver* CIMAlertPropertyObserver::NewL( - MIMAlertPropertyNotificationObserver& aObserver ) - { - CIMAlertPropertyObserver* self = new( ELeave ) CIMAlertPropertyObserver( aObserver ); - return self; - } - - -// Destructor -CIMAlertPropertyObserver::~CIMAlertPropertyObserver() - { - if( IsActive() ) - { - Cancel(); - } - } - - -// ----------------------------------------------------------------------------- -// CIMAlertPropertyObserver::ObservePropertyChangeL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMAlertPropertyObserver::ObservePropertyChangeL( TUid aCategory, TUint aKey ) - { - if( IsActive() ) - { - return; - } - User::LeaveIfError( iProperty.Attach( aCategory, aKey ) ); - iKey = aKey; - iCategory = aCategory; - iProperty.Subscribe( iStatus ); - SetActive(); - } - -// ----------------------------------------------------------------------------- -// CIMAlertPropertyObserver::CancelObserve -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMAlertPropertyObserver::CancelObserve() - { - if( IsActive() ) - { - Cancel(); - } - } - -// ----------------------------------------------------------------------------- -// CIMAlertPropertyObserver::RunL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMAlertPropertyObserver::RunL() - { - iProperty.Subscribe( iStatus ); - SetActive(); - iObserver.HandlePropertyNotificationEventL( iCategory, iKey ); - } - -// ----------------------------------------------------------------------------- -// CIMAlertPropertyObserver::DoCancel -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CIMAlertPropertyObserver::DoCancel() - { - iProperty.Cancel(); - } - -// ----------------------------------------------------------------------------- -// CIMAlertPropertyObserver::Category -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TUid CIMAlertPropertyObserver::Category() - { - return iCategory; - } - -// ----------------------------------------------------------------------------- -// CIMAlertPropertyObserver::Key -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TUint CIMAlertPropertyObserver::Key() - { - return iKey; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/src/imalertnotifierfactory.cpp --- a/instantmessagesalert/src/imalertnotifierfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* 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: Publish and Subscribe factory method implementation -* -*/ - -// INCLUDE FILES -#include "imalertnotifierfactory.h" -#include "mimalertnotifierinterface.h" -#include "cimalertnotifierimpl.h" - - -// ============================ MEMBER FUNCTIONS =============================== - -// --------------------------------------------------------- -// IMAlertNotifierFactory::CreateNotifierL -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C MIMAlertNotifierInterface* IMAlertNotifierFactory::CreateNotifierL( MIMAlertNotifierKeyObserver* aObserver ) - { - return CIMAlertNotifierImpl::NewL( aObserver ); - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/ReadMe.txt --- a/instantmessagesalert/tsrc/testinstantmsgalert/ReadMe.txt Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# -# 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: ReadMe.txt -# -# - -This Test Code is written in Stiff ( Test Scripter) -Stubs folder is reused from - MeCo_Domain/conversations/uiservicetab/Internal/tsrc/vimpstengine_ut/src/ -Total Number of Test Cases - 17 -Branch Coverage - 45 -Function Coverage - 85 - -To update a Test Case: - Update cfg file - Update testinstantmsgalertBlocks.cpp - Update testinstantmsgalert.cpp diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/bmarm/testinstantmsgalertU.DEF --- a/instantmessagesalert/tsrc/testinstantmsgalert/bmarm/testinstantmsgalertU.DEF Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/bwins/testinstantmsgalertu.def --- a/instantmessagesalert/tsrc/testinstantmsgalert/bwins/testinstantmsgalertu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - ?AddObserverL@CIMAlertManager@@UAEXPBVMIMAlertManagerObserver@@@Z @ 2 NONAME ; void CIMAlertManager::AddObserverL(class MIMAlertManagerObserver const *) - ?CreateNotifierL@IMAlertNotifierFactory@@SAPAVMIMAlertNotifierInterface@@PAVMIMAlertNotifierKeyObserver@@@Z @ 3 NONAME ; class MIMAlertNotifierInterface * IMAlertNotifierFactory::CreateNotifierL(class MIMAlertNotifierKeyObserver *) - ?DoPlayL@CIMAlertManager@@AAEXK@Z @ 4 NONAME ; void CIMAlertManager::DoPlayL(unsigned long) - ?NewL@CIMAlertManager@@SAPAV1@XZ @ 5 NONAME ; class CIMAlertManager * CIMAlertManager::NewL(void) - ?NewL@CVIMPSTSettingsStore@@SAPAVMVIMPSTSettingsStore@@XZ @ 6 NONAME ; class MVIMPSTSettingsStore * CVIMPSTSettingsStore::NewL(void) - ?NewLC@CVIMPSTSettingsStore@@SAPAVMVIMPSTSettingsStore@@XZ @ 7 NONAME ; class MVIMPSTSettingsStore * CVIMPSTSettingsStore::NewLC(void) - ?PlayL@CIMAlertManager@@UAEXK@Z @ 8 NONAME ; void CIMAlertManager::PlayL(unsigned long) - ?RemoveObserver@CIMAlertManager@@UAEXPBVMIMAlertManagerObserver@@@Z @ 9 NONAME ; void CIMAlertManager::RemoveObserver(class MIMAlertManagerObserver const *) - ?SetRingingType@CIMAlertManager@@UAEXW4TProfileRingingType@@@Z @ 10 NONAME ; void CIMAlertManager::SetRingingType(enum TProfileRingingType) - ?SetVibra@CIMAlertManager@@UAEXH@Z @ 11 NONAME ; void CIMAlertManager::SetVibra(int) - ?SetVolume@CIMAlertManager@@UAEXH@Z @ 12 NONAME ; void CIMAlertManager::SetVolume(int) - ?Stop@CIMAlertManager@@UAEXXZ @ 13 NONAME ; void CIMAlertManager::Stop(void) - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/conf/testinstantmsgalert.cfg --- a/instantmessagesalert/tsrc/testinstantmsgalert/conf/testinstantmsgalert.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -[Define] -USERID testmeco -[Enddefine] - - -[Test] -title 1.NewL-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_NewL USERID -delete object -[Endtest] -[Test] -title 2.PlayL-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_PlayL USERID -delete object -[Endtest] -[Test] -title 3.Stop-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_Stop USERID -delete object -[Endtest] -[Test] -title 4.SetVolume-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_SetVolume USERID -delete object -[Endtest] -[Test] -title 5.SetRingingType-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_SetRingingType USERID -delete object -[Endtest] -[Test] -title 6.SetVibra-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_SetVibra USERID -delete object -[Endtest] -[Test] -title 7.DoSetRingingType-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_DoSetRingingType USERID -delete object -[Endtest] -[Test] -title 8.ConvertVolume-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_ConvertVolume USERID -delete object -[Endtest] -[Test] -title 9.MapcInitComplete-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_MapcInitComplete USERID -delete object -[Endtest] -[Test] -title 10.MapcPlayComplete-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_MapcPlayComplete USERID -delete object -[Endtest] -[Test] -title 11.HandleKeyChange-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_HandleKeyChange USERID -delete object -[Endtest] -[Test] -title 12.HandleNotifyInt-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_HandleNotifyInt USERID -delete object -[Endtest] -[Test] -title 13.MatoPrepareComplete-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_MatoPrepareComplete USERID -delete object -[Endtest] -[Test] -title 14.MatoPlayComplete-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_MatoPlayComplete USERID -delete object -[Endtest] -[Test] -title 15.AddObserverL-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_AddObserverL USERID -delete object -[Endtest] -[Test] -title 16.RemoveObserver-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_RemoveObserver USERID -delete object -[Endtest] -[Test] -title 17.HandleError-CIMAlertManager -create testinstantmsgalert object -object CIMAlertManager_HandleError USERID -delete object -[Endtest] diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/eabi/testinstantmsgalertu.def --- a/instantmessagesalert/tsrc/testinstantmsgalert/eabi/testinstantmsgalertu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - _ZN15CIMAlertManager12AddObserverLEPK23MIMAlertManagerObserver @ 2 NONAME - _ZN15CIMAlertManager14RemoveObserverEPK23MIMAlertManagerObserver @ 3 NONAME - _ZN15CIMAlertManager14SetRingingTypeE19TProfileRingingType @ 4 NONAME - _ZN15CIMAlertManager4NewLEv @ 5 NONAME - _ZN15CIMAlertManager4StopEv @ 6 NONAME - _ZN15CIMAlertManager5PlayLEm @ 7 NONAME - _ZN15CIMAlertManager7DoPlayLEm @ 8 NONAME - _ZN15CIMAlertManager8SetVibraEi @ 9 NONAME - _ZN15CIMAlertManager9SetVolumeEi @ 10 NONAME - _ZN20CVIMPSTSettingsStore4NewLEv @ 11 NONAME - _ZN20CVIMPSTSettingsStore5NewLCEv @ 12 NONAME - _ZN22IMAlertNotifierFactory15CreateNotifierLEP27MIMAlertNotifierKeyObserver @ 13 NONAME - _ZTI15CIMAlertManager @ 14 NONAME ; ## - _ZTI20CIMAlertNotifierImpl @ 15 NONAME ; ## - _ZTV15CIMAlertManager @ 16 NONAME ; ## - _ZTV20CIMAlertNotifierImpl @ 17 NONAME ; ## - _ZThn20_N15CIMAlertManager12AddObserverLEPK23MIMAlertManagerObserver @ 18 NONAME ; ## - _ZThn20_N15CIMAlertManager14RemoveObserverEPK23MIMAlertManagerObserver @ 19 NONAME ; ## - _ZThn20_N15CIMAlertManager14SetRingingTypeE19TProfileRingingType @ 20 NONAME ; ## - _ZThn20_N15CIMAlertManager4StopEv @ 21 NONAME ; ## - _ZThn20_N15CIMAlertManager5PlayLEm @ 22 NONAME ; ## - _ZThn20_N15CIMAlertManager8SetVibraEi @ 23 NONAME ; ## - _ZThn20_N15CIMAlertManager9SetVolumeEi @ 24 NONAME ; ## - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/group/bld.inf --- a/instantmessagesalert/tsrc/testinstantmsgalert/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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: -* -*/ - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these - - DEFAULT - -PRJ_TESTEXPORTS -// NOTE: If using ARS requirements all export operations should be done under this. -// 'abld test export' - -PRJ_EXPORTS - -PRJ_TESTMMPFILES - testinstantmsgalert.mmp -//PRJ_MMPFILES -// testinstantmsgalert_nrm.mmp - - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/group/ctcerr.txt --- a/instantmessagesalert/tsrc/testinstantmsgalert/group/ctcerr.txt Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -# -# 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: ctcerr.txt -# -# - -******************************************************************************* - -argv[0]: mwccsym2.exe - -*** CTC++/ctcagent command: set PATH=G:\epoc32\gcc\bin;c:\apps\actperl\bin\;c:\apps\rvct22_593\bin;c:\apps\atool;\epoc32\tools;\epoc32\gcc\bin;c:\apps\ue;c:\apps\ccm65\bin;c:\apps\carbide\x86build\symbian_tools\command_line_tools;c:\apps\actpython\.;c:\program files\pc connectivity solution\;c:\program files\thinkpad\utilities;c:\winnt\system32;c:\winnt\system32\wbem;c:\program files\ati technologies\ati control panel;c:\program files\intel\wireless\bin;c:\program files\doxygen\bin;c:\program files\graphviz2.20\bin;c:\apps\symrec;c:\apps\gracecli\bin;c:\apps\wget;c:\apps\ant\bin;c:\program files\quicktime\qtsystem\;c:\build_c\mecevo_wk51_ivalo\qt\4.4.4-temple;c:\build_c\mecevo_wk51_ivalo\qt\4.4.4-temple\bin;c:\apps\cltools;c:\apps\cmt\;c:\cygwin\bin;s:\epoc32\tools;c:\apps\pclint;c:\apps\ctc;c:\apps\sbs\bin;c:\apps\codescanner;c:\apps\symdec;c:\apps\jdk_1.6.0_11\bin;c:\apps\7zip;c:\apps\understand\bin\pc-win95;c:\apps\unzip;c:\apps\bc; && C:\APPS\ctc\ctc -c C:\APPS\ctc\sym_cw\winscw.ini @C:\DOCUME~1\amsubram\LOCALS~1\Temp\ctc3\ctcopts.rsp mwccsym2 -*** CTC++/ctcagent command status: 0 - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/group/testinstantmsgalert.mmp --- a/instantmessagesalert/tsrc/testinstantmsgalert/group/testinstantmsgalert.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* 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: MMP file for STIF Test Framework's TestScripter -* testclass test module. -* -*/ - -#include - -TARGET testinstantmsgalert.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE testinstantmsgalert.def - - - -SOURCEPATH ../src - -SOURCE testinstantmsgalert.cpp -SOURCE testinstantmsgalertBlocks.cpp - -SOURCEPATH ../../../src -SOURCE cimalertmanager.cpp -SOURCE imalertnotifierfactory.cpp -SOURCE cimalertnotifierimpl.cpp -SOURCE cimalertpropertyobserver.cpp - -SOURCEPATH ../src/stubs - -SOURCE s_vimpstsettingsstore.cpp -SOURCE s_vimpstsettingsstoreimp.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../../inc -USERINCLUDE ../../inc -USERINCLUDE ../inc/stubs - -APP_LAYER_SYSTEMINCLUDE -OS_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -//// Libraries from the source mmp file -LIBRARY euser.lib -LIBRARY centralrepository.lib -LIBRARY CenRepNotifHandler.lib -LIBRARY apgrfx.lib // for instantmessagesalert -LIBRARY mediaclientaudio.lib // for instantmessagesalert -LIBRARY apmime.lib // for instantmessagesalert -LIBRARY filelist.lib //filelist dialog, needed for tone setting item -LIBRARY PlatformEnv.lib -LIBRARY ProfileEng.lib -LIBRARY efsrv.lib -LIBRARY bafl.lib -LIBRARY HWRMVibraClient.lib -//LIBRARY vimpstsettings.lib -//// End Libraries from source mmp file - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/group/testinstantmsgalert.pkg --- a/instantmessagesalert/tsrc/testinstantmsgalert/group/testinstantmsgalert.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -; -; 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: -; -; Installation file for STIF -; - -; Languages -&EN - -; Provide value for uid -#{"STIF"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 3.0 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None - -; Install files -"/epoc32/release/armv5/udeb/testinstantmsgalert.dll" - "!:/Sys/Bin/testinstantmsgalert.dll" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/group/testinstantmsgalert_DoxyFile.txt --- a/instantmessagesalert/tsrc/testinstantmsgalert/group/testinstantmsgalert_DoxyFile.txt Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,241 +0,0 @@ -#/*TYPE TESTCLASS*/ -#/* -#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: MMP file for STIF Test Framework's TestScripter -# testclass test module. -# -#*/ - -# Doxyfile 1.4.1 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = testinstantmsgalert -PROJECT_NUMBER = -OUTPUT_DIRECTORY = G:/MeCo_Domain/conversations/instantmessagesalert/tsrc/testinstantmsgalert/ -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = YES -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = NO -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = NO -GENERATE_TESTLIST = NO -GENERATE_BUGLIST = NO -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = G:/MeCo_Domain/conversations/instantmessagesalert/tsrc/testinstantmsgalert/ -FILE_PATTERNS = *.h / - *.rh / - *.hrh -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = NO -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = YES -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = YES -TOC_EXPAND = YES -DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = YES -RTF_OUTPUT = Doc -COMPACT_RTF = YES -RTF_HYPERLINKS = YES -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = NONSHARABLE_CLASS -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/group/testinstantmsgalert_nrm.mmp --- a/instantmessagesalert/tsrc/testinstantmsgalert/group/testinstantmsgalert_nrm.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* 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: MMP file for STIF Test Framework's TestScripter -* testclass test module. -* -*/ - -#include - -TARGET testinstantmsgalert.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE testinstantmsgalert.def - -USERINCLUDE ../inc - -OS_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../src - -SOURCE testinstantmsgalert.cpp -SOURCE testinstantmsgalertBlocks.cpp - -//RESOURCE resource_file -//RESOURCE resource_file2 - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/inc/testinstantmsgalert.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/inc/testinstantmsgalert.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,213 +0,0 @@ -/* -* 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: STIF testclass declaration -* -*/ - -#ifndef TESTINSTANTMSGALERT_H -#define TESTINSTANTMSGALERT_H - -// INCLUDES -#include -#include -#include -#include -#include "mimalertmanagerobserver.h" -////* Source code include files -#include "cimalertmanager.h" -#include -#include - - - -//*/ - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def -#define TEST_CLASS_VERSION_MAJOR 0 -#define TEST_CLASS_VERSION_MINOR 0 -#define TEST_CLASS_VERSION_BUILD 0 - -// Logging path -_LIT( KtestinstantmsgalertLogPath, "//logs//testframework//testinstantmsgalert//" ); -// Log file -_LIT( KtestinstantmsgalertLogFile, "testinstantmsgalert.txt" ); -_LIT( KtestinstantmsgalertLogFileWithTitle, "testinstantmsgalert_[%S].txt" ); - -// FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; -class Ctestinstantmsgalert; - -// DATA TYPES -//enum ?declaration -//typedef ?declaration -//extern ?data_type; - -// CLASS DECLARATION - -/** -* Ctestinstantmsgalert test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS(Ctestinstantmsgalert) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static Ctestinstantmsgalert* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~Ctestinstantmsgalert(); - - public: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - - private: - - /** - * C++ default constructor. - */ - Ctestinstantmsgalert( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - /** - * Test methods are listed below. - */ - - /** - * Example test method. - * @since ?Series60_version - * @param aItem Script line containing parameters. - * @return Symbian OS error code. - */ - virtual TInt ExampleL( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_NewL( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_PlayL( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_SetVolume( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_SetRingingType( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_SetVibra( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_DoSetRingingType( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_ConvertVolume( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_Stop( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_MapcInitComplete( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_MapcPlayComplete( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_HandleKeyChange( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_HandleNotifyInt( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_MatoPrepareComplete( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_MatoPlayComplete( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_AddObserverL( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_RemoveObserver( CStifItemParser& aItem ); - virtual TInt CIMAlertManager_HandleError( CStifItemParser& aItem ); - - - - - /** - * Method used to log version of test class - */ - void SendTestClassVersion(); - - //ADD NEW METHOD DEC HERE - //[TestMethods] - Do not remove - - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - private: // Data - - // ?one_line_short_description_of_data - //?data_declaration; - - // Reserved pointer for future extension - //TAny* iReserved; - - public: // Friend classes - //?friend_class_declaration; - protected: // Friend classes - //?friend_class_declaration; - private: // Friend classes - //?friend_class_declaration; - - }; - -#endif // TESTINSTANTMSGALERT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_cactive.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_cactive.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* 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: s_cactive.cpp -* -*/ -#include - -CActiveScheduler::TLoopOwner gTLoop ; - -TBool gSetActive = EFalse; -/* - IMPORT_C ~CActive(); - IMPORT_C void Deque(); - IMPORT_C void SetPriority(TInt aPriority); - inline TBool IsAdded() const; - inline TInt Priority() const; - IMPORT_C virtual TInt RunError(TInt aError); - IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); -*/ - -void CActive::Cancel() - { - iStatus.iFlags = 0; - } - -CActive::CActive(TInt /*aPriority*/) - { - } - -void CActive::SetActive() - { - iStatus.iFlags = TRequestStatus::EActive; - } - -CActive::~CActive() - { - } - -void CActive::Deque() - { - } - -void CActive::SetPriority(TInt /*aPriority*/) - { - } - -TInt CActive::RunError(TInt /*aError*/) - { - return KErrNone; - } - -TInt CActive::Extension_(TUint /*aExtensionId*/, TAny*& /*a0*/, TAny* /*a1*/) - { - return KErrNone; - } - -void CActiveScheduler::Add(CActive* /*aActive*/) - { - } - - -void CPeriodic::Start(TTimeIntervalMicroSeconds32 /*aDelay*/, - TTimeIntervalMicroSeconds32 /*anInterval*/, - TCallBack /*aCallBack*/) - { - } - - -CActiveSchedulerWait::CActiveSchedulerWait() - { - } -CActiveSchedulerWait::~CActiveSchedulerWait() - { - } - -void CActiveSchedulerWait::Start() - { - CActiveScheduler::TLoopOwner temp = NULL; - iLoop = temp; //assign some local variable with junk value - } - -void CActiveSchedulerWait::AsyncStop() - { - iLoop = NULL; - } - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_cch.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_cch.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,301 +0,0 @@ -/* -* s_cch.cpp : 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: s_cch.cpp -* -*/ - -// EXTERNAL INCLUDES -#include -#include - -#include "s_cch.h" - -MyCchService* myService = NULL; -TBool createService = EFalse; -TBool tryAllSubserviceAvailable = EFalse; -TBool tryVoipSubServiceAvailable = EFalse; -TBool tryPresenceSubServiceAvailable = EFalse; -TBool tryIMSubServiceAvailable = EFalse; -TBool tryConnParamLeaveWithNotSupported = EFalse; -TBool tryConnParamWithSuccess = EFalse; -TBool sendObserverEvent = EFalse; -TBool getUserName = EFalse; -TBool getPassword = EFalse; -TBool tryParamTomatchOwnId =EFalse; -TBool tryConnParamWithFailure = EFalse; - - - -/*************** Stubs ****************/ -CCchService* CCch::GetService( TInt /*aServiceId*/ ) - { - if( createService && !myService ) - { - myService = new ( ELeave ) MyCchService(); - return myService; - } - - return myService; - } - - -/************* End of Stubs ************/ - - - -TInt MyCchService::Enable( TCCHSubserviceType aType ) - { - - if (sendObserverEvent) - { - if (iObserver) - { - TCchServiceStatus aStatus; - - aStatus.SetState(ECCHEnabled); - aStatus.SetError(KErrNone); - - if (tryPresenceSubServiceAvailable) - { - iObserver->ServiceStatusChanged( 10, ECCHPresenceSub, aStatus ); - } - else - { - iObserver->ServiceStatusChanged( 10, aType, aStatus ); - } - } - } - - return KErrNone; - } - -/** - * Launches service disable. See MCchServiceObserver for status changes. - * - * @param aType Type of service - * @return Symbian error - */ - TInt MyCchService::Disable( TCCHSubserviceType /*aType*/ ){ return KErrNone; } - -/** - * Returns the current service state - * - * @param aType Type of service - * @param aStatus Status of the service, return value - * @return Symbian error code - */ - TInt MyCchService::GetStatus( TCCHSubserviceType aType, - TCchServiceStatus& aStatus ) const - - { - - if ( (ECCHVoIPSub == aType) && (tryVoipSubServiceAvailable || tryAllSubserviceAvailable) ) - { - aStatus.SetState(ECCHUninitialized); - aStatus.SetError(KErrNone); - return KErrNone; - } - - else if ( (ECCHPresenceSub == aType) && (tryPresenceSubServiceAvailable || tryAllSubserviceAvailable) ) - { - aStatus.SetState(ECCHUninitialized); - aStatus.SetError(KErrNone); - return KErrNone; - } - - else if ( (ECCHIMSub == aType) && (tryIMSubServiceAvailable || tryAllSubserviceAvailable) ) - { - aStatus.SetState(ECCHUninitialized); - aStatus.SetError(KErrNone); - return KErrNone; - } - - return KErrNotFound ; - - } - -/** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt MyCchService::GetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, TInt& /*aValue*/ ) const{ return KErrNone;} - -/** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt MyCchService::GetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, RBuf& aValue ) const - - { - if (tryConnParamLeaveWithNotSupported) - { - return KErrNotSupported; - } - - if (tryConnParamWithSuccess) - { - aValue.Copy(KTestUserName); - } - if (tryParamTomatchOwnId) - { - aValue.Copy(KOwnUserNameMatch); - } - if ( getUserName ) - { - aValue.Copy(KTestUserName); - } - if ( getPassword ) - { - aValue.Copy(KTestPassword); - } - if(tryConnParamWithFailure) - { - return KErrNotFound; - } - - return KErrNone; - } - -/** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt MyCchService::SetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, TInt /*aValue*/ ) - - { - return KErrNone; - } - -/** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt MyCchService::SetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, const TDesC& /*aValue*/ ) - { - if (tryConnParamLeaveWithNotSupported) - { - return KErrNotSupported; - } - - return KErrNone; - } - -/** - * Reserves the service for exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt MyCchService::Reserve( TCCHSubserviceType /*aType*/ ){ return KErrNone; } - -/** - * Frees the service of exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt MyCchService::Free( TCCHSubserviceType /*aType*/ ){ return KErrNone; } - -/** - * Is the service reserved - * - * @param aType Type of service - * @param aReserved True if the service is reserved - * @return Symbian error code - */ - TInt MyCchService::IsReserved( TCCHSubserviceType /*aType*/, TBool& /*aReserved*/ ) const{ return KErrNone; } - -/** - * Returns the service id - * - * @return The id of the service - */ - TInt MyCchService::ServiceId() const{ return KErrNone; } - -/** - * @deprecated Do not use this anymore, change to AddObserver! - * - * Adds observer for listening service events - * - * @param aObserver Event observing class - */ - void MyCchService::SetObserver( MCchServiceStatusObserver& aObserver ) - { - iObserver = &aObserver; - } - -/** - * @deprecated Do not use this anymore, change to - * RemoveObserver method with paramater - * - * Removes the observer of service events - */ - void MyCchService::RemoveObserver( ) - { - iObserver = NULL; - } - - -/** - * Adds observer for listening service events - * - * @param aObserver Event observing class - * @return KErrAlreadyExist Observer already added - * KErrNone Observer was added - */ - TInt MyCchService::AddObserver( MCchServiceStatusObserver& /*aObserver*/ ){ return KErrNone; } - -/** - * Removes the observer of service events - * - * @param aObserver Event observing class - * @return KErrNotFound Observer was not found - * KErrNone Observer was removed - */ - TInt MyCchService::RemoveObserver( MCchServiceStatusObserver& /*aObserver*/ ){ return KErrNone; } - -/** - * Checks if the type is supported - * - * @param aType Type of service - * @param aSupported True if the service type is supported - * @return Symbian error code - */ - TInt MyCchService::IsSupported( TCCHSubserviceType /*aType*/, TBool& /*aSupported*/ ) const{ return KErrNone; } - - - //end of file - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_cch.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_cch.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* s_cch.h :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: s_cch.h -* -*/ - -#ifndef MyCchServiceH -#define MyCchServiceH - -// EXTERNAL INCLUDES -#include -#include - -_LIT(KTestUserName, "hi123"); -_LIT(KOwnUserNameMatch,"gizmo:Sharath"); // dont change this value -_LIT(KTestPassword, "password"); -_LIT(KTestDescription, "error"); - -class MyCchService : public CCchService - { - TInt Enable( TCCHSubserviceType aType ); - - /** - * Launches service disable. See MCchServiceObserver for status changes. - * - * @param aType Type of service - * @return Symbian error - */ - TInt Disable( TCCHSubserviceType aType ); - - /** - * Returns the current service state - * - * @param aType Type of service - * @param aStatus Status of the service, return value - * @return Symbian error code - */ - TInt GetStatus( TCCHSubserviceType aType, - TCchServiceStatus& aStatus ) const ; - - /** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt GetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, TInt& aValue ) const; - - /** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt GetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, RBuf& aValue ) const; - - /** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt SetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, TInt aValue ); - - /** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt SetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, const TDesC& aValue ); - - /** - * Reserves the service for exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt Reserve( TCCHSubserviceType aType ); - - /** - * Frees the service of exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt Free( TCCHSubserviceType aType ); - - /** - * Is the service reserved - * - * @param aType Type of service - * @param aReserved True if the service is reserved - * @return Symbian error code - */ - TInt IsReserved( TCCHSubserviceType aType, TBool& aReserved ) const; - - /** - * Returns the service id - * - * @return The id of the service - */ - TInt ServiceId() const; - - /** - * @deprecated Do not use this anymore, change to AddObserver! - * - * Adds observer for listening service events - * - * @param aObserver Event observing class - */ - void SetObserver( MCchServiceStatusObserver& aObserver ); - - /** - * @deprecated Do not use this anymore, change to - * RemoveObserver method with paramater - * - * Removes the observer of service events - */ - void RemoveObserver( ); - - /** - * Adds observer for listening service events - * - * @param aObserver Event observing class - * @return KErrAlreadyExist Observer already added - * KErrNone Observer was added - */ - TInt AddObserver( MCchServiceStatusObserver& aObserver ); - - /** - * Removes the observer of service events - * - * @param aObserver Event observing class - * @return KErrNotFound Observer was not found - * KErrNone Observer was removed - */ - TInt RemoveObserver( MCchServiceStatusObserver& aObserver ); - - /** - * Checks if the type is supported - * - * @param aType Type of service - * @param aSupported True if the service type is supported - * @return Symbian error code - */ - TInt IsSupported( TCCHSubserviceType aType, TBool& aSupported ) const; - - private: - MCchServiceStatusObserver* iObserver; - - }; - - -#endif //MyCchService - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_imcache.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_imcache.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -/* -* s_imcache.cpp : 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:s_imcache.cpp -* -*/ -// imcache related headers -#include "cimcachefactory.h" -#include "mimcacheaccessor.h" -#include "mimcacheupdater.h" - -TBool gConversationExist = EFalse; -TBool gConversationUnreadCount = EFalse; - -class MyMIMCacheAccessor : public MIMCacheAccessor - { - public: - - /** - * Register to observer conversation data updates - * @param aObserver the observer interface - */ - void RegisterObserverL( MIMCacheEventHandler& /*aObserver*/ ) {} - - /** - * Unregister a conversation data update observer - * @param aObserver the observer interface - */ - void UnRegisterObserver( MIMCacheEventHandler& /*aObserver*/ ) {} - - /** - * to get the unread message count from server - * @param aOwnUserId , logged in user id - * @return number of unread msg count - */ - TInt GetUnreadMessageCountL( const TDesC& /*aBuddyId*/ ) - { - if (gConversationUnreadCount) - { - return 1; - } - - return 0; - } - - /** - * to get the all unread message count from server - * @param , aOwnUserId logged in user id - * @return number of all unread msg count - */ - TInt GetAllUnreadMessageCountL() { return KErrNone; } - - /** - * check if already conversation opened - * @param aServiceId, serviceid to use - * @param aOwnUserId, own user id - * @param aRecipientId, the selected user id with whom conversation is started - * @return ETrue if already exist else EFlase. - */ - TBool IsConversationExistL( const TDesC& /*aBuddyId*/ ) - { - if (gConversationExist) - { - return ETrue; - } - - return EFalse; - } - - /** - * closes conversation and commit operation - * @param aServiceId service id. - * @param aOwnId own user id. - * @param aRecipientId recipient's user id. - */ - void CloseConversationL( const TDesC& /*aBuddyId*/ ) {} - - /** - * to get the friend request count from server - * @param , aOwnUserId logged in user id - * @return number of all request - */ - TInt GetFriendRequestCountL( ) { return KErrNone; } - - - /** - * Remove friend request from cahce and commit operation - * @param aServiceId service id. - * @param aOwnId own user id. - * @param aRequesterId ,requester user id. - */ - void RemoveFriendRequestL( const TDesC& /*aBuddyId*/ ) {} - - - /** - * Destructor - */ - ~MyMIMCacheAccessor() {}; - - MyMIMCacheAccessor() {}; - }; - -class MyMIMCacheUpdater : public MIMCacheUpdater - { - public: - - void RegisterObserverL( MIMCacheEventHandler& /*aObserver*/ ) {} - - void UnRegisterObserver( MIMCacheEventHandler& /*aObserver*/ ) {} - - void StartNewConversationL(const TDesC& /*aBuddyId*/ ) {}; - - void AppendReceiveMessageL(const TDesC& /*aBuddyId*/, - const TDesC& /*aText*/ ){}; - - void AppendSendMessageL(const TDesC& /*aText*/ ){}; - - void AppendMessageL(const TDesC& /*aBuddyId*/, const TDesC& /*aText*/){}; - - void CloseConversationL( const TDesC& /*aBuddyId*/ ){}; - - TInt DeactivateConversationL() - { - return KErrNone; - } - - void AppendAddRequestL( const TDesC& /*aBuddyId*/, - TInt /*aServiceId*/ ){}; - - RArray GetChatListL( const TInt& /*aServiceId*/ ) - { - RArray array; - return array; - } - - ~MyMIMCacheUpdater() {}; - - MyMIMCacheUpdater() {}; - }; - -CIMCacheFactory* gIMCacheFactory = NULL; -MyMIMCacheAccessor* gMyMIMCacheAccessor = NULL; -MyMIMCacheUpdater* gMyMIMCacheUpdater = NULL; - -CIMCacheFactory* CIMCacheFactory::InstanceL() - { - if (!gIMCacheFactory) - { - gIMCacheFactory = new ( ELeave ) CIMCacheFactory(); - } - return gIMCacheFactory; - } - -void CIMCacheFactory::Release() - { - - delete gMyMIMCacheAccessor; - gMyMIMCacheAccessor = NULL; - - delete gMyMIMCacheUpdater; - gMyMIMCacheUpdater = NULL; - - delete gIMCacheFactory; - gIMCacheFactory = NULL; - - - } - -MIMCacheAccessor* CIMCacheFactory::CreateAccessorL(TInt /*aServiceId*/, - const TDesC& /*aUserId*/ ) - { - if (!gMyMIMCacheAccessor) - { - gMyMIMCacheAccessor = new (ELeave) MyMIMCacheAccessor(); - } - return gMyMIMCacheAccessor; - } - - -CIMCacheFactory::~CIMCacheFactory() - { - - } - -CIMCacheFactory::CIMCacheFactory() - { - - } - -void CIMCacheFactory::ConstructL() - { - - } - -MIMCacheUpdater* CIMCacheFactory::CreateUpdaterL(TInt /*aServiceId*/, - const TDesC& /*aUserId*/ , - TBool /*aRegistrationNeeded*/ ) - { - if (!gMyMIMCacheUpdater) - { - gMyMIMCacheUpdater = new (ELeave) MyMIMCacheUpdater(); - } - return gMyMIMCacheUpdater; - } - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_mcchuiobserver.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_mcchuiobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* s_mcchuiobserver.h :Copyright (c) 2008-2008 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: Observer definition for CCH UI clients -* -*/ - - -#ifndef M_CCHUIOBSERVER_H -#define M_CCHUIOBSERVER_H - -/** - * CCH UI Observer declaration class. - * - * This class defines observer implementation for the CCH UI - * clients. Every client must derive this class in order to - * be able to use services provided by CCH UI and to be able - * to receive observer callbacks. - * @code - * inherit in header: - * class CMyClass : public CBase, public MCchUiObserver - * @endcode - * - * @lib cchui.lib - * @since S60 5.0 - */ -class MCchUiObserver - { -public: - - /** Defines dialog types available through this API */ - enum TCchUiDialogType - { - ECchUiDialogTypeNotSet, - // For connecting note showing - ECchUiDialogTypeConnecting, - // For disconnecting note showing - ECchUiDialogTypeDisconnecting, - // For showing info note about invalid username/password. - // Will also automatically show username/password query after - // showing info note. - ECchUiDialogTypeUsernamePasswordFailed, - // For showing username/password query. - ECchUiDialogTypeAuthenticationFailed, - // For showing no connections defined query. When user inputs - // username/password and accepts query, CCHUI will save them - // and also will re-enable service. - ECchUiDialogTypeNoConnectionDefined, - // For showing no connections available query. When user selects - // new access point, CCHUI adds it to service´s SNAP and re-enables - // service automatically. - ECchUiDialogTypeNoConnectionAvailable, - // For showing confirmation query to change connection. - // Will show automatically also change connection query if - // confirmation query accepted by user. - ECchUiDialogTypeConfirmChangeConnection, - // For showing change connection query. When user selects - // new access point, CCHUI add it to service´s SNAP and re-enables - // service. CCHUI will also delete old access point from service´s - // SNAP if access point is not used by other service(s). - ECchUiDialogTypeChangeConnection, - // For showing defective settings info note. - ECchUiDialogTypeDefectiveSettings, - // For showing error in connection info note. - // Will show automatically also confirm change connection query - // and confirmation query is accepted by user, change connection - // query is showed also. - ECchUiDialogTypeErrorInConnection - }; - - /** Defines operation results ie. indicates what have been done. - Client can implement handling based on these on callback. */ - enum TCchUiOperationResult - { - // Operation result not set - ECchUiClientOperationResultNotSet, - // User has cancelled query. - ECchUiClientOperationResultUserCancelled, - // Failure that prevents enabling service has happened. - ECchUiClientOperationResultGeneralFailure, - // CCHUI has added new access point to service´s SNAP. - ECchUiClientOperationResultAccessPointAdded, - // CCHUI has added new access point to service´s SNAP. - // CCHUI has also removed previously used access point from - // service´s SNAP if it was not used by other service(s). - ECchUiClientOperationResultConnectionChanged, - // CCHUI has saved new username/password for service - ECchUiClientOperationResultCredentialsChanged - }; - - /** - * Gets called when cchui has finished showing connectivity dialogs - * and possible connectivity related operations based on user - * actions in those dialogs. - * - * @since S60 5.0 - * @param aServiceId Service id. - * @param aServiceState Service state after cchui operations. - * @param aOperationResult Contains last cchui operation. - * @return None - */ - virtual void ConnectivityDialogsCompletedL( - TInt aServiceId, - TCchUiOperationResult aOperationResult ) = 0; - }; - -#endif // M_CCHUIOBSERVER_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_mvimpststoragecontacts.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_mvimpststoragecontacts.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,259 +0,0 @@ -/* -* s_mvimpststoragecontacts.h :Copyright (c) 2008 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: Stored contact data container interface -* -*/ - - - -#ifndef MVIMPSTSTORAGECONTACTS_H -#define MVIMPSTSTORAGECONTACTS_H - - -#include "TVIMPSTEnums.h" - -#include -#include -#include "mvimpststoragecontact.h" - -// FORWARD DECLARATIONS -class MVIMPSTStorageContactsObserver; -class MVIMPSTStorageContactList; -class MVIMPSTStorageContact; -class MVPbkContactLink; -class CVPbkContactManager; -class MVPbkStoreContact; -class MVIMPSTStorageVpbkStoreHandler; -class MVIMPSTStorageContactManagementObserver; - - - - -// CLASS DECLARATION - -/** - * Interface for stored contacts container - * - * @lib VIMPSTStorage.dll - * @since 5.0 - */ -class MVIMPSTStorageContacts - { - public : - virtual void UpdateAvatarDataL( const TDesC& aContactId ,const TDesC8& aData) = 0; - public: // Definitions - /** - * An Enum - * To define contact list preperty. - * not used. - */ - - enum TContactListProperty - { - EPrimaryCollapseInUse, /*primary collapse. */ - ESecondaryCollapseInUse /* secondary collapse. */ - }; - - public: // New functions - - /** - * Add an observer. - * @param aObserver The observer - */ - virtual void AddObserverL( MVIMPSTStorageContactsObserver* aObserver ) = 0; - - /** - * Remove an observer. - * @param aObserver The observer - */ - virtual void RemoveObserver( - MVIMPSTStorageContactsObserver* aObserver ) = 0; - - - /** - * Find a contact from the store by Name - * @param aContactListId List which contains contact. - * @param aId the User ID of the contact to find - * @return The contact - */ - virtual MVIMPSTStorageContact* FindContactByName( const TDesC& aContactListId, - const TDesC& aId ) = 0; - - virtual MVIMPSTStorageContact* FindContactByName( const TDesC& aContactListId, - const TDesC& aId, - MVIMPSTStorageContactList*& aContactList ) = 0; - - /** - * Find any contact which id is aContactId - * @param aContactId Contactid to recognize contact. - * @return First one which matches contactId. If not found return NULL - */ - virtual MVIMPSTStorageContact* FindAnyContactByName( const TDesC& aContactId ) = 0; - - /** - * Find any contact which has contact link same as aContactLink - * @param aContactId Contactid to recognize contact. - * @return First one which matches contactId. If not found return NULL - */ - virtual MVIMPSTStorageContact* FindContact( const MVPbkContactLink& aContactLink, - MVIMPSTStorageContactList*& aContactList ) = 0; - - - /** - * Find a contact from the store by using Service ID - * @param aServiceId the Service ID of the contact to find - * @return The contact - */ - virtual MVIMPSTStorageContact* FindContactByServiceField( const TDesC& aServiceId ) = 0; - - /** - * Count of lists. - * @return Count of lists. - */ - virtual TInt ListCount() const = 0; - - /** - * List in index. - * @param aIndex. Index of list. - * return Contact list. - */ - virtual MVIMPSTStorageContactList& ListAt( TInt aIndex ) const = 0; - - /** - * Find contact list by id - * @param aListId. Id to find. - * @return Contactlist. If not found return NULL - */ - virtual MVIMPSTStorageContactList* FindContactList( const TDesC& aListId ) = 0; - - /** - * Find out if contact exists in all list. - * @param aContactId. Id to check. - * @return ETrue if contact is in all lists. EFalse if not. - */ - virtual TBool ContactInAllLists( const TDesC& aContactId ) const = 0; - - /** - * Add new contact list. - * @param aContactListId Id for new contact list. - * @param aDisplayName Display name of new contact list. - */ - virtual MVIMPSTStorageContactList* AddContactListIdL( const TDesC& aContactListId, - const TDesC& aDisplayName, - TBool aNotify = ETrue ) = 0; - - /** - * Remove contact list from store. - * @param aContactListId. Id of contact list to be removed. - */ - virtual void RemoveContactList( const TDesC& aContactListId ) = 0; - - - /** - * Removes all contacts. - */ - virtual void RemoveAllContactsL() = 0; - - /** - * Count of stored contacts - * @param aSkipOfflineContacts ETrue skip offline contacts. - * EFalse Do not skip. - * @return TInt Count of contacts - */ - virtual TInt ContactCount( - TBool aSkipOfflineContacts = EFalse ) const = 0; - - /** - * Online status of user. - * @param aContactId Id which status is wanted. - * @return Onlinestatus of user. - */ - virtual TVIMPSTEnums::TOnlineStatus OnlineStatus( - const TDesC& aContactId ) = 0; - - /** - * Update presence information of contact. - * @param aContactId Id of contact which presence is updated. - * @param aStatus. New presence status - * @param aAlias. New alias. - * @param aStatusText New status message text. - * @return MVIMPSTStorageContact* pointer of the contact - */ - virtual MVIMPSTStorageContact* UpdatePresenceL( const TDesC& aContactId, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aAlias, - const TDesC& aStatusText) = 0; - - - /** - * Check if contact is found in storage. - * @param aContact contact to find. - * @return TBool ETrue if contact is found from storage - */ - virtual TBool IsContactValid( const MVIMPSTStorageContact* aContact ) const = 0; - - /** - * Sorts contact lists alphabetically. - * @since S60 v5.0 - */ - virtual void SortContactLists() = 0; - - - /** - * From MVIMPSTStorageContacts - */ - virtual void Sort( const TDesC& aContactListId = KNullDesC ) = 0; - - /** - * Resort one contact, what ever contact list it is in - */ - virtual void ResortContactInAll( MVIMPSTStorageContact* aContact ) = 0; - - /** - * From MVIMPSTStorageContacts - */ - virtual void SetSortAlgorithm( MVIMPSTStorageContact::TSortAlgorithm aAlgorithm ) = 0; - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - virtual MVIMPSTStorageContact* AddContactL( const TDesC& aFirstName = KNullDesC, - const TDesC& aServiceField = KNullDesC ) = 0; - - - /** - * removes contact from the virtual phonebook. - * @param aContact contact id to be removed. - */ - virtual void RemoveContactL( const MVPbkContactLink& aContactLink) = 0; - - /** - * removes contact from the virtual phonebook. - * @param aContact contact id to be removed. - */ - virtual void RemoveContactL( const TDesC& aServiceContactId) = 0; - - virtual void SetOwnDataL( const TDesC& aOwnId ) = 0; - - protected: - /** - * virtual destructor. - */ - virtual ~MVIMPSTStorageContacts(){}; - }; - -#endif // MVIMPSTSTORAGECONTACTS_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceblockinfo.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceblockinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* 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: Interface for presence block info object. -* -*/ - - -#include "s_presenceblockinfo.h" -#include "s_ximpidentity.h" - -extern MyMXIMPIdentityStub gMXIMPIdentity; // already defined in MPresentityPresenceEventStub - -// ============================ MEMBER FUNCTIONS ============================= -// --------------------------------------------------------------------------- -// From MPresenceBlockInfo class. -// CPresenceBlockInfoImp::BlockedEntityId() -// --------------------------------------------------------------------------- -// -const MXIMPIdentity& MPresenceBlockInfoStub::BlockedEntityId() const - { - return gMXIMPIdentity; ; - } - - -// --------------------------------------------------------------------------- -// From MPresenceBlockInfo class. -// MPresenceBlockInfoStub::BlockedEntityDisplayName() -// --------------------------------------------------------------------------- -// -const TDesC16& MPresenceBlockInfoStub::BlockedEntityDisplayName() const - { - return KNullDesC(); - } - - -// --------------------------------------------------------------------------- -// From MPresenceBlockInfo class. -// MPresenceBlockInfoStub::SetBlockedEntityIdL() -// --------------------------------------------------------------------------- -// -void MPresenceBlockInfoStub::SetBlockedEntityIdL( - MXIMPIdentity* /*aIdentity*/ ) - { - /*CXIMPIdentityImp* identityImp = - TXIMPGetImpClassOrPanic< CXIMPIdentityImp>::From( *aIdentity ); - - delete iIdentity; - iIdentity = identityImp; */ - } - - -// --------------------------------------------------------------------------- -// From MPresenceBlockInfo class. -// MPresenceBlockInfoStub::SetBlockedEntityDisplayNameL() -// --------------------------------------------------------------------------- -// -void MPresenceBlockInfoStub::SetBlockedEntityDisplayNameL( - const TDesC16& /*aDisplayName*/ ) - { - /*HBufC16* displayNameBuf = aDisplayName.AllocL(); - iDisplayName.Close(); - iDisplayName.Assign( displayNameBuf );*/ - } - - -const TAny* MPresenceBlockInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceBlockInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceBlockInfoStub::GetInterfaceId() const - { - return 0; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceblockinfo.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceblockinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* 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: Interface for presence block info object. -* -*/ - -#ifndef MXIMPFWPRESENCEBLOCKINFOSTUB_H -#define MXIMPFWPRESENCEBLOCKINFOSTUB_H - -#include - - - -/** - * Interface for presence block info object. - * - * Presence block info object presents single - * presence block entry in the presence block list. - * Presence block info object holds the identity - * and display name information for the presence - * block entry. - * - * @ingroup presencedatamodelapi - * @since S60 v3.2 - */ -class MPresenceBlockInfoStub :public MPresenceBlockInfo - { - -public: - - /** - * Returns identity of the blocked entity. - * - * @return The identity of the blocked entity. - */ - const MXIMPIdentity& BlockedEntityId() const; - - - - /** - * Returns displayname of the blocked entity. - * - * @return The displayname of the blocked entity. - */ - const TDesC16& BlockedEntityDisplayName() const; - - - - /** - * Sets identity of the blocked entity. - * - * @param [in] aIdentity - * Identity of the blocked entity. - * Ownership of the argument is transfered to - * callee, if method succeeds without a leave. - * - * @leave KErrNoMemory if failed to allocate memory. - * @leave KErrArgument if NULL argument were provided. - */ - void SetBlockedEntityIdL( - MXIMPIdentity* aIdentity ); - - - /** - * Sets displayname of the blocked entity. - * - * @param [in] aDisplayName - * New display name value. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - void SetBlockedEntityDisplayNameL( - const TDesC16& aDisplayName ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - - -#endif // MXIMPFWPRESENCEBLOCKINFOSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfo.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* s_presencebuddyinfo.cpp 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:s_presencebuddyinfo.cpp -* -*/ - -#include "s_presencebuddyinfo.h" -#include "s_presenceinfo.h" - - - -MPresenceBuddyInfoStub* MPresenceBuddyInfoStub::NewStubL() - { - return new ( ELeave ) MPresenceBuddyInfoStub(); - } - - TInt MPresenceBuddyInfoStub::Set( - MXIMPIdentity* /*aIdentity*/, - MPresenceInfo* /*aPresenceInfo*/) - { - return KErrNone; - } - -TInt MPresenceBuddyInfoStub::SetPresenceInfo(MPresenceInfo* /*aPresenceInfo*/) - { - return KErrNone; - } - -TInt MPresenceBuddyInfoStub::SetBuddyId(MXIMPIdentity* /*aIdentity*/) - { - return KErrNone; - } - -TInt MPresenceBuddyInfoStub::SetPersonPresenceL( - MPersonPresenceInfo* /*aPersonPresenceInfo*/) - { - return KErrNone; - } - -const MPresenceInfo* MPresenceBuddyInfoStub::PresenceInfo() const - { - if ( !gMPresenceInfoStub ) - { - gMPresenceInfoStub = new ( ELeave ) MPresenceInfoStub(); - } - - return gMPresenceInfoStub; - } - -const MXIMPIdentity* MPresenceBuddyInfoStub::BuddyId() const - { - MXIMPIdentity* identity = NULL; - return identity; - } - -TBool MPresenceBuddyInfoStub::EqualsIdentity( - const MPresenceBuddyInfo* /*aOtherInstance*/ ) const - { - return ETrue; - } - -const TAny* MPresenceBuddyInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceBuddyInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceBuddyInfoStub::GetInterfaceId() const - { - return 0; - } - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfo.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* s_presencebuddyinfo.h :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: s_presencebuddyinfo.h -* -*/ -#ifndef MXIMPFWBUDDYPRESENCEINFOSTUB_H -#define MXIMPFWBUDDYPRESENCEINFOSTUB_H - -#include - -class MPresenceBuddyInfoStub : public MPresenceBuddyInfo - { - public: - static MPresenceBuddyInfoStub* NewStubL(); - - TInt Set( MXIMPIdentity* aIdentity, - MPresenceInfo* aPresenceInfo); - TInt SetPresenceInfo(MPresenceInfo* aPresenceInfo); - TInt SetBuddyId(MXIMPIdentity* aIdentity); - TInt SetPersonPresenceL(MPersonPresenceInfo* aPersonPresenceInfo); - const MPresenceInfo* PresenceInfo() const; - const MXIMPIdentity* BuddyId() const; - TBool EqualsIdentity(const MPresenceBuddyInfo* aOtherInstance ) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif //MXIMPFWBUDDYPRESENCEINFOSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfo2.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfo2.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -/* -* s_presencebuddyinfo2.cpp : 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: s_presencebuddyinfo2.cpp -* -*/ -#include "s_presencebuddyinfo2.h" -#include - -#define KAvailability _L("online"); -#define KMsg _L("hello"); -#define KBuddyId _L("gizmo:Sharath"); -#define KAvatar _L8("gshhshshhshshhsjskssiisisisisiisks"); - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ - MPresenceBuddyInfo2Stub* MPresenceBuddyInfo2Stub:: NewStubL() - { - return new(ELeave) MPresenceBuddyInfo2Stub; - } - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::BuddyId -//------------------------------------------------------------ -TPtrC MPresenceBuddyInfo2Stub::BuddyId( ) const - { - return KBuddyId; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::Availability -//------------------------------------------------------------ -MPresenceBuddyInfo2::TAvailabilityValues MPresenceBuddyInfo2Stub::Availability( ) - { - return EUnknownAvailability; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::AvailabilityText -//------------------------------------------------------------ -TPtrC MPresenceBuddyInfo2Stub::AvailabilityText( ) - { - return KAvailability; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::Avatar -//------------------------------------------------------------ -TPtrC8 MPresenceBuddyInfo2Stub::Avatar( ) - { - return KAvatar; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -TPtrC MPresenceBuddyInfo2Stub::StatusMessage( ) - { - return KMsg; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::SetIdentityL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetIdentityL( const TDesC& /*aBuddyId*/ ) - { - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::SetAvailabilityL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetAvailabilityL( - MPresenceBuddyInfo2::TAvailabilityValues /*aAvailability*/, - const TDesC& /*aAvailabilityText*/ ) - { - - } - - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::SetAvatarL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetAvatarL( const TDesC8& /*aAvatar*/ ) - { - - } - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetStatusMessageL( - const TDesC& /*aStatusMessage*/ ) - { - - } - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::SetAnyFieldL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetAnyFieldL( - const TDesC16& aKey, - const TDesC8& aValue ) - { - HBufC8* valueBuffer = aValue.AllocLC(); - HBufC* keyBuffer = aKey.AllocLC(); - - TInt insertPos = iIds.Find(0); - if ( insertPos < 0 ) - { - insertPos = iIds.Count(); - iIds.Append( keyBuffer ); - iValues.Append( valueBuffer ); - } - else - { - iIds[insertPos] = keyBuffer; - iValues[insertPos] = valueBuffer; - } - CleanupStack::Pop( keyBuffer ); - CleanupStack::Pop( valueBuffer ); - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -TPtrC8 MPresenceBuddyInfo2Stub::GetAnyField( - const TDesC16& aKey ) - { - HBufC* key = aKey.AllocLC(); - HBufC8* val = NULL; - TInt count = iIds.Count(); - for(TInt i = 0; i < count; i++) - { - if(iIds[i]->Des().Compare(KExtensionKey) == 0) - { - val = iValues[i]; - break; - } - } - CleanupStack::PopAndDestroy(key); - // since there is no destructor for this test class, the member variable are destroyed here. - // as they are not needed any further, if these member variables are required further then appropriate destructor - // should be added. - // iIds.ResetAndDestroy(); - // iIds.Close(); - // iValues.ResetAndDestroy(); - // iValues.Close(); - return val ? val->Des() : TPtrC8(); - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::GetFieldKeysL( - CDesCArrayFlat& aKeys ) - { - aKeys.Reset(); - aKeys.AppendL(KExtensionKey ); - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::RemoveField(const TDesC& /*aKey*/ ) - { - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -TBool MPresenceBuddyInfo2Stub::EqualsIdentity( - const MPresenceBuddyInfo2& /*aOtherInstance*/ ) const - { - return ETrue; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::ExternalizeL( RWriteStream& /*aStream*/ ) const -{ - -} -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::InternalizeL( RReadStream& /*aStream*/ ) - { - - } - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfo2.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfo2.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* s_presencebuddyinfo2.h :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: s_presencebuddyinfo2.h -* -*/ -#ifndef MPRESENCEBUDDYINFO2STUB_H -#define MPRESENCEBUDDYINFO2STUB_H - -#include - -class MPresenceBuddyInfo2Stub : public MPresenceBuddyInfo2, - public CBase - { -public: - static MPresenceBuddyInfo2Stub* NewStubL(); - - void SetIdentityL( const TDesC& aBuddyId ); - - TPtrC BuddyId( ) const ; - - void SetAvailabilityL( - TAvailabilityValues aAvailability, - const TDesC& aAvailabilityText ) ; - - TAvailabilityValues Availability( ) ; - - TPtrC AvailabilityText( ); - - - void SetAvatarL( const TDesC8& aAvatar ) ; - - TPtrC8 Avatar( ) ; - - void SetStatusMessageL( - const TDesC& aStatusMessage ) ; - - TPtrC StatusMessage( ) ; - - void SetAnyFieldL( - const TDesC16& aKey, - const TDesC8& aValue ) ; - - TPtrC8 GetAnyField( - const TDesC16& aKey ); - - void GetFieldKeysL( - CDesCArrayFlat& aKeys ) ; - - void RemoveField(const TDesC& aKey ); - - TBool EqualsIdentity( - const MPresenceBuddyInfo2& aOtherInstance ) const ; - - void ExternalizeL( RWriteStream& aStream ) const ; - - void InternalizeL( RReadStream& aStream ) ; - ~MPresenceBuddyInfo2Stub() - { - iIds.ResetAndDestroy(); - iIds.Close(); - iValues.ResetAndDestroy(); - iValues.Close(); - } - -private: - RPointerArray iIds; - RPointerArray iValues; - }; - - - -#endif //MPRESENCEBUDDYINFO2STUB_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfolist.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfolist.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* s_presencebuddyinfolist.cpp 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:s_presencebuddyinfolist.cpp -* -*/ -#include "s_presencebuddyinfolist.h" - - -MPresenceBuddyInfoListStub* MPresenceBuddyInfoListStub::NewStubL() - { - return new ( ELeave ) MPresenceBuddyInfoListStub(); - } - - -RPointerArray& MPresenceBuddyInfoListStub::GetObjectCollection() - { - //RPointerArray array; - return iBuddyInfo ; // *gPresenceArry; - } - -TPtrC MPresenceBuddyInfoListStub::ServiceName() const - { - TPtrC ptr; - return ptr; - } - -TInt MPresenceBuddyInfoListStub::Count() const - { - return iBuddyInfo.Count(); - } - -TInt MPresenceBuddyInfoListStub::AddOrReplace( - MPresenceBuddyInfo* aBuddyPresenceInfo) - { - iBuddyInfo.Append( aBuddyPresenceInfo ); - return KErrNone; - } - -TInt MPresenceBuddyInfoListStub::FindAndRemove( - const MXIMPIdentity& /*aIdentity*/) - { - return KErrNone; - } - -MPresenceBuddyInfo* MPresenceBuddyInfoListStub::FindAndGet( - const MXIMPIdentity& /*aIdentity*/) const - { - MPresenceBuddyInfo* info = NULL; - return info; - } - - -const TAny* MPresenceBuddyInfoListStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceBuddyInfoListStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceBuddyInfoListStub::GetInterfaceId() const - { - return 0; - } - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfolist.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencebuddyinfolist.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* s_presencebuddyinfolist.h : 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: s_presencebuddyinfolist.h -* -*/ -#ifndef MXIMPFWBUDDYPRESENCEINFOLISTSTUB_H -#define MXIMPFWBUDDYPRESENCEINFOLISTSTUB_H - -#include -#include - -class MPresenceBuddyInfoListStub : public MPresenceBuddyInfoList - { - public: - static MPresenceBuddyInfoListStub* NewStubL(); - - RPointerArray& GetObjectCollection(); - TPtrC ServiceName() const; - TInt Count() const; - TInt AddOrReplace(MPresenceBuddyInfo* aBuddyPresenceInfo); - TInt FindAndRemove(const MXIMPIdentity& aIdentity); - MPresenceBuddyInfo* FindAndGet(const MXIMPIdentity& aIdentity) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - ~MPresenceBuddyInfoListStub() - { - iBuddyInfo.ResetAndDestroy(); - } - - private : - - RPointerArray iBuddyInfo; - }; - - - -#endif //MXIMPFWBUDDYPRESENCEINFOLISTSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencecachereader2.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencecachereader2.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* s_presencecachereader2.cpp :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: s_presencecachereader2.cpp -* -*/ -#include "s_presencecachereader2.h" - -TInt gAllBuddiesPresenceInServiceError = KErrNone; - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::CreateReaderL -//------------------------------------------------------------ -MPresenceCacheReader2* MPresenceCacheReader2:: CreateReaderL() - { - return new(ELeave) MPresenceCacheReader2Stub; - } - -//------------------------------------------------------------ -// MPresenceCacheReader2Stub::BuddyCountInAllServices -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::BuddyCountInAllServices() - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::BuddyCountInService -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub:: BuddyCountInService(const TDesC& /*aServiceName*/) - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::ServicesCount -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::ServicesCount() - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::NewStubL -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::CancelRead() - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::SetIdentityL -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::AllBuddiesPresenceInService(const TDesC& /*aServiceName*/, - MPresenceCacheReadHandler2* /*aHandler*/) - { - return gAllBuddiesPresenceInServiceError; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::SetAvailabilityL -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::SetObserverForSubscribedNotifications( - MPresenceCacheReadHandler2* /*aHandler*/) - { - return 0; - } - - -//------------------------------------------------------------ -// MPresenceCacheReader2::SubscribePresenceBuddyChangeL -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::SubscribePresenceBuddyChangeL(const TDesC& /*aIdentity*/) - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::UnSubscribePresenceBuddyChangeL -//------------------------------------------------------------ - -void MPresenceCacheReader2Stub::UnSubscribePresenceBuddyChangeL(const TDesC& /*aIdentity*/) - { - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::BuddyId -//------------------------------------------------------------ - - MPresenceBuddyInfo2* MPresenceCacheReader2Stub::PresenceInfoLC(const TDesC& /*aIdentity*/) - { - MPresenceBuddyInfo2* info =NULL; - return info; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencecachereader2.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencecachereader2.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* s_presencecachereader2.h :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: s_presencecachereader2.h -* -*/ -#ifndef MPRESENCECACHEREADER2STUB_H -#define MPRESENCECACHEREADER2STUB_H - -#include - -class MPresenceCacheReader2Stub : public MPresenceCacheReader2 - { - -public: //Sub interfaces for presence cache reader, Synchonous methods - - MPresenceBuddyInfo2* PresenceInfoLC(const TDesC& aIdentity); - - TInt BuddyCountInAllServices() ; - - TInt BuddyCountInService(const TDesC& aServiceName) ; - - TInt ServicesCount(); - - TInt CancelRead() ; - -public: //Sub interfaces for presence cache reader, Asynchronous methods - TInt AllBuddiesPresenceInService(const TDesC& aServiceName, - MPresenceCacheReadHandler2* aHandler); - -public: //Sub interfaces for presence cache reader, Asynchronous methods - - TInt SetObserverForSubscribedNotifications( - MPresenceCacheReadHandler2* aHandler) ; - - - TInt SubscribePresenceBuddyChangeL(const TDesC& aIdentity); - - void UnSubscribePresenceBuddyChangeL(const TDesC& aIdentity) ; - }; - - - -#endif //MPRESENCECACHEREADER2STUB_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencefeatures.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencefeatures.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* s_presencefeatures.cpp Copyright (c) 2006, 2007 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: Interface for presence context. -* -*/ - - -#include "s_presencefeatures.h" -#include "s_presentitygroups.h" -#include "s_ximppresenceauthorization.h" -#include "s_presencepublishing.h" -#include "s_presenceobjectfactory.h" -#include "s_presencewatching.h" - -MPresenceAuthorizationStub gPresenceAuthorizationStub; -MPresencePublishingStub gMPresenceFeaturesStubPublishing; -MPresenceObjectFactoryStub gMPresenceFeaturesStubObjectFactory; -MPresenceWatchingStub gMPresenceFeaturesStubPresenceWatching; - -/** - * Factory method to instantiate MPresenceFeatures. - * - * Factory method to instantiate platform default - * MXIMPClient implementation through the ECom. - * If the default presence framework isn't supported - * in the platform, leaves with errorcode signalled - * from ECom. - * - * @return The new presence client object. Object - * ownership is returned to caller. - */ -MPresenceFeatures* MyMPresenceFeatureStub::NewStubL( MXIMPContext* /*aContext*/ ) - { - - MyMPresenceFeatureStub* ret = new (ELeave) MyMPresenceFeatureStub(); - CleanupStack::PushL(ret); - ret->ContructL(); - CleanupStack::Pop(); - return ret; - } - -void MyMPresenceFeatureStub::ContructL() - { - iGroups = new (ELeave) MyPresentityGroupsStub(); - } - -/** - * Public destructor. - * Objects can be deleted through this interface. - */ -MyMPresenceFeatureStub::~MyMPresenceFeatureStub() - { - delete iGroups; - }; - - -/** - * Default constructor to zero initialize - * the iEcomDtorID member. - */ -MyMPresenceFeatureStub::MyMPresenceFeatureStub() - { - - } - - -/** - * Gets reference to object factory interface. - * - * Returned object factory interface is used - * to instantiate presence objects. - * - * @return Object factory interface. - * No ownership is returned caller. - */ -MPresenceObjectFactory& MyMPresenceFeatureStub::PresenceObjectFactory() const - { -// MPresenceObjectFactory* ret = NULL; -// return *ret; - return gMPresenceFeaturesStubObjectFactory; - }; - - -/** - * Gets reference to presence watching interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ -MPresenceWatching& MyMPresenceFeatureStub::PresenceWatching() const - { - //MPresenceWatching* ret = NULL; - //return *ret; - return gMPresenceFeaturesStubPresenceWatching; - }; - - - -/** - * Gets reference to presence publishing interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ -MPresencePublishing& MyMPresenceFeatureStub::PresencePublishing() const - { -// MPresencePublishing* ret = NULL; -// return *ret; - return gMPresenceFeaturesStubPublishing; - }; - - - -/** - * Gets reference to presentity groups interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ -MPresentityGroups& MyMPresenceFeatureStub::PresentityGroups() const - { - return *iGroups; - }; - - -/** - * Gets reference to presence authorization interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ -MPresenceAuthorization& MyMPresenceFeatureStub::PresenceAuthorization() const - { - return gPresenceAuthorizationStub; - }; - - -const TAny* MyMPresenceFeatureStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MyMPresenceFeatureStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MyMPresenceFeatureStub::GetInterfaceId() const - { - return 0; - } - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencefeatures.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencefeatures.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for presence context. -* -*/ - -#ifndef MyMPresenceFeatureStub_H -#define MyMPresenceFeatureStub_H - -#include -#include -#include - -#include - -class MyPresentityGroupsStub; - -/** - * Interface for presence features. - * This interface is implemented by the XIMP Framework Presence Feature plug-in. - * - * MPresenceFeatures is root interface for accessing - * and updating presence data to remote presence service. - * XIMP FW client binds MXIMPContext interface - * to desired remote presence service and creates - * MPresenceFeatures interface to access the XIMP FW presence related - * methods to publish and access presence data. - * - * Following sub interfaces can be accessed from - * from MPresenceFeatures: - * - MPresenceObjectFactory - * - MPresenceWatching - * - MPresencePublishing - * - MPresentityGroups - * - MPresenceAuthorization - * - * All Presence events (context state, presence data, - * request completion etc. ones) are delivered through - * MPresenceContextObserver interface. - * - * @ingroup ximppresmanagementapi - * @since S60 v3.2 - */ -class MyMPresenceFeatureStub : public CBase, public MPresenceFeatures - { - -public: - - /** - * Factory method to instantiate MPresenceFeatures. - * - * Factory method to instantiate platform default - * MXIMPClient implementation through the ECom. - * If the default presence framework isn't supported - * in the platform, leaves with errorcode signalled - * from ECom. - * - * @return The new presence client object. Object - * ownership is returned to caller. - */ - static MPresenceFeatures* NewStubL( MXIMPContext* aContext ); - - /** - * Public destructor. - * Objects can be deleted through this interface. - */ - ~MyMPresenceFeatureStub(); - -protected: - - /** - * Default constructor to zero initialize - * the iEcomDtorID member. - */ - MyMPresenceFeatureStub(); - -private: - - void ContructL(); - -public: //Sub interfaces for presence context - - - /** - * Gets reference to object factory interface. - * - * Returned object factory interface is used - * to instantiate presence objects. - * - * @return Object factory interface. - * No ownership is returned caller. - */ - MPresenceObjectFactory& PresenceObjectFactory() const ; - - - /** - * Gets reference to presence watching interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ - MPresenceWatching& PresenceWatching() const ; - - - - /** - * Gets reference to presence publishing interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ - MPresencePublishing& PresencePublishing() const ; - - - - /** - * Gets reference to presentity groups interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ - MPresentityGroups& PresentityGroups() const ; - - - /** - * Gets reference to presence authorization interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ - MPresenceAuthorization& PresenceAuthorization() const ; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - - private: - MyPresentityGroupsStub* iGroups; - - }; - - - - -#endif // MyMPresenceFeatureStub_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencegrantrequestinfo.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencegrantrequestinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* s_presencegrantrequestinfo.cpp 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: s_presencegrantrequestinfo.cpp -* -*/ - -#include "s_presencegrantrequestinfo.h" -#include "s_ximpidentity.h" - -extern MyMXIMPIdentityStub gMXIMPIdentity; // already defined in MPresentityPresenceEventStub - -const MXIMPIdentity& MPresenceGrantRequestInfoStub::RequestorId() const - { - return gMXIMPIdentity; - } - -const TDesC16& MPresenceGrantRequestInfoStub::RequestorDisplayName() const - { - return KNullDesC(); - } - -void MPresenceGrantRequestInfoStub::SetRequestorIdL( MXIMPIdentity* /*aIdentity*/ ) - { - } - -void MPresenceGrantRequestInfoStub::SetRequestorDisplayNameL( const TDesC16& /*aDisplayName*/ ) - { - } - -const TAny* MPresenceGrantRequestInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - -TAny* MPresenceGrantRequestInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceGrantRequestInfoStub::GetInterfaceId() const - { - return 0; - } - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencegrantrequestinfo.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencegrantrequestinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* s_presencegrantrequestinfo.h :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: s_presencegrantrequestinfo.h -* -*/ -#ifndef MPRESENCEGRANTREQUESTINFOSTUB -#define MPRESENCEGRANTREQUESTINFOSTUB - -#include - -/** - * Interface for presence grant request info object. - * - * Presence grant request info object presents single - * presence grant request entry in the presence - * grant request list. Presence grant request info - * object holds the identity and display name information - * for the presence grant request. - * - * @ingroup presencedatamodelapi - * @since S60 v3.2 - */ -class MPresenceGrantRequestInfoStub : public MPresenceGrantRequestInfo - { -public: - const MXIMPIdentity& RequestorId() const; - - const TDesC16& RequestorDisplayName() const; - - void SetRequestorIdL( MXIMPIdentity* aIdentity ); - - void SetRequestorDisplayNameL( const TDesC16& aDisplayName ); - - const TAny* GetInterface( TInt32 aInterfaceId, TIfGetOps aOps ) const; - - TAny* GetInterface( TInt32 aInterfaceId, TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - -#endif diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfo.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* s_presenceinfo.cpp :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: s_presenceinfo.cpp -* -*/ - -#include "s_presenceinfo.h" -#include "s_presencepersoninfo.h" - -MPersonPresenceInfoStub gMPersonPresenceInfo; -TBool gPersonPresenceInfoAvailable = EFalse; - -const MPersonPresenceInfo* MPresenceInfoStub::PersonPresence() const - { - if ( gPersonPresenceInfoAvailable ) - { - return &gMPersonPresenceInfo; - } - MPersonPresenceInfo* info = NULL; - return info; - } -MPersonPresenceInfo* MPresenceInfoStub::PersonPresence() - { - MPersonPresenceInfo* info = NULL; - return info; - } - -void MPresenceInfoStub::SetPersonPresenceL( MPersonPresenceInfo* /*aPersonPresence*/ ) - { - } - -TInt MPresenceInfoStub::ServicePresenceCount() const - { - return 0; - } - -const MServicePresenceInfo& MPresenceInfoStub::ServicePresenceAt( TInt /*aIndex*/ ) const - { - MServicePresenceInfo* info = NULL; - return *info; - } - -void MPresenceInfoStub::LookupServicePresenceByServiceType( - MServicePresenceInfo*& /*aServicePresence*/, - const TDesC8& /*aMatch*/ ) const - { - } - -void MPresenceInfoStub::AddServicePresenceL( MServicePresenceInfo* /*aServicePresence*/ ) - { - } - -TInt MPresenceInfoStub::DevicePresenceCount() const - { - return 0; - } - -const MDevicePresenceInfo& MPresenceInfoStub::DevicePresenceAt( TInt /*aIndex*/ ) const - { - MDevicePresenceInfo* info = NULL; - return *info; - } - -void MPresenceInfoStub::AddDevicePresenceL( MDevicePresenceInfo* /*aDevicePresence*/ ) - { - } - -const TAny* MPresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoStub::GetInterfaceId() const - { - return 0; - } - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfo.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* s_presenceinfo.h :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: s_presenceinfo.h -* -*/ -#ifndef MPRESENCEINFOSTUB -#define MPRESENCEINFOSTUB - -#include - -/** - * Interface for presence info object. - * - * - * @todo Interface might be extended with new methods. - * - * @ingroup presencedatamodelapi - * @since S60 v3.2 - */ -class MPresenceInfoStub : public MPresenceInfo - { -public: - - const MPersonPresenceInfo* PersonPresence() const; - MPersonPresenceInfo* PersonPresence(); - - void SetPersonPresenceL( MPersonPresenceInfo* aPersonPresence ); - - TInt ServicePresenceCount() const; - - const MServicePresenceInfo& ServicePresenceAt( TInt aIndex ) const; - - void LookupServicePresenceByServiceType( - MServicePresenceInfo*& aServicePresence, - const TDesC8& aMatch ) const; - - void AddServicePresenceL( MServicePresenceInfo* aServicePresence ); - - TInt DevicePresenceCount() const; - - const MDevicePresenceInfo& DevicePresenceAt( TInt aIndex ) const; - - void AddDevicePresenceL( MDevicePresenceInfo* aDevicePresence ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - -#endif diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofield.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofield.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* 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 : s_presenceinfofield.cpp -* -*/ - -#include "s_presenceinfofield.h" - -const TDesC8& MPresenceInfoFieldStub::FieldType() const - { - return KNullDesC8; - } - -void MPresenceInfoFieldStub::SetFieldTypeL( const TDesC8& /*aFieldType*/ ) - { - } - -const MXIMPBase& MPresenceInfoFieldStub::FieldValue() const - { - MXIMPBase* base = NULL; - return *base; - } - -MXIMPBase& MPresenceInfoFieldStub::FieldValue() - { - MXIMPBase* base = NULL; - return *base; - } - -void MPresenceInfoFieldStub::SetFieldValue( MXIMPBase* /*aFieldValue*/ ) - { - } - -const TAny* MPresenceInfoFieldStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoFieldStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoFieldStub::GetInterfaceId() const - { - return 0; - } - - - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofield.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofield.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* 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: s_presenceinfofield.h -* -*/ -#ifndef MXIMPFWPRESENCEINFOFIELDSTUB_H -#define MXIMPFWPRESENCEINFOFIELDSTUB_H - -#include - -class MPresenceInfoFieldStub : public MPresenceInfoField - { - const TDesC8& FieldType() const; - - void SetFieldTypeL( const TDesC8& aFieldType ); - - const MXIMPBase& FieldValue() const; - - MXIMPBase& FieldValue(); - - void SetFieldValue( MXIMPBase* aFieldValue ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif //MXIMPFWPRESENCEINFOFIELD_H - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldcollection.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldcollection.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* 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: s_presenceinfofieldcollection.cpp -* -*/ - -#include "s_presenceinfofieldcollection.h" - -TInt MPresenceInfoFieldCollectionStub::FieldCount() const - { - return KErrNone; - } - -const MPresenceInfoField& MPresenceInfoFieldCollectionStub::FieldAt( TInt /*aIndex*/ ) const - { - MPresenceInfoField* field = NULL; - return *field; - } - -void MPresenceInfoFieldCollectionStub::LookupFieldByFieldType( - MPresenceInfoField*& /*aPresenceInfoField*/, - const TDesC8& /*aMatch*/ ) const - { - } - -TInt MPresenceInfoFieldCollectionStub::DeleteFieldByFieldType(const TDesC8& /*aMatch*/ ) - { - return KErrNone; - } - - -void MPresenceInfoFieldCollectionStub::AddOrReplaceFieldL( MPresenceInfoField* /*aPresenceInfoField*/ ) - { - } - -const TAny* MPresenceInfoFieldCollectionStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoFieldCollectionStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoFieldCollectionStub::GetInterfaceId() const - { - return 0; - } - - - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldcollection.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldcollection.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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: s_presenceinfofieldcollection.h -* -*/ -#ifndef MXIMPFWPRESENCEINFOFIELDCOLLECTIONSTUB_H -#define MXIMPFWPRESENCEINFOFIELDCOLLECTIONSTUB_H - -#include - -class MPresenceInfoFieldCollectionStub : public MPresenceInfoFieldCollection - { - TInt FieldCount() const; - - const MPresenceInfoField& FieldAt( TInt aIndex ) const; - - void LookupFieldByFieldType( MPresenceInfoField*& aPresenceInfoField, - const TDesC8& aMatch ) const; - - virtual TInt DeleteFieldByFieldType(const TDesC8& aMatch ); - - void AddOrReplaceFieldL( MPresenceInfoField* aPresenceInfoField ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif //MXIMPFWPRESENCEINFOFIELDCOLLECTION_H - - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldvalueenum.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldvalueenum.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* 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: s_presenceinfofieldvalueenum.cpp -* -*/ - -#include "s_presenceinfofieldvalueenum.h" - -TInt MPresenceInfoFieldValueEnumStub::MinValue() const - { - return 0; - } - -TInt MPresenceInfoFieldValueEnumStub::MaxValue() const - { - return 0; - } - -TInt MPresenceInfoFieldValueEnumStub::Value() const - { - return 0; - } - -void MPresenceInfoFieldValueEnumStub::SetValueL( TInt /*aValue*/ ) - { - } - -void MPresenceInfoFieldValueEnumStub::SetLimits( TInt /*aMin*/, TInt /*aMax*/ ) - { - } - -const TAny* MPresenceInfoFieldValueEnumStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoFieldValueEnumStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoFieldValueEnumStub::GetInterfaceId() const - { - return 0; - } - - - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldvalueenum.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldvalueenum.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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: s_presenceinfofieldvalueenum.h -* -*/ -#ifndef MXIMPFWPRESENCEINFOFIELDVALUEENUMSTUB_H -#define MXIMPFWPRESENCEINFOFIELDVALUEENUMSTUB_H - -#include - -class MPresenceInfoFieldValueEnumStub : public MPresenceInfoFieldValueEnum - { - TInt MinValue() const; - - TInt MaxValue() const; - - TInt Value() const; - - void SetValueL( TInt aValue ); - - void SetLimits( TInt aMin, TInt aMax ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - -#endif //MXIMPFWPRESENCEINFOFIELDVALUEENUM_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldvaluetext.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldvaluetext.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* 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: s_presenceinfofieldvaluetext.cpp -* -*/ - -#include "s_presenceinfofieldvaluetext.h" - -TInt MPresenceInfoFieldValueTextStub::MaxLength() const - { - return 0; - } - -TPtrC MPresenceInfoFieldValueTextStub::TextValue() const - { - return KNullDesC(); - } - -void MPresenceInfoFieldValueTextStub::SetTextValueL( const TDesC& /*aValue*/ ) - { - } - -const TAny* MPresenceInfoFieldValueTextStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoFieldValueTextStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoFieldValueTextStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldvaluetext.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceinfofieldvaluetext.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* 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: s_presenceinfofieldvaluetext.h -* -*/ -#ifndef MXIMPFWPRESENCEINFOFIELDVALUETEXTSTUB_H -#define MXIMPFWPRESENCEINFOFIELDVALUETEXTSTUB_H - -#include - -class MPresenceInfoFieldValueTextStub : public MPresenceInfoFieldValueText - { - TInt MaxLength() const; - - TPtrC TextValue() const; - - void SetTextValueL( const TDesC& aValue ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - - -#endif //MXIMPFWPRESENCEINFOFIELDVALUETEXT_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceobjectfactory.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceobjectfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* 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: s_presenceobjectfactory.cpp -* -*/ - -#include "s_presenceobjectfactory.h" -#include "s_servicepresenceinfo.h" -#include "s_presenceinfofield.h" -#include "s_presenceinfofieldvalueenum.h" -#include "s_presencepersoninfo.h" -#include "s_presenceinfofieldvaluetext.h" -#include "s_presenceinfo.h" - -MPresenceInfoStub* gMPresenceInfoStub = NULL; -MServicePresenceInfoStub gMPresenceObjectFactoryStubServicePresenceInfo; -MPresenceInfoFieldStub gMPresenceObjectFactoryStubPresenceInfoField; -MPresenceInfoFieldValueEnumStub gMPresenceObjectFactoryStubPresenceInfoFieldValueEnum; -MPersonPresenceInfoStub gMPresenceObjectFactoryStubPersonPresenceInfo; -MPresenceInfoFieldValueTextStub gMPresenceObjectFactoryStubPresenceInfoFieldValueText; - -MPresentityGroupInfo* MPresenceObjectFactoryStub::NewPresentityGroupInfoLC() - { - return NULL; - } - -MPresentityGroupMemberInfo* MPresenceObjectFactoryStub::NewPresentityGroupMemberInfoLC() - { - return NULL; - } - -MPresenceWatcherInfo* MPresenceObjectFactoryStub::NewPresenceWatcherInfoLC() - { - return NULL; - } - -MPresenceGrantRequestInfo* MPresenceObjectFactoryStub::NewPresenceGrantRequestInfoLC() - { - return NULL; - } - -MPresenceInfo* MPresenceObjectFactoryStub::NewPresenceInfoLC() - { - if ( !gMPresenceInfoStub ) - { - gMPresenceInfoStub = new ( ELeave )MPresenceInfoStub(); - } - - CleanupStack::PushL( gMPresenceInfoStub ); - return gMPresenceInfoStub; - } - -MPresenceInfoFilter* MPresenceObjectFactoryStub::NewPresenceInfoFilterLC() - { - return NULL; - } - -MPersonPresenceInfo* MPresenceObjectFactoryStub::NewPersonPresenceInfoLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubPersonPresenceInfo ); - return &gMPresenceObjectFactoryStubPersonPresenceInfo; - } - -MServicePresenceInfo* MPresenceObjectFactoryStub::NewServicePresenceInfoLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubServicePresenceInfo ); - return &gMPresenceObjectFactoryStubServicePresenceInfo; - } - -MDevicePresenceInfo* MPresenceObjectFactoryStub::NewDevicePresenceInfoLC() - { - return NULL; - } - -MPresenceInfoField* MPresenceObjectFactoryStub::NewInfoFieldLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubPresenceInfoField ); - return &gMPresenceObjectFactoryStubPresenceInfoField; - } - -MPresenceInfoFieldValueEnum* MPresenceObjectFactoryStub::NewEnumInfoFieldLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubPresenceInfoFieldValueEnum ); - return &gMPresenceObjectFactoryStubPresenceInfoFieldValueEnum; - } - -MPresenceInfoFieldValueText* MPresenceObjectFactoryStub::NewTextInfoFieldLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubPresenceInfoFieldValueText ); - return &gMPresenceObjectFactoryStubPresenceInfoFieldValueText; - } - -MPresenceInfoFieldValueBinary* MPresenceObjectFactoryStub::NewBinaryInfoFieldLC() - { - return NULL; - } - -MPresenceBlockInfo* MPresenceObjectFactoryStub::NewPresenceBlockInfoLC() - { - return NULL; - } - -const TAny* MPresenceObjectFactoryStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceObjectFactoryStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceObjectFactoryStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceobjectfactory.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presenceobjectfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* 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: s_presenceobjectfactory.h -* -*/ -#ifndef MPRESENCEOBJECTFACTORYSTUB_H -#define MPRESENCEOBJECTFACTORYSTUB_H - -#include - -class MPresenceObjectFactoryStub : public MPresenceObjectFactory - { -public: - - MPresentityGroupInfo* NewPresentityGroupInfoLC(); - - MPresentityGroupMemberInfo* NewPresentityGroupMemberInfoLC(); - - MPresenceWatcherInfo* NewPresenceWatcherInfoLC(); - - MPresenceGrantRequestInfo* NewPresenceGrantRequestInfoLC(); - - MPresenceInfo* NewPresenceInfoLC(); - - MPresenceInfoFilter* NewPresenceInfoFilterLC(); - - MPersonPresenceInfo* NewPersonPresenceInfoLC(); - - MServicePresenceInfo* NewServicePresenceInfoLC(); - - MDevicePresenceInfo* NewDevicePresenceInfoLC(); - - MPresenceInfoField* NewInfoFieldLC(); - - MPresenceInfoFieldValueEnum* NewEnumInfoFieldLC(); - - MPresenceInfoFieldValueText* NewTextInfoFieldLC(); - - MPresenceInfoFieldValueBinary* NewBinaryInfoFieldLC(); - - MPresenceBlockInfo* NewPresenceBlockInfoLC(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - -#endif // MPRESENCEOBJECTFACTORY_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencepersoninfo.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencepersoninfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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: s_presencepersoninfo.cpp -* -*/ - -#include "s_presencepersoninfo.h" -#include "s_presenceinfofieldcollection.h" - -MPresenceInfoFieldCollectionStub gMPersonPresenceInfoStubCollection; - -const MPresenceInfoFieldCollection& MPersonPresenceInfoStub::Fields() const - { - return gMPersonPresenceInfoStubCollection; - } - -MPresenceInfoFieldCollection& MPersonPresenceInfoStub::Fields() - { - return gMPersonPresenceInfoStubCollection; - } - -const TAny* MPersonPresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPersonPresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPersonPresenceInfoStub::GetInterfaceId() const - { - return 0; - } - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencepersoninfo.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencepersoninfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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: s_presencepersoninfo.h -* -*/ -#ifndef MXIMPFWPERSONPRESENCEINFOSTUB_H -#define MXIMPFWPERSONPRESENCEINFOSTUB_H - -#include - -class MPersonPresenceInfoStub : public MPersonPresenceInfo - { - const MPresenceInfoFieldCollection& Fields() const; - - MPresenceInfoFieldCollection& Fields(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif //MXIMPFWPERSONPRESENCEINFO_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencepublishing.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencepublishing.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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: s_presencepublishing.cpp -* -*/ - -#include "s_presencepublishing.h" - -TXIMPRequestId gMPresencePublishingStubId; -TInt gPublishOwnPresenceLeaves = KErrNone; - -TXIMPRequestId MPresencePublishingStub::SubscribeOwnPresenceL( const MPresenceInfoFilter& /*aPif*/ ) - { - return gMPresencePublishingStubId; - } - -TXIMPRequestId MPresencePublishingStub::UnsubscribeOwnPresenceL() - { - return gMPresencePublishingStubId; - } - -TXIMPRequestId MPresencePublishingStub::PublishOwnPresenceL( const MPresenceInfo& /*aPresence*/ ) - { - User::LeaveIfError( gPublishOwnPresenceLeaves ); - - return gMPresencePublishingStubId; - } - -TXIMPRequestId MPresencePublishingStub::SubscribePresenceWatcherListL() - { - return gMPresencePublishingStubId; - } - -TXIMPRequestId MPresencePublishingStub::UnsubscribePresenceWatcherListL() - { - return gMPresencePublishingStubId; - } - -const TAny* MPresencePublishingStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresencePublishingStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresencePublishingStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencepublishing.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencepublishing.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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: s_presencepublishing.h -* -*/ -#ifndef MXIMPFWPRESENCEPUBLISHINGSTUB_H -#define MXIMPFWPRESENCEPUBLISHINGSTUB_H - -#include - -class MPresencePublishingStub : public MPresencePublishing - { - TXIMPRequestId SubscribeOwnPresenceL( const MPresenceInfoFilter& aPif ); - - TXIMPRequestId UnsubscribeOwnPresenceL(); - - TXIMPRequestId PublishOwnPresenceL( const MPresenceInfo& aPresence ); - - TXIMPRequestId SubscribePresenceWatcherListL(); - - TXIMPRequestId UnsubscribePresenceWatcherListL(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENCEPUBLISHING_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencesubserviceeventobserver.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencesubserviceeventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* 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: s_presencesubserviceeventobserver.h -* -*/ - -#include "MVIMPSTEnginePresenceSubServiceEventObserver.h" -#include - -class MyPresenceSubServiceEventObserverStub : public MVIMPSTEnginePresenceSubServiceEventObserver, - public CBase - { - public : - - static MyPresenceSubServiceEventObserverStub* MyPresenceSubServiceEventObserverStub::NewL() - { - MyPresenceSubServiceEventObserverStub* self = new (ELeave) MyPresenceSubServiceEventObserverStub(); - return self; - } - - MyPresenceSubServiceEventObserverStub::~MyPresenceSubServiceEventObserverStub() - { - - } - - public: - /** - * observer to handle own presence change notifications - * - * @since s60 5.0 - * @param aStatus current status. - * @param aStatusText status text to be shown. - */ - void HandleOwnPresenceChangeEventL(TVIMPSTEnums::TOnlineStatus /*aStatus*/, const TDesC& /*aStatusText*/ ) - { - - } - - - void HandleAddRequestEventL(const TDesC& /*aRequester*/) - { - - } - }; - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencewatching.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencewatching.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* 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: s_presencewatching.cpp -* -*/ - -#include "s_presencewatching.h" - - -TXIMPRequestId MPresenceWatchingStub::SubscribePresentityPresenceL( - const MXIMPIdentity& /*aPresentityId*/, - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MPresenceWatchingStub::UnsubscribePresentityPresenceL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MPresenceWatchingStub::SubscribePresentityGroupMembersPresenceL( - const MXIMPIdentity& /*aGroupId*/, - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MPresenceWatchingStub::UnsubscribePresentityGroupMembersPresenceL( - const MXIMPIdentity& /*aGroupId*/ ) - { - TXIMPRequestId id; - return id; - } - -const TAny* MPresenceWatchingStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceWatchingStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceWatchingStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencewatching.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presencewatching.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* 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: s_presencewatching.h -* -*/ -#ifndef MXIMPFWPRESENCEWATCHINGSTUB_H -#define MXIMPFWPRESENCEWATCHINGSTUB_H - -#include - -class MPresenceWatchingStub : public MPresenceWatching - { - TXIMPRequestId SubscribePresentityPresenceL( - const MXIMPIdentity& aPresentityId, - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId UnsubscribePresentityPresenceL( - const MXIMPIdentity& aPresentityId ); - - TXIMPRequestId SubscribePresentityGroupMembersPresenceL( - const MXIMPIdentity& aGroupId, - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId UnsubscribePresentityGroupMembersPresenceL( - const MXIMPIdentity& aGroupId ); - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENCEWATCHINGSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presentitygroups.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presentitygroups.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,257 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Presentity group handling interface for clients use. -* -*/ - - -#include "s_presentitygroups.h" - -/** - * Protected destructor. - * Object instancies can't be deleted via this interface. - */ -MyPresentityGroupsStub::~MyPresentityGroupsStub() {} - -//MyPresentityGroupsStub::MyPresentityGroupsStub {} - -/** - * Subscribes presentity group list notifications. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::SubscribePresentityGroupListL() - { - TXIMPRequestId id; - return id; - } - - - -/** - * Unsubscribes presentity group list notifications. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::UnsubscribePresentityGroupListL() - { - TXIMPRequestId id; - return id; - } - - - -/** - * Creates presentity group. - * - * Note: Remote service may alter given presentity group ID and - * display name. Altered ID and display names are signalled back - * to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aDisplayName - * Presentity group display name. - * - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::CreatePresentityGroupL( - const MXIMPIdentity& /*aGroupId*/, - const TDesC16& /*aDisplayName*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Deletes presentity group. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::DeletePresentityGroupL( - const MXIMPIdentity& /*aGroupId*/ ) - { - TXIMPRequestId id; - return id; - } - - - -/** - * Updates presentity group display name. - * - * Note: Remote service may alter given presentity group display name. - * Altered display name is signalled back to client through - * MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aDisplayName - * New display name for the presentity group. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::UpdatePresentityGroupDisplayNameL( - const MXIMPIdentity& /*aGroupId*/, - const TDesC16& /*aDisplayName*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Subscribes presentity group content notifications. - * - * @param [in] aGroupId - * Identification for presentity group for which - * to subscribe content notifications. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::SubscribePresentityGroupContentL( - const MXIMPIdentity& /*aGroupId*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Unsubscribes presentity group content notifications. - * - * @param [in] aGroupId - * Identification for presentity group for which - * content notification subscription to terminate. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::UnsubscribePresentityGroupContentL( - const MXIMPIdentity& /*aGroupId*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Requests the protocol to add new member to - * identified presentity group. - * - * - * Note: Remote service may alter given member and - * display name. Altered ID and display names - * are signalled back to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification of the presentity group where to - * add new member. - * - * @param [in] aMemberId - * Identification of the new member. - * - * @param [in] aMemberDisplayName - * Display name for the added member. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::AddPresentityGroupMemberL( - const MXIMPIdentity& /*aGroupId*/, - const MXIMPIdentity& /*aMemberId*/, - const TDesC16& /*aMemberDisplayName*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Requests the XIMPFw to remove member from - * identified presentity group. - * - * @param [in] aGroupId - * Identification of the presentity group from - * where to remove member. - * - * @param [in] aMemberId - * Identification of the member to remove. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::RemovePresentityGroupMemberL( - const MXIMPIdentity& /*aGroupId*/, - const MXIMPIdentity& /*aMemberId*/ ) - { - TXIMPRequestId id; - return id; - } - - - -/** - * Requests the XIMPFw to update presentity group - * member display name. - * - * Note: Remote service may alter given presentity group member - * display name. Altered display name is signalled back - * to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aMemberId - * Identification of the member which display - * name to update. - * - * @param [in] aMemberDisplayName - * New display name for the member. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::UpdatePresentityGroupMemberDisplayNameL( - const MXIMPIdentity& /*aGroupId*/, - const MXIMPIdentity& /*aMemberId*/, - const TDesC16& /*aMemberDisplayName*/ ) - { - TXIMPRequestId id; - return id; - } - - - -const TAny* MyPresentityGroupsStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MyPresentityGroupsStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MyPresentityGroupsStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presentitygroups.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_presentitygroups.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,245 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Presentity group handling interface for clients use. -* -*/ - -#ifndef MyPresentityGroupsStub_H -#define MyPresentityGroupsStub_H - -#include -#include -#include - -class MXIMPIdentity; - - -/** - * Presentity group handling interface for clients use. - * Interface is implemented by the XIMP Framework. - * - * MPresentityGroups provides services for - * XIMP Framework clients to manage presentity groups - * and presentity group members. It provides also services - * to subscribe notifications from presentity group list changes - * and from individual presentity group changes. - * - * Client can retrieve MPresentityGroups interface from - * MXIMPContext interface. - * - * @ingroup ximppresmanagementapi - * @since S60 v3.2 - */ -class MyPresentityGroupsStub : public MPresentityGroups, public CBase - { - -public: - /** - * Protected destructor. - * Object instancies can't be deleted via this interface. - */ - ~MyPresentityGroupsStub(); - - - /** - * Subscribes presentity group list notifications. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId SubscribePresentityGroupListL() ; - - - - /** - * Unsubscribes presentity group list notifications. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId UnsubscribePresentityGroupListL() ; - - - - /** - * Creates presentity group. - * - * Note: Remote service may alter given presentity group ID and - * display name. Altered ID and display names are signalled back - * to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aDisplayName - * Presentity group display name. - * - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId CreatePresentityGroupL( - const MXIMPIdentity& aGroupId, - const TDesC16& aDisplayName ) ; - - - /** - * Deletes presentity group. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId DeletePresentityGroupL( - const MXIMPIdentity& aGroupId ) ; - - - - /** - * Updates presentity group display name. - * - * Note: Remote service may alter given presentity group display name. - * Altered display name is signalled back to client through - * MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aDisplayName - * New display name for the presentity group. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId UpdatePresentityGroupDisplayNameL( - const MXIMPIdentity& aGroupId, - const TDesC16& aDisplayName ) ; - - - -public: //Prototypes for presentity group member management requests - - - /** - * Subscribes presentity group content notifications. - * - * @param [in] aGroupId - * Identification for presentity group for which - * to subscribe content notifications. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId SubscribePresentityGroupContentL( - const MXIMPIdentity& aGroupId ) ; - - - /** - * Unsubscribes presentity group content notifications. - * - * @param [in] aGroupId - * Identification for presentity group for which - * content notification subscription to terminate. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId UnsubscribePresentityGroupContentL( - const MXIMPIdentity& aGroupId ) ; - - - /** - * Requests the protocol to add new member to - * identified presentity group. - * - * - * Note: Remote service may alter given member and - * display name. Altered ID and display names - * are signalled back to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification of the presentity group where to - * add new member. - * - * @param [in] aMemberId - * Identification of the new member. - * - * @param [in] aMemberDisplayName - * Display name for the added member. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId AddPresentityGroupMemberL( - const MXIMPIdentity& aGroupId, - const MXIMPIdentity& aMemberId, - const TDesC16& aMemberDisplayName ) ; - - - /** - * Requests the XIMPFw to remove member from - * identified presentity group. - * - * @param [in] aGroupId - * Identification of the presentity group from - * where to remove member. - * - * @param [in] aMemberId - * Identification of the member to remove. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId RemovePresentityGroupMemberL( - const MXIMPIdentity& aGroupId, - const MXIMPIdentity& aMemberId ) ; - - - - /** - * Requests the XIMPFw to update presentity group - * member display name. - * - * Note: Remote service may alter given presentity group member - * display name. Altered display name is signalled back - * to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aMemberId - * Identification of the member which display - * name to update. - * - * @param [in] aMemberDisplayName - * New display name for the member. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId UpdatePresentityGroupMemberDisplayNameL( - const MXIMPIdentity& aGroupId, - const MXIMPIdentity& aMemberId, - const TDesC16& aMemberDisplayName ) ; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - - - -#endif // MyPresentityGroupsStub_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_rproperty.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_rproperty.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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: s_rproperty.cpp -* -*/ -#include -#include - - -TInt gKey = KErrNotFound; -TInt gValue = KErrNotFound; -TRequestStatus gRequest = 0; -/* - IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, TInt aPreallocate=0); - IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); - IMPORT_C static TInt Define(TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); - IMPORT_C static TInt Delete(TUid aCategory, TUint aKey); - IMPORT_C static TInt Delete(TUint aKey); - IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes16& aValue); -#endif - IMPORT_C static TInt Set(TUid aCategory, TUint aKey, TInt aValue); - IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC16& aValue); -#endif - - IMPORT_C void Cancel(); - - IMPORT_C TInt Get(TInt& aValue); - IMPORT_C TInt Get(TDes8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C TInt Get(TDes16& aValue); -#endif - IMPORT_C TInt Set(TInt aValue); - IMPORT_C TInt Set(const TDesC8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C TInt Set(const TDesC16& aValue); -*/ - -TInt RProperty::Attach(TUid /*aCategory*/, TUint /*aKey*/, TOwnerType /*aType*/ ) - { - return KErrNone; - } - -TInt RProperty::Set(TUid /*aCategory*/, TUint aKey, TInt aValue) - { - gKey = aKey; - gValue = aValue; - - return KErrNone; - } - -TInt RProperty::Get( TInt& aValue ) - { - aValue = gValue; - - return KErrNone; - } - -TInt RProperty::Get(TUid /*aCategory*/, TUint aKey, TInt& aValue) - { - if( aKey == gKey ) - { - aValue = gValue; - return KErrNone; - } - - return KErrNotFound; - } - -void RProperty::Subscribe(TRequestStatus& /*aRequest*/) - { - } - -void RProperty::Cancel() - { - } - -TInt RProperty::Define(TUid /*aCategory*/, TUint /*aKey*/, TInt /*aAttr*/, TInt /*aPreallocate=0*/) - { - return KErrNone; - } - -void RHandleBase::Close() -{ - -} - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_servicepresenceinfo.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_servicepresenceinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* 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: s_servicepresenceinfo.cpp -* -*/ - -#include "s_servicepresenceinfo.h" -#include "s_presenceinfofieldcollection.h" - -MPresenceInfoFieldCollectionStub gMPresenceInfoFieldCollection; - -const TPtrC8 MServicePresenceInfoStub::ServiceType() const - { - return KNullDesC8(); - } - -void MServicePresenceInfoStub::SetServiceTypeL( const TDesC8& /*aServiceType*/ ) - { - } - -const MPresenceInfoFieldCollection& MServicePresenceInfoStub::Fields() const - { - MPresenceInfoFieldCollection* collection = NULL; - return *collection; - } - -MPresenceInfoFieldCollection& MServicePresenceInfoStub::Fields() - { - return gMPresenceInfoFieldCollection; - } - -const TAny* MServicePresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MServicePresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MServicePresenceInfoStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_servicepresenceinfo.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_servicepresenceinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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: s_servicepresenceinfo.h -* -*/ -#ifndef MXIMPFWSERVICEPRESENCEINFOSTUB_H -#define MXIMPFWSERVICEPRESENCEINFOSTUB_H - -#include - -class MServicePresenceInfoStub : public MServicePresenceInfo - { - const TPtrC8 ServiceType() const; - - void SetServiceTypeL( const TDesC8& aServiceType ); - - const MPresenceInfoFieldCollection& Fields() const; - - MPresenceInfoFieldCollection& Fields(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - -#endif //MXIMPFWSERVICEPRESENCEINFO_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_spentry.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_spentry.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* 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: s_spentry.cpp -* -*/ - -#include -#include - - -CSPEntry* CSPEntry::NewL() - { - CSPEntry* self = CSPEntry::NewLC(); - CleanupStack::Pop(self); - return self; - } - -CSPEntry* CSPEntry::NewLC() - { - CSPEntry* self = new ( ELeave) CSPEntry; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -CSPEntry::~CSPEntry() - { - iServiceName.Close(); - iPropertyArray.ResetAndDestroy(); - iPropertyArray.Close(); - } - -TServiceId CSPEntry::GetServiceId() const - { - return iServiceId; - } - -void CSPEntry::SetServiceId( TServiceId aServiceId ) - { - iServiceId = aServiceId; - } - -const TDesC16& CSPEntry::GetServiceName() const - { - return iServiceName; - } - -TInt CSPEntry::SetServiceName( const TDesC16& aServiceName ) - { - - iServiceName.Copy(aServiceName); - return KErrNone; - } - -TInt CSPEntry::AddPropertyL( const CSPProperty& aProperty ) - { - CSPProperty* property = CSPProperty::NewL(); - CleanupStack::PushL( property ); - - property->CopyL( aProperty ); - - TInt err = iPropertyArray.Append( property ); - if( err == KErrNoMemory ) - { - User::Leave( KErrNoMemory ); - } - - CleanupStack::Pop( property ); - - return KErrNone; - } - - -TInt CSPEntry::UpdateProperty( TServicePropertyName /*aPropertyName*/, TInt /*aValue*/ ) - { - return KErrNone; - } - - -TInt CSPEntry::UpdateProperty( TServicePropertyName /*aPropertyName*/, const TDesC& /*aValue*/ ) - { - return KErrNone; - } - -TInt CSPEntry::UpdateProperty( TServicePropertyName /*aPropertyName*/, TOnOff /*aValue*/ ) - { - return KErrNone; - } - -TInt CSPEntry::GetProperty( const CSPProperty*& aProperty, - TServicePropertyName aPropertyName ) const - { - TInt count = iPropertyArray.Count(); - for( TInt i=0; iGetName() == aPropertyName ) - { - aProperty = iPropertyArray[ i ]; - return KErrNone; - } - } - - return KErrNotFound; - } - -TInt CSPEntry::GetProperty( const CSPProperty*& /*aProperty*/, - TInt /*aIndex*/ ) const - { - return KErrNone; - } - -TInt CSPEntry::DeleteProperty( TInt /*aIndex*/ ) - { - return KErrNone; - } - -TInt CSPEntry::DeleteProperty( TServicePropertyName /*aProperty*/ ) - { - return KErrNone; - } - -const RPropertyArray& CSPEntry::GetAllProperties() const - { - return iPropertyArray; - } - -TInt CSPEntry::PropertyCount() const - { - return KErrNone; - } - -CSPEntry::CSPEntry() - { - } - -void CSPEntry::ConstructL() - { - iServiceName.CreateL(500); - } - -TInt CSPEntry::SearchProperty( TServicePropertyName /*aProperty*/ ) const - { - return KErrNone; - } - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_spproperty.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_spproperty.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,317 +0,0 @@ -/* -* 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: s_spproperty.cpp -* -*/ - -#include - -TServicePropertyName gPropertyName = EPropertyUnknown; -TInt gContactViewPluginId = 0; -HBufC* gPropertyContactStoreId = 0; -HBufC* gPropertyBrandId = 0; -TBool gPropertyInvalid = EFalse; -TInt gPropertyBrandLanguage = 0; -TInt gPropertyBrandVersion = 0; -TInt gPropertyXIMP = 0; -TOnOff gPropertyPresenceRequestPreference = EOff; -TInt gContactViewId = 0; - -TOnOff gPropertyVoIPEnabled = EOff; -TInt gPropertyPresenceSettingsId = 0; -TInt gPropertyIMSettingsId = 0; -TInt gPropertyPCSPluginId = 0; - -CSPProperty* CSPProperty::NewL() - { - return new ( ELeave ) CSPProperty; - } - - -CSPProperty* CSPProperty::NewLC() - { - - CSPProperty* self = new ( ELeave ) CSPProperty; - CleanupStack::PushL( self ); - return self; - } - -CSPProperty::~CSPProperty(){} - - -TServicePropertyName CSPProperty::GetName() const - { - return iPropertyName; - } - - -TInt CSPProperty::SetName( TServicePropertyName aPropertyname ) - { - iPropertyName = aPropertyname; - return KErrNone; - } - - -TSPItemType CSPProperty::GetPropertyType() const - { - TSPItemType type = EItemTypeNotDefined; - return type; - } - - -TInt CSPProperty::SetPropertyType( TSPItemType /*aPropertyType*/ ){ return KErrNone; } - - -TPropertyDataType CSPProperty::GetDataType() const - { - TPropertyDataType type = EDataTypeNotSet; - return type; - } - - -void CSPProperty::SetDataType( TPropertyDataType /*aDataType*/ ){} - - -TInt CSPProperty::GetValue( TInt& aValue ) const - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - - if( GetName() == EPropertyContactViewPluginId ) - { - aValue = gContactViewPluginId; - } - else if( GetName() == EPropertyBrandLanguage ) - { - aValue = gPropertyBrandLanguage; - } - else if( GetName() == EPropertyBrandVersion ) - { - aValue = gPropertyBrandVersion; - } - else if( GetName() == EPropertyPCSPluginId ) - { - aValue = gPropertyXIMP; - } - else if( GetName() == EPropertyContactViewId ) - { - aValue = gContactViewId; - } - else if( GetName() == ESubPropertyPresenceSettingsId ) - { - aValue = gPropertyPresenceSettingsId; - } - else if( GetName() == ESubPropertyIMSettingsId ) - { - aValue = gPropertyIMSettingsId; - } - else if( GetName() == EPropertyPCSPluginId ) - { - aValue = gPropertyPCSPluginId; - } - - return KErrNone; - } - -TInt CSPProperty::SetValue( TInt aValue ) - { - if( GetName() == EPropertyContactViewPluginId ) - { - gContactViewPluginId = aValue; - } - else if( GetName() == EPropertyBrandLanguage ) - { - gPropertyBrandLanguage = aValue; - } - else if( GetName() == EPropertyBrandVersion ) - { - gPropertyBrandVersion = aValue; - } - else if( GetName() == EPropertyPCSPluginId ) - { - gPropertyXIMP = aValue; - } - else if( GetName() == EPropertyContactViewId ) - { - gContactViewId = aValue ; - } - else if( GetName() == ESubPropertyPresenceSettingsId ) - { - gPropertyPresenceSettingsId = aValue ; - } - else if( GetName() == ESubPropertyIMSettingsId ) - { - gPropertyIMSettingsId = aValue ; - } - else if( GetName() == EPropertyPCSPluginId ) - { - gPropertyPCSPluginId = aValue ; - } - - - return KErrNone; - } - - -TInt CSPProperty::GetValue( TDes& aValue ) const - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - if( GetName() == EPropertyContactStoreId ) - { - if (gPropertyContactStoreId) - { - aValue.Copy(*gPropertyContactStoreId); - } - } - else if( GetName() == EPropertyBrandId ) - { - if (gPropertyBrandId) - { - aValue.Copy(*gPropertyBrandId); - } - } - - return KErrNone; - } - -TInt CSPProperty::SetValue( const TDesC& aValue ) - { - if( GetName() == EPropertyContactStoreId ) - { - - if (gPropertyContactStoreId) - { - delete gPropertyContactStoreId; - gPropertyContactStoreId = NULL; - } - - gPropertyContactStoreId = aValue.Alloc(); - } - else if( GetName() == EPropertyBrandId ) - { - if (gPropertyBrandId) - { - delete gPropertyBrandId; - gPropertyBrandId = NULL; - } - gPropertyBrandId = aValue.Alloc(); - } - - return KErrNone; - } - -TInt CSPProperty::GetValue( TOnOff& aValue ) const - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - - if( GetName() == ESubPropertyPresenceRequestPreference ) - { - aValue = gPropertyPresenceRequestPreference; - } - else if( GetName() == ESubPropertyVoIPEnabled ) - { - aValue = gPropertyVoIPEnabled; - } - - return KErrNone; - } - - -TInt CSPProperty::SetValue( TOnOff aValue ) - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - - if( GetName() == ESubPropertyPresenceRequestPreference ) - { - gPropertyPresenceRequestPreference = aValue; - } - else if( GetName() == ESubPropertyVoIPEnabled ) - { - gPropertyVoIPEnabled = aValue; - } - - return KErrNone; - } - - -TInt CSPProperty::SetValueNoDataTypeCheck( const TDesC& /*aValue*/ ){ return KErrNone; } - - -TPropertyDataType CSPProperty::DataType( TServicePropertyName /*aProperty*/ ) - { - TPropertyDataType type = EDataTypeNotSet; - return type; - } - - -TSPItemType CSPProperty::PropertyType( TServicePropertyName /*aProperty*/ ) - { - TSPItemType type = EItemTypeNotDefined; - return type; - } - - -void CSPProperty::CopyL( const CSPProperty& aSource ) - { - iPropertyName = aSource.GetName(); - - if( GetName() == EPropertyContactStoreId ) - { - HBufC* value = HBufC::NewLC(500); - TPtr valuePtr = value->Des(); - aSource.GetValue(valuePtr); - SetValue( valuePtr ); - - CleanupStack::PopAndDestroy(value); - } - else if( GetName() == EPropertyBrandId ) - { - HBufC* value = HBufC::NewLC(500); - TPtr valuePtr = value->Des(); - aSource.GetValue(valuePtr); - SetValue( valuePtr ); - - CleanupStack::PopAndDestroy(value); - } - else if( GetName() == EPropertyContactViewPluginId ) - { - TInt value = 0; - aSource.GetValue( value ); - SetValue( value ); - } - - } - - -TBool CSPProperty::CSPProperty::operator==( - const CSPProperty& /*aProperty*/ ) const{ return ETrue; } - -CSPProperty::CSPProperty(){} - -void CSPProperty::ConstructL(){} - - -TInt SetDefaultValue( TServicePropertyName /*aProperty*/ ){ return KErrNone; } - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_spsettings.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_spsettings.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,241 +0,0 @@ -/* -* 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: s_spsettings.cpp -* -*/ -#include -#include -#include - -RArray< TServiceId > gServiceIds; -RPointerArray< CSPEntry > gEntries; - - -CSPSettings* myCSPSettings = NULL; - - -extern TServicePropertyName gPropertyName; -extern TInt gContactViewPluginId; -extern HBufC* gPropertyContactStoreId; -extern HBufC* gPropertyBrandId; -extern TBool gPropertyInvalid; -extern TInt gPropertyBrandLanguage; -extern TInt gPropertyBrandVersion; -extern TInt gPropertyXIMP; -extern TOnOff gPropertyPresenceRequestPreference; -extern TInt gContactViewId; - -CSPSettings* CSPSettings::NewL() - { - if (!myCSPSettings) - { - myCSPSettings = new ( ELeave ) CSPSettings; - } - return myCSPSettings; - } - -CSPSettings* CSPSettings::NewLC() - { - CSPSettings* settings = CSPSettings::NewL(); - CleanupStack::PushL( settings ); - return settings; - } - -CSPSettings::~CSPSettings() - { - gServiceIds.Close(); - - gEntries.ResetAndDestroy(); - gEntries.Close(); - delete gPropertyContactStoreId; - delete gPropertyBrandId; - - - myCSPSettings = NULL; - gPropertyName = EPropertyUnknown; - gContactViewPluginId = 0; - gPropertyContactStoreId = 0; - gPropertyBrandId = 0; - gPropertyInvalid = EFalse; - gPropertyBrandLanguage = 0; - gPropertyBrandVersion = 0; - gPropertyXIMP = 0; - gPropertyPresenceRequestPreference = EOff; - gContactViewId = 0; - } - -void CopyEntry( const CSPEntry& aOriginal, CSPEntry& aTarget ) - { - aTarget.SetServiceId( aOriginal.GetServiceId() ); - aTarget.SetServiceName( aOriginal.GetServiceName() ); - RPropertyArray array = aOriginal.GetAllProperties(); - for( TInt i = 0; i < array.Count(); i++ ) - { - TRAP_IGNORE( aTarget.AddPropertyL( *array[i] ) ); - } - } - -TInt CSPSettings::AddEntryL( CSPEntry& aEntry ) - { - TInt err = gServiceIds.Append( aEntry.GetServiceId() ); - if( err ) - { - User::Leave( err ); - } - - CSPEntry* entry = CSPEntry::NewLC(); - CopyEntry( aEntry, *entry ); - // If property counts difference from each other, - // alloc failure has happened in CopyEntry - if( aEntry.GetAllProperties().Count() != - entry->GetAllProperties().Count() ) - { - User::Leave( KErrNoMemory ); - } - - err = gEntries.Append( entry ); - if( err ) - { - User::Leave( err ); - } - CleanupStack::Pop( entry ); - return KErrNone; - } - -TInt CSPSettings::FindEntryL( TServiceId aServiceId, CSPEntry& aEntry ) - { - for( TInt i=0; iGetAllProperties().Count() ) - { - User::Leave( KErrNoMemory ); - } - - return KErrNone; - } - } - - return KErrNotFound; - } - - -TInt CSPSettings::UpdateEntryL( const CSPEntry& aEntry ) - { - for( TInt i=0; iSetServiceName( aEntry.GetServiceName() ); - RPropertyArray propOrig = gEntries[i]->GetAllProperties(); - RPropertyArray propNew = aEntry.GetAllProperties(); - TBool found = EFalse; - for( TInt j = 0; j < propNew.Count(); j++ ) - { - for( TInt k = 0; k < propOrig.Count() && !found; k++ ) - { - if( propNew[j] == propOrig[k] ) - { - found = ETrue; - } - } - if( !found ) - { - gEntries[i]->AddPropertyL( *propNew[j] ); - } - found = EFalse; - } - return KErrNone; - } - } - - return KErrNotFound; - } - -TInt CSPSettings::FindPropertyL( TServiceId aServiceId, - TServicePropertyName aPropertyName, - CSPProperty& aProperty ) - { - for( TInt i=0; iGetProperty( property, - aPropertyName ); - - if (KErrNone == err) - { - aProperty.CopyL(*property); - return KErrNone; - } - } - } - - return KErrNotFound; - } - - -TInt CSPSettings::FindServiceIdsL( RIdArray& aServiceIds ) - { - if( gServiceIds.Count() == 0 ) - { - return KErrNotFound; - } - - for( TInt i=0; i - -void User::WaitForRequest(TRequestStatus& /*aStatus*/) - { - } - -void User::After(TTimeIntervalMicroSeconds32 /*aInterval*/) - { - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstengineaimagehandler.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstengineaimagehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2008 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: s_vimpstengineaimagehandler.cpp -* -*/ - -// INCLUDE FILES -#include "s_vimpstengineaimagehandler.h" - - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::NewL -// Two-phased constructor. -// --------------------------------------------------------- -EXPORT_C CVIMPSTEngineImageHandler* CVIMPSTEngineImageHandler::NewL() - { - CVIMPSTEngineImageHandler* self = - CVIMPSTEngineImageHandler::NewLC( ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::NewLC -// Two-phased constructor. -// --------------------------------------------------------- -EXPORT_C CVIMPSTEngineImageHandler* CVIMPSTEngineImageHandler::NewLC( ) - { - CVIMPSTEngineImageHandler* self = new (ELeave) - CVIMPSTEngineImageHandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::CVIMPSTEngineImageHandler -// --------------------------------------------------------- -CVIMPSTEngineImageHandler::CVIMPSTEngineImageHandler() - { - - } -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::ConstructL -// --------------------------------------------------------- -void CVIMPSTEngineImageHandler::ConstructL() - { - } -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::~CVIMPSTEngineImageHandler -// --------------------------------------------------------- -CVIMPSTEngineImageHandler::~CVIMPSTEngineImageHandler() - { - } - -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::HandleProcessingCompleteL -// -// ------------------------------------------------------------------------ -void CVIMPSTEngineImageHandler::HandleProcessingCompleteL( TInt /*aStatus*/ ) - { - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::ProcessImageFromFileL -// -// ------------------------------------------------------------------------ -EXPORT_C HBufC8* CVIMPSTEngineImageHandler::ProcessImageFromFileL(const TDesC& /*aFilename*/ , - const TDesC8& /*aMimetype*/) - { - HBufC8* temp = NULL; - return temp; - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::ProcessImageFromDataL -// -// ------------------------------------------------------------------------ -EXPORT_C HBufC8* CVIMPSTEngineImageHandler::ProcessImageFromDataL( const TDesC8& /*aImageData */, const TDesC8& /*aMimeType*/) - { - HBufC8* temp = NULL; - return temp; - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstengineaimagehandler.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstengineaimagehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* Copyright (c) 2008 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: s_vimpstengineaimagehandler.h -* -*/ - -#ifndef __CVIMPSTENGINEIMAGEHANDLER_H -#define __CVIMPSTENGINEIMAGEHANDLER_H - -// INCLUDES -#include - -#include "mvimpstimageprocessobserver.h" - -// FORWARD DECLARATIONS -class CVimpstImageProcessor; -class CFbsBitmap; - -// CLASS DECLARATION -/** - * This Class is wrapper over the CVimpstImageProcessor implements the processing of image - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineImageHandler ) : public CBase, - public MCAImageProcessObserver - - { - - - public: // Two-phased constructors and destructor - - /** - * Two-phased constructor. - */ - - IMPORT_C static CVIMPSTEngineImageHandler* NewL(); - /** - * Two-phased constructor. - */ - IMPORT_C static CVIMPSTEngineImageHandler* NewLC(); - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - /** - * C++ Destructor. - */ - virtual ~CVIMPSTEngineImageHandler(); - - - private: - - /** - * default constructor - */ - CVIMPSTEngineImageHandler(); - - - - public: - /** - * process the image from file name - * @return processed image content - */ - IMPORT_C HBufC8* ProcessImageFromFileL(const TDesC& aFilename , - const TDesC8& aMimetype); - /** - * process the image from image data - * @return processed image content - */ - IMPORT_C HBufC8* ProcessImageFromDataL( const TDesC8& aImageData , const TDesC8& aMimeType); - /** - * Get Bitmap - * @return bitmap - */ - IMPORT_C CFbsBitmap& Bitmap(); - public: // from MCAImageProcessObserver - - /** - * See MCAImageProcessObserver - */ - void HandleProcessingCompleteL( TInt aStatus ); - - - private: - - - //Result code from waited request - TInt iReqResult; - - // Owns content - HBufC8* iContent; - - // Owns imageporcessor - CVimpstImageProcessor* iProcessor; - - // own active sheduler - CActiveSchedulerWait iWait; - - }; - -#endif //__CVIMPSTENGINEIMAGEHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstengineavatarextention.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstengineavatarextention.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,270 +0,0 @@ -/* -* Copyright (c) 2008 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: s_vimpstengineavatarextention.cpp -* -*/ - -// INCLUDE FILES -#include "cvimpstengineavatarextention.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "cvimpstenginerequestmapper.h" -#include "cvimpstenginerequest.h" -#include "vimpstdebugprint.h" -#include "tvimpstenums.h" - - -#include "vimpstallerrors.h" -#include "tvimpstconsts.h" - -#include "cvimpstsettingsstore.h" // settings store in cenrep used for own avatar data -#include "imconnectionproviderconsts.h" - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::NewL -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTEngineAvatarExtention* CVIMPSTEngineAvatarExtention::NewL( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper) - { - CHAT_DP_FUNC_ENTER("CVIMPSTEngineAvatarExtention::NewL"); - CVIMPSTEngineAvatarExtention* self = - CVIMPSTEngineAvatarExtention::NewLC( aServiceId, aFeatures, - aRequestMapper - ); - CleanupStack::Pop( self ); - CHAT_DP_FUNC_DONE("CVIMPSTEngineAvatarExtention::NewL"); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::NewLC -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTEngineAvatarExtention* CVIMPSTEngineAvatarExtention::NewLC( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper) - { - CHAT_DP_FUNC_ENTER("CVIMPSTEngineAvatarExtention::NewLC"); - CVIMPSTEngineAvatarExtention* self = new (ELeave) - CVIMPSTEngineAvatarExtention(aServiceId, aFeatures,aRequestMapper); - CleanupStack::PushL( self ); - - CHAT_DP_FUNC_DONE("CVIMPSTEngineAvatarExtention::NewLC"); - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::CVIMPSTEngineAvatarExtention -// --------------------------------------------------------- -CVIMPSTEngineAvatarExtention::CVIMPSTEngineAvatarExtention( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper) - : - iServiceId(aServiceId), - iFeatures(aFeatures), - iRequestMapper(aRequestMapper), - iSupported(TVIMPSTEnums::ESupportUnKnown) - { - - } - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::~CVIMPSTEngineAvatarExtention -// --------------------------------------------------------- -CVIMPSTEngineAvatarExtention::~CVIMPSTEngineAvatarExtention() - { - CHAT_DP_FUNC_ENTER("CVIMPSTEngineAvatarExtention::~CVIMPSTEngineAvatarExtention"); - - CHAT_DP_FUNC_DONE("CVIMPSTEngineAvatarExtention::~CVIMPSTEngineAvatarExtention"); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::IsSupported() -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::FeatureSupport CVIMPSTEngineAvatarExtention::IsSupported() const - { - return iSupported; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::Type() -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::ExtentionType CVIMPSTEngineAvatarExtention::Type() const - { - return TVIMPSTEnums::EAvatar; - } - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::UpdateAvtarToServerL -// -// --------------------------------------------------------- -TInt CVIMPSTEngineAvatarExtention::UpdateAvtarToServerL(const TDesC& aFilename, const TDesC8& aMimetype) - { - TInt error = KErrNone; - HBufC8* avatarContent = NULL; - if ( aFilename.Length()) - { - CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL(); - CleanupStack::PushL(imageHandler); - // get the avatar content from the image processor - // returns image content if the processing succesful - avatarContent = imageHandler->ProcessImageFromFileL( aFilename , aMimetype); - if ( !avatarContent ) - { - // some problem in the image processing , so set as general error - error = KErrGeneral; - } - CleanupStack::PopAndDestroy(imageHandler); // imageHandler - } - // if there is no error in processing or to set default avatar - if( ! error) - { - MPresencePublishing& publisher = iFeatures.PresencePublishing(); - MPresenceInfo* myPresence = iFeatures.PresenceObjectFactory().NewPresenceInfoLC();//1 - MPersonPresenceInfo *PersonPresence = iFeatures.PresenceObjectFactory().NewPersonPresenceInfoLC();//2 - MPresenceInfoFieldCollection& attributeFields = PersonPresence->Fields(); - MPresenceInfoField* infoField = iFeatures.PresenceObjectFactory().NewInfoFieldLC();//3 - MPresenceInfoFieldValueBinary* avatarField = iFeatures.PresenceObjectFactory().NewBinaryInfoFieldLC();//4 - // "avatar" attribute - - if(avatarContent) - { - avatarField->SetBinaryValueL(*avatarContent); - } - else - { - // this is to clear the avatar - avatarField->SetBinaryValueL(KNullDesC8); - } - // Take handles to object factory and publish interface - - CleanupStack::Pop(); // (4)avatarField, pop before passing the ownership to infofiled - - //Fill presence doc with presence components and attributes - infoField->SetFieldTypeL( NPresenceInfo::NFieldType::KAvatar ); - // for clear avatar mimetye is KNUllDesc so set for all the cases - avatarField->SetMimeTypeL(aMimetype); - infoField->SetFieldValue( avatarField ); - CleanupStack::Pop(); // (3)infoField ownership is passed to attributeFields - - attributeFields.AddOrReplaceFieldL(infoField );// - CleanupStack::Pop(); // (2)PersonPresence, as ownership is transfered to mypresence - - myPresence->SetPersonPresenceL(PersonPresence); - TXIMPRequestId reqId = publisher.PublishOwnPresenceL( *myPresence ); - // wait completion - iRequestMapper.CreateRequestL(reqId, ETrue, EVIMPSTXimpOperationSetAvatar ); - if( !iReqResult ) - { - // singleton object owned by tabbedview : dont delete - MVIMPSTSettingsStore* store = CVIMPSTSettingsStoreFactory ::NewL(); - if(avatarContent) - { - error = store->SetL(iServiceId ,EServiceAvatar ,*avatarContent); - } - else - { - error = store->SetL(iServiceId ,EServiceAvatar ,KNullDesC8); - } - } - else - { - error = iReqResult; - } - - CleanupStack::Pop(); // (1) myPresence - - delete avatarContent; - avatarContent = NULL; - } - // return the error - return error; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::HandleSessionContextEventL -// --------------------------------------------------------- -void CVIMPSTEngineAvatarExtention::HandleSessionContextEventL(const MXIMPContext& /*aContext*/, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation /*= EVIMPSTXimpOperationNoOperation*/ ) - { - - CHAT_DP_FUNC_ENTER("CVIMPSTEngineAvatarExtention::HandleSessionContextEventL"); - - switch( aEvent.GetInterfaceId() ) - { - case MXIMPRequestCompleteEvent::KInterfaceId: - { - CHAT_DP_FUNC_ENTER("InsideCallbackswitch::MXIMPRequestCompleteEvent"); - if (EVIMPSTXimpOperationSetAvatar == aXimpOperation) - { - const MXIMPRequestCompleteEvent* event = - TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - - iReqResult = event->CompletionResult().ResultCode(); - const TXIMPRequestId& reqId = event->RequestId(); - CVIMPSTEngineRequest *req = iRequestMapper.FindRequestId( reqId ); - - if ( req ) - { - req->StopWait() ; - iRequestMapper.RemoveRequestId(reqId); - delete req; - } - } - break; - } - - default: - { - break; - } - } - CHAT_DP_FUNC_DONE("CVIMPSTEngineAvatarExtention::HandleSessionContextEventL"); - } - -//---------------------------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::SetSupported() -// ----------------------------------------------------------------------------- -// -void CVIMPSTEngineAvatarExtention::SetSupported(TVIMPSTEnums::FeatureSupport aSupported) - { - iSupported = aSupported; - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstengineavatarextention.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstengineavatarextention.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2008 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: s_vimpstengineavatarextention.h -* -*/ - -#ifndef __CVIMPSTENGINEAVATAREXTENTION_H -#define __CVIMPSTENGINEAVATAREXTENTION_H - -// INCLUDES -#include - -#include "mvimpstengineavatarextention.h" -#include "TVIMPSTEnums.h" -#include "mvimpstenginesessioncntxtobserver.h" -#include "cvimpstengineimagehandler.h" - - -// FORWARD DECLARATIONS -class CVIMPSTEngineRequestMapper; -class MPresenceFeatures; -class MXIMPContext; -class MXIMPIdentity; - - - -// CLASS DECLARATION -/** - * This Class implements the Contact Management Extention Feature - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineAvatarExtention ) : public CBase, - public MVIMPSTEngineAvatarExtention, - public MVIMPSTEngineSessionCntxtObserver - - { - - - public: // Two-phased constructors and destructor - - /** - * Two-phased constructor. - * @param aFeatures - Presentity Group - * @param aRequestMapper: Request Mapper for XIMP Events - */ - - static CVIMPSTEngineAvatarExtention* NewL( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper); - /** - * Two-phased constructor. - * @param aFeatures - Presentity Group - * @param aRequestMapper: Request Mapper for XIMP Events - */ - static CVIMPSTEngineAvatarExtention* NewLC( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper); - - /** - * C++ Destructor. - */ - virtual ~CVIMPSTEngineAvatarExtention(); - - - private: - - /** - * default constructor - * @param aFeatures - Presentity Group - * @param aRequestMapper: event observer to get the notifications of the events. - */ - CVIMPSTEngineAvatarExtention( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper); - - - - public: // See MVIMPSTEngineAvatarExtention - - /** - * See MVIMPSTEngineAvatarExtention - */ - TInt UpdateAvtarToServerL(const TDesC& aFilename , - const TDesC8& aMimetype); - - - private: - /** - * See MVIMPSTEngineSessionCntxtObserver - */ - void HandleSessionContextEventL( const MXIMPContext& aContext, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation = EVIMPSTXimpOperationNoOperation); - - public: // From MVIMPSTEngineExtentionFeatures - - /** - * See MVIMPSTEngineExtentionFeatures - */ - TVIMPSTEnums::FeatureSupport IsSupported() const; - - - /** - * See MVIMPSTEngineExtentionFeatures - */ - TVIMPSTEnums::ExtentionType Type() const; - - /** - * See MVIMPSTEngineExtentionFeatures - */ - void SetSupported(TVIMPSTEnums::FeatureSupport aSupported) ; - - - private: - // serivice id - TInt iServiceId; - - // not own - MPresenceFeatures& iFeatures; - - //doesnt own - CVIMPSTEngineRequestMapper& iRequestMapper; - - //Whether the extention Feature Supported or not - TVIMPSTEnums::FeatureSupport iSupported; - - //Result code from waited request - TInt iReqResult; - - }; - -#endif //__CVIMPSTENGINEAVATAREXTENTION_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstore.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstore.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions and repository transactions. -* -*/ - - -// INCLUDES -#include -#include "s_vimpstsettingsstoreimp.h" - -/** - * vimpst settings API class - * - * Main class of managing vimpst settings - * - * @code example code of how to get/set a value to the setting item in cenrep - * MVIMPSTSettingsStore* obj = CVIMPSTUiSettingsStoreFactory::NewL(); - * TInt value = 1; - * TInt err = obj->Set(serviceId, ETOUDlgOff, value ); - * similarly for getting the value - * obj->Get(serviceId, ETOUDlgOff, value); - * @lib vimpstsettingsstore.lib - * @since S60 v5.0 - */ - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsStoreFactory::NewL -// Create an instance of the class CVIMPSTSettingsStoreImp -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewL() - { - MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreImp::NewL(); - - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::Destructor -// Release the singelton -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsStore::~CVIMPSTSettingsStore() - { - CVIMPSTSettingsStoreImp::Release(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsStoreFactory::NewLC -// Create an instance of the class CVIMPSTSettingsStoreImp -// ----------------------------------------------------------------------------- -// - -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewLC() - { - MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreImp::InitialiseLibraryL(); - CleanupDeletePushL ( self ); - return self; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstore.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstore.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions -* -*/ - -#ifndef __CVIMPSTSETTINGSSTORE_H -#define __CVIMPSTSETTINGSSTORE_H - -#include - -/** types of settings provided in meco settings */ -enum TSettingItemName - { - ETOUDlgOff = 0x00000000, // key value to enable or disable TOU Dialog to be shown - EURLRegistrationOff = 0x00000001, // key value to enable or disable URL registration query - EServiceSuccessfullLogin = 0x00000002, - EServiceToneFileName = 0x00000003, // key value to get the IM tone File name.complete path of the file name should be provided. example - EServiceURLLink = 0x00000004, // key value to get the URL link for IM based on service - EServiceAvatar = 0x00000005, // key value to get the Own Avatar for IM based on service - EServiceAvatarMimeType = 0x00000006, // key value to get the Own Avatar s 'mimetype' for IM based on service - EServiceOwnAvatarIconIndex = 0x00000007 , // key value to get the Own Icon index for avatar s - // key value to check whether the "Cancel Login" is supported or not - // if setting "value = 1" then cancel login not supported else supported. - // if cancel is supported , no need to write anything to cenrep. - // By default its taken as supported. - // if not supported then write explicitly this setting as '1' - EServiceCancelLoginNotSupported = 0x00000008 - }; - - - -//CLASS DECLARATION -/** - * M-Class for meco settingstore API's - * @lib vimpstsettingsstore.lib - * @since S60 5.0 - */ -class MVIMPSTSettingsStore - { - public: //Interface - - /** - * virtual Destructor. - */ - virtual ~MVIMPSTSettingsStore() - { - } - - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aBuffer, variable to set/get the value - * @return TInt, used as error passing value. - */ - virtual TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf& aBuffer ) = 0; - virtual TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) = 0; - - }; - -/** - * vimpst settings API class - * - * Main class of managing vimpst settings - * - * @code example code of how to get/set a value to the setting item in cenrep - * MVIMPSTSettingsStore* obj = CVIMPSTUiSettingsStoreFactory::NewL(); - * TInt value = 1; - * TInt err = obj->Set(serviceId, ETOUDlgOff, value ); - * similarly for getting the value - * obj->Get(serviceId, ETOUDlgOff, value); - * @lib vimpstsettingsstore.lib - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CVIMPSTSettingsStore ): public CBase - { - - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - IMPORT_C static MVIMPSTSettingsStore* NewL(); - - /** - * Two-phased constructor. - */ - IMPORT_C static MVIMPSTSettingsStore* NewLC(); - - /** - * Destructors. - */ - virtual ~CVIMPSTSettingsStore(); - }; - -#endif /*__CVIMPSTSETTINGSSTORE_H*/ diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstorefactory.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstorefactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions and repository transactions. -* -*/ - - -// INCLUDES -#include -#include "s_vimpstsettingsstoreimp.h" - -/** - * vimpst settings API class - * - * Main class of managing vimpst settings - * - * @code example code of how to get/set a value to the setting item in cenrep - * MVIMPSTSettingsStore* obj = CVIMPSTUiSettingsStoreFactory::NewL(); - * TInt value = 1; - * TInt err = obj->Set(serviceId, ETOUDlgOff, value ); - * similarly for getting the value - * obj->Get(serviceId, ETOUDlgOff, value); - * @lib vimpstsettingsstore.lib - * @since S60 v5.0 - */ - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsStoreFactory::NewL -// Create an instance of the class CVIMPSTSettingsStoreImp -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStoreFactory::NewL() - { - MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreFactory::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::Destructor -// Release the singelton -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsStoreFactory::~CVIMPSTSettingsStoreFactory() - { - CVIMPSTSettingsStoreImp::Release(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsStoreFactory::NewLC -// Create an instance of the class CVIMPSTSettingsStoreImp -// ----------------------------------------------------------------------------- -// - -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStoreFactory::NewLC() - { - MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreImp::InitialiseLibraryL(); - CleanupDeletePushL ( self ); - return self; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstoreimp.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstoreimp.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions and repository transactions. -* -*/ - - -// INCLUDES -#include -#include "s_vimpstsettingsstoreimp.h" - -//dummy serviceId, assuming the service id not more than 256. for the first time -//and it is assumed that this service id is for initializing the cenrep keys only. -//not updated in the service table and hence will not get a TAB in phone book -//const TInt KServiceIDOffset = 16; - -// opaque data length, see cvimpstuisapsettings.h SetOpaqueDesC16 method description. -//const TInt KSapSettingsDataBufferLength = 5; -// Collation level 1 to ignore case -//const TInt KCollationLevel = 1; - -/** Key to CIMPSSAPSettings opaque value */ -//_LIT( KIMToUAccepted, "KIMToUAccepted" ); -/** User id separator in KIMToUAccepted list */ -//_LIT( KIMDot, "," ); - -//================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTSettingsStoreImp::NewL -// -// --------------------------------------------------------- -MVIMPSTSettingsStore* CVIMPSTSettingsStoreImp::InitialiseLibraryL( ) - { - // no existing instance, create a new one - MVIMPSTSettingsStore *settingsStoreImp = CVIMPSTSettingsStoreImp::NewL(); - return (MVIMPSTSettingsStore*)settingsStoreImp; - } - -void CVIMPSTSettingsStoreImp::Release( ) - { - - } -// --------------------------------------------------------- -// CVIMPSTSettingsStoreImp::NewLC -// -// --------------------------------------------------------- -MVIMPSTSettingsStore* CVIMPSTSettingsStoreImp::NewL( ) - { - CVIMPSTSettingsStoreImp* self = new (ELeave) CVIMPSTSettingsStoreImp( ); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTSettingsStoreImp::ConstructL -// -// --------------------------------------------------------- - -void CVIMPSTSettingsStoreImp::ConstructL( ) - { - - } - -// --------------------------------------------------------- -// CVIMPSTSettingsStoreImp::Destructor -// -// --------------------------------------------------------- -CVIMPSTSettingsStoreImp::~CVIMPSTSettingsStoreImp() - { - - } - -TInt CVIMPSTSettingsStoreImp::GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf& aBuffer ) - { - if(aSettingItemNAme == EServiceToneFileName) - { - _LIT(filename,"testtonefile"); - aBuffer.Copy(filename); - } - return KErrNone; // return the value : error code - } -// -------------------------------------------------------------------------------------------------- -// CVIMPSTSettingsStoreImp::SetL -// -// --------------------------------------------------------------------------------------------------- - -TInt CVIMPSTSettingsStoreImp::SetL(TUint32 /*aServiceId*/, TSettingItemName /*aSettingItemName*/, const TDesC8& /*aBuffer*/ ) - { - return KErrNone; // return the value : error code - } -// -------------------------------------------------------------------------------------------------- -// CVIMPSTSettingsStoreImp::GetL -// -// --------------------------------------------------------------------------------------------------- - - - -//End of file diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstoreimp.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpstsettingsstoreimp.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions and repository transactions. -* -*/ - - -#ifndef __CVIMPSTSETTINGSSTOREIMP_H -#define __CVIMPSTSETTINGSSTOREIMP_H - -// INCLUDES -#include -#include "s_vimpstsettingsstore.h" - -NONSHARABLE_CLASS( CVIMPSTSettingsStoreImp):public CBase, - public MVIMPSTSettingsStore -{ - - public: // Constructors and destructor - - /** - * Initialises the Library - */ - static MVIMPSTSettingsStore* InitialiseLibraryL(); - - /** - * Release the resources allocated - */ - static void Release(); - - /** - * Destructors. - */ - virtual ~CVIMPSTSettingsStoreImp(); - - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aBuffer, variable to set/get the value - * @return TInt, used as error passing value. - */ - - TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf& aBuffer ); - TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) ; - /** - * Two-phased constructor. - */ - static MVIMPSTSettingsStore* NewL(); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - - }; - -#endif //__CVIMPSTSETTINGSSTOREIMP_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragecontact.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragecontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of contact data container -* -*/ - - - -// INCLUDE FILES -#include "s_vimpststoragecontact.h" - -#include "TVIMPSTEnums.h" -#include - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::UserId -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& MyVIMPSTStorageContactStub::UserId() const - { - return KNullDesC; - } - - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::OnlineStatus -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TOnlineStatus MyVIMPSTStorageContactStub::OnlineStatus() const - { - return iPresenceStatus; - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::SetOnlineStatus -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactStub::SetOnlineStatus( - TVIMPSTEnums::TOnlineStatus aOnlineStatus ) - { - - iPresenceStatus = aOnlineStatus; - } - - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::StatusText -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& MyVIMPSTStorageContactStub::StatusText() const - { - return KNullDesC; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::SetStatusTextL -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactStub::SetStatusTextL( const TDesC& /*aStatusText*/ ) - { - - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::SetUserIdL -// From MVIMPSTStorageExtendedStorageContact -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactStub::SetUserIdL( const TDesC& /*aUserId */ ) - { - - } - - -// --------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::ContactLink() -// --------------------------------------------------------------------------- -// -MVPbkContactLink* MyVIMPSTStorageContactStub::ContactLink() const - { - MVPbkContactLink* link = NULL; - - return link; - } - -// --------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::VoIPNumbers() -// --------------------------------------------------------------------------- -// -RPointerArray& MyVIMPSTStorageContactStub::ServiceDetails() - { - RPointerArray array; - - return array; - } - -// --------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::SetSeriveFields() -// --------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactStub::SetSeriveFields( - const CDesCArray& /*aArrayOfServices*/ ) - { - - } - -// --------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::SetSeriveFields() -// --------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactStub::SignalChanges() - { - - } - // End of File - -// MyMVIMPSTStorageViewIdStub::SetOwnData -// From MVIMPSTStorageContacts. -// -// ----------------------------------------------------------------------------- - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragecontact.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragecontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact data container implementation -* -*/ - - - -#ifndef CVIMPSTSTORAGECONTACT_H -#define CVIMPSTSTORAGECONTACT_H - -#include "TVIMPSTEnums.h" -// INCLUDES -#include "MVIMPSTStorageContact.h" - -// FORWARD DECLARATIONS -class MVPbkContactLink; -class MVIMPSTStorageContact; - -// CLASS DECLARATION - -/** - * Contact data implementation - * @lib vimpststorage.dll - * @since 5.0 - */ -class MyVIMPSTStorageContactStub : public MVIMPSTStorageContact - { - public: // Constructors and destructor - - MyVIMPSTStorageContactStub() - { - - } - /** - * C++ Destructor. - */ - ~MyVIMPSTStorageContactStub() - { - - } - - - public: // Functions from base classes MVIMPSTStorageContact - - /** - * @see MVIMPSTStorageContact - */ - void SetUserIdL( const TDesC& aUserId ); - - /** - * @see MVIMPSTStorageContact - */ - MVPbkContactLink* ContactLink() const; - - /** - * @see MVIMPSTStorageContact - */ - RPointerArray& ServiceDetails(); - - - /** - * @see MVIMPSTStorageContact - */ - void SetSeriveFields( - const CDesCArray& aArrayOfServiceNumbers ); - - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& UserId() const; - - - /** - * @see MVIMPSTStorageContact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus() const; - - /** - * @see MVIMPSTStorageContact - */ - void SetOnlineStatus( - TVIMPSTEnums::TOnlineStatus aOnlineStatus ); - - /** - * @see MVIMPSTStorageContact - */ - void SignalChanges(); - - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& StatusText() const; - - /** - * @see MVIMPSTStorageContact - */ - void SetStatusTextL( const TDesC& aStatusText ); - - - - private : - - TVIMPSTEnums::TOnlineStatus iPresenceStatus; - - - - }; - -#endif // CVIMPSTSTORAGECONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragecontactlist.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragecontactlist.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact list container implementation -* -*/ - - - -// INCLUDE FILES -#include "s_vimpststoragecontactlist.h" - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::ListId -// ----------------------------------------------------------------------------- -// -const TDesC& MyVIMPSTStorageContactListStub::ListId() const - { - return KNullDesC; - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::DisplayName -// ----------------------------------------------------------------------------- -// -TPtrC MyVIMPSTStorageContactListStub::DisplayName() const - { - const TDesC& des ( KNullDesC ) ; - return des; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::SetDisplayName -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactListStub::SetDisplayNameL( const TDesC& /*aDisplayName*/ ) - { - - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::Sort -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactListStub::Sort() - { - - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::ResortContact -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactListStub::ResortContact( MVIMPSTStorageContact* /*aContact*/ ) - { - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::ContactFindById -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactListStub::ResortUnKnownContact( MVIMPSTStorageContact* /*aContact*/ ) - { - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::FindIndexOfContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -TInt MyVIMPSTStorageContactListStub::FindIndexOfContact( const MVIMPSTStorageContact* /*aContact*/, - TVIMPSTEnums::TFilterType /*aFilter*/ ) const - { - return KErrNotFound; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::Count -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -TInt MyVIMPSTStorageContactListStub::Count() const - { - return 0; - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::operator[] -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& MyVIMPSTStorageContactListStub::operator[]( TInt /*aIndex */) const - { - MVIMPSTStorageContact* contact = NULL; - return *contact; - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::FilteredContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& MyVIMPSTStorageContactListStub::FilteredContact( - TInt /*aIndex*/, TVIMPSTEnums::TFilterType /*aFilter*/ ) const - { - MVIMPSTStorageContact* contact = NULL; - return *contact; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::FilteredCount -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -TInt MyVIMPSTStorageContactListStub::FilteredCount( - TVIMPSTEnums::TFilterType /*aFilter*/ ) const - { - return 0; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::FilterAllowsContact -// ----------------------------------------------------------------------------- -// -TBool MyVIMPSTStorageContactListStub::FilterAllowsContact( const MVIMPSTStorageContact* /*aContact*/, - TVIMPSTEnums::TFilterType /*aFilter*/ ) const - { - TBool showContact( EFalse ); - - return showContact; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragecontactlist.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragecontactlist.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact list container implementation -* -*/ - - - -#ifndef CVIMPSTSTORAGECONTACTLIST_H -#define CVIMPSTSTORAGECONTACTLIST_H - -// INCLUDES -#include "TVIMPSTEnums.h" -#include "MVIMPSTStorageContactList.h" - -// FORWARD DECLARATIONS -class CVIMPSTStorageContactSorter; -class MVIMPSTStorageContactsObserver; -class MVIMPSTStorageContactList; -class MVIMPSTStorageContact; - -// CLASS DECLARATION - -/** - * Contact list data implementation - */ -class MyVIMPSTStorageContactListStub : public MVIMPSTStorageContactList - { - - public: - MyVIMPSTStorageContactListStub() - { - - } - /** - * Destructor. - */ - ~MyVIMPSTStorageContactListStub() - { - - } - - - - /** - * @see MVIMPSTStorageContactList - */ - const TDesC& ListId() const; - - /** - * @see MVIMPSTStorageContactList - */ - TPtrC DisplayName() const; - - /** - * @see MVIMPSTStorageContactList - */ - void SetDisplayNameL( const TDesC& aDisplayName ); - - - /** - * @see MVIMPSTStorageContactList - */ - TInt Count() const; - - /** - * @see MVIMPSTContactList - */ - MVIMPSTStorageContact& operator[]( TInt aIndex ) const; - - /** - * @see MVIMPSTStorageContactList - */ - MVIMPSTStorageContact& FilteredContact( - TInt aIndex, TVIMPSTEnums::TFilterType aFilter ) const; - - /** - * @see MVIMPSTStorageContactList - */ - TInt FilteredCount( - TVIMPSTEnums::TFilterType aFilter ) const; - - - /** - * @see MVIMPSTStorageContactList - */ - void Sort(); - - /** - * @see MVIMPSTStorageContactList - */ - void ResortContact( MVIMPSTStorageContact* aContact ); - - /** - * @see MVIMPSTStorageContactList - */ - void ResortUnKnownContact( MVIMPSTStorageContact* aContact ); - - /** - * @see MVIMPSTStorageContactList - */ - TInt FindIndexOfContact( - const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter = - TVIMPSTEnums::EFilterAll ) const; - - /** - * @see MVIMPSTStorageContactList - */ - TBool FilterAllowsContact( const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter ) const; - - }; - -#endif // CVIMPSTSTORAGECONTACTLIST_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragemanagerfactory.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragemanagerfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of CVIMPSTStorageManagerFactory -* -*/ - - - -// INCLUDE FILES -#include - -#include "s_mvimpststoragecontacts.h" - -#include "s_vimpststoragemanagerfactory.h" -#include "s_vimpststorageviewid.h" -#include "s_vimpststoragecontact.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::InitialiseLibraryL -// Factory method that initialises the vimpststorage library -// used by CVIMPSTViewIdFactory -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseLibraryL() - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::Release -// Factory method to release the resource owned by the vimpststorage library -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CVIMPSTStorageManagerFactory::Release() - { - return KErrNone; - - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::InitialiseViewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseViewL( - TUint32 /*aServiceId*/, - const TDesC& /*aStoreName*/) - { - - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::ContactListInterfaceL() -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTStorageContacts* CVIMPSTStorageManagerFactory::ContactListInterfaceL(TUint32 /*aServiceId*/ ) - { - MyMVIMPSTStorageViewIdStub* contactlistInterface = new ( ELeave ) MyMVIMPSTStorageViewIdStub(); - //cast to the base class and return the MVIMPSTStorageContacts base ptr - return dynamic_cast(contactlistInterface); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::ItemInterfaceL -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTStorageItemModel* CVIMPSTStorageManagerFactory::ItemInterfaceL( TUint32 /*aServiceId*/ ) - { - //cast to the base class and return the MVIMPSTStorageItemModel base ptr - return NULL; - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragemanagerfactory.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststoragemanagerfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2008 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: Declaration of CVIMPSTStorageManagerFactory - * -*/ - - - -#ifndef CVIMPSTSTORAGEMANAGERFACTORY_H -#define CVIMPSTSTORAGEMANAGERFACTORY_H - -// INCLUDES -#include -#include -#include "s_vimpststorageviewid.h" -// FORWARD DECLARATIONS -class MVIMPSTStorageItemModel; -class MVIMPSTStorageContacts; - -// CLASS DECLARATION - -/** - * Factory to create contact and group list interfaces. - * @lib vimpststorage.lib - * @since S60 5.0 - */ -class CVIMPSTStorageManagerFactory : public CBase - { - public: // New functions - - CVIMPSTStorageManagerFactory() - { - } - ~CVIMPSTStorageManagerFactory() - { - } - /** - * Initialises the Library - */ - static void InitialiseLibraryL(); - - - /** - * Release the resources allocated - */ - static TInt Release(); - - /** - * Inititalises the Store for the Service Id - * Must be called before using ContactListInterfaceL, - * ItemInterfaceL API's. - * @param aServiceId service id - * @param aStoreName storename for this service - */ - static void InitialiseViewL( TUint32 aServiceId, - const TDesC& aStoreName) ; - - /** - * Returns the pointer to MVIMPSTStorageContactsStub - * this pointer can be used to perform numerous operations on - * contacts - * @param aServiceId service id - * @return MVIMPSTStorageContacts* instance of the contact list interface - */ - static MVIMPSTStorageContacts* ContactListInterfaceL(TUint32 aServiceId); - - /** - * Returns the pointer to MVIMPSTStorageItemModelStub - * this pointer can be used to perform numerous operations on - * contactlist - * @param aServiceId service id - * @return MVIMPSTStorageItemModel* interface to itemmodel - */ - static MVIMPSTStorageItemModel* ItemInterfaceL( TUint32 aServiceId ) ; - - }; - -#endif // CVIMPSTSTORAGEMANAGERFACTORY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststorageviewid.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststorageviewid.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,445 +0,0 @@ -/* -* Copyright (c) 2008 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: Storage view implementation - * -*/ - - -// INCLUDE FILES -#include "s_vimpststorageviewid.h" - -#include "MVIMPSTStorageContactList.h" - - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::AddContactListIdL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContactList* MyMVIMPSTStorageViewIdStub::AddContactListIdL( - const TDesC& /*aContactListId*/, - const TDesC& /*aDisplayName*/, - TBool /*aNotify*/ ) - { - //CVIMPSTStorageContactList* contactList = CVIMPSTStorageContactList::NewL(); - - return NULL; - } - - - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::RemoveContactList -// ----------------------------------------------------------------------------- -// -void MyMVIMPSTStorageViewIdStub::RemoveContactList( const TDesC& /*aContactListId*/ ) - { - - } - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::RemoveContact -// From MVIMPSTStorageContacts. -// ----------------------------------------------------------------------------- -void MyMVIMPSTStorageViewIdStub::RemoveContact( const TDesC& /*aListId*/, - const TDesC& /*aContactId*/ ) - { - - } - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::FindContact -// From MVIMPSTStorageContacts. -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::FindContact( const TDesC& /*aContactListId*/, - const TDesC& /*aId*/ ) - { - return NULL; - } - -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::FindContact( const TDesC& /*aContactListId*/, - const TDesC& /*aId*/ , - MVIMPSTStorageContactList*& /*aContactList*/ ) - { - return NULL; - } - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::ContactInAnyList -// From MVIMPSTStorageContacts. -// ----------------------------------------------------------------------------- -TBool MyMVIMPSTStorageViewIdStub::ContactInAllLists( const TDesC& /*aContactId*/ ) const - { - return ETrue; - } - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::FindContact -// From MVIMPSTStorageContacts. -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::FindAnyContact( const TDesC& /*aContactId*/ ) - { - return NULL; - } -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::FindContact -// From MVIMPSTStorageContacts. -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::FindAnyContactByName( const TDesC& /*aContactId*/ ) - { - return NULL; - } - - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::ListCount -// Count of contactlists -// ----------------------------------------------------------------------------- -// -TInt MyMVIMPSTStorageViewIdStub::ListCount() const - { - return 1; - } - - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::ListAt -// Reference to contact list -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContactList& MyMVIMPSTStorageViewIdStub::ListAt( TInt /*aIndex*/ ) const - { - // FIXME ASSERT - MVIMPSTStorageContactList *abc = NULL; - - return *abc; - } - - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::ContactCount -// Count of contacts -// ----------------------------------------------------------------------------- -// -TInt MyMVIMPSTStorageViewIdStub::ContactCount( TBool /*aSkipOfflineContacts*/ ) const - { - TInt contactCount( 0 ); - - return contactCount; - } - - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::CreateContactL -// From MVIMPSTExtendedStorageContact -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::CreateContactL( - const TDesC& /*aContactList*/, - const TDesC& /*aWVID*/, - MVPbkContactLink* /*aContactLink*/, - CVPbkContactManager& /*aContactManager*/, - MVIMPSTStorageContactManagementObserver& /*aContactManagementObserver*/ ) - { - - return NULL; - } - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::CreateContactL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::CreateContactL( - MVIMPSTStorageContactList& /*aContactList*/, - const TDesC& /*aWVID*/, - TVIMPSTEnums::TOnlineStatus /*aStatus*/, - const TDesC& /*aStatusText*/, - MVPbkContactLink* /*aContactLink*/, - CVPbkContactManager& /*aContactManager*/, - MVIMPSTStorageContactManagementObserver& /* aContactManagementObserver*/) - { - - // this is used at fetching, so do not notify any observer, will be done for whole list - return NULL; - } - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::RemoveAllContactsL -// ----------------------------------------------------------------------------- -// -void MyMVIMPSTStorageViewIdStub::RemoveAllContactsL() - { - - } - - - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::UpdatepresenceL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::UpdatePresenceL( - const TDesC& /*aContactId*/, - TVIMPSTEnums::TOnlineStatus/* aStatus*/, - const TDesC& /*aAlias*/, - const TDesC& /*aStatusText*/) - { - return NULL; - } - - - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::OwnStatus -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& MyMVIMPSTStorageViewIdStub::OwnStatus() - { - MVIMPSTStorageContact* own = NULL; - return *own; - } - - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::IsContactValid -// ----------------------------------------------------------------------------- -// -TBool MyMVIMPSTStorageViewIdStub::IsContactValid( const MVIMPSTStorageContact* /*aContact*/ ) const - { - // contact not found - return EFalse; - } - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::SortContactLists -// ----------------------------------------------------------------------------- -// -void MyMVIMPSTStorageViewIdStub::SortContactLists() - { - - } - -// ----------------------------------------------------------------------------- -// MyMVIMPSTStorageViewIdStub::FindContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContactList* MyMVIMPSTStorageViewIdStub::FindContactList( const TDesC& /*aListId */) - { - return NULL; - } - -/** - * From MVIMPSTStorageContacts - */ -MVIMPSTStorageVpbkStoreHandler& MyMVIMPSTStorageViewIdStub::GetStoreHandler( ) -{ -MVIMPSTStorageVpbkStoreHandler* storehandler = NULL; -return *storehandler; -} - -/** - * From MVIMPSTStorageContacts - */ -MVPbkStoreContact* MyMVIMPSTStorageViewIdStub::CreateNewContactLC( ) -{ -MVPbkStoreContact* contact = NULL; -return contact; -} - -/** - * From MVIMPSTStorageContacts - */ -void MyMVIMPSTStorageViewIdStub::AddObserverL( MVIMPSTStorageContactsObserver* /*aObserver*/ ) -{ - -} - - -/** - * From MVIMPSTStorageContacts - */ -void MyMVIMPSTStorageViewIdStub::RemoveObserver( MVIMPSTStorageContactsObserver* /*aObserver*/ ) -{ - -} - - - -/** - * From MVIMPSTStorageContacts - */ -TInt MyMVIMPSTStorageViewIdStub::FindContact( const MVIMPSTStorageContact& /*aContact*/ ) const - { - return 0; - } - - -/** - * From MVIMPSTStorageContacts - */ -void MyMVIMPSTStorageViewIdStub::FindContacts( RPointerArray< MVIMPSTStorageContact >& /*aArray*/, - const TDesC& /*aContactId*/ ) const - { - - } - - -/** - * From MVIMPSTStorageContacts - */ -void MyMVIMPSTStorageViewIdStub::Sort( const TDesC& /*aContactListId*/ ) - { - - } - -/** - * Resort one contact, what ever contact list it is in - */ -void MyMVIMPSTStorageViewIdStub::ResortContactInAll( MVIMPSTStorageContact* /*aContact*/ ) - { - - } - -/** - * From MVIMPSTStorageContacts - */ -void MyMVIMPSTStorageViewIdStub::SetSortAlgorithm( MVIMPSTStorageContact::TSortAlgorithm /*aAlgorithm*/ ) - { - - } - -/** - * From MVIMPSTStorageContacts - */ -TVIMPSTEnums::TOnlineStatus MyMVIMPSTStorageViewIdStub::OnlineStatus( const TDesC& /*aContactId*/ ) - { - return iStatus; - } - - -/** - * From MVIMPSTStorageContacts - */ -void MyMVIMPSTStorageViewIdStub::SetNotifyOnSave( TBool /*aStatus*/ ) - { - - } - - -/** - * MVIMPSTStorageContacts - */ -void MyMVIMPSTStorageViewIdStub::SendContactListUpdatedEvent( MVIMPSTStorageContactList& /*aList*/ ) - { - - } - - -/** - * add contact to the virtual phonebook. - */ -void MyMVIMPSTStorageViewIdStub::AddServerContactL( const TDesC& /*aContact*/) -{ - -} - - -/** - * add selected pbk2 contact to the service store. - * @param aContact contact selected from phone book. - */ -void MyMVIMPSTStorageViewIdStub::AddPhoneBookContactL( const MVPbkStoreContact& /*aContact */) - { - - } - -/** - * add selected contact to the phone book. - * @param aContact selected contact. - */ -void MyMVIMPSTStorageViewIdStub::AddContactToPhoneBookL( const MVIMPSTStorageContact& /*aContact*/ ) - { - - } - - /** - * removes contact from the virtual phonebook. - */ -void MyMVIMPSTStorageViewIdStub::RemoveServerContactL( const TDesC& /*aContact*/) - { - - } -void MyMVIMPSTStorageViewIdStub::UpdateAvatarDataL( const TDesC& /*aContactId*/ ,const TDesC8& /*aData*/) - { - - } - -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::FindContactByName( const TDesC& /*aContactListId*/, - const TDesC& /*aId*/ ) - { - MVIMPSTStorageContact* contact= NULL; - return contact; - } - -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::FindContactByName( const TDesC& /*aContactListId*/, - const TDesC& /*aId*/, - MVIMPSTStorageContactList*& /*aContactList*/ ) - { - MVIMPSTStorageContact* contact= NULL; - return contact; - } -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::FindContact( const MVPbkContactLink& /*aContactLink*/, - MVIMPSTStorageContactList*& /*aContactList*/ ) - - { - MVIMPSTStorageContact* contact= NULL; - return contact; - } - -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::FindContactByServiceField( const TDesC& /*aServiceId */) - { - MVIMPSTStorageContact* contact= NULL; - return contact; - } - -MVIMPSTStorageContact* MyMVIMPSTStorageViewIdStub::AddContactL( const TDesC& /*aFirstName*/ /*= KNullDesC*/,const TDesC& /*aServiceField*/ /*= KNullDesC */) - { - MVIMPSTStorageContact* contact= NULL; - return contact; - } - -void MyMVIMPSTStorageViewIdStub::RemoveContactL( const MVPbkContactLink& /*aContactLink*/) - { - - } - -void MyMVIMPSTStorageViewIdStub::RemoveContactL( const TDesC& /*aServiceContactId*/) - - { - - } - -void MyMVIMPSTStorageViewIdStub::SetOwnDataL( const TDesC& aOwnId ) - { - iOwnId = NULL; - iOwnId = aOwnId.AllocL(); - } - -// ----------------------------------------------------------------------------- - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststorageviewid.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_vimpststorageviewid.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,327 +0,0 @@ -/* -* Copyright (c) 2008 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: Storage view implementation -* -*/ - - -#ifndef CVIMPSTSTORAGEVIEWID_H -#define CVIMPSTSTORAGEVIEWID_H - -#include "TVIMPSTEnums.h" -#include "s_mvimpststoragecontacts.h" -// INCLUDES - -// FORWARD DECLARATIONS -class MVIMPSTStorageContactList; -class MVPbkContactLink; -class CVPbkContactManager; -class MVPbkStoreContact; -class MVIMPSTStorageVpbkStoreHandler; -class MVIMPSTStorageContactManagementObserver; -class MVIMPSTStorageContactsObserver; - -// CLASS DECLARATION - -class MyMVIMPSTStorageViewIdStub : public MVIMPSTStorageContacts - { - - - - public: // Functions from base classes - - void UpdateAvatarDataL( const TDesC& aContactId ,const TDesC8& aData); - MyMVIMPSTStorageViewIdStub() - { - - } - - ~MyMVIMPSTStorageViewIdStub() - { - - } - - /** - * From MVIMPSTStorageContacts - */ - MVIMPSTStorageVpbkStoreHandler& GetStoreHandler( ); - - /** - * From MVIMPSTStorageContacts - */ - MVPbkStoreContact* CreateNewContactLC( ); - - /** - * From MVIMPSTStorageContacts - */ - void AddObserverL( MVIMPSTStorageContactsObserver* aObserver ); - - - /** - * From MVIMPSTStorageContacts - */ - void RemoveObserver( MVIMPSTStorageContactsObserver* aObserver ); - - - /** - * From MVIMPSTStorageContacts - */ - MVIMPSTStorageContactList* AddContactListIdL( const TDesC& aContactListId, - const TDesC& aDisplayName, - TBool aNotify = ETrue ); - - /** - * From MVIMPSTStorageContacts - */ - void RemoveContactList( const TDesC& aContactListId ); - - /** - * From MVIMPSTStorageContacts - */ - void RemoveContact( const TDesC& aListId, const TDesC& aContactId ); - - /** - * From MVIMPSTStorageContacts - */ - - void SetOwnDataL( const TDesC& aOwnId ); - - - MVIMPSTStorageContact* FindContact( const TDesC& aContactListId, - const TDesC& aId ); - - MVIMPSTStorageContact* FindContact( const TDesC& aContactListId, - const TDesC& aId, - MVIMPSTStorageContactList*& aContactList ); - /** - * From MVIMPSTStorageContacts - */ - MVIMPSTStorageContact* FindAnyContact( const TDesC& aContactId ); - - /** - * Find a contact from the store by using Service ID - * @param aServiceId the Service ID of the contact to find - * @return The contact - */ - MVIMPSTStorageContact* FindContactByServiceField( const TDesC& aServiceId ); - - /** - * Find any contact which id is aContactId - * @param aContactId Contactid to recognize contact. - * @return First one which matches contactId. If not found return NULL - */ - MVIMPSTStorageContact* FindAnyContactByName( const TDesC& aContactId ); - - /** - * Find any contact which has contact link same as aContactLink - * @param aContactId Contactid to recognize contact. - * @return First one which matches contactId. If not found return NULL - */ - MVIMPSTStorageContact* FindContact( const MVPbkContactLink& aContactLink, - MVIMPSTStorageContactList*& aContactList ) ; - - - /** - * Find a contact from the store by Name - * @param aContactListId List which contains contact. - * @param aId the User ID of the contact to find - * @return The contact - */ - MVIMPSTStorageContact* FindContactByName( const TDesC& aContactListId, - const TDesC& aId ) ; - - MVIMPSTStorageContact* FindContactByName( const TDesC& aContactListId, - const TDesC& aId, - MVIMPSTStorageContactList*& aContactList ) ; - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - MVIMPSTStorageContact* AddContactL( const TDesC& aFirstName = KNullDesC, - const TDesC& aServiceField = KNullDesC ); - - /** - * From MVIMPSTStorageContacts - */ - TInt FindContact( const MVIMPSTStorageContact& aContact ) const; - - /** - * From MVIMPSTStorageContacts - */ - TBool ContactInAllLists( const TDesC& aContactId ) const; - - /** - * From MVIMPSTStorageContacts - */ - TInt ListCount() const; - - /** - * From MVIMPSTStorageContacts - */ - MVIMPSTStorageContactList& ListAt( TInt aIndex ) const; - - /** - * From MVIMPSTStorageContacts - */ - void FindContacts( RPointerArray< MVIMPSTStorageContact >& aArray, - const TDesC& aContactId ) const; - - /** - * From MVIMPSTStorageContacts - */ - TInt ContactCount( TBool aSkipOfflineContacts = EFalse ) const; - - - /** - * From MVIMPSTStorageContacts - */ - void Sort( const TDesC& aContactListId = KNullDesC ); - - /** - * Resort one contact, what ever contact list it is in - */ - void ResortContactInAll( MVIMPSTStorageContact* aContact ); - - /** - * From MVIMPSTStorageContacts - */ - void SetSortAlgorithm( MVIMPSTStorageContact::TSortAlgorithm aAlgorithm ); - - /** - * From MVIMPSTStorageContacts - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus( - const TDesC& aContactId ); - - /** - * From MVIMPSTStorageContacts - */ - MVIMPSTStorageContact* UpdatePresenceL( const TDesC& aContactId, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aAlias, - const TDesC& aStatusText); - /** - * From MVIMPSTStorageContacts - */ - MVIMPSTStorageContact& OwnStatus(); - - /** - * From MVIMPSTStorageContacts - */ - void SetNotifyOnSave( TBool aStatus ); - - - /** - * MVIMPSTStorageContacts - */ - MVIMPSTStorageContact* CreateContactL( - const TDesC& aContactList, - const TDesC& aWVID, - MVPbkContactLink* aContactLink, - CVPbkContactManager& aContactManager, - MVIMPSTStorageContactManagementObserver& aContactManagementObserver); - - /** - * MVIMPSTStorageContacts - */ - MVIMPSTStorageContact* CreateContactL( - MVIMPSTStorageContactList& aContactList, - const TDesC& aWVID, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aStatusText, - MVPbkContactLink* aContactLink, - CVPbkContactManager& aContactManager , - MVIMPSTStorageContactManagementObserver& aContactManagementObserver); - - /** - * MVIMPSTStorageContacts - */ - void SendContactListUpdatedEvent( MVIMPSTStorageContactList& aList ); - - - /** - * From MVIMPSTStorageContacts - */ - void RemoveAllContactsL(); - - - /** - * From MVIMPSTStorageContacts - */ - TBool IsContactValid( const MVIMPSTStorageContact* aContact ) const; - - /** - * From MVIMPSTStorageContacts - */ - void SortContactLists(); - - - - /** - * add contact to the virtual phonebook. - */ - void AddServerContactL( const TDesC& aContact); - - - /** - * add selected pbk2 contact to the service store. - * @param aContact contact selected from phone book. - */ - void AddPhoneBookContactL( const MVPbkStoreContact& aContact ); - - /** - * add selected contact to the phone book. - * @param aContact selected contact. - */ - void AddContactToPhoneBookL( const MVIMPSTStorageContact& aContact ); - - /** - * removes contact from the virtual phonebook. - */ - void RemoveServerContactL( const TDesC& aContact); - - /** - * Find contact list by id - * @param aListId. Id to find. - * @return Contactlist. If not found return NULL - */ - MVIMPSTStorageContactList* FindContactList( const TDesC& aListId ) ; - /** - * removes contact from the virtual phonebook. - * @param aContact contact id to be removed. - */ - void RemoveContactL( const MVPbkContactLink& aContactLink); - - /** - * removes contact from the virtual phonebook. - * @param aContact contact id to be removed. - */ - void RemoveContactL( const TDesC& aServiceContactId); - - - - - - TVIMPSTEnums::TOnlineStatus iStatus; - - HBufC* iOwnId; - - - - }; - -#endif // CVIMPSTVIEWID_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_wssession.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_wssession.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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: s_wssession.cpp -* -*/ - -#include -#include - - -RWsSession::RWsSession() {} - -TInt RWsSession::Connect() {return KErrNone;} - -void RWsSession::Close() {} - - -TApaTask::TApaTask(RWsSession& aWsSession) -:iWsSession(aWsSession) -{} - -TBool TApaTask::Exists() const { return ETrue; } -void TApaTask::KillTask() {} -void TApaTask::EndTask() {} - -TApaTaskList::TApaTaskList(RWsSession& aWsSession) -:iWsSession(aWsSession) -{} - -TApaTask TApaTaskList::FindApp(TUid /*aAppUid*/) - { - - } - - -MWsClientClass::MWsClientClass() {} diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpclient.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpclient.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* 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: s_ximpclient.cpp -* -*/ - -#include "s_ximpclient.h" -#include "s_ximpcontext.h" - -void MXIMPClientStub::GetProtocolsL( - RXIMPObjOwningPtrArray< MXIMPProtocolInfo >& /*aProtocols*/ ) - { - } - -MXIMPFeatureInfo* MXIMPClientStub::GetFrameworkFeaturesLC() - { - return NULL; - } - -MXIMPContext* MXIMPClientStub::NewPresenceContextLC() - { - MXIMPContext* context = new ( ELeave ) MXIMPContextStub; - CleanupStack::PushL( context ); - return context; - } - -const TAny* MXIMPClientStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MXIMPClientStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MXIMPClientStub::GetInterfaceId() const - { - return 0; - } - - -MXIMPClient* MXIMPClientStub::NewClientL() - { - return new (ELeave) MXIMPClientStub(); - } - - - -MXIMPClientStub::~MXIMPClientStub() - { - - } - - - - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpclient.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpclient.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* 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: s_ximpclient.h -* -*/ -#ifndef _MXIMPCLIENTSTUB_ -#define _MXIMPCLIENTSTUB_ - -#include - -class MXIMPProtocolInfo; -class MXIMPFeatureInfo; -class MXIMPContext; - -class MXIMPClientStub : public CBase, public MXIMPClient - { - -public: - /** - * Factory method to instantiate MXIMPClient. - * - * Factory method to instantiate platform default - * MXIMPClient implementation through the ECom. - * If the default presence framework isn't supported - * in the platform, leaves with errorcode signalled - * from ECom. - * - * @return The new presence client object. Object - * ownership is returned to caller. - */ - static MXIMPClient* NewClientL(); - - - /** - * Public destructor. - * Object can be deleted through this interface. - */ - ~MXIMPClientStub(); - - void GetProtocolsL( - RXIMPObjOwningPtrArray< MXIMPProtocolInfo >& aProtocols ); - - MXIMPFeatureInfo* GetFrameworkFeaturesLC(); - - MXIMPContext* NewPresenceContextLC(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - -#endif // MXIMPFWCLIENT_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpcontext.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpcontext.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* 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: s_ximpcontext.cpp -* -*/ - -#include "s_ximpcontext.h" -#include "s_ximpobjectfactory.h" - -TInt gUnBindingLeaves = KErrNone; - -void MXIMPContextStub::RegisterObserverL( - MXIMPContextObserver& /*aObserver*/, - const TArray* /*aEventFilter*/ ) - { - } - -void MXIMPContextStub::UnregisterObserver( - MXIMPContextObserver& /*aObserver*/ ) - { - } - -TXIMPRequestId MXIMPContextStub::BindToL( - TUid /*aProtocolImpUid*/, - const TDesC16& /*aServiceAddress*/, - const TDesC16& /*aUsername*/, - const TDesC16& /*aPassword*/, - TInt32 /*aIapId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MXIMPContextStub::BindToL( - TUid /*aProtocolImpUid*/, - const TDesC16& /*aServiceAddress*/, - const TDesC16& /*aUsername*/, - const TDesC16& /*aPassword*/, - const TDesC16& /*aClientId*/, - TInt32 /*aIapId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MXIMPContextStub::BindToL( - TUid /*aProtocolImpUid*/, - const TDesC16& /*aUsername*/, - const TDesC16& /*aPassword*/, - TInt /*aSettingsId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MXIMPContextStub::BindToL( TUid /*aProtocolImpUid*/, - TInt /*aSettingsId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MXIMPContextStub::UnbindL() - { - User::LeaveIfError( gUnBindingLeaves ); - TXIMPRequestId id; - return id; - } - -MXIMPFeatureInfo* MXIMPContextStub::GetContextFeaturesLC() const - { - return NULL; - } - -MXIMPObjectFactory& MXIMPContextStub::ObjectFactory() const - { - - - MXIMPContextStub* thisObject = const_cast (this); - if (!thisObject->iObjFactory) - { - thisObject->iObjFactory = new (ELeave) MyMXIMPObjectFactoryStub(); - } - return *iObjFactory; - } - -const TAny* MXIMPContextStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MXIMPContextStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MXIMPContextStub::GetInterfaceId() const - { - return 0; - } - -MXIMPContextStub::MXIMPContextStub() -{ - -} - -MXIMPContextStub::~MXIMPContextStub() - { - delete iObjFactory; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpcontext.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpcontext.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +0,0 @@ -/* -* 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: s_ximpcontext.h -* -*/ - -#ifndef MXIMPFWPRESENCECONTEXTSTUB_H -#define MXIMPFWPRESENCECONTEXTSTUB_H - -#include - -class MyMXIMPObjectFactoryStub; - -class MXIMPContextStub : public CBase, public MXIMPContext - { -public: - MXIMPContextStub(); - ~MXIMPContextStub(); - void RegisterObserverL( - MXIMPContextObserver& aObserver, - const TArray* aEventFilter = NULL ); - - void UnregisterObserver( - MXIMPContextObserver& aObserver ); - - TXIMPRequestId BindToL( - TUid aProtocolImpUid, - const TDesC16& aServiceAddress, - const TDesC16& aUsername, - const TDesC16& aPassword, - TInt32 aIapId ); - TXIMPRequestId BindToL( - TUid aProtocolImpUid, - const TDesC16& aServiceAddress, - const TDesC16& aUsername, - const TDesC16& aPassword, - const TDesC16& aClientId, - TInt32 aIapId ); - TXIMPRequestId BindToL( TUid aProtocolImpUid, - TInt aSettingsId ); - - TXIMPRequestId BindToL( - TUid aProtocolImpUid, - const TDesC16& aUsername, - const TDesC16& aPassword, - TInt aSettingsId ); - - TXIMPRequestId UnbindL(); - MXIMPFeatureInfo* GetContextFeaturesLC() const; - MXIMPObjectFactory& ObjectFactory() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - private: - MyMXIMPObjectFactoryStub* iObjFactory; - - }; - - -#endif // MXIMPFWPRESENCECONTEXT_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpcontextstateevent.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpcontextstateevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* 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: s_ximpcontextstateevent.cpp -* -*/ - -#include "s_ximpcontextstateevent.h" - - -TInt32 gMXIMPContextStateEventStubInterfaceId = 0; - -const MXIMPContextState& MXIMPContextStateEventStub::ContextState() const - { - MXIMPContextState* state = NULL; - return *state; - } - -const MXIMPStatus* MXIMPContextStateEventStub::StateChangeReason() const - { - MXIMPStatus* status = NULL; - return status; - } - -const TAny* MXIMPContextStateEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - -TAny* MXIMPContextStateEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps */) - { - return NULL; - } - -TInt32 MXIMPContextStateEventStub::GetInterfaceId() const - { - return gMXIMPContextStateEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpcontextstateevent.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpcontextstateevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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: s_ximpcontextstateevent.h -* -*/ -#ifndef MXIMPFWCONTEXTSTATEEVENTSTUB_H -#define MXIMPFWCONTEXTSTATEEVENTSTUB_H - -#include - - -class MXIMPContextStateEventStub : public MXIMPContextStateEvent - { - const MXIMPContextState& ContextState() const; - const MXIMPStatus* StateChangeReason() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - -#endif // MXIMPFWCONTEXTSTATEEVENTSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpidentity.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpidentity.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for identity object. -* -*/ - - -#include "s_ximpidentity.h" - -MyMXIMPIdentityStub::MyMXIMPIdentityStub() - { - } -MyMXIMPIdentityStub::~MyMXIMPIdentityStub() - { - if(iIdentity) - { - delete iIdentity; - } - } - -const TDesC16& MyMXIMPIdentityStub::Identity() const - { - return iIdentity->Des(); - } - -void MyMXIMPIdentityStub::SetIdentityL( - const TDesC16& aIdentity ) - { - if ( iIdentity ) - { - iIdentity->ReAlloc( aIdentity.Length() ); - } - else - { - iIdentity = HBufC::NewL( aIdentity.Length() ); - } - - iIdentity->Des().Copy( aIdentity ); - - } - - -const TAny* MyMXIMPIdentityStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - -TAny* MyMXIMPIdentityStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) -{ -return this; -} - -TInt32 MyMXIMPIdentityStub::GetInterfaceId() const -{ -return KErrNone; -} diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpidentity.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpidentity.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for identity object. -* -*/ - -#ifndef MyMXIMPIdentityStub_H -#define MyMXIMPIdentityStub_H - -#include -#include -#include -#include - -_LIT( KTestIdentity, "TEST_IDENTITY" ); - -/** - * Interface for identity object. - * - * Identity objects are used to identify - * presentities, presentity groups and - * presentity group members, XIMP framework - * client applications etc. entities in - * XIMP Framework. - * - * @ingroup ximpdatamodelapi - * @since S60 v3.2 - */ -class MyMXIMPIdentityStub : public CBase, public MXIMPIdentity - { - -public: - - MyMXIMPIdentityStub(); - - /** - * Public destructor. - * Objects can be deleted through this interface. - */ - ~MyMXIMPIdentityStub() ; - - -public: - - - /** - * Returns identity string. - * - * @return The identity string. - */ - const TDesC16& Identity() const ; - - - - /** - * Sets identity. - * - * @param [in] aIdentity - * Identity string. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - void SetIdentityL( - const TDesC16& aIdentity ) ; - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; -private: - HBufC* iIdentity; - -}; - - -#endif // MyMXIMPIdentityStub_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpobjectfactory.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpobjectfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for XIMP Framework object factory. -* -*/ - - -#include "s_ximpobjectfactory.h" -#include "s_ximpidentity.h" - -TBool gCreateXIMPIdentity = EFalse; -/** - * Instantiates new status object. - * - * @return New status object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPStatus* MyMXIMPObjectFactoryStub::NewStatusLC() - { - return NULL; - } - - -/** - * Instantiates new identity object. - * - * @return New identity object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPIdentity* MyMXIMPObjectFactoryStub::NewIdentityLC() - { - if (gCreateXIMPIdentity) - { - MyMXIMPIdentityStub* ret = new (ELeave) MyMXIMPIdentityStub(); - CleanupStack::PushL(ret); - return ret; - } - - return NULL; - } - - -/** - * Instantiates new restricted object collection object. - * - * @return New restricted object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPRestrictedObjectCollection* MyMXIMPObjectFactoryStub::NewRestrictedObjectCollectionLC() { return NULL;} - - -/** - * Instantiates new object collection object. - * - * @return New object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPObjectCollection* MyMXIMPObjectFactoryStub::NewObjectCollectionLC() { return NULL; } - - -/** - * Instantiates new data subscription state object. - * - * @return New data subscription state instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPDataSubscriptionState* MyMXIMPObjectFactoryStub::NewDataSubscriptionStateLC() { return NULL; } - - -const TAny* MyMXIMPObjectFactoryStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MyMXIMPObjectFactoryStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) -{ - return NULL; -} - -TInt32 MyMXIMPObjectFactoryStub::GetInterfaceId() const -{ - return KErrNone; -} - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpobjectfactory.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpobjectfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for XIMP Framework object factory. -* -*/ - -#ifndef MyMXIMPObjectFactoryStub_H -#define MyMXIMPObjectFactoryStub_H - -#include -#include -#include -#include - - -class MXIMPStatus; -class MXIMPIdentity; -class MXIMPObjectCollection; -class MXIMPRestrictedObjectCollection; -class MXIMPDataSubscriptionState; - - -/** - * Interface for XIMP Framework object factory. - * - * XIMP object factory is used to instantiate - * data objects declared in Data Model API. - * - * MXimpFwObjectFactory interface can be obtained from - * MXIMPContext or MXIMPProtocolConnectionHost - * interfaces. - * - * @ingroup ximpdatamodelapi - * @since S60 v3.2 - */ -class MyMXIMPObjectFactoryStub : public CBase, public MXIMPObjectFactory - { -public: - - /** - * Protected destructor. - * Object instancies can't be deleted via this interface. - */ - ~MyMXIMPObjectFactoryStub() {}; - - MyMXIMPObjectFactoryStub() - { - - }; - - - /** - * Instantiates new status object. - * - * @return New status object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPStatus* NewStatusLC() ; - - - /** - * Instantiates new identity object. - * - * @return New identity object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPIdentity* NewIdentityLC() ; - - - /** - * Instantiates new restricted object collection object. - * - * @return New restricted object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPRestrictedObjectCollection* NewRestrictedObjectCollectionLC() ; - - - /** - * Instantiates new object collection object. - * - * @return New object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPObjectCollection* NewObjectCollectionLC() ; - - - /** - * Instantiates new data subscription state object. - * - * @return New data subscription state instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPDataSubscriptionState* NewDataSubscriptionStateLC() ; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - - - }; - -#endif // MyMXIMPObjectFactoryStub_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresenceauthorization.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresenceauthorization.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* 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: s_ximppresenceauthorization.cpp -* -*/ - - -#include "s_ximppresenceauthorization.h" - -TInt32 gMXIMPPresenceAuthorizationInterfaceId = 0; - - - -TXIMPRequestId MPresenceAuthorizationStub::SubscribePresenceGrantRequestListL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub::UnsubscribePresenceGrantRequestListL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: GrantPresenceForPresentityL( - const MXIMPIdentity& /*aPresentityId*/, - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: WithdrawPresenceGrantFromPresentityL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: GrantPresenceForPresentityGroupMembersL( - const MXIMPIdentity& /*aPresentityId*/, - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: WithdrawPresenceGrantFromPresentityGroupMembersL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: GrantPresenceForEveryoneL( - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: WithdrawPresenceGrantFromEveryoneL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: SubscribePresenceBlockListL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: UnsubscribePresenceBlockListL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: BlockPresenceForPresentityL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: CancelPresenceBlockFromPresentityL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - - -const TAny* MPresenceAuthorizationStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MPresenceAuthorizationStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceAuthorizationStub::GetInterfaceId() const - { - return gMXIMPPresenceAuthorizationInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresenceauthorization.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresenceauthorization.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* 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: s_ximppresenceauthorization.h -* -*/ -#ifndef MXIMPFWPRESENCEAUTHORIZATIONSTUB_H -#define MXIMPFWPRESENCEAUTHORIZATIONSTUB_H - -#include - - -class MPresenceAuthorizationStub : public MPresenceAuthorization - { - TXIMPRequestId SubscribePresenceGrantRequestListL(); - - TXIMPRequestId UnsubscribePresenceGrantRequestListL(); - - TXIMPRequestId GrantPresenceForPresentityL( - const MXIMPIdentity& aPresentityId, - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId WithdrawPresenceGrantFromPresentityL( - const MXIMPIdentity& aPresentityId ); - - TXIMPRequestId GrantPresenceForPresentityGroupMembersL( - const MXIMPIdentity& aGroupId, - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId WithdrawPresenceGrantFromPresentityGroupMembersL( - const MXIMPIdentity& aGroupId ); - - TXIMPRequestId GrantPresenceForEveryoneL( - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId WithdrawPresenceGrantFromEveryoneL(); - - TXIMPRequestId SubscribePresenceBlockListL(); - - TXIMPRequestId UnsubscribePresenceBlockListL(); - - TXIMPRequestId BlockPresenceForPresentityL( - const MXIMPIdentity& aPresentityId ); - - TXIMPRequestId CancelPresenceBlockFromPresentityL( - const MXIMPIdentity& aPresentityId ); - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENCEAUTHORIZATIONSTUB_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresencegrantrequestlistevent.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresencegrantrequestlistevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* 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: s_ximppresencegrantrequestlistevent.cpp -* -*/ - - -#include "s_ximppresencegrantrequestlistevent.h" -#include "s_presencegrantrequestinfo.h" - -TInt32 gMXIMPPresenceGrantRequestListEventStubInterfaceId = 0; -MPresenceGrantRequestInfoStub gMPresenceGrantRequestInfo; -TInt gNewRequestsCountValue = KErrNone; -TInt gCurrentRequestsCountValue = KErrNone; - -TInt MPresenceGrantRequestListEventStub::NewRequestsCount() const - { - return gNewRequestsCountValue; - } - -const MPresenceGrantRequestInfo& MPresenceGrantRequestListEventStub::NewRequest( - TInt /*aIndex*/ ) const - { - MPresenceGrantRequestInfo* info = NULL; - return *info; - } - -TInt MPresenceGrantRequestListEventStub::DisappearedRequestsCount() const - { - return KErrNone; - } - -const MPresenceGrantRequestInfo& MPresenceGrantRequestListEventStub::DisappearedRequest( - TInt /*aIndex*/ ) const - { - MPresenceGrantRequestInfo* info = NULL; - return *info; - } - -TInt MPresenceGrantRequestListEventStub::CurrentRequestsCount() const - { - return gCurrentRequestsCountValue; - } - -const MPresenceGrantRequestInfo& MPresenceGrantRequestListEventStub::CurrentRequest( - TInt /*aIndex*/ ) const - { - return gMPresenceGrantRequestInfo; - } - -const MXIMPDataSubscriptionState& MPresenceGrantRequestListEventStub::DataSubscriptionState() const - { - MXIMPDataSubscriptionState* state = NULL; - return *state; - } - - -const TAny* MPresenceGrantRequestListEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MPresenceGrantRequestListEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceGrantRequestListEventStub::GetInterfaceId() const - { - return gMXIMPPresenceGrantRequestListEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresencegrantrequestlistevent.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresencegrantrequestlistevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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: s_ximppresencegrantrequestlistevent.h -* -*/ -#ifndef MXIMPFWPRESENCEGRANTREQUESTLISTEVENTSTUB_H -#define MXIMPFWPRESENCEGRANTREQUESTLISTEVENTSTUB_H - -#include - - -class MPresenceGrantRequestListEventStub : public MPresenceGrantRequestListEvent - { - TInt NewRequestsCount() const; - const MPresenceGrantRequestInfo& NewRequest( TInt aIndex ) const; - TInt DisappearedRequestsCount() const; - const MPresenceGrantRequestInfo& DisappearedRequest( TInt aIndex ) const; - TInt CurrentRequestsCount() const; - const MPresenceGrantRequestInfo& CurrentRequest( TInt aIndex ) const; - const MXIMPDataSubscriptionState& DataSubscriptionState() const; - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENCEGRANTREQUESTLISTEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresensitygroupcontentevent.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresensitygroupcontentevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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: s_ximppresensitygroupcontentevent.cpp -* -*/ - -#include "s_ximppresensitygroupcontentevent.h" -#include "s_ximpidentity.h" - -TInt32 gMXIMPPresentityGroupEventStubInterfaceId = 0; -extern MyMXIMPIdentityStub gMXIMPIdentity; // already define in MPresentityPresenceEventStub - -const MXIMPIdentity& MPresentityGroupContentEventStub::GroupId() const - { - return gMXIMPIdentity; - } - -TInt MPresentityGroupContentEventStub::NewMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::NewMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info = NULL; - return *info; - } - -TInt MPresentityGroupContentEventStub::UpdatedMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::UpdatedMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info = NULL; - return *info; - } - -TInt MPresentityGroupContentEventStub::DisappearedMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::DisappearedMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info = NULL; - return *info; - } - -TInt MPresentityGroupContentEventStub::CurrentMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::CurrentMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info = NULL; - return *info; - } - -const MXIMPDataSubscriptionState& MPresentityGroupContentEventStub::DataSubscriptionState() const - { - MXIMPDataSubscriptionState* state = NULL; - return *state; - } - - -const TAny* MPresentityGroupContentEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MPresentityGroupContentEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresentityGroupContentEventStub::GetInterfaceId() const - { - return gMXIMPPresentityGroupEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresensitygroupcontentevent.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresensitygroupcontentevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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: s_ximppresensitygroupcontentevent.h -* -*/ -#ifndef MXIMPFWPRESENSITYGROUPCONTENTEVENTSTUB_H -#define MXIMPFWPRESENSITYGROUPCONTENTEVENTSTUB_H - -#include - - -class MPresentityGroupContentEventStub : public MPresentityGroupContentEvent - { - const MXIMPIdentity& GroupId() const; - TInt NewMembersCount() const; - const MPresentityGroupMemberInfo& NewMember( TInt aIndex ) const; - TInt UpdatedMembersCount() const; - const MPresentityGroupMemberInfo& UpdatedMember( TInt aIndex ) const; - TInt DisappearedMembersCount() const; - const MPresentityGroupMemberInfo& DisappearedMember( TInt aIndex ) const; - TInt CurrentMembersCount() const; - const MPresentityGroupMemberInfo& CurrentMember( TInt aIndex ) const; - const MXIMPDataSubscriptionState& DataSubscriptionState() const; - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENSITYGROUPCONTENTEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresensitypresenceevent.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresensitypresenceevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* 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: s_ximppresensitypresenceevent.cpp -* -*/ -#include "s_ximppresensitypresenceevent.h" -#include "s_ximpidentity.h" -#include "s_presenceinfo.h" - -MyMXIMPIdentityStub gMXIMPIdentity; -MPresenceInfoStub gMPresenceInfo; -//MXIMPDataSubscriptionState gMXIMPDataSubscriptionState; - -TInt32 gMXIMPPresentityPresenceEventStubInterfaceId = 0; - -const MXIMPIdentity& MPresentityPresenceEventStub::PresentityId() const - { - return gMXIMPIdentity; - } - -const MPresenceInfo& MPresentityPresenceEventStub::SubscribedPresence() const - { - return gMPresenceInfo; - } - -const MXIMPDataSubscriptionState& MPresentityPresenceEventStub::DataSubscriptionState() const - { - MXIMPDataSubscriptionState* state = NULL; - return *state; - } - - -const TAny* MPresentityPresenceEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MPresentityPresenceEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresentityPresenceEventStub::GetInterfaceId() const - { - return gMXIMPPresentityPresenceEventStubInterfaceId; - } - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresensitypresenceevent.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximppresensitypresenceevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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: s_ximppresensitypresenceevent.h -* -*/ -#ifndef MXIMPFWPRESENSITYPRESENCEEVENTSTUB_H -#define MXIMPFWPRESENSITYPRESENCEEVENTSTUB_H - -#include - - -class MPresentityPresenceEventStub : public MPresentityPresenceEvent - { - const MXIMPIdentity& PresentityId() const; - const MPresenceInfo& SubscribedPresence() const; - const MXIMPDataSubscriptionState& DataSubscriptionState() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENSITYPRESENCEEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximprequestcompleteevent.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximprequestcompleteevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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: s_ximprequestcompleteevent.cpp -* -*/ - -#include "s_ximprequestcompleteevent.h" - -TInt32 gMXIMPRequestCompleteEventStubInterfaceId = 0; -TXIMPRequestId gMXIMPRequestCompleteEventStubRequestId; -TBool gRequestCompleteEventResultCodeKerrNotSupported = 0; -MyXIMPStatusStub gXIMPStatus; - -const TXIMPRequestId& MXIMPRequestCompleteEventStub::RequestId() const - { - return gMXIMPRequestCompleteEventStubRequestId; - } - -const MXIMPStatus& MXIMPRequestCompleteEventStub::CompletionResult() const - { - if (gRequestCompleteEventResultCodeKerrNotSupported) - { - gXIMPStatus.SetResultCode(KErrNotSupported); - return gXIMPStatus; - } - - gXIMPStatus.SetResultCode(KErrNone); - - return gXIMPStatus; - } - -const MXIMPBase* MXIMPRequestCompleteEventStub::LookupCompletionDataByType( - TInt32 /*aInterfaceId*/ ) const - { - MXIMPBase* base = NULL; - return base; - } - -const TAny* MXIMPRequestCompleteEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*Ops*/ ) const - { - return this; - } - -TAny* MXIMPRequestCompleteEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MXIMPRequestCompleteEventStub::GetInterfaceId() const - { - return gMXIMPRequestCompleteEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximprequestcompleteevent.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximprequestcompleteevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -/* -* 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: s_ximprequestcompleteevent.h -* -*/ -#ifndef MXIMPFWREQUESTCOMPLETEEVENTSTUB_H -#define MXIMPFWREQUESTCOMPLETEEVENTSTUB_H - -#include -#include - -class MXIMPStatus; - -class MXIMPRequestCompleteEventStub : public MXIMPRequestCompleteEvent - { - const TXIMPRequestId& RequestId() const; - const MXIMPStatus& CompletionResult() const; - const MXIMPBase* LookupCompletionDataByType( TInt32 aInterfaceId ) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - - -/** - * Interface for status object. - * - * Status object is used in XIMP Framework API - * to present result code and additional textual - * details from request completions, context - * state changes and similar events. - * - * @ingroup ximpdatamodelapi - * @since S60 v3.2 - */ -class MyXIMPStatusStub : public MXIMPStatus - { - -public: - - /** - * Gets request completion code. - * - * Result code can be: - * - one of the system wide errors - * - one of the ximp core specific errors defined in in ximperrors.hrh - * - one of the presence specific errors defined in in presenceerrors.hrh - * - error specific to the underlying communication channel - * - * @return The result code. - */ - TInt ResultCode() const { return iCode; }; - - - /** - * Gets the protocol level response code. - * - * - * @return Protocol level response code. - * KErrNone if no protocol level response code available. - */ - TInt ProtocolResultCode() const { return KErrNone; } - - - - /** - * Get the textual result description. - * Textual descriptions are protocol specific. - * - * @return The textual result description. - * Empty descriptor if no description available. - */ - const TDesC16& ProtocolResultDescription() const { return KNullDesC; } - - - - /** - * Sets request completion code. - * - * @param [in] aCode - * The result code. - */ - void SetResultCode( - TInt aCode ) { iCode = aCode; }; - - - - /** - * Sets textual result description. - * - * @param [in] aCode - */ - void SetProtocolResultCode( - TInt /*aCode*/ ) {}; - - - - /** - * Sets textual result description. - * - * @param [in] aDescription - * The textual result description. - */ - void SetProtocolResultDescriptionL( - const TDesC16& /*aDescription*/ ) {}; - - const TAny* GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const { return NULL; } - - TAny* GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) { return NULL; } - - TInt32 GetInterfaceId() const { return KErrNone; } - - private: - TInt iCode; - - }; - -#endif // MXIMPFWREQUESTCOMPLETEEVENT_H - - - diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpsearchevent.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpsearchevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* 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: s_ximpsearchevent.cpp -* -*/ - - -#include "s_ximpsearchevent.h" - -TInt32 gMXIMPSearchEventStubInterfaceId = 0; - - -TInt MSearchEventStub::SearchResultCount()const - { - return KErrNone; - } - -const MSearchInfo& MSearchEventStub::SearchResult( TInt /*aIndex*/ )const - { - MSearchInfo* info = NULL; - return *info; - } - -const MXIMPIdentity& MSearchEventStub::SearchId()const - { - MXIMPIdentity* identity = NULL; - return *identity; - } - - -const TAny* MSearchEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MSearchEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MSearchEventStub::GetInterfaceId() const - { - return gMXIMPSearchEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpsearchevent.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpsearchevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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: s_ximpsearchevent.h -* -*/ -#ifndef MXIMPFWSEARCHEVENTSTUB_H -#define MXIMPFWSEARCHEVENTSTUB_H - -#include - - -class MSearchEventStub : public MSearchEvent - { - TInt SearchResultCount() const; - const MSearchInfo& SearchResult( TInt aIndex ) const; - const MXIMPIdentity& SearchId() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWSEARCHEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpsearchkeysevent.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpsearchkeysevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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: s_ximpsearchkeysevent.cpp -* -*/ - - -#include "s_ximpsearchkeysevent.h" - -TInt32 gMXIMPSearchKeysEventStubInterfaceId = 0; - - -TInt MSearchKeysEventStub::InfoCount()const - { - return KErrNone; - } - -const MSearchKeyInfo& MSearchKeysEventStub::SearchKeyInfo( TInt /*aIndex*/ )const - { - MSearchKeyInfo* info = NULL; - return *info; - } - - -const TAny* MSearchKeysEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MSearchKeysEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MSearchKeysEventStub::GetInterfaceId() const - { - return gMXIMPSearchKeysEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpsearchkeysevent.h --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_ximpsearchkeysevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* 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: s_ximpsearchkeysevent.h -* -*/ -#ifndef MXIMPFWSEARCHKEYSEVENTSTUB_H -#define MXIMPFWSEARCHKEYSEVENTSTUB_H - -#include - - -class MSearchKeysEventStub : public MSearchKeysEvent - { - TInt InfoCount() const; - const MSearchKeyInfo& SearchKeyInfo( TInt aIndex ) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWSEARCHKEYSEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/testinstantmsgalert.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/testinstantmsgalert.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,200 +0,0 @@ -/* -* 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: This file contains testclass implementation. -* -*/ - -// INCLUDE FILES -#include -#include "testinstantmsgalert.h" -#include - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::Ctestinstantmsgalert -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -Ctestinstantmsgalert::Ctestinstantmsgalert( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void Ctestinstantmsgalert::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(KtestinstantmsgalertLogFileWithTitle, &title); - } - else - { - logFileName.Copy(KtestinstantmsgalertLogFile); - } - TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); - TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); - iLog = CStifLogger::NewL( KtestinstantmsgalertLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - SendTestClassVersion(); - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -Ctestinstantmsgalert* Ctestinstantmsgalert::NewL( - CTestModuleIf& aTestModuleIf ) - { - Ctestinstantmsgalert* self = new (ELeave) Ctestinstantmsgalert( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -Ctestinstantmsgalert::~Ctestinstantmsgalert() - { - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - } - -//----------------------------------------------------------------------------- -// Ctestinstantmsgalert::SendTestClassVersion -// Method used to send version of test class -//----------------------------------------------------------------------------- -// -void Ctestinstantmsgalert::SendTestClassVersion() - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; - moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; - moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; - - TFileName moduleName; - moduleName = _L("testinstantmsgalert.dll"); - - TBool newVersionOfMethod = ETrue; - TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) Ctestinstantmsgalert::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 instantmessagesalert/tsrc/testinstantmsgalert/src/testinstantmsgalertBlocks.cpp --- a/instantmessagesalert/tsrc/testinstantmsgalert/src/testinstantmsgalertBlocks.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,430 +0,0 @@ -/* -* 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: This file contains testclass implementation. -* -*/ - -// [INCLUDE FILES] - do not remove -#include -#include -#include -#include "testinstantmsgalert.h" - - - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void Ctestinstantmsgalert::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - ENTRY( "Example", Ctestinstantmsgalert::ExampleL ), - ENTRY( "CIMAlertManager_NewL", Ctestinstantmsgalert::CIMAlertManager_NewL ), - ENTRY( "CIMAlertManager_PlayL", Ctestinstantmsgalert::CIMAlertManager_PlayL ), - ENTRY( "CIMAlertManager_Stop", Ctestinstantmsgalert::CIMAlertManager_Stop ), - ENTRY( "CIMAlertManager_SetVolume", Ctestinstantmsgalert::CIMAlertManager_SetVolume ), - ENTRY( "CIMAlertManager_SetRingingType", Ctestinstantmsgalert::CIMAlertManager_SetRingingType ), - ENTRY( "CIMAlertManager_SetVibra", Ctestinstantmsgalert::CIMAlertManager_SetVibra ), - ENTRY( "CIMAlertManager_DoSetRingingType", Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType ), - ENTRY( "CIMAlertManager_ConvertVolume", Ctestinstantmsgalert::CIMAlertManager_ConvertVolume ), - ENTRY( "CIMAlertManager_MapcInitComplete", Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete ), - ENTRY( "CIMAlertManager_MapcPlayComplete", Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete ), - ENTRY( "CIMAlertManager_HandleKeyChange", Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange ), - ENTRY( "CIMAlertManager_HandleNotifyInt", Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt ), - ENTRY( "CIMAlertManager_MatoPrepareComplete", Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete ), - ENTRY( "CIMAlertManager_MatoPlayComplete", Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete ), - ENTRY( "CIMAlertManager_AddObserverL", Ctestinstantmsgalert::CIMAlertManager_AddObserverL ), - ENTRY( "CIMAlertManager_RemoveObserver", Ctestinstantmsgalert::CIMAlertManager_RemoveObserver ), - ENTRY( "CIMAlertManager_HandleError", Ctestinstantmsgalert::CIMAlertManager_HandleError ), - - //ADD NEW ENTRY HERE - // [test cases entries] - Do not remove - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::ExampleL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::ExampleL( CStifItemParser& aItem ) - { - - // Print to UI - _LIT( Ktestinstantmsgalert, "testinstantmsgalert" ); - _LIT( KExample, "In Example" ); - TestModuleIf().Printf( 0, Ktestinstantmsgalert, KExample ); - // Print to log file - iLog->Log( KExample ); - - TInt i = 0; - TPtrC string; - _LIT( KParam, "Param[%i]: %S" ); - while ( aItem.GetNextString ( string ) == KErrNone ) - { - TestModuleIf().Printf( i, Ktestinstantmsgalert, - KParam, i, &string ); - i++; - } - - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_NewL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_NewL( CStifItemParser& aItem ) - { - - TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksRequests ); - TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); - CIMAlertManager* object = CIMAlertManager::NewL(); - - if(object) - { - delete object; - return KErrNone; - } - else - return KErrGeneral; - - } -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_PlayL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_PlayL( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - object->PlayL(5); - delete object; - return KErrNone; - - } -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_SetVolume -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_SetVolume( CStifItemParser& aItem ) - { - - CIMAlertManager* object = CIMAlertManager::NewL(); - object->SetVolume(5); - delete object; - return KErrNone; - - - } -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_SetRingingType -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_SetRingingType( CStifItemParser& aItem ) - { - - CIMAlertManager* object = CIMAlertManager::NewL(); - object->SetRingingType(EProfileRingingTypeRingingOnce); - delete object; - return KErrNone; - - } -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_SetVibra -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_SetVibra( CStifItemParser& aItem ) - { - - CIMAlertManager* object = CIMAlertManager::NewL(); - object->SetVibra(ETrue); - delete object; - return KErrNone; - - } -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_DoSetRingingType( CStifItemParser& aItem ) - { - - CIMAlertManager* object = CIMAlertManager::NewL(); - object->DoSetRingingType(EProfileRingingTypeRingingOnce); - delete object; - return KErrNone; - - } -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_ConvertVolume -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_ConvertVolume( CStifItemParser& aItem ) - { - - CIMAlertManager* object = CIMAlertManager::NewL(); - object->ConvertVolume(5); - delete object; - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_Stop -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_Stop( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - object->Stop(); - delete object; - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_MapcInitComplete( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - object->MapcInitComplete(KErrNone,5); - delete object; - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_MapcPlayComplete( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - object->MapcPlayComplete(KErrNone); - delete object; - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_HandleKeyChange( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - TUpdatedKey temp; - temp.iValue = ECoreAppUIsStopTonePlaying; - object->HandleKeyChange(temp); - delete object; - return KErrNone; - - } -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_HandleNotifyInt( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - object->HandleNotifyInt(KProEngActiveRingingVolume,5); - delete object; - return KErrNone; - - } -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_MatoPrepareComplete( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - object->MatoPrepareComplete(KErrNone); - delete object; - return KErrNone; - - } -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_MatoPlayComplete( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - object->MatoPlayComplete(KErrNone); - delete object; - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_AddObserverL -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_AddObserverL( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - MIMAlertManagerObserver* observer = NULL; - object->AddObserverL(observer); - delete object; - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_RemoveObserver -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_RemoveObserver( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - MIMAlertManagerObserver* observer = NULL; - object->RemoveObserver(observer); - delete object; - return KErrNone; - - } - -// ----------------------------------------------------------------------------- -// Ctestinstantmsgalert::CIMAlertManager_HandleError -// Example test method function. -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt Ctestinstantmsgalert::CIMAlertManager_HandleError( CStifItemParser& aItem ) - { - CIMAlertManager* object = CIMAlertManager::NewL(); - MIMAlertManagerObserver* observer = NULL; - object->HandleError(KErrNone); - delete object; - return KErrNone; - - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= -// None - -// [End of File] - Do not remove diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/group/bld.inf --- a/instantmsgindicatorplugin/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* 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: Build information file for instantmsgindicator plugin -* -*/ - -#include - - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -// for image creation: -../rom/instantmsgindicatorplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(instantmsgindicatorplugin.iby) - -// ROM SIS stubs -../sis/instantmsgindicatorpluginstub.sis /epoc32/data/z/system/install/instantmsgindicatorpluginstub.sis - -PRJ_MMPFILES -instantmsgindicatorplugin.mmp diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/group/instantmsgindicatorplugin.mmp --- a/instantmsgindicatorplugin/group/instantmsgindicatorplugin.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* 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: plugin for getting the message infiormation form instantmessageingcache -* -*/ -#include - -// To get the APP_LAYER_SYSTEMINCLUDE-definition -#include - -#include "../inc/instantmsgindicatoruids.h" - -TARGET instantmsgindicatorplugin.dll -TARGETTYPE PLUGIN -UID KECOMRECOGNITIONUID2 KINSTANTMSGINDICATORUID3 -CAPABILITY CAP_ECOM_PLUGIN - -VERSION 10.0 - -//used to allow binary compression by making use of BYTEPAIR algorithm -PAGED - -USERINCLUDE ../inc -USERINCLUDE ../../instantmessagesalert/inc - -// Default system include paths for application layer modules. -APP_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE /epoc32/include/ecom - -SOURCEPATH ../src - -SOURCE instantmsgindicatorproxy.cpp -SOURCE instantmsgindicatorpluginimplementation.cpp - - -// Resources -START RESOURCE ../rss/20026766.rss -TARGET instantmsgindicatorplugin.rsc -TARGETPATH ECOM_RESOURCE_DIR -END - - -LIBRARY aknskins.lib -LIBRARY egul.lib -LIBRARY fbscli.lib -LIBRARY aknicon.lib - -LIBRARY efsrv.lib -LIBRARY commonengine.lib -LIBRARY bafl.lib -LIBRARY euser.lib -LIBRARY cone.lib -LIBRARY ecom.lib -LIBRARY apparc.lib -LIBRARY apgrfx.lib -LIBRARY calinterimapi.lib -LIBRARY aknnotify.lib -LIBRARY instantmessagesalert.lib - -// Eod of file - diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/inc/instantmsgindicatorpluginimplementation.h --- a/instantmsgindicatorplugin/inc/instantmsgindicatorpluginimplementation.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* 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: this class is the implementation of the plugin -* -*/ -// This file defines the API for imstatuspaneindicator.dll - -#ifndef __INSTANTMSGINDICATORPLUGINIMPLEMENTATION_H__ -#define __INSTNATMSGINDICATORPLUGINIMPLEMENTATION_H__ - -// Include Files - -#include // CBase -#include // TBuf -#include -#include "instantmsgindicatoruids.h" - - -//Forward Declarations - -class CAknSmallIndicator; -class CIMAlertManager; -// Class Definitions - -class CInstantMsgIndicatorPluginImplementation : public CInstantMsgIndicator - { -public: - // new functions - - /** - * NewLC two phase constructor. - * @param aServiceId, service id - */ - static CInstantMsgIndicatorPluginImplementation* NewL( ); - - /** - * NewLC two phase constructor. - * @param aServiceId, service id - */ - static CInstantMsgIndicatorPluginImplementation* NewLC( ); - - /** - * c++ default destructor - */ - virtual ~CInstantMsgIndicatorPluginImplementation(); - -public: - - - /** - * sets/resets the status pane indicator - * @param aNewMessages, new message count - * @param aSeriveId, service id. - * @param aSenderId, message sender id. - * @param aMultipleSender, count of number of P-2_p chats. - * @param aCloseConversation, indicates that this even came from closing the - * conversation and hence no need to paly the tone if there were already new messages. - */ - void MessageInfoL(TInt aNewMessages, TInt aSeriveId, const TDesC& aSenderId, - TInt aMultipleSender,TBool aCloseConversation = EFalse); - - - -private: // new functions - - - /** - * C++ constructor. - */ - CInstantMsgIndicatorPluginImplementation(); - - /** - * Second phase construction - * ConstructL - */ - void ConstructL(); - - /* - * Show IM indicator. - */ - void ShowIMIndicatorL(TInt aNewMessages, TInt aSeriveId, const TDesC& aSenderId, TInt aMultipleSender); - - /* - * play the msg tone. - */ - void PlayMsgToneL(TInt aNewMessages,TInt aSeriveId); -private: // data - - // owned, object of status indicator. - CAknSmallIndicator* iIndicator; - - CIMAlertManager* iIMAlertMgr; - }; - -#endif // __INSTANTMSGINDICATORPLUGINIMPLEMENTATION_H__ - diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/inc/instantmsgindicatoruids.h --- a/instantmsgindicatorplugin/inc/instantmsgindicatoruids.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* 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: this is the implementation of the proxy -* -*/ - - -#ifndef __INSTANTMSGINDICATORUIDS_H -#define __INSTANTMSGINDICATORUIDS_H - - - -// part of imindicatorplugin dll -#define KECOMRECOGNITIONUID2 0x10009d8d -#define KINSTANTMSGINDICATORUID3 0x20026766 -#define KINSTANTMSGINDICATORIMPLEMENTATIONUID3 0x20026766 -#define KINSTNATMSGINTERFACEUID 0x20026768 - -#endif // __INSTANTMSGINDICATORUIDS_H - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/rom/instantmsgindicatorplugin.iby --- a/instantmsgindicatorplugin/rom/instantmsgindicatorplugin.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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: this file contains the iby's -* -*/ - -#ifndef __INSTANTMSGINDICATORPLUGIN_IBY__ -#define __INSTANTMSGINDICATORPLUGIN_IBY__ - -#include -#include - -ECOM_PLUGIN(instantmsgindicatorplugin.dll,instantmsgindicatorplugin.rsc) - -// stub SIS, provides support for SIS upgrading -data=DATAZ_\system\install\instantmsgindicatorpluginstub.sis system\install\instantmsgindicatorpluginstub.sis - -#endif // __SERVICEWIDGET_IBY__ diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/rss/20026766.rss --- a/instantmsgindicatorplugin/rss/20026766.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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: this file is the resource file of plugin -* -*/ - - -#include "../inc/instantmsgindicatoruids.h" -#include - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = KINSTANTMSGINDICATORUID3; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KINSTNATMSGINTERFACEUID; - - implementations = - { - - IMPLEMENTATION_INFO - { - implementation_uid = KINSTANTMSGINDICATORIMPLEMENTATIONUID3; - version_no = 1; - display_name = ""; - default_data = "Default"; - opaque_data = ""; - } - }; - } - }; - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/sis/createsisx.bat --- a/instantmsgindicatorplugin/sis/createsisx.bat Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -makesis instantmsgindicatorplugin.pkg -signsis instantmsgindicatorplugin.sis instantmsgindicatorplugin.sisx rd.cer rd-key.pem diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/sis/instantmsgindicatorplugin.pkg --- a/instantmsgindicatorplugin/sis/instantmsgindicatorplugin.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -; -; 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: -; -;Language - standard language definitions -&EN - -;UID is the dll's UID -#{"InstantMsgIndicatorPlugin"},(0x20026766),1,1,0, TYPE=SA, RU - -;Supports Series 60 v 5.2; Needs to be updated when platform is changed -(0x20022E6D ), 0, 0, 0, {"Series60ProductID"} - -;Localised Vendor name -%{"Nokia"} - -;VendorID -:"Nokia" - -; Files to copy - -"/EPOC32/RELEASE/ARMV5/UREL/instantmsgindicatorplugin.dll" -"!:/sys/bin/instantmsgindicatorplugin.dll" - - -"/EPOC32/DATA/Z/Resource/Plugins/instantmsgindicatorplugin.rsc" -"!:/Resource/Plugins/instantmsgindicatorplugin.rsc" - -; end of file - diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/sis/instantmsgindicatorplugin.sis Binary file instantmsgindicatorplugin/sis/instantmsgindicatorplugin.sis has changed diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/sis/instantmsgindicatorplugin.sisx Binary file instantmsgindicatorplugin/sis/instantmsgindicatorplugin.sisx has changed diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/sis/instantmsgindicatorpluginstub.pkg --- a/instantmsgindicatorplugin/sis/instantmsgindicatorpluginstub.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -; -; 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: -; -;Language -&EN - -;Header -#{"InstantMsgIndicatorPlugin"}, (0x20026766), 1, 0, 0, TYPE=SA - -;Localised VendorID -%{"Nokia"} - -;VendorID -:"Nokia" - -;uiservicetab components -"" -"z:\sys\bin\instantmsgindicatorplugin.dll" - -;resources -"" -"z:\Resource\Plugins\instantmsgindicatorplugin.rsc" - - -; end of file diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/sis/instantmsgindicatorpluginstub.sis Binary file instantmsgindicatorplugin/sis/instantmsgindicatorpluginstub.sis has changed diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/sis/metadata.xml --- a/instantmsgindicatorplugin/sis/metadata.xml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ - - - ABC:ABC - - - - - 1 - - InstantMsgIndicatorPlugin - - Update for InstantMsgIndicatorPlugin - - - - - - S60 - - - 5 - 2 - - - 2007 - 1 - - - - - 5 - 2 - - 2009 - 52 - - - - - - - - 0x20026766 - - - 1 - 0 - 0 - - - - 2 - 2 - 2 - - - - - diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/src/instantmsgindicatorpluginimplementation.cpp --- a/instantmsgindicatorplugin/src/instantmsgindicatorpluginimplementation.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,194 +0,0 @@ -/* -* 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: this class is the implementaiton of this plugin -* -*/ -// Include Files - -#include "instantmsgindicatorpluginimplementation.h" -#include //Akn indicator -#include -#include -#include "cimalertmanager.h" - -// Member Functions - -// --------------------------------------------------------------------------- -// CInstantMsgIndicatorPluginImplementation::CInstantMsgIndicatorPluginImplementation() -// --------------------------------------------------------------------------- -// -CInstantMsgIndicatorPluginImplementation* CInstantMsgIndicatorPluginImplementation::NewLC() - { - CInstantMsgIndicatorPluginImplementation* self = new (ELeave) CInstantMsgIndicatorPluginImplementation(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CInstantMsgIndicatorPluginImplementation::CInstantMsgIndicatorPluginImplementation() -// --------------------------------------------------------------------------- -// - CInstantMsgIndicatorPluginImplementation* CInstantMsgIndicatorPluginImplementation::NewL() - { - CInstantMsgIndicatorPluginImplementation* self = CInstantMsgIndicatorPluginImplementation::NewLC( ); - CleanupStack::Pop(self); - return self; - } - // --------------------------------------------------------------------------- - // CInstantMsgIndicatorPluginImplementation::CInstantMsgIndicatorPluginImplementation() - // --------------------------------------------------------------------------- - // -CInstantMsgIndicatorPluginImplementation::CInstantMsgIndicatorPluginImplementation( ) - { - } -// --------------------------------------------------------------------------- -// CInstantMsgIndicatorPluginImplementation::ConstructL() -// --------------------------------------------------------------------------- -// -void CInstantMsgIndicatorPluginImplementation::ConstructL() - { - iIndicator = CAknSmallIndicator::NewL( TUid::Uid( EAknIndicatorMecoServiceTab ) ); - //define the properties for publishing - // msg count, serive id, sender id, receiver id - - // define first property to be integer type - TInt result = RProperty::Define(KIMStatusProperty,EIMStatusPropertyMessageCount,RProperty::EInt); - if (result != KErrAlreadyExists) - User::LeaveIfError(result); - - // define first property to be integer type - result = RProperty::Define(KIMStatusProperty,EIMStatusPropertyServiceId,RProperty::EInt); - if (result != KErrAlreadyExists) - User::LeaveIfError(result); - - result = RProperty::Define(KIMStatusProperty,EIMMultipleSender,RProperty::EInt); - if (result != KErrAlreadyExists) - User::LeaveIfError(result); - - // define first property to be integer type - result = RProperty::Define(KIMStatusProperty,EIMStatusPropertySenderId,RProperty::EText); - if (result != KErrAlreadyExists) - User::LeaveIfError(result); - - iIMAlertMgr = CIMAlertManager::NewL(); - } - -// --------------------------------------------------------------------------- -// CInstantMsgIndicatorPluginImplementation::~CInstantMsgIndicatorPluginImplementation -// --------------------------------------------------------------------------- -// -CInstantMsgIndicatorPluginImplementation::~CInstantMsgIndicatorPluginImplementation() - { - //Make the IM Indicator invisible here - if(iIndicator) - { - // using TRAP_IGNORE as we cannot call leaving methods in the destructor. - TRAP_IGNORE(iIndicator->SetIndicatorStateL(EAknIndicatorStateOff)); - delete iIndicator; - iIndicator = NULL; - } - // delete the earlier defined property - RProperty::Delete(KIMStatusProperty,EIMStatusPropertyMessageCount); - - // delete the earlier defined property - RProperty::Delete(KIMStatusProperty,EIMStatusPropertyServiceId); - - // delete the earlier defined property - RProperty::Delete(KIMStatusProperty,EIMMultipleSender); - - // delete the earlier defined property - RProperty::Delete(KIMStatusProperty,EIMStatusPropertySenderId); - } - - -// --------------------------------------------------------------------------- -// CInstantMsgIndicatorPluginImplementation::ShowIMIndicator -// --------------------------------------------------------------------------- -// -void CInstantMsgIndicatorPluginImplementation::ShowIMIndicatorL(TInt aNewMessages, TInt aSeriveId, - const TDesC& aSenderId , - TInt aMultipleSender) - { - if(iIndicator) - { - if(aNewMessages>0) - { - TInt result = RProperty::Set(KIMStatusProperty,EIMStatusPropertyMessageCount,aNewMessages); - User::LeaveIfError(result); - - result = RProperty::Set(KIMStatusProperty,EIMStatusPropertyServiceId,aSeriveId); - User::LeaveIfError(result); - - result = RProperty::Set(KIMStatusProperty,EIMMultipleSender,aMultipleSender); - User::LeaveIfError(result); - - result = RProperty::Set(KIMStatusProperty,EIMStatusPropertySenderId,aSenderId); - User::LeaveIfError(result); - - iIndicator->SetIndicatorStateL( EAknIndicatorStateOn ); - } - else - { - TInt result = RProperty::Set(KIMStatusProperty,EIMStatusPropertyMessageCount,aNewMessages); - User::LeaveIfError(result); - - result = RProperty::Set(KIMStatusProperty,EIMStatusPropertyServiceId,aSeriveId); - User::LeaveIfError(result); - - result = RProperty::Set(KIMStatusProperty,EIMMultipleSender,aMultipleSender); - User::LeaveIfError(result); - - result = RProperty::Set(KIMStatusProperty,EIMStatusPropertySenderId,aSenderId); - User::LeaveIfError(result); - iIndicator->SetIndicatorStateL( EAknIndicatorStateOff ); - } - } - - } - -// --------------------------------------------------------------------------- -// CInstantMsgIndicatorPluginImplementation::PlayMsgToneL -// --------------------------------------------------------------------------- -// -void CInstantMsgIndicatorPluginImplementation::PlayMsgToneL(TInt aNewMessages,TInt aSeriveId) - { - if(aNewMessages>0 && iIMAlertMgr) - { - iIMAlertMgr->PlayL(aSeriveId); - } - } - -// --------------------------------------------------------------------------- -// CInstantMsgIndicatorPluginImplementation::MessageInfoL -// --------------------------------------------------------------------------- -// - void CInstantMsgIndicatorPluginImplementation::MessageInfoL(TInt aNewMessages, TInt aSeriveId, - const TDesC& aSenderId , - TInt aMultipleSender, - TBool aCloseConversation /*= EFalse*/) - { - - ShowIMIndicatorL(aNewMessages, aSeriveId,aSenderId, aMultipleSender); - // this event is not from close conversation hence play the tone, - // else do not play the tone. - if(!aCloseConversation) - { - PlayMsgToneL(aNewMessages,aSeriveId); - } - } - -//end of file - - diff -r 2b7283837edb -r 3104fc151679 instantmsgindicatorplugin/src/instantmsgindicatorproxy.cpp --- a/instantmsgindicatorplugin/src/instantmsgindicatorproxy.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* 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: this class is the proxy calss -* -*/ - -#include "instantmsgindicatorpluginimplementation.h" -#include "instantmsgindicatoruids.h" - -#include - -// Define the interface UIDs -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KINSTANTMSGINDICATORIMPLEMENTATIONUID3, - CInstantMsgIndicatorPluginImplementation::NewL ) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy - (TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(ImplementationTable[0]); - return ImplementationTable; - } -// End of file diff -r 2b7283837edb -r 3104fc151679 layers.sysdef.xml --- a/layers.sysdef.xml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -]> - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/group/bld.inf --- a/servicewidget/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2008 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: build information files - * -*/ - - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -// for image creation: -../rom/servicewidget.iby CORE_APP_LAYER_IBY_EXPORT_PATH(servicewidget.iby) -../rom/servicewidgetresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(servicewidgetresources.iby) - -// ROM SIS stubs -../sis/servicewidget_stub.sis /epoc32/data/z/system/install/servicewidget_stub.sis - -PRJ_MMPFILES - -#include "../servicewidgetdatapublisher/group/bld.inf" -#include "../themes/install-themes/install/servicewidget_20021383/group/bld.inf" - -PRJ_TESTMMPFILES -// None - -PRJ_TESTEXPORTS -// None - -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/inc/servicewidgetcpglobals.h --- a/servicewidget/inc/servicewidgetcpglobals.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2008 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: constant declaration class - * - * -*/ - - - -#ifndef SERVICEWIDGETLOBALS_H -#define SERVICEWIDGETLOBALS_H - -#include - -// meco service uid -const TInt32 KMECOIMPLEMENTATIONUID ( 0x20012423 ); - -/* -* service tab app and view uid -*/ -const TInt32 KIMServicetabPluginUid ( 0x20007B6D ); - -/* -* define constants -*/ -#define KIMWCP_FIRSTTEXT_SIZE 50 // first row text length -#define KIMWCP_SECONDTEXT_SIZE 100 // second row text length -#define KIMW_MAX_LENGTH 512 // own user id -#define KTimerInterval 3000000 // 3 sc timer expiration time -#define KSW_RESOURCE_MAX_LENGTH 512 // resource path max length -#define KIMWCP_ADD_DATA_SIZE 100 // additional data length -/* -* resource related strings -*/ -_LIT(KResourceDrive, "\\resource\\" ); -_LIT(KResourceFileName, "servicewidgetpluginres.rsc" ); - -/* -* some special character -*/ -_LIT(KAt, "@" ); -_LIT(KSlash, "/"); -_LIT(KColon,":"); - -/* -* content publishing service -*/ -_LIT8( KCPInterface, "IDataSource" ); -_LIT8( KCPContentInterface, "IContentPublishing" ); -_LIT8( KCPService, "Service.ContentPublishing" ); - -/* - * publisher id and types supported - */ -_LIT(KMask,"_mask"); - -//Supported Commands -_LIT8( KAdd, "Add" ); -_LIT8(KGetList,"GetList"); -_LIT8(KResults,"results"); -// Input arguments -_LIT8( KType, "type" ); -_LIT8( KItem, "item" ); -_LIT8( KPublisherId, "publisher" ); -_LIT8( KContentType, "content_type" ); -_LIT8( KContentId, "content_id" ); -_LIT( KCpData, "cp_data" ); - - /* - * own id content id and key defined in xml - */ -_LIT8(KOwnTextKey, "owntext"); - -/* - * message content id and key defined in xml - */ -_LIT8(KMessageTextKey, "msgtext"); - -/* - * serviceimage content id and key defined in xml - */ -_LIT8(KServiceImageKey, "serviceimage"); - -/* - * own status content id and key defined in xml - */ -_LIT8(KStatusIconKey, "statusimage"); - -/* - * HandleNotify constant - */ -_LIT8( KActive, "active"); -_LIT8( KDeActive, "deactive"); -_LIT8( KSuspend, "suspend"); -_LIT8( KInactive, "inactive"); -_LIT8( KResume, "resume"); -_LIT8( KData, "data" ); -_LIT8( KDelete, "Delete" ); -_LIT8(KSelected, "selected"); -// Output -_LIT8( KDataMap, "data_map" ); -_LIT8( KActionMap, "action_map" ); - -//Register Widget -_LIT(KServiceWidget, "servicewidget"); -//UID 20021383 is of Publisher used here as constant to avoid conflict with any other -//Homescreen widget.This will be suffix to publisher name to make unique id for theme. -_LIT( KThemeUid, ":0x20021383"); -_LIT8( KTemplateType, "template_type"); -_LIT8( KWidgetName, "widget_name"); -_LIT8( KWidgetInfo, "widget_info"); -_LIT(KTemplateWidget, "hstemplate"); -_LIT8( KExecute, "execute" ); -_LIT( KAll, "all"); -_LIT8( KMaxWidgetInst, "widget_inst"); -_LIT8( KWidgetDesc, "widget_desc"); -_LIT8( KWidgetLogo, "widget_icon"); - - -_LIT8( KRequestNotification, "RequestNotification" ); -_LIT( KPublisher, "publisher" ); -_LIT8( KFilter, "filter" ); -_LIT(KTriggerMap, "data"); -_LIT8( KChangeInfo, "change_info" ); -_LIT8( KActionTrigger, "action_trigger" ); -_LIT8( KOperation, "operation" ); - -#endif /*SERVICEWIDGETLOBALS_H*/ diff -r 2b7283837edb -r 3104fc151679 servicewidget/inc/servicewidgetenums.hrh --- a/servicewidget/inc/servicewidgetenums.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2008 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: class presence cache handler class implementation - * -*/ - - -#ifndef SERVICEWIDGETENUMS_HRH -#define SERVICEWIDGETENUMS_HRH - -/** -* do not modify the below order -*/ -/** - * @class presence cache handler class implementation - * @since 5.0 - */ -enum TWSPresenceStatus - { - EWSUnknown = -1, // add new enums below this - EWSOnline = 0, - EWSAway, // 1 - EWSbusy, // 2 - EWSDoNotDisturb, // 3 - EWSOffline, // 4 - EWSOnPhone,//5 - EWSBlocked, //6 - EWSNewMessage ,//7 - EWSServiceIcon, //8 - EWSInvisible, //9 - EWSLast = 10 // add new enums above this - - }; - -/** - * @operation id - * @since 5.0 - */ - enum TWServiceOperationId - { - EWSOperationUnknown = -1, - EWSOperationBind, - EWSOperationUnbind, - EWSOperationFetching, - EWSOperationGrandList, - EWSOperationComplete - }; - - -/** -* A enum -* Registration states to control views -*/ -enum TSWSTRegistrationState - { - ESWSNotRegistered = 0,/* Service Not registered*/ - ESWSRegistered = 0x8, /* Service registered */ - ESWSNetworkConnecting = 0x4, /* service connecting */ - ESWSWaitingForNetwork = 0x2, /* service waiting for connection*/ - ESWSNetworkDisConnecting = 0x1, /* service disconnecting */ - ESWSUpdatingContacts = 0x10 - }; - -/* -* enum for appview launch -*/ -enum TSWAExecuteOperation - { - ESWAUnknown = -1, - ESWALaunchServiceTab , - ESWALaunchConverView, - ESWALaunchSTAutoLogin, - ESWAStartLogin - }; - -#endif // SERVICEWIDGETENUMS_HRH - - -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/inc/servicewidgetpluginuids.hrh --- a/servicewidget/inc/servicewidgetpluginuids.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2008 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: uids collections - * - * -*/ - - - -#ifndef SERVICEWIDGETPLUGINUIDS_HRH -#define SERVICEWIDGETPLUGINUIDS_HRH - -/** - * Dll uid for service widget plugin. - */ -#define AI_UID_DLL_SERVICEWIDGETPUBLISHER_PLUGIN 0x20021383 - - -#endif // SERVICEWIDGETPLUGINUIDS_HRH diff -r 2b7283837edb -r 3104fc151679 servicewidget/inc/swpdebugtrace.h --- a/servicewidget/inc/swpdebugtrace.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* Copyright (c) 2008 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: logger -* -*/ - - - -#ifndef __SWPDEBUGTRACE_H__ -#define __SWPDEBUGTRACE_H__ - -// INCLUDES -#include "e32std.h" -#include -// DEFINES -// enable logs printing -// into c:\\logs\\swp\\swp.txt -#ifdef __WINS__ - #ifdef _DEBUG - #define SWP_ENABLE_DEBUG_LOGS // for WINS UDEB - #endif -#else - #ifdef _DEBUG - #define SWP_ENABLE_DEBUG_LOGS // for device UDEB - #endif -#endif - -/** -* Usage of Log MACRO'S -* _LIT( KExample, "Example" ); -* TXT(s) _L(s) -* TRACE_SWP(TXT("Some text.") ); -* TRACE_SWP(TXT("Some text: %d"), 100 ); -* TRACE_SWP(TXT("Some text: %S"), &KExample ); -*/ - -_LIT( KTAdaptDebugOutputDir, "swp" ); -_LIT( KTAdaptDebugOutputFileName, "swp.txt" ); -const TInt KTAdaptMaxLogLineLength = 250 ; -#define TXT(s) _L(s) -#define TRACE_SWP TSWPLogger::WriteLog -#define PLUGIN_UNUSED_PARAM(p) (void) p - - -/** - * IM cache debug logger. - */ -class TSWPLogger - { - public: //Logging functions - /** - * WriteLog, write the message into c:\\logs\\swp\\swp.txt - * @param aFmt, list of messges to print - */ - static void WriteLog( TRefByValue aFmt,... ); - - private: //Prohibited - /** - * construtor - */ - TSWPLogger(); - /** - * destructor - */ - ~TSWPLogger(); - }; - -#endif // __SWPDEBUGTRACE_H__ - - - -/** - * Handler used by logger to truncate the string - * rather than panic in case of buffer overflow. -*/ - -NONSHARABLE_CLASS ( TAdaptOverflowTruncate ) : public TDes16Overflow - { - -public: - void Overflow ( TDes16& /*aDes*/ ) {} - }; - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// TSWPLogger::WriteLog() -// ----------------------------------------------------------------------------- -// -inline void TSWPLogger::WriteLog ( TRefByValue aFmt, ... ) - { - #ifdef SWP_ENABLE_DEBUG_LOGS - ( void ) aFmt;//Suppress unused formal parameter warning - TBuf< KTAdaptMaxLogLineLength > buffer; - buffer.Append ( _L ( "[" ) ); // CSI: 78 # - buffer.Append ( RThread().Name() ); - buffer.Append ( _L ( "] " ) ); // CSI: 78 # - TAdaptOverflowTruncate overflow; - VA_LIST list; - VA_START ( list, aFmt ); - buffer.AppendFormatList ( aFmt, list, &overflow ); - RFileLogger logger; - - if ( logger.Connect() == KErrNone ) - { - logger.SetDateAndTime ( ETrue, ETrue ); - logger.CreateLog ( KTAdaptDebugOutputDir, KTAdaptDebugOutputFileName, - EFileLoggingModeAppend ); - logger.Write ( buffer ); - logger.CloseLog(); - logger.Close(); - } - #endif - - } - - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 servicewidget/rom/servicewidget.iby --- a/servicewidget/rom/servicewidget.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2008 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: imwidget IBY file. -* -*/ - - -#ifndef __SERVICEWIDGET_IBY__ -#define __SERVICEWIDGET_IBY__ - -#include -#include - -ECOM_PLUGIN(servicewidgetdatapublisher.dll,servicewidgetdatapublisher.rsc) - -// stub SIS, provides support for SIS upgrading -data=DATAZ_\system\install\servicewidget_stub.sis system\install\servicewidget_stub.sis - -#endif // __SERVICEWIDGET_IBY__ diff -r 2b7283837edb -r 3104fc151679 servicewidget/rom/servicewidgetresources.iby --- a/servicewidget/rom/servicewidgetresources.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2008 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: imwidget resources IBY file. -* -*/ - -#ifndef __SERVICEWIDGET_RESOURCESIBY__ -#define __SERVICEWIDGET_RESOURCESIBY__ - -//service widget - -// ECom plugin resources -data=DATAZ_\RESOURCE_FILES_DIR\servicewidgetpluginres.rsc RESOURCE_FILES_DIR\servicewidgetpluginres.rsc - -#endif //__SERVICEWIDGET_RESOURCESIBY__ diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/group/bld.inf --- a/servicewidget/servicewidgetdatapublisher/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -/* -* Copyright (c) 2008 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: build information files - * -*/ - - - -#include - -PRJ_PLATFORMS - -DEFAULT - -PRJ_EXPORTS -// None -PRJ_EXPORTS - -PRJ_MMPFILES - - -servicewidgetdatapublisher.mmp - -// End of File - diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/group/servicewidgetdatapublisher.mmp --- a/servicewidget/servicewidgetdatapublisher/group/servicewidgetdatapublisher.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* Copyright (c) 2008 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: This is a project specification file for service widget - * - * -*/ - - -#include -#include -#include "../../inc/servicewidgetpluginuids.hrh" - -TARGET servicewidgetdatapublisher.dll -TARGETTYPE PLUGIN -// ECom Dll recognition UID followed by the unique UID for this dll -UID 0x10009D8D AI_UID_DLL_SERVICEWIDGETPUBLISHER_PLUGIN -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -// Plugin -SOURCEPATH ../src -SOURCE cservicewidgetplugin.cpp -SOURCE cservicewidgetcontentpublisher.cpp -SOURCE cservicewidgetservicemanager.cpp -SOURCE cservicewidgetcchhandler.cpp -SOURCE cservicewidgetpresencehandler.cpp -SOURCE cservicewidgetbuddypresence.cpp -SOURCE cservicewidgetmessagehandler.cpp -SOURCE cservicewidgetbrandhandler.cpp -SOURCE cservicewidgettimer.cpp -SOURCE servicewidgetutils.cpp - -SOURCEPATH ../rss -// ECom resource -START RESOURCE servicewidgetdatapublisher.rss -TARGET servicewidgetdatapublisher.rsc -END -// loc strings resource -START RESOURCE servicewidgetpluginres.rss -HEADER -TARGET servicewidgetpluginres.rsc -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../../group - -USERINCLUDE ../../../uiservicetab/inc -USERINCLUDE ../../../inc - - -// Default system include paths for application layer modules. -APP_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE /epoc32/include/ecom -SYSTEMINCLUDE /epoc32/include/mmf/common -SYSTEMINCLUDE /epoc32/include/internal - -// AI / Calendar -LIBRARY aiutils.lib -// S60 / Symbian -LIBRARY avkon.lib -LIBRARY aknskins.lib -LIBRARY egul.lib -LIBRARY fbscli.lib -LIBRARY aknicon.lib -// ------------------------- -LIBRARY efsrv.lib -LIBRARY commonengine.lib -LIBRARY bafl.lib -LIBRARY euser.lib -LIBRARY cone.lib -LIBRARY ecom.lib -LIBRARY apparc.lib -LIBRARY apgrfx.lib -LIBRARY calinterimapi.lib -LIBRARY estor.lib -LIBRARY centralrepository.lib -LIBRARY eikcore.lib -LIBRARY imageconversion.lib // image processing -LIBRARY bitmaptransforms.lib // bitmap scaling -// imcache -LIBRARY imcacheclient.lib -// dependency to ximp framework -//LIBRARY ximpdatamodel.lib -LIBRARY presencecacheclient2.lib -//// CCH Library -LIBRARY cch.lib -LIBRARY serviceprovidersettings.lib -//AI3 liw f/w -LIBRARY cputils.lib -LIBRARY liwservicehandler.lib - -LIBRARY flogger.lib -// dependency to service sttings -LIBRARY vimpstsettings.lib - -LIBRARY bsclient.lib // branding server - -LIBRARY xspviewservices.lib -// imcvlauncher -LIBRARY imcvlauncher.lib -// End of File - - diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgetbrandhandler.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetbrandhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* Copyright (c) 2008 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: brand status icons handler - * - * -*/ - - - -#ifndef CSERVICEWIDGETBRANDHANDLER_H -#define CSERVICEWIDGETBRANDHANDLER_H - -#include -#include -#include "servicewidgetenums.hrh" - -// farword declarations -//Forward Declarations -class CBSFactory; -class MBSAccess; -class CSPSettings; -/** - * TODO : Temp solution until homescreenfw support the bitmap and mask publishing - * @since 5.0 - */ - -// class defnitions -class CServiceWidgetBrandHandler : public CBase - { - - friend class Cservicewidgetdatapublisher_ut; - - public: - - /** - * Two-phased constructor. - */ - static CServiceWidgetBrandHandler* NewL(TInt aServiceId ); - - /** - * Two-phased constructor. - */ - static CServiceWidgetBrandHandler* NewLC(TInt aServiceId ); - - /** - * Standard C++ destructor - */ - ~CServiceWidgetBrandHandler(); - - public: - - - /** - * @return bitmap path for status icons - */ - void GetStatusBitmapL(TWSPresenceStatus aIndex, TInt& aBitmapHandle, TInt& aMaskHandle); - - - private: // Implementation - - /** - * Standard C++ constructor - */ - CServiceWidgetBrandHandler(TInt aServiceId ); - - /** - * Load the bitmaps from branding server - * @since S60 5.0 - */ - void LoadBrandingBitmapsL() ; - - /** - * Load the bitmaps from branding server - * @return CGulIcon if sucessfull, else the Null. - * @param aIndex - index of the TWSPresenceStatus enum - * @since S60 5.0 - */ - CGulIcon* LoadBitmapL(TInt aIndex) ; - - /** - * Performs the 2nd phase of construction. - * @param aServiceName, service name - */ - void ConstructL(); - - /** - * Prepares branding access - * @return KErrNone if sucessfull, else the Error. - * @since S60 5.0 - */ - TInt PrepareBrandingAccess(); - - /** - * get the brand info from settings - * @return KErrNone if sucessfull, else the Error. - * @since S60 5.0 - */ - TInt GetBrandInfoL(TLanguage& aBrandLanguage, - TInt &aBrandVersion, TDes8& aBrandId); - - - private: // Data - - // Not own. Settings id of the service.. - const TDesC8& iAppId; - - // Not own. Settings id of the service.. - HBufC8* iBrandId; - - // Not own. Settings id of the service.. - TLanguage iLanguageId; - - //Owns, handle to brnadingfactory. - CBSFactory* iBrandingFactory; - - //Owns, handle to brandaccessor - MBSAccess* iBrandingAccess; - - // owns : service id - TInt iServiceId; - - RPointerArray iBrandIcons; -}; - -#endif /*CSERVICEWIDGETBRANDHANDLER_H*/ diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgetbuddypresence.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetbuddypresence.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2008 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: buddy ,presene status of a user - * -*/ - - -#ifndef CSERVICEWIDGETBUDDYPRESENCE_H -#define CSERVICEWIDGETBUDDYPRESENCE_H - -#include -#include "servicewidgetenums.hrh" - -class CServiceWidgetBuddyPresence : public CBase - { - public : - - /** - * Two-phased constructor. - * @param aBuddyId, friend buddy id - * @param aStatus, buddy presence status - * @return new instance of this class - */ - static CServiceWidgetBuddyPresence* NewL(const TDesC& aBuddyId, TWSPresenceStatus aStatus ); - /** - * Standard C++ destructor - */ - ~CServiceWidgetBuddyPresence(); - - /** - * @return buddy Id - */ - const TDesC& BuddyId(); - - /** - * @return buddy status - */ - TWSPresenceStatus PresenceStatus(); - - /** - * @param aStatus, status to sdet - */ - void SetPresenceStatus( TWSPresenceStatus aStatus ); - private : - /** - * constructor - */ - CServiceWidgetBuddyPresence(TWSPresenceStatus aStatus); - /** - * Performs the 2nd phase of construction. - * @param aServiceName, service name - */ - void ConstructL(const TDesC& aBuddyId ); - private : // data - // Owns : buddy id - HBufC* iBuddyId; - // owns : buddy presence status - TWSPresenceStatus iStatus; - - }; -#endif // CSERVICEWIDGETBUDDYPRESENCE_H \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgetcchhandler.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetcchhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* -* Copyright (c) 2008 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: class for cch service handling - * - * -*/ - - -#ifndef CSERVICEWIDGETCCHHANDLER_H -#define CSERVICEWIDGETCCHHANDLER_H - -#include -#include -#include -#include -#include "servicewidgetcpglobals.h" -#include "servicewidgetenums.hrh" - -// farword declarations -class MServiceWidgetServiceStateObserver; -/** - * @class cch handler class implementation - * @since 5.0 - */ -struct TSubServiceState - { - TCCHSubserviceType iSubServiceType; /* subservice type(IM/VOIP/PRESENCE */ - TSWSTRegistrationState iSubServiceState; /* observer */ - }; - -class CServiceWidgetCchHandler : public CBase, - public MCchServiceStatusObserver - { - - public: - - /** - * Two-phased constructor. - * @param aServiceId, service id - * @param aContentPrioritizer, service state observer - * @return the instance of this class - */ - static CServiceWidgetCchHandler* NewL( TUint32 aServiceId, - MServiceWidgetServiceStateObserver& aContentPrioritizer ); - - /** - * Two-phased constructor. - * @param aServiceId, service id - * @param aContentPrioritizer, service state observer - * @return the instance of this class - */ - static CServiceWidgetCchHandler* NewLC( TUint32 aServiceId, - MServiceWidgetServiceStateObserver& aContentPrioritizer ); - - /** - * Standard C++ destructor - */ - ~CServiceWidgetCchHandler(); - - public: // new methods - - /** - * @return own user id - */ - const TDesC& OwnUserIdL(); - - /** - * @return own user id - */ - TInt XimpAdaptationUidL(); - - /** - * @param aSubServiceType, a sub service type - * @return ETrue if service supported - */ - TBool IsSubServiceSupported(TCCHSubserviceType aSubServiceType ); - - - /** - * read the supported sub service of selected service - */ - void ReadSupportedSubServices(); - - - /** - * mapped the cch state to local state - * @param aState ,cch state - * @return mapped state - */ - TSWSTRegistrationState ParseGetServiceState(); - - /** - * @return tabview id if service installed else NULL - */ - TInt GetServiceViewIdL( TInt& aTabUid ); - - /** - * @returns true if service logged in successfully else KErrNotFound - */ - TInt EnableServiceL( ); - - public: // method from MCchServiceObserver - - /** - * Signaled when service status or error changes - * - * @param aServiceId Id of the service - * @param aType Service type - * @param aServiceStatus Service status - */ - void ServiceStatusChanged(TInt aServiceId, - const TCCHSubserviceType aType, - const TCchServiceStatus& aServiceStatus ); - - private: // Implementation - - /** - * Standard C++ constructor - * @param aServiceId, service id - * @param aContentPrioritizer, service state observer - */ - CServiceWidgetCchHandler(TUint32 aServiceId, - MServiceWidgetServiceStateObserver& aContentPrioritizer ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - /** - * read the own status from the xmmp - * @return the own status - */ - HBufC* GetConParametersL( TCchConnectionParameter aConnParam ); - - /** - * mapped the cch state to local state - * @param aState ,cch state - * @return mapped state - */ - TSWSTRegistrationState GetLocalServiceState(TCCHSubserviceState aState ); - - /** - * @return service state - */ - TSWSTRegistrationState GetServiceState( TCCHSubserviceType aServiceType ); - - /** - * check from cch service - * @param aSubServiceType ,a sub service type - * @return ETrue if supported - */ - TBool IsServiceSupported(TCCHSubserviceType aSubServiceType ); - - private: // Data - //owns : serviceid - TInt iServiceId; - // not owns : reference to state observer - MServiceWidgetServiceStateObserver& iStateObserver; - //owns : reference to cch - CCch* iCchClient; - //owns : own user id - HBufC* iOwnData; - // owns : service name - HBufC* iServiceName; - // owns : xmpp parameters - TSWSTRegistrationState iServiceState; - // does not own array of observers. - RArray iSupportedSubServices; - }; - -#endif /*CSERVICEWIDGETCCHHANDLER_H*/ diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgetcontentpublisher.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetcontentpublisher.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2008 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: class to publish the data into widget - * - * -*/ - - -#ifndef CSERVICEWIDGETCONTENTPUBLISHER_H -#define CSERVICEWIDGETCONTENTPUBLISHER_H - -#include -#include -#include -#include "servicewidgetcpglobals.h" -#include "mservicewidgetobservers.h" - -class MServiceWidgetEventObserver; - -/** - * @class servicewidgetdatapubliser - * @since 5.0 - */ -class CServiceWidgetContentPublisher: public CBase, - public MLiwNotifyCallback - { - - - public: - - /** - * Two-phased constructor. - */ - static CServiceWidgetContentPublisher* NewL(MServiceWidgetEventObserver& aObserver); - - /** - * Two-phased constructor. - */ - static CServiceWidgetContentPublisher* NewLC(MServiceWidgetEventObserver& aObserver); - - /** - * @function ~CServiceWidgetContentPublisher - * @discussion Destroy the object and release all memory objects - */ - ~CServiceWidgetContentPublisher(); - - - - public: - - /** - * publish the text with given details and actions - * @param aPublisherId, publisher id - * @param aInstId, Instance id - * @paramconst aOwnTextToAdd Own text (updated in first row) - * @paramconst aStatusTextToAdd status text (updated in second row) - * @param aBitmapHandle image handle to add - * @param aMaskHandle, image mask handle to add - */ - void PublishDataWithActionL( const TDesC& aPublisherId, - const TDesC& aInstId, - const TDesC& aOwnTextToAdd, - const TDesC& aStatusTextToAdd, - TInt aBitmapHandle, - TInt aMaskHandle, - TInt sericonbitmapHandle, - TInt sericonmaskHandle - ); - - - /** - * Notifies event from widget (from CPS) - * @param aCmdId, cmd id - * @param aEventParamList - * @param aInParamList - */ - virtual TInt HandleNotifyL(TInt aCmdId, TInt /*aEventId*/, - CLiwGenericParamList& aEventParamList, - const CLiwGenericParamList& aInParamList); - - - /** - * Unregister widget from CPS - * @param aPublisherId, publisher id - */ - void UnregisterWidgetL(const TDesC& aPublisherId ); - - /** - * Unregister all widgets from CPS - */ - void UnregisterAllWidgetsL(RArray* aServiceArray); - - /** - * Register widget from CPS - * @param aPublisherId, publisher id - */ - void RegisterWidgetL(const TDesC& aPublisherId, - TInt aBitmapHandle, - TInt aMaskHandle ); - - /** - * Remove data from widget - * @param aPublisherId, publisher id - */ - void RemoveWidgetDataL(const TDesC& aPublisherId,const TDesC& aInstId ); - - private: - - /** - * @function ConstructL - * @discussion Perform the second phase construction of a CServiceWidgetContentPublisher object - * this needs to be public due to the way the framework constructs the AppUi - */ - void ConstructL(); - - /** - *@function CServiceWidgetContentPublisher - * @discussion Perform the first phase of two phase construction. - * This needs to be public due to the way the framework constructs the AppUi - */ - CServiceWidgetContentPublisher(MServiceWidgetEventObserver& aObserver); - - /** - * GetMessagingInterfaceL get interface from liw - */ - MLiwInterface* GetMessagingInterfaceL( ); - - private: // data - - MServiceWidgetEventObserver& iObserver; - // owns : message interface to liw - MLiwInterface* iMsgInterface; - // owns : liw service handler - CLiwServiceHandler* iServiceHandler; - }; - - #endif // CSERVICEWIDGETCONTENTPUBLISHER_H - diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgetimagedecoder.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetimagedecoder.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ -/* -* Copyright (c) 2008 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: presene avatar decoder handler - * - * -*/ - - -#ifndef CSERVICEWIDGETIMAGEDECODER_H -#define CSERVICEWIDGETIMAGEDECODER_H - -#include -#include - -class CImageDecoder; -class CBitmapScaler; -class CFbsBitmap; -class CImageEncoder; - -/** - * decode notification class - * - * @lib servicewidgetdatapublisher.dll - * @since S60 v5.0 - */ - -class MServiceWidgetImagerDecodeObserver - { - public : - /** - * HandlerDecodeComplete notification once decode complete - * @param aBitmap decoded bitmap - * @since S60 v5.0 - * takes the ownership of aBitmap - */ - virtual void HandlerDecodeCompleteL() = 0 ; - - /** - * virtaul Destructor - * @since S60 v5.0 - */ - virtual ~MServiceWidgetImagerDecodeObserver() - { - - } - }; - -/** - * Utility class for asynchronously decoding the header thumbnail image - * - * @lib servicewidgetdatapublisher.dll - * @since S60 v5.0 - */ - -class CServiceWidgetImageDecoder : public CActive - { - enum TSWDEOperationId - { - EOpUnknown = -1, - EOpEncodeBitmap, - EOpComplete - }; -public: - /** - * Two-phased constructor - * - * @param aHeader The header control to which the bitmap is to be inserted after loading - * @param aBitmapData Descriptor containing the bitmap data stream - * @return a instance of same class - * @since S60 v5.0 - */ - static CServiceWidgetImageDecoder* NewL(MServiceWidgetImagerDecodeObserver& aObserver ); - - /** - * Destructor - * @since S60 v5.0 - */ - ~CServiceWidgetImageDecoder(); - - /** - * Starts the decoding process - * @since S60 v5.0 - * @param aBitmapData Descriptor containing the bitmap data stream - * - */ - void StartDecodingL( const TDesC8& aBitmapData ); - - /** - * From CActive - * (see details from baseclass ) - * @since S60 v5.0 - */ - void RunL(); - - /** - * From CActive - * (see details from baseclass ) - * @since S60 v5.0 - */ - void DoCancel(); -private: - /** - * First-phase (C++) constructor - * @param aHeader The header control to which the bitmap is to be inserted after loading - * @since S60 v5.0 - */ - CServiceWidgetImageDecoder(MServiceWidgetImagerDecodeObserver& aObserver); - - /** - * Second phase constructor - * @since S60 v5.0 - */ - void ConstructL(); - - /** - * helper to do encoding - * @since S60 v5.0 - */ - void StartEncodingL(); - - private : // data - - - /** - * Not Owns : notify once complete - */ - MServiceWidgetImagerDecodeObserver& iObserver; - - - /** - * Owns : The image decoder whose service is called to decode the image - */ - CImageDecoder* iImgDecoder; - - /** - * Owns : The image encoder whose service is called to decode the image - */ - CImageEncoder* iImageEncoder; - - /** - * Owns : Handle to the file server session for loading the bitmap - */ - RFs iFs; - - /** - * The bitmap. - * Owned until decoding is complete, then ownersip is transferred to header control. - */ - CFbsBitmap* iBitmap; // owned until completion - - /** - * Owns : Copy of the bitmap data stream - */ - HBufC8* iBitmapData; - - /** - * Owns : Copy of mimeType - */ - HBufC8* iMimeType; - - // next operation to perform - TSWDEOperationId iNextOperationId; - }; - -#endif /*CSERVICEWIDGETIMAGEDECODER_H*/ diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgetmessagehandler.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetmessagehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2008 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: message handler notification - * - * -*/ - - - -#ifndef CSERVICEWIDGETMESSAGEHANDLER_H -#define CSERVICEWIDGETMESSAGEHANDLER_H - -#include -// imcache -#include -#include - -// farword declaration -class MIMCacheAccessor; -class CIMCacheFactory; -class MServiceWidgetNewMessageObserver; - -const TUid KConversationViewAppUid = {0x20012425}; -const TUid KIMPhoneBookUid = {0x101f4cce}; - -/** - * @class im cache message handler class implementation - * @since 5.0 - */ - -class CServiceWidgetMessageHandler : public CBase, - public MIMCacheEventHandler -{ - -public: - - /** - * Two-phased constructor. - * @param aMessageObserver, refernce to content handler - * @param aServiceId, service id to monitor - * @param aOwnUserId, own user id - */ - static CServiceWidgetMessageHandler* NewL(MServiceWidgetNewMessageObserver& aMessageObserver, - TInt aServiceId, - const TDesC& aOwnUserId ); - - /** - * Two-phased constructor. - * @param aMessageObserver, refernce to content handler - * @param aServiceId, service id to monitor - * @param aOwnUserId, own user id - */ - static CServiceWidgetMessageHandler* NewLC(MServiceWidgetNewMessageObserver& aMessageObserver, - TInt aServiceId, - const TDesC& aOwnUserId ); - - /** - * Standard C++ destructor - */ - ~CServiceWidgetMessageHandler(); - -public : // new methods - - /** - * get the unread counts - * @return count - */ - TInt GetUnreadMessageCountL(); - - /** - * get the unread sender - * @return sender - */ - const TDesC& GetUnreadSenderId() ; - - /** check if only one sender or multiple - * @return ETrue or False - */ - TBool IsSingleMessageSender(); - - -public: // from MIMCacheEventHandler - - /** - * Gets called when data update is available. - * Client can then decide wether to use the old one - * or the updated one. - * @param aNewMessage, new message details - */ - void HandleIMCacheEventL(TIMCacheEventType aEvent, TAny* aChatMessage = NULL ) ; - - - -private: // Implementation - - /** - * Standard C++ constructor - */ - CServiceWidgetMessageHandler(MServiceWidgetNewMessageObserver& aMessageObserver ); - - /** - * Performs the 2nd phase of construction. - * @param aOwnUserId, user id - */ - void ConstructL( const TDesC& aOwnUserId, TInt aServiceId ); - - /** - * serach the given id in array - * @param aNewSenderId, sender user id - * @return ETrue if found - */ - TBool IsExistInSendersArrayL( const TDesC& aNewSenderId ) ; - - /** - * synchronized the senders array by deleting the sender - * which is not having any unread message - */ - void SynchronizeSendersArrayL() ; - - /* - * plays the msg tone for incoming messages - * - */ - void PlayMsgAlertToneL(); - -private: // Data - // not owns , reference to contententpritizer - MServiceWidgetNewMessageObserver& iMessageObserver; - // owns : im cache accessor - MIMCacheAccessor* iAccessor; - //owns : im cache factory - CIMCacheFactory* iIMCacheFactory; - // owns : sender is unique or multiple sender - RPointerArray iSendersArray; -}; - -#endif /*CSERVICEWIDGETMESSAGEHANDLER_H*/ - diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgetplugin.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetplugin.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ -/* -* Copyright (c) 2008 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: This is a plugin implementation - * - * -*/ - -#ifndef CSERVICEWIDGETPLUGIN_H -#define CSERVICEWIDGETPLUGIN_H - -//content harvester -#include -#include -#include -//#include -#include "mservicewidgetobservers.h" -#include -// FORWARD DECLARATIONS -class CServiceWidgetServiceManager; -class CServiceWidgetContentPublisher; -class CCoeEnv; -class MVIMPSTSettingsStore; -class CSPNotifyChange; - -/** - * - * Plugin implementation - * - * @servicewidgetdatapublisher.dll - * @since S60 5.0 - */ - -class CServiceWidgetPlugin : public CContentHarvesterPlugin, - public MSPNotifyChangeObserver, - public MServiceWidgetEventObserver//, - //public MAiPropertyExtension - { - friend class Cservicewidgetdatapublisher_ut; - public: - - /** - * Two-phased constructor. - * @return the instance of same class - */ - static CServiceWidgetPlugin* NewL(); - - /** - * Standard C++ destructor - */ - ~CServiceWidgetPlugin(); - - - private: - - /** - * Standard C++ constructor - */ - CServiceWidgetPlugin(); - - /** - * 2phase construction - */ - void ConstructL(); - - /** - * helper method for reading the service ids from cspsettings - */ - void ReadServiceIdsL(); - /** - * helper method for reading resource file - */ - void LoadResourceFileL(); - /** - * helper method for validating Service and creating/deleting service managers - * as per service - */ - void ValidateAllServicesL(); - - public : //CContentHarvesterPlugin - /** - * Triggers update process. - * all the operation must start here - */ - void UpdateL() ; - - public : // from MSPNotifyChangeObserver - - /** - * From MSPNotifyChangeObserver - * Callback when service has changed - * - * @since S60 5.0 - * @param aServiceId changed service - * @return None - */ - void HandleNotifyChange( TServiceId aServiceId ); - - /** - * From MSPNotifyChangeObserver - * Callback when service error occures - * - * @since S60 5.0 - * @param aError error code - * @return None - */ - void HandleError( TInt aError ); - - public: // from MServiceWidgetEventObserver - /** - * @param aPublisherId publisher id for Theme (it is service name). - * @param aEvent Event name (i.e. Active,Suspend,Resume,Deactivate,Selected) - *This function handles all homescreen callbacks (publisher received callback events - * from homescreen and direct them to plugin to take appropriate action.) - */ - void HandleServiceEventL(const TDesC& aPublisherId, const TDesC8& aEvent,TDesC& aInstId ); - - public: //From MAiPropertyExtension. - /** - * From MAiPropertyExtension. - * Read property of publisher plug-in. - * - * @param aProperty - identification of property. - * @return pointer to property value. - */ - //TAny* GetPropertyL( TInt aProperty ); - - /** - * From MAiPropertyExtension. - * Write property value. - * - * @param aProperty - identification of property. - * @param aValue - contains pointer to property value. - */ - //void SetPropertyL( TInt aProperty, TAny* aValue ); - - - private: // Data members - // owns : content publishing client to hsps - CServiceWidgetContentPublisher* iContentPublisher; - // owns : list of all service ids interested in service tab - RArray iServiceIds; - // owns : content prioritizer - RPointerArray iServiceManagers; - // Not owns : A static CEikonEnv - CCoeEnv* iEnv; - // owns : a resource offset - TInt iResourceOffset; - // owns, retrive settings from cenrep store - MVIMPSTSettingsStore* iSettingsStore; - // Own: service observer - CSPNotifyChange* iSpNotifyChange; - // Information about the content publisher (this plug-in) - //TAiPublisherInfo iInfo; - }; - -#endif // CSERVICEWIDGETPLUGIN_H -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgetpresencehandler.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetpresencehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,242 +0,0 @@ -/* -* Copyright (c) 2008 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: presene status handler - * - * -*/ - - -#ifndef CSERVICEWIDGETPRESENCEHANDLER_H -#define CSERVICEWIDGETPRESENCEHANDLER_H - -#include -#include // buddy info class -#include //Presence info test -#include // handling the presence cache events -#include -#include "servicewidgetenums.hrh" - -// farword declarations -class MXIMPContext; -class MXIMPClient; -class MPresenceCacheReadHandler2; -class MServiceWidgetPresenceObserver; -class CActiveSchedulerWait; -class MXIMPBase; -class MPresenceFeatures; -class CServiceWidgetBuddyPresence; -class CFbsBitmap; - -// class defnitions -class CServiceWidgetPresenceHandler : public CBase, - public MXIMPContextObserver, - public MPresenceCacheReadHandler2 - -{ -public: - - /** - * Two-phased constructor. - * @param aPresenceObserver, prsence observer - * @param aServiceName, service name - */ - static CServiceWidgetPresenceHandler* NewL( MServiceWidgetPresenceObserver& aPresenceObserver, - const TDesC& aServiceName, - const TDesC& aOwnId ); - - /** - * Two-phased constructor. - * @param aPresenceObserver, prsence observer - * @param aServiceName, service name - */ - static CServiceWidgetPresenceHandler* NewLC( MServiceWidgetPresenceObserver& aPresenceObserver, - const TDesC& aServiceName, - const TDesC& aOwnId ); - - /** - * Standard C++ destructor - */ - ~CServiceWidgetPresenceHandler(); - - public: - - /** - * @return online counts - */ - TInt OnlineBuddyCount(); - - /** - * @return all friend count - */ - TInt AllBuddyCount(); - - /** - * @return all inviations count - */ - TInt GetInviteCounts(); - - /** - * @return on going operation id - */ - TWServiceOperationId GetOngoingOperationId(); - - /** - * get the connected session - * @param aProtocolUid, protocal to use - * @param aServiceId, service id to use - */ - void GetConnectedSessionL(TInt aProtocolUid, - TInt aServiceId ); - - /** - * release the connected session - */ - void ReleaseConnectionL(); - - /** - * release the connected session - */ - TWSPresenceStatus GetOwnStatus(); - - - private : // from MXIMPContextObserver - /** - * HandleximpContextEvent method from context obsrver - * ximp framework - * @param aContext - * @param aEvent, event - */ - void HandlePresenceContextEvent(const MXIMPContext& aContext, - const MXIMPBase& aEvent ); - - private: // from prescachereadhandler - /** - * Handler for AllBuddiesPresenceInService method of MPresenceCacheReader. - * - * @param aErrorCode - * @param aPresenceBuddyInfoList presence infos for all buddies requested. - * Ownership of elements to callee. Can be empty if not found. - */ - void HandlePresenceReadL(TInt aErrorCode, - RPointerArray& aPresenceBuddyInfoList) ; - - /** - * Handler for Buddy presence change notifications. - * - * @param aErrorCode - * @param aPresenceBuddyInfo presence info for buddy. - * Ownership to callee. Can be NULL if aErrorCode exist. - */ - void HandlePresenceNotificationL(TInt aErrorCode, - MPresenceBuddyInfo2* aPresenceBuddyInfo); - -private: // Implementation - - /** - * Standard C++ constructor - */ - CServiceWidgetPresenceHandler( MServiceWidgetPresenceObserver& aPresenceObserver ); - - /** - * Performs the 2nd phase of construction. - * @param aServiceName, service name - */ - void ConstructL(const TDesC& aServiceName, const TDesC& aOwnId ); - - - /** - * subsribe the presence change notification - */ - void RetrieveSubscribedListL(); - - /** - * subsribe the presence change notification - */ - void SubscribeForAuthorizationL(); - - /** - * subsribe the presence change notification - * @param aUserId, user to use - */ - void SubscribePresenceL( const TDesC& aUserId ); - - /** - * read buddy presence from cache - */ - void ReadPresenceFromCacheL(); - - /** - * helper method for bind complete - */ - void DoHandleBindCompleteL(); - - /** - * helper method buddy fetch event - * @param aEvent, group list event - */ - void DoHandlePresentityGroupContentEventL( const MXIMPBase& aEvent ); - - /** - * helper method friend request fetch event - * @param aEvent, grand list event - */ - void DoHandlePresenceGrantRequestListEventL( const MXIMPBase& aEvent ); - - /** - * helper method for converting ximpstatus to local status - * @param aAvailabilityEnum, availability of contact - */ - TWSPresenceStatus ConvertPresenceCacheEnums(MPresenceBuddyInfo2::TAvailabilityValues aAvailabilityEnum,TPtrC aAvabilityText); - - /** - * method for maitain the unique information about status - * @param aUserId, a user id of contact - * @param aStatus, status of contact - */ - void CheckAndCacheBuddyAvailabilityL( const TDesC& aUserId, TWSPresenceStatus aStatus ); - -private: // Data - - // not owns : reference to presence observer for notification - MServiceWidgetPresenceObserver& iPresenceObserver; - // owns : service name - HBufC* iServiceName; - // owns : own user id - HBufC* iOwnUserId; - // not own - TInt iServiceId; - // own , client for presence framework - MXIMPClient* iClient; - // own ,presence context to prsence framework - MXIMPContext* iPresenceCtx; - //Stores the XIMPFw EventTypes Subscribed for - RArray< TInt32 > iAcceptedEventTypes; - //owns : reference to presence cache reader - MPresenceCacheReader2* iPresenceCacheReader; - // owns : total budy count - TInt iTotalCount; - // owned pointer to presence plugin - MPresenceFeatures* iFeatures; - // own : current ongoing operation - TWServiceOperationId iOperationId; - // owns : list of presence buddy - RPointerArray iOnlineBuddyArray; - // owns : own status - TWSPresenceStatus iOwnStatus; - // owns : invitation count - TInt iInvitationCount; - -}; - -#endif /*CSERVICEWIDGETPRESENCEHANDLER_H*/ diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgetservicemanager.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgetservicemanager.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,305 +0,0 @@ -/* -* Copyright (c) 2008 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: service manager for a specific service - * - * -*/ - - - -#ifndef CSERVICEWIDGETSERVICEMANAGER_H -#define CSERVICEWIDGETSERVICEMANAGER_H - -#include -#include -#include "mservicewidgetobservers.h" -#include "servicewidgetcpglobals.h" - -class CServiceWidgetContentPublisher; -class CServiceWidgetPresenceHandler; -class CServiceWidgetCchHandler; -class CServiceWidgetMessageHandler; -class CServiceWidgetTimer; -class CCoeEnv; -class CServiceWidgetBrandHandler; -class MVIMPSTSettingsStore; -/** - * - * content harvester plugin - * layout Description of servicewidgetplugin and numbering of boxes - * - * ------------------------------------- - * | 1 A | User ( Offline ) |offline| Text Row 1 - * | V | 2 |icon 3 | - * | A |---------------------------- - - * | T | n new message | if nothing display "click to online" - * | AR | or n online friends 4 | Text Row 2 - * ------------------------------------- - * new message has higher priority than friends invite - * friends invite has higher priority than n online user - * any fried come online show for x second and go to back again - * - * @lib servicewidgetplugin - * @since S60 3.2 - */ - -class CServiceWidgetServiceManager : public CBase, - public MServiceWidgetNewMessageObserver, - public MServiceWidgetPresenceObserver, - public MServiceWidgetServiceStateObserver, - public MServiceWidgetTimerObserver - { - public: - - // to change priority , rearange this - enum TIMWidgetContentPriority - { - EIMUknown = -1, // no priority - EIMNewMessage = 0, // highest priority - EIMFriendInvite, - EIMPresence, // lowest priority - }; - - - /** - * Two-phased constructor. - * @param aServiceId, a service id - * @param aContentPublisher, content publisher reference - * @param aSettingStore, reference to settings store - * @return the instance of same class - */ - static CServiceWidgetServiceManager* NewL(TUint32 aServiceId, - CServiceWidgetContentPublisher& aContentPublisher, - MVIMPSTSettingsStore& aSettingStore ); - - - /** - * Standard C++ destructor - */ - ~CServiceWidgetServiceManager(); - - -public : // new method - - - /** - * update the content in widgets - */ - void UpdateContentsL(); - /** - * Returns the service ID for which Service Manager is created - */ - TInt ServiceId(); - - /** - * Unregisters widget when service is deleted - */ - void UnregisterWidgetL(); - - /** - * Registers widget when service is installed - */ - void RegisterWidgetL(); - - /** - * Returns the service Name for which Service Manager is created - */ - const TDesC& ServiceName(); - - /** - * Intialize all objects once widget is Activated on Home Screen - */ - void ActivateWidgetL(TDesC& aInstId); - /** - * destroy all objects once widget is deactivated from Home Screen - */ - void DeactivateWidgetL(TDesC& aInstId); - /** - *Executes action based on iExecuteOperation - */ - - void ExecuteActionL(); - - -public : // MServiceWidgetContentPrioritizer - /** - * from MServiceWidgetNewMessageObserver - * Gets called when data update is available as new messgae recieved. - * Client can then decide wether to use the old one - * or the updated one. - * @param aSenderId, sender name - * @param aMessageText, new message details - */ - void HandleNewMessageL(const TDesC& aSenderId , - const TDesC& aMessageText ) ; - - /** - * from MServiceWidgetNewMessageObserver - * im cache call back - * @param aState service state - */ - void HandleCountChangedL(); - - /** - * from MServiceWidgetPresenceObserver - * Handler for own status change notification - */ - void HandleOwnStatusChangeL(TWSPresenceStatus aStatus) ; - - /** - * from MServiceWidgetPresenceObserver - * Handler for AllBuddiesPresenceInService method of MPresenceCacheReader. - * @param aErrorCode - * @param aPresenceBuddyInfoList presence infos for all buddies requested. - * Ownership to callee. Can be null if not found. - */ - void HandleChangeL() ; - - /** - * from MServiceWidgetPresenceObserver - * Handler for AllBuddiesPresenceInService method of MPresenceCacheReader. - * @param aErrorCode - * @param aPresenceBuddyInfoList presence infos for all buddies requested. - * Ownership to callee. Can be null if not found. - */ - void HandleBuddyPresenceChangeL( const TDesC& aBuddyId, - TWSPresenceStatus aStatus, - const TDesC& aStatusText ); - - /** - * from MServiceWidgetPresenceObserver - * Gets called when data update is available as new messgae recieved. - * Client can then decide wether to use the old one - * or the updated one. - * @param aSenderId, sender name - * @param aMessageText, new message details - */ - void HandleAddRequestL(const TDesC& aRequesterId ) ; - - - /** - * from MServiceWidgetServiceStateObserver - * Handler cch server - * @param aState service state - */ - void HandleServiceStatusChangedL(TSWSTRegistrationState aState) ; - - /** - * from MServiceWidgetTimerObserver - * timer expiration call back - * @param aState service state - */ - void HandleTimerExpiredL(); - - /** - * WidgetSuspended - * @param aIsWidgetSuspended True - widget is suspended on Homescreen - * False - Widget is active - */ - void WidgetSuspended( TBool aIsWidgetSuspended ); - - - private: - /** - * Constructor - * @param aServiceId, a service id - * @param aContentPublisher, content publisher reference - * @param aSettingStore, reference to settings store - */ - CServiceWidgetServiceManager(TUint32 aServiceId, - CServiceWidgetContentPublisher& aContentPublisher, - MVIMPSTSettingsStore& aSettingStore ); - - /** - * provides the two phase construction - */ - void ConstructL(); - - /** - * load the resource file in memory for use - */ - void LoadResourceFileL(); - - - /** - * read and set the current data - */ - void SetCurrentTextDataL(); - - /** - * create the second row data - * @return created text : ownership transfer to caller - */ - HBufC* GetSecondRowDataLC() ; - - /** - * create all handlers if service enable - * delete all handlers if service loggedoff - * @param aState service state - */ - void CreateHandlersL(); - - - /** - * reset the priority to zero - */ - inline void ResetPriority() - { - iPriority = 0 ; - } - - - private : - // owns : service id - TInt iServiceId; - //not owns : Publisher client - CServiceWidgetContentPublisher& iContentPublisher; - //not owns : settings store - MVIMPSTSettingsStore& iSettingStore; - // owns : cch handler - CServiceWidgetCchHandler* iCchHandler; - // owns : presence handler - CServiceWidgetPresenceHandler* iPresenceHandler; - // owns : message handler - CServiceWidgetMessageHandler* iMessageHandler; - // owns : current priority for second row box - TInt iPriority; - // owns : service state - TSWSTRegistrationState iServiceState; - // owns : timer - CServiceWidgetTimer* iWidgetTimer; - // owns : - TSWAExecuteOperation iExecuteOperation; - //owns : brand icons - CServiceWidgetBrandHandler* iBrandHandler; - // Not owns : A static CEikonEnv - CCoeEnv* iEnv; - //tabview id for the service - TInt iServiceviewId; - //owns : service Name - HBufC* iServiceName; - // ETrue if widget is suspended - TBool iIsWidgetSuspended; - - //Widget InstanceId - HBufC* iInstId; - // Service tab UID from spsettings - TInt iServiceTabUid; - }; - -#endif // CSERVICEWIDGETSERVICEMANAGER_H - - -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/cservicewidgettimer.h --- a/servicewidget/servicewidgetdatapublisher/inc/cservicewidgettimer.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2008 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: Event listener implementation presence -* -*/ - - -#ifndef CSERVICEWIDGETTIMER_H -#define CSERVICEWIDGETTIMER_H - -#include - -// forward declaration -class MServiceWidgetTimerObserver; -// class declaration - -/** - * @class timer class - * @since 5.0 - */ - -class CServiceWidgetTimer : public CActive - { -public : - // Constructor - /** - * Creates a new CServiceWidgetTimer. - * @param aObserver, reference to timer - * @return New instance of this class - */ - static CServiceWidgetTimer* NewL(MServiceWidgetTimerObserver& aObserver ); - - /** - * Standard C++ destructor. - */ - ~CServiceWidgetTimer(); - - /** - * start listening - * @param a time interval - */ - void StartListening(TTimeIntervalMicroSeconds32 anInterval); - - - /** - * stop listening - */ - void StopListening(); - -private : // From CActive - - /** - * RunL - */ - void RunL(); - - /** - * DoCancel - */ - void DoCancel(); - - -private: // Implementation - - /** - * Standard C++ constructor - * @param aObserver, reference to timer - */ - CServiceWidgetTimer(MServiceWidgetTimerObserver& aObserver ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - -private : - - // not owns : reference to contact update observer - MServiceWidgetTimerObserver& iObserver; - - /** - * owns : timer to trigger message queue uptation checking - */ - RTimer iTimer; - - }; - -#endif /*CSERVICEWIDGETTIMER_H*/ - -//end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/mservicewidgetobservers.h --- a/servicewidget/servicewidgetdatapublisher/inc/mservicewidgetobservers.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -/* -* Copyright (c) 2008 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: all observer classes -* -*/ - - -#ifndef MSERVICEWIDGETOBSERVERS_H -#define MSERVICEWIDGETOBSERVERS_H - -#include -#include "servicewidgetenums.hrh" -/** - * - * Observer interface for messages handler - * @dll servicewidgetplugin - * @since S60 5.0 - */ - -class MServiceWidgetNewMessageObserver - { - public: - /** - * Gets called when data update is available as new messgae recieved. - * Client can then decide wether to use the old one - * or the updated one. - * @param aSenderId, sender id - * @param aMessageText, new message details - */ - virtual void HandleNewMessageL(const TDesC& aSenderId ,const TDesC& aMessageText ) = 0 ; - - /** - * unread message change notification - * Client can then decide wether to use the old one - */ - virtual void HandleCountChangedL() = 0 ; - - - protected : - /** - * virtual destructor - */ - virtual ~MServiceWidgetNewMessageObserver() - { - - } - - - }; - -/** - * - * Observer interface for presence handler - * @dll servicewidgetplugin - * @since S60 5.0 - */ -class MServiceWidgetPresenceObserver - { - public: - - /** - * Handler for own status change notification - */ - virtual void HandleOwnStatusChangeL(TWSPresenceStatus aStatus ) = 0; - - /** - * Handler for AllBuddiesPresenceInService method of MPresenceCacheReader. - * - * @param aErrorCode - * @param aPresenceBuddyInfoList presence infos for all buddies requested. - * Ownership to callee. Can be null if not found. - */ - virtual void HandleChangeL( ) = 0 ; - - /** - * from MServiceWidgetPresenceObserver - * Handler for AllBuddiesPresenceInService method of MPresenceCacheReader. - * @param aErrorCode - * @param aPresenceBuddyInfoList presence infos for all buddies requested. - * Ownership to callee. Can be null if not found. - */ - virtual void HandleBuddyPresenceChangeL(const TDesC& aBuddyId, - TWSPresenceStatus aStatus, - const TDesC& aStatusText ) = 0 ; - /** - * Gets called when data update is available as new messgae recieved. - * Client can then decide wether to use the old one - * or the updated one. - * @param aSenderId, sender name - * @param aMessageText, new message details - */ - virtual void HandleAddRequestL(const TDesC& aRequesterId ) = 0 ; - - - protected : - /** - * virtual destructor - */ - virtual ~MServiceWidgetPresenceObserver() - { - - } - - -}; - - /** - * - * Observer interface for session state handler - * @dll servicewidgetplugin - * @since S60 5.0 - */ -class MServiceWidgetServiceStateObserver - { - public: - - /** - * Handler for service state changes - * param aState, service state - */ - virtual void HandleServiceStatusChangedL( TSWSTRegistrationState aState) = 0; - - protected : - /** - * virtual destructor - */ - virtual ~MServiceWidgetServiceStateObserver() - { - - } - - }; - -/** - * - * Observer interface for timer - * @dll servicewidgetplugin - * @since S60 5.0 - */ -class MServiceWidgetTimerObserver - { - public: - /** - * Handler for timer expiration - */ - virtual void HandleTimerExpiredL() = 0 ; - - - protected : - /** - * virtual destructor - */ - virtual ~MServiceWidgetTimerObserver() - { - - } - - - }; - -/** - * - * Observer interface for handling ai foreground event - * @dll servicewidgetplugin - * @since S60 5.0 - */ - -class MServiceWidgetEventObserver - { - public: - - /** - * Handler for timer ai foreground event - */ - virtual void HandleServiceEventL(const TDesC& aPublisherId, const TDesC8& aEvent,TDesC& aInstId ) = 0 ; - - - protected : - /** - * virtual destructor - */ - virtual ~MServiceWidgetEventObserver() - { - - } - - }; -#endif // MSERVICEWIDGETOBSERVERS_H - - -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/inc/servicewidgetutils.h --- a/servicewidget/servicewidgetdatapublisher/inc/servicewidgetutils.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2008 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: utils class -* -*/ - - -#ifndef SERVICEWIDGETUTILS_H -#define SERVICEWIDGETUTILS_H - -// INCLUDES -#include - -class CCoeEnv; - -/** - * Utils for imwidget modules. - * @lib imwidgetdatapublisher.dll - * @since 5.0 - */ -class ServiceWidgetUtils - { - public: // new methods - - /** - * Used for removing the domain part from the user id - * @param aId The id to process - * @param aDomainHiding, is list hiding. - * @return TPtrC The id without the domain part - */ - static TPtrC DisplayId( const TDesC& aId, - TBool aDomainHiding = ETrue ); - - /** - * used to load the resource and - * @param aResourceId The id to read - * @return push onto cleanup stack HBufC* The string for given resource id - */ - static HBufC* LoadResourceLC( TInt aResourceId, - CCoeEnv* aEnv = NULL ); - - /** - * used to load the resource - * @param aResourceId The id to read - * @param aText %U string. - * @return , push onto cleanup stack HBufC* The string for given resource id - */ - static HBufC* LoadResourceLC( TInt aResourceId , - const TDesC& aText, - CCoeEnv* aEnv = NULL ); - - /** - * used to load the resource - * @param aResourceId The id to read - * @param aInt %N integer value to append - * @return , push onto cleanup stack HBufC* The string for given resource id - */ - static HBufC* LoadResourceLC( TInt aResourceId , - TInt aInt, - CCoeEnv* aEnv = NULL ); - - /** - * used to load the resource - * @param aResourceId The id to read - * @param aInts array of integer, %0N,%1N integer array. - * @param aEnv, a pointer to enviroment - * @return , push onto cleanup stack HBufC* The string for given resource id - */ - static HBufC* LoadResourceLC( TInt aResourceId , - const CArrayFix& aInts, - CCoeEnv* aEnv = NULL ); - - }; - -#endif // SERVICEWIDGETUTILS_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/rss/servicewidgetdatapublisher.rss --- a/servicewidget/servicewidgetdatapublisher/rss/servicewidgetdatapublisher.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2008 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: plugin resource files - * -*/ - - -// INCLUDES -#include "servicewidgetpluginuids.hrh" -#include -#include - -// RESOURCE DEFINITIONS -// ----------------------------------------------------------------------------- -// -// registry_info -// ?description -// -// ----------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO registry_info - { - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = AI_UID_DLL_SERVICEWIDGETPUBLISHER_PLUGIN; // service widget plugin UID - // Interface info array - interfaces = - { - INTERFACE_INFO - { - // UID of the implemented interface - interface_uid = KContentHarvesterPluginUid; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = AI_UID_DLL_SERVICEWIDGETPUBLISHER_PLUGIN; - version_no = 1; - display_name = "servicewidget"; // not used yet...will have localized string in future releases... - default_data = " "; - opaque_data = " "; - } - }; - } - }; -} - - -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/rss/servicewidgetpluginres.rss --- a/servicewidget/servicewidgetdatapublisher/rss/servicewidgetpluginres.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,248 +0,0 @@ -/* -* Copyright (c) 2008 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: resource files - * -*/ - - -#include -#include -#include -#include -#include -#include - -#include - -NAME IVSW // im voip service widget - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF { buf=""; } - -//---------------------------------------------------- -// r_qtn_servtab_widget_onlinestatus -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_onlinestatus -{ - buf = qtn_servtab_widget_onlinestatus; -} - - -//---------------------------------------------------- -// r_qtn_servtab_widget_friend -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_friend -{ - buf = qtn_servtab_widget_friend; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_newmsgs -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_newmsgs -{ - buf = qtn_servtab_widget_newmsgs; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_onenewmsg -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_onenewmsg -{ - buf = qtn_servtab_widget_onenewmsg; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_pendreq -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_pendreq -{ - buf = qtn_servtab_widget_pendreq; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_onependreq -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_onependreq -{ - buf = qtn_servtab_widget_onependreq; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_invite -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_invite -{ - buf = qtn_servtab_widget_invite; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_connecting -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_connecting -{ - buf = qtn_servtab_widget_connecting; -} -//---------------------------------------------------- -// r_qtn_servtab_widget_loggingout -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_loggingout -{ - buf = qtn_servtab_widget_loggingout; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_login -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_login -{ - buf = qtn_servtab_widget_login; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_updating -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_updating -{ - buf = qtn_servtab_widget_updating; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_status -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_status -{ - buf = qtn_servtab_widget_status; -} -//---------------------------------------------------- -// r_qtn_servtab_widget_online -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_online -{ - buf = qtn_servtab_widget_online; -} -//---------------------------------------------------- -// r_qtn_servtab_widget_offline -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_offline -{ - buf = qtn_servtab_widget_offline; -} -//---------------------------------------------------- -// r_qtn_servtab_widget_invisible -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_invisible - { - buf = qtn_servtab_widget_invisible; - } -//---------------------------------------------------- -// r_qtn_servtab_widget_away -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_away -{ - buf = qtn_servtab_widget_away; -} -//---------------------------------------------------- -// r_qtn_servtab_widget_busy -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_busy -{ - buf = qtn_servtab_widget_busy; -} - -//---------------------------------------------------- -// r_qtn_servtab_widget_dnd -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_dnd - { - buf = qtn_servtab_widget_dnd; - } -//---------------------------------------------------- -// r_qtn_servtab_widget_onthephone -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_onthephone - { - buf = qtn_servtab_widget_onthephone; - } - -//---------------------------------------------------- -// r_qtn_servtab_widget_available -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_available - { - buf = qtn_servtab_widget_available; - } - - //---------------------------------------------------- -// r_qtn_servtab_widget_waiting -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_waiting - { - buf = qtn_servtab_widget_waiting; - } - -//---------------------------------------------------- -// r_qtn_servtab_widget_servdesc -// -//---------------------------------------------------- -// -RESOURCE TBUF r_qtn_servtab_widget_servdesc - { - buf = qtn_servtab_widget_servdesc ; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgetbrandhandler.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetbrandhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,288 +0,0 @@ -/* -* Copyright (c) 2008 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: brand status icons handler - * - * -*/ - - -#include "cservicewidgetbrandhandler.h" - -#include "servicewidgetcpglobals.h" -#include "swpdebugtrace.h" -// branding server -#include -#include -#include -#include -//icons -#include -#include -#include -#include -#include -#include - -#include "conversations.h" - -_LIT8(KAppIdForBrand,"xsp"); -_LIT8(KDefaultBrandIdForBrand,"xsp"); - -// Taken as conversation.h gile doesn't have it. -_LIT8( KEMbmConversationsQgnDefaultImage, "default_brand_image"); - -// --------------------------------------------------------------------------- -// CServiceWidgetBrandHandler::CServiceWidgetBrandHandler -// --------------------------------------------------------------------------- -// -CServiceWidgetBrandHandler::CServiceWidgetBrandHandler(TInt aServiceId ): - iAppId(KAppIdForBrand), - iServiceId( aServiceId ) - { - TRACE_SWP(TXT("CServiceWidgetBrandHandler::CServiceWidgetBrandHandler()") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetBrandHandler::NewL -// --------------------------------------------------------------------------- -// -CServiceWidgetBrandHandler* CServiceWidgetBrandHandler::NewL(TInt aServiceId ) - { - TRACE_SWP(TXT("CServiceWidgetBrandHandler::NewL() start" ) ); - CServiceWidgetBrandHandler* self = NewLC(aServiceId); - CleanupStack::Pop(self); - TRACE_SWP(TXT("CServiceWidgetBrandHandler::NewL() end" ) ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetBrandHandler::NewLC -// --------------------------------------------------------------------------- -// -CServiceWidgetBrandHandler* CServiceWidgetBrandHandler::NewLC(TInt aServiceId) - { - TRACE_SWP(TXT("CServiceWidgetBrandHandler::NewLC() start" ) ); - CServiceWidgetBrandHandler* self = - new (ELeave) CServiceWidgetBrandHandler(aServiceId); - CleanupStack::PushL(self); - self->ConstructL(); - TRACE_SWP(TXT("CServiceWidgetBrandHandler::NewLC() end" ) ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetBrandHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CServiceWidgetBrandHandler::ConstructL() - { - iBrandId = HBufC8::NewL( KSW_RESOURCE_MAX_LENGTH ); - TPtr8 brandIdPtr( iBrandId->Des() ); - TInt version = 1 ; // default - - iLanguageId = ELangInternationalEnglish; - GetBrandInfoL(iLanguageId, version, brandIdPtr); - - iBrandingFactory = CBSFactory::NewL( KDefaultBrandIdForBrand, iAppId ); - - // Leaves if no brand for service, therefore trap - PrepareBrandingAccess(); - - LoadBrandingBitmapsL(); - } - - // --------------------------------------------------------- -// CServiceWidgetBrandHandler::GetBrandInfo -// -// --------------------------------------------------------- -TInt CServiceWidgetBrandHandler::GetBrandInfoL(TLanguage& aBrandLanguage, - TInt &aBrandVersion, TDes8& aBrandId) - - { - CSPSettings* settings = CSPSettings::NewLC(); - - ////////////// brand id///////////////////// - CSPProperty* property = CSPProperty::NewLC(); - settings->FindPropertyL( iServiceId, - EPropertyBrandId, - *property ); - if ( property ) - { - HBufC* brandId = HBufC::NewLC( 100 ); - TPtr brandIdPtr( brandId->Des() ); - property->GetValue( brandIdPtr ); - aBrandId.Copy(brandIdPtr); - CleanupStack::PopAndDestroy( brandId ); - } - CleanupStack::PopAndDestroy( property ); - - /////////// langauge ////////////////// - TInt language = ELangInternationalEnglish; - property = CSPProperty::NewLC(); - settings->FindPropertyL( iServiceId, - EPropertyBrandLanguage, - *property ); - if ( property ) - { - property->GetValue( language ); - } - CleanupStack::PopAndDestroy(property); - aBrandLanguage = ( TLanguage) language; - - /////////// version //////////////// - property = CSPProperty::NewLC(); - settings->FindPropertyL( iServiceId, - EPropertyBrandVersion, - *property ); - if ( property ) - { - property->GetValue( aBrandVersion ); - } - CleanupStack::PopAndDestroy( property ); - ////////////////////////////////////// - CleanupStack::PopAndDestroy( settings ); - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetBrandHandler::PrepareBrandingAccess() -// --------------------------------------------------------------------------- -// -TInt CServiceWidgetBrandHandler::PrepareBrandingAccess() - { - TRAPD(err, iBrandingAccess = iBrandingFactory->CreateAccessL( *iBrandId, iLanguageId )); - return err; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetBrandHandler::~CServiceWidgetBrandHandler -// --------------------------------------------------------------------------- -// -CServiceWidgetBrandHandler::~CServiceWidgetBrandHandler() - { - TRACE_SWP(TXT("CServiceWidgetBrandHandler::~CServiceWidgetBrandHandler() start" ) ); - - iBrandIcons.ResetAndDestroy(); - if(iBrandingAccess) - { - iBrandingAccess->Close(); - } - delete iBrandingFactory; - delete iBrandId; - TRACE_SWP(TXT("CServiceWidgetBrandHandler::~CServiceWidgetBrandHandler() end" ) ); - } - -// ----------------------------------------------------------------------------- -// CServiceWidgetBrandHandler::LoadBrandBitmapL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// - -void CServiceWidgetBrandHandler::LoadBrandingBitmapsL() - { - CGulIcon* gulIcon = NULL ; - //Fetching bitmaps from the server. - if(!iBrandingAccess) - { - PrepareBrandingAccess(); - } - - // EWSonline has to be at 0th in enums - for(TInt index = EWSOnline; index < EWSLast; index++ ) - { - gulIcon = LoadBitmapL(index) ; - iBrandIcons.Append(gulIcon) ; - } - } - -CGulIcon* CServiceWidgetBrandHandler::LoadBitmapL(TInt aIndex) - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - CGulIcon* gulIcon = NULL ; - - switch(aIndex) - { - case EWSOnline: - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnpropimfriendon, bitmap, mask); - break; - case EWSAway: - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnpropimfriendaway, bitmap, mask); - break; - case EWSbusy: - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnpropimfriendbusy, bitmap, mask); - break; - case EWSDoNotDisturb: - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnpropimfriendbusy, bitmap, mask); - break; - case EWSOffline: - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnpropimfriendoff, bitmap, mask); - break; - case EWSOnPhone: - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnpropimfriendonmobile, bitmap, mask); - break; - case EWSBlocked: - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnpropimuserblocked, bitmap, mask); - break; - case EWSNewMessage: - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnpropimimsgnew, bitmap, mask); - break; - case EWSServiceIcon: - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnDefaultImage, bitmap, mask); - break; - case EWSInvisible: // show offline icon for invisible state - iBrandingAccess->GetBitmapL(KEMbmConversationsQgnpropimfriendoff, bitmap, mask); - break; - } - - if(bitmap && mask) - { - CleanupStack::PushL(bitmap); - CleanupStack::PushL(mask); - // to solve the handle zero issue - TSize size ; - AknIconUtils::GetContentDimensions(bitmap, size); - if ( aIndex == EWSServiceIcon ) - { - size.iWidth = 200; - size.iHeight = 200; - } - AknIconUtils::SetSize(bitmap, size); - gulIcon = CGulIcon::NewL(bitmap, mask); - gulIcon->SetBitmapsOwnedExternally(EFalse) ;// give ownership to gulicon - CleanupStack::Pop(mask); - CleanupStack::Pop(bitmap); - } - return gulIcon ; - } -// ----------------------------------------------------------------------------- -// CServiceWidgetBrandHandler::GetStatusBitmapPath -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CServiceWidgetBrandHandler::GetStatusBitmapL(TWSPresenceStatus aIndex, TInt& aBitmapHandle, TInt& aMaskHandle) - { - CGulIcon *gulIcon = NULL ; - - if(aIndex < EWSOnline || aIndex >= EWSLast) - return ; - - gulIcon = iBrandIcons[aIndex] ; - if(gulIcon) - { - aBitmapHandle = gulIcon->Bitmap()->Handle(); - aMaskHandle = gulIcon->Mask()->Handle(); - } - } - // end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgetbuddypresence.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetbuddypresence.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2008 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: buddy ,presene status of a user - * -*/ - - -// INCLUDE FILES -#include "cservicewidgetbuddypresence.h" - -// ================= MEMBER FUNCTIONS ======================= -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::NewL -// -------------------------------------------------------------------------- -// -CServiceWidgetBuddyPresence* CServiceWidgetBuddyPresence::NewL(const TDesC& aBuddyId, TWSPresenceStatus aStatus ) - { - CServiceWidgetBuddyPresence* self = - new (ELeave) CServiceWidgetBuddyPresence(aStatus); - CleanupStack::PushL(self); - self->ConstructL( aBuddyId); - CleanupStack::Pop(self); - return self; - } -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::CServiceWidgetBuddyPresence -// -------------------------------------------------------------------------- -// -CServiceWidgetBuddyPresence::CServiceWidgetBuddyPresence(TWSPresenceStatus aStatus): - iStatus( aStatus ) - { - } -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::ConstructL -// -------------------------------------------------------------------------- -// -void CServiceWidgetBuddyPresence::ConstructL(const TDesC& aBuddyId ) - { - iBuddyId = aBuddyId.AllocL(); - } - -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::~CServiceWidgetBuddyPresence -// -------------------------------------------------------------------------- -// -CServiceWidgetBuddyPresence::~CServiceWidgetBuddyPresence() - { - delete iBuddyId; - } -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::BuddyId -// -------------------------------------------------------------------------- -// -const TDesC& CServiceWidgetBuddyPresence::BuddyId() - { - if( iBuddyId ) - { - return *iBuddyId; - } - return KNullDesC; - } -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::PresenceStatus -// -------------------------------------------------------------------------- -// -TWSPresenceStatus CServiceWidgetBuddyPresence::PresenceStatus() - { - return iStatus; - } -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::SetPresenceStatus -// -------------------------------------------------------------------------- -// -void CServiceWidgetBuddyPresence::SetPresenceStatus( TWSPresenceStatus aStatus ) - { - iStatus = aStatus; - } -// End of File - - diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgetcchhandler.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetcchhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,530 +0,0 @@ -/* -* Copyright (c) 2008 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: class for cch service handling - * - * -*/ - -#include "cservicewidgetcchhandler.h" - -#include "cservicewidgetcontentpublisher.h" -#include "mservicewidgetobservers.h" -#include "servicewidgetcpglobals.h" -#include "swpdebugtrace.h" - -#include -#include -#include - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::CServiceWidgetCchHandler -// --------------------------------------------------------------------------- -// -CServiceWidgetCchHandler::CServiceWidgetCchHandler(TUint32 aServiceId, - MServiceWidgetServiceStateObserver& aStateObserver ): - iServiceId(aServiceId), - iStateObserver( aStateObserver ), - iServiceState( ESWSNotRegistered ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::CServiceWidgetCchHandler iServiceId %d"),iServiceId ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::NewL -// --------------------------------------------------------------------------- -// -CServiceWidgetCchHandler* CServiceWidgetCchHandler::NewL(TUint32 aServiceId, - MServiceWidgetServiceStateObserver& aStateObserver ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::NewL() start") ); - CServiceWidgetCchHandler* self = NewLC(aServiceId, aStateObserver); - CleanupStack::Pop(self); - TRACE_SWP(TXT("CServiceWidgetCchHandler::NewL() end") ); - return self; - } - -// ---------------------------------------------------------------------------aOwnStatusKey -// CServiceWidgetCchHandler::NewLC -// --------------------------------------------------------------------------- -// -CServiceWidgetCchHandler* CServiceWidgetCchHandler::NewLC(TUint32 aServiceId, - MServiceWidgetServiceStateObserver& aStateObserver ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::NewLC() start") ); - CServiceWidgetCchHandler* self = - new (ELeave) CServiceWidgetCchHandler(aServiceId, aStateObserver); - CleanupStack::PushL(self); - self->ConstructL( ); - TRACE_SWP(TXT("CServiceWidgetCchHandler::NewLC() end") ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CServiceWidgetCchHandler::ConstructL() - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::ConstructL() start") ); - iCchClient = CCch::NewL(); - TRACE_SWP(TXT("CServiceWidgetCchHandler::ConstructL() iCchClient created") ); - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - service->AddObserver( *this ); - } - //Configure CCHUI notes - MCchUi& cchui = iCchClient->CchUiApi(); - // Configure CCHUI API to show all notes/dialogs except connecting note. - // Also configure that only VoIP and IM subservices are allowed (notes are - // shown only for those). - RArray allowedNotes; - RArray allowedSubServices; - CleanupClosePushL( allowedNotes ); - CleanupClosePushL( allowedSubServices ); - - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeUsernamePasswordFailed ); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeAuthenticationFailed ); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionDefined ); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionAvailable ); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeConfirmChangeConnection ); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeChangeConnection ); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeDefectiveSettings ); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeErrorInConnection ); - - allowedSubServices.AppendL( ECCHVoIPSub ); - allowedSubServices.AppendL( ECCHIMSub ); - allowedSubServices.AppendL( ECCHPresenceSub ); - - cchui.ConfigureVisualizationL( - allowedNotes, allowedSubServices ); - CleanupStack::PopAndDestroy( &allowedSubServices ); - CleanupStack::PopAndDestroy( &allowedNotes ); - - ReadSupportedSubServices(); - TRACE_SWP(TXT("CServiceWidgetCchHandler::ConstructL() end") ); - } - - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::~CServiceWidgetCchHandler -// --------------------------------------------------------------------------- -// -CServiceWidgetCchHandler::~CServiceWidgetCchHandler() - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::~CServiceWidgetCchHandler() start") ); - if(iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - service->RemoveObserver(*this); - } - delete iCchClient; - } - iSupportedSubServices.Reset(); - - delete iServiceName; - delete iOwnData; - TRACE_SWP(TXT("CServiceWidgetCchHandler::~CServiceWidgetCchHandler() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::ReadSupportedSubServices -// --------------------------------------------------------------------------- -// - void CServiceWidgetCchHandler::ReadSupportedSubServices() - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::ReadSupportedSubServices() start") ); - iSupportedSubServices.Reset(); - TSubServiceState subService; - TBool supported = IsServiceSupported( ECCHIMSub ); - if( supported ) - { - // im sub service supported - subService.iSubServiceType = ECCHIMSub; - subService.iSubServiceState = GetServiceState( ECCHIMSub ); - iSupportedSubServices.Append( subService ); - } - supported = IsServiceSupported( ECCHPresenceSub ); - if( supported ) - { - // presence sub service supported - subService.iSubServiceType = ECCHPresenceSub; - subService.iSubServiceState = GetServiceState( ECCHPresenceSub ); - iSupportedSubServices.Append( subService ); - } - supported = IsServiceSupported( ECCHVoIPSub ); - if( supported ) - { - // voip sub service supported - subService.iSubServiceType = ECCHVoIPSub; - subService.iSubServiceState = GetServiceState( ECCHVoIPSub ); - iSupportedSubServices.Append( subService ); - } - TRACE_SWP(TXT("CServiceWidgetCchHandler::ReadSupportedSubServices() end") ); - } - - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::ServiceStatusChanged -// --------------------------------------------------------------------------- -// -void CServiceWidgetCchHandler::ServiceStatusChanged( - TInt aServiceId, - const TCCHSubserviceType aType, - const TCchServiceStatus& aServiceStatus ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::ServiceStatusChanged() start") ); - if( aServiceId != iServiceId ) - { - return; - } - TCCHSubserviceState state = aServiceStatus.State(); - TInt subServiceCount = iSupportedSubServices.Count(); - TInt error = aServiceStatus.Error(); - - for(TInt i=0; i< subServiceCount; i++) - { - TSubServiceState subService = iSupportedSubServices[ i ]; - if( subService.iSubServiceType == aType ) - { - // sub service is matched ,supported - // check for ALR state if supported ,service may go to waiting state - if( error && (error != KCCHErrorInvalidSettings ) && - ( ECCHConnecting == state ) ) - { - // waiting state - iSupportedSubServices[ i ].iSubServiceState = ESWSWaitingForNetwork; - } - else - { - TSWSTRegistrationState swState = GetLocalServiceState( state ); - if( swState == ESWSRegistered && aType == ECCHPresenceSub ) - { - // in case of presence subservice ,need to fetch the contact ,so - // move to updating state - iSupportedSubServices[ i ].iSubServiceState = ESWSUpdatingContacts; - } - else - { - // store the subservice state - iSupportedSubServices[ i ].iSubServiceState = swState; - } - } - break; // break the loop if subservice matched - } - } - TSWSTRegistrationState previousState = iServiceState; - // get best match state - iServiceState = ParseGetServiceState(); - - if( iServiceState != previousState ) - { - // inform the observer only if state changed - TRACE_SWP(TXT("CServiceWidgetCchHandler::ServiceStatusChanged() state changed") ); - // some times give the same state call back more than one - TRAP_IGNORE( iStateObserver.HandleServiceStatusChangedL( iServiceState ) ); - } - TRACE_SWP(TXT("CServiceWidgetCchHandler::ServiceStatusChanged() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::ParseGetServiceState -// --------------------------------------------------------------------------- -// -TSWSTRegistrationState CServiceWidgetCchHandler::ParseGetServiceState() - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::ParseGetServiceState() start") ); - - TInt serviceState = 0; - TInt subServiceCount = iSupportedSubServices.Count(); - //Find the cumulative of the ServiceStates of all subservices - // iterate the service array - for ( TInt index = 0; index < subServiceCount ; index++ ) - { - serviceState |= iSupportedSubServices[index].iSubServiceState; - } - TSWSTRegistrationState swState = ESWSNotRegistered; - //The logic below is that, if any one subservice not enabled for us the service is not enabled - //So to do this we assign priority for each service state - //Connecting gets the High Priority, when copmared to Waiting for Connection, - //Disconnecting, Registered, UnRegistered. - //By this way the Sevice Tab will be more usable and atleast we can perform operations - //related to the the logged in subservice - //its upto the connection handlers to do the job properly, whether to provide connectivity to all - //sub services or not.. - - //Start parsing and decide the state of the ServiceTab - if ( serviceState & ESWSNetworkConnecting ) - { - //Connecting - swState = ESWSNetworkConnecting; - } - else if ( serviceState & ESWSWaitingForNetwork ) - { - //Waiting for Connection - swState = ESWSWaitingForNetwork; - } - else if ( serviceState & ESWSUpdatingContacts ) - { - //Waiting for Connection - swState = ESWSUpdatingContacts; - } - else if ( serviceState & ESWSNetworkDisConnecting ) - { - //disconnecting - swState = ESWSNetworkDisConnecting; - } - else if ( serviceState & ESWSRegistered ) - { - //Enabled - swState = ESWSRegistered; - } - TRACE_SWP(TXT("CServiceWidgetCchHandler::ParseGetServiceState() end") ); - return swState; - } -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::GetServiceState -// --------------------------------------------------------------------------- -// -TSWSTRegistrationState CServiceWidgetCchHandler::GetServiceState( TCCHSubserviceType aServiceType ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::GetServiceState() start") ); - CCchService* service = iCchClient->GetService( iServiceId ); - TCchServiceStatus status; - status.SetState(ECCHUninitialized); - if( service ) - { - // Get status from the client - service->GetStatus( aServiceType , status ); - } - TRACE_SWP(TXT("CServiceWidgetCchHandler::GetServiceState() end") ); - return GetLocalServiceState( status.State() ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::GetLocalServiceState -// --------------------------------------------------------------------------- -// -TSWSTRegistrationState CServiceWidgetCchHandler::GetLocalServiceState(TCCHSubserviceState aState ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::GetLocalServiceState() start") ); - TSWSTRegistrationState mappedState = ESWSNotRegistered; - if( ECCHConnecting == aState ) - { - mappedState = ESWSNetworkConnecting; - } - else if( ECCHDisconnecting == aState ) - { - mappedState = ESWSNetworkDisConnecting; - } - else if( ECCHDisabled == aState ) - { - mappedState = ESWSNotRegistered; - } - else if( ECCHEnabled == aState ) - { - mappedState = ESWSRegistered; - } - TRACE_SWP(TXT("CServiceWidgetCchHandler::GetLocalServiceState() end") ); - return mappedState; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::OwnUserIdL -// --------------------------------------------------------------------------- -// -const TDesC& CServiceWidgetCchHandler::OwnUserIdL() - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::OwnUserIdL() start") ); - if( iOwnData ) - { - delete iOwnData; - iOwnData = NULL; - } - - // call back can not be modified ignore the error - iOwnData = GetConParametersL( ECchUsername ); - if( iOwnData ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::OwnUserIdL() valid") ); - TRACE_SWP(TXT("CServiceWidgetCchHandler::OwnUserIdL() end") ); - return *iOwnData; - } - TRACE_SWP(TXT("CServiceWidgetCchHandler::OwnUserIdL() end") ); - return KNullDesC ; - } - - // --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::XimpAdaptationUidL() -// --------------------------------------------------------------------------- -// -TInt CServiceWidgetCchHandler::XimpAdaptationUidL() - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::XimpAdaptationUidL() start") ); - TInt ret = KErrNotFound; - CSPSettings* settings = CSPSettings::NewLC(); - CSPProperty* property = CSPProperty::NewLC(); - TInt err = settings->FindPropertyL( iServiceId, - EPropertyPCSPluginId, - *property ); - if (KErrNone == err) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::XimpAdaptationUidL() uid read") ); - property->GetValue( ret ); - } - CleanupStack::PopAndDestroy(2);// property ,settings - TRACE_SWP(TXT("CServiceWidgetCchHandler::XimpAdaptationUidL() end") ); - return ret; - } - - // --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::GetConParametersL -// --------------------------------------------------------------------------- -// -HBufC* CServiceWidgetCchHandler::GetConParametersL( TCchConnectionParameter aConnParam ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::GetConParametersL() start") ); - HBufC* temp = NULL; - TInt error = KErrNotFound; - if(iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - RBuf buffer; - CleanupClosePushL( buffer ); - buffer.CreateL(KIMW_MAX_LENGTH); - error = service->GetConnectionParameter(ECCHUnknown,aConnParam,buffer); - User::LeaveIfError( error); - if( buffer.Length() > 0) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::GetConParametersL() buffer valid") ); - //extract only the user id in case - // Check for prefix and remove if found - TInt prefixLocation = buffer.Locate( ':' ); - if ( KErrNotFound != prefixLocation && ECchUsername == aConnParam ) - { - temp = buffer.Mid(prefixLocation+1 ).AllocL(); // ownership transferred - } - else - { - temp = buffer.AllocL(); // ownership transferred - } - } - CleanupStack::PopAndDestroy( &buffer ); - } - } - TRACE_SWP(TXT("CServiceWidgetCchHandler::GetConParametersL() end") ); - return temp; - } - - // --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::IsServiceSupported -// --------------------------------------------------------------------------- -// -TBool CServiceWidgetCchHandler::IsServiceSupported(TCCHSubserviceType aSubServiceType ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::IsServiceSupported() start") ); - TBool ret = EFalse; - if ( iCchClient ) - { - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - service->IsSupported(aSubServiceType, ret ); - } - } - TRACE_SWP(TXT("CServiceWidgetCchHandler::IsServiceSupported() end") ); - return ret; - } - - // --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::IsSubServiceSupported -// --------------------------------------------------------------------------- -// -TBool CServiceWidgetCchHandler::IsSubServiceSupported(TCCHSubserviceType aSubServiceType ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::IsSubServiceSupported() start") ); - TBool ret = EFalse; - TInt subServiceCount = iSupportedSubServices.Count(); - //Find the cumulative of the ServiceStates of all subservices - // iterate the service array - for ( TInt index = 0; index < subServiceCount ; index++ ) - { - if( iSupportedSubServices[index].iSubServiceType == aSubServiceType ) - { - ret = ETrue; - break; - } - } - TRACE_SWP(TXT("CServiceWidgetCchHandler::IsSubServiceSupported() end") ); - return ret; - } - - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::GetServiceViewIdL -// --------------------------------------------------------------------------- -// -TInt CServiceWidgetCchHandler::GetServiceViewIdL( TInt& aTabUid ) - { - TInt serviceviewId = 0 ; - if( iServiceId != KErrNotFound) - { - CSPSettings* spSettings = CSPSettings::NewL(); - CleanupStack::PushL(spSettings); - //get the tabview id from settings - CSPProperty* property = CSPProperty::NewLC(); - spSettings->FindPropertyL( iServiceId, - EPropertyContactViewId, - *property ); - property->GetValue(serviceviewId); - - //get the tab uid from settings - spSettings->FindPropertyL( iServiceId, - EPropertyContactViewPluginId, - *property ); - property->GetValue(aTabUid); - - CleanupStack::PopAndDestroy( property ); - CleanupStack::PopAndDestroy( spSettings ); - } - return serviceviewId; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetCchHandler::EnableServiceL -// -// --------------------------------------------------------------------------- -// -TInt CServiceWidgetCchHandler::EnableServiceL( ) - { - TRACE_SWP(TXT("CServiceWidgetCchHandler::EnableServiceL() start") ); - TInt error = KErrNotFound; - - if( iCchClient ) - { - iCchClient->SetConnectivityDialogsAllowed( ETrue ); - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - error = service->Enable( ECCHUnknown ); - } - } - return error; - } - // end of file - diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgetcontentpublisher.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetcontentpublisher.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,541 +0,0 @@ -/* -* Copyright (c) 2008 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: class to publish the data into widget -* -* -*/ - -#include "cservicewidgetcontentpublisher.h" - -#include -#include -#include -#include -#include -#include "swpdebugtrace.h" - -#include -#include "servicewidgetcpglobals.h" -#include -#include - -#include -#include - -#define KSW_LIST_GRANULARITY 8 - -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::CServiceWidgetContentPublisher -// --------------------------------------------------------------------------- -// -CServiceWidgetContentPublisher::CServiceWidgetContentPublisher(MServiceWidgetEventObserver& aObserver ) - :iObserver( aObserver ) - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::CServiceWidgetContentPublisher") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::NewL -// --------------------------------------------------------------------------- -// -CServiceWidgetContentPublisher* CServiceWidgetContentPublisher::NewL(MServiceWidgetEventObserver& aObserver) - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::NewL() start") ); - CServiceWidgetContentPublisher* self = NewLC(aObserver); - CleanupStack::Pop(self); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::NewL() End") ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::NewLC -// --------------------------------------------------------------------------- -// -CServiceWidgetContentPublisher* CServiceWidgetContentPublisher::NewLC(MServiceWidgetEventObserver& aObserver) - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::NewLC() start") ); - CServiceWidgetContentPublisher* self = - new (ELeave) CServiceWidgetContentPublisher(aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::NewLC() End") ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::ConstructL -// --------------------------------------------------------------------------- -// ConstructL is called by the application framework -void CServiceWidgetContentPublisher::ConstructL() - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::ConstructL() start") ); - iMsgInterface = GetMessagingInterfaceL(); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::ConstructL() End") ); - } -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::~CServiceWidgetContentPublisher -// --------------------------------------------------------------------------- -CServiceWidgetContentPublisher::~CServiceWidgetContentPublisher() - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::~CServiceWidgetContentPublisher() start") ); - if( iMsgInterface ) - { - iMsgInterface->Close(); - iMsgInterface = NULL; - } - if( iServiceHandler ) - { - iServiceHandler->Reset(); - delete iServiceHandler; - iServiceHandler = NULL; - } - TRACE_SWP(TXT("CServiceWidgetContentPublisher::~CServiceWidgetContentPublisher() End") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::GetMessagingInterfaceL -// --------------------------------------------------------------------------- - -MLiwInterface* CServiceWidgetContentPublisher::GetMessagingInterfaceL( ) - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::GetMessagingInterfaceL() start") ); - if( !iServiceHandler ) - { - iServiceHandler = CLiwServiceHandler::NewL(); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::GetMessagingInterfaceL() CLiwServiceHandler created") ); - } - CLiwGenericParamList* inParam = CLiwGenericParamList::NewL(); - CleanupStack::PushL( inParam ); - CLiwGenericParamList* outParam = CLiwGenericParamList::NewL(); - CleanupStack::PushL( outParam ); - CLiwCriteriaItem* crit = CLiwCriteriaItem::NewL( KLiwCmdAsStr, KCPContentInterface, - KCPService ); - crit->SetServiceClass( TUid::Uid(KLiwClassBase) ); - - RCriteriaArray array; - array.AppendL(crit); - iServiceHandler->AttachL(array); - iServiceHandler->ExecuteServiceCmdL( *crit, *inParam, *outParam ); - delete crit; - array.Reset(); - - // find service interface - TInt pos = 0; - MLiwInterface* msgInterface = NULL; - outParam->FindFirst( pos, KCPContentInterface ); - if ( pos != KErrNotFound ) - { - msgInterface = (*outParam)[pos].Value().AsInterface(); - } - outParam->Reset(); - inParam->Reset(); - CleanupStack::PopAndDestroy( outParam ); - CleanupStack::PopAndDestroy( inParam ); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::GetMessagingInterfaceL() End") ); - return msgInterface; - } -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::HandleNotifyL -// --------------------------------------------------------------------------- -// -TInt CServiceWidgetContentPublisher::HandleNotifyL( TInt aCmdId, TInt /*aEventId*/, - CLiwGenericParamList& aEventParamList, - const CLiwGenericParamList& /*aInParamList*/ - ) - { - TRACE_SWP( TXT("CServiceWidgetContentPublisher::HandleNotifyL() start") ); - TInt pos(0); - aEventParamList.FindFirst(pos, KChangeInfo); - - if (pos != KErrNotFound) - { - TLiwVariant variant = (aEventParamList)[pos].Value(); - variant.PushL(); - const CLiwList* changeMapsList = variant.AsList(); - HBufC16* publisher = NULL; - HBufC8* trigger = NULL; - const TInt KSAPIContentNameMaxLength = 255; - TBuf InstId; - - for (TInt i = 0; i < changeMapsList->Count(); ++i) - { - if ( changeMapsList->AtL(i, variant) ) - { - const CLiwMap* map = variant.AsMap(); - if( map->FindL( KActionTrigger, variant) ) - { - trigger = variant.AsData().AllocLC(); // trigger name - // In template case trigger name can be - // active , resume , suspend ,inactive, deactive or item names. - } - if( map->FindL( KPublisherId, variant) ) - { - publisher = variant.AsDes().AllocLC(); // ai3templatedwidget - } - if( map->FindL( KContentId, variant) ) - { - variant.Get( InstId ); - } - if( trigger && publisher ) - { - iObserver.HandleServiceEventL( *publisher, *trigger, InstId); - }// - if ( publisher ) - { - CleanupStack::PopAndDestroy( publisher ); - publisher = NULL; - } - if ( trigger ) - { - CleanupStack::PopAndDestroy( trigger ); - trigger = NULL; - } - } - }// loop - CleanupStack::Pop(&variant); //variant - variant.Reset(); - }//if (pos != KErrNotFound) - TRACE_SWP(TXT("CServiceWidgetContentPublisher::HandleNotifyL() end") ); - return aCmdId; - }//End HandleNotifyL - -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::RegisterWidgetL -// --------------------------------------------------------------------------- -// -void CServiceWidgetContentPublisher::RegisterWidgetL(const TDesC& aPublisherId, - TInt aBitmapHandle, - TInt aMaskHandle ) - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::RegisterWidgetL() start") ); - if( iMsgInterface ) - { - CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL()); - CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL()); - - TLiwGenericParam type( KType, TLiwVariant( KPublisher )); - inparam->AppendL( type ); - - CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); - CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC(); - CLiwDefaultMap* mapAction = CLiwDefaultMap::NewLC(); - - cpdatamap->InsertL( KPublisherId, TLiwVariant( aPublisherId )); - cpdatamap->InsertL( KContentType, TLiwVariant( KTemplateWidget )); - cpdatamap->InsertL( KContentId, TLiwVariant( KAll )); - //Take widget name as "service name" - //Give widget name here which will be displayed in HomeScreen Add Content menu - datamap->InsertL( KWidgetName, TLiwVariant( aPublisherId.Left( aPublisherId.Length()-KThemeUid().Length() ) ) ); - datamap->InsertL( KTemplateType, TLiwVariant( KServiceWidget )); - - //To publish logo and widget description - HBufC* text = NULL; - text = StringLoader::LoadLC( R_QTN_SERVTAB_WIDGET_SERVDESC ); - datamap->InsertL(KWidgetDesc, TLiwVariant( *text )); - CleanupStack::PopAndDestroy(text);//text - datamap->InsertL(KWidgetLogo , TLiwVariant( aBitmapHandle ) ); // key - aKey, value - map (stringsMap) - // append mask - // create mask key for the data item. Format is the image key with the '_mask' postfix. - HBufC8* maskResult = HBufC8::NewLC( KWidgetLogo().Length() + KMask().Length() ); - TPtr8 maskResultPtr = maskResult ->Des(); - maskResultPtr .Append( KWidgetLogo ); - maskResultPtr .Append( KMask ); - datamap->InsertL( maskResultPtr, TLiwVariant( aMaskHandle ) ); // key - aKey, value - map (stringsMap) - CleanupStack::PopAndDestroy(maskResult);//maskResult - - cpdatamap->InsertL( KDataMap, TLiwVariant(datamap) ); - - mapAction->InsertL(KActive, TLiwVariant(KTriggerMap)); - mapAction->InsertL(KDeActive, TLiwVariant(KTriggerMap)); - mapAction->InsertL(KSuspend, TLiwVariant(KTriggerMap)); - mapAction->InsertL(KInactive, TLiwVariant(KTriggerMap)); - mapAction->InsertL(KResume, TLiwVariant(KTriggerMap)); - // this will be called after clicking on widget, and generate "selected" event - mapAction->InsertL( KSelected, TLiwVariant( KTriggerMap ) ); - cpdatamap->InsertL( KActionMap, TLiwVariant(mapAction) ); - - TLiwGenericParam textItem( KItem, TLiwVariant( cpdatamap )); - inparam->AppendL( textItem ); - iMsgInterface->ExecuteCmdL( KAdd , *inparam, *outparam); - CleanupStack::PopAndDestroy(mapAction); - CleanupStack::PopAndDestroy(datamap); - CleanupStack::PopAndDestroy(cpdatamap); - - textItem.Reset(); - outparam->Reset(); - inparam->Reset(); - - // request for active/deactive/suspend/resume notification - CLiwDefaultMap* reqFilter = CLiwDefaultMap::NewLC(); - reqFilter->InsertL(KPublisherId, TLiwVariant( aPublisherId )); - reqFilter->InsertL(KContentType, TLiwVariant( KAll )); - reqFilter->InsertL( KContentId, TLiwVariant( KAll )); - reqFilter->InsertL(KOperation, TLiwVariant(KExecute)); - - // fill in input list for RequestNotification command - inparam->AppendL(TLiwGenericParam(KType, TLiwVariant(KPublisher))); - inparam->AppendL(TLiwGenericParam(KFilter, TLiwVariant(reqFilter))); - - iMsgInterface->ExecuteCmdL( KRequestNotification, - *inparam, - *outparam, - 0, - this ) ; - - CleanupStack::PopAndDestroy(reqFilter ); - outparam->Reset(); - inparam->Reset(); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::RegisterWidgetL() Registered widget %s"), &aPublisherId ); - } - TRACE_SWP(TXT("CServiceWidgetContentPublisher::RegisterWidgetL() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::UnregisterWidgetL -// --------------------------------------------------------------------------- -// -void CServiceWidgetContentPublisher::UnregisterWidgetL(const TDesC& aPublisherId ) - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterWidgetL() start") ); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterWidgetL() ServiceName %S"), &aPublisherId); - CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL()); - CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL()); - CLiwDefaultMap* cpdatamap= CLiwDefaultMap::NewLC(); - - cpdatamap->InsertL( KPublisherId, TLiwVariant( aPublisherId )); - cpdatamap->InsertL( KContentType, TLiwVariant( KTemplateWidget )); - cpdatamap->InsertL( KContentId, TLiwVariant( KAll )); - // fill in input list for RequestNotification command - inparam->AppendL(TLiwGenericParam(KType, TLiwVariant(KPublisher))); - inparam->AppendL(TLiwGenericParam(KData, TLiwVariant(cpdatamap))); - - iMsgInterface->ExecuteCmdL(KDelete, *inparam, *outparam, 0, this ); - - CleanupStack::PopAndDestroy(cpdatamap); - outparam->Reset(); - inparam->Reset(); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterWidget() end") ); - }//end UnregisterWidget - -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::UnregisterAllWidgetsL -// --------------------------------------------------------------------------- -// -void CServiceWidgetContentPublisher::UnregisterAllWidgetsL(RArray* aServiceArray) - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterAllWidgetsL() start") ); - CDesC16ArrayFlat* servicesExisting = new (ELeave) CDesC16ArrayFlat( KSW_LIST_GRANULARITY ); - CleanupStack::PushL( servicesExisting ); - if(aServiceArray && aServiceArray->Count() > 0) - { - CSPSettings* settings = CSPSettings::NewLC(); - for(TInt i=0; iCount();i++) - { - CSPEntry* entry = CSPEntry::NewLC(); - settings->FindEntryL( (*aServiceArray)[i], *entry ) ; - servicesExisting->AppendL(entry->GetServiceName()); - CleanupStack::PopAndDestroy(entry); - } - CleanupStack::PopAndDestroy(settings); - } - - CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL()); - CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL()); - CLiwDefaultMap* cpdatamap= CLiwDefaultMap::NewLC(); - - cpdatamap->InsertL( KPublisherId, TLiwVariant( KAll )); - cpdatamap->InsertL( KContentType, TLiwVariant( KTemplateWidget )); - cpdatamap->InsertL( KContentId, TLiwVariant( KAll )); - - // fill in input list for GetList command - inparam->AppendL(TLiwGenericParam(KType, TLiwVariant(KPublisher))); - inparam->AppendL(TLiwGenericParam(KData, TLiwVariant(cpdatamap))); - - iMsgInterface->ExecuteCmdL(KGetList, *inparam, *outparam, 0, this ); - CDesC16ArrayFlat* serviceNames = new (ELeave) CDesC16ArrayFlat( KSW_LIST_GRANULARITY ); - CleanupStack::PushL( serviceNames ); - - if(outparam) - { - TInt pos(0); - outparam->FindFirst(pos,KResults); - if(pos != KErrNotFound) - { - HBufC* uidStr = KThemeUid().AllocLC(); - TLiwVariant variant = (*outparam)[pos].Value(); - variant.PushL(); - - CLiwIterable* iterable = variant.AsIterable(); - iterable->Reset(); - - while ( iterable->NextL( variant ) ) - { - CLiwDefaultMap *map = CLiwDefaultMap::NewLC(); - variant.Get( *map ); - if ( map->FindL( KPublisherId, variant) ) - { - if(variant.AsDes().Length() >= KThemeUid().Length()) - { - TPtrC tempUidStr; - tempUidStr.Set(variant.AsDes().Right(KThemeUid().Length())); - if( 0 == tempUidStr.Compare(uidStr->Des())) - { - //If publisher id has KThemeUid, then this services is - //registered by this component - TBool serviceExisting = EFalse; - if(servicesExisting && servicesExisting->Count() > 0) - { - for(TInt i=0; iCount(); i++) - { - TPtrC serviceName; - serviceName.Set(variant.AsDes().Left(variant.AsDes().Length()-KThemeUid().Length())); - if(serviceName.Compare((*servicesExisting)[i]) == 0) - { - serviceExisting = ETrue; - break; - } - } - } - if(!serviceExisting) - { - serviceNames->AppendL(variant.AsDes()); - } - } - } - } - CleanupStack::PopAndDestroy( map ); - } //End of while - - CleanupStack::PopAndDestroy( &variant ); - CleanupStack::PopAndDestroy( uidStr ); - } //End of if(pos != KErrNotFound) - } - - TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterAllWidgetsL():ServiceCountForDeletion %d"), serviceNames->Count()); - for(TInt i=0; iCount();i++) - { - UnregisterWidgetL((*serviceNames)[i]); - } - - CleanupStack::PopAndDestroy(serviceNames); - CleanupStack::PopAndDestroy(cpdatamap); - CleanupStack::PopAndDestroy(servicesExisting); - outparam->Reset(); - inparam->Reset(); - - TRACE_SWP(TXT("CServiceWidgetContentPublisher::UnregisterAllWidgetsL() end") ); - } - - -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::RemoveWidgetDataL -// --------------------------------------------------------------------------- -// -void CServiceWidgetContentPublisher::RemoveWidgetDataL(const TDesC& aPublisherId, const TDesC& aInstId) - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::RemoveWidgetData() start") ); - CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL()); - CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL()); - - CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); - - cpdatamap->InsertL( KPublisherId, TLiwVariant( aPublisherId )); - cpdatamap->InsertL( KContentType, TLiwVariant( KAll )); - cpdatamap->InsertL( KContentId, TLiwVariant( aInstId )); - - // fill in input list for RequestNotification command - inparam->AppendL(TLiwGenericParam(KType, TLiwVariant(KCpData))); - inparam->AppendL(TLiwGenericParam(KData, TLiwVariant(cpdatamap))); - - TInt err = KErrNone; - // if you have only one combination of publisher,content_type, contenid - // then all the items will be remove from your widget - TRAP(err,iMsgInterface->ExecuteCmdL( KDelete , *inparam, *outparam, 0 , this)); - - CleanupStack::PopAndDestroy( cpdatamap ); - outparam->Reset(); - inparam->Reset(); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::RemoveWidgetData() end") ); - } -// --------------------------------------------------------------------------- -// CServiceWidgetContentPublisher::PublishDataWithActionL -// --------------------------------------------------------------------------- -// -void CServiceWidgetContentPublisher::PublishDataWithActionL( const TDesC& aPublisherId, - const TDesC& aInstId, - const TDesC& aOwnTextToAdd, - const TDesC& aStatusTextToAdd, - TInt aBitmapHandle, - TInt aMaskHandle, - TInt aSericonbitmapHandle, - TInt aSericonmaskHandle - ) - { - TRACE_SWP(TXT("CServiceWidgetContentPublisher::PublishDataWithActionL() start") ); - - CLiwGenericParamList* inparam = &(iServiceHandler->InParamListL()); - CLiwGenericParamList* outparam = &(iServiceHandler->OutParamListL()); - inparam->Reset(); - outparam->Reset(); - - if( iMsgInterface ) - { - TLiwGenericParam type( KType,TLiwVariant(KCpData)); - inparam->AppendL( type ); - - CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); - CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC(); - - cpdatamap->InsertL( KPublisherId, TLiwVariant( aPublisherId )); - cpdatamap->InsertL( KContentType, TLiwVariant( KAll )); - cpdatamap->InsertL( KContentId, TLiwVariant( aInstId )); - - //adding data to the map - //add service icon data - datamap->InsertL(KServiceImageKey , TLiwVariant( aSericonbitmapHandle ) ); // key - aKey, value - map (stringsMap) - // append mask - // create mask key for the data item. Format is the image key with the '_mask' postfix. - HBufC8* maskResult1 = HBufC8::NewLC( KServiceImageKey().Length() + KMask().Length() ); - TPtr8 maskResultPtr1 = maskResult1 ->Des(); - maskResultPtr1.Append( KServiceImageKey ); - maskResultPtr1.Append( KMask ); - datamap->InsertL( maskResultPtr1, TLiwVariant( aSericonmaskHandle ) ); // key - aKey, value - map (stringsMap) - CleanupStack::PopAndDestroy(maskResult1);//maskResult - //Add status icon data - datamap->InsertL(KStatusIconKey , TLiwVariant( aBitmapHandle ) ); // key - aKey, value - map (stringsMap) - // append mask - // create mask key for the data item. Format is the image key with the '_mask' postfix. - HBufC8* maskResult = HBufC8::NewLC( KStatusIconKey().Length() + KMask().Length() ); - TPtr8 maskResultPtr = maskResult ->Des(); - maskResultPtr .Append( KStatusIconKey ); - maskResultPtr .Append( KMask ); - datamap->InsertL( maskResultPtr, TLiwVariant( aMaskHandle ) ); // key - aKey, value - map (stringsMap) - CleanupStack::PopAndDestroy(maskResult);//maskResult - //add data for first text row and second text row - datamap->InsertL(KOwnTextKey, TLiwVariant(aOwnTextToAdd)); - datamap->InsertL(KMessageTextKey, TLiwVariant(aStatusTextToAdd)); - cpdatamap->InsertL( KDataMap, TLiwVariant(datamap) ); - - TLiwGenericParam item( KItem, TLiwVariant( cpdatamap )); - inparam->AppendL( item ); - iMsgInterface->ExecuteCmdL( KAdd, *inparam, *outparam ); - item.Reset(); - type.Reset(); - CleanupStack::PopAndDestroy(datamap); // datamap - CleanupStack::PopAndDestroy(cpdatamap); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::PublishDataWithActionL() success") ); - } - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgetimagedecoder.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetimagedecoder.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2008 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: presene avatar decoder handler - * - * -*/ - - -#include "cservicewidgetimagedecoder.h" -#include "servicewidgetcpglobals.h" -#include -#include - -const TInt KMimeLength = 16; -// --------------------------------------------------------------------------- -// CServiceWidgetImageDecoder::NewL -// Two-phase construction -// --------------------------------------------------------------------------- -// -CServiceWidgetImageDecoder* CServiceWidgetImageDecoder::NewL(MServiceWidgetImagerDecodeObserver& aObserver ) - { - CServiceWidgetImageDecoder* self = new (ELeave) CServiceWidgetImageDecoder(aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetImageDecoder::CServiceWidgetImageDecoder -// First phase (C++) constructor -// --------------------------------------------------------------------------- -// -CServiceWidgetImageDecoder::CServiceWidgetImageDecoder(MServiceWidgetImagerDecodeObserver& aObserver ) - : - CActive( CActive::EPriorityStandard ), - iObserver(aObserver) - { - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetImageDecoder::ConstructL -// ConstructL, second phase constructor -// --------------------------------------------------------------------------- -// -void CServiceWidgetImageDecoder::ConstructL() - { - User::LeaveIfError( iFs.Connect() ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetImageDecoder::~CServiceWidgetImageDecoder -// --------------------------------------------------------------------------- -// -CServiceWidgetImageDecoder::~CServiceWidgetImageDecoder() - { - DoCancel(); - if (iImgDecoder) - { - delete iImgDecoder; - iImgDecoder = NULL; - } - if (iBitmap) - { - delete iBitmap; - iBitmap = NULL; - } - if (iBitmapData) - { - delete iBitmapData; - iBitmapData = NULL; - } - iFs.Close(); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetImageDecoder::StartDecodingL -// Starts the decoding process -// --------------------------------------------------------------------------- -// -void CServiceWidgetImageDecoder::StartDecodingL(const TDesC8& aBitmapData ) - { - iBitmapData = aBitmapData.AllocL(); - - iMimeType = HBufC8::NewL( KMimeLength); - TPtr8 mimePtr = iMimeType->Des(); - CImageDecoder::GetMimeTypeDataL( *iBitmapData , mimePtr ); - - iImgDecoder = CImageDecoder::DataNewL( iFs, *iBitmapData ); - TFrameInfo info = iImgDecoder->FrameInfo(); - iBitmap = new ( ELeave ) CFbsBitmap; - User::LeaveIfError( iBitmap->Create( info.iOverallSizeInPixels, info.iFrameDisplayMode )); - - iNextOperationId = EOpEncodeBitmap; - iStatus = KRequestPending; - iImgDecoder->Convert( &iStatus, *iBitmap ); - SetActive(); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetImageDecoder::RunL -// Called by the active object framework when the decoding (request) is -// completed. -// --------------------------------------------------------------------------- -// -void CServiceWidgetImageDecoder::RunL() - { - User::LeaveIfError( iStatus.Int() ); - - switch( iNextOperationId ) - { - case EOpEncodeBitmap: - { - StartEncodingL(); - break; - } - case EOpComplete: - { - iObserver.HandlerDecodeCompleteL(); - break; - } - } - } - -// --------------------------------------------------------------------------- -// CServiceWidgetImageDecoder::DoCancel -// Called when the decoding (request) is cancelled for some reason. -// --------------------------------------------------------------------------- -// -void CServiceWidgetImageDecoder::DoCancel() - { - iImgDecoder->Cancel(); - } -// --------------------------------------------------------------------------- -// CServiceWidgetImageDecoder::StartEncodingL -// Called when the decoding (request) is cancelled for some reason. -// --------------------------------------------------------------------------- -// -void CServiceWidgetImageDecoder::StartEncodingL() - { - iImageEncoder = CImageEncoder::FileNewL(iFs, - KSeTAvatarPath, - *iMimeType, - CImageEncoder::EOptionExtUseWithSetThumbnail ); - iImageEncoder->SetThumbnail(ETrue); - - iNextOperationId = EOpComplete; - iStatus = KRequestPending; - iImageEncoder->Convert( &iStatus, *iBitmap ); - SetActive(); - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgetmessagehandler.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetmessagehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,249 +0,0 @@ -/* -* Copyright (c) 2008 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: message handler notification - * - * -*/ - - -#include "cservicewidgetmessagehandler.h" -#include "mservicewidgetobservers.h" -#include "swpdebugtrace.h" -//im cache -#include -#include -#include -#include - -// --------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::CServiceWidgetMessageHandler -// --------------------------------------------------------------------------- -// -CServiceWidgetMessageHandler::CServiceWidgetMessageHandler( - MServiceWidgetNewMessageObserver& aMessageObserver ) - :iMessageObserver( aMessageObserver ) - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::CServiceWidgetMessageHandler") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::NewL -// --------------------------------------------------------------------------- -// -CServiceWidgetMessageHandler* CServiceWidgetMessageHandler::NewL( - MServiceWidgetNewMessageObserver& aMessageObserver, - TInt aServiceId, - const TDesC& aOwnUserId ) - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::NewL() start") ); - CServiceWidgetMessageHandler* self = NewLC(aMessageObserver, - aServiceId, - aOwnUserId); - CleanupStack::Pop(self); - TRACE_SWP(TXT("CServiceWidgetMessageHandler::NewL() end") ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::NewLC -// --------------------------------------------------------------------------- -// -CServiceWidgetMessageHandler* CServiceWidgetMessageHandler::NewLC( - MServiceWidgetNewMessageObserver& aMessageObserver, - TInt aServiceId, - const TDesC& aOwnUserId ) - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::NewLC() start") ); - CServiceWidgetMessageHandler* self = - new (ELeave) CServiceWidgetMessageHandler(aMessageObserver ); - CleanupStack::PushL(self); - self->ConstructL( aOwnUserId ,aServiceId ); - TRACE_SWP(TXT("CServiceWidgetMessageHandler::NewLC() end") ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CServiceWidgetMessageHandler::ConstructL( const TDesC& aOwnUserId, TInt aServiceId ) - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::ConstructL() start") ); - iIMCacheFactory = CIMCacheFactory::InstanceL(); - iAccessor = iIMCacheFactory->CreateAccessorL( aServiceId, aOwnUserId ); - iAccessor->RegisterObserverL(*this); - TRACE_SWP(TXT("CServiceWidgetMessageHandler::ConstructL() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::~CServiceWidgetMessageHandler -// --------------------------------------------------------------------------- -// -CServiceWidgetMessageHandler::~CServiceWidgetMessageHandler() - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::~CServiceWidgetMessageHandler() start") ); - if( iIMCacheFactory ) - { - if( iAccessor ) - { - iAccessor->UnRegisterObserver(*this); - } - CIMCacheFactory::Release(); - } - iSendersArray.ResetAndDestroy(); - - TRACE_SWP(TXT("CServiceWidgetMessageHandler::~CServiceWidgetMessageHandler() end") ); - } - -// ----------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::GetUnreadMessageCountL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CServiceWidgetMessageHandler::GetUnreadMessageCountL() - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::GetUnreadMessageCountL()") ); - return iAccessor->GetAllUnreadMessageCountL() ; - } -//----------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::HandleIMCacheEventL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- - -void CServiceWidgetMessageHandler::HandleIMCacheEventL(TIMCacheEventType aEventType, TAny* aChatMessage ) - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::HandleIMCacheEventL() start") ); - switch( aEventType ) - { - case EIMCacheUnreadMessage : - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::HandleIMCacheEventL() EIMCacheUnreadMessage ") ); - if (!aChatMessage) - { - return; - } - SIMCacheMessageData* chatData = static_cast( aChatMessage ) ; - // check that buddy id exists - if ( chatData->iBuddyId ) - { - TPtrC buddyId = chatData->iBuddyId->Des(); - TPtrC messageText = chatData->iText->Des(); - if( !IsExistInSendersArrayL( buddyId ) ) // append only if not exist - { - HBufC* sender = buddyId.AllocLC(); - if( sender ) - { - iSendersArray.InsertL( sender ,0 ); // ownership to array - CleanupStack::Pop(sender); // - } - } - iMessageObserver.HandleNewMessageL( buddyId, messageText ); - } - break; - } - case EIMCacheUnreadChange : - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::HandleIMCacheEventL() EIMCacheUnreadChange ") ); - SynchronizeSendersArrayL(); - iMessageObserver.HandleCountChangedL(); - break; - } - default: - { - break; - } - } - TRACE_SWP(TXT("CServiceWidgetMessageHandler::HandleIMCacheEventL() end ") ); - } - -// ----------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::GetUnreadSenderId -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -const TDesC& CServiceWidgetMessageHandler::GetUnreadSenderId() - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::GetUnreadSenderId() start") ); - if( iSendersArray.Count() ) - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::GetUnreadSenderId() end") ); - return *( iSendersArray[ 0 ] ); // latest sender always on top - } - TRACE_SWP(TXT("CServiceWidgetMessageHandler::GetUnreadSenderId() end") ); - return KNullDesC; - } - -// ----------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::IsSingleMessageSender -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CServiceWidgetMessageHandler::IsSingleMessageSender() - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::IsSingleMessageSender()") ); - return ( iSendersArray.Count() == 1 ); - } - -// ----------------------------------------------------------------------------- -// CServiceWidgetMessageHandler::IsExistInSendersArrayL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CServiceWidgetMessageHandler::IsExistInSendersArrayL( const TDesC& aNewSenderId ) - { - TRACE_SWP(TXT("CServiceWidgetMessageHandler::IsExistInSendersArrayL() start") ); - TInt count = iSendersArray.Count(); - for( TInt i=0; iGetUnreadMessageCountL(*senderId ) ; - if( !unreadCount ) - { - iSendersArray.Remove( i ); - delete senderId; - senderId = NULL; - iSendersArray.Compress(); - break; - } - } - } - TRACE_SWP(TXT("CServiceWidgetMessageHandler::SynchronizeSendersArrayL() end") ); - } - -// end of file - - diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgetplugin.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetplugin.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,463 +0,0 @@ -/* -* Copyright (c) 2008 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: This is a plugin implementation - * - * -*/ - - -#include "cservicewidgetplugin.h" - -#include -#include "servicewidgetutils.h" -#include "servicewidgetpluginuids.hrh" -#include "servicewidgetcpglobals.h" -#include "cservicewidgetservicemanager.h" -#include "cservicewidgetcontentpublisher.h" -#include "swpdebugtrace.h" -#include -#include -#include -#include -#include -#include -#include - -// Provide a key pair value table for ECOM. -// Used to identify the correct construction function for the requested interface - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( AI_UID_DLL_SERVICEWIDGETPUBLISHER_PLUGIN, - CServiceWidgetPlugin::NewL ) - }; - -// ======== GLOBAL FUNCTIONS ======== -// Return an instance of the proxy table. - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount ) - { - aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy ); - return ImplementationTable; - } - -// ============================ MEMBER FUNCTIONS =============================== - -// --------------------------------------------------------------------------- -// CServiceWidgetPlugin::NewL -// --------------------------------------------------------------------------- -// -CServiceWidgetPlugin* CServiceWidgetPlugin::NewL() - { - TRACE_SWP(TXT("CServiceWidgetPlugin::NewL() start") ); - CServiceWidgetPlugin* self = new( ELeave )CServiceWidgetPlugin; - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - TRACE_SWP(TXT("CServiceWidgetPlugin::NewL() End") ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPlugin::NewL -// --------------------------------------------------------------------------- -// -CServiceWidgetPlugin::CServiceWidgetPlugin() - { - TRACE_SWP(TXT("CServiceWidgetPlugin::CServiceWidgetPlugin() Start") ); - iEnv = CCoeEnv::Static(); - TRACE_SWP(TXT("CServiceWidgetPlugin::CServiceWidgetPlugin() End") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPlugin::ConstructL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPlugin::ConstructL() - { - TRACE_SWP(TXT("CServiceWidgetPlugin::ConstructL() Start") ); - iContentPublisher = CServiceWidgetContentPublisher::NewL( *this ); - TRACE_SWP(TXT("CServiceWidgetContentPublisher created succesfully") ); - iSettingsStore = CVIMPSTSettingsStore::NewL(); - TRACE_SWP(TXT("CServiceWidgetPlugin iSettingsStore created succesfully") ); - // read service ids - ReadServiceIdsL(); - TRACE_SWP(TXT(" CServiceWidgetPlugin ReadServiceIdsL excuted") ); - LoadResourceFileL(); - TRACE_SWP(TXT(" CServiceWidgetPlugin LoadResourceFileL excuted") ); - TRACE_SWP(TXT("CServiceWidgetPlugin::ConstructL() End") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPlugin::NewL -// --------------------------------------------------------------------------- -// -CServiceWidgetPlugin::~CServiceWidgetPlugin() - { - TRACE_SWP(TXT("CServiceWidgetPlugin::~CServiceWidgetPlugin() Start") ); - delete iSpNotifyChange; - iServiceManagers.ResetAndDestroy(); - delete iSettingsStore; - delete iContentPublisher; - iServiceIds.Reset(); - - if( iEnv ) - { - iEnv->DeleteResourceFile( iResourceOffset ); - } - TRACE_SWP(TXT("CServiceWidgetPlugin::~CServiceWidgetPlugin() End") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPlugin::ReadServiceIdsL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPlugin::ReadServiceIdsL() - { - TRACE_SWP(TXT("CServiceWidgetPlugin::ReadServiceIdsL() Start") ); - CSPSettings* settings = CSPSettings::NewLC(); - ///////////////////////Get Service Id//////////////// - RArray services; - CleanupClosePushL( services ); - //Get the all configured service ID in services array - settings->FindServiceIdsL( services ); - const TInt serviceCount = services.Count(); - iServiceIds.Reset(); - //Append all the service ID in which service tab is interested in iServiceIds array - TRACE_SWP(TXT("CServiceWidgetPlugin::ReadServiceIdsL() serviceCount %d"), serviceCount ); - for ( TInt i( 0 ); i < serviceCount; i++ ) - { - TInt refContactUid = KErrNotFound; - CSPProperty* property = CSPProperty::NewLC(); - settings->FindPropertyL( services[i],EPropertyContactViewPluginId,*property ); - if ( property ) - { - property->GetValue( refContactUid ); - } - CleanupStack::PopAndDestroy( property ); - if ( (TUid::Uid( refContactUid ) == TUid::Uid( KMECOIMPLEMENTATIONUID )) - || (TUid::Uid( refContactUid ) == TUid::Uid( KIMServicetabPluginUid ) ) - || (TUid::Uid( refContactUid ) == TUid::Uid( 0x2002B334 ) )) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::ReadServiceIdsL() valid service id %d"), services[i] ); - iServiceIds.Append( services[i] ); - } - } - CleanupStack::PopAndDestroy( &services); //services - CleanupStack::PopAndDestroy( settings ); //settings - TRACE_SWP(TXT("CServiceWidgetPlugin::ReadServiceIdsL() End ") ); - } - - // --------------------------------------------------------------------------- -// CServiceWidgetPlugin::LoadResourceFileL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPlugin::LoadResourceFileL() - { - TRACE_SWP(TXT("CServiceWidgetPlugin::LoadResourceFileL() Start") ); - if( iEnv ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::LoadResourceFileL() iEnv is valid") ); - TFileName path; - Dll::FileName(path); //get the location of the dll - TDriveName drive( TParsePtrC( path ).Drive( ) ); // solve drive - TRACE_SWP(TXT("CServiceWidgetPlugin::LoadResourceFileL() TParsePtrC called") ); - // leave to stack, LC method - HBufC* resourceFilePath = HBufC::NewLC( KSW_RESOURCE_MAX_LENGTH ); - TPtr ptr( resourceFilePath->Des() ); - TRACE_SWP(TXT("CServiceWidgetPlugin::LoadResourceFileL() resourceFilePath called") ); - ptr.Zero(); - ptr.Append( KResourceDrive() ); - ptr.Append( KResourceFileName() ); - // NearestLanguageFile takes only TFileName - path.Zero(); - path.Append( *resourceFilePath ); - TRACE_SWP(TXT("CServiceWidgetPlugin::LoadResourceFileL() path.Append called") ); - if ( path.Length() != 0 ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::LoadResourceFileL() path length not zero") ); - BaflUtils::NearestLanguageFile( iEnv->FsSession(), path ); - } - CleanupStack::PopAndDestroy(resourceFilePath); // resourceFilePath - TRACE_SWP(TXT("CServiceWidgetPlugin::LoadResourceFileL() resourceFilePath deleted") ); - iResourceOffset = iEnv->AddResourceFileL(path); - TRACE_SWP(TXT("CServiceWidgetPlugin::LoadResourceFileL() AddResourceFileL called") ); - } - TRACE_SWP(TXT("CServiceWidgetPlugin::LoadResourceFileL() End") ); - } -// ---------------------------------------------------------------------------- -// This function updates information in CPS storage -// ---------------------------------------------------------------------------- -// -void CServiceWidgetPlugin::UpdateL() - { - TRACE_SWP(TXT("CServiceWidgetPlugin::UpdateL() Start") ); - //Unregisrer all previously registered services. - if(iContentPublisher) - { - iContentPublisher->UnregisterAllWidgetsL(&iServiceIds); - } - //register for service table notifications - RArray serviceIds; - CleanupClosePushL( serviceIds ); - iSpNotifyChange = CSPNotifyChange::NewL( *this ); - iSpNotifyChange->NotifyChangeL( serviceIds ); - CleanupStack::PopAndDestroy( &serviceIds ) ; - - TInt serviceCount = iServiceIds.Count(); - TRACE_SWP(TXT("CServiceWidgetPlugin::UpdateL() serviceCount %d"), serviceCount ); - iServiceManagers.ResetAndDestroy(); - if( serviceCount ) - { - for( TInt i=0; i < serviceCount; i++ ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::UpdateL() service id %d"), iServiceIds[i] ); - - CServiceWidgetServiceManager* servicemanager = CServiceWidgetServiceManager::NewL( iServiceIds[i], - *iContentPublisher,*iSettingsStore ); - CleanupStack::PushL( servicemanager ); - servicemanager->RegisterWidgetL(); - iServiceManagers.Append(servicemanager); - CleanupStack::Pop(servicemanager ); - TRACE_SWP(TXT("CServiceWidgetPlugin::UpdateL() service manager created for %d" ) , iServiceIds[i] ); - }//End for - } - TRACE_SWP(TXT("CServiceWidgetPlugin::UpdateL() End") ); - } - - -// ---------------------------------------------------------------------------- -// This function Validates all serviceManagers and add or delete as per service -// CServiceWidgetPlugin::ValidateAllServicesL -// ---------------------------------------------------------------------------- -// -void CServiceWidgetPlugin::ValidateAllServicesL() -{ -TRACE_SWP(TXT("CServiceWidgetPlugin::ValidateAllServicesL() Start") ); -TInt count = iServiceIds.Count(); -//If all services are deleted then unregister all widget first and then delete -//ServiceManager -if( count == 0 ) - { - TInt serviceCount = iServiceManagers.Count(); - for( TInt i=0; iUnregisterWidgetL(); - } - iServiceManagers.ResetAndDestroy(); - } -else - { - // check first all deleted services and remove their manager. - TBool servicemanagerFound = EFalse; - TInt serviceCount = iServiceManagers.Count(); - for( TInt i = 0; iServiceId() ) - { - servicemanagerFound = ETrue; - break; - } - }//End for J - if( !servicemanagerFound ) - { - // Delete service manager - CServiceWidgetServiceManager* servicemanager = iServiceManagers[ i ]; - //Unregister widget - servicemanager->UnregisterWidgetL(); - TRACE_SWP(TXT("CServiceWidgetContentPublisher::RegisterWidgetPublishers() UnRegistered widget servID %d"),iServiceManagers[i]->ServiceId() ); - iServiceManagers.Remove( i ); - delete servicemanager; - servicemanager = NULL; - iServiceManagers.Compress(); - serviceCount = serviceCount-1; - } - }//End For i - // Check for new services and create their manager if not exist - for( TInt i=0; iServiceId() ) - { - servicemanagerFound = ETrue; - break; - } - }//End For J - if( !servicemanagerFound ) - { - // create new service manager - CServiceWidgetServiceManager* servicemanager = CServiceWidgetServiceManager::NewL( iServiceIds[ i ], - *iContentPublisher,*iSettingsStore ); - CleanupStack::PushL( servicemanager ); - //Register widget to HS - servicemanager->RegisterWidgetL(); - iServiceManagers.Append(servicemanager); - CleanupStack::Pop(servicemanager ); - } - }//End for i - }//End Else -TRACE_SWP(TXT("CServiceWidgetPlugin::ValidateAllServicesL() End") ); -}//End ValidateAllServicesL - -// ----------------------------------------------------------------------------------- -// CServiceWidgetPlugin::HandleServiceEventL -// This function handles all homescreen callbacks (publisher received callback events -// from homescreen and directed them to plugin to take appropriate action.) -// ----------------------------------------------------------------------------------- -// -void CServiceWidgetPlugin::HandleServiceEventL(const TDesC& aPublisherId, const TDesC8& aEvent,TDesC& aInstId ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleServiceEventL() Start") ); - CServiceWidgetServiceManager* servicemanager = NULL; - TInt serviceCount = iServiceManagers.Count(); - TInt index = KErrNotFound; - //First identify which manager is supposed to handle event - for( index=0; indexServiceName().Compare( aPublisherId ) == 0 ) - { - servicemanager = iServiceManagers[ index ]; - break; - } - } - //Take action based on Event - if( servicemanager && (index < serviceCount) && (index >=0) ) - { - if( aEvent.Compare( KActive ) == 0 ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleServiceEventL() Active Event") ); - // this publisher widget is added into homescreen. - // publish content to widget ,widget is ready to use - servicemanager->ActivateWidgetL(aInstId); - } - else if( aEvent.Compare( KResume ) == 0 ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleServiceEventL() Resume Event") ); - servicemanager->WidgetSuspended( EFalse ); - // Home screen is in foreground or back light is on now. - // publishing / removing data now will be immediately updated in your widget. - // this publisher widget is added into homescreen. - // publich content to widget ,widget is ready to use - servicemanager->UpdateContentsL(); - } - else if( aEvent.Compare( KSuspend ) == 0 || aEvent.Compare( KInactive ) == 0 ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleServiceEventL() Suspend Event") ); - // Home screen is in back ground or back light is off. - // don't publish new data now it won't be updated in your widget. - // widget is suspended - // Home screen page is switched - // // don't publish new data now it won't be updated in your widget. - // // widget is suspended and in Inactive state - servicemanager->WidgetSuspended( ETrue ); - } - else if( aEvent.Compare( KDeActive ) == 0 ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleServiceEventL() Deactive Event") ); - // this publisher widget is removed from homescreen. - // remove the last data published to homescreen. - // So that when the user add widget again it won't show the old data. - servicemanager->DeactivateWidgetL(aInstId); - } - else if( aEvent.Compare( KSelected ) == 0 ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleServiceEventL() Selected Event") ); - // this publisher widget is clicked from homescreen. - servicemanager->ExecuteActionL(); - } - } - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleServiceEventL() End") ); - }//End HandleServiceEventL - - -////////////////////////////////////////////////////////////// -// --------------------------------------------------------------------------- -// CServiceWidgetPlugin::HandleNotifyChange() -// --------------------------------------------------------------------------- -// -void CServiceWidgetPlugin::HandleNotifyChange( - TServiceId /*aServiceId*/ ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleNotifyChange() start") ); - //This function will be triggred if any change in any service - TRAP_IGNORE( // Read the service id if any installed - ReadServiceIdsL(); - ValidateAllServicesL(); - ); - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleNotifyChange() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPlugin::HandleError() -// --------------------------------------------------------------------------- -// -void CServiceWidgetPlugin::HandleError( TInt /*aError*/ ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::HandleError() start/end") ); - } - -// --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Read property of publisher plug-in. -// --------------------------------------------------------------------------- -// -/*TAny* CServiceWidgetPlugin::GetPropertyL( TInt aProperty ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::GetPropertyL() start") ); - TAny* property = NULL; - - switch ( aProperty ) - { - case EAiPublisherInfo: - { - property = static_cast( &iInfo ); - break; - } - } - TRACE_SWP(TXT("CServiceWidgetPlugin::GetPropertyL() end") ); - return property; - } - -// --------------------------------------------------------------------------- -// From class MAiPropertyExtension -// Write property value to optimize the content model. -// --------------------------------------------------------------------------- -// -void CServiceWidgetPlugin::SetPropertyL( TInt aProperty, TAny* aValue ) - { - TRACE_SWP(TXT("CServiceWidgetPlugin::SetPropertyL() start") ); - switch ( aProperty ) - { - case EAiPublisherInfo: - { - if( aValue ) - { - const TAiPublisherInfo* info = static_cast( aValue ); - iInfo.iName.Copy(info->iName); - iInfo.iNamespace.Copy(info->iNamespace); - } - break; - } - default: - break; - } - TRACE_SWP(TXT("CServiceWidgetPlugin::SetPropertyL() end") ); - }*/ -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgetpresencehandler.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetpresencehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,642 +0,0 @@ -/* -* Copyright (c) 2008 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: presene status handler - * - * -*/ - - -#include "cservicewidgetpresencehandler.h" - -#include "cservicewidgetbuddypresence.h" -#include "servicewidgetcpglobals.h" -#include "mservicewidgetobservers.h" -#include "cservicewidgetimagedecoder.h" -#include "swpdebugtrace.h" -//ximp includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include //Presence info test -#include -#include -#include - -//ximpfw presence cache -#include // cache reader -#include -#include -#include -#include -#include -#include -#include -//presencecache event handler. -#include -#include - -#include - -#include "vimpstcustomcleanupapi.h" //For customized cleanup function - -_LIT( KListNameAllBuddy ,"buddylist" ); -const TInt KUriMaxLength = 255; -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::CServiceWidgetPresenceHandler -// --------------------------------------------------------------------------- -// -CServiceWidgetPresenceHandler::CServiceWidgetPresenceHandler(MServiceWidgetPresenceObserver& aPresenceObserver ) - :iPresenceObserver( aPresenceObserver ), - iTotalCount( 0 ), - iOperationId( EWSOperationUnknown ), - iOwnStatus( EWSOnline ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::CServiceWidgetPresenceHandler()") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::NewL -// --------------------------------------------------------------------------- -// -CServiceWidgetPresenceHandler* CServiceWidgetPresenceHandler::NewL(MServiceWidgetPresenceObserver& aPresenceObserver, - const TDesC& aServiceName, - const TDesC& aOwnId ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::NewL() start") ); - CServiceWidgetPresenceHandler* self = NewLC(aPresenceObserver, aServiceName, aOwnId ); - CleanupStack::Pop(self); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::NewL() end") ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::NewLC -// --------------------------------------------------------------------------- -// -CServiceWidgetPresenceHandler* CServiceWidgetPresenceHandler::NewLC(MServiceWidgetPresenceObserver& aPresenceObserver, - const TDesC& aServiceName, - const TDesC& aOwnId ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::NewLC() start") ); - CServiceWidgetPresenceHandler* self = - new (ELeave) CServiceWidgetPresenceHandler(aPresenceObserver); - CleanupStack::PushL(self); - self->ConstructL( aServiceName, aOwnId ); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::NewLC() end") ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPresenceHandler::ConstructL(const TDesC& aServiceName,const TDesC& aOwnId ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ConstructL() start") ); - iServiceName = aServiceName.AllocL(); - iOwnUserId = aOwnId.AllocL(); - iClient = MXIMPClient::NewClientL(); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ConstructL() iClient created") ); - //Create new sink to receive ximp context events - iPresenceCtx = iClient->NewPresenceContextLC(); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ConstructL() iPresenceCtx created") ); - iFeatures = MPresenceFeatures::NewL(iPresenceCtx); - iAcceptedEventTypes.Reset(); - iAcceptedEventTypes.AppendL( MXIMPRequestCompleteEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MXIMPContextStateEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MPresentityGroupContentEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MPresenceGrantRequestListEvent::KInterfaceId ); - TArray< TInt32 > eventFilterArray = iAcceptedEventTypes.Array(); - // register this to prsence context - iPresenceCtx->RegisterObserverL( *this, &eventFilterArray ); - // ignore code scanner warning, it gives panic - CleanupStack::Pop();// because of LC method - //initialize the presence cache. - iPresenceCacheReader = MPresenceCacheReader2::CreateReaderL(); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ConstructL() iPresenceCacheReader created") ); - iPresenceCacheReader->SetObserverForSubscribedNotifications(this); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ConstructL() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::~CServiceWidgetPresenceHandler -// --------------------------------------------------------------------------- -// -CServiceWidgetPresenceHandler::~CServiceWidgetPresenceHandler() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::~CServiceWidgetPresenceHandler() start") ); - iAcceptedEventTypes.Reset(); - iOnlineBuddyArray.ResetAndDestroy(); - delete iServiceName; - delete iOwnUserId; - delete iPresenceCacheReader; - delete iFeatures; - if(iPresenceCtx) - { - iPresenceCtx->UnregisterObserver( *this ); - delete iPresenceCtx; - } - delete iClient; - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::~CServiceWidgetPresenceHandler() end") ); - } - -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::GetConnectedSessionL -// -// --------------------------------------------------------- -void CServiceWidgetPresenceHandler::GetConnectedSessionL(TInt aProtocolUid,TInt aServiceId ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::GetConnectedSessionL() start") ); - iOperationId = EWSOperationBind; - iPresenceCtx->BindToL( TUid::Uid( aProtocolUid), aServiceId ) ; - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::GetConnectedSessionL() end") ); - } -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::GetCompletedReqResult -// -// --------------------------------------------------------- -void CServiceWidgetPresenceHandler::ReleaseConnectionL() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ReleaseConnectionL() start") ); - iPresenceCtx->UnbindL() ; - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ReleaseConnectionL() end") ); - } -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::SubscribePresenceL -// -// --------------------------------------------------------- -void CServiceWidgetPresenceHandler::SubscribePresenceL( const TDesC& aUserId ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::SubscribePresenceL() start") ); - __ASSERT_ALWAYS( aUserId.Length(), User::Leave( KErrArgument ) ); - //if anything is there with colon e.g. sip:user@presence1. strip the part before : - TInt len = aUserId.Find(_L(":")); - TPtrC buddyId = aUserId.Right( aUserId.Length() - len - KColon().Length() ); - - HBufC* name = HBufC::NewLC( buddyId.Length() + iServiceName->Length() + KColon().Length() ); - TPtr namePtr( name->Des() ); - namePtr.Zero(); - // append the service name followed by user id ,seperated by colon - namePtr.Append(*iServiceName); - namePtr.Append(KColon); - namePtr.Append(buddyId); - iPresenceCacheReader->SubscribePresenceBuddyChangeL( *name ); - CleanupStack::PopAndDestroy(); // name - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::SubscribePresenceL() end") ); - } - - -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::RetrieveSubscribedListL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPresenceHandler::RetrieveSubscribedListL() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::RetrieveSubscribedListL() start") ); - iOperationId = EWSOperationFetching; - //Create group id - TBuf buffer( KListNameAllBuddy ); - MXIMPIdentity* groupList = iPresenceCtx->ObjectFactory().NewIdentityLC(); - __ASSERT_ALWAYS( groupList , User::Leave( KErrNoMemory ) ); - groupList->SetIdentityL( buffer ); - //Subscribe buddy list - TXIMPRequestId operationId = TXIMPRequestId::Null(); - __ASSERT_ALWAYS( iFeatures, User::Leave( KErrNotSupported ) ) ; - MPresentityGroups& groups = iFeatures->PresentityGroups() ; - groups.SubscribePresentityGroupContentL( *groupList ); - CleanupStack::PopAndDestroy(); // groupList - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::RetrieveSubscribedListL() end") ); - } -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::ReadPresenceFromCacheL -// -// --------------------------------------------------------- -void CServiceWidgetPresenceHandler::ReadPresenceFromCacheL() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ReadPresenceFromCache() start") ); - iOnlineBuddyArray.ResetAndDestroy(); - __ASSERT_ALWAYS( iServiceName, User::Leave( KErrArgument ) ); - // passed the service id to see the member count - iPresenceCacheReader->BuddyCountInService(*iServiceName); - // passed the service to register for notification - iPresenceCacheReader->AllBuddiesPresenceInService(*iServiceName, this ); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ReadPresenceFromCache() end") ); - } -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::SubscribeForAuthorizationL -// -// --------------------------------------------------------- -void CServiceWidgetPresenceHandler::SubscribeForAuthorizationL() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::SubscribeForAuthorizationL() start") ); - __ASSERT_ALWAYS( iFeatures, User::Leave( KErrNotSupported ) ) ; - MPresenceAuthorization& authorization = iFeatures->PresenceAuthorization(); - __ASSERT_ALWAYS( &authorization, User::Leave( KErrNotSupported ) ); - authorization.SubscribePresenceGrantRequestListL(); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::SubscribeForAuthorizationL() end") ); - } -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::OnlineBuddyCount -// -// --------------------------------------------------------- -TInt CServiceWidgetPresenceHandler::OnlineBuddyCount() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::OnlineBuddyCount()") ); - return iOnlineBuddyArray.Count(); - } - -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::AllBuddyCount -// -// --------------------------------------------------------- -TInt CServiceWidgetPresenceHandler::AllBuddyCount() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::AllBuddyCount()") ); - return iTotalCount; - } -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::GetInviteCountsL -// -// --------------------------------------------------------- -TInt CServiceWidgetPresenceHandler::GetInviteCounts() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::GetInviteCountsL()") ); - return iInvitationCount; - } - - // --------------------------------------------------------- -// CServiceWidgetPresenceHandler::GetOwnStatusL -// -// --------------------------------------------------------- -TWSPresenceStatus CServiceWidgetPresenceHandler::GetOwnStatus() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::GetOwnStatusL()") ); - // get the avatar image if not return the default image - return iOwnStatus; - } - -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::GetOwnStatusL -// -// --------------------------------------------------------- -TWServiceOperationId CServiceWidgetPresenceHandler::GetOngoingOperationId() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::GetOngoingOperationId()") ); - // get the state of ongoing operation - return iOperationId; - } - -// --------------------------------------------------------- -// CServiceWidgetPresenceHandler::HandlePresenceContextEvent -// --------------------------------------------------------- -void CServiceWidgetPresenceHandler::HandlePresenceContextEvent( - const MXIMPContext& /*aContext*/, - const MXIMPBase& aEvent ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceContextEvent() start") ); - switch( aEvent.GetInterfaceId() ) - { - case MXIMPRequestCompleteEvent::KInterfaceId: - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler:: MXIMPRequestCompleteEvent ") ); - const MXIMPRequestCompleteEvent* complEvent = - TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - TXIMPRequestId reqId = complEvent->RequestId(); - const MXIMPStatus& status = complEvent->CompletionResult() ; - TInt reqResult = complEvent->CompletionResult().ResultCode(); - if( iOperationId == EWSOperationBind && reqResult == KErrNone ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::login completed ") ); - iOwnStatus = EWSOnline; - TRAP_IGNORE(DoHandleBindCompleteL()) ; - } - break; - } - case MPresentityGroupContentEvent::KInterfaceId: - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::MPresentityGroupContentEvent ") ); - TRAP_IGNORE(DoHandlePresentityGroupContentEventL( aEvent )) ; - break; - } - case MPresenceGrantRequestListEvent::KInterfaceId: - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler:: MPresenceGrantRequestListEvent ") ); - TRAP_IGNORE(DoHandlePresenceGrantRequestListEventL(aEvent )) ; - break; - } - default: - { - break; - } - } - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceContextEvent() end") ); - } -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::HandlePresenceNotificationL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPresenceHandler::HandlePresenceNotificationL(TInt /*aErrorCode*/, - MPresenceBuddyInfo2* aPresenceBuddyInfo) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceNotificationL() start") ); - if ( aPresenceBuddyInfo) - { - // we have the ownership of aPresenceBuddyInfo ; Push into cleanup stack - CleanupDeletePushL( aPresenceBuddyInfo ); - if (iServiceName ) - { - // read the buddyID : returns in XSP format - TPtrC buddyXSPId = aPresenceBuddyInfo->BuddyId(); - TPtrC buddyId = buddyXSPId.Right( buddyXSPId.Length() - iServiceName->Length() - KColon().Length()); - // read the availability /presence state enum value - MPresenceBuddyInfo2::TAvailabilityValues availabilityEnum = aPresenceBuddyInfo->Availability(); - TPtrC avablityText = aPresenceBuddyInfo->AvailabilityText(); - // convert the presence cache enum value to service tab enum - TWSPresenceStatus status = ConvertPresenceCacheEnums( availabilityEnum, avablityText ); - - TPtrC statusMsg = aPresenceBuddyInfo->StatusMessage(); // read the status message - TBool isOwnId = buddyId.Compare(*iOwnUserId) ? EFalse : ETrue ; - - if( isOwnId ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceNotificationL() own status change") ); - iOwnStatus = status; - iPresenceObserver.HandleOwnStatusChangeL( iOwnStatus ); - } - else - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceNotificationL() buddy status change") ); - CheckAndCacheBuddyAvailabilityL( buddyId, status ); - iPresenceObserver.HandleBuddyPresenceChangeL(buddyId, status, statusMsg ); - } - } - CleanupStack::PopAndDestroy(); // aPresenceBuddyInfo - } - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceNotificationL() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::HandlePresenceReadL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPresenceHandler::HandlePresenceReadL(TInt /*aErrorCode*/, - RPointerArray& aPresenceBuddyInfoList) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceReadL() start") ); - iOnlineBuddyArray.ResetAndDestroy(); // rest and destroy old data - // we have the ownership of aPresenceBuddyInfoList : Push it to customize cleanupstack - // aPresenceBuddyInfoList is collection of owned object and each object need to be deleted - CustomCleanupResetAndDestroyPushL(aPresenceBuddyInfoList); - - TInt buddyCount = aPresenceBuddyInfoList.Count(); - for ( TInt i =0 ; i < buddyCount && iServiceName; ++i ) - { - MPresenceBuddyInfo2* buddyinfo = aPresenceBuddyInfoList[i]; - // read the buddyID : returns in XSP format - TPtrC buddyXSPId = buddyinfo->BuddyId(); - TPtrC buddyId = buddyXSPId.Right( buddyXSPId.Length() - iServiceName->Length() - KColon().Length()); - // read the availability /presence state enum value - MPresenceBuddyInfo2::TAvailabilityValues availabilityEnum = buddyinfo->Availability(); - TPtrC avablityText = buddyinfo->AvailabilityText(); - // convert the presence cache enum value to service tab enum - TWSPresenceStatus status = ConvertPresenceCacheEnums( availabilityEnum,avablityText ); - //compare if its for own user id - TBool isOwnId = buddyId.Compare(*iOwnUserId) ? EFalse : ETrue ; - if( isOwnId ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceReadL() own status change") ); - iOwnStatus = status; - iPresenceObserver.HandleOwnStatusChangeL( iOwnStatus ); - } - else - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceReadL() buddy status change") ); - CheckAndCacheBuddyAvailabilityL( buddyId, status ); - } - } - CleanupStack::PopAndDestroy(); // aPresenceBuddyInfoList, calls LocalResetAndDestroy - iPresenceObserver.HandleChangeL(); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::HandlePresenceReadL() end") ); - } - - // --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::DoHandleBindCompleteL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPresenceHandler::DoHandleBindCompleteL() - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::DoHandleBindCompleteL() start") ); - __ASSERT_ALWAYS( iOwnUserId, User::Leave( KErrArgument ) ); - SubscribePresenceL(*iOwnUserId); - iInvitationCount = 0; - SubscribeForAuthorizationL(); - // get the list. - RetrieveSubscribedListL(); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::DoHandleBindCompleteL() end") ); - } -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler:: DoHandlePresentityGroupContentEventL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPresenceHandler::DoHandlePresentityGroupContentEventL( const MXIMPBase& aEvent ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::DoHandlePresentityGroupContentEventL() start") ); - const MPresentityGroupContentEvent& event = *TXIMPGetInterface< - const MPresentityGroupContentEvent >::From(aEvent,MXIMPBase::EPanicIfUnknown ); - TInt newCount = event.NewMembersCount(); - TInt disapCount = event.DisappearedMembersCount(); - - iTotalCount = iTotalCount + newCount; - iTotalCount = iTotalCount - disapCount; - if( iTotalCount <0 ) - { - // if total count becomes < 0 assign to 0 - iTotalCount = 0; - } - TRACE_SWP(TXT("CServiceWidgetPresenceHandler iTotalCount %d "), iTotalCount ); - HBufC* groupId = event.GroupId().Identity().AllocLC(); - if ( groupId && !groupId->Compare( KListNameAllBuddy ) ) - { - for( TInt i =0; i < newCount; i++ ) - { - const MPresentityGroupMemberInfo& subscribedEntitys = event.NewMember(i); - const MXIMPIdentity& ident = subscribedEntitys.GroupMemberId(); - HBufC* buddy = ident.Identity().AllocLC(); - if( buddy ) - { - SubscribePresenceL(*buddy); - CleanupStack::PopAndDestroy( buddy ); - } - } - } - if( groupId) - { - CleanupStack::PopAndDestroy( groupId ); - } - iOperationId = EWSOperationComplete; - iPresenceObserver.HandleChangeL(); - ReadPresenceFromCacheL(); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::DoHandlePresentityGroupContentEventL() end") ); - } -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler:: DoHandlePresenceGrantRequestListEventL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPresenceHandler::DoHandlePresenceGrantRequestListEventL( const MXIMPBase& aEvent ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::DoHandlePresenceGrantRequestListEventL() start") ); - const MPresenceGrantRequestListEvent& event = *TXIMPGetInterface< const MPresenceGrantRequestListEvent >::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler iInvitationCount %d"), iInvitationCount ); - TInt newcount = event.NewRequestsCount(); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler newcount %d"), newcount ); - TInt disapearCount = event.DisappearedRequestsCount(); - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::disapearCount %d "), disapearCount); - if(newcount) - { - iInvitationCount++; // one more inviation recieved - TRACE_SWP(TXT("CServiceWidgetPresenceHandler new invitation ,iInvitationCount %d"), iInvitationCount ); - const MPresenceGrantRequestInfo& reqInfo = event.NewRequest ( 0 );// its always a new request - HBufC* requesterId = reqInfo.RequestorId().Identity().AllocLC(); - if( requesterId ) - { - iPresenceObserver.HandleAddRequestL( *requesterId ); - CleanupStack::PopAndDestroy( requesterId ); - } - } - else if( disapearCount ) - { - iInvitationCount--; - if( iInvitationCount <0 ) - { - // if <0 assign to 0 - iInvitationCount = 0; - } - TRACE_SWP(TXT("CServiceWidgetPresenceHandler accept/decline ,iInvitationCount %d"), iInvitationCount ); - // there is some count changes - iPresenceObserver.HandleChangeL(); - } - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::DoHandlePresenceGrantRequestListEventL() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::ConvertXimpToClientPresenceStatus -// --------------------------------------------------------------------------- -// -TWSPresenceStatus CServiceWidgetPresenceHandler::ConvertPresenceCacheEnums( MPresenceBuddyInfo2::TAvailabilityValues aAvailabilityEnum,TPtrC aAvabilityText) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ConvertPresenceCacheEnums() start") ); - TWSPresenceStatus status = EWSUnknown ; - switch( aAvailabilityEnum ) - { - case MPresenceBuddyInfo2::EBusy: - { - status = EWSbusy; - if(0==aAvabilityText.Compare(KAwayState)) - { - status = EWSAway; - } - if(0==aAvabilityText.Compare(KOnPhoneState)) - { - status = EWSOnPhone; - } - if(0==aAvabilityText.Compare(KDndState)) - { - status = EWSDoNotDisturb; - } - break; - } - case MPresenceBuddyInfo2::EAvailable: - { - status = EWSOnline; - break; - } - case MPresenceBuddyInfo2::ENotAvailable: - { - status = EWSOffline; - break; - } - case MPresenceBuddyInfo2::EUnknownAvailability: - { - status = EWSUnknown; - if(0==aAvabilityText.Compare(KInvisibleState)) - { - status = EWSInvisible; - } - break; - } - default: - { - status = EWSUnknown; - break; - } - } - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::ConvertPresenceCacheEnums() end") ); - return status; - } - // --------------------------------------------------------------------------- -// CServiceWidgetPresenceHandler::CheckAndCacheBuddyAvailabilityL -// --------------------------------------------------------------------------- -// -void CServiceWidgetPresenceHandler::CheckAndCacheBuddyAvailabilityL( const TDesC& aUserId, TWSPresenceStatus aStatus ) - { - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::CheckAndCacheBuddyAvailabilityL() start") ); - TBool needToAdd = ETrue; - TInt count = iOnlineBuddyArray.Count(); - for( TInt i=0; iBuddyId() ) == 0 ) - { - if( aStatus == EWSUnknown || aStatus == EWSOffline ) - { - // went offline remove from array - iOnlineBuddyArray.Remove( i ); // do not use agian the loop ,may cuase to crash - delete store; - store = NULL; - iOnlineBuddyArray.Compress(); - } - else - { - store->SetPresenceStatus( aStatus ); - } - needToAdd = EFalse; - break; // break the loop - } - } - if( needToAdd && ( aStatus != EWSUnknown ) && ( aStatus != EWSOffline ) ) - { - // add only availabe buddies to list - CServiceWidgetBuddyPresence* store = CServiceWidgetBuddyPresence::NewL( aUserId, aStatus ); - iOnlineBuddyArray.Append(store); // ownership given to array - } - TRACE_SWP(TXT("CServiceWidgetPresenceHandler::CheckAndCacheBuddyAvailabilityL() end") ); - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgetservicemanager.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgetservicemanager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,902 +0,0 @@ -/* -* Copyright (c) 2008 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: service manager for a specific service - * - * -*/ - - -#include "cservicewidgetservicemanager.h" - -#include "cservicewidgetcontentpublisher.h" -#include "cservicewidgetbrandhandler.h" -#include "cservicewidgetmessagehandler.h" -#include "cservicewidgetcchhandler.h" -#include "cservicewidgetpresencehandler.h" -#include "cservicewidgettimer.h" -#include "servicewidgetcpglobals.h" -#include "servicewidgetutils.h" -#include "swpdebugtrace.h" -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include //For Stream writing -//--------------------------------------------------------------------------- -// CServiceWidgetServiceManager::NewL -// --------------------------------------------------------------------------- -// -CServiceWidgetServiceManager* CServiceWidgetServiceManager::NewL(TUint32 aServiceId, - CServiceWidgetContentPublisher& aContentPublisher, - MVIMPSTSettingsStore& aSettingStore ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::NewL() start") ); - CServiceWidgetServiceManager* self = new( ELeave )CServiceWidgetServiceManager( aServiceId, aContentPublisher , aSettingStore); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - TRACE_SWP(TXT("CServiceWidgetServiceManager::NewL() end") ); - return self; - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::CServiceWidgetServiceManager -// --------------------------------------------------------------------------- -// -CServiceWidgetServiceManager::CServiceWidgetServiceManager(TUint32 aServiceId, - CServiceWidgetContentPublisher& aContentPublisher, - MVIMPSTSettingsStore& aSettingStore ) - :iServiceId( aServiceId ), - iContentPublisher( aContentPublisher ), - iSettingStore( aSettingStore ), - iExecuteOperation( ESWAUnknown ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::CServiceWidgetServiceManager() start") ); - TRACE_SWP(TXT("CServiceWidgetServiceManager::CServiceWidgetServiceManager() start") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::ConstructL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::ConstructL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::ConstructL() start") ); - CSPSettings* settings = CSPSettings::NewLC(); - // read service name - CSPEntry* entry = CSPEntry::NewLC(); - settings->FindEntryL( iServiceId, *entry ) ; - // set the service name to presence cache updater - iServiceName = entry->GetServiceName().AllocL() ; - - //KThemeUid appended to iServiceName for making service name unique from serivces - //published by other applications - iServiceName = iServiceName->ReAllocL(iServiceName->Des().Length() + KThemeUid().Length()); - iServiceName->Des().Append(KThemeUid); - CleanupStack::PopAndDestroy(2); // entry,settings - - iBrandHandler = CServiceWidgetBrandHandler::NewL(iServiceId); - TRACE_SWP(TXT("CServiceWidgetServiceManager::ConstructL() end") ); - } -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::ActivateWidgetL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::ActivateWidgetL(TDesC& aInstId) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::ActivateWidget() start") ); - iEnv = CEikonEnv::Static(); - //CCH handler initialize - iCchHandler = CServiceWidgetCchHandler::NewL( iServiceId, *this ); - TRACE_SWP(TXT("CServiceWidgetServiceManager::ActivateWidget() iBrandHandler created") ); - iServiceState = iCchHandler->ParseGetServiceState(); - iServiceviewId = iCchHandler->GetServiceViewIdL( iServiceTabUid ); - CreateHandlersL(); - //Initialize instance id of corresponding widget - iInstId = aInstId.AllocL(); - iExecuteOperation = ESWALaunchServiceTab; - - TRACE_SWP(TXT("CServiceWidgetServiceManager::ActivateWidget() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::DeactivateWidgetL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::DeactivateWidgetL(TDesC& aInstId) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::DeactivateWidgetL() start") ); - - iContentPublisher.RemoveWidgetDataL(*iServiceName,aInstId ); - - delete iMessageHandler; - iMessageHandler = NULL; - - if( iPresenceHandler) - { - iPresenceHandler->ReleaseConnectionL() ; - delete iPresenceHandler ; - iPresenceHandler = NULL; - } - if( iWidgetTimer ) - { - iWidgetTimer->StopListening(); - delete iWidgetTimer; - iWidgetTimer = NULL; - } - - delete iCchHandler; - iCchHandler = NULL; - - delete iInstId; - iInstId = NULL; - - iIsWidgetSuspended = EFalse; - iExecuteOperation = ESWAUnknown; - TRACE_SWP(TXT("CServiceWidgetServiceManager::DeactivateWidgetL() end") ); - } -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::WidgetSuspended -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::WidgetSuspended( TBool aIsWidgetSuspended ) - { - iIsWidgetSuspended = aIsWidgetSuspended; - } -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::~CServiceWidgetServiceManager -// --------------------------------------------------------------------------- -// -CServiceWidgetServiceManager::~CServiceWidgetServiceManager() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::~CServiceWidgetServiceManager() start") ); - delete iMessageHandler; - if( iPresenceHandler) - { - TRAP_IGNORE( iPresenceHandler->ReleaseConnectionL() ); - delete iPresenceHandler ; - iPresenceHandler = NULL; - } - delete iCchHandler; - - delete iServiceName; - - if( iWidgetTimer ) - { - iWidgetTimer->StopListening(); - delete iWidgetTimer; - } - delete iBrandHandler; - - delete iInstId; - - TRACE_SWP(TXT("CServiceWidgetServiceManager::~CServiceWidgetServiceManager() end") ); - } - // --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::UpdateContentsL -// ---------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::UpdateContentsL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::UpdateContentsL() start") ); - if( !iIsWidgetSuspended ) - { - SetCurrentTextDataL(); // to set the data in box 2 and 4 : Own id and new message or invite or presence - } - TRACE_SWP(TXT("CServiceWidgetServiceManager::UpdateContentsL() end") ); - } - - // --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::SetCurrentTextDataL -// ---------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::SetCurrentTextDataL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::SetCurrentTextDataL() start") ); - iServiceState = iCchHandler->ParseGetServiceState(); - - TWSPresenceStatus showIcon = EWSLast; - iExecuteOperation = ESWALaunchServiceTab; - - TBuf firstText( KNullDesC ); - TBuf SecondText( KNullDesC); - - TRACE_SWP(TXT("CServiceWidgetServiceManager::SetCurrentTextDataL() service is complete") ); - // service configured correctly - TPtrC serviceNameWithUID = iServiceName->Left( KIMWCP_FIRSTTEXT_SIZE ); - - //serviceName is retrieved by removing KThemeUID. This text is displayed in first line of - //home screen widget when iServiceState state is ESWSNotRegistered state. - TPtrC serviceName = serviceNameWithUID.Left( serviceNameWithUID.Length() - KThemeUid().Length() ); - - TPtrC ownUser = ServiceWidgetUtils::DisplayId( iCchHandler->OwnUserIdL().Left( KIMWCP_FIRSTTEXT_SIZE ) ); - switch( iServiceState ) - { - case ESWSNetworkConnecting: - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::SetCurrentTextDataL() Connecting") ); - firstText.Append(ownUser); - HBufC* str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_CONNECTING,iEnv ); - if( str ) - { - SecondText.Append( *str ); - CleanupStack::PopAndDestroy(str); //str - } - break; - } - case ESWSUpdatingContacts: - case ESWSRegistered: - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::SetCurrentTextDataL() Enabled") ); - firstText.Append(ownUser ); - TWServiceOperationId operationId = EWSOperationUnknown; - HBufC* tempValue = NULL; - if( iPresenceHandler ) - { - // presence service supported - // take the ongoing operation - showIcon = iPresenceHandler->GetOwnStatus(); - operationId = iPresenceHandler->GetOngoingOperationId(); - if( operationId != EWSOperationComplete ) - { - // fetching is on going - tempValue = ServiceWidgetUtils::LoadResourceLC(R_QTN_SERVTAB_WIDGET_UPDATING ,iEnv ); - } - } - if( !tempValue) - { - // second row data is empty ,read it - tempValue = GetSecondRowDataLC(); - } - if( tempValue ) - { - TPtrC tempValuePtr( tempValue->Des() ); - SecondText.Append( tempValuePtr ); - CleanupStack::PopAndDestroy(tempValue); // tempValue - } - break; - } - case ESWSNetworkDisConnecting: - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::SetCurrentTextDataL() Disconnecting") ); - firstText.Append(ownUser ); - HBufC* str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_LOGGINGOUT ,iEnv); - if( str ) - { - SecondText.Append( *str ); - CleanupStack::PopAndDestroy(str); //str - } - break; - } - case ESWSWaitingForNetwork: - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::SetCurrentTextDataL() Waiting for connection") ); - // waiting for network connection mostly for service which has ALR support - firstText.Append(ownUser ); - HBufC* str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_WAITING ,iEnv); - if( str ) - { - SecondText.Append( *str ); - CleanupStack::PopAndDestroy(str); //str - } - break; - } - case ESWSNotRegistered: - default : - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::SetCurrentTextDataL() ECCHDisabled || default ") ); - firstText.Append(serviceName ); - HBufC* str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_LOGIN ,iEnv ); - if( str ) - { - SecondText.Append( *str ); - CleanupStack::PopAndDestroy(str); //str - } - iExecuteOperation = ESWALaunchSTAutoLogin; - TInt isSuccessfullLogin = KErrNone; - iSettingStore.GetL(iServiceId, EServiceSuccessfullLogin, isSuccessfullLogin ); - if( isSuccessfullLogin ) - { - iExecuteOperation = ESWAStartLogin; - } - break; - } - } -//Data to publish service Icon - TInt sericonbitmapHandle = 0 ; - TInt sericonmaskHandle = 0 ; - iBrandHandler->GetStatusBitmapL( EWSServiceIcon, sericonbitmapHandle, sericonmaskHandle ) ; - //data to publish presence icon - TInt bitmapHandle = 0; - TInt maskHandle = 0 ; - iBrandHandler->GetStatusBitmapL( showIcon, bitmapHandle, maskHandle ) ; - // publish the data to widget - iContentPublisher.PublishDataWithActionL( *iServiceName, - *iInstId, - firstText, - SecondText, - bitmapHandle, - maskHandle, - sericonbitmapHandle, - sericonmaskHandle - ); - TRACE_SWP(TXT("CServiceWidgetServiceManager::SetCurrentTextDataL() end") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::GetSecondRowDataLC -// --------------------------------------------------------------------------- -// -HBufC* CServiceWidgetServiceManager::GetSecondRowDataLC() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::GetSecondRowDataLC() start ") ); - HBufC* text = HBufC::NewLC(KIMWCP_SECONDTEXT_SIZE); - TPtr textPtr( text->Des() ); - TInt unreadCount = 0; - TInt inviteCount = 0; - HBufC* str = NULL; - - if( iMessageHandler) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::GetSecondRowDataLC() iMessageHandler ") ); - unreadCount = iMessageHandler->GetUnreadMessageCountL(); - } - if( iPresenceHandler) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::GetSecondRowDataLC() iPresenceHandler ") ); - inviteCount = iPresenceHandler->GetInviteCounts(); - } - if( ( static_cast( iPriority ) == EIMNewMessage) - && unreadCount ) // match the priority - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::GetSecondRowDataLC() unreadCount %d "), unreadCount ); - if( iMessageHandler->IsSingleMessageSender() ) - { - // single sender launch conversation view - iExecuteOperation = ESWALaunchConverView ; - } - if( unreadCount == 1 ) - { - // exactly one message show singular form - str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_ONENEWMSG , iEnv); - } - else - { - // more than one message show plural form - str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_NEWMSGS, unreadCount, iEnv ); - } - if( str ) - { - textPtr.Append( *str ); - CleanupStack::PopAndDestroy(str); //str - } - } - else if( ( static_cast( ++iPriority ) == EIMFriendInvite ) - && inviteCount ) - // match the priority - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::GetSecondRowDataLC() inviteCount %d "), inviteCount ); - if( inviteCount == 1 ) - { - // exactly one request show singular form - str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_ONEPENDREQ ,iEnv ); - } - else - { - // more than one request show plural form - str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_PENDREQ, inviteCount, iEnv ); - } - if( str ) - { - textPtr.Append( *str ); - CleanupStack::PopAndDestroy(str); //str - } - } - else if( iPresenceHandler )// this is next priority - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::GetSecondRowDataLC() iPresenceHandler ") ); - TInt totalCount = iPresenceHandler->AllBuddyCount(); - TInt onlineCount = iPresenceHandler->OnlineBuddyCount(); - TRACE_SWP(TXT("CServiceWidgetServiceManager::GetSecondRowDataLC() totalCount %d "), totalCount); - TRACE_SWP(TXT("CServiceWidgetServiceManager::GetSecondRowDataLC() onlineCount %d "), onlineCount); - // array to append online / totlal counts - CArrayFix* intArray = new ( ELeave ) CArrayFixFlat( 2 ); - CleanupStack::PushL( intArray ); - intArray->AppendL( onlineCount ); - intArray->AppendL( totalCount ); - str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_ONLINESTATUS, *intArray , iEnv ); - if( str ) - { - textPtr.Append( *str ); - CleanupStack::PopAndDestroy(str); //str - } - CleanupStack::PopAndDestroy(intArray); //intArray - } - else - { - // nothing to show in online case ,show "You are online" - str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_AVAILABLE ,iEnv ); - if( str ) - { - textPtr.Append( *str ); - CleanupStack::PopAndDestroy(str); //str - } - } - ResetPriority(); // reset to high again - TRACE_SWP(TXT("CServiceWidgetServiceManager::GetSecondRowDataLC() end ") ); - return text; // ownership to caller - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::HandleNewMessageL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::HandleNewMessageL(const TDesC& aSenderId ,const TDesC& aMessageText) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleNewMessageL() start ") ); - if( !iIsWidgetSuspended ) - { - TBuf firstText; - TBuf secondText; - TBuf additionalData( KNullDesC); - HBufC* str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_FRIEND, - ServiceWidgetUtils::DisplayId( aSenderId ), - iEnv ); - if( str ) - { - TPtr strPtr( str->Des() ); - firstText.Append( strPtr.Left( KIMWCP_FIRSTTEXT_SIZE ) ); - CleanupStack::PopAndDestroy(str); //str - } - secondText.Append( aMessageText.Left( KIMWCP_SECONDTEXT_SIZE ) ); - - additionalData.Append( aSenderId.Left( KIMWCP_ADD_DATA_SIZE ) ) ; - - //Data to be published for service icon - TInt sericonbitmapHandle = 0 ; - TInt sericonmaskHandle = 0 ; - iBrandHandler->GetStatusBitmapL( EWSServiceIcon, sericonbitmapHandle, sericonmaskHandle ) ; - - TInt bitmapHandle = 0; - TInt maskHandle = 0 ; - iBrandHandler->GetStatusBitmapL( EWSNewMessage, bitmapHandle, maskHandle ) ; - // publish the new message icon with all other data - iContentPublisher.PublishDataWithActionL( *iServiceName, - *iInstId, - firstText, - secondText , - bitmapHandle, - maskHandle, - sericonbitmapHandle, - sericonmaskHandle - ); - iExecuteOperation = ESWALaunchConverView; - if( iWidgetTimer ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleNewMessageL() timer started ") ); - iWidgetTimer->StopListening(); - iWidgetTimer->StartListening( KTimerInterval ); - } - } - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleNewMessageL() end ") ); - } - - // --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::HandleAddRequestL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::HandleAddRequestL(const TDesC& aRequesterId ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleAddRequestL() start ") ); - if( !iIsWidgetSuspended ) - { - TBuf firstText; - TBuf secondText; - - HBufC* str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_INVITE ,iEnv ); - if( str ) - { - TPtr strPtr( str->Des() ); - firstText.Append( strPtr.Left( KIMWCP_FIRSTTEXT_SIZE ) ); - CleanupStack::PopAndDestroy(str); //str - } - secondText.Append( ServiceWidgetUtils::DisplayId( aRequesterId ).Left( KIMWCP_SECONDTEXT_SIZE ) ); - // publish the last icon which is empty - TBuf additionalData( KNullDesC); - //Data to be published for service icon - TInt sericonbitmapHandle = 0 ; - TInt sericonmaskHandle = 0 ; - iBrandHandler->GetStatusBitmapL( EWSServiceIcon, sericonbitmapHandle, sericonmaskHandle ) ; - - TInt bitmapHandle = 0; - TInt maskHandle = 0 ; - iBrandHandler->GetStatusBitmapL( EWSLast, bitmapHandle, maskHandle ) ; - //Publish all data - iContentPublisher.PublishDataWithActionL(*iServiceName, - *iInstId, - firstText, - secondText, - bitmapHandle, - maskHandle, - sericonbitmapHandle, - sericonmaskHandle - ); - iExecuteOperation = ESWALaunchServiceTab; - if( iWidgetTimer ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleAddRequestL() timer started ") ); - iWidgetTimer->StopListening(); - iWidgetTimer->StartListening( KTimerInterval ); - } - } - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleAddRequestL() start ") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::HandleCountChangedL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::HandleCountChangedL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleCountChangedL() start ") ); - UpdateContentsL(); // set new data - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleCountChangedL() end ") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::HandleChangeL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::HandleChangeL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleChangeL() start ") ); - UpdateContentsL(); // new data - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleChangeL() end ") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::HandleBuddyPresenceChangeL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::HandleBuddyPresenceChangeL(const TDesC& aBuddyId, - TWSPresenceStatus aStatus, - const TDesC& aStatusText ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleBuddyPresenceChangeL() start ") ); - if( !iIsWidgetSuspended ) - { - TBuf firstText; - TBuf secondText; - HBufC* str = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_FRIEND, - ServiceWidgetUtils::DisplayId( aBuddyId ), - iEnv ); - if( str ) - { - TPtr strPtr( str->Des() ); - firstText.Append( strPtr.Left( KIMWCP_FIRSTTEXT_SIZE ) ); - CleanupStack::PopAndDestroy(str); //str - } - HBufC* statusText = NULL; - HBufC* status = NULL; - if( aStatusText.Length() ) - { - statusText = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_STATUS, - ServiceWidgetUtils::DisplayId( aStatusText ), - iEnv ); - } - else - { - TInt statusResId = R_QTN_SERVTAB_WIDGET_OFFLINE; - switch( aStatus ) - { - case EWSOnline: - { - statusResId = R_QTN_SERVTAB_WIDGET_ONLINE; - break; - } - case EWSAway: - { - statusResId = R_QTN_SERVTAB_WIDGET_AWAY; - break; - } - case EWSbusy: - { - statusResId = R_QTN_SERVTAB_WIDGET_BUSY; - break; - } - - case EWSDoNotDisturb: - { - statusResId = R_QTN_SERVTAB_WIDGET_DND; - break; - } - case EWSOnPhone: - { - statusResId = R_QTN_SERVTAB_WIDGET_ONTHEPHONE; - break; - } - case EWSOffline: - default: - { - statusResId = R_QTN_SERVTAB_WIDGET_OFFLINE; - } - } - status = ServiceWidgetUtils::LoadResourceLC( statusResId, iEnv ); - if( status ) - { - statusText = ServiceWidgetUtils::LoadResourceLC( R_QTN_SERVTAB_WIDGET_STATUS, - *status, - iEnv ); - } - } - if( statusText ) - { - TPtr statusTextPtr( statusText->Des() ); - secondText.Append( statusTextPtr.Left( KIMWCP_SECONDTEXT_SIZE ) ); - CleanupStack::PopAndDestroy(); //statusText - if( status ) - { - CleanupStack::PopAndDestroy(status); //status - } - - } - //Data to be published for service Icon - TInt sericonbitmapHandle = 0 ; - TInt sericonmaskHandle = 0 ; - iBrandHandler->GetStatusBitmapL( EWSServiceIcon, sericonbitmapHandle, sericonmaskHandle ) ; - ////////////////////////////////////////// - TInt bitmapHandle = 0; - TInt maskHandle = 0 ; - iBrandHandler->GetStatusBitmapL( aStatus, bitmapHandle, maskHandle ) ; - TBuf additionalData( KNullDesC); - iContentPublisher.PublishDataWithActionL(*iServiceName, - *iInstId, - firstText, - secondText, - bitmapHandle, - maskHandle, - sericonbitmapHandle, - sericonmaskHandle - ); - iExecuteOperation = ESWALaunchServiceTab; - if( iWidgetTimer ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleBuddyPresenceChangeL() timer started ") ); - iWidgetTimer->StopListening(); - iWidgetTimer->StartListening( KTimerInterval ); - } - } - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleBuddyPresenceChangeL() end ") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::HandleOwnStatusChangeL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::HandleOwnStatusChangeL( TWSPresenceStatus /*aStatus*/ ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleOwnStatusChangeL() start ") ); - UpdateContentsL(); - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleOwnStatusChangeL() end ") ); - } -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::HandleServiceStatusChangedL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::HandleServiceStatusChangedL( TSWSTRegistrationState aState ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleServiceStatusChangedL() start ") ); - iServiceState = aState ; - CreateHandlersL(); - UpdateContentsL(); - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleServiceStatusChangedL() end ") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::HandleTimerExpiredL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::HandleTimerExpiredL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleTimerExpiredL() start ") ); - UpdateContentsL(); // once timer expired show the current data based on availabity - TRACE_SWP(TXT("CServiceWidgetServiceManager::HandleTimerExpiredL() end ") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::CreateHandlersL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::CreateHandlersL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() start ") ); - if( iServiceState == ESWSRegistered || iServiceState == ESWSUpdatingContacts ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() ECCHEnabled ") ); - // once logged in create all interfaces - // please note this is boot blugin so keep lesser memory use - if( !iPresenceHandler && iCchHandler->IsSubServiceSupported( ECCHPresenceSub ) ) - { - TPtrC ownId = iCchHandler->OwnUserIdL(); - TPtrC str = iServiceName->Des().Left(iServiceName->Des().Length()-KThemeUid().Length()); - iPresenceHandler = CServiceWidgetPresenceHandler::NewL(*this,str,ownId ); - iPresenceHandler->GetConnectedSessionL( iCchHandler->XimpAdaptationUidL(), iServiceId ); - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() iPresenceHandler cretaed ") ); - } - if( !iMessageHandler && iCchHandler->IsSubServiceSupported( ECCHIMSub ) ) - { - TPtrC ownId = iCchHandler->OwnUserIdL(); - iMessageHandler = CServiceWidgetMessageHandler::NewL( *this, iServiceId, ownId); - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() iMessageHandler created ") ); - } - if( !iWidgetTimer && ( iPresenceHandler || iMessageHandler ) ) - { - // create the timer only if required - iWidgetTimer = CServiceWidgetTimer::NewL(*this) ; - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() iWidgetTimer created ") ); - } - } - else if( iServiceState == ESWSNotRegistered ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() ECCHDisabled ") ); - // once disconnecting off delete all interfaces - if( iWidgetTimer ) - { - delete iWidgetTimer; - iWidgetTimer = NULL; - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() iWidgetTimer deleted ") ); - } - if(iMessageHandler ) - { - delete iMessageHandler; - iMessageHandler = NULL; - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() iMessageHandler deleted ") ); - } - if( iPresenceHandler) - { - iPresenceHandler->ReleaseConnectionL(); - delete iPresenceHandler ; - iPresenceHandler = NULL; - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() iPresenceHandler deleted ") ); - } - } - TRACE_SWP(TXT("CServiceWidgetServiceManager::CreateHandlersL() end ") ); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::ServiceId -// --------------------------------------------------------------------------- -// -TInt CServiceWidgetServiceManager::ServiceId() -{ -TRACE_SWP(TXT("CServiceWidgetServiceManager::ServiceId() Manager") ); -return iServiceId; -} - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::ServiceName -// --------------------------------------------------------------------------- -// -const TDesC& CServiceWidgetServiceManager::ServiceName() -{ -TRACE_SWP(TXT("CServiceWidgetServiceManager::ServiceName() Manager") ); -return *iServiceName; -} -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::UnregisterWidgetL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::UnregisterWidgetL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::UnregisterWidgetL() Manager") ); - - iContentPublisher.UnregisterWidgetL(*iServiceName); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::RegisterWidgetL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::RegisterWidgetL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::RegisterWidgetL() Manager") ); - TInt bitmapHandle = 0 ; - TInt maskHandle = 0 ; - iBrandHandler->GetStatusBitmapL( EWSServiceIcon, bitmapHandle, maskHandle ) ; - iContentPublisher.RegisterWidgetL(*iServiceName,bitmapHandle, maskHandle); - } - -// --------------------------------------------------------------------------- -// CServiceWidgetServiceManager::ExecuteActionL -// --------------------------------------------------------------------------- -// -void CServiceWidgetServiceManager::ExecuteActionL() - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::ExecuteActionL() Manager") ); - switch( iExecuteOperation ) - { - case ESWALaunchServiceTab: - { - RxSPViewServices viewServices; - TInt err = viewServices.Activate( iServiceTabUid, - iServiceviewId ) ; - TRACE_SWP(TXT("CServiceWidgetServiceManager::ExecuteActionL() Activate = %d"), err), - User::LeaveIfError( err ); - - break; - } - case ESWALaunchConverView: - { - if( iMessageHandler && iEnv ) - { - TRACE_SWP(TXT("CServiceWidgetServiceManager::ExecuteActionL() launch cv") ); - TVwsViewId activeViewId; - CCoeAppUi* appui = iEnv->AppUi(); - appui->GetActiveViewId( activeViewId ); - IMCVLauncher::LaunchImConversationViewL(activeViewId, - iServiceId, - iMessageHandler->GetUnreadSenderId() ) ; - } - break; - } - case ESWALaunchSTAutoLogin : - { - /* - * First pack version number followed by service id. - * PhoneBook first read till EEnd and then it goes to service tab - * get the custom info in this call CVIMPSTUiTabbedView::DoActivateViewL - * aCustomMessageId is CPbk2ViewState::Uid() - * In service tab (tabbedview) we need to unpack dataPtr in similar reverse pattern - * - */ - HBufC8* data = HBufC8::NewLC( 20 ); - TPtr8 dataPtr( data->Des() ); - RDesWriteStream stream( dataPtr ); - stream.PushL(); - stream.WriteInt8L(1); // version number - stream.WriteInt8L( 0 ); //EEnd - stream.WriteInt32L( iServiceId ); //Service Id - stream.CommitL(); - - RxSPViewServices viewServices; - TInt err = viewServices.Activate( iServiceTabUid, - iServiceviewId , dataPtr ); - TRACE_SWP(TXT("CServiceWidgetServiceManager::ExecuteActionL() Activate = %d"), err), - User::LeaveIfError( err ); - CleanupStack::PopAndDestroy(); - CleanupStack::PopAndDestroy( data );// data - break; - } - case ESWAStartLogin: - { - iCchHandler->EnableServiceL(); - break; - } - default : - { - // do nothing - } - } // end of switch - - }//End ExecuteActionL -// End of File diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/cservicewidgettimer.cpp --- a/servicewidget/servicewidgetdatapublisher/src/cservicewidgettimer.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2008 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: Event listener implementation presence -* -*/ - -// INCLUDE FILES -#include "cservicewidgettimer.h" -#include "mservicewidgetobservers.h" -//system includes -#include -#include "swpdebugtrace.h" -// ================= MEMBER FUNCTIONS ======================= -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::CServiceWidgetTimer -// -------------------------------------------------------------------------- -// -CServiceWidgetTimer::CServiceWidgetTimer( MServiceWidgetTimerObserver& aObserver ) - : CActive( CActive::EPriorityStandard ), - iObserver( aObserver ) - { - CActiveScheduler::Add( this ); - } - -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::ConstructL -// -------------------------------------------------------------------------- -// -void CServiceWidgetTimer::ConstructL() - { - TRACE_SWP(TXT("CServiceWidgetTimer::ConstructL() start") ); - User::LeaveIfError( iTimer.CreateLocal() ); - TRACE_SWP(TXT("CServiceWidgetTimer::ConstructL() end") ); - } - - -// -------------------------------------------------------------------------- -// CServiceWidgetTimer::NewL -// -------------------------------------------------------------------------- -// -CServiceWidgetTimer* CServiceWidgetTimer::NewL(MServiceWidgetTimerObserver& aObserver ) - { - TRACE_SWP(TXT("CServiceWidgetTimer::NewL() start") ); - CServiceWidgetTimer* self = new(ELeave) CServiceWidgetTimer( aObserver ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - TRACE_SWP(TXT("CServiceWidgetTimer::NewL() end") ); - return self; - } -// --------------------------------------------------------- -// CServiceWidgetTimer::~CServiceWidgetTimer() -// C++ Destructor -// --------------------------------------------------------- -// -CServiceWidgetTimer::~CServiceWidgetTimer() - { - TRACE_SWP(TXT("CServiceWidgetTimer::~CServiceWidgetTimer() start") ); - Cancel(); // Cancel any request, if outstanding - iTimer.Close(); // Destroy the RTimer object - TRACE_SWP(TXT("CServiceWidgetTimer::~CServiceWidgetTimer() end") ); - } -// --------------------------------------------------------- -// CServiceWidgetTimer::RunL() -// --------------------------------------------------------- -// -void CServiceWidgetTimer::RunL() - { - TRACE_SWP(TXT("CServiceWidgetTimer::RunL() start") ); - if( iStatus.Int() == KErrNone ) - { - iObserver.HandleTimerExpiredL(); - } - TRACE_SWP(TXT("CServiceWidgetTimer::RunL() end") ); - } -// --------------------------------------------------------- -// CServiceWidgetTimer::RunL() -// --------------------------------------------------------- -// -void CServiceWidgetTimer::DoCancel() - { - TRACE_SWP(TXT("CServiceWidgetTimer::DoCancel() start") ); - iTimer.Cancel(); - TRACE_SWP(TXT("CServiceWidgetTimer::DoCancel() end") ); - } -// --------------------------------------------------------- -// CServiceWidgetTimer::StartListening() -// --------------------------------------------------------- -// -void CServiceWidgetTimer::StartListening(TTimeIntervalMicroSeconds32 anInterval) - { - TRACE_SWP(TXT("CServiceWidgetTimer::StartListening() start") ); - if(!IsActive() ) - { - iTimer.After ( iStatus, anInterval ); - SetActive (); // Tell scheduler a request is active - } - TRACE_SWP(TXT("CServiceWidgetTimer::StartListening() end") ); - } -// --------------------------------------------------------- -// CServiceWidgetTimer::StopListening() -// --------------------------------------------------------- -// -void CServiceWidgetTimer::StopListening() - { - TRACE_SWP(TXT("CServiceWidgetTimer::StopListening() start") ); - if(IsActive() ) - { - Cancel(); - } - TRACE_SWP(TXT("CServiceWidgetTimer::StopListening() end") ); - } - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 servicewidget/servicewidgetdatapublisher/src/servicewidgetutils.cpp --- a/servicewidget/servicewidgetdatapublisher/src/servicewidgetutils.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2008 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: utils class -* -*/ - - -// INCLUDES -#include "servicewidgetutils.h" -#include "servicewidgetcpglobals.h" -#include -#include -// ----------------------------------------------------------------------------- -// ServiceWidgetUtils::DisplayId -// ----------------------------------------------------------------------------- -// -TPtrC ServiceWidgetUtils::DisplayId( const TDesC& aId, - TBool aDomainHiding ) - { - TPtrC ret( aId ); - // locate ":" for userid, groupid. - // locate "/" for list id. - TInt pos = aId.FindC( aDomainHiding ? KSlash : KColon ); - if ( ( pos != KErrNotFound) && ( pos != aId.Length()-1) ) - { - // contains the special character, and it is not the last char - // remove everything before the special char (including the char) - ret.Set( aId.Mid( pos + 1 ) ); - } - if( aDomainHiding) - { - // remove also the domain part - TInt domainPos = ret.FindC( KAt ); - if ( ( domainPos != KErrNotFound ) && ( domainPos != 0 ) ) - { - ret.Set( ret.Mid( 0, domainPos ) ); - } - } - return ret; - } - -// ----------------------------------------------------------------------------- -// ServiceWidgetUtils::LoadResourceL -// give ownership to caller -// ----------------------------------------------------------------------------- -// -HBufC* ServiceWidgetUtils::LoadResourceLC( TInt aResourceId , - CCoeEnv* aEnv /*= NULL*/) - { - HBufC* ret = NULL; - if(aEnv) - { - ret = StringLoader::LoadLC( aResourceId ); - } - return ret; - } - -// ----------------------------------------------------------------------------- -// ServiceWidgetUtils::LoadResourceL -// give ownership to caller -// ----------------------------------------------------------------------------- -// -HBufC* ServiceWidgetUtils::LoadResourceLC( TInt aResourceId , - const TDesC& aText , - CCoeEnv* aEnv /*= NULL*/ ) - { - HBufC* ret = NULL; - if(aEnv) - { - ret = StringLoader::LoadLC( aResourceId, aText ); - } - return ret; - } - - // ----------------------------------------------------------------------------- -// ServiceWidgetUtils::LoadResourceL -// give ownership to caller -// ----------------------------------------------------------------------------- -// -HBufC* ServiceWidgetUtils::LoadResourceLC( - TInt aResourceId , - TInt aInt , - CCoeEnv* aEnv /*= NULL*/) - { - HBufC* ret = NULL; - if(aEnv) - { - ret = StringLoader::LoadLC( aResourceId, aInt ); - } - return ret; - } - // ----------------------------------------------------------------------------- -// ServiceWidgetUtils::LoadResourceL -// give ownership to caller -// ----------------------------------------------------------------------------- -// -HBufC* ServiceWidgetUtils::LoadResourceLC( - TInt aResourceId , - const CArrayFix& aInts , - CCoeEnv* aEnv /*= NULL*/ ) - { - HBufC* ret = NULL; - if(aEnv) - { - ret = StringLoader::LoadLC( aResourceId, aInts ); - } - return ret; - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/sis/backup_registration.xml diff -r 2b7283837edb -r 3104fc151679 servicewidget/sis/empty_file.dat diff -r 2b7283837edb -r 3104fc151679 servicewidget/sis/servicewidget.pkg --- a/servicewidget/sis/servicewidget.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -; -; 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: -; -; Installation file for STIF -; - - -; -------- general -------- - -;Language - standard language definitions -&EN - -;UID is the dll's UID -#{"servicewidget"},(0x20021383),1,1,0, TYPE=SA, RU - -;Localised Vendor name -%{"Nokia"} - -;VendorID -:"Nokia" - -; Supports Series 60 v5.2 -[0x20022E6D], 0, 0, 0, {"Series60ProductID"} - -; Files to copy - -"\epoc32\release\armv5\urel\servicewidgetdatapublisher.dll" -"!:\sys\bin\servicewidgetdatapublisher.dll" -"\epoc32\data\z\resource\servicewidgetpluginres.rsc" -"!:\resource\servicewidgetpluginres.rsc" -"\epoc32\data\z\resource\plugins\servicewidgetdatapublisher.rsc" -"!:\resource\plugins\servicewidgetdatapublisher.rsc" - -; -------- files to install for Theme-------- - -; HSPS - general (extracting files to C drive, other drives are not searched) -"..\themes\install-themes\install\servicewidget_20021383\hsps\00\widgetconfiguration.xml" - "c:\private\200159c0\import\2001f48a\101fb657\20021383\1.0\widgetconfiguration.xml" -"..\themes\install-themes\install\servicewidget_20021383\hsps\00\manifest.dat" - "c:\private\200159c0\import\2001f48a\101fb657\20021383\1.0\manifest.dat" - -; HSPS - Resources for locale 0 -"..\themes\install-themes\install\servicewidget_20021383\xuikon\00\servicewidget.o0000" - "c:\private\200159c0\import\2001f48a\101fb657\20021383\1.0\0\servicewidget.o0000" - -; HSPS - Backup -"backup_registration.xml" - "c:\private\10202D56\import\packages\20021383\backup_registration.xml" -; HSPS - trigger for post installations by the HSPS server -"empty_file.dat" - "c:\private\200159c0\import\plugin_2001f48a_101fb657_20021383_1.0.dat" - -;end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/sis/servicewidget_stub.pkg --- a/servicewidget/sis/servicewidget_stub.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -; -; 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: ServiceWidget Stub installation file. -; - -;Language -&EN - -;Header -#{"servicewidget"}, (0x20021383), 1, 0, 0, TYPE=SA - -;Localised VendorID -%{"Nokia"} - -;VendorID -:"Nokia" - -"" -"z:\sys\bin\servicewidgetdatapublisher.dll" -"" -"z:\resource\plugins\servicewidgetdatapublisher.rsc" -"" -"z:\resource\servicewidgetpluginres.r*" - -"" -"z:\private\200159c0\import\2001f48a\101fb657\20021383\1.0\widgetconfiguration.xml" -"" -"z:\private\200159c0\import\2001f48a\101fb657\20021383\1.0\manifest.dat" -"" -"z:\private\200159c0\import\2001f48a\101fb657\20021383\1.0\0\servicewidget.o0000" -"" -"z:\private\10202D56\import\packages\20021383\backup_registration.xml" -"" -"z:\private\200159c0\import\plugin_2001f48a_101fb657_20021383_1.0.dat" - -; end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/sis/servicewidget_stub.sis Binary file servicewidget/sis/servicewidget_stub.sis has changed diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/createodts.cmd --- a/servicewidget/themes/install-themes/createodts.cmd Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem -@echo off - -REM ################################################################################ -REM Xuikon/HSPS install script. Installs Xuikon themes (Creates ODT files) -REM and copies them under the HSPS projects with the same name. -REM -REM The script will do the following: -REM 1. Go through the directory names under the install\ directory -REM 2. Find .dat files under each directory and call themeinstaller.bat on -REM each of them. -REM 3. Copy the ODT-files from a temporary location to the widget directory\hsps\ -REM -REM The directory structure should look like this: -REM install\ -REM my_widget\ -REM hsps\ <<-- The HSPS Configuration files should be located here -REM xuikon\ <<-- The Xuikon theme should be located here -REM ################################################################################ - -REM If "install" directory is not found, display an error -if not exist install\ ( -goto error -) - -REM create a directory for temporary files -if not exist install_temp ( -mkdir install_temp -) - -REM go to install directory and list all directory names (that should contain the widgets) -dir /AD /B install > install_temp\install_temp.txt - -REM go through the temporary file and call install on all xuikon themes -FOR /F "tokens=1 delims=" %%i in (install_temp\install_temp.txt) do call installxuikontheme.cmd %%i - -REM delete files in temporary location and delete the temporary epoc32 dir -rmdir /S /Q install_temp\ - -goto end - -:error -echo "install" directory not found. - -:end -REM call rename_localized_xuikon_odts.pl -echo Done. diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/doinstall.cmd --- a/servicewidget/themes/install-themes/doinstall.cmd Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -@ECHO OFF -SETLOCAL - -SET INPUT_FILE=doinstall_install.dat -SET TEMP_DIR=%EPOCROOT%epoc32\winscw\c\data\Installs\test\ -SET INSTALLER_BIN=%EPOCROOT%epoc32\release\winscw\udeb\hspsThemeInstallerCons.exe -SET INSTALLER_LOG=%EPOCROOT%epoc32\winscw\c\Logs\hspsThemeInstallerCons\hspsThemeInstallerCons.log -SET ERR=0 - -if exist %TEMP_DIR% rmdir %TEMP_DIR% /s /q -xcopy * %TEMP_DIR% /s /q -%INSTALLER_BIN% %INPUT_FILE% -if %ERRORLEVEL% NEQ 0 SET ERR=1 -if exist %INSTALLER_LOG% type %INSTALLER_LOG% -if %ERR% NEQ 0 echo Failed! -echo Please move generated files from \epoc32\winscw\c\private\200159c0\themes\ path to the ROM drive! - -:end -ENDLOCAL diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/doinstall_install.dat --- a/servicewidget/themes/install-themes/doinstall_install.dat Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -install\servicewidget_20021383\hsps\00 diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/doreset.cmd --- a/servicewidget/themes/install-themes/doreset.cmd Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem -@echo off -rem ** -rem ** Execute this batch file when you want to reuse same configuration UIDs in other test configurations -rem ** - -SETLOCAL - -set tmp_path="\epoc32\winscw\c\private\200159C0" -echo Processing %tmp_path%... -if exist %tmp_path% rmdir %tmp_path% /s /q - -set tmp_path="\epoc32\release\winscw\udeb\z\private\200159C0" -echo Processing %tmp_path%... -if exist %tmp_path% rmdir %tmp_path% /s /q - -set tmp_path="\epoc32\release\armv5\urel\z\private\200159C0" -echo Processing %tmp_path%... -if exist %tmp_path% rmdir %tmp_path% /s /q - -set tmp_path="\epoc32\data\c\private\200159C0" -echo Processing %tmp_path%... -if exist %tmp_path% rmdir %tmp_path% /s /q - -set tmp_path="\epoc32\data\Z\private\200159C0" -echo Processing %tmp_path%... -if exist %tmp_path% rmdir %tmp_path% /s /q - -set tmp_path="\epoc32\data\Z\resource\homescreen" -echo Processing %tmp_path%... -if exist %tmp_path% rmdir %tmp_path% /s /q - -del \epoc32\winscw\c\private\10202be9\persists\200159c9.cre -del \epoc32\winscw\c\private\10202be9\persists\10275104.cre - -echo Done - -ENDLOCAL \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/hsps_definition.xsd --- a/servicewidget/themes/install-themes/hsps_definition.xsd Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/hsps_manifest.xsd --- a/servicewidget/themes/install-themes/hsps_manifest.xsd Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/group/bld.inf --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2008 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: bld.inf -* -*/ - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// Support for productization and Carbide.Ui customization -//******************************************************** -../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/servicewidget_20021383/hsps/manifest.dat -../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/servicewidget_20021383/hsps/widgetconfiguration.xml - -../xuikon/00/servicewidget.dat /epoc32/data/Z/resource/homescreen/servicewidget_20021383/xuikon/servicewidget_20021383.dat -../xuikon/00/servicewidget.css /epoc32/data/Z/resource/homescreen/servicewidget_20021383/xuikon/servicewidget.css -../xuikon/00/servicewidget.xml /epoc32/data/Z/resource/homescreen/servicewidget_20021383/xuikon/servicewidget.xml -../xuikon/00/servicewidget.dtd /epoc32/data/Z/resource/homescreen/servicewidget_20021383/xuikon/servicewidget.dtd - -// Arabic languages -//***************** -../xuikon/37/servicewidget.css /epoc32/data/Z/resource/homescreen/servicewidget_20021383/xuikon/37/servicewidget.css -../xuikon/50/servicewidget.css /epoc32/data/Z/resource/homescreen/servicewidget_20021383/xuikon/50/servicewidget.css -../xuikon/57/servicewidget.css /epoc32/data/Z/resource/homescreen/servicewidget_20021383/xuikon/57/servicewidget.css -../xuikon/94/servicewidget.css /epoc32/data/Z/resource/homescreen/servicewidget_20021383/xuikon/94/servicewidget.css - - -// Support for S60 localization -//***************************** -// export localizable loc files (engineering versions) -../loc/servicewidget.loc APP_LAYER_LOC_EXPORT_PATH(servicewidget.loc) - - - -// Support for S60 builds -//*********************** -// export iby files -../rom/servicewidget_20021383_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(servicewidget_20021383_resources.iby) -../rom/servicewidget_20021383_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(servicewidget_20021383_customer.iby) -../rom/servicewidget_20021383_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(servicewidget_20021383_variant.iby) -../rom/servicewidget_20021383_theme.iby CORE_APP_LAYER_IBY_EXPORT_PATH(servicewidget_20021383_theme.iby) - -// Dtd-localization -//***************** -PRJ_EXTENSIONS -START EXTENSION tools/dtd -OPTION SWITCH_LOC_FILE_NAME servicewidget_20021383 -OPTION DTD_TYPE widget -END - -PRJ_MMPFILES -PRJ_TESTMMPFILES - -// End of File \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/hsps/00/manifest.dat --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/hsps/00/manifest.dat Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - -qhd_tch -vga_tch - - - template - - - 0x2001f48a - - - 0x101fb657 - - - 0x20021383 - - - servicewidget - srw - 1.0 - - - widgetconfiguration.xml - - - - - - servicewidget.o0000 - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/hsps/00/widgetconfiguration.xml --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/hsps/00/widgetconfiguration.xml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/loc/servicewidget.loc --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/loc/servicewidget.loc Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -/* -* Copyright (c) 2008 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: Localization strings for WideImage widget (Xuikon) -* -*/ - -// d: Loading content -// l: ai_gene_pane_1_t1/opt4 -// w: -// r: 52.50+ -#define qtn_servtab_widget_loading_content "Loading content..." - -//end of file - diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/rom/servicewidget_20021383_customer.iby --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/rom/servicewidget_20021383_customer.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - -#ifndef __SERVICEWIDGET_20021383_CUSTOMER_IBY__ -#define __SERVICEWIDGET_20021383_CUSTOMER_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) -// Enabled by DTD-localization tools, language specific -data=ZPRIVATE\200159c0\install\servicewidget_20021383\xuikon\00\servicewidget.o0000 \private\200159c0\install\servicewidget_20021383\xuikon\00\servicewidget.o0000 - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH -#endif // __SERVICEWIDGET_20021383_CUSTOMER_IBY__ diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/rom/servicewidget_20021383_resources.iby --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/rom/servicewidget_20021383_resources.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - -#ifndef __SERVICEWIDGET_20021383_RESOURCES_IBY__ -#define __SERVICEWIDGET_20021383_RESOURCES_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) -// Enabled by DTD-localization tools, language specific - -data=ZPRIVATE\200159c0\install\servicewidget_20021383\xuikon\00\servicewidget.o0000 \private\200159c0\install\servicewidget_20021383\xuikon\00\servicewidget.o0000 -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH -#endif // __SERVICEWIDGET_20021383_RESOURCES_IBY__ diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/rom/servicewidget_20021383_theme.iby --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/rom/servicewidget_20021383_theme.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - -#ifndef __SERVICEWIDGET_20021383_THEME_IBY__ -#define __SERVICEWIDGET_20021383_THEME_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by DTD-localization tools -data=ZPRIVATE\200159c0\install\servicewidget_20021383\xuikon\00\servicewidget.o0000 \private\200159c0\install\servicewidget_20021383\xuikon\00\servicewidget.o0000 -data=ZPRIVATE\200159c0\install\servicewidget_20021383\hsps\00\manifest.dat \private\200159c0\install\servicewidget_20021383\hsps\00\manifest.dat - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH -#endif // __SERVICEWIDGET_20021383_THEME_IBY__ diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/rom/servicewidget_20021383_variant.iby --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/rom/servicewidget_20021383_variant.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - -#ifndef __SERVICEWIDGET_20021383_VARIANT_IBY__ -#define __SERVICEWIDGET_20021383_VARIANT_IBY__ - -#if defined(__LAYOUT_360_640_TOUCH) || defined(__LAYOUT_640_360_TOUCH) - -// Enabled by variation tools, variant specific -data=ZPRIVATE\200159c0\install\servicewidget_20021383\hsps\00\widgetconfiguration.xml \private\200159c0\install\servicewidget_20021383\hsps\00\widgetconfiguration.xml - -#endif // __LAYOUT_360_640_TOUCH || __LAYOUT_640_360_TOUCH -#endif // __SERVICEWIDGET_20021383_VARIANT_IBY__ diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.css --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.css Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#servicewidget_template{ - block-progression: rl; - direction: ltr; - nav-index: appearance; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - -} - - - -box#first_inner_box - { - width: 30%; - height: 100%; - direction: ltr; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:90%; - } - - -box#second_inner_box - { - width: 100%; - height: 100%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box - { - width: 100%; - height: 50%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box1 - { - margin-left:0%; - width: 80%; - height: 100%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box2 - { - margin-top: 4%; - margin-bottom: 4%; - margin-left:0%; - margin-right:0.5%; - width: 15%; - height: 90%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#fourth_inner_box - { - width: 100%; - height: 50%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } -image.first_image - { - margin-top: 10%; - margin-left: 10%; - width: 60%; - height: 80%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -image.second_image - { - margin-top: 20%; - width: 60%; - height: 60%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -text.first_text - { - visibility: visible; - position: static; - text-align: left; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - font-weight: bold; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - } - -text.second_text - { - visibility: visible; - position: static; - text-align: left; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - margin-top:1%; - } diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.dat --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.dat Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - 2001CB4F - 101FB657 - 11001353 - servicewidget - servicewidget - 1.0 - servicewidget.xml - servicewidget.css - servicewidget.dtd - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.dtd --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.dtd Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.o0000 Binary file servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.o0000 has changed diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.xml --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/00/servicewidget.xml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - &qtn_servtab_widget_loading_content; - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/37/servicewidget.css --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/37/servicewidget.css Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#servicewidget_template{ - block-progression: rl; - direction: rtl; - nav-index: appearance; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - -} - - -box#first_inner_box - { - width: 30%; - height: 100%; - direction: ltr; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:90%; - } - - -box#second_inner_box - { - width: 100%; - height: 100%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box - { - width: 100%; - height: 50%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box1 - { - margin-left:0%; - width: 80%; - height: 100%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box2 - { - margin-top: 4%; - margin-bottom: 4%; - margin-left:0%; - margin-right:0.5%; - width: 15%; - height: 90%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } -box#fourth_inner_box - { - width: 100%; - height: 50%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -image.first_image - { - margin-top: 10%; - margin-left: 10%; - width: 60%; - height: 80%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -image.second_image - { - margin-top: 20%; - width: 60%; - height: 60%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -text.first_text - { - visibility: visible; - position: static; - text-align: right; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - font-weight: bold; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - } - -text.second_text - { - visibility: visible; - position: static; - text-align: right; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - margin-top:1%; - } - diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/50/servicewidget.css --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/50/servicewidget.css Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#servicewidget_template{ - block-progression: rl; - direction: rtl; - nav-index: appearance; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - -} - - -box#first_inner_box - { - width: 30%; - height: 100%; - direction: ltr; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:90%; - } - - -box#second_inner_box - { - width: 100%; - height: 100%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box - { - width: 100%; - height: 50%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box1 - { - margin-left:0%; - width: 80%; - height: 100%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box2 - { - margin-top: 4%; - margin-bottom: 4%; - margin-left:0%; - margin-right:0.5%; - width: 15%; - height: 90%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } -box#fourth_inner_box - { - width: 100%; - height: 50%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -image.first_image - { - margin-top: 10%; - margin-left: 10%; - width: 60%; - height: 80%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -image.second_image - { - margin-top: 20%; - width: 60%; - height: 60%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -text.first_text - { - visibility: visible; - position: static; - text-align: right; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - font-weight: bold; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - } - -text.second_text - { - visibility: visible; - position: static; - text-align: right; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - margin-top:1%; - } - diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/57/servicewidget.css --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/57/servicewidget.css Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#servicewidget_template{ - block-progression: rl; - direction: rtl; - nav-index: appearance; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - -} - - -box#first_inner_box - { - width: 30%; - height: 100%; - direction: ltr; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:90%; - } - - -box#second_inner_box - { - width: 100%; - height: 100%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box - { - width: 100%; - height: 50%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box1 - { - margin-left:0%; - width: 80%; - height: 100%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box2 - { - margin-top: 4%; - margin-bottom: 4%; - margin-left:0%; - margin-right:0.5%; - width: 15%; - height: 90%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } -box#fourth_inner_box - { - width: 100%; - height: 50%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -image.first_image - { - margin-top: 10%; - margin-left: 10%; - width: 60%; - height: 80%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -image.second_image - { - margin-top: 20%; - width: 60%; - height: 60%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -text.first_text - { - visibility: visible; - position: static; - text-align: right; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - font-weight: bold; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - } - -text.second_text - { - visibility: visible; - position: static; - text-align: right; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - margin-top:1%; - } - diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/94/servicewidget.css --- a/servicewidget/themes/install-themes/install/servicewidget_20021383/xuikon/94/servicewidget.css Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -widget#servicewidget_template{ - block-progression: rl; - direction: rtl; - nav-index: appearance; - padding-top: 5px; - padding-bottom: 5px; - padding-left: 3px; - -} - - -box#first_inner_box - { - width: 30%; - height: 100%; - direction: ltr; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:90%; - } - - -box#second_inner_box - { - width: 100%; - height: 100%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box - { - width: 100%; - height: 50%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box1 - { - margin-left:0%; - width: 80%; - height: 100%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -box#third_inner_box2 - { - margin-top: 4%; - margin-bottom: 4%; - margin-left:0%; - margin-right:0.5%; - width: 15%; - height: 90%; - direction: ltr; - block-progression: tb; - nav-index:auto; - background-size:98%; - } -box#fourth_inner_box - { - width: 100%; - height: 50%; - direction: rtl; - block-progression: tb; - nav-index:auto; - background-size:98%; - } - -image.first_image - { - margin-top: 10%; - margin-left: 10%; - width: 60%; - height: 80%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -image.second_image - { - margin-top: 20%; - width: 60%; - height: 60%; - visibility: visible; - position: static; - _s60-aspect-ratio:preserve; - } - -text.first_text - { - visibility: visible; - position: static; - text-align: right; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - font-weight: bold; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - } - -text.second_text - { - visibility: visible; - position: static; - text-align: right; - margin-left:6px; - font-family: EAknLogicalFontSecondaryFont; - color: "SKIN(268458534 13056 74)"; - font-size: 23px; - margin-top:1%; - } - diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/installxuikontheme.cmd --- a/servicewidget/themes/install-themes/installxuikontheme.cmd Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem -@echo off - -REM go to widget directory and store a list of widget .dat files -dir /B install\%1\xuikon\00\*.dat > install_temp\widget_temp.txt - -REM go through the temporary file and call install on all xuikon themes -FOR /F "tokens=1 delims=" %%i in (install_temp\widget_temp.txt) do call themeinstaller.bat install\%1\xuikon\00\%%i install_temp - -REM find odt files+resources install_temp\odt_temp.txt - -REM copy odt files to the widget\hsps directory -FOR /F "tokens=1 delims=" %%j in (install_temp\odt_temp.txt) do xcopy /F /R %%j install\%1\xuikon\00\ - -REM delete the odt files from the temporary location -FOR /F "tokens=1 delims=" %%j in (install_temp\odt_temp.txt) do del %%j - -del install_temp\widget_temp.txt -del install_temp\odt_temp.txt diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/rename_localized_xuikon_odts.pl --- a/servicewidget/themes/install-themes/rename_localized_xuikon_odts.pl Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -# -# 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: -# -#!/usr/bin/perl -use File::Copy; -use File::Find; - -print("Start to move localized xuikon odts to folders named by language number\n"); - -# go through all directories and subdirectories -find(\&MoveLocalized, '.'); - -sub MoveLocalized -{ - # if we are in hsps folder move localized xuikon odts - if ($File::Find::name =~ /\/hsps\//g) - { - #print("Processing folder $File::Find::dir\n"); - $File::Find::prune = 1; - # move localized xuikon odts to folders named by language index - while(<*.o*>) - { - # Find position of suffix (search for ".o") - $suffix = $_; - $suffix =~ /\.o/g; - - # name of localized dir is last four characters of file - $dirname = substr($_, pos($suffix), 4); - # don't move engineering english version - if ($dirname != "0000") - { - print("\nold file = $File::Find::dir/$_\n"); - # remove zeros from beginning - $dirname += 0; - # create folder - mkdir($dirname); - # move file to folder and rename it - $newlocation = $dirname ."/" .$_; - move($_, $newlocation); - $oldname = $newlocation; - $newlocation =~ s/\.o(.*)$/\.o0000/; - print("new file = $File::Find::dir/$newlocation\n"); - rename $oldname, $newlocation; - } - } - } -} - - -exit; \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/themeinstaller.bat --- a/servicewidget/themes/install-themes/themeinstaller.bat Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -@ECHO OFF - -REM Configuration -setlocal -set JRE_BIN_DIR="C:\APPS\j2sdk_1.6.0_02\jre\bin" -set INSTALL_DIR="/epoc32/tools/themeinstaller" - -REM Verify that the JRE exists -if not exist %JRE_BIN_DIR%\java.exe goto jrenotfound - -REM Verify that the theme installer exists -if not exist %INSTALL_DIR%\themeinstaller.jar goto installernotfound - -REM Execute ThemeInstaller -%JRE_BIN_DIR%\java -Dfile.encoding=ISO8859_1 -classpath %INSTALL_DIR%/themeinstaller.jar;%INSTALL_DIR%/lib/batik-util.jar;%INSTALL_DIR%/lib/xml-apis-ext.jar;%INSTALL_DIR%/lib/batik-css.jar;%INSTALL_DIR%/lib/xercesimpl.jar com.nokia.tools.themeinstaller.ui.ThemeInstaller %1 %2 %3 %4 %5 %6 -goto exitpoint - -:jrenotfound -echo. -echo Error: Java Runtime Environment not found from the JRE_BIN_DIR: %JRE_BIN_DIR% -echo Configure the JRE location to themeinstaller.bat file. -goto exitpoint - -:installernotfound -echo. -echo Error: themeinstaller.jar not found from the INSTALL_DIR: %INSTALL_DIR% -echo Configure the install location to themeinstaller.bat file. -goto exitpoint - -:exitpoint \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/themeinstaller.jar Binary file servicewidget/themes/install-themes/themeinstaller.jar has changed diff -r 2b7283837edb -r 3104fc151679 servicewidget/themes/install-themes/validate.cmd --- a/servicewidget/themes/install-themes/validate.cmd Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -@ECHO OFF -SETLOCAL - -SET PATH_LINT=C:\Apps\libxml2-2.6.23.win32\bin\xmllint.exe -SET PATH_MANIFEST_XSD=hsps_manifest.xsd -SET PATH_DEFINITION_XSD=hsps_definition.xsd - -IF NOT EXIST %PATH_MANIFEST_XSD% GOTO ERR_XSD -IF NOT EXIST %PATH_DEFINITION_XSD% GOTO ERR_XSD - -SET ARGS_MANIFEST=--schema %PATH_MANIFEST_XSD% --noout -SET ARGS_DEFINITION=--schema %PATH_DEFINITION_XSD% --noout - -echo. -echo Validating AI3 against the HSPS schema files... -echo. -%PATH_LINT% .\install\wideimage\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\wideimage\hsps\widgetconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\onerow\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\onerow\hsps\widgetconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\tworows\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\tworows\hsps\widgetconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\threerows\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\threerows\hsps\widgetconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\threetextrows\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\threetextrows\hsps\widgetconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\organizer\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\organizer\hsps\widgetconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\root\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\root\hsps\rootconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\shortcut\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\shortcut\hsps\widgetconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\shortcut2\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\shortcut2\hsps\widgetconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\view\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\view\hsps\viewconfiguration.xml %ARGS_DEFINITION% - -%PATH_LINT% .\install\empty\hsps\manifest.dat %ARGS_MANIFEST% -%PATH_LINT% .\install\empty\hsps\widgetconfiguration.xml %ARGS_DEFINITION% - -GOTO END - -:ERR_LINT -ECHO XMLLint was not found! Personlize the PATH_LINT variable in %0 and download the tool from HSPS's support pages. -GOTO END - -:ERR_XSD -ECHO Schemas were not found at %PATH_MANIFEST_XSD% and %PATH_DEFINITION_XSD%! -GOTO END - -:END - -ENDLOCAL \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 sysdef_1_4_0.dtd --- a/sysdef_1_4_0.dtd Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/Group/backup_registration.xml --- a/uiservicetab/Group/backup_registration.xml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/Group/bld.inf --- a/uiservicetab/Group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2008 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: Build information file for IMUIServiceTab -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -// component has to export its .iby files -// exporting the imvuiservice tab's iby files -../rom/imuiservicetab.iby CORE_APP_LAYER_IBY_EXPORT_PATH(imuiservicetab.iby) -../rom/imuiservicetabresources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(imuiservicetabresources.iby) - -../inc/mimpstuiaiwitemcontrol.h APP_LAYER_PLATFORM_EXPORT_PATH( mimpstuiaiwitemcontrol.h ) -../inc/mcommandmapper.h APP_LAYER_PLATFORM_EXPORT_PATH( mcommandmapper.h ) -../inc/cmenuextension.h APP_LAYER_PLATFORM_EXPORT_PATH( cmenuextension.h ) -../inc/servicetabmenuextensioncommand.rh APP_LAYER_PLATFORM_EXPORT_PATH( servicetabmenuextensioncommand.rh) -../inc/servicetabmenucommandinfo.hrh APP_LAYER_PLATFORM_EXPORT_PATH( servicetabmenucommandinfo.hrh) -// ROM SIS stubs -../sis/uiservicetabstub.sis /epoc32/data/Z/System/Install/uiservicetabstub.sis -// Backup registration files -backup_registration.xml /epoc32/data/z/private/20012423/backup_registration.xml -backup_registration.xml /epoc32/release/winscw/udeb/z/private/20012423/backup_registration.xml -backup_registration.xml /epoc32/release/winscw/urel/z/private/20012423/backup_registration.xml -// MMP files for project components -PRJ_MMPFILES - - -#include "../vimpstutils/group/bld.inf" -#include "../vimpststorage/group/bld.inf" -#include "../vimpstengine/group/bld.inf" -#include "../vimpstcmdprocess/group/bld.inf" -#include "../vimpstui/group/bld.inf" -#include "../vimpstdetailsviewplugin/group/bld.inf" - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/cmenuextension.h --- a/uiservicetab/inc/cmenuextension.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2008 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: cmenuextension.h - * -*/ - -#ifndef __CMENUEXTENSION_H__ -#define __CMENUEXTENSION_H__ - - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CEikMenuPane; -class MCommandMapper; -class MVIMPSTUiAIWControl; - - -//CONSTANTS -const TUid KMenuCustomisationInterfaceUid = { 0x2002139E }; - -// CLASS DECLARATION - -/** - * Abstract interface for menuextensions. extension plugins can - * extend service tab menu by implementing a class derived from this. - */ -class CMenuExtension : public CBase - { - - public: - - static CMenuExtension* CreateImplementationL( TUid aUid ); - - virtual ~CMenuExtension(); - - public: // Interface - /** - * Filters the menu pane of the plugin connected to this. - * - * @param aPreviousId Menu command id after which the plugins menu - * should come. - * @param aMenuPane Menu pane which will be filtered. - * @param aServiceId service id. - * @param aMenuExtManager, MenuExtention manager of service tab - */ - virtual void DynInitMenuPaneL - (TInt aPreviousId, CEikMenuPane& aMenuPane,TUint aServiceId, MVIMPSTUiAIWControl& aMenuExtManager) = 0; - - /** - * Handles service tab extension commands. - * - * @param aCommandId Command ID. - * - * @return ETrue if command was handled, otherwise EFalse. - */ - virtual TBool HandleCommandL(const TInt& aCommand ) = 0; - - /** - * Registers command ID mapper. This method is called automatically - * by Servicetab menu extneions at initialization phase. - * - * @param aMapper Command ID mapper - */ - virtual void RegisterCommandMapper( MCommandMapper& aMapper ) = 0; - - /** - * Gets STM_COMMAND_INFO_ARRAY resource. Resource should be loaded. - * - * @return Resource ID or KErrNotFound - */ - virtual TInt CommandInfoResource() const = 0; - - - private: - /** - * Instance identifier key. When instance of an implementation is - * created by ECOM framework, the framework will assign a UID for - * it. The UID is used in the destructor to notify framework that - * this instance is being destroyed and resources can be released. - * Plugin implementations should leave this untouched, as the inline - * destructor and constructor method take care of ECom releasing. - */ - TUid iDtor_ID_Key; - - - }; -inline CMenuExtension* CMenuExtension::CreateImplementationL( TUid aUid ) - { - TAny* ptr = REComSession::CreateImplementationL( aUid, _FOFF( CMenuExtension, iDtor_ID_Key ) ); - CMenuExtension* impl = static_cast (ptr); - return impl; - } - -inline CMenuExtension::~CMenuExtension() - { - REComSession::DestroyedImplementation( iDtor_ID_Key ); - } - -#endif // __MXSPVIEW_H__ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/mcommandmapper.h --- a/uiservicetab/inc/mcommandmapper.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2008 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: mcommandmapper.h - * -*/ - -#ifndef __MCOMMANDMAPPER_H__ -#define __MCOMMANDMAPPER_H__ - - -// INCLUDES -#include - -// CLASS DECLARATION - - -/** - * Abstract interface for getting mapped command IDs. Command ID mapping - * means that xSP's own "Names List" command IDs ( constants that are usually - * defined in a *.hrh file ) are substituted with IDs provided by Extension - * Manager. This is needed because there may be extensions using same - * "Names List" command IDs. After the substitution, the original IDs are - * not valid anymore. Still, in order to allow original "Names List" - * command IDs usage inside the xSP's own code, MxSPCommandMapper provides the - * mechanism for retrieving new IDs which correspond to the old original - * ones and vice versa. - */ -class MCommandMapper - { - public: - /** - * Gets old original "Service Tab" command ID which corresponds - * to the given new one - * - * @param aPluginId implementation ID for identification - * @param aNewCommand New mapped command ID - * @param aOldCommand On return old/original command ID - * @return KErrNone if mapping exist, otherwise KErrNotFound - */ - virtual TInt GetOldCommand( TInt32 aPluginId, - TInt aNewCommand, - TInt& aOldCommand ) const = 0; - - /** - * Gets new mapped "ServiceTab" command ID which corresponds - * to the given old one - * - * @param aPluginId implementation ID for identification - * @param aOldCommand Old/original command ID - * @param aNewCommand On return new mapped command ID - * @return KErrNone if mapping exist, otherwise KErrNotFound - */ - virtual TInt GetNewCommand( TInt32 aPluginId, - TInt aOldCommand, - TInt& aNewCommand ) const = 0; - - protected: // Protected interface - - /** - * Destructor. - */ - virtual ~MCommandMapper() - {}; - - }; - - -#endif // __MCOMMANDMAPPER_H__ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/mimpstuiaiwitemcontrol.h --- a/uiservicetab/inc/mimpstuiaiwitemcontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2008 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: Interface to hide/unhide AIW menu in service tab - * -*/ - -#ifndef MVIMPSTUIAIWITEMCONTROL_H -#define MVIMPSTUIAIWITEMCONTROL_H - - -class MVIMPSTUiAIWControl - { -public: - virtual void SetAIWItemDimmed(TInt aCommand, TBool aHide) = 0; - }; - -#endif // MVIMPSTUIAIWITEMCONTROL_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/servicetabmenucommandinfo.hrh --- a/uiservicetab/inc/servicetabmenucommandinfo.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2008 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:servicetabmenucommandinfo.hrh - * -*/ - -#ifndef __SERVICETABMENUCOMMANDINFO_HRH__ -#define __SERVICETABMENUCOMMANDINFO_HRH__ - - -// Command range allocated to xSP Extension Manager -#define EServiceTabMenuExtensionFirstCommand 40700 -#define EServiceTabMenuExtensionFirstFreeCommand 40702 -#define EServiceTabMenuExtensionLastCommand 40799 - - -#endif // __SERVICETABMENUCOMMANDINFO_HRH__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/servicetabmenuextensioncommand.rh --- a/uiservicetab/inc/servicetabmenuextensioncommand.rh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2008 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: servicetabmenuextensioncommand.rh - * -*/ - -STRUCT STM_COMMAND_INFO //SERVICETABMENU_COMMAND_INFO - { - // non-mapped command id - LONG oldId; - } - -STRUCT STM_COMMAND_INFO_ARRAY //SERVICETABMENU_COMMAND_INFO_ARRAY - { - STRUCT items[]; - } - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/tvimpstconsts.h --- a/uiservicetab/inc/tvimpstconsts.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ -/* -* Copyright (c) 2008 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: constant for VIMST ui service tab -* -*/ - - -#ifndef TVIMPSTCONSTS_H -#define TVIMPSTCONSTS_H - -//includes -#include "tvimpstenums.h" -//TODO:: uncomment this once the phonebook exprots this header file. -//#include - -//constants - -_LIT( KResourceDir, "\\resource\\" ); -_LIT( KResourceFileName, "vimpstuires.rsc" ); -_LIT( KDefaultIconFile, "\\resource\\apps\\vimpstui.mif" ); - -const TInt KMaxResourcePathLength = 512; - -//used to show info not for the fetaures which are not supported yet -_LIT(KNotSupportedMessage,"Selected feature not yet supported !"); - -_LIT(KColon,":"); // TODO: get this service name from service tables - -const TInt KProtocolUidTelepathy = 0x101FB3E7;//0x111fffff; // telepathy. - -const TInt KProtocolUid12 = 0x10282EE9 ; // imps 1.2 new uid - -const TInt KProtocolUid13 = 0x10282EEA ; // imps 1.3 id - -const TInt32 KAppId = 11; - -const TInt KFriendsListMaxIdentificationLength = 100; -const TInt KUsernameMaxLength = 100; -const TInt KPasswordMaxLength = 50; -const TInt KOwnDataIndex = 0; -const TInt KStatusMsgMaxLength = 75; - -_LIT(KUserId ,"testui123@gmail.com") ; -_LIT(KPassword,"test_ui123") ; -_LIT(KAddress,"talk.google.com") ; - - -_LIT(Kview1,"View1"); - -// xmpp use signle default list -_LIT(KFriendList ,"buddyList"); -_LIT(KIMContactListId,"buddyList"); -_LIT(KVPContactListId,"VPContacts"); - -//Used for iStores->Find -_LIT(KPbkDefaultContactDb,"contacts.cdb"); - -//Used for iStores->Find -_LIT(KVIMDefaultContactDb,"vimpststore.cdb"); - - -// used for constructing the DB path -_LIT( KCntDbURIDomain, "cntdb://" ); -_LIT( KCntDbPrivateDrive, "c:" ); - -_LIT( KPhoneBookDbURI, "cntdb://c:contacts.cdb"); - -//used for constructing DB name. -_LIT(KUnderscore, "_"); - -const TInt KPropertyMaxLength = 512; -const TInt KMaxSearchLimit = 10; -const TInt KTelInternetFieldLength = 512; -const TInt KLisBoxItem = 160; -const TUint KIconIdMaxLength( 128 ); -_LIT( KListItemFormatRegistered, "%d\t%S\t\t%d" ); -_LIT( KListItemFormatBlockList, "%d\t%S" ); -_LIT( KListItemFormatSelectContact, "%d\t%S" ); - -_LIT(KImppPresencePrefix, "impp:"); -_LIT(KVoipPresencePrefix, "voip:"); - - -const TInt KMaxLengthOfAddress = 512; - -// CONSTANTS -const TInt KNumberGranularity( 12 ); - -const TInt KMediumAmountOfContacts = 64; -const TInt KLargeAmountOfContacts = 200; - -_LIT(KTab, "\t"); -_LIT(KSpace, " "); - - -// CONSTANTS -const TInt KCColumn = 2; -//const TInt KPrimaryFont = 0; -const TInt KSecondaryFont = 1; - -// A Column Icons -_LIT( KContactOfflineIconA, "0\t" ); -_LIT( KContactOnlineIconA, "1\t" ); -_LIT( KListAwayIcon, "2\t" ); -_LIT( KListBusyIcon, "3\t" ); -_LIT( KListInvisibleIcon, "4\t" ); -_LIT( KEmptyIconA, "\t" ); -_LIT( KEmptyIconC, "\t" ); -_LIT( KContactOpenConvIcon, "5\t" ); -_LIT( KContactNewMsgIcon, "6\t" ); -_LIT( KDefaultAvatar, "7\t" ); -_LIT( KLocalPendingRequest, "8\t" ); -_LIT( KRemotePendingRequest, "9\t" ); -_LIT( KLocalPendingRequestOffline, "10\t" ); -_LIT( KRemotePendingRequestOffline, "11\t" ); -_LIT( KFrndOnMobileIcon, "12\t" ); -_LIT( KFrndBlockedIcon, "13\t" ); -_LIT( KCallForward, "14\t" ); - -const TInt KDataArraySize = 5; - - -const TInt KVIMPSTUISPSMaxPropertyLength = 512; - -const TInt KVIMPSTTabbedViewIdBase = 10000; - -const TInt KVIMPSTSearchViewIdBase = 10101; - -const TInt KVIMPSTBlockedViewIdBase = 10150; -// own status -// For own status -const TInt KAmountOfOwnStatusStates = 3; -const TInt KOnlineIconIndex = 0; -//Tab format for listbox item with an icon -_LIT( KTabFormat, "%d\t"); -const TInt KTabFormatLenght = 4; - -const TInt KStatusTextLength = 40; - -const TInt KMaxStatusMessageCount = 4; - -const TInt KStatusMessageHeaderLength = 3; // length of status message header. -const TInt KSearchStringLength = 50; - -const TInt KArrayGranularity = 500; -// KStatusMessageHeaderLength must be used as amount of characters for format. -_LIT( KStatusMessageHeaderFormat, "%3d" ); -_LIT( KStatusMessageHeaderLengthFormat, "%d" ); // This is length of header. - -// StatusText attribute value tags -_LIT8( KStatusTextfield, "StatusText"); - -_LIT( KAvailable, "available"); -_LIT( KBusy, "dnd"); -_LIT( KAway, "away"); -_LIT( KXa, "xa"); -_LIT( KHidden, "hidden"); -_LIT( KOffline, "offline"); -_LIT (KNetworkError, "Waiting for Connection"); -_LIT(KFileName, "c:\\FILENAME.CPP"); - - -// CONSTANTS -#define KJPegType _L("image/jpeg") -#define KGifType _L("image/gif") -#define KPngType _L("image/png") - -// From ICL documentation: -// "all decoder plugins also support thumbnail decodes with ratios of 1:2, 1:4 and 1:8." -const TInt KDecodeScaleRatioMin = 2; -const TInt KDecodeScaleRatioMax = 8; -const TInt KMaxListItemLength = 100; - - -_LIT(KAt,"@"); -//TODO:: to be enabled once the phonebook exports ExtensionManager.hrh -//#define KVIMPSTTabbedViewIdBase 10001 //EExtensionManagerTabViewStartId -//#define KVIMPSTSearchViewIdBase 10101 //EExtensionManagerViewStartId - -// Database overhead -const TInt KEmptyDbSize = 1024; -_LIT( KContactId, "ContactId" ); -_LIT( KContactTable, "Contacts" ); -// Name for database. -_LIT( KStorageExtn, ".db"); -//hardcoded path for the local service db file. -_LIT(KDbPath, "c:\\MeCo\\"); - -#endif // TVIMPSTCONSTS_H - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/tvimpstenums.h --- a/uiservicetab/inc/tvimpstenums.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,505 +0,0 @@ -/* -* Copyright (c) 2008 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: enum for service tab -* -*/ - -#ifndef TVIMPSTENUMSPC_H -#define TVIMPSTENUMSPC_H - -#include -#include - -/* - This is main interface of arraywrapper on Process component side. - UI Side array decorator has to use this array and get the details required.... - - -*/ -//FORWARD DECLARATION -class MCCAParameter; -class MCCAConnection; - -/** - * structure - * encapsulating data required for search - */ -struct TVIMPSTSearchData - { - TPtrC iFirstName; /*First name*/ - TPtrC iLastName; /*Last name*/ - TPtrC iEmailId; /*Email Id*/ - }; - -/** - * structure - * TSendData for temp use,to be removed later - */ -struct TSendData - { - TPtrC msgText; /* actual message to be sent*/ - TPtrC recipientID; /* Id of hte receiver of the msgText.*/ - - }; - -/** - * structure - * TNewContact encpsulating data required for addaing a new contact. - */ -struct TNewContact - { - TPtrC listId; /* list id*/ - TPtrC displayName; /* display name*/ - TPtrC userId; /* user id */ - - }; - -/** - * structure - * TLaunchCCAData encpsulating data required for launching the details view - */ -struct TLaunchCCAData - { - MCCAParameter* iParameter; /* parameter */ - MCCAConnection* iConnection;/* connection */ - TInt iIndex; /* index of the contact */ - - }; - -/** - * structure - * TAddFriendResponse encpsulating data required for sending - * accapted/ rejected reactive authorization response. - */ -struct TAddFriendResponse - { - const TDesC& iRequesterId ; /* user id of the requestor*/ - TBool iResponse; // Accepted/Declined ETrue/EFalse - }; - -/** - * structure - * TVoipData encpsulating data required for voip - */ -struct TVoipData - { - TInt iWindowGroup; /* window group*/ - TInt iIndex; /* index of the contact */ - TUint32 iServiceId; /* service id*/ - }; -/** - * TVPbkSelectedData encapsulating data required for - * adding contact from phone book - * iPackedLinks HBufC8 pointer to hold packed links from selection dialog. - * iXSPList array of xsp id(s) retrived based on iPackedLinks. - */ -struct TVPbkSelectedData - { - HBufC8* iPackedLinks; - RPointerArray iXSPList; - }; -// CLASS DECLARATION - -/** - * TVIMPSTEnums all the enms and structures used across the application are defined here. - * @lib vimpstengine.lib - * @since 5.0 - */ -class TVIMPSTEnums - { - - public: // Enumerations and typedefs - - /** - * A enum - * to identify which type of service. - */ - enum TServiceIds - { - EXmppService = 0, /* xmmp service */ - EXizmoService /* gizmo service */ - }; - - - - enum SubServiceType - { - EVoip, - EPresence, - EIM, - ELast - }; - - enum ExtentionType - { - ESearch, - EBlocking, - EContactManagement, - EExtentionLast - }; - - enum FeatureSupport - { - ESupportUnKnown, - ESupported, - ENotSupported - }; - - /** - * A enum - * Registration states to control views - */ - enum TVIMPSTRegistrationState - { - ESVCENotRegistered = 0,/* Service Not registered*/ - ESVCERegistered = 0x8, /* Service registered */ - ESVCENetworkConnecting = 0x4, /* service connecting */ - ESVCEWaitingForNetwork = 0x2, /* service waiting for connection*/ - ESVCENetworkDisConnecting = 0x1, /* service disconnecting */ - ESVCEUpdatingContacts = 0x10 - }; - - - /** - * A enum - * to identify Type of operation - */ - enum TOperationType - { - EAddItem, /* Add item */ - ERemoveItem, /* Remove Item */ - EUpdateItem /* Update Item */ - }; - - /** - * A enum - * to identify errors. - */ - enum TImpsCSPAllErrors - { - EImpsErrNone = 0, /* no error */ - ECSPInsufficientGroupPrivileges, /* Insufficient group privileges error */ - ECSPNotSupported, /* Not supported error */ - ECSPInvalidParameter, /* Invalid parameter error */ - ECSPMultipleErrors /* general error */ - }; - - /** - * A enum - * to identify Type of item - */ - enum TItem - { - EInvalid = -1, /* unknown Item */ - EOwnStatusItem, /* Own item */ - EContactItem, /* Contact Item */ - EContactListItem, /* ContactList Item */ - EFriendRequestItem,/* Friend request item */ - EUnknonContactItem /* contact item but not in friend list */ - }; - - /** - * A enum - * to identify the onlne status - */ - enum TOnlineStatus - { - EUnknown = -1, /* unknown status */ - EOffline, /* Offline status */ - EOnline, /* Online status */ - EInvisible, /* Invisible status */ - EAway, /* Away status */ - EBusy, /* Busy status */ - EOnPhone, - EDoNotDisturb, - EPending, - EBlocked, - EServiceOut, - ECallForward - }; - - /** - * A enum - * ximp context states. - */ - enum TLoginState - { - EOffLine = 0, /* Context is inactive */ - ELogging, /* Context is binding to service */ - ELoggedIn, /* Context is active and binded to service */ - ELoggingOut, /* Context is unbinding from service */ - ERequestComplete, /* user cancel login */ - ELoggingCancel /* user cancel ongoing login */ - }; - - /** - * A enum - * Type of note - */ - enum TNoteType - { - EUnKnown = -1, /* unknown note type*/ - EWaiteNote, /* Wait note */ - EInfoNote, /* Info note */ - EWaiteNoteWithRSK, /* wait note with RSK */ - EConfirmationNote, /* Confirmation Note */ - EInformationNote /* Information note.*/ - }; - /** - * A enum - * request presence - */ - enum TVIMPSTPresenceRequestStatus - { - ESVCEPresenceRequestStatusUnKnown = -1, //unknown presence statusRequest Status might be NotFound - ESVCEPresenceRequestStatusAlwaysAsk = 0, /* ask when ever there si a request for presence.*/ - ESVCEPresenceRequestStatusAutoAccept /* auto accept when ever there is a request for presence.*/ - }; - - - - /** - * A enum - * Presence event - */ - enum TVIMPSTPresenceEvent - { - ESVCENoEvent = 0, /* No presence Event */ - ESVCERemotePartyAcceptedPresenceRequest, /* Remote contact accepted the presence request. */ - ESVCEExtensionRemotePartyBlockedYou, /* Remote contact blocked you */ - ESVCERemotePartyWantsToWatchYou /* remote contact requested for the your presence. */ - }; - - /** - * A enum - * Filter type for getting right contacts. - * Tells us what to show; for example EFilterAll - * does not filter out any statuses: all contacts are shown - */ - enum TFilterType - { - EFilterNotDefined = -1, /* Filter Not defined */ - EFilterAll = 0, /* Filter All*/ - EFilterAndOperation = 1, /* Filter based on AND operation*/ - EFilterOnline = 2, /* Fileter online */ - EFilterNonBlocked = 4, /* Filter non blocked */ - EFilterAway = 8, /* Filter Away */ - EFilterNonOffline = 16 /* this means online and away */ - }; - - /** - * A enum - * to identify client type - */ - enum TClientType - { - EUnknownClient = 0, /* Unknown Client*/ - EMobile, /* Mobile Client*/ - EPC /* PC Client*/ - }; - - /** - * A enum - * observer event types - */ - enum TVIMPSTStorgaeEventType - { - EStorageEventUnkown = -1, - EStorageEventListAddition, /* Storege ListAddition event*/ - EStorageEventListDelete, /* Storege ListDelete event*/ - EStorageEventListChanged, /* Storege ListChanged event*/ - EStorageEventContactAddition, /* Storege ContactAddition event*/ - EStorageEventContactDelete, /* Storege ContactDeletion event*/ - EStorageEventContactChange, /* storage contact information chnaged*/ - EStorageAvatarChange, // avatar change signal, - EStoragePresenceChange, // Contact presence chnages - EStorageMultiplePresenceChange, // Contact presence chnages - EStorageOwnPresenceChange, - EStorageAllContactRemoved, // all storage contact removed - EStorageContactFetchComplete, - EStorageEventDeleteFromPbk, - EStorageEventOwnUserChanged, - EStorageEventUserIdPreChange, // in pre change engin emust unsubscribe and close conversatio if exist - EStorageEventUserIdPostChange,// engine must subscribe here - EStorageContactReadComplete, - EStorageContactReading, - EStorageContactFetching, - EStorageContactFetchExistInStore, - EStorageContactSynchronizing - }; - - /** - * A enum - * Search Key Types - */ - enum TVIMPSTSearchKey - { - EVIMPSTSearchKeyUknown = -1, /* Unknown search key */ - EVIMPSTFirstName = 600, /* First Name search key */ - EVIMPSTMiddleName, /* Middle Name search key */ - EVIMPSTLastName, /* Last NAme search key */ - EVIMPSTFullName, /* Full Name search key */ - EVIMPSTNickName, /* Nick Name search key */ - EVIMPSTBirthday, /* BirthDay search key */ - EVIMPSTCountry, /* Country search key */ - EVIMPSTCity, /* City search key */ - EVIMPSTState, /* State search key */ - EVIMPSTEmailAddress, /* Email Address search key */ - EVIMPSTUser, /* User search key */ - EVIMPSTOrganisation, /* Organization search key */ - EVIMPSTOrganisationUnit /* Organization Unit search key */ - }; - - - - enum TVIMPSTBindStatus - { - EVIMPSTBindNotDone = 0, - EVIMPSTBindDone, - EVIMPSTUnBinding, - EVIMPSTUnBindWaiting, - EVIMPSTBindFailureMode - }; - - enum TPresenceStatus - { - EVIMPSTPresenceNotSubscribed = 0, // default values: - EVIMPSTPresenceOnline, // subscribed - EVIMPSTPresenceOffline, // subscribed - EVIMPSTPresenceBlocked, // blocked - EVIMPSTPresencePending, // subscribed - EVIMPSTPresencePendingAuthorization, - EVIMPSTPresencePendingBlock, - EVIMPSTPresencePendingUnBlock, - EVIMPSTPresenceAutoSubscribe, - EVIMPSTPresenceSubscribeWaitingForContactCreation, - EVIMPSTPresenceSubscribeWhenContactCreated - }; - - enum TPresenceEvent - { - EVIMPSTNoEvent = 0, - EVIMPSTPresenceDataChanged, - EVIMPSTRemotePartyAcceptedPresenceRequest, - EVIMPSTRemotePartyBlockedYou, - EVIMPSTRemotePartyWantsToWatchYou, - EVIMPSTSubcribeListReceived - }; - - enum TIMEventType - { - EIMRequestCompleted = 0, - EIMNewMessage , - EIMUnreadMessage, - EIMUnreadChange, - EIMNewChat, - EIMChatStarted, - EIMChatClosed, - EIMAllChatClosed - }; - }; - -/** - * structure - * TVIMPSTSearchKeyData encapsulates the data required for search key - */ -struct TVIMPSTSearchKeyData - { - TVIMPSTEnums::TVIMPSTSearchKey iSearchKey; /* search key */ - TPtrC iSearchLabel; /* Search lable */ - TPtrC iSearchKeyData; /* isearchkeydata */ - }; - -enum TErrorType - { - EProtected = 1, - ECorrupted, - EErrExistInBlockList, - EErrExistInContactList - }; - -//enums -enum TXimpOperation - { - EVIMPSTXimpOperationNoOperation = 0, - EVIMPSTXimpOperationBind, - EVIMPSTXimpOperationUnBind, - EVIMPSTXimpOperationGetSubscribedList, - EVIMPSTXimpOperationGetBlockList, - EVIMPSTXimpOperationGetPresenceGrantList, - EVIMPSTXimpOperationGetWatcherList, - EVIMPSTXimpOperationUnsubcribeWatcherList, - EVIMPSTXimpOperationUnsubcribeGrantRequestList, - EVIMPSTXimpOperationSubcribeGrantRequestList, - EVIMPSTXimpOperationWithdrawPresenceGrant, - EVIMPSTXimpOperationGrantPresenceForPresentity, - EVIMPSTXimpOperationCancelPresenceBlockFromPresentity, - EVIMPSTXimpOperationBlockPresenceForPresentity, - EVIMPSTXimpOperationPublisOwnPresence, - EVIMPSTXimpOperationSubscribe, - EVIMPSTXimpOperationUnsubscribe, - - //Start of ContactMgmt Operations - EVIMPSTXimpOperationAddContact, - EVIMPSTXimpOperationDeleteContact, - //End of ContactMgmt Operations - - //Start of Search Feature Operations - EVIMPSTXimpOperationSearchContact, - EVIMPSTXimpOperationSubscribeSearchKeys - //End of Search Feature Operations - - - }; - -enum TVIMPSTFeatureSupported //multiples of 2 - { - EVIMPSTFeatureUnknown = 0, - EVIMPSTFeaturePublish = 0x1, - EVIMPSTFeatureFetch = 0x2, - EVIMPSTFeatureSubscribe = 0x4, - EVIMPSTFeatureUnsubscribe = 0x8, - EVIMPSTFeatureAddContact = 0x10, - EVIMPSTFeatureDeleteContact = 0x20, - EVIMPSTFeatureBlock = 0x40, - EVIMPSTFeatureUnBlock = 0x80, - EVIMPSTFeatureAvatar = 0x100, - EVIMPSTFeatureCreateGroup = 0x200, - EVIMPSTFeatureDeleteGroup = 0x400, - EVIMPSTFeatureInstantMessage = 0x800, - EVIMPSTFeatureSearch = 0x1000, - EVIMPSTFeatureLast = 0x2000 - }; - - -struct TStatusAndStatusText - { - TVIMPSTEnums::TOnlineStatus iStatus; - TBuf<50> iStatusText; - }; - -/** - * structure - * encapsulating data required for avatar, filename and mimetype - */ -struct TAvatarData - { - TVIMPSTEnums::TOnlineStatus iStatus; - TBuf<50> iStatusText; - TPtrC iFileName; - TPtrC8 iMimeType; - }; - -#endif // TVIMPSTENUMS_H - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/uiservicetabtracer.h --- a/uiservicetab/inc/uiservicetabtracer.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,425 +0,0 @@ -/* -* Copyright (c) 2008 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: trace logs - * -*/ - -#ifndef UISERVICETABTRACER_H -#define UISERVICETABTRACER_H - -#include -#include -#include "vimpstbuilddefinitions.h" - -#ifdef CHAT_ENABLE_DEBUG_PRINT - -// -------------------------------------------------------------------------- -// Define tracer logging method -// 0 = Logging off -// 1 = Log to RDebug -// 2 = Log to file (RFileLogger) -// -------------------------------------------------------------------------- -// - -#ifdef __WINS__ - #ifdef _DEBUG - #define TRACER_LOG_METHOD 1 // for WINS UDEB - #else - #define TRACER_LOG_METHOD 0 // for WINS UREL - #endif -#else - #ifdef _DEBUG - #define TRACER_LOG_METHOD 2 // for Armv5 UDEB - #else - #define TRACER_LOG_METHOD 0 // for Armv5 UREL - #endif -#endif - -#endif - -// -------------------------------------------------------------------------- -// Whether to use TRAP_INSTRUMENTATIONs to -// log trapped leaves -// -------------------------------------------------------------------------- -// -#define TRACE_TRAPS -//============================================================================ - -// Logging off, define empty macros and skip all the rest -#if TRACER_LOG_METHOD == 0 - -#define TRACER(func) -#define TRACER_AUTO -#define TRACER_RET(func,format) -#define TRACER_AUTO_RET(format) -#define TRACER_LEAVE(func) -#define TRACER_AUTO_LEAVE -#define TRACE(args...) -#define TRACE8(args...) -#define TRACER_TO16(a,b) -#define TRACER_TO8(a,b) -#define TRACER_CLOSELOG - -#else // Logging on - -// -------------------------------------------------------------------------- -// Change these to modify line syntax -// -------------------------------------------------------------------------- -// -_LIT( KLogBase, "UiServiceTab %S(%d): %S"); -_LIT( KLogEnter, "UiServiceTab %S: ENTER" ); -_LIT( KLogExit, "UiServiceTab %S: EXIT" ); -_LIT( KLogLeave, "UiServiceTab %S: LEAVE!" ); -_LIT( KLogTrappedLeave, "UiServiceTab %S(%d): TRAPPED LEAVE, code %d!" ); -_LIT( KLogExitRet, "UiServiceTab %S: EXIT, Returning " ); -_LIT( KLogDir, "UiServiceTab" ); -_LIT( KLogFile, "UiServiceTab.log" ); - -#define TRACER_PARAMS_LENGTH 200 - -// -------------------------------------------------------------------------- -// Macro to print only function leaves (not entries or exits). -// Example: TRACER_LEAVE( "CMyClass::MyFunction" ); -// -------------------------------------------------------------------------- -// -#define TRACER_LEAVE(func) TTracer function_tracer( _S(func), _S(""), EFalse ) - -// -------------------------------------------------------------------------- -// Same as above, except that function name is generated automatically -// Example: TRACER_AUTO_LEAVE; -// -------------------------------------------------------------------------- -// -#define TRACER_AUTO_LEAVE TTracer \ - function_tracer( ((const TText8*)__PRETTY_FUNCTION__), _S(""), EFalse ) - -// -------------------------------------------------------------------------- -// Macro to print function entry, exit and leave. -// Example: TRACER( "CMyClass::MyFunction" ); -// -------------------------------------------------------------------------- -// -#define TRACER(func) TTracer function_tracer( _S(func), _S(""), ETrue ) - -// -------------------------------------------------------------------------- -// Same as above, except that function name is generated automatically -// Example: TRACER_AUTO; -// -------------------------------------------------------------------------- -// -#define TRACER_AUTO \ - TTracer function_tracer \ - ( ((const TText8*)__PRETTY_FUNCTION__), _S(""), ETrue ) - -// -------------------------------------------------------------------------- -// Macro to print function return value in addition to entry, exit -// and leave conditions. Second parameter is a formatting string used -// to print the return value Example to print an integer return value: -// TRACER_RET("CMyclass::MyFunction", "%d"); -// -------------------------------------------------------------------------- -// -#define TRACER_RET(func,format) \ - TTracer function_tracer( _S(func), _S(format), ETrue ) - -// -------------------------------------------------------------------------- -// Same as above, except that function name is generated automatically -// Example: TRACER_AUTO_RET( "%d" ); -// -------------------------------------------------------------------------- -// -#define TRACER_AUTO_RET(format) \ - TTracer function_tracer \ - ( ((const TText8*)__PRETTY_FUNCTION__), _S(format), ETrue ) - -// -------------------------------------------------------------------------- -// Macro to print custom msg with any number of parameters -// Either TRACER, TRACER_RET or TRACER_LEAVE -// must be called before in same scope -// It's is assumed that descriptor (pointer) parameters are 16-bit -// NOTE: It is also assumed that parameter values -// add no more than TRACE_PARAMS_LENGTH to the traced string -// -------------------------------------------------------------------------- -// -#define TRACE( args... ) function_tracer.trace( __LINE__, ## args ) - -// -------------------------------------------------------------------------- -// Macro to print custom msg with any number of parameters -// Either TRACER, TRACER_RET or TRACER_LEAVE -// must be called before in same scope -// It's is assumed that descriptor (pointer) parameters are 8-bit -// NOTE: It is also assumed that parameter values -// add no more than TRACE_PARAMS_LENGTH to the traced string -// -------------------------------------------------------------------------- -// -#define TRACE8( args... ) function_tracer.trace8(__LINE__, ## args ) - -// -------------------------------------------------------------------------- -// Just to quickly convert descriptors if needed -// -------------------------------------------------------------------------- -// -#define DESCRIPTOR_LENGTH 100 -#define TRACER_TO16( desc8, desc16 ) \ - TBuf desc16;desc16.Copy(desc8) -#define TRACER_TO8( desc16, desc8 ) \ - TBuf8 desc8;desc8.Copy(desc16) - -#ifdef TRACE_TRAPS -#undef TRAP_INSTRUMENTATION_LEAVE -#define TRAP_INSTRUMENTATION_LEAVE(aResult) \ - TTracer::static_trace( ((const TText8*)__PRETTY_FUNCTION__), \ - __LINE__, aResult ) -#endif - - -#if TRACER_LOG_METHOD == 1 // Print to RDebug - -#include - -#define TRACER_PRINT(a) RDebug::Print(a,&iFunc); -#define TRACER_PRINT_BASE(a,b,c) RDebug::Print(a,&iFunc, b, c); -#define TRACER_PRINT_RET(a,b) RDebug::Print(a,&iFunc,b); -#define TRACER_PRINT_STATIC(a, b, c,d ) \ - RDebug::Print(a, b, c, d); - -#elif TRACER_LOG_METHOD == 2 // Print to file - - // needs flogger.lib as DEBUGLIBRARY - -// -------------------------------------------------------------------------- -// Log directory under C:\logs -// -------------------------------------------------------------------------- -// -//_LIT( KLogDir, "MeCo" ); - -// -------------------------------------------------------------------------- -// Log filename in log directory -// -------------------------------------------------------------------------- -// -//_LIT( KLogFile, "MeCo.log" ); -#define TRACER_PRINT(a) RFileLogger::WriteFormat(KLogDir, \ - KLogFile,EFileLoggingModeAppend,a,&iFunc); -#define TRACER_PRINT_BASE(a,b,c) RFileLogger::WriteFormat(KLogDir, \ - KLogFile,EFileLoggingModeAppend,a,&iFunc,b,c); -#define TRACER_PRINT_RET(a,b) RFileLogger::WriteFormat(KLogDir, \ - KLogFile,EFileLoggingModeAppend,a,&iFunc,b); -#define TRACER_PRINT_STATIC(a,b,c,d) \ - RFileLogger::WriteFormat(KLogDir, \ - KLogFile,EFileLoggingModeAppend,a,b,c,d); - -#endif - - -/** - * Simple tracer class that logs function enter, exit or leave - */ -class TTracer : public CBase - { -private: - - /** - * Simple helper method to just return if NULL - */ - template static void ReturnIfNull(T* aNy) - { if ( !aNy ) return; } - -public: - /** - * inline constructor to write log of entering a function - */ - TTracer( const TText* aFunc, - const TText* aRetFormat, - TBool aPrintEnter) : - iFunc( aFunc), - iRetFormat( aRetFormat ), - iPrintEnterAndExit( aPrintEnter) - { - iFuncBuf = NULL; - //iLogger.Connect(); - //iLogger.CreateLog(KLogDir, KLogFile, mode); - if ( iPrintEnterAndExit ) - { - TRACER_PRINT( KLogEnter ); - } - } - - /** - * inline constructor to write log of entering a function (8-bit) - */ - TTracer( const TText8* aFunc, - const TText* aRetFormat, - TBool aPrintEnter) : - iRetFormat( aRetFormat ), - iPrintEnterAndExit( aPrintEnter ) - { - TInt len = User::StringLength ((const unsigned char*)aFunc ); - HBufC8* temp = HBufC8::New( len ); - ReturnIfNull( temp ); - *temp = (const TUint8*)aFunc; - iFuncBuf = HBufC::NewL( len ); - //iLogger.Connect(); - //iLogger.CreateLog(KLogDir, KLogFile, EFileLoggingModeAppend); - if ( iFuncBuf ) - { - iFuncBuf->Des().Copy( *temp ); - iFunc.Set( *iFuncBuf ); - if ( iPrintEnterAndExit ) - { - TRACER_PRINT( KLogEnter ); - } - } - delete temp; - } - - - /** - * inline destructor to write log of exiting a function - * normally or with a leave - */ - ~TTracer( ) - { - if ( std::uncaught_exception ( ) ) // Leave is an exception - { - // The function exited with a leave - TRACER_PRINT( KLogLeave ); - } - else - { - // The function exited normally - if ( iPrintEnterAndExit ) - { - if ( iRetFormat.Length ( )== 0 ) - { - TRACER_PRINT( KLogExit ); - } - else - { - // Log the return value -#ifdef __WINS__ - TInt32 retVal = 0; - - // The assembly bit. This needs to be reimplemented - // for every target. - _asm( mov retVal, ebx ); - - TBuf<100> format( KLogExitRet ); - format.Append( iRetFormat ); - TRACER_PRINT_RET( format, retVal ); -#else - // ARM assembler to get return value - // could be implemented here.. - TRACER_PRINT( KLogExit ); -#endif - } - } - } - //iLogger.Close(); - delete iFuncBuf; - } - -public: - - /** - * Trace method that assumes 16-bit descriptor parameters - */ - void trace( TInt aLine, const char* aMsg, ... ) - { - ReturnIfNull( iFunc.Ptr() ); - TInt len = User::StringLength ((const unsigned char*)aMsg ); - TPtrC8 msg( (const unsigned char*)aMsg, len ); - HBufC* format = HBufC::New( len ); - ReturnIfNull( format ); - format->Des().Copy( msg ); - HBufC* result = HBufC::New( len + TRACER_PARAMS_LENGTH ); - if ( result ) - { - VA_LIST list; - VA_START( list, aMsg ); - result->Des().FormatList( *format, list ); - VA_END(list); - TRACER_PRINT_BASE(KLogBase, aLine, result ); - } - delete format; - delete result; - } - - /** - * Trace method that assumes 8-bit descriptor parameters - */ - void trace8(TInt aLine, const char* aMsg, ... ) - { - ReturnIfNull( iFunc.Ptr() ); - TInt len = User::StringLength ((const unsigned char*)aMsg ); - TPtrC8 msg( (const unsigned char*)aMsg, len ); - HBufC8* result8 = HBufC8::New( len + TRACER_PARAMS_LENGTH ); - ReturnIfNull( result8 ); - VA_LIST list; - VA_START( list, aMsg ); - result8->Des().FormatList( msg, list ); - VA_END(list); - HBufC* result16 = HBufC::New( result8->Length() ); - if ( result16 ) - { - result16->Des().Copy( *result8 ); - TRACER_PRINT_BASE( KLogBase, aLine, result16 ); - } - delete result8; - delete result16; - } - - static void static_trace( const TText8* aFunc, - TInt aLine, - TInt aResult ) - { - TInt len = User::StringLength ((const unsigned char*)aFunc ); - HBufC8* temp = HBufC8::New( len ); - ReturnIfNull( temp ); - *temp = (const TUint8*)aFunc; - HBufC* funcBuf = HBufC::NewL( len ); - if ( funcBuf ) - { - funcBuf->Des().Copy( *temp ); - TRACER_PRINT_STATIC( - KLogTrappedLeave, funcBuf, aLine, aResult ); - } - delete temp; - delete funcBuf; - } -public: - - /** - * Pointer descriptor to function signature that is to be logged. - */ - TPtrC iFunc; - //RFileLogger iLogger; - -private: - - - /** - * Formatting string used to print the function return value - */ - TPtrC iRetFormat; - - /** - * If true, method enters and exits are printed - */ - TBool iPrintEnterAndExit; - - /** - * Buffer to store function name when needed - */ - HBufC* iFuncBuf; - }; - -#endif // TRACER_LOG_METHOD != 0 && CHAT_ENABLE_DEBUG_PRINT - -#endif // UISERVICETABTRACER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/vimpstbuilddefinitions.h --- a/uiservicetab/inc/vimpstbuilddefinitions.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2008 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: Build definitions - * -*/ - - - -#ifndef VIMPSTBUILDDEFINITIONS_H -#define VIMPSTBUILDDEFINITIONS_H - - -// Enables debug print -#ifdef __WINS__ - #ifdef _DEBUG // for WINS UDEB - // Enables debug print - #define CHAT_ENABLE_DEBUG_PRINT - // Enabled file debug (Remember to create c\Logs\Chat - #define CHAT_ENABLE_FILE_DEBUG - - // Enables layout debug print - #define CHAT_DEBUG_OUTPUT_TO_FILE - #endif -#else - #ifdef _DEBUG // for device UDEB - // Enables debug print - #define CHAT_ENABLE_DEBUG_PRINT - // Enabled file debug (Remember to create c\Logs\Chat - #define CHAT_ENABLE_FILE_DEBUG - - // Enables layout debug print - #define CHAT_DEBUG_OUTPUT_TO_FILE - #endif -#endif - -#endif // VIMPSTBUILDDEFINITIONS_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/vimpstdebugassert.h --- a/uiservicetab/inc/vimpstdebugassert.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpstdebugassert.h -* -*/ - - -#ifndef __VIMPSTDEBUGASSERT_H__ -#define __VIMPSTDEBUGASSERT_H__ - -#include "vimpstdebugmacros.h" - -#ifdef __WVUI_TEST__ - // for test code, define empty assert (otherwise causes decisions) - struct TCHATEmptyDebug { }; - - #define CHAT_EMPTY( s ) TCHATEmptyDebug() - - #define __CHAT_ASSERT_DEBUG( c ) CHAT_EMPTY( s ) - -#else - // debug assert that panics with filename and line number if c is not true - #define __CHAT_ASSERT_DEBUG( c ) \ - __ASSERT_DEBUG( c, User::Panic( TPtrC((const TText *)__WFILE__), __LINE__ ) ); - -#endif - -#endif // __VIMPSTIMDEBUGASSERT_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/vimpstdebugmacros.h --- a/uiservicetab/inc/vimpstdebugmacros.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -/* -* Copyright (c) 2008 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: debug macro for uiservicetab -* -*/ - - -#ifndef __VIMPSTIMDEBUGMACROS_H__ -#define __VIMPSTIMDEBUGMACROS_H__ - -// widen macros for unicode text -#define WIDEN2(x) L ## x -#define WIDEN(x) WIDEN2(x) -#define __WFILE__ WIDEN(__FILE__) - -#endif // __VIMPSTIMDEBUGMACROS_H__ \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/vimpstdebugprint.h --- a/uiservicetab/inc/vimpstdebugprint.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,332 +0,0 @@ -/* -* Copyright (c) 2008 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: logging tool for debug logs - * -*/ - - - -/* -* -* Description: -* -* Logging tools. Uniforms style to write debug data to -* screen using RDebug or to a file with RFileLogger. -* -* Usage: -* 1.Configuring: -* -* Logging and debug printing is configured with following macros -* CHAT_ENABLE_DEBUG_PRINT (defining this enables debug printing) -* CHAT_DEBUG_OUTPUT_TO_FILE (now debug printing goes to file) -* CHAT_DEBUG_FILENAME "Some.log" (file to store debug log) -* -* Debug printing can be configured on project level by defining desired -* macros in .mmp file like this -* //enable file logging -* MACRO CHAT_ENABLE_DEBUG_PRINT -* MACRO CHAT_DEBUG_OUTPUT_TO_FILE -* -* You may also automate the debug printing to follow current build -* variant like this: -* #ifdef _DEBUG -* MACRO CHAT_ENABLE_DEBUG_PRINT -* #endif // _DEBUG -* -* The file to write debug log needs to be defined in file level. -* (Defining it in mmp file causes errors to build procedure..) -* #define CHAT_DEBUG_FILENAME "Example.log" -* -* When using debug printing to file, flogger.lib needs to be added in -* mmp file -* LIBRARY flogger.lib -* and following directory must be manually done before loggin -* (no directory, not logs) Epoc32\Wins\c\logs\CHAT\ -* -* -* 2.Printing: -* -* // normal string output: -* CHAT_DP( D_CHAT_LIT( "Some text." ) ); >> CHAT: Some text. -* CHAT_DP( D_PLAIN_LIT( "Some text." ) ); >> Some text. -* CHAT_DP_TXT( "Some text." ); >> CHAT: Some text. -* -* // string with variables -* TInt index( 99 ); -* _LIT( KExample, "Example" ); -* CHAT_DP( D_CHAT_LIT( "Some text: %d" ), 100 ); >> CHAT: Some text: 100 -* CHAT_DP( D_CHAT_LIT( "Some text: %d" ), index ); >> CHAT: Some text: 99 -* CHAT_DP( D_CHAT_LIT( "Some text: %S" ), &KExample ); >> CHAT: Some text: Example -* -* CHAT_DP( D_PLAIN_LIT( "Some text: %d" ), 100 ); >> Some text: 100 -* CHAT_DP( D_PLAIN_LIT( "Some text: %d" ), index ); >> Some text: 99 -* CHAT_DP( D_PLAIN_LIT( "Some text: %S" ), &KExample ); >> Some text: Example -* -* -* 3.Known issues: -* -* - If you use macros from .mmp file remember to abld makefile to -* change flags from project. -* - In statements like CHAT_DP( D_CHAT_LIT("Some text: %S"), &KExample ); -* parameters causes still some code to generated in release builds. -* Propably it is best to #ifdef all debugprint blocks -* with CHAT_ENABLE_DEBUG_PRINT statement. -* -* ============================================================================ -*/ - - -#ifndef __VIMPSTIMDEBUGPRINT_H__ -#define __VIMPSTIMDEBUGPRINT_H__ - -#include "vimpstbuilddefinitions.h" - -// Debug logging is enabled, you may enable debug printing in release builds also -#ifdef CHAT_ENABLE_DEBUG_PRINT - - // no include files if no debug printing --> faster compile time - // INCLUDES - #include - #include - #include -// -// #ifndef _DEBUG -// // warn in release build -// #if defined( __VC32__ ) -// #pragma message( "Warning: CHAT debug printing is on in release build!" ) // CSI: 68 # Warning for rel builds -// #else // __GCC32__ -// #warning "CHAT debug printing is on in release build!" -// #endif // __VC32__ -// #endif - - /** - * Depending if the build is UNICODE or not, define the - * helper macros that insert CHAT prefix. - */ - #ifdef _UNICODE - #define CHAT_TOKEN_PASTING( s ) L##s - #define CHAT_TO_UNICODE( s ) CHAT_TOKEN_PASTING( s ) - #define CHAT_DEBUG_STR( m ) CHAT_TO_UNICODE( "CHAT: " ) L##m - #else - #define CHAT_DEBUG_STR "CHAT: " - #endif // _UNICODE - - - /** - * Helper macro for defining debug strings with plain debug text. - */ - #define D_PLAIN_LIT( s ) _L( s ) // CSI: 78 # Debug print - - - /** - * Helper macro for defining debug strings with "CHAT:" prefix. - */ - #define D_CHAT_LIT( s ) TPtrC( ( const TText * ) CHAT_DEBUG_STR( s ) ) - - - - #ifdef CHAT_DEBUG_OUTPUT_TO_FILE - - /** - * Method to handle file writing - */ - inline void CHATDebugWriteFormat( TRefByValue aFmt,... ) - { - _LIT( KDir, "Chat" ); - #ifdef CHAT_DEBUG_FILENAME - const static TLitC< sizeof( CHAT_DEBUG_FILENAME ) > KName={ - sizeof( CHAT_DEBUG_FILENAME)-1, - CHAT_TO_UNICODE( CHAT_DEBUG_FILENAME ) }; - #else - _LIT( KName, "IMConversationDebug.log" ); - #endif // CHAT_DEBUG_FILENAME - - // take the ellipsis parameters - VA_LIST args; - VA_START( args,aFmt ); - RFileLogger::WriteFormat( KDir, KName, EFileLoggingModeAppend, - aFmt, args ); - VA_END( args ); - } - - /** - * Actual debug printters. - * Output to log file. - */ - #define CHAT_DP CHATDebugWriteFormat - #define CHAT_DP_TXT( s ) CHATDebugWriteFormat( D_CHAT_LIT( s ) ) - - - - #else - /** - * Actual debug printters. - * Output to debugger output. - */ - #define CHAT_DP RDebug::Print - #define CHAT_DP_TXT( s ) RDebug::Print( D_CHAT_LIT( s ) ) - #endif - - -#else //CHAT_ENABLE_DEBUG_PRINT - - /** - * - * Empty implementations for non-debug printing build versions. - * - */ - - /** - * Dummy struct for checking that all CHAT_DP's define string - * literals using space-saving D_PLAIN_LIT or D_CHAT_LIT. - */ - struct TCHATEmptyDebugString { }; - - /** - * Macro for defining debug-only literal strings (empty release version) - */ - #define D_PLAIN_LIT( s ) TCHATEmptyDebugString() - - /** - * Macro for defining debug-only literal strings (empty release version) - */ - #define D_CHAT_LIT( s ) TCHATEmptyDebugString() - - /** - * Macro for empty debug print function - */ - #define CHAT_DP_TXT( s ) CHAT_DP( D_CHAT_LIT( s ) ) - - - /// Empty debug print function for release builds. - inline void CHAT_DP(TCHATEmptyDebugString) - { - } - - template< class T1 > - inline void CHAT_DP( TCHATEmptyDebugString, T1 ) - { - } - - template< class T1, class T2 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2 ) - { - } - - template< class T1, class T2, class T3 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3 ) - { - } - - template< class T1, class T2, class T3, class T4 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8, class T9 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8, - T9 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8, class T9, class T10 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8, - T9, T10 ) - { - } - - template< class T1, class T2, class T3, class T4, class T5, class T6, - class T7, class T8, class T9, class T10, class T11 > - inline void CHAT_DP( TCHATEmptyDebugString, T1, T2, T3, T4, T5, T6, T7, T8, - T9, T10, T11 ) - { - } - -#endif // CHAT_ENABLE_DEBUG_PRINT - -/* Some general wrappers to CHAT_DP for convenience. - * - * Since these just wrap CHAT_DP, they work transparently: the macros write - * stuff to debug output or to a file, whichever you are using, - * you don't have to care. - * - * Since CHAT_DP is either defined or empty inline, these won't - * matter in either build (no, there is no noticeable penalty in compile time) - * - * There are three types of wrappers, output format is - * - * "filename:linenumber method - enter" when entering function - * "filename:linenumber method - message" when inside function - * "filename:linenumber method - done" when exiting function - * - * Example: - * TInt CSomeClass::SomeMethod() - * { - * CHAT_DP_FUNC_ENTER( "SomeMethod" ); - * - * TInt i = 41; - * - * CHAT_DP_FUNC_DP( "SomeMethod", "Doing intensive calculations" ); - * - * i++; - * - * CHAT_DP_FUNC_DONE( "SomeMethod" ); - * } - * - * You have to provide the method name yourself since the __FUNCTION__ - * preprocessor macro is not understood. - */ - -#include "vimpstdebugmacros.h" // WFILE etc. - -// when entering a function -#define CHAT_DP_FUNC_ENTER( method ) \ - CHAT_DP( D_CHAT_LIT("%s:%d %s - enter" ), __WFILE__, __LINE__, L ## method ); - -// debug print -#define CHAT_DP_FUNC_DP( method,msg ) \ - CHAT_DP( D_CHAT_LIT( "%s:%d %s - %s" ), __WFILE__, __LINE__, L ## method, L ## msg ); - -// when exiting a function -#define CHAT_DP_FUNC_DONE(method) \ - CHAT_DP( D_CHAT_LIT( "%s:%d %s - done" ), __WFILE__, __LINE__, L ## method ); - -#endif // IMDEBUGPRINT_H__ - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/vimpstdebugtrace.h --- a/uiservicetab/inc/vimpstdebugtrace.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* 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: trace logs -* -*/ - -#ifndef __VIMPSTDEBUGTRACE_H__ -#define __VIMPSTDEBUGTRACE_H__ - -// INCLUDES -#include "e32std.h" -#include -// DEFINES -// enable logs printing -// into c:\\logs\\vimpst\\vimpst.txt -//#define VIMPST_ENABLE_DEBUG_LOGS -#undef VIMPST_ENABLE_DEBUG_LOGS - -/** -* Usage of Log MACRO'S -* _LIT( KExample, "Example" ); -* TXT(s) _L(s) -* TRACE( T_LIT("Some text.") ); -* TRACE( T_LIT("Some text: %d"), 100 ); -* TRACE( T_LIT("Some text: %S"), &KExample ); -*/ - -_LIT( KTAdaptDebugOutputDir, "vimpst" ); -_LIT( KTAdaptDebugOutputFileName, "vimpst.txt" ); -_LIT( KTAdaptDebugOutputDFileName, "dvimpst.txt" ); -const TInt KTAdaptMaxLogLineLength = 250 ; -#define T_LIT(s) _L(s) -#define TRACE TVIMPSTLogger::WriteLog -#define TRACED TVIMPSTLogger::DWriteLog // TRACED must be used in details view plugin only -#define PLUGIN_UNUSED_PARAM(p) (void) p - - -/** - * IM cache debug logger. - */ -class TVIMPSTLogger - { - public: //Logging functions - /** - * WriteLog, write the message into c:\\logs\\vimpst\\vimpst.txt - * need to create imcv folder into c:\\logs - * @param aFmt, list of messges to print - */ - static void WriteLog( TRefByValue aFmt,... ); - - /** - * WriteLog, write the message into c:\\logs\\vimpst\\vimpstd.txt - * need to create vimpst folder into c:\\logs - * only used for detailsview plugin - * @param aFmt, list of messges to print - */ - static void DWriteLog( TRefByValue aFmt,... ); - - private: //Prohibited - /** - * construtor - */ - TVIMPSTLogger(); - /** - * destructor - */ - ~TVIMPSTLogger(); - }; - -#endif // __VIMPSTDEBUGTRACE_H__ - -/** - * Handler used by logger to truncate the string - * rather than panic in case of buffer overflow. -*/ - -NONSHARABLE_CLASS ( TAdaptOverflowTruncate ) : public TDes16Overflow - { - -public: - void Overflow ( TDes16& /*aDes*/ ) {} - }; - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// TVIMPSTLogger::WriteLog() -// ----------------------------------------------------------------------------- -// -inline void TVIMPSTLogger::WriteLog ( TRefByValue aFmt, ... ) - { - (void) aFmt;//Suppress unused formal parameter warning - #ifdef VIMPST_ENABLE_DEBUG_LOGS - TBuf< KTAdaptMaxLogLineLength > buffer; - buffer.Append ( _L ( "[" ) ); // CSI: 78 # - buffer.Append ( RThread().Name() ); - buffer.Append ( _L ( "] " ) ); // CSI: 78 # - TAdaptOverflowTruncate overflow; - VA_LIST list; - VA_START ( list, aFmt ); - buffer.AppendFormatList ( aFmt, list, &overflow ); - RFileLogger logger; - if ( logger.Connect() == KErrNone ) - { - logger.SetDateAndTime ( ETrue, ETrue ); - logger.CreateLog ( KTAdaptDebugOutputDir, KTAdaptDebugOutputFileName, - EFileLoggingModeAppend ); - logger.Write ( buffer ); - logger.CloseLog(); - logger.Close(); - } - #endif - } - -// ----------------------------------------------------------------------------- -// TVIMPSTLogger::DWriteLog() -// ----------------------------------------------------------------------------- -// -inline void TVIMPSTLogger::DWriteLog ( TRefByValue aFmt, ... ) - { - (void) aFmt;//Suppress unused formal parameter warning - #ifdef VIMPST_ENABLE_DEBUG_LOGS - TBuf< KTAdaptMaxLogLineLength > buffer; - buffer.Append ( _L ( "[" ) ); // CSI: 78 # - buffer.Append ( RThread().Name() ); - buffer.Append ( _L ( "] " ) ); // CSI: 78 # - TAdaptOverflowTruncate overflow; - VA_LIST list; - VA_START ( list, aFmt ); - buffer.AppendFormatList ( aFmt, list, &overflow ); - RFileLogger logger; - if ( logger.Connect() == KErrNone ) - { - logger.SetDateAndTime ( ETrue, ETrue ); - logger.CreateLog ( KTAdaptDebugOutputDir, KTAdaptDebugOutputDFileName, - EFileLoggingModeAppend ); - logger.Write ( buffer ); - logger.CloseLog(); - logger.Close(); - } - #endif - } -// End of File - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/vimpstdefinitions.h --- a/uiservicetab/inc/vimpstdefinitions.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2008 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: This header contains constants that are used in various places in IM -* -*/ - - -#ifndef VIMPSTDEFINITIONS_H -#define VIMPSTDEFINITIONS_H - -#include "vimpstbuilddefinitions.h" - -#include -#include -#include - - - - - -_LIT( KIconTabulator, "1\t" ); - -// "test character identity and accents, ignore case" -const TInt KCollationLevel = 1; - - -#endif // IMDEFINITIONS_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/vimpstextentionuiuid.h --- a/uiservicetab/inc/vimpstextentionuiuid.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2008 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: Common header for UIDs. -* -*/ - - -#ifndef __VIMPSTEXTENSIONUIUID_H__ -#define __VIMPSTEXTENSIONUIUID_H__ - -// Unique implementation Uid for this example -#define KIMCONTACTSEXTNIMPLEMENTATIONUID 0x20012423 -#define KHELPUID 0x2001FDC2 - -// -// Common system UIDs -// For some reason these are not available in .mmp usable form (macros) -// in Symbian OS SDK. -// -#define KEPOCNULLUID 0x0 -#define KEPOCAPPUID2 0x100039ce -#define KEPOCSTATICDLLUID2 0x1000008d -#define KECOMRECOGNITIONUID2 0x10009D8D - -#endif // __VIMPSTEXTENSIONUIUID_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/inc/vimpstui.h --- a/uiservicetab/inc/vimpstui.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* 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: Branding item header file -* -*/ -// Branding item header file created with XML2H. DO NOT MODIFY! - -_LIT8( KEMbmVimpstuiQgnpropserviceofffriendrequestsent, "EMbmVimpstuiQgnpropserviceofffriendrequestsent"); -_LIT8( KEMbmVimpstuiQgnpropimfriendonmobile, "person:onmobile:image"); -_LIT8( KEMbmVimpstuiQgninditbaddrecipient, "EMbmVimpstuiQgninditbaddrecipient"); -_LIT8( KEMbmVimpstuiQgnpropimimsg, "EMbmVimpstuiQgnpropimimsg"); -_LIT8( KEMbmVimpstuiQgnpropimimsgnew, "EMbmVimpstuiQgnpropimimsgnew"); -_LIT8( KEMbmVimpstuiQgnstatimuni, "EMbmVimpstuiQgnstatimuni"); -_LIT8( KEMbmVimpstuiExamplemsntab, "EMbmVimpstuiExamplemsntab"); -_LIT8( KEMbmVimpstuiQgnpropimfriendon, "person:available:image"); -_LIT8( KEMbmVimpstuiQgnpropimuserblocked, "person:block:image"); -_LIT8( KEMbmVimpstuiQgnpropservicefriendrequestsent, "EMbmVimpstuiQgnpropservicefriendrequestsent"); -_LIT8( KEMbmVimpstuiQgninditbconversation, "EMbmVimpstuiQgninditbconversation"); -_LIT8( KEMbmVimpstuiQgnpropserviceofffriendrequestreceived, "EMbmVimpstuiQgnpropserviceofffriendrequestreceived"); -_LIT8( KEMbmVimpstuiQgninditbbusinesscard, "EMbmVimpstuiQgninditbbusinesscard"); -_LIT8( KEMbmVimpstuiQgnpropimfriendaway, "person:away:image"); -_LIT8( KEMbmVimpstuiQgninditbvoip, "EMbmVimpstuiQgninditbvoip"); -_LIT8( KEMbmVimpstuiQgnpropimfriendbusy, "person:dnd:image"); -_LIT8( KEMbmVimpstuiQgnpropimfriendinvisible, "EMbmVimpstuiQgnpropimfriendinvisible"); -_LIT8( KEMbmVimpstuiQgnpropimfriendvoip, "EMbmVimpstuiQgnpropimfriendvoip"); -_LIT8( KEMbmVimpstuiQgnpropimfriendoff, "person:offline:image"); -_LIT8( KEMbmVimpstuiQgnpropservicedefaultavatar, "EMbmVimpstuiQgnpropservicedefaultavatar"); -_LIT8( KEMbmVimpstuiQgnpropservicefriendrequestreceived, "EMbmVimpstuiQgnpropservicefriendrequestreceived"); - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/rom/imuiservicetab.iby --- a/uiservicetab/rom/imuiservicetab.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - - -#ifndef __IMUISERVICETAB_IBY__ -#define __IMUISERVICETAB_IBY__ - -//im ui service tab - -file=ABI_DIR/BUILD_DIR/vimpstutils.dll SHARED_LIB_DIR/vimpstutils.dll -file=ABI_DIR/BUILD_DIR/vimpststorage.dll SHARED_LIB_DIR/vimpststorage.dll -file=ABI_DIR/BUILD_DIR/vimpstengine.dll SHARED_LIB_DIR/vimpstengine.dll -file=ABI_DIR/BUILD_DIR/vimpstcmdprocess.dll SHARED_LIB_DIR/vimpstcmdprocess.dll - -// ECom plug-ins -ECOM_PLUGIN(vimpstui.dll,vimpstui.rsc) -// cca details view related -ECOM_PLUGIN(vimpstdetailsviewplugin.dll,vimpstdetailsviewplugin.rsc) - -// stub SIS, provides support for SIS upgrading -data=DATAZ_/system/install/uiservicetabstub.sis system/install/uiservicetabstub.sis - -data=DATAZ_\private\20012423\backup_registration.xml private\20012423\backup_registration.xml - -#endif //__IMUISERVICETAB_IBY__ - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/rom/imuiservicetabresources.iby --- a/uiservicetab/rom/imuiservicetabresources.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* 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: -* Export help related files. -* -*/ - - -#ifndef __IMUISERVICETAB_RESOURCESIBY__ -#define __IMUISERVICETAB_RESOURCESIBY__ - -//im ui service tab - -// ECom plugin resources -data=DATAZ_\RESOURCE_FILES_DIR\vimpstuires.rsc RESOURCE_FILES_DIR\vimpstuires.rsc - -data=DATAZ_\RESOURCE_FILES_DIR\vimpstdetailsviewpluginrsc.rsc RESOURCE_FILES_DIR\vimpstdetailsviewpluginrsc.rsc - -data=DATAZ_\BITMAP_DIR\vimpstui.mif BITMAP_DIR\vimpstui.mif - -data=DATAZ_\BITMAP_DIR\vimpst_servicetab_default.mif BITMAP_DIR\vimpst_servicetab_default.mif -// Enabling Default branding. To be activated after solving 'Application Closed : BS' -data=\epoc32\winscw\c\private\102828DD\data\xsp\xsp\files\r47.conversations.mif private\102828DD\data\xsp\xsp\files\r47.conversations.mif -data=\epoc32\winscw\c\private\102828DD\data\xsp\xsp\brandfile.bin.r47 private\102828DD\data\xsp\xsp\brandfile.bin.r47 - -#endif //__IMUISERVICETAB_RESOURCESIBY__ - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/sis/IMUiServiceTab.pkg --- a/uiservicetab/sis/IMUiServiceTab.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -; -; 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: pkg file for IMUiService tab -; -;Language - standard language definitions -&EN - -;UID is the dll's UID -#{"IMUiServiceTab"},(0x20012423),1,0,0 - -;Localised Vendor name -%{"Nokia-EN"} - -;VendorID -:"Nokia" - -; Files to copy - -"\EPOC32\RELEASE\ARMV5\UREL\VIMPSTUtils.dll" -"!:\sys\bin\VIMPSTUtils.dll" - -"\EPOC32\RELEASE\ARMV5\UREL\vimpststorage.dll" -"!:\sys\bin\vimpststorage.dll" - -"\EPOC32\RELEASE\ARMV5\UREL\vimpstservicemanager.dll" -"!:\sys\bin\vimpstservicemanager.dll" - -"\EPOC32\RELEASE\ARMV5\UREL\imcommands.dll" -"!:\sys\bin\imcommands.dll" - -"\EPOC32\RELEASE\ARMV5\UREL\IMContactsExtentionUi.dll" -"!:\sys\bin\IMContactsExtentionUi.dll" - -"\EPOC32\DATA\Z\Resource\Plugins\IMContactsExtentionUi.rsc" -"!:\Resource\Plugins\IMContactsExtentionUi.rsc" - -"\EPOC32\DATA\Z\Resource\IMExtentionUiRes.rsc" -"!:\Resource\IMExtentionUiRes.rsc" - -"\EPOC32\DATA\Z\Resource\IMExtentionUi.mbm" -"!:\Resource\IMExtentionUi.mbm" - -"\EPOC32\DATA\Z\Resource\IMExtentionUi.mif" -"!:\Resource\IMExtentionUi.mif" - -"\EPOC32\DATA\Z\Resource\VIMPSTUtilsRes.rsc" -"!:\Resource\VIMPSTUtilsRes.rsc" - -"\EPOC32\DATA\Z\Resource\vimpstservicevariation.rsc" -"!:\Resource\vimpstservicevariation.rsc" - -; end of file - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/sis/createsisx.bat --- a/uiservicetab/sis/createsisx.bat Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -rem -rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -rem All rights reserved. -rem This component and the accompanying materials are made available -rem under the terms of "Eclipse Public License v1.0" -rem which accompanies this distribution, and is available -rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -rem -rem Initial Contributors: -rem Nokia Corporation - initial contribution. -rem -rem Contributors: -rem -rem Description: sis file for UI service tab -rem - -makesis IMUiServiceTab.pkg -signsis IMUiServiceTab.SIS IMUiServiceTab.SISX rd.cer rd-key.pem diff -r 2b7283837edb -r 3104fc151679 uiservicetab/sis/metadata.xml --- a/uiservicetab/sis/metadata.xml Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ - - - ABC:ABC - - - - - 1 - - UiServiceTab - - Update for Service Tab - - - - - - S60 - - - 5 - 2 - - - 2007 - 1 - - - - - 2 - 0 - - 2009 - 52 - - - - - - - - 0x20012423 - - - 1 - 0 - 0 - - - - 2 - 2 - 2 - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/sis/uiservicetab.pkg --- a/uiservicetab/sis/uiservicetab.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -; -; 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: -; -;Language - standard language definitions -&EN - -;UID is the dll's UID -#{"UiServiceTab"},(0x20012423),1,1,4, TYPE=SA, RU - -;Supports Series 60 v 5.0 -(0x1028315F), 0, 0, 0, {"Series60ProductID"} - -;Localised Vendor name -%{"Nokia"} - -;VendorID -:"Nokia" - -; Files to copy - -"/EPOC32/RELEASE/ARMV5/UREL/vimpstutils.dll" -"!:/sys/bin/vimpstutils.dll" -"/EPOC32/RELEASE/ARMV5/UREL/vimpststorage.dll" -"!:/sys/bin/vimpststorage.dll" -"/EPOC32/RELEASE/ARMV5/UREL/vimpstengine.dll" -"!:/sys/bin/vimpstengine.dll" -"/EPOC32/RELEASE/ARMV5/UREL/vimpstcmdprocess.dll" -"!:/sys/bin/vimpstcmdprocess.dll" -"/EPOC32/RELEASE/ARMV5/UREL/vimpstui.dll" -"!:/sys/bin/vimpstui.dll" -"/EPOC32/RELEASE/ARMV5/UREL/vimpstdetailsviewplugin.dll" -"!:/sys/bin/vimpstdetailsviewplugin.dll" - -"/EPOC32/DATA/Z/Resource/vimpstdetailsviewpluginrsc.rsc" -"!:/Resource/vimpstdetailsviewpluginrsc.rsc" -"/EPOC32/DATA/Z/Resource/vimpstuires.rsc" -"!:/Resource/vimpstuires.rsc" -"/EPOC32/DATA/Z/Resource/Plugins/vimpstui.rsc" -"!:/Resource/Plugins/vimpstui.rsc" -"/EPOC32/DATA/Z/Resource/Plugins/vimpstdetailsviewplugin.rsc" -"!:/Resource/Plugins/vimpstdetailsviewplugin.rsc" -; Backup & restore -"../group/backup_registration.xml" -"!:/private/20012423/backup_registration.xml" - -"/EPOC32/DATA/Z/Resource/apps/vimpstui.mif" -"!:/Resource/apps/vimpstui.mif" - -; end of file - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/sis/uiservicetabstub.pkg --- a/uiservicetab/sis/uiservicetabstub.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -; -; 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: -; -;Language -&EN - -;Header -#{"UiServiceTab"}, (0x20012423), 1, 0, 0, TYPE=SA - -;Localised VendorID -%{"Nokia"} - -;VendorID -:"Nokia" - -; end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/sis/uiservicetabstub.sis Binary file uiservicetab/sis/uiservicetabstub.sis has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/bwins/vimpstcmdprocessu.def --- a/uiservicetab/vimpstcmdprocess/bwins/vimpstcmdprocessu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?NewL@CVIMPSTCmdHandler@@SAPAV1@AAVMVIMPSTEngine@@@Z @ 1 NONAME ; class CVIMPSTCmdHandler * CVIMPSTCmdHandler::NewL(class MVIMPSTEngine &) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/eabi/vimpstcmdprocessu.def --- a/uiservicetab/vimpstcmdprocess/eabi/vimpstcmdprocessu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -EXPORTS - _ZN17CVIMPSTCmdHandler4NewLER13MVIMPSTEngine @ 1 NONAME - _ZTI17CVIMPSTCmdHandler @ 2 NONAME - _ZTI19CVIMPSTProcessArray @ 3 NONAME - _ZTI25CVIMPSTProcessContactItem @ 4 NONAME - _ZTI25CVIMPSTProcessOwnDataItem @ 5 NONAME - _ZTI29CVIMPSTProcessContactListItem @ 6 NONAME - _ZTI31CVIMPSTProcessFriendRequestItem @ 7 NONAME - _ZTI32CVIMPSTCmdProcessSelectedContact @ 8 NONAME - _ZTI32CVIMPSTProcessUnknownContactItem @ 9 NONAME - _ZTV17CVIMPSTCmdHandler @ 10 NONAME - _ZTV19CVIMPSTProcessArray @ 11 NONAME - _ZTV25CVIMPSTProcessContactItem @ 12 NONAME - _ZTV25CVIMPSTProcessOwnDataItem @ 13 NONAME - _ZTV29CVIMPSTProcessContactListItem @ 14 NONAME - _ZTV31CVIMPSTProcessFriendRequestItem @ 15 NONAME - _ZTV32CVIMPSTCmdProcessSelectedContact @ 16 NONAME - _ZTV32CVIMPSTProcessUnknownContactItem @ 17 NONAME - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/group/bld.inf --- a/uiservicetab/vimpstcmdprocess/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2008 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: inf file for command process -* -*/ - - -// -// Platforms -// -PRJ_PLATFORMS -DEFAULT - -// Exports -PRJ_EXPORTS - - -// MMP files -PRJ_MMPFILES -vimpstcmdprocess.mmp diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/group/vimpstcmdprocess.mmp --- a/uiservicetab/vimpstcmdprocess/group/vimpstcmdprocess.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2008 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: mmp file for command process -* -*/ - - -#include -#include -#include "../../inc/vimpstbuilddefinitions.h" - -#include "../../inc/vimpstextentionuiuid.h" - -// Target information -TARGET vimpstcmdprocess.dll -TARGETTYPE dll -UID 0x100039CE 0x20012420 -CAPABILITY CAP_GENERAL_DLL - -VERSION 10.0 -// Source path -SOURCEPATH ../src - -// common Source files -SOURCE cvimpstcmdfactory.cpp - -// Command objects -SOURCE cvimpstcmdhandler.cpp - -SOURCE cvimpstcmdlogin.cpp -SOURCE cvimpstcmdcancellogin.cpp -SOURCE cvimpstcmdlogout.cpp -SOURCE cvimpstcmdcca.cpp -SOURCE cvimpstcmdaddcontact.cpp -SOURCE cvimpstcmddeletecontact.cpp -SOURCE cvimpstcmdchangeownstatus.cpp -SOURCE cvimpstcmdchangeownmessage.cpp -SOURCE cvimpstcmdsearch.cpp -// process & call back objects -SOURCE cvimpstprocessArray.cpp -SOURCE cvimpstprocessarrayitem.cpp -SOURCE cvimpstprocessfriendrequestitem.cpp -SOURCE cvimstcmdfriendrequest.cpp -SOURCE cvimpstcmdchangeownavtar.cpp -SOURCE cvimpstcmdcloseconversation.cpp -SOURCE cvimpstcmdaddtopbk.cpp -SOURCE cvimpstcmdprocessselectedcontact.cpp -SOURCE cvimpstcmdblockcontact.cpp -SOURCE cvimpstcmdunblockcontact.cpp -SOURCE cvimpstcmdfetchblockedlist.cpp - -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../vimpstengine/inc -USERINCLUDE ../../vimpststorage/inc -USERINCLUDE ../../vimpstutils/inc -USERINCLUDE ../../vimpstdetailsviewplugin/inc -USERINCLUDE ../../../group - -APP_LAYER_SYSTEMINCLUDE - - -LIBRARY euser.lib cone.lib ecom.lib bafl.lib -LIBRARY eikcore.lib eikctl.lib eikcoctl.lib -LIBRARY avkon.lib aknnotify.lib -LIBRARY vimpstutils.lib -LIBRARY commonengine.lib - -// dependency to PbkGcServiceTab components - -LIBRARY vimpstengine.lib -LIBRARY vimpststorage.lib -LIBRARY serviceprovidersettings.lib - -// Dependencies to other Phonebook 2 components -LIBRARY vpbkeng.lib pbk2presentation.lib -LIBRARY pbk2commonui.lib - -//CCA -LIBRARY ccaclient.lib - -LIBRARY aiwdialdata.lib -LIBRARY sysutil.lib efsrv.lib -LIBRARY servicehandler.lib -LIBRARY apgrfx.lib - -//#ifdef CHAT_ENABLE_DEBUG_PRINT -LIBRARY flogger.lib -//#endif - - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdaddcontact.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdaddcontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* Copyright (c) 2008 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: IM AddContact command object -* -*/ - - -#ifndef CVIMPSTCMDADDCONTACT_H -#define CVIMPSTCMDADDCONTACT_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; - -// CLASS DECLARATION -/** - * IM AddContact command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdAddContact) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aContactId id of the contact to be aded.. - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdAddContact* NewL( - const TInt aCommandId ,const TDesC& aContactId, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdAddContact(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aContactId id of the contact to be aded.. - * @param aEngine instance of engine. - */ - CVIMPSTCmdAddContact( - const TInt aCommandId, - const TDesC& aContactId, - MVIMPSTEngine& aEngine); - - /** - * symbian second phase constructor - */ - void ConstructL(); - - /** - * check if contact is in the blocked list. - * @param aUserId ,used id that is checked in blocked list. - * @return, true if contact is in blocked list,other wise false. - */ - TBool IsContactBlocked(const TDesC& aUserId); - - private: // Data - - //Command id - const TInt iCommandId; - - //contact id - const TDesC& iContactId; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - - }; - -#endif // CVIMPSTCMDADDCONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdaddfrompbk.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdaddfrompbk.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2008 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: -* -*/ - - -#ifndef CVIMPSTCMDADDFROMPBK_H_ -#define CVIMPSTCMDADDFROMPBK_H_ - - -// INCLUDES -#include -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; -class MVPbkStoreContact; - -/** - * CVIMPSTCmdAddFromPbk command object. - */ -NONSHARABLE_CLASS(CVIMPSTCmdAddFromPbk) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aStoreContact phone book contact to be added. - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdAddFromPbk* NewL( const TInt aCommandId , - const MVPbkStoreContact& aStoreContact, - MVIMPSTEngine& aEngine ); - - /** - * Destructor. - */ - ~CVIMPSTCmdAddFromPbk(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aStoreContact phone book contact to be aded.. - * @param aEngine instance of engine. - */ - CVIMPSTCmdAddFromPbk( const TInt aCommandId, - const MVPbkStoreContact& aStoreContact, - MVIMPSTEngine& aEngine ); - - /** - * symbian second phase constructor - */ - void ConstructL(); - - /** - * symbian second phase constructor - */ - void GetServiceFieldsL( CDesCArray& aArrayForServiceFields ); - - private: // Data - - //Command id - const TInt iCommandId; - - //phone book store contact, not owned. - const MVPbkStoreContact& iStoreContact; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - }; - -#endif /*CVIMPSTCMDADDFROMPBK_H_*/ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdaddtopbk.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdaddtopbk.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2008 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: IM AddContact command object -* -*/ - - -#ifndef CVIMPSTCMDADDTOPBK_H_ -#define CVIMPSTCMDADDTOPBK_H_ - - -// INCLUDES -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; -class MVIMPSTStorageContact; - -/** - * IM AddContact command object. - */ -NONSHARABLE_CLASS(CVIMPSTCmdAddToPbk) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aStoreContact contact to be added to phone book. - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdAddToPbk* NewL( const TInt aCommandId , - const MVIMPSTStorageContact& aStoreContact, - MVIMPSTEngine& aEngine ); - - /** - * Destructor. - */ - ~CVIMPSTCmdAddToPbk(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aContactId id of the contact to be aded.. - * @param aEngine instance of engine. - */ - CVIMPSTCmdAddToPbk( const TInt aCommandId, - const MVIMPSTStorageContact& aStoreContact, - MVIMPSTEngine& aEngine ); - - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //Vpbk store contact, not owned. - const MVIMPSTStorageContact& iStoreContact; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - }; - -#endif /*CVIMPSTCMDADDTOPBK_H_*/ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdblockcontact.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdblockcontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2008 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: execute command for blocking contact -* -*/ - - -#ifndef CVIMPSTCMDBLOCKCONTACT_H -#define CVIMPSTCMDBLOCKCONTACT_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; -class MVPbkContactLink; -class MVIMPSTProcessArray; -// CLASS DECLARATION -/** - * IM Deletecontact command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdBlockContact) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aContactId id of the contact to be blocked.. - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdBlockContact* NewL( - const TInt aCommandId ,const TDesC& aContactId, - MVIMPSTProcessArray& mArrayProcess, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdBlockContact(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aContactId id of the contact to be deleted.. - * @param aEngine instance of engine. - */ - CVIMPSTCmdBlockContact( - const TInt aCommandId, - const TDesC& aContactId, - MVIMPSTProcessArray& mArrayProcess, - MVIMPSTEngine& aEngine); - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //contact id - const TDesC& iContactId; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - // not owns - MVIMPSTProcessArray& iProcessArray; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code - TInt iError; - - }; - -#endif // CVIMPSTCmdBlockContact_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdcall.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdcall.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* Copyright (c) 2008 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: IM Settings command object -* -*/ - - -#ifndef CVIMPSTCMDCALL_H -#define CVIMPSTCMDCALL_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - -// CLASS DECLARATION - -class MVIMPSTProcessArray; - -/** - * IM Settings command object. - */ -NONSHARABLE_CLASS(CVIMPSTCmdCall) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @return A new instance of this class. - */ - static CVIMPSTCmdCall* NewL( - const TInt aCommandId, TInt& aIndex, - MVIMPSTProcessArray& mArrayProcess, - TInt aWindowGroup, - TUint32 aServiceId); - /** - * Destructor. - */ - ~CVIMPSTCmdCall(); - - public: // From MImCommand - /** - * see mvimpstcmd - */ - void ExecuteLD(); - - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - */ - CVIMPSTCmdCall(const TInt aCommandId, TInt& aIndex, - MVIMPSTProcessArray& mArrayProcess, - TInt aWindowGroup, - TUint32 aServiceId); - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //Doesnt own - MVIMPSTCmdObserver* iObserver; - - //Index of the list item chosen - TInt& iIndex; - - //Doesnt own - MVIMPSTProcessArray& iArrayProcess; - - //window group - TInt iWindowGroup; - - //Service Id - TUint32 iServiceId; - - - }; - -#endif // CVIMPSTCMDCALL_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdcancellogin.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdcancellogin.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2008 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: Cancel login command class header -* -*/ - - -#ifndef CVIMPSTCMDCANCELLOGIN_H -#define CVIMPSTCMDCANCELLOGIN_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - - -// FORWARD DECLARATION -class MVIMPSTEngine; - -// CLASS DECLARATION -/** - * Login cancelling command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdCancelLogin) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdCancelLogin* NewL( - const TInt aCommandId , - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdCancelLogin(); - - public: // From mvimpstcmd - /** - * See mvimpstcmd - */ - void ExecuteLD(); - /** - * See mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * See mvimpstcmd - */ - TInt CommandId() const; - - /** - * See mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aEngine, reference to engine. - */ - CVIMPSTCmdCancelLogin( - const TInt aCommandId, - MVIMPSTEngine& aEngine); - - - private: // Data - //Command id - const TInt iCommandId; - - //Service Id - TUint32 iServiceId; - - //observer - Doesnt own - MVIMPSTCmdObserver* iObserver; - - //Doesnt own - engine interface - MVIMPSTEngine& iEngine; - - }; - -#endif // CVIMPSTCmdCANCELLOGIN_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdcca.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdcca.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* -* Copyright (c) 2008 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: IM Settings command object -* -*/ - - -#ifndef CVIMPSTCMDCCA_H -#define CVIMPSTCMDCCA_H - -// INCLUDES -#include -#include "mvimpstcmd.h" -#include -#include -#include - -// FORWARD DECLARATION - -class MVIMPSTProcessArray; -class MVIMPSTEngine; -//CLASS DECLARATION -/** - * IM Settings command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdCCA) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @param aParameter, parammeter. - * @param aConnection, ccaconnection. - * @param aIndex, index. - * @param mArrayProcess, reference to MVIMPSTProcessArray - * @return A new instance of this class. - */ - static CVIMPSTCmdCCA* NewL( - const TInt aCommandId, TInt& aIndex, - MCCAConnection* aConnection, - MVIMPSTProcessArray& mArrayProcess, - MVIMPSTEngine& aEngine ); - /** - * Destructor. - */ - ~CVIMPSTCmdCCA(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aParameter, parammeter. - * @param aConnection, ccaconnection. - * @param aIndex, index. - * @param mArrayProcess, reference to MVIMPSTProcessArray - */ - CVIMPSTCmdCCA( const TInt aCommandId, - TInt& aIndex, - MCCAConnection* aConnection, - MVIMPSTProcessArray& mArrayProcess, - MVIMPSTEngine& aEngine ); - - /** - * symbian second constructor - */ - void ConstructL(); - - /** - * helper method to launch cca - */ - void LaunchCcaL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //doesnt own - MVIMPSTCmdObserver* iObserver; - - //index of the item in the list - TInt& iIndex; - - //does not own : connection to CCA - MCCAConnection* iConnection; - // doesnt own:array process item - MVIMPSTProcessArray& iArrayProcess; - - MVIMPSTEngine& iEngine; - - // own:parameter to pass to the CCA connection - MCCAParameter* iParameter; - - - }; - -#endif // CVIMPSTCMDCCA_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdchangeownavtar.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdchangeownavtar.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,125 +0,0 @@ -/* -* Copyright (c) 2008 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: IM Change Avtar command object -* -*/ - - -#ifndef CVIMPSTCMDCHANGEOWNAVTAR_H -#define CVIMPSTCMDCHANGEOWNAVTAR_H - -// INCLUDES -#include -#include "mvimpstcmd.h" -#include "tvimpstconsts.h" -#include "tvimpstenums.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; - -/** - * IM Change Avtar command object. - */ -NONSHARABLE_CLASS(CVIMPSTCmdChangeOwnAvtar) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @param aFileName Avtar file name - * @param aEngine Engine - * @return A new instance of this class. - */ - static CVIMPSTCmdChangeOwnAvtar* NewL( - const TInt aCommandId ,const TAvatarData& aData, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdChangeOwnAvtar(); - - public: // From mvimpstcmd - /** - * @see mvimpstcmd - */ - void ExecuteLD(); - /** - * @see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * @see mvimpstcmd - */ - TInt CommandId() const; - /** - * @see mvimpstcmd - */ - TInt Result() const; - - - private: // Implementation - - /** - * symbian default constructor - */ - CVIMPSTCmdChangeOwnAvtar( - const TInt aCommandId, - const TAvatarData& aData, - MVIMPSTEngine& aEngine); - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - /** - * Command id - */ - const TInt iCommandId; - - /** - * avatar data.file name and mimetype - */ - const TAvatarData& iData; - - /** - * observer - * doesnt own - */ - MVIMPSTCmdObserver* iObserver; - - /** - * doesnt own - * engine for this service - */ - MVIMPSTEngine& iEngine; - - /** - * error code. - */ - TInt iError; - - }; - -#endif // CVIMPSTCMDCHANGEOWNAVTAR_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdchangeownmessage.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdchangeownmessage.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* Copyright (c) 2008 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: IM Login command object -* -*/ - - -#ifndef CVIMPSTCMDCHANGEOWNMESSAGE_H -#define CVIMPSTCMDCHANGEOWNMESSAGE_H - -// INCLUDES -#include -#include "mvimpstcmd.h" -#include "tvimpstconsts.h" -#include "tvimpstenums.h" - - -// FORWARD DECLARATION -class MVIMPSTEngine; - -// CLASS DECLARATION -/** - * IM Login command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdChangeOwnMessage) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @param aStatus, structure containing status and status text. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdChangeOwnMessage* NewL( - const TInt aCommandId ,TStatusAndStatusText aStatus, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdChangeOwnMessage(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aStatus, structure containing status and status text. - * @param aEngine, reference to engine. - */ - CVIMPSTCmdChangeOwnMessage( - const TInt aCommandId, - TStatusAndStatusText aStatus, - MVIMPSTEngine& aEngine); - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //contact id - TBuf<50> iStatusText; - - TVIMPSTEnums::TOnlineStatus iStatus; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - - }; - -#endif // CVIMPSTCMDCHANGEOWNMESSAGE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdchangeownstatus.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdchangeownstatus.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2008 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: IM Login command object -* -*/ - - -#ifndef CVIMPSTCMDCHANGEOWNSTATUS_H -#define CVIMPSTCMDCHANGEOWNSTATUS_H - -// INCLUDES -#include -#include "mvimpstcmd.h" -#include "tvimpstconsts.h" -#include "tvimpstenums.h" - - -// FORWARD DECLARATION -class MVIMPSTEngine; - -// CLASS DECLARATION -/** - * IM Login command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdChangeOwnStatus) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @param aStatus, structure containing status and status message. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdChangeOwnStatus* NewL( - const TInt aCommandId ,TStatusAndStatusText aStatus, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdChangeOwnStatus(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aStatus, structure containing status and status message. - * @param aEngine, reference to engine. - */ - CVIMPSTCmdChangeOwnStatus( - const TInt aCommandId, - TStatusAndStatusText aStatus, - MVIMPSTEngine& aEngine); - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //contact id - TBuf<50> iStatusText; - - // online status. - TVIMPSTEnums::TOnlineStatus iStatus; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - - }; - -#endif // CVIMPSTCMDCHANGEOWNSTATUS_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdcloseconversation.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdcloseconversation.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2008 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: IM AddContact command object -* -*/ - - -#ifndef CVIMPSTCMDCLOSECONVERSATION_H_ -#define CVIMPSTCMDCLOSECONVERSATION_H_ - - -// INCLUDES -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; - -/** - * IM AddContact command object. - */ -NONSHARABLE_CLASS(CVIMPSTCmdCloseConversation) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aContactId id of the conversation party. - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdCloseConversation* NewL( const TInt aCommandId, - const TDesC& aContactId, - MVIMPSTEngine& aEngine ); - - /** - * Destructor. - */ - ~CVIMPSTCmdCloseConversation(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aContactId id of the conversation party. - * @param aEngine instance of engine. - */ - CVIMPSTCmdCloseConversation( const TInt aCommandId, - const TDesC& aContactId, - MVIMPSTEngine& aEngine ); - - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //contact id - const TDesC& iContactId; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - - }; - -#endif /*CVIMPSTCMDCLOSECONVERSATION_H_*/ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmddeletecontact.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmddeletecontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,118 +0,0 @@ -/* -* Copyright (c) 2008 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: IM Deletecontact command object -* -*/ - - -#ifndef CVIMPSTCMDDELETECONTACT_H -#define CVIMPSTCMDDELETECONTACT_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; -class MVPbkContactLink; - -// CLASS DECLARATION -/** - * IM Deletecontact command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdDeleteContact) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aContactId id of the contact to be deleted.. - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdDeleteContact* NewL( - const TInt aCommandId ,MVPbkContactLink* aContactLink, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdDeleteContact(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aContactId id of the contact to be deleted.. - * @param aEngine instance of engine. - */ - CVIMPSTCmdDeleteContact( - const TInt aCommandId, - MVPbkContactLink* aContactLink, - MVIMPSTEngine& aEngine); - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //contact id - MVPbkContactLink* iContactLink; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code - TInt iError; - - }; - -#endif // CVIMPSTCMDDELETECONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdeditcontact.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdeditcontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2008 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: Edit contact -* -*/ - - -#ifndef CVIMPSTCMDEDITCONTACT_H -#define CVIMPSTCMDEDITCONTACT_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; -class MVPbkContactLink; - -// CLASS DECLARATION -/** - * IM Edit command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdEditContact) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aContactId id of the contact to be aded.. - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdEditContact* NewL( - const TInt aCommandId ,MVPbkContactLink* aContactLink, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdEditContact(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aContactId id of the contact to be aded.. - * @param aEngine instance of engine. - */ - CVIMPSTCmdEditContact( - const TInt aCommandId, - MVPbkContactLink* aContactLink, - MVIMPSTEngine& aEngine); - - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //contact Link - MVPbkContactLink* iContactLink; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - - }; - -#endif // CVIMPSTCMDEDITCONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdfactory.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2008 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: Creates IM command objects. -* -*/ - - -#ifndef CVIMPSTCMDFACTORY_H -#define CVIMPSTCMDFACTORY_H - -// INCLUDES -#include -#include "mvimpstcmdfactory.h" -#include "tvimpstenums.h" -#include "mvimpstengineservicestateeventobserver.h" - -// FORWARD DECLARATIONS -class MVIMPSTProcessArray; -class MVIMPSTEngine; - -// CLASS DECLARATION -/** - * Factory to create IM command objects. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdFactory) : - public CBase, - public MVIMPSTCmdFactory, - public MVIMPSTEngineServiceStateEventObserver - { - public: // Constructor and destructor - /** - * Static constructor. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdFactory* NewL(MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdFactory(); - - public: // From MImCommandFactory - /** - * See MImCommandFactory - */ - MVIMPSTCmd* CreateCommandForIdL( - TImCommandId aCommandId,TAny* aData = NULL) ; - - /** - * See MImCommandFactory - */ - void AddObserverL(MVIMPSTCmdObserver* aObserver) ; - - /** - * See MImCommandFactory - */ - void RemoveObserver(MVIMPSTCmdObserver* aObserver); - - /** - * @returns reference to process interface. - */ - MVIMPSTProcessArray& GetProcessInterface() ; - - private:// form MVIMPSTEngineServiceStateEventObserver - - /** - * Observer Event for Service State changes - * @param aState - Indicates the service state - * @parma aServiceError, error if any. - */ - void HandleServiceEventL - ( TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt aServiceError ) ; - - private: // Implementation - /** - * symbian default constructor. - * @param aEngine, reference to engine. - */ - CVIMPSTCmdFactory(MVIMPSTEngine& aEngine); - - /** - * Second phase constructor. - */ - void ConstructL(); - - private: // Data - // owned ,pointer to CIMArrayProcess - MVIMPSTProcessArray* iArrayProcess; - - //not owned - RPointerArray iObservers; - - //Ref to the engine item for current service - MVIMPSTEngine& iEngine; - - }; - -#endif // CVIMPSTCMDFACTORY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdfetchblockedlist.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdfetchblockedlist.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* 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: Fetch the blocked list from server -* -*/ - -#ifndef CVIMPSTCMDFETCHBLOCKEDLIST_H -#define CVIMPSTCMDFETCHBLOCKEDLIST_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - - -// FORWARD DECLARATION -class MVIMPSTEngine; - -// CLASS DECLARATION -/** - * IM Login command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdFetchBlockedContactList) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @param aServiceID, service id. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdFetchBlockedContactList* NewL( - const TInt aCommandId , MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdFetchBlockedContactList(); - - public: // From mvimpstcmd - /** - * See mvimpstcmd - */ - void ExecuteLD(); - /** - * See mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * See mvimpstcmd - */ - TInt CommandId() const; - - /** - * See mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aServiceID, service id. - * @param aEngine, reference to engine. - */ - CVIMPSTCmdFetchBlockedContactList( - const TInt aCommandId, MVIMPSTEngine& aEngine); - - /** - * second phase constructor - */ - void ConstructL(); - - - private: // Data - //Command id - const TInt iCommandId; - - //Service Id - TUint32 iServiceId; - - //observer - Doesnt own - MVIMPSTCmdObserver* iObserver; - - //Doesnt own - engine interface - MVIMPSTEngine& iEngine; - - }; - -#endif // CVIMPSTCMDFETCHBLOCKEDLIST_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdhandler.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2008 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: IM command handler -* -*/ - - -#ifndef CVIMPSTCMDHANDLER_H -#define CVIMPSTCMDHANDLER_H - -// INCLUDES -#include -#include "mvimpstcmdhandler.h" - -// FORWARDS -class MVIMPSTCmdFactory; -class MVIMPSTEngine; - -// CLASS DECLARATION - -/** - * IM command handler. - * Responsible for handling all IM commands - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -class CVIMPSTCmdHandler : public CBase, - public MVIMPSTCmdHandler - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - IMPORT_C static CVIMPSTCmdHandler* NewL(MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdHandler(); - - public: // From MVIMPSTCmdHandler - - /** - * see MVIMPSTCmdHandler - */ - TBool HandleCommandL( - const TImCommandId aCommandId, MVIMPSTCmdObserver* aObserver, - TAny* aData ); - - /** - * see MVIMPSTCmdHandler - */ - void RegisterEventObserverL( MVIMPSTCmdObserver* aObserver ) ; - - /** - * see MVIMPSTCmdHandler - */ - void UnRegisterEventObserver( MVIMPSTCmdObserver* aObserver ) ; - - /** - * see MVIMPSTCmdHandler - */ - MVIMPSTProcessArray& GetProcessInterface() ; - - private: // Implementation - /** - * symbian default constructor - */ - CVIMPSTCmdHandler(); - /** - * second phase constructor - */ - void ConstructL(MVIMPSTEngine& aEngine); - - - private: // Data - /// Own: Command factory - MVIMPSTCmdFactory* iCommandFactory; - }; - -#endif // CVIMPSTCMDHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdlogin.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdlogin.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2008 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: IM Login command object -* -*/ - - -#ifndef CVIMPSTCMDLOGIN_H -#define CVIMPSTCMDLOGIN_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - - -// FORWARD DECLARATION -class MVIMPSTEngine; - -// CLASS DECLARATION -/** - * IM Login command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdLogin) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @param aServiceId, service id. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdLogin* NewL( - const TInt aCommandId ,TUint32 aServiceID, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdLogin(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aServiceId, service id. - * @param aEngine, reference to engine. - */ - CVIMPSTCmdLogin( - const TInt aCommandId, - TUint32 aServiceID, - MVIMPSTEngine& aEngine); - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //Service Id - TUint32 iServiceId; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - }; - -#endif // CVIMPSTCMDLOGIN_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdlogout.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdlogout.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2008 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: IM Login command object -* -*/ - - -#ifndef CVIMPSTCMDLOGOUT_H -#define CVIMPSTCMDLOGOUT_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - - -// FORWARD DECLARATION -class MVIMPSTEngine; - -// CLASS DECLARATION -/** - * IM Login command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdLogout) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @param aServiceID, service id. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdLogout* NewL( - const TInt aCommandId ,TUint32 aServiceID, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdLogout(); - - public: // From mvimpstcmd - /** - * See mvimpstcmd - */ - void ExecuteLD(); - /** - * See mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * See mvimpstcmd - */ - TInt CommandId() const; - - /** - * See mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aServiceID, service id. - * @param aEngine, reference to engine. - */ - CVIMPSTCmdLogout( - const TInt aCommandId,TUint32 aServiceID, - MVIMPSTEngine& aEngine); - - /** - * second phase constructor - */ - void ConstructL(); - - - private: // Data - //Command id - const TInt iCommandId; - - //Service Id - TUint32 iServiceId; - - //observer - Doesnt own - MVIMPSTCmdObserver* iObserver; - - //Doesnt own - engine interface - MVIMPSTEngine& iEngine; - - }; - -#endif // CVIMPSTCMDLOGOUT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdprocessselectedcontact.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdprocessselectedcontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2008 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: CVIMPSTCmdProcessSelectedContact command object -* -*/ - - - - -#ifndef CVIMPSTCMDPROCESSSELECTEDCONTACT_H_ -#define CVIMPSTCMDPROCESSSELECTEDCONTACT_H_ - -// INCLUDES -#include -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; -class MVPbkContactLinkArray; -struct TVPbkSelectedData; -/** - * CVIMPSTCmdProcessSelectedContact command object. - */ -class CVIMPSTCmdProcessSelectedContact : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aSelectedEntries structure to hold packed links of selected phone book contact(s). - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdProcessSelectedContact* NewL( const TInt aCommandId , - TVPbkSelectedData& aSelectedEntries, - MVIMPSTEngine& aEngine ); - - /** - * Destructor. - */ - ~CVIMPSTCmdProcessSelectedContact(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aSelectedEntries structure to hold packed links of selected phone book contact(s). - * @param aEngine instance of engine. - */ - CVIMPSTCmdProcessSelectedContact( const TInt aCommandId, - TVPbkSelectedData& aSelectedEntries, - MVIMPSTEngine& aEngine ); - - /** - * symbian second phase constructor - */ - void ConstructL(); - - /** - * return ETrue if exist in block list - */ - TBool IsContactBlocked(const TDesC& aUserId); - - private: // Data - - //Command id - const TInt iCommandId; - - // TVPbkSelectedData to holde packed links of selected contacts. - TVPbkSelectedData& iSelectedEntries; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - }; - -#endif /*CVIMPSTCMDPROCESSSELECTEDCONTACT_H_*/ - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdsearch.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdsearch.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2008 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: Search Command header -* -*/ - - -#ifndef CVIMPSTCMDSEARCH_H -#define CVIMPSTCMDSEARCH_H - -// INCLUDES -#include -#include "mvimpstcmd.h" -#include "tvimpstconsts.h" -#include "tvimpstenums.h" - - -// FORWARD DECLARATION -class MVIMPSTEngine; - -// CLASS DECLARATION -/** - * IM Login command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdSearch) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aCommandId Command id. - * @param aKeyDataArray, array of keys for search. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdSearch* NewL( - const TInt aCommandId , - RArray& aKeyDataArray, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdSearch(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aKeyDataArray, array of keys for search. - * @param aEngine, reference to engine. - */ - CVIMPSTCmdSearch( - const TInt aCommandId, - RArray& aKeyDataArray, - MVIMPSTEngine& aEngine); - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //own array of search ids and values - RArray& iKeyDataArray; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - - }; - -#endif // CVIMPSTCMDSEARCH_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstcmdunblockcontact.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstcmdunblockcontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* Copyright (c) 2008 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: Execute block command -* -*/ - -#ifndef CVIMPSTCMDUNBLOCKCONTACT_H -#define CVIMPSTCMDUNBLOCKCONTACT_H - -// INCLUDES -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; -class MVPbkContactLink; - -// CLASS DECLARATION -/** - * IM Deletecontact command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdUnBlockContact) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aContactId id of the contact to be deleted.. - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdUnBlockContact* NewL( - const TInt aCommandId ,const TDesC& aContactId, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdUnBlockContact(); - - public: // From mvimpstcmd - /** - * see mvimpstcmd - */ - void ExecuteLD(); - /** - * see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * see mvimpstcmd - */ - TInt CommandId() const; - /** - * see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aContactId id of the contact to be deleted.. - * @param aEngine instance of engine. - */ - CVIMPSTCmdUnBlockContact( - const TInt aCommandId, - const TDesC& aContactId, - MVIMPSTEngine& aEngine); - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id - const TInt iCommandId; - - //contact id - const TDesC& iContactId; - - //observer - doesnt own - MVIMPSTCmdObserver* iObserver; - - //doesnt own - engine for this service - MVIMPSTEngine& iEngine; - - //error code - TInt iError; - - }; - -#endif // CVIMPSTCmdUnBlockContact_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstprocessarray.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstprocessarray.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,531 +0,0 @@ -/* -* Copyright (c) 2008 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: Array Process -* -*/ - - -#ifndef _CVIMPSTPROCESSARRAY_H -#define _CVIMPSTPROCESSARRAY_H - -// INCLUDES -#include -#include "mvimpstcmdhandler.h" -#include "vimpstcmd.hrh" -#include "mvimpststoragecontactsobserver.h" -#include "mvimpstprocessarray.h" -#include "tvimpstenums.h" -#include "mvimpstengineimsubserviceeventobserver.h" -#include "mvimpstenginepresencesubserviceeventobserver.h" -#include - -// FORWARD DECLARATION -class MVIMPSTProcessArrayItem; -class MVIMPSTStorageContact; -class MVIMPSTStorageContactList; -class MVIMPSTStorageServiceView; -class MVIMPSTProcessArrayObserver; -class MVIMPSTStorageItemModel; -class MVPbkContactLink; -class MVPbkStoreContact; -class MVIMPSTEngine; -class CVIMPSTProcessFriendRequestItem; -class CVIMPSTProcessUnknownContactItem; - -// CLASS DECLARATION - -/** - * Array Process. - * Responsible for handling all contacts array - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -class CVIMPSTProcessArray : public CBase, - public MVIMPSTProcessArray, - public MVIMPSTStorageContactsObserver, - public MVIMPSTEngineIMSubServiceEventObserver, - public MVIMPSTEnginePresenceSubServiceEventObserver - { - friend class Cvimpstcmdprocess_utest; - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aEngine, reference to engine. - * @return A new instance of this class. - */ - static CVIMPSTProcessArray* NewL( - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTProcessArray(); - - public: //form mvimpstchatobserver - /** - * @see MVIMPSTEngineIMSubServiceEventObserver.h - **/ - void HandleChatMessageEventL(TVIMPSTEnums::TIMEventType aEventType ,const TDesC& aSender ); - - - public: - /** - * Observer Event for new add request - * aRequester - requester for add request. - */ - void HandleAddRequestEventL(TVIMPSTEnums::TOperationType aType, const TDesC& aRequesterId, - const TDesC& aRequestorDisplayName ); - - - public : //from MVIMPSTProcessArray - /** - * register for array call back - * @param aObserver: to be added - */ - void AddObserver(MVIMPSTProcessArrayObserver* aObserver) ; - - /** - * unregister for array call back - * @param aObserver: to be removed - */ - void RemoveObserver() ; - - /** - * Count: Called by UI components to get total count of array - * @return integer Count of array - */ - virtual TInt Count() const; - - /** - * @return ETrue if presence service is enabled - */ - TBool IsSubServiceSupportedL( TVIMPSTEnums::SubServiceType aType ) const ; - - /** - * @return, ETrue if IM is supported - */ - TBool IsIMSupported(); - - /** - * @return, ETrue if Presence is supported - */ - TBool IsPresenceSupported(); - - /** - * GetType: Function to get the type of list item - * @param aIndex: index of the list item - * @return TEnumsPC::TItem: type of the list item as EContactItem, EOwnStatusItem etc - */ - virtual TVIMPSTEnums::TItem GetType(TInt aIndex) const; - - /** - * ResetArray: Function to reset and fill the array - */ - void ResetArray(); - - /** - * GetItemNameText: To get item name of each list item - * @param aIndex: Index of the list item whose name is to be returned - * @return TPtrC: Name of the list item - */ - virtual TPtrC GetItemNameText(TInt aIndex); - - - /** - * SetLoginState: To set the loginstate. - * @param aLoginState: state of login - */ - virtual void SetLoginStateL(TVIMPSTEnums::TVIMPSTRegistrationState aLoginState); - - - /** - * GetLoginState: To set the loginstate. - * @return TVIMPSTRegistrationState, state of login - */ - virtual TVIMPSTEnums::TVIMPSTRegistrationState GetLoginState(); - - /** - * @returns the VPBK Contact Link - */ - MVPbkContactLink* ContactLink(TInt aIndex); - - - /** - * GetOnlineStatusL gets the status of given index. - * @param aIndex: Index of the item - * @returns the onlinestatus of given valid index. - */ - TVIMPSTEnums::TOnlineStatus GetOnlineStatusL(TInt aIndex); - - /** - * Get the status text for the contact - * @param aIndex: Index of contact item - * @return reference to the status text. - */ - const TDesC& StatusTextL(TInt aIndex ) ; - - /** - * From MVIMPSTProcessArray - * - */ - void MapContactListPositions(RArray& aPositionArray ); - /** - * IsMsgPending: To find if there are any pending messages to - * decide the icons for display - * @param aIndex: index of the list item - * @return bool: True if there are pending messages else false. - */ - TBool IsMsgPending(TInt aIndex); - - /** - * ResetPendingMsg: To reset if there are any pending messages to - * decide the icons for display - * @param aIndex: index of the list item - */ - void ResetPendingMsg(TInt aIndex); - - - /** - * Find any contact which id is aContactId - * @param aContactId, user id. - * @return ETrue if contact already existst.else EFlase. - */ - TBool FindAnyContact( const TDesC& aContactId ); - - /** - * Find any contact which id is aContactId - * @param aContactId, user id. - * @return ETrue if contact already existst.else EFlase. - */ - TBool FindAnyContactServiceField( const TDesC& aContactId ); - /** - * Find any friend request which id is aRequesterId - * @param aRequesterId, user id. - * @return ETrue if request already existst.else EFlase. - */ - TBool FindAnyAddRequest( const TDesC& aRequesterId ); - - /** - * @param aRequesterId, user id. - * @return ETrue if request already existst.else EFlase. - */ - TBool IsContactBlocked( const TDesC& aRequesterId ); - - /** - * check if already conversation opened - * @param aRecipientId, the selected user id with whom conversation is started - * @return ETrue if already exist else EFlase. - */ - TBool IsConversationExistL(const TDesC& aRecipientId) ; - /** - * check if already conversation opened - * @param aRecipientId, the selected user id with whom conversation is started - * @return ETrue if already exist else EFlase. - */ - TBool IsConversationExist(TInt aIndex); - - /** - * Find the index of contact with contact id as aContactId - * @param aContactId : id of contact whose index is to be found - * @return index of contact else KErrNotFounf if not found - */ - TInt FindContactIndexL( const TDesC& aContactId ) ; - - /** - * GetItemNameText: To get item name of each list item - * @param aIndex, Index of the list item whose name is to be returned - * @return TPtrC, Name of the list item - */ - TPtrC GetItemUserId(TInt aIndex); - /** - * RemoveFriendRequest: To remove friend request from list. - * @param aIndex, Index of the list item to be removed. - */ - void RemoveFriendRequestL(const TDesC& aRequesterId); - /** - * Login user name of the own user from settings - * owener ship is transferred to the caller - * @return allocated HBufC: Login user name of the own user from settings - */ - const TDesC& LoginUserIdFromStoreL() const; - - /** - * OwnAvatarIndex: Returns the avatar index for the corresponding contact item - * This index is used to append the avatar in the UI. - * If index is ' 0 ', then it means no avatar is set. - * - * @return index of the own avatar - */ - TInt OwnAvatarIndexL( ) ; - /** - * OwnAvatarContent: Returns the mime type of the avatar image for the conatct - * - * If nothing returns KNullDesC8 - * @return TDesC8& own avatar content - */ - const TDesC8& OwnAvatarContentL( ) const ; - - /** - * SetOwnAvatarIndex: Sets the index for own avatar contact item - * @param aAvatarIndex: Index to be set - */ - void SetOwnAvatarIndexL( TInt aAvatarIndex ); - - /** - * AvatarMimeType: Returns the mime type of the avatar image for the conatct - * - * If nothing returns KNullDesC8 - * @param aContactIndex : Index of the conatct item - * - * @return TDesC8& mime type of the avatar - */ - const TDesC8& AvatarContent(TInt aContactIndex) ; - - /** - * SetAvatarIndex: Sets the index for avatar for for the corresponding contact item - * - * @param aContactIndex : Index of the conatct item - * @param aAvatarIndex: Index to be set - */ - void SetAvatarIndex( TInt aContactIndex, TInt aAvatarIndex ); - - /** - * AvatarIndex: Returns the avatar index for the corresponding contact item - * This index is used to append the avatar in the UI. - * If index is ' 0 ', then it means no avatar is set. - * - * @param aContactIndex : Index of the conatct item - * - * @return index of the own avatar - */ - TInt AvatarIndex(TInt aContactIndex) ; - - /** - * from MVIMPSTProcessArray - * Return index of aContactId (considering friend request also.). - * @param aContactId, contact id for which index to be found. - * @return, Index of aContactId including friend request. - */ - TInt GetSelectedItemIndex(const TDesC& aContactId); - - /* - * find and return the array item - */ - MVIMPSTProcessArrayItem* FindArrayItem( const TDesC& aSenderId ); - - /* - * reset all pending and open flags to EFalse - */ - void ResetOpenConversationPendingMsg(); - - /* - * @aIndex, index for the listbox item whose descriptor is needed - * @return, the descriptor for the array item to be used by listbox - */ - TPtrC16 GetFormattedString(TInt aIndex); - - - public: // From MVIMPSTStorageContactsObserver - - - /** - * HandleChange: To handle the Chnage event from the MCAStoredContactsObserver - * @see MCAStoredContactsObserver - * @param aList: reference to the list at which a change has occured - * @param aContact: reference to the contact at which a change has occured - * @param aEventType: TVIMPSTEnums::TCAObserverEventType,type of change event that has occured - * @param aUserIdChanged, ETrue if userid has changed, else EFalse. - * @return void - */ - void HandleStorageChangeL( TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType, - MVIMPSTStorageContactList* aList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ); - - - private: // Implementation - - /** - * Default constructor - * @param aEngine, reference to engine. - */ - - CVIMPSTProcessArray( MVIMPSTEngine& aEngine ); - - /** - * Second phase constructor - */ - void ConstructL(); - - /** - * FillItemL: fill up the individual item in the array - * @return void - **/ - void FillItemL(); - /** - * FillOwnDataL: fill up fill the owndata item - * @return void - **/ - TBool FillOwnDataL(); - - /** - * FillArray: fill up the complete array - * @return void - **/ - void FillArrayL(); - - /** - * fill the unknown contact to main array - * @return void - **/ - void FillUnknownContactsL(); - /** - * FillAddRequestDataL: fill up the add request to array - * @return void - **/ - void FillAddRequestDataL(); - - /** - * remove all the unknown contacts from main array iItemArray, - * so that unknown contact can pesist till the session is entertainesd. - * @return void - **/ - void RemoveUnKnownContacts(); - /** - * RemoveAddRequestData: removes data from iItemArray, - * so that request can pesist till the reqest is entertainesd. - * @return void - **/ - void RemoveAddRequestData(); - - /** - * handlle the message which is from unknown buddy - * @param aSenderId , Sender Id - * @return void - **/ - void DoHandleUnKnownContactMessageL( const TDesC& aSenderId ,TBool aIsMsgPending); - - /** - * get the all open chat and append unknown contacts - * @return void - **/ - void GetAndCreateOpenChatListL(); - - /** - * remove the item from invitation or unknown array if found - * @param aContactId : conatct user Id - * @return ETrue if contact is removed - */ - TBool RemoveFromUnknonOrInvitationListL( const TDesC& aContactId , TBool aBlocked ) ; - /** - * play the incoming message tone. - */ - void PlayMsgBeepL(); - - /** - * @return ETrue if unread message exist - */ - TBool IsUnreadMessageExistsL(const TDesC& aRecipientId); - /** - * helper method for removing unknown contacts - * @return ETrue if contact is removed - */ - TBool RemoveFromUnknonListL( const TDesC& aAddedUserId ); - /** - * helper method for removing invitation contacts - * @return ETrue if contact is removed - */ - TBool RemoveFromInvitationListL( const TDesC& aAddedUserId ); - /** - * helper method for finding and marking as open chat - * @return ETrue if contact is find - */ - TBool FindAndMarkContactAsOpenChat( const TDesC& aContactId, TBool aMesssagePending ); - - private: // Data - - /** - * starting index of Owndata , it's 0 as per ui spec - **/ - TInt iOwnDataIndex; - - /** - * starting index of contacts , it's 0 as per ui spec - **/ - TInt iContactListIndex; - - //Ref to the engine item for current service - MVIMPSTEngine& iEngine; - - /** - * Flag to check whether own data added or not - **/ - TBool iOwnDataAdded; - - /** - * Owns. Buffer that hold's information about fetched item - **/ - HBufC* iData; - - - /** - * reference to the contact list interface - **/ - MVIMPSTStorageServiceView* iContactInterface; - - // owned : take RPointerArray if nedded - MVIMPSTProcessArrayObserver* iProcessObservers; - - /** - * list of items here - **/ - RPointerArray iItemArray; - - - /** - * reference to the contact list model - * not owned. - **/ - MVIMPSTStorageItemModel* iContactListModel; - - //service id - TUint32 iServiceId; - - TVIMPSTEnums::TVIMPSTRegistrationState iLoginState; - - /** - * reference list of friend request items here - **/ - RPointerArray iAddRequestArray; - - /** - * reference list of friend request items here - **/ - RPointerArray iUnKnownContactArray; - - // ETrue if fetch completed - TBool iFetchCompleted; - - // ETrue if engine supports IM subservice - TBool iIMSupported; - - // ETrue if engine supports Presence subservice - TBool iPresenceSupported; - - }; - -#endif // _CVIMPSTPROCESSARRAY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstprocessarrayitem.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstprocessarrayitem.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1000 +0,0 @@ -/* -* Copyright (c) 2008 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: CVIMPSTProcessContactItem, CVIMPSTProcessContactListItem, CVIMPSTProcessOwnDataItem, -* CVIMPSTProcessConversationItem -* are the different types of array items stored in the MCAMainViewArrayPC -* -*/ - - - -#ifndef CVIMPSTPROCESSARRAYITEM_H -#define CVIMPSTPROCESSARRAYITEM_H -#include - -#include "tvimpstenums.h" -#include "cvimpstprocessarray.h" -// FORWARD DECLARATION -class MVPbkContactLink; - -// CLASS DECLARATION - -/** -* Base class for cimcontactitem, cimcontactlistitem, cimowndataitem -* to be stored into an array of on the process component side. -* The UI components will query for each item in this heterogeneous array to display -* information like contactlist, contact, conversation, groups etc in the listbox of -* the main view class -* @lib vimpstcmdprocess.dll -* @since 5.0 -*/ -class MVIMPSTProcessArrayItem - { - - public: - - /** - * Returns the default type of the listbox item - * @return TEnumsPC::TItem: type of the listbox item as either EContactitem, EContactListItem etc - */ - virtual TVIMPSTEnums::TItem Type() = 0; - - /** - * Returns the name of the listbox item - * @return TPtrC: name of the listbox item to be displayed - */ - virtual TPtrC GetItemNameText() = 0 ; - - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - - virtual void SetMsgPending(TBool aMsgPending) = 0; - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - virtual TBool IsMsgPending() = 0 ; - - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - - virtual void SetConversationOpen(TBool aConvOpen ) = 0; - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - virtual TBool IsConversationOpen() = 0 ; - - /** - * Returns the array index of the listbox item on engine/storage side - * @return TInt: index of the listbox item on engine/storage side - */ - virtual TInt GetItemIndex() = 0; - - /** - * return the VPBK Contact Link - */ - virtual MVPbkContactLink* ContactLink() = 0; - - - /** - * Sets the on engine/storage side index of the listbox item - * @param aIndex: index of the listbox item on engine/storage side - * @return void - */ - virtual void SetItemIndex(TInt aIndex) = 0; - - /** - * Returns the user id of the listbox item - * @return TPtrC: user id of the listbox item. - */ - virtual TPtrC GetItemUserId() = 0 ; - /** - * Returns the avatar index of the listbox item - * @return TInt: avatar index of the listbox item. - */ - virtual TInt AvatarIndex() = 0; - - /** - * sets the avatar index of the listbox item - * @param aAvatarIndex: avatar index to be set - */ - virtual void SetAvatarIndex(TInt aAvatarIndex ) = 0; - - - /** - * returns status text of the contact - */ - virtual const TDesC& StatusText() = 0; - - /** - * returns online status of the contact - */ - virtual TVIMPSTEnums::TOnlineStatus OnlineStatus() = 0; - - - /** - * return formatted string needed for listbox for this item - */ - virtual TPtrC16 FormattedItemString() = 0; - - - /* - * Format and Reformat the string for listbox - */ - virtual void DoFormatStringL() = 0; - - - /** - * virtual destructor. - */ - virtual ~MVIMPSTProcessArrayItem(){}; - - - }; - -/** -* CCAContactItemPC is a structure that will encapsualte information on a contact -* item in the single array on the process component side. -* @lib vimpstcmdprocess.dll -* @since 5.0 -*/ -class CVIMPSTProcessContactItem : public CBase, - public MVIMPSTProcessArrayItem - { - - public: // symbain constructor , destructor - - /** - * Creates a new instance of this class. - * @param aContactId, reference to contactid. - * @param aContactLink, pointer to Contactlink. - * @return the ContactitemPC instance - */ - static CVIMPSTProcessContactItem* NewL( CVIMPSTProcessArray& aParent, const TDesC& aContactName, - const TDesC& aContactId, - MVPbkContactLink* aContactLink, - const TDesC& aStatusText, - TVIMPSTEnums::TOnlineStatus aOnlineStatus - ); - /** - * symbain way of construction - */ - void ConstructL( const TDesC& aContactId, - const TDesC& aContactName, - const TDesC& aStatusText, - TVIMPSTEnums::TOnlineStatus aOnlineStatus - ); - - /** - * destructor - */ - virtual ~CVIMPSTProcessContactItem(); - - private: - - /** - * C++ default constructor - * @param aContactId, reference to contactid. - * @param aContactLink, pointer to Contactlink. - */ - CVIMPSTProcessContactItem( CVIMPSTProcessArray& aParent, MVPbkContactLink* aContactLink); - - public: - //to be used later. - /** - * Returns the blocked status of the contact item - * @return bool: true if the contact item is blocked else false - */ - //TBool IsBlocked(); - - /** - * Sets the blocked status of the contact item - * @param aBlockedStatus: true if the contact is blocked else false - */ - //void SetBlockedStatus(TBool aBlockedStatus); - - /** - * Sets the messages pending status of the contact item - * @param aPendingMessageStatus: true if the contact has pending messages - * else false - */ - void SetMsgPending(TBool aPendingMessageStatus); - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - TBool IsMsgPending(); - - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - - void SetConversationOpen(TBool aConvOpen ) ; - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - TBool IsConversationOpen() ; - - public: //From MImArrayItem - - /** - * Returns the name of the contact item - * @return TPtrC: name of the contact item to be displayed - */ - TPtrC GetItemNameText(); - - /** - * Returns the default type of the contact item - * @return TEnumsPC::TItem: type of the contact item as either - * EContactitem, EContactListItem etc - */ - TVIMPSTEnums::TItem Type(); - - - /** - * Get the index of the contact item from engine side model - * @return TInt, index - */ - inline TInt GetItemIndex() - { - return iIndex; - } - - /** - * Set the index of the contact item from engine side model - * @param TInt, aIndex - */ - inline void SetItemIndex(TInt aIndex) - { - iIndex = aIndex; - } - - /** - * @returns the VPBK Contact Link - */ - inline MVPbkContactLink* ContactLink() - { - return iContactLink; - } - - - /** - * Returns the user id of the listbox item - * @return TPtrC: user id of the listbox item. - */ - TPtrC GetItemUserId(); - - /** - * Returns the avatar index of the listbox item - * @return TInt: avatar index of the listbox item. - */ - inline TInt AvatarIndex() - { - return iAvatarIndex; - } - - /** - * sets the avatar index of the listbox item - * @param aAvatarIndex: avatar index to be set - */ - inline void SetAvatarIndex(TInt aAvatarIndex ) - { - iAvatarIndex = aAvatarIndex; - - TRAP_IGNORE(DoFormatStringL()); - } - - /** - * returns status text of the contact - */ - const TDesC& StatusText(); - - /** - * returns online status of the contact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus(); - - /* - * Format and Reformat the string for listbox - */ - void DoFormatStringL(); - - /** - * return formatted string needed for listbox for this item - */ - TPtrC16 FormattedItemString(); - - private: - - // Process Array - CVIMPSTProcessArray& iParent; - - /** - * The name of the listbox item - */ - HBufC* iItemNameTextContact; - - - /** - * The name of the listbox item - */ - HBufC* iContactUserId; - - /** - * Index of the item in engines model class - */ - TInt iIndex; - - //Not owned - MVPbkContactLink* iContactLink; - - // ETrue if it has a pending message, else EFalse. - TBool iSMsgPending; - - TBool iIsConversationOpen; - - // avatar index - TInt iAvatarIndex; - - // Status text Message - HBufC* iStatusText; - - // Stores the status of the contact - TVIMPSTEnums::TOnlineStatus iOnlineStatus; - - HBufC* iFormattedString; - - }; - - -/** -* CVIMPSTProcessContactListItem is a structure that will encapsualte information on a contact -* list in the single array on the process component side. -* @lib vimpstcmdprocess.dll -* @since 5.0 -*/ -class CVIMPSTProcessContactListItem : public CBase, - public MVIMPSTProcessArrayItem - { - - public: - /** - * Creates a new instance of this class. - * @return the CVIMPSTProcessContactListItem instance - */ - static CVIMPSTProcessContactListItem* NewL(CVIMPSTProcessArray& aParent); - - /** - * second phase constructor - */ - void ConstructL(); - - /** - * destructor - */ - virtual ~CVIMPSTProcessContactListItem(); - - private: - - /** - * C++ default constructor - */ - CVIMPSTProcessContactListItem(CVIMPSTProcessArray& aParent); - - public: - - /** - * Returns the expanded or collapsed state information of the contact list - * @return bool, true if the contact list is collapsed else return false - */ - TBool IsCollapsed(); - - - /** - * Sets the collapsed/expanded state of the contact list - * @param aCollapsed, true if the contact list item is collapsed else false - */ - void SetCollapsed(TBool aCollapsed); - - public: //From CImArrayItem - - /** - * Returns the name of the contact list item - * @return TPtrC, name of the contact item to be displayed - */ - TPtrC GetItemNameText(); - - /** - * Sets the name of the contact list item - * @param aName: Name of the contact list item to be set - * @return void - */ - void SetItemNameText(const TDesC&); - - /** - * Returns the default type of the contact list item - * @return TEnumsPC::TItem: type of the contact list item as either - * EContactitem, EContactListItem etc - */ - TVIMPSTEnums::TItem Type(); - - /** - * Get the index of the contact item from engine side model - * @return TInt: index - */ - inline TInt GetItemIndex() - { - return iIndex; - } - - /** - * Set the index of the contact item from engine side model - * @param TInt: aIndex - */ - inline void SetItemIndex(TInt aIndex) - { - iIndex = aIndex; - } - - /** - * @return the VPBK Contact Link - */ - inline MVPbkContactLink* ContactLink() - { - return 0; - } - - /** - * Returns the user id of the listbox item - * @return TPtrC: user id of the listbox item. - */ - inline TPtrC GetItemUserId() - { - return KNullDesC(); - } - /** - * Returns the avatar index of the listbox item - * @return TInt: avatar index of the listbox item. - */ - inline TInt AvatarIndex() - { - return KErrNone; // always return zero - } - - /** - * sets the avatar index of the listbox item - * @param aAvatarIndex: avatar index to be set - */ - inline void SetAvatarIndex(TInt /*aAvatarIndex*/ ) - { - // dummy not used - } - void SetMsgPending(TBool /*aMsgPending*/) - { - // NA - } - /** - * Sets the messages pending status of the contact item - * @param aPendingMessageStatus: true if the contact has pending messages - * else false - */ - TBool IsMsgPending() - { - return EFalse; - } - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - - void SetConversationOpen(TBool /*aConvOpen*/ ) - { - // NA - } - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - TBool IsConversationOpen() - { - return EFalse; - } - - /** - * returns status text of the contact - */ - const TDesC& StatusText() - { - //NA - return KNullDesC; - } - - /** - * returns online status of the contact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus() - { - //NA - return TVIMPSTEnums::EUnknown; - } - - /* - * Format and Reformat the string for listbox - */ - void DoFormatStringL(); - - /** - * return formatted string needed for listbox for this item - */ - TPtrC16 FormattedItemString(); - - private: - - // Process Array - CVIMPSTProcessArray& iParent; - - /** - * collapsed/expanded status of the contact list - */ - TBool iCollapsedStatus; - - - /** - * Total no. of contacts in the contact list - */ - TInt iTotalContacts; - - /** - * name of the contact list followed by - * the (No. of Online Contacts/ Total contacts) in that contact list - */ - HBufC* iText; - - /** - * Index of the item in engines model class - */ - TInt iIndex; - - - /** - * The name of the listbox item - * Till the contalist is supported in futuer, - * iItemNameTextList is a pointer. - */ - HBufC* iItemNameTextList; - }; - -/** -* CVIMPSTProcessOwnDataItem is a structure that will encapsualte information on Own data -* item in the single array on the process component side. -*/ - class CVIMPSTProcessOwnDataItem : public CBase, - public MVIMPSTProcessArrayItem - { - - public: - /** - * Creates a new instance of this class. - * @param aContactId, id of the contact - */ - static CVIMPSTProcessOwnDataItem* NewL(CVIMPSTProcessArray& aParent, TDesC& aContactId); - - /** - * second phase constructor - */ - void ConstructL(); - - /** - * destructor - */ - virtual ~CVIMPSTProcessOwnDataItem(); - - private: - - /** - * symbian default constructor - * @param aContactId, id of the contact - */ - - CVIMPSTProcessOwnDataItem(CVIMPSTProcessArray& aParent,TDesC& aContactId); - - public: //From CImArrayItem - - /** - * Returns the name of the contact list item - * @return TPtrC, name of the contact item to be displayed - **/ - TPtrC GetItemUserId(); - - - /** - * Returns the default type of the contact list item - * @return TEnumsPC::TItem, type of the contact list item as either - * EContactitem, EContactListItem etc - */ - TVIMPSTEnums::TItem Type(); - - /** - * Get the index of the contact item from engine side model - * @return TInt, index - */ - inline TInt GetItemIndex() - { - return iIndex; - } - - /** - * Set the index of the contact item from engine side model - * @param TInt, aIndex - */ - inline void SetItemIndex(TInt aIndex) - { - iIndex = aIndex; - } - /** - * @return the VPBK Contact Link - */ - inline MVPbkContactLink* ContactLink() - { - return 0; - } - - /** - * Returns the user id of the listbox item - * @return TPtrC: user id of the listbox item. - */ - inline TPtrC GetItemNameText() - { - return KNullDesC(); - } - /** - * Returns the avatar index of the listbox item - * @return TInt: avatar index of the listbox item. - */ - inline TInt AvatarIndex() - { - return iAvatarIndex; - } - - /** - * sets the avatar index of the listbox item - * @param aAvatarIndex: avatar index to be set - */ - inline void SetAvatarIndex(TInt aAvatarIndex ) - { - iAvatarIndex = aAvatarIndex; - - TRAP_IGNORE(DoFormatStringL()); - } - /** - * returns the mimetype - * @return returns the mimetype - */ - inline const TDesC8& MimeType() - { - if( iMimeType ) - { - return *iMimeType; - } - else - { - return KNullDesC8(); - } - } - /** - * sets the mimetype - * @param the mimetype to be set - */ - inline void SetMimeType( const TDesC8& aMime) - { - delete iMimeType; - iMimeType = NULL; - iMimeType = aMime.Alloc(); - } - void SetMsgPending(TBool /*aMsgPending*/) - { - // NA - } - /** - * Sets the messages pending status of the contact item - * @param aPendingMessageStatus: true if the contact has pending messages - * else false - */ - TBool IsMsgPending() - { - return EFalse; - } - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - - void SetConversationOpen(TBool /*aConvOpen*/ ) - { - // NA - } - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - TBool IsConversationOpen() - { - return EFalse; - } - - /** - * returns status text of the contact - */ - const TDesC& StatusText() - { - //NA - return KNullDesC; - } - - /** - * returns online status of the contact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus() - { - //NA - return TVIMPSTEnums::EUnknown; - } - - /* - * Format and Reformat the string for listbox - */ - void DoFormatStringL(); - - /** - * return formatted string needed for listbox for this item - */ - TPtrC16 FormattedItemString(); - - private: - - //Process Array - CVIMPSTProcessArray& iParent; - - /** - * Index of the item in engines model class - */ - TInt iIndex; - - /** - * The name of the listbox item - */ - TDesC& iOwnDataId; - - - // avatar index - TInt iAvatarIndex; - // owned mimetype - HBufC8* iMimeType; - }; - - - -/** - * unknown contact item - * Responsible for handling feriend requests. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -class CVIMPSTProcessUnknownContactItem : public CBase, - public MVIMPSTProcessArrayItem - { - public: // symbain constructor , destructor - - /** - * Returns the instance of tis class. - * @param aBuddyId, buddyId id. - * @return CVIMPSTProcessFriendRequestItem, instance of this class. - */ - static CVIMPSTProcessUnknownContactItem* NewL(CVIMPSTProcessArray& aParent, const TDesC& aBuddyId); - - /** - * symbain way of construction - * @param aBuddyId, requestor id. - */ - void ConstructL(const TDesC& aBuddyId); - - /** - * destructor - */ - virtual ~CVIMPSTProcessUnknownContactItem(); - - private: - - /** - * C++ default constructor - */ - CVIMPSTProcessUnknownContactItem(CVIMPSTProcessArray& aParent); - - public : // new method - - /** - * Sets the messages pending status of the contact item - * @param aPendingMessageStatus: true if the contact has pending messages - * else false - */ - void SetMsgPending(TBool aPendingMessageStatus); - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - TBool IsMsgPending(); - - public: //From MImArrayItem - - /** - * Returns the name of the contact item - * @return TPtrC, name of the contact item to be displayed - */ - TPtrC GetItemNameText(); - - /** - * Returns the default type of the contact item - * @return TEnumsPC::TItem: type of the contact item as either - * EContactitem, EContactListItem etc - */ - TVIMPSTEnums::TItem Type(); - - - /** - * Get the index of the contact item from engine side model - * @return TInt: index - */ - inline TInt GetItemIndex() - { - return iIndex; - } - - /** - * Set the index of the contact item from engine side model - * @param TInt: aIndex - */ - inline void SetItemIndex(TInt aIndex) - { - iIndex = aIndex; - } - - /** - * @return the VPBK Contact Link - */ - inline MVPbkContactLink* ContactLink() - { - return NULL; - } - - /** - * Returns the user id of the listbox item - * @return TPtrC, user id of the listbox item. - */ - inline TPtrC GetItemUserId(); - - /** - * Returns the avatar index of the listbox item - * @return TInt: avatar index of the listbox item. - */ - inline TInt AvatarIndex() - { - return KErrNone; // always return zero - } - - /** - * sets the avatar index of the listbox item - * @param aAvatarIndex: avatar index to be set - */ - inline void SetAvatarIndex(TInt /*aAvatarIndex*/ ) - { - // dummy not used - } - - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - - void SetConversationOpen(TBool aConvOpen ); - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - TBool IsConversationOpen(); - - /** - * returns status text of the contact - */ - const TDesC& StatusText() - { - //NA - return KNullDesC; - } - - /** - * returns online status of the contact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus() - { - //NA - return TVIMPSTEnums::EUnknown; - } - - /* - * Format and Reformat the string for listbox - */ - void DoFormatStringL(); - - /** - * return formatted string needed for listbox for this item - */ - TPtrC16 FormattedItemString(); - - private://member variables. - - // Process Array - CVIMPSTProcessArray& iParent; - - /** - * The name of the listbox item (owned). - */ - HBufC* iItemNameText; - - /** - * Index of the item in engines model class - */ - TInt iIndex; - - // Owns, user id of item. - HBufC* iUesrId; - - // if any message is pending - - TBool iSMsgPending; - - TBool iIsConversationOpen; - - HBufC* iFormattedString; - }; - -#endif //CVIMPSTPROCESSARRAYITEM_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimpstprocessfriendrequestitem.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimpstprocessfriendrequestitem.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ -/* -* Copyright (c) 2008 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: Friend request item, stores all the information regarding *the ERactive authorization -* -*/ - - - -#ifndef CVIMPSTPROCESSFRIENDREQUESTITEM_H_ -#define CVIMPSTPROCESSFRIENDREQUESTITEM_H_ - -#include -#include "tvimpstenums.h" -#include "cvimpstprocessarrayitem.h" - -// CLASS DECLARATION - -/** - * Friend request item, stores all the information regarding the ERactive authorization. - * Responsible for handling feriend requests. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -class CVIMPSTProcessFriendRequestItem:public CBase, - public MVIMPSTProcessArrayItem - { - public: // symbain constructor , destructor - - /** - * Returns the instance of tis class. - * @param aRequesterId, requestor id. - * @return CVIMPSTProcessFriendRequestItem, instance of this class. - */ - static CVIMPSTProcessFriendRequestItem* NewL(CVIMPSTProcessArray& aParent, const TDesC& aRequesterId, const TDesC& aRequestorDisplayName); - - /** - * symbain way of construction - * @param aRequesterId, requestor id. - */ - void ConstructL(const TDesC& aRequesterId, const TDesC& aRequestorDisplayName); - - /** - * destructor - */ - virtual ~CVIMPSTProcessFriendRequestItem(); - - private: - - /** - * C++ default constructor - */ - CVIMPSTProcessFriendRequestItem(CVIMPSTProcessArray& aParent); - - public: //From MImArrayItem - - /** - * Returns the name of the contact item - * @return TPtrC, name of the contact item to be displayed - */ - TPtrC GetItemNameText(); - - /** - * Returns the default type of the contact item - * @return TEnumsPC::TItem: type of the contact item as either - * EContactitem, EContactListItem etc - */ - TVIMPSTEnums::TItem Type(); - - - /** - * Get the index of the contact item from engine side model - * @return TInt: index - */ - inline TInt GetItemIndex() - { - return iIndex; - } - - /** - * Set the index of the contact item from engine side model - * @param TInt: aIndex - */ - inline void SetItemIndex(TInt aIndex) - { - iIndex = aIndex; - } - - /** - * @return the VPBK Contact Link - */ - inline MVPbkContactLink* ContactLink() - { - return NULL; - } - - - - /** - * Returns the user id of the listbox item - * @return TPtrC, user id of the listbox item. - */ - inline TPtrC GetItemUserId(); - - /** - * Returns the avatar index of the listbox item - * @return TInt: avatar index of the listbox item. - */ - inline TInt AvatarIndex() - { - return KErrNone; // always return zero - } - - /** - * sets the avatar index of the listbox item - * @param aAvatarIndex: avatar index to be set - */ - inline void SetAvatarIndex(TInt /*aAvatarIndex*/ ) - { - // dummy not used - } - - /** - * Sets the messages pending status of the contact item - * @param aPendingMessageStatus: true if the contact has pending messages - * else false - */ - void SetMsgPending(TBool aPendingMessageStatus); - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - TBool IsMsgPending(); - - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - - void SetConversationOpen(TBool aConvOpen ) ; - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - TBool IsConversationOpen() ; - - /** - * returns status text of the contact - */ - const TDesC& StatusText() - { - //NA - return KNullDesC; - } - - /** - * returns online status of the contact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus() - { - //NA - return TVIMPSTEnums::EUnknown; - } - - /* - * Format and Reformat the string for listbox - */ - void DoFormatStringL(); - - /** - * return formatted string needed for listbox for this item - */ - TPtrC16 FormattedItemString(); - - private://member variables. - - //Process Array - CVIMPSTProcessArray& iParent; - - /** - * Index of the item in engines model class - */ - TInt iIndex; - - // Owns, user id of item. - HBufC* iUesrId; - - // Owns, user id of item. - HBufC* iDisplayName; - - // ETrue if it has a pending message, else EFalse. - TBool iSMsgPending; - // is conversation open - TBool iIsConversationOpen; - - // for listbox - HBufC* iFormattedString; - }; - -#endif /*CVIMPSTPROCESSFRIENDREQUESTITEM_H_*/ - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/cvimstcmdfriendrequest.h --- a/uiservicetab/vimpstcmdprocess/inc/cvimstcmdfriendrequest.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* -* Copyright (c) 2008 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: IM AddContact command object -* -*/ - - -#ifndef CVIMSTCMDFRIENDREQUEST_H_ -#define CVIMSTCMDFRIENDREQUEST_H_ - -// INCLUDES -#include -#include "mvimpstcmd.h" - -// FORWARD DECLARATION - -class MVIMPSTEngine; - -// CLASS DECLARATION - -/** - * IM AddContact command object. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTCmdFriendRequest) : public CBase, - public MVIMPSTCmd - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * @param aCommandId Command id. - * @param aContactId id of the contact to be aded.. - * @param aEngine instance of engine. - * @return A new instance of this class. - */ - static CVIMPSTCmdFriendRequest* NewL( - const TInt aCommandId ,const TDesC& aContactId, - MVIMPSTEngine& aEngine); - - /** - * Destructor. - */ - ~CVIMPSTCmdFriendRequest(); - - public: // From mvimpstcmd - /** - * @see mvimpstcmd - */ - void ExecuteLD(); - /** - * @see mvimpstcmd - */ - void AddObserver( - MVIMPSTCmdObserver& aObserver ); - /** - * @see mvimpstcmd - */ - TInt CommandId() const; - /** - * @see mvimpstcmd - */ - TInt Result() const; - - - - private: // Implementation - - /** - * symbian default constructor - * @param aCommandId Command id. - * @param aContactId id of the contact to be aded.. - * @param aEngine instance of engine. - */ - CVIMPSTCmdFriendRequest( - const TInt aCommandId, - const TDesC& aContactId, - MVIMPSTEngine& aEngine); - - /** - * symbian second phase constructor - */ - void ConstructL(); - - - private: // Data - - //Command id. - const TInt iCommandId; - - //contact id. - const TDesC& iContactId; - - //doesnt own observer. - MVIMPSTCmdObserver* iObserver; - - //doesnt own engine for this service - MVIMPSTEngine& iEngine; - - //error code. - TInt iError; - - }; - -#endif /*CVIMSTCMDFRIENDREQUEST_H_*/ - -//END OF FILE - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/mvimpstcmd.h --- a/uiservicetab/vimpstcmdprocess/inc/mvimpstcmd.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2008 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: IM command object interface -* -*/ - - -#ifndef _MVIMPSTCMD_H_ -#define _MVIMPSTCMD_H_ - -// INCLUDES -#include -#include "vimpstcmd.hrh" - -// FORWARD DECLARATIONS -class MVIMPSTCmdObserver; - - -// CLASS DECLARATION - -/** - * IM command object interface. - * - * Every Instant Messaging command must implement this interface. - * Application command handler can then create these command objects - * and execute them. Commands can report about their execution via - * MImCommandObserver interface. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -class MVIMPSTCmd - { - public: // Interface - - /** - * Destructor. - */ - virtual ~MVIMPSTCmd() - {} - - /** - * Executes the command and destroys this command object when done. - * The command is also destroyed if this function leaves. - */ - virtual void ExecuteLD() = 0; - - /** - * Adds a command observer for this command. - * @param aObserver Command observer to add. - */ - virtual void AddObserver( - MVIMPSTCmdObserver& aObserver ) = 0; - - - /** - * Returns the command id. - * @return TImCommandId Command ID. - */ - virtual TInt CommandId() const = 0 ; - - - /** - * Returns the result data/error code. - * The return value will have a valid data, only if this function - * is called in CommandFinished() observer notification[MImCommandObserver] - * @return TAny pointer to the result data. - * Ownership is not transferred to the caller - */ - virtual TInt Result() const = 0 ; - - }; - -#endif // _MVIMPSTCMd_H_ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/mvimpstcmdfactory.h --- a/uiservicetab/vimpstcmdprocess/inc/mvimpstcmdfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2008 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: IM Command factory abstract API. -* -*/ - - -#ifndef MVIMPSTCMDFACTORY_H -#define MVIMPSTCMDFACTORY_H - -#include "vimpstcmd.hrh" - -// FORWARD DECLARATIONS -class MVIMPSTCmd; -class MVIMPSTCmdObserver; -class MVIMPSTProcessArray; - -// CLASS DECLARATION - -/** - * Instant Messaging command factory API. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -class MVIMPSTCmdFactory - { - public: // Interface - /** - * Virtual destructor. - */ - virtual ~MVIMPSTCmdFactory() { } - - /** - * Creates a command given command ID. - * - * @param aCommandId ID of the command that the command object is created for. - * @param aData Pass the data required for the command to process - * @return the created command object - */ - virtual MVIMPSTCmd* CreateCommandForIdL( - TImCommandId aCommandId,TAny* aData = NULL) =0; - - /** - * AddObserverL :add the observer from ui to get back the command events - * @param: aObserver - */ - virtual void AddObserverL(MVIMPSTCmdObserver* aObserver) = 0; - - - /** - * RemoveObserverL :remoces the observer from ui. - * @param: aObserver - */ - virtual void RemoveObserver(MVIMPSTCmdObserver* aObserver ) = 0; - - /** - * Return a reference to the precess array. - * @return MVIMPSTProcessArray, reference of precess array. - */ - virtual MVIMPSTProcessArray& GetProcessInterface() = 0; - - }; - -#endif // MVIMPSTCMDFACTORY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/mvimpstcmdhandler.h --- a/uiservicetab/vimpstcmdprocess/inc/mvimpstcmdhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2008 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: IM command handler interface -* -*/ - - -#ifndef MVIMPSTCMDHANDLER_H -#define MVIMPSTCMDHANDLER_H - -// INCLUDES -#include -#include "vimpstcmd.hrh" -#include "mvimpstprocessarray.h" - -// FORWARD DECLARATIONS -class MVIMPSTCmd; -class MVIMPSTCmdObserver; -class MVIMPSTProcessArray; - -// CLASS DECLARATION - -/** - * IM command handler interface. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -class MVIMPSTCmdHandler - { - public: // Interface - - /** - * Handles IM commands. - * - * @param aCommandId The id of the command to handle. - * @param aObserver The observer - * @param aData Pass the data required for the command to process - * @return ETrue if the command was handled, EFalse otherwise. - */ - virtual TBool HandleCommandL( - const TImCommandId aCommandId, MVIMPSTCmdObserver* aObserver, - TAny* aData ) = 0; - /** - * RegisterEventObserverL :register the observer from ui to get back the events - * @param: aObserver - */ - virtual void RegisterEventObserverL( MVIMPSTCmdObserver* aObserver ) = 0; - - /** - * UnRegisterEventObserver :Unregister the observer from ui to stop getting the events - * @param: aObserver - */ - virtual void UnRegisterEventObserver( MVIMPSTCmdObserver* aObserver ) = 0; - - - /** - * GetProcessInterface :Returns the Process interface - * @return MVIMPSTProcessArray, reference to process array. - */ - virtual MVIMPSTProcessArray& GetProcessInterface() = 0 ; - - - - /** - * destructor. - */ - virtual ~MVIMPSTCmdHandler() {} - }; - -#endif // MVIMPSTCMDHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/mvimpstcmdobserver.h --- a/uiservicetab/vimpstcmdprocess/inc/mvimpstcmdobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2008 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: IM command observer interface -* -*/ - - -#ifndef MVIMPSTCMDOBSERVER_H -#define MVIMPSTCMDOBSERVER_H -#include "tvimpstenums.h" - -// FORWARD DECLARATIONS -class MVIMPSTCmd; - -// CLASS DECLARATION -/** - * IM command observer interface. - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ -class MVIMPSTCmdObserver - { - public: // Interface - - /** - * Notifies the command observer that the command has finished. - * @param aCommand The command that was finished. - */ - virtual void CommandFinishedL( - const MVIMPSTCmd& aCommand ) = 0; - /** - * Notifies the the ui on events from service manager. - * @param aState the state of login. - * @param aServiceError, service error if any. - */ - virtual void HandleCommandEventL - (TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt aServiceError) = 0; - - protected: // Disabled functions - /** - * virtual destructor. - */ - virtual ~MVIMPSTCmdObserver() - {} - }; - -#endif // MVIMPSTCMDOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/mvimpstprocessArrayobserver.h --- a/uiservicetab/vimpstcmdprocess/inc/mvimpstprocessArrayobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* Copyright (c) 2008 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: Interface for observer -* -*/ - - -#ifndef MVIMPSTPROCESSARRAYOBSERVER_H -#define MVIMPSTPROCESSARRAYOBSERVER_H - -#include -#include "tvimpstenums.h" - -// CLASS DECLARATION - -/** - * Interface for observer - * - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ - -class MVIMPSTProcessArrayObserver - { - public: // New functions - - - /** - * Called when a contact is added. - * @param type. type of the item deleted(contact/contactlist). - * @param aIndex The index which was added - */ - virtual void HandleAdditionL(TVIMPSTEnums::TItem type, - TInt aIndex) = 0; - /** - * Called when a contact is deleted. - * @param type. type of the item deleted(contact/contactlist). - * @param aIndex The aIndex which was deleted. - */ - virtual void HandleDeletionL(TVIMPSTEnums::TItem type, TInt aIndex) = 0; - virtual void HandleAvatarChangeL( const TDesC& aUserId ) = 0; - - /** - * Virtual destructor - */ - virtual ~MVIMPSTProcessArrayObserver() {}; - }; - - -#endif // MVIMPSTPROCESSARRAYOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/mvimpstprocessarray.h --- a/uiservicetab/vimpstcmdprocess/inc/mvimpstprocessarray.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,261 +0,0 @@ -/* -* Copyright (c) 2008 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: Interface for observer -* -*/ - - -#ifndef _MVIMPSTPROCESSARRAY_H_ -#define _MVIMPSTPROCESSARRAY_H_ - -#include -#include "tvimpstenums.h" - -// FORWARD DECLARATION -class MVIMPSTProcessArrayObserver; -class MVPbkContactLink; -class MVPbkStoreContact; - -// CLASS DECLARATION -/** - * Interface for observer - * - * @lib vimpstcmdprocess.dll - * @since 5.0 - */ - class MVIMPSTProcessArray - { - public: - /** - * register for array call back - * @param aObserver, observer to be registered for - * @return void - */ - virtual void AddObserver(MVIMPSTProcessArrayObserver* aObserver) = 0 ; - - /** - * unregister for array call back - * @param aObserver: to be removed - * @return void - */ - virtual void RemoveObserver() = 0; - - /** - * Count: Called by UI components to get total count of array elements. - * @return integer: Count of items on the array. - */ - virtual TInt Count() const = 0; // total count of array - - - /** - * @return ETrue if voip presence service is enabled,else EFalse. - */ - virtual TBool IsSubServiceSupportedL( TVIMPSTEnums::SubServiceType aType ) const = 0 ; - - /** - * GetType: Function to get the type of list item - * @param aIndex: index of the list item - * @return TEnumsPC::TItem: type of the list item as EContactItem, - * EOwnStatusItem etc - */ - virtual TVIMPSTEnums::TItem GetType(TInt aIndex) const = 0; - - /** - * GetItemNameText: To get item name of each list item - * @param aIndex: Index of the list item whose name is to be returned - * @return TPtrC: Name of the list item - */ - virtual TPtrC GetItemNameText(TInt aIndex)=0; - - - /** - * @returns the VPBK Contact Link - */ - virtual MVPbkContactLink* ContactLink(TInt aIndex) = 0; - - - /** - * SetLoginState: To set the loginstate. - * @param aLoginState: state of login - */ - virtual void SetLoginStateL(TVIMPSTEnums::TVIMPSTRegistrationState aLoginState) = 0; - - - /** - * SetLoginState: To set the loginstate. - * @return TVIMPSTRegistrationState, state of login - */ - virtual TVIMPSTEnums::TVIMPSTRegistrationState GetLoginState() = 0; - - /** - * @returns the TOnlineStatus, current status. - */ - virtual TVIMPSTEnums::TOnlineStatus GetOnlineStatusL(TInt aIndex) = 0; - - /** - * Get the status text for the contact - * @param aIndex: Index of contact item - * @return reference to the status text. - */ - virtual const TDesC& StatusTextL(TInt aIndex ) = 0 ; - - /** - * Construct an array of contact list positions in model. - * aPositionArray is cleared before appending positions! - * @param aPositionArray array in which to store positions - * @return none - */ - virtual void MapContactListPositions(RArray& aPositionArray ) = 0; - /** - * IsMsgPending: To find if there are any pending messages to - * decide the icons for display - * @param aIndex: index of the list item - * @return TBool: ETrue if there are pending messages else EFalse. - */ - virtual TBool IsMsgPending(TInt aIndex) = 0 ; - - /** - * ResetPendingMsg: To reset if there are any pending messages to - * decide the icons for display - * @param aIndex: index of the list item - */ - virtual void ResetPendingMsg(TInt aIndex) = 0; - - - /** - * Find any contact which id is aContactId - * @param ETrue if contact already existst. - * else EFlase. - */ - virtual TBool FindAnyContact( const TDesC& aContactId ) = 0; - - - /** - * check if already conversation opened - * @param aRecipientId, the selected user id with whom conversation is started - * @return ETrue if already exist else EFlase. - */ - virtual TBool IsConversationExistL(const TDesC& aRecipientId) = 0; - - - /** - * check if already conversation opened - * @param aRecipientId, the selected user id with whom conversation is started - * @return ETrue if already exist else EFlase. - */ - virtual TBool IsConversationExist(TInt aIndex) = 0 ; - - /** - * Find the index of contact with contact id as aContactId - * @param aContactId : id of contact whose index is to be found - * @return index of contact else KErrNotFounf if not found - */ - virtual TInt FindContactIndexL( const TDesC& aContactId ) = 0; - - /** - * GetItemNameText: To get item name of each list item - * @param aIndex: Index of the list item whose name is to be returned - * @return TPtrC: Name of the list item - */ - virtual TPtrC GetItemUserId(TInt aIndex) =0; - - /** - * LoginUserNameFromSettingsL: Login user name of the own user from settings - * owener ship is transferred to the caller - * @return allocated HBufC: Login user name of the own user from settings - */ - virtual const TDesC& LoginUserIdFromStoreL() const =0; - - - /** - * - * Return index of aContactId (considering friend request also.). - * @param aContactId, contact id for which index to be found. - * @return, Index of aContactId including friend request. - */ - virtual TInt GetSelectedItemIndex(const TDesC& aContactId) = 0; - - /** - * OwnAvatarIndex: Returns the avatar index for the own item - * This index is used to append the avatar(ICON) in the UI. - * If index is ' 0 ', then it means no avatar is set. - * - * @return index of the avatar - */ - virtual TInt OwnAvatarIndexL( ) = 0; - /** - * SetOwnAvatarIndex: Sets the index for avatar for for the own item - * - * @param aAvatarIndex: Index to be set - */ - virtual void SetOwnAvatarIndexL( TInt aAvatarIndex ) = 0; - - /** - * OwnAvatarContent: Returns the content of the avatar image for the own item - * - * If nothing returns KNullDesC8 - * - * @return TDesC8& content of the avatar - */ - virtual const TDesC8& OwnAvatarContentL( ) const = 0; - /** - * AvatarContent: Returns the content of the avatar image for the conatct - * - * If nothing returns KNullDesC8 - * @param aContactIndex : Index of the conatct item - * - * @return TDesC8& content of the avatar - */ - virtual const TDesC8& AvatarContent(TInt aContactIndex) = 0; - - /** - * SetAvatarIndex: Sets the index for avatar for for the corresponding contact item - * - * @param aContactIndex : Index of the conatct item - * @param aAvatarIndex: Index to be set - */ - virtual void SetAvatarIndex( TInt aContactIndex, TInt aAvatarIndex )= 0; - - /** - * AvatarIndex: Returns the avatar index for the corresponding contact item - * This index is used to append the avatar(ICON) in the UI. - * If index is ' 0 ', then it means no avatar is set. - * - * @param aContactIndex : Index of the conatct item - * - * @return index of the avatar - */ - virtual TInt AvatarIndex(TInt aContactIndex) = 0; - - /** - * remove the item from invitation or unknown array if found - * @param aContactId : conatct user Id - * @return ETrue if contact is removed - */ - virtual TBool RemoveFromUnknonOrInvitationListL( const TDesC& aContactId , TBool aBlocked ) = 0 ; - - /** - * @return, formatted string for the listbox item - */ - virtual TPtrC16 GetFormattedString(TInt aIndex) = 0; - - /** - * Virtual destructor - */ - virtual ~MVIMPSTProcessArray() {}; - - }; -#endif // _MVIMPSTPROCESSARRAY_H_ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/inc/vimpstcmd.hrh --- a/uiservicetab/vimpstcmdprocess/inc/vimpstcmd.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2008 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: A enum IM command codes. -* -*/ - - -#ifndef VIMPSTCMD_HRH -#define VIMPSTCMD_HRH - -/** - * A enum - * IM command codes. - */ -enum TImCommandId - { - EFirstCmd = 0, /* First command*/ - ELoginService, /* Login command*/ - ELogoutService, /* Logout command*/ - ELaunchCCA, /* Launch details view command*/ - EAddContact, /* Add contact command*/ - EDeleteContact, /* DElete contact command*/ - EChangeOwnStatus, /* Change own status command*/ - EChangeOwnMessage, /* change own message command*/ - ESearch, /* Search command*/ - EFriendAccpeted, /* Friend request accepted command*/ - EFriendRejected, /* Frined request rejected command*/ - EChangeOwnAvtar, - ECloseConversation, - EAddFromPbk, - EAddToPbk, - ECancelLogin, - EEditContact, - ECmdProcessSelectedContactNew, - ECmdProcessSelectedContactExist, - ECmdProcessAcceptedContactNew, - ECmdProcessAcceptedContactExist, - ECmdBlockContact, - ECmdUnBlockContact, - EFetchBlockedList, - ELastCmd = 65535 /* Last command, some arbitrary number.*/ - }; - - -#endif // VIMPSTCMD_HRH - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdaddcontact.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdaddcontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,215 +0,0 @@ -/* -* Copyright (c) 2008 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: VIMPST command for add contact -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdaddcontact.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - - -#include -#include "mvimpstengine.h" -#include "mvimpstenginecontactmgmtextention.h" -#include "mvimpstengineextentionfeatures.h" -#include -#include -#include -#include - -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" -#include "mvimpststoragecontact.h" -#include "tvimpstenums.h" -#include "tvimpstconsts.h" -#include "mvimpstenginesubservice.h" -#include "mvimpstenginepresencesubservice.h" - -#include "uiservicetabtracer.h" - -// Constants -_LIT( KListNameAllBuddy ,"buddylist" ); - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddContact::CVIMPSTCmdAddContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdAddContact::CVIMPSTCmdAddContact( - const TInt aCommandId ,const TDesC& aContactId, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iContactId( aContactId ), - iEngine(aEngine) - { - TRACER_AUTO; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact() - { - TRACER_AUTO; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddContact::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdAddContact* CVIMPSTCmdAddContact::NewL( - const TInt aCommandId,const TDesC& aContactId, - MVIMPSTEngine& aEngine) - { - TRACER_AUTO; - CVIMPSTCmdAddContact* self = new (ELeave ) CVIMPSTCmdAddContact( aCommandId ,aContactId, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddContact::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdAddContact::ConstructL() - { - TRACER_AUTO; - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddContact::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdAddContact::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iEngine.ServiceId()) ; - if(storage ) - { - if( !IsContactBlocked(iContactId) ) - { - MVIMPSTStorageContact* alreadyExist = storage->FindContactByUserId( iContactId ); - if( !alreadyExist ) - { - iError = KErrNone; - MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::EContactManagement); - if (feature) - { - MVIMPSTEngineContactMgmtExtention& contactMgr = - MVIMPSTEngineContactMgmtExtention::Cast (*feature); - // if there is a scenario when the user enters only the firstname , then userid is null. - //In this case don't send it to the server, Add the contact to the servicetab and - //presence will not be visible. - // check if contact is in the blocked list. - // iError already exist - if( iContactId.Length() ) - { - iError = contactMgr.AddServerContactL(KListNameAllBuddy,iContactId, KNullDesC() ); - }//End if(iContactId) - } //End if(feature) - if(KErrNone == iError) - { - storage->CreateNewContactL( iContactId ); - } - }//End if(alreadyExist) - else - { - iError = EErrExistInContactList; - } - } - else - { - iError = EErrExistInBlockList; - } - }//End if(storage) - - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddContact::IsContactBlocked -// -------------------------------------------------------------------------- -TBool CVIMPSTCmdAddContact::IsContactBlocked(const TDesC& aUserId) - { - TRACER_AUTO; - TRACE("userId: %S", &aUserId); - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - - RPointerArray *blockedlist = presence .GetBlockedList(); - - if(blockedlist) - { - for(TInt i=0; iCount(); ++i) - { - if(0 == aUserId.CompareC((*blockedlist)[i]->Des())) - { - return ETrue; - } - } - } - } - return EFalse; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddContact::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdAddContact::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddContact::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdAddContact::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddContact::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdAddContact::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdaddfrompbk.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdaddfrompbk.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation for CVIMPSTCmdAddFromPbk -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdaddfrompbk.h" -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include -#include "mvimpstengine.h" -#include "mvimpststorageserviceview.h" -#include "cvimpststoragemanagerfactory.h" -#include -#include -#include -#include "mvimpstenginecontactmgmtextention.h" -#include "mvimpstengineextentionfeatures.h" -#include - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddFromPbk::CVIMPSTCmdAddFromPbk -// -------------------------------------------------------------------------- -// -CVIMPSTCmdAddFromPbk::CVIMPSTCmdAddFromPbk( const TInt aCommandId , - const MVPbkStoreContact& aStoreContact, - MVIMPSTEngine& aEngine ): - iCommandId( aCommandId ), - iStoreContact( aStoreContact ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddFromPbk::~CVIMPSTCmdAddFromPbk -// -------------------------------------------------------------------------- -// -CVIMPSTCmdAddFromPbk::~CVIMPSTCmdAddFromPbk() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddFromPbk::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdAddFromPbk* CVIMPSTCmdAddFromPbk::NewL( const TInt aCommandId, - const MVPbkStoreContact& aStoreContact, - MVIMPSTEngine& aEngine ) - { - TRACER_AUTO; - CVIMPSTCmdAddFromPbk* self = new (ELeave ) CVIMPSTCmdAddFromPbk( aCommandId ,aStoreContact, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddFromPbk::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdAddFromPbk::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddFromPbk::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdAddFromPbk::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ; - if(storage) - { - //storage->AddPhoneBookContactL(iStoreContact); - // get the link and form link identify the servicedetails and then sedn it to - //contact management to add it to server. - //make search request using search manager in engine - // Read all necessary data from contact and store to - // own type - CDesCArray* arrayForService = new (ELeave) CDesCArrayFlat( - 12 ); - CleanupStack::PushL( arrayForService ); // 1 - - GetServiceFieldsL(*arrayForService); - - TInt count = arrayForService->Count(); - MVIMPSTEngineContactMgmtExtention* contactMgr = - dynamic_cast - (iEngine.ExtentionFeatures(TVIMPSTEnums::EContactManagement)); - - for(TInt i = 0; i< count; i++) - { - if(contactMgr) - { - iError = contactMgr->AddServerContactL(KNullDesC(),KNullDesC(),KNullDesC()); - } - } - CleanupStack::PopAndDestroy(arrayForService); - } - else - { - iError = KErrGeneral; - } - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddFromPbk::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdAddFromPbk::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddFromPbk::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdAddFromPbk::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddFromPbk::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdAddFromPbk::Result() const - { - //return valid data regd the command operation - return iError; - } -// --------------------------------------------------------------------------- -// CVIMPSTCmdAddFromPbk::GetServiceFieldsL -// --------------------------------------------------------------------------- -// -void CVIMPSTCmdAddFromPbk::GetServiceFieldsL( CDesCArray& aArrayForServiceFields ) - { - - TRACER_AUTO; - HBufC* values[40]; - for( TInt index = 0 ; - index < iStoreContact.Fields().FieldCount() ; - index++ ) - { - const MVPbkStoreContactFieldCollection& fieldCollection = iStoreContact.Fields(); - - const MVPbkStoreContactField& field = fieldCollection.FieldAt( index ); - const MVPbkFieldType* fieldType = field.BestMatchingFieldType(); - - //find the relevant voip fields/email id fileds. - if ( fieldType ) - { - if ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_VOIPHOME ) || - ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_VOIPWORK ) || - ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_VOIPGEN ) || - ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_SIP )|| - ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_EMAILWORK ) || - ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_EMAILHOME ) || - ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_EMAILGEN )) - { - TRACE("GetServiceFieldsL - Found"); - values[0] = MVPbkContactFieldTextData::Cast( - iStoreContact.Fields().FieldAt( index ). - FieldData() ).Text().AllocLC(); - if ( values[0] ) - { - // Check for prefix and remove if found - TInt prefixLocation = values[0]->Locate( ':' ); - if ( KErrNotFound != prefixLocation ) - { - TRACE("Prefix found -> remove"); - aArrayForServiceFields.AppendL( values[0]->Des().Mid( - prefixLocation+1 ) ); - } - else - { - TRACE("No prefix"); - aArrayForServiceFields.AppendL( values[0]->Des() ); - } - CleanupStack::PopAndDestroy( values[0] ); - } - } - } - } - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdaddtopbk.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdaddtopbk.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation for CVIMPSTCmdAddToPbk -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdaddtopbk.h" -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include -#include "mvimpstengine.h" -#include "mvimpststorageserviceview.h" -#include "cvimpststoragemanagerfactory.h" - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddToPbk::CVIMPSTCmdAddToPbk -// -------------------------------------------------------------------------- -// -CVIMPSTCmdAddToPbk::CVIMPSTCmdAddToPbk( const TInt aCommandId , - const MVIMPSTStorageContact& aStoreContact, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iStoreContact( aStoreContact ), - iEngine( aEngine ) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddToPbk::~CVIMPSTCmdAddToPbk -// -------------------------------------------------------------------------- -// -CVIMPSTCmdAddToPbk::~CVIMPSTCmdAddToPbk() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddToPbk::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdAddToPbk* CVIMPSTCmdAddToPbk::NewL( const TInt aCommandId, - const MVIMPSTStorageContact& aStoreContact, - MVIMPSTEngine& aEngine) - { - CVIMPSTCmdAddToPbk* self = new (ELeave ) CVIMPSTCmdAddToPbk( aCommandId, aStoreContact, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddToPbk::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdAddToPbk::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddToPbk::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdAddToPbk::ExecuteLD() - { - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iEngine.ServiceId()) ; - if(storage) - { - //storage->AddContactToPhoneBookL(iStoreContact); - } - else - { - iError = KErrGeneral; - } - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddToPbk::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdAddToPbk::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddToPbk::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdAddToPbk::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdAddToPbk::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdAddToPbk::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdblockcontact.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdblockcontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* Copyright (c) 2008 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: Execute command for blocking contact -* -*/ - -// INCLUDE FILES -#include "cvimpstcmdblockcontact.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" - -#include "mvimpstenginesubservice.h" -#include "mvimpstenginepresencesubservice.h" -#include "tvimpstconsts.h" -#include "mvimpstprocessarray.h" -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdBlockContact::CVIMPSTCmdBlockContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdBlockContact::CVIMPSTCmdBlockContact( - const TInt aCommandId , const TDesC& aContactId, - MVIMPSTProcessArray& aArrayProcess, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iContactId( aContactId ), - iProcessArray( aArrayProcess ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdBlockContact::~CVIMPSTCmdBlockContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdBlockContact::~CVIMPSTCmdBlockContact() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdBlockContact::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdBlockContact* CVIMPSTCmdBlockContact::NewL( - const TInt aCommandId, const TDesC& aContactId, - MVIMPSTProcessArray& aArrayProcess, - MVIMPSTEngine& aEngine) - { - CVIMPSTCmdBlockContact* self = new (ELeave ) CVIMPSTCmdBlockContact( aCommandId ,aContactId, aArrayProcess ,aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdBlockContact::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdBlockContact::ConstructL() - { - iError = KErrNotFound; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdBlockContact::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdBlockContact::ExecuteLD() - { - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - iError = KErrGeneral; - if(iContactId.Length()) - { - //Get Presence SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - if (subService && iEngine.IsBlockSupportedL()) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - iError = presence.AddToBlockListL(iContactId); - TRACE("iError: %d", iError); - } - } - - if( iError == KErrNone ) - { - iProcessArray.RemoveFromUnknonOrInvitationListL( iContactId ,ETrue ); - } - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdBlockContact::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdBlockContact::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdBlockContact::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdBlockContact::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdBlockContact::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdBlockContact::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdcall.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdcall.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation for CVIMPSTCmdCall -* -*/ - - -// INCLUDE FILES - - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" -#include "cvimpstcmdcall.h" -#include "mvimpstprocessarray.h" - -#include "uiservicetabtracer.h" - -#include -#include -#include -#include -#include - - - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCall::CVIMPSTCmdCall -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCall::CVIMPSTCmdCall( - const TInt aCommandId,TInt& aIndex, - MVIMPSTProcessArray& mArrayProcess, - TInt aWindowGroup, - TUint32 aServiceId) : - iCommandId( aCommandId ), - iIndex(aIndex), - iArrayProcess(mArrayProcess), - iWindowGroup(aWindowGroup), - iServiceId(aServiceId) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCall::~CVIMPSTCmdCall -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCall::~CVIMPSTCmdCall() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCall::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCall* CVIMPSTCmdCall::NewL( - const TInt aCommandId,TInt& aIndex, - MVIMPSTProcessArray& aArrayProcess, - TInt aWindowGroup, - TUint32 aServiceId) - { - CVIMPSTCmdCall* self = new (ELeave ) CVIMPSTCmdCall( aCommandId,aIndex, - aArrayProcess, aWindowGroup, - aServiceId); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdCall::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCall::ConstructL() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCall::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCall::ExecuteLD() - { - TRACER_AUTO; - - //push to the cleanupstack - CleanupStack::PushL( this ); - - CAiwServiceHandler * aiwServiceHandler = CAiwServiceHandler::NewL(); - - CAiwDialDataExt* dialDataExt = CAiwDialDataExt::NewL(); - CleanupStack::PushL( dialDataExt ); - - dialDataExt->SetWindowGroup( iWindowGroup ); - - HBufC8* pack = iArrayProcess.ContactLink(iIndex)->PackLC(); - - dialDataExt->SetContactLinkL( *pack ); - - dialDataExt->SetCallType( CAiwDialData::EAIWVoiP ); - - //dialDataExt->SetServiceId( iServiceId ); - - - CAiwGenericParamList& paramList = - aiwServiceHandler->InParamListL(); - dialDataExt->FillInParamListL( paramList ); - - aiwServiceHandler->ExecuteServiceCmdL( - KAiwCmdCall, - paramList, - aiwServiceHandler->OutParamListL(), - NULL); // No need for callback - - - CleanupStack::PopAndDestroy( pack ); - CleanupStack::PopAndDestroy( dialDataExt ); - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - // CHAT_DP_FUNC_ENTER("CVIMPSTCallCmd:: CommandFinished"); - CleanupStack::PopAndDestroy(); - // CHAT_DP_FUNC_DONE("CVIMPSTCallCmd::ExecuteLD"); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCall::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCall::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - TRACER_AUTO; - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCall::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdCall::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCall::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdCall::Result() const - { - //return valid data regd the command operation - return KErrNone; - } - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdcancellogin.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdcancellogin.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2008 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: cancel login command implementation -* -*/ - - -// INCLUDE FILES - -#include "cvimpstcmdcancellogin.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogout::CVIMPSTCmdLogout -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCancelLogin::CVIMPSTCmdCancelLogin( const TInt aCommandId, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCancelLogin::~CVIMPSTCmdCancelLogin -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCancelLogin::~CVIMPSTCmdCancelLogin() - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCancelLogin::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCancelLogin* CVIMPSTCmdCancelLogin::NewL( - const TInt aCommandId, - MVIMPSTEngine& aEngine) - { - // return the object created - - TRACER_AUTO; - return new (ELeave ) CVIMPSTCmdCancelLogin( aCommandId , aEngine); - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCancelLogin::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCancelLogin::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - // now call logout for cancel login - // protocol adaptation has to take care of this - iEngine.LogoutL(); - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCancelLogin::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCancelLogin::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCancelLogin::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdCancelLogin::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCancelLogin::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdCancelLogin::Result() const - { - // return KErrNone since iEngine.Logout() doesnot return any error value - return KErrNone; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdcca.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdcca.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation for CVIMPSTCmdCCA -* -*/ - - -// INCLUDE FILES - - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" -#include "cvimpstcmdcca.h" -#include "mvimpstengine.h" -#include "mvimpstprocessarray.h" - -#include - -#include -#include -#include -#include "tvimpstconsts.h" -#include "vimpstdetailsviewpluginuids.hrh" - -#include "uiservicetabtracer.h" - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::CVIMPSTCmdCCA -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCCA::CVIMPSTCmdCCA( - const TInt aCommandId, - TInt& aIndex, - MCCAConnection* aConnection, - MVIMPSTProcessArray& mArrayProcess, - MVIMPSTEngine& aEngine ) : - iCommandId( aCommandId ), - iIndex(aIndex), - iConnection(aConnection), - iArrayProcess(mArrayProcess), - iEngine( aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::~CVIMPSTCmdCCA -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCCA::~CVIMPSTCmdCCA() - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCCA* CVIMPSTCmdCCA::NewL( - const TInt aCommandId,TInt& aIndex, - MCCAConnection* aConnection, - MVIMPSTProcessArray& aArrayProcess, - MVIMPSTEngine& aEngine ) - { - TRACER_AUTO; - CVIMPSTCmdCCA* self = new (ELeave ) CVIMPSTCmdCCA( aCommandId,aIndex,aConnection,aArrayProcess, aEngine ); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCCA::ConstructL() - { - RProperty::Define(KMeCoPropertyUid, KMeCoXSPDetailsServiceIdKey, RProperty::EInt, - ECapabilityReadUserData ,ECapabilityWriteUserData); - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCCA::ExecuteLD() - { - TRACER_AUTO; - - //push to the cleanupstack - CleanupStack::PushL( this ); - - LaunchCcaL(); - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCCA::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdCCA::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdCCA::Result() const - { - //return valid data regd the command operation - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCCA::LaunchCcaL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCCA::LaunchCcaL() - { - TRACER_AUTO; - if ( iParameter ) - { - iParameter->Close(); - iParameter = NULL; - } - - // The lifetime of this cmd object is too short to hold - // iParameterRef, caller of this must own it - iParameter = TCCAFactory::NewParameterL(); - iParameter->SetConnectionFlag(MCCAParameter::ENormal); - iParameter->SetContactDataFlag(MCCAParameter::EContactLink); - - TUid uid( TUid::Null() ); - uid.iUid = KVIMPSTDetailsViewPluginImplmentationUid + iEngine.ServiceId(); // service details view implementation uid - iParameter->SetLaunchedViewUid( uid ); - - RProperty::Set(KMeCoPropertyUid, KMeCoXSPDetailsServiceIdKey, iEngine.ServiceId() ); - - MVPbkContactLink* link = iArrayProcess.ContactLink( iIndex )->CloneLC(); - if (link) - { - HBufC8* link8 = link->PackLC(); - HBufC16* link16 = HBufC16::NewLC( link8->Length() ); - link16->Des().Copy( *link8); - iParameter->SetContactDataL(link16->Des()); - CleanupStack::PopAndDestroy(3); - } - // Sync call - iConnection->LaunchApplicationL(*iParameter); - - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdchangeownavtar.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdchangeownavtar.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,138 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for set own avtar -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdchangeownavtar.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "mvimpstenginepresencesubservice.h" -#include "mvimpstenginesubservice.h" - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnAvtar::CVIMPSTCmdChangeOwnAvtar -// -------------------------------------------------------------------------- -// -CVIMPSTCmdChangeOwnAvtar::CVIMPSTCmdChangeOwnAvtar( - const TInt aCommandId ,const TAvatarData& aData, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iData(aData), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnAvtar::~CVIMPSTCmdChangeOwnAvtar -// -------------------------------------------------------------------------- -// -CVIMPSTCmdChangeOwnAvtar::~CVIMPSTCmdChangeOwnAvtar() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnAvtar::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdChangeOwnAvtar* CVIMPSTCmdChangeOwnAvtar::NewL( - const TInt aCommandId,const TAvatarData& aData, - MVIMPSTEngine& aEngine) - { - CVIMPSTCmdChangeOwnAvtar* self = new (ELeave ) CVIMPSTCmdChangeOwnAvtar( aCommandId ,aData, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnAvtar::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdChangeOwnAvtar::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnAvtar::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdChangeOwnAvtar::ExecuteLD() - { - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - //Get Presence SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - presence.PublishOwnPresenceL(iData.iStatus, iData.iStatusText, iData.iFileName , iData.iMimeType, ETrue ); - } - - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnAvtar::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdChangeOwnAvtar::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnAvtar::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdChangeOwnAvtar::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnAvtar::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdChangeOwnAvtar::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdchangeownmessage.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdchangeownmessage.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for change own message -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdchangeownmessage.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "mvimpstenginesubservice.h" -#include "mvimpstenginepresencesubservice.h" - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnMessage::CVIMPSTCmdChangeOwnMessage -// -------------------------------------------------------------------------- -// -CVIMPSTCmdChangeOwnMessage::CVIMPSTCmdChangeOwnMessage( - const TInt aCommandId ,TStatusAndStatusText aStatus, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iStatus(aStatus.iStatus), - iEngine(aEngine) - { - iStatusText.Copy(aStatus.iStatusText); - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnMessage::~CVIMPSTCmdChangeOwnMessage -// -------------------------------------------------------------------------- -// -CVIMPSTCmdChangeOwnMessage::~CVIMPSTCmdChangeOwnMessage() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnMessage::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdChangeOwnMessage* CVIMPSTCmdChangeOwnMessage::NewL( - const TInt aCommandId,TStatusAndStatusText aStatus, - MVIMPSTEngine& aEngine) - { - TRACER_AUTO; - CVIMPSTCmdChangeOwnMessage* self = new (ELeave ) CVIMPSTCmdChangeOwnMessage( aCommandId ,aStatus, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnMessage::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdChangeOwnMessage::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnMessage::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdChangeOwnMessage::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - //Get Presence SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - presence.PublishOwnPresenceL(iStatus, iStatusText); - } - - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnMessage::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdChangeOwnMessage::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnMessage::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdChangeOwnMessage::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnMessage::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdChangeOwnMessage::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdchangeownstatus.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdchangeownstatus.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for change status -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdchangeownstatus.h" -#include "mvimpstenginepresencesubservice.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "mvimpstenginesubservice.h" - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnStatus::CVIMPSTCmdChangeOwnStatus -// -------------------------------------------------------------------------- -// -CVIMPSTCmdChangeOwnStatus::CVIMPSTCmdChangeOwnStatus( - const TInt aCommandId ,TStatusAndStatusText aStatus, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iStatus(aStatus.iStatus), - iEngine(aEngine) - { - iStatusText.Copy(aStatus.iStatusText); - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnStatus::~CVIMPSTCmdChangeOwnStatus -// -------------------------------------------------------------------------- -// -CVIMPSTCmdChangeOwnStatus::~CVIMPSTCmdChangeOwnStatus() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnStatus::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdChangeOwnStatus* CVIMPSTCmdChangeOwnStatus::NewL( - const TInt aCommandId,TStatusAndStatusText aStatus, - MVIMPSTEngine& aEngine) - { - CVIMPSTCmdChangeOwnStatus* self = new (ELeave ) CVIMPSTCmdChangeOwnStatus( aCommandId ,aStatus, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnStatus::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdChangeOwnStatus::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnStatus::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdChangeOwnStatus::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - //Get Presence SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - - if ( iStatus == TVIMPSTEnums::EInvisible) - { - // Status set to Appear Offline - iError = presence.PublishOwnPresenceL(iStatus, KNullDesC); - } - else - { - iError = presence.PublishOwnPresenceL(iStatus, iStatusText); - } - } - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - - - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnStatus::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdChangeOwnStatus::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnStatus::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdChangeOwnStatus::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdChangeOwnStatus::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdChangeOwnStatus::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdcloseconversation.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdcloseconversation.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for close conversation -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdcloseconversation.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "mvimpstenginesubservice.h" -#include "mvimpstengineimsubservice.h" - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation( const TInt aCommandId, - const TDesC& aContactId, - MVIMPSTEngine& aEngine ): - iCommandId( aCommandId ), - iContactId( aContactId ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCloseConversation::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdCloseConversation* CVIMPSTCmdCloseConversation::NewL( const TInt aCommandId, - const TDesC& aContactId, - MVIMPSTEngine& aEngine ) - { - TRACER_AUTO; - CVIMPSTCmdCloseConversation* self = new (ELeave ) CVIMPSTCmdCloseConversation( aCommandId ,aContactId, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdCloseConversation::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCloseConversation::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCloseConversation::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCloseConversation::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - //Get IM SubService - MVIMPSTEngineSubService* subService1 = - (iEngine.SubService(TVIMPSTEnums::EIM)); - - if(subService1) - { - MVIMPSTEngineIMSubService& imSubService = - MVIMPSTEngineIMSubService::Cast (*subService1); - imSubService.CloseConversationL( iContactId ); - } - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCloseConversation::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdCloseConversation::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCloseConversation::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdCloseConversation::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdCloseConversation::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdCloseConversation::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmddeletecontact.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmddeletecontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for delete contact -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmddeletecontact.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" -#include "mvimpstenginesubservice.h" -#include "mvimpstenginecontactmgmtextention.h" -#include "mvimpstengineextentionfeatures.h" -#include "mvimpstengineimsubservice.h" -#include "tvimpstenums.h" -#include "tvimpstconsts.h" -#include "mvimpstenginesubservice.h" -#include "mvimpstenginepresencesubservice.h" -#include "mvimpstenginepresencesubservice.h" - -// Constants -_LIT( KListNameAllBuddy ,"buddylist" ); -_LIT( KPresenceBlockedList, "blockedcontacts"); - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdDeleteContact::CVIMPSTCmdDeleteContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdDeleteContact::CVIMPSTCmdDeleteContact( - const TInt aCommandId , MVPbkContactLink* aContactLink, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iContactLink( aContactLink ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdDeleteContact::~CVIMPSTCmdDeleteContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdDeleteContact::~CVIMPSTCmdDeleteContact() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdDeleteContact::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdDeleteContact* CVIMPSTCmdDeleteContact::NewL( - const TInt aCommandId, MVPbkContactLink* aContactLink, - MVIMPSTEngine& aEngine) - { - TRACER_AUTO; - CVIMPSTCmdDeleteContact* self = new (ELeave ) CVIMPSTCmdDeleteContact( aCommandId ,aContactLink, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdDeleteContact::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdDeleteContact::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdDeleteContact::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdDeleteContact::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - iError = KErrNone; - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId()) ; - if(storage) - { - MVIMPSTStorageContact* contact = storage->FindContactByLink( *iContactLink ); - if (contact ) - { - TBuf listId; - listId.Zero(); - listId.Append(KListNameAllBuddy); - if(TVIMPSTEnums::EBlocked == contact->OnlineStatus()) - { - listId.Zero(); - listId.Append(KPresenceBlockedList); - } - TPtrC userIdPtr = contact->UserId(); - MVIMPSTEngineSubService* subService = iEngine.SubService(TVIMPSTEnums::EPresence); - MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::EContactManagement); - //Get IM SubService - MVIMPSTEngineSubService* imService = iEngine.SubService(TVIMPSTEnums::EIM) ; - //for each userid in the service details, unsubscribe - if( userIdPtr.Length() ) - { - if( subService ) - { - MVIMPSTEnginePresenceSubService& presenceSubService = MVIMPSTEnginePresenceSubService::Cast(*subService); - presenceSubService.UnSubscribePresenceOfSingleContactL( userIdPtr ); - } - if (feature ) - { - MVIMPSTEngineContactMgmtExtention& contactMgr = MVIMPSTEngineContactMgmtExtention::Cast(*feature); - TRAP(iError, contactMgr.DeleteServerContactL(listId, userIdPtr ) ); - } - if(imService ) - { - MVIMPSTEngineIMSubService& imSubService = - MVIMPSTEngineIMSubService::Cast (*imService); - TRAP_IGNORE( imSubService.CloseConversationL( userIdPtr )); - } - } - if( iError == KErrNone ) - { - storage->RemoveContactL( contact ); - } - } // contact - } // storage - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdDeleteContact::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdDeleteContact::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdDeleteContact::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdDeleteContact::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdDeleteContact::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdDeleteContact::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdeditcontact.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdeditcontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* Copyright (c) 2008 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: Edit Contact for local store and server store -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdeditcontact.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "mvimpstenginecontactmgmtextention.h" -#include "mvimpstengineextentionfeatures.h" - -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdEditContact::CVIMPSTCmdEditContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdEditContact::CVIMPSTCmdEditContact( - const TInt aCommandId ,MVPbkContactLink* aContactLink, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iContactLink( aContactLink ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdEditContact::~CVIMPSTCmdEditContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdEditContact::~CVIMPSTCmdEditContact() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdEditContact::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdEditContact* CVIMPSTCmdEditContact::NewL( - const TInt aCommandId,MVPbkContactLink* aContactLink, - MVIMPSTEngine& aEngine) - { - TRACER_AUTO; - CVIMPSTCmdEditContact* self = new (ELeave ) CVIMPSTCmdEditContact( aCommandId ,aContactLink, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdEditContact::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdEditContact::ConstructL() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdEditContact::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdEditContact::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); -/* - MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::EContactManagement); - if (feature) - { - // to be implimented for serverstore editcontact - iError = KErrNone; - } - - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iEngine.ServiceId()) ; - if(storage) - { - storage->EditContactL(*iContactLink); - } - - CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd:: CommandFinished"); - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd:: CommandFinished"); - */ - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdEditContact::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdEditContact::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdEditContact::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdEditContact::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdEditContact::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdEditContact::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdfactory.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,307 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation for CVIMPSTCmdFactory -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdfactory.h" -#include "cvimpstprocessarray.h" -#include "cvimpstcmdcca.h" -#include "cvimpstcmdlogin.h" -#include "cvimpstcmdlogout.h" -#include "cvimpstcmdcancellogin.h" - -#include "uiservicetabtracer.h" - -#include "mvimpstcmdobserver.h" -#include "mvimpstengine.h" -#include "tvimpstconsts.h" -#include "cvimpststoragemanagerfactory.h" -#include "cvimpstcmdaddcontact.h" -#include "cvimpstcmddeletecontact.h" -#include "tvimpstconsts.h" -#include "cvimpstcmdchangeownstatus.h" -#include "cvimpstcmdchangeownmessage.h" -#include "cvimpstcmdsearch.h" -#include "cvimstcmdfriendrequest.h" -#include "cvimpstcmdchangeownavtar.h" -#include "cvimpstcmdcloseconversation.h" -#include "cvimpstcmdaddtopbk.h" -#include "cvimpstcmdprocessselectedcontact.h" -#include "cvimpstcmdblockcontact.h" -#include "cvimpstcmdunblockcontact.h" -#include "cvimpstcmdfetchblockedlist.h" - - -// ================= MEMBER FUNCTIONS ======================= - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFactory::CVIMPSTCmdFactory -// -------------------------------------------------------------------------- -// -CVIMPSTCmdFactory::CVIMPSTCmdFactory(MVIMPSTEngine& aEngine) : -iEngine(aEngine) - { - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFactory::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFactory::ConstructL() - { - TRACER_AUTO; - TUint32 serviceId = iEngine.ServiceId(); - - //Make sure we initialise the Storage view for this service - HBufC* storeName = HBufC::NewLC( KVIMPSTUISPSMaxPropertyLength ); - - TPtr storeNamePtr( storeName->Des() ); - - iEngine.ContactStoreIdL(storeNamePtr); - - CVIMPSTStorageManagerFactory::InitialiseViewL(serviceId, *storeName, iEngine.ServiceName()); - - CleanupStack::PopAndDestroy(); //storeName - - iEngine.IntializeStorageL(); - - - //create the array process - iArrayProcess = CVIMPSTProcessArray::NewL( iEngine ); - - iEngine.RegisterServiceSessionObserverL(this); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFactory::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdFactory* CVIMPSTCmdFactory::NewL(MVIMPSTEngine& aEngine) - { - CVIMPSTCmdFactory* self = new (ELeave) CVIMPSTCmdFactory(aEngine); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFactory::~CVIMPSTCmdFactory -// -------------------------------------------------------------------------- -// -CVIMPSTCmdFactory::~CVIMPSTCmdFactory() - { - TRACER_AUTO; - iEngine.UnIntializeStorage(); - iEngine.UnRegisterServiceSessionObserver(this); - - iObservers.Reset(); - iObservers.Close(); - - delete iArrayProcess; - iArrayProcess = NULL; - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFactory::CreateCommandForIdL -// -------------------------------------------------------------------------- -// -MVIMPSTCmd* CVIMPSTCmdFactory::CreateCommandForIdL( - TImCommandId aCommandId,TAny* aData /*NULL*/) - { - TRACER_AUTO; - MVIMPSTCmd* commd = NULL; - - //Instantiate appropriate command - switch ( aCommandId ) - { - case ELoginService: - { - commd = CVIMPSTCmdLogin::NewL(aCommandId,*(TUint32*)aData, iEngine); - break; - } - - case ELogoutService: - { - commd = CVIMPSTCmdLogout::NewL(aCommandId,*(TUint32*)aData, iEngine); - break; - } - case ELaunchCCA: - { - commd = CVIMPSTCmdCCA::NewL(aCommandId, - (*(TLaunchCCAData*)aData).iIndex, - (*(TLaunchCCAData*)aData).iConnection, - *iArrayProcess, - iEngine ); - break; - - } - case EAddContact: - { - commd = CVIMPSTCmdAddContact::NewL(aCommandId,*(TDesC*) aData, iEngine); - break; - - } - case EDeleteContact: - { - commd = CVIMPSTCmdDeleteContact::NewL(aCommandId,*(MVPbkContactLink**) aData, iEngine); - break; - - } - case EChangeOwnStatus: - { - commd = CVIMPSTCmdChangeOwnStatus::NewL(aCommandId,*(TStatusAndStatusText*) aData, iEngine); - break; - - } - case EChangeOwnMessage: - { - commd = CVIMPSTCmdChangeOwnMessage::NewL(aCommandId,*(TStatusAndStatusText*) aData, iEngine); - break; - - } - case ESearch: - { - commd = CVIMPSTCmdSearch::NewL(aCommandId,*(RArray*) aData, iEngine); - break; - - } - case EFriendAccpeted: - case EFriendRejected: - { - commd = CVIMPSTCmdFriendRequest::NewL(aCommandId,*(TDesC*) aData, iEngine); - break; - } - case EChangeOwnAvtar: - { - commd = CVIMPSTCmdChangeOwnAvtar::NewL(aCommandId,*(TAvatarData*) aData, iEngine); - break; - } - case ECloseConversation: - { - commd = CVIMPSTCmdCloseConversation::NewL(aCommandId,*(TDesC*) aData, iEngine); - break; - } - - case EAddToPbk: - { - commd = CVIMPSTCmdAddToPbk::NewL(aCommandId,*(MVIMPSTStorageContact*) aData, iEngine); - break; - } - case ECancelLogin: - { - commd = CVIMPSTCmdCancelLogin::NewL(aCommandId ,iEngine); - break; - } - case ECmdProcessAcceptedContactNew: - case ECmdProcessSelectedContactNew: - case ECmdProcessAcceptedContactExist: - case ECmdProcessSelectedContactExist: - { - commd = CVIMPSTCmdProcessSelectedContact::NewL( aCommandId, *(TVPbkSelectedData*)aData, iEngine ); - break; - } - case ECmdBlockContact: - { - commd = CVIMPSTCmdBlockContact::NewL(aCommandId,*(TDesC*) aData, *iArrayProcess , iEngine); - break; - - } - case ECmdUnBlockContact: - { - commd = CVIMPSTCmdUnBlockContact::NewL(aCommandId,*(TDesC*) aData, iEngine); - break; - - } - case EFetchBlockedList: - { - commd = CVIMPSTCmdFetchBlockedContactList::NewL(aCommandId, iEngine); - break; - } - default: - { - break; - } - - } - - return commd; - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFactory::HandleServiceEventL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFactory::HandleServiceEventL - ( TVIMPSTEnums::TVIMPSTRegistrationState aState,TInt aServiceError ) - { - TRACER_AUTO; - // need not to store update complete state - iArrayProcess->SetLoginStateL( aState ); - for( TInt index( 0 ); index < iObservers.Count(); ++index ) - { - iObservers[index]->HandleCommandEventL(aState,aServiceError); - } - - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdFactory::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFactory::AddObserverL(MVIMPSTCmdObserver* aObserver) - { - if( iObservers.Find( aObserver ) == KErrNotFound ) - { - User::LeaveIfError( iObservers.Append( aObserver ) ); - } - - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdFactory::RemoveObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFactory::RemoveObserver(MVIMPSTCmdObserver* aObserver) - { - - TInt index( iObservers.Find( aObserver) ); - - if( index != KErrNotFound ) - { - iObservers.Remove( index ); - } - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFactory::GetProcessInterface -// -------------------------------------------------------------------------- -// -MVIMPSTProcessArray& CVIMPSTCmdFactory::GetProcessInterface() - { - return *iArrayProcess; - } -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdfetchblockedlist.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdfetchblockedlist.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2008 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: execute command for fetching blocked list -* -*/ - -// INCLUDE FILES - -//#include "cvimpstcmdlogout.h" - -#include "vimpstcmd.hrh" -#include "cvimpstcmdfetchblockedlist.h" -#include "mvimpstcmdobserver.h" - - -#include "uiservicetabtracer.h" - -#include - -#include "mvimpstengine.h" - - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFetchBlockedContactList::CVIMPSTCmdFetchBlockedContactList -// -------------------------------------------------------------------------- -// -CVIMPSTCmdFetchBlockedContactList::CVIMPSTCmdFetchBlockedContactList( - const TInt aCommandId , MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFetchBlockedContactList::~CVIMPSTCmdFetchBlockedContactList -// -------------------------------------------------------------------------- -// -CVIMPSTCmdFetchBlockedContactList::~CVIMPSTCmdFetchBlockedContactList() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFetchBlockedContactList::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdFetchBlockedContactList* CVIMPSTCmdFetchBlockedContactList::NewL( - const TInt aCommandId,MVIMPSTEngine& aEngine) - { - CVIMPSTCmdFetchBlockedContactList* self = new (ELeave ) CVIMPSTCmdFetchBlockedContactList( aCommandId , aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdFetchBlockedContactList::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFetchBlockedContactList::ConstructL() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFetchBlockedContactList::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFetchBlockedContactList::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - //call logout - iEngine.FetchBlockedListL(); - - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFetchBlockedContactList::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFetchBlockedContactList::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFetchBlockedContactList::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdFetchBlockedContactList::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFetchBlockedContactList::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdFetchBlockedContactList::Result() const - { - //return valid data regd the command operation - return 0; - } - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdhandler.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation for CVIMPSTCmdHandler -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdhandler.h" -#include "cvimpstcmdfactory.h" - -#include "mvimpstcmd.h" -#include "mvimpstengine.h" - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdHandler::CVIMPSTCmdHandler -// -------------------------------------------------------------------------- -// -CVIMPSTCmdHandler::CVIMPSTCmdHandler() - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdHandler::~CVIMPSTCmdHandler -// -------------------------------------------------------------------------- -// -CVIMPSTCmdHandler::~CVIMPSTCmdHandler() - { - delete iCommandFactory; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdHandler::NewL -// -------------------------------------------------------------------------- -// -EXPORT_C CVIMPSTCmdHandler* CVIMPSTCmdHandler::NewL(MVIMPSTEngine& aEngine) - { - CVIMPSTCmdHandler* self = new(ELeave) CVIMPSTCmdHandler(); - CleanupStack::PushL(self); - self->ConstructL(aEngine); - CleanupStack::Pop(self); - return self; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdHandler::ConstructL -// -------------------------------------------------------------------------- -// -inline void CVIMPSTCmdHandler::ConstructL(MVIMPSTEngine& aEngine) - { - iCommandFactory = CVIMPSTCmdFactory::NewL(aEngine); - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdHandler::HandleCommandL -// -------------------------------------------------------------------------- -// -TBool CVIMPSTCmdHandler::HandleCommandL - ( const TImCommandId aCommandId, MVIMPSTCmdObserver* aObserver, - TAny* aData ) - { - TBool ret = EFalse; - - //use the variable aData to set the command related data - MVIMPSTCmd* cmd = iCommandFactory->CreateCommandForIdL( - aCommandId,aData); - - if (cmd) - { - cmd->AddObserver(*aObserver); - TRAPD (err, cmd->ExecuteLD()); - User::LeaveIfError(err); - ret = ETrue; - } - - return ret; - } - // -------------------------------------------------------------------------- -// CVIMPSTCmdHandler::RegisterEventObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdHandler::RegisterEventObserverL( MVIMPSTCmdObserver* aObserver ) - { - iCommandFactory->AddObserverL(aObserver); - - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdHandler::UnRegisterEventObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdHandler::UnRegisterEventObserver( MVIMPSTCmdObserver* aObserver ) - { - iCommandFactory->RemoveObserver(aObserver); - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdHandler::GetProcessInterface -// -------------------------------------------------------------------------- -// -MVIMPSTProcessArray& CVIMPSTCmdHandler::GetProcessInterface() - { - return iCommandFactory->GetProcessInterface(); - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdlogin.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdlogin.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for login -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdlogin.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogin::CVIMPSTCmdLogin -// -------------------------------------------------------------------------- -// -CVIMPSTCmdLogin::CVIMPSTCmdLogin( - const TInt aCommandId ,TUint32 aServiceID, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iServiceId( aServiceID ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogin::~CVIMPSTCmdLogin -// -------------------------------------------------------------------------- -// -CVIMPSTCmdLogin::~CVIMPSTCmdLogin() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogin::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdLogin* CVIMPSTCmdLogin::NewL( - const TInt aCommandId,TUint32 aServiceID, - MVIMPSTEngine& aEngine) - { - CVIMPSTCmdLogin* self = new (ELeave ) CVIMPSTCmdLogin( aCommandId ,aServiceID, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogin::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdLogin::ConstructL() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogin::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdLogin::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - //call login - iEngine.Login(); - - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogin::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdLogin::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogin::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdLogin::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogin::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdLogin::Result() const - { - //return valid data regd the command operation - //must be freed in Dtor - return 0; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdlogout.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdlogout.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for logout -* -*/ - - -// INCLUDE FILES - -#include "cvimpstcmdlogout.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include - -#include "mvimpstengine.h" - - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogout::CVIMPSTCmdLogout -// -------------------------------------------------------------------------- -// -CVIMPSTCmdLogout::CVIMPSTCmdLogout( - const TInt aCommandId ,TUint32 aServiceID, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iServiceId( aServiceID ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogout::~CVIMPSTCmdLogout -// -------------------------------------------------------------------------- -// -CVIMPSTCmdLogout::~CVIMPSTCmdLogout() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogout::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdLogout* CVIMPSTCmdLogout::NewL( - const TInt aCommandId,TUint32 aServiceID, - MVIMPSTEngine& aEngine) - { - CVIMPSTCmdLogout* self = new (ELeave ) CVIMPSTCmdLogout( aCommandId ,aServiceID, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogout::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdLogout::ConstructL() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogout::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdLogout::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - //call logout - iEngine.LogoutL(); - - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogout::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdLogout::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogout::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdLogout::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdLogout::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdLogout::Result() const - { - //return valid data regd the command operation - return 0; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdprocessselectedcontact.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdprocessselectedcontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,255 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for selected contact -* -*/ - - -//include files -#include "cvimpstcmdprocessselectedcontact.h" - -#include -#include -#include -#include - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include -#include "mvimpstengine.h" - -#include "mvimpststorageserviceview.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpstenginecontactmgmtextention.h" -#include "tvimpstconsts.h" -#include "mvimpstenginesubservice.h" -#include "mvimpstenginepresencesubservice.h" - -// Constants -_LIT( KListNameAllBuddy ,"buddylist" ); - -// -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::CVIMPSTCmdProcessSelectedContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdProcessSelectedContact::CVIMPSTCmdProcessSelectedContact( const TInt aCommandId , - TVPbkSelectedData& aSelectedEntries, - MVIMPSTEngine& aEngine ): - iCommandId( aCommandId ), - iSelectedEntries( aSelectedEntries ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::~CVIMPSTCmdProcessSelectedContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdProcessSelectedContact::~CVIMPSTCmdProcessSelectedContact() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdProcessSelectedContact* CVIMPSTCmdProcessSelectedContact::NewL( const TInt aCommandId, - TVPbkSelectedData& aSelectedEntries, - MVIMPSTEngine& aEngine ) - { - CVIMPSTCmdProcessSelectedContact* self = new (ELeave ) CVIMPSTCmdProcessSelectedContact( aCommandId ,aSelectedEntries, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdProcessSelectedContact::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdProcessSelectedContact::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ; - if(storage) - { - TBool localStore = storage->IsLocalStore(); - //retrieve contact from links - TPtrC8 pacledLinks = iSelectedEntries.iPackedLinks->Des(); - TInt count = storage->RetriveLinkXSPIdsL( pacledLinks ); - if( !count ) - { - iError = KErrGeneral; - } - if( (iCommandId == ECmdProcessSelectedContactNew || - iCommandId == ECmdProcessSelectedContactExist )&& - iError == KErrNone ) - { - MVIMPSTEngineExtentionFeatures* contactFeature = iEngine.ExtentionFeatures(TVIMPSTEnums::EContactManagement); - MVIMPSTEngineSubService* presenceService = iEngine.SubService(TVIMPSTEnums::EPresence); - for(TInt index = 0; index < count; index++ ) - { - TPtrC xspIdPtr = storage->GetRetrieveXSPIdL( index ); // xspId is owned here - if( localStore ) - { - iError = KErrNone; - if( xspIdPtr.Length() ) - { - if( IsContactBlocked( xspIdPtr ) ) - { - iError = EErrExistInBlockList; - } - else if( storage->FindContactByUserId( xspIdPtr ) ) - { - iError = EErrExistInContactList; - } - else if( contactFeature ) - { - // add to server and store if sucess - MVIMPSTEngineContactMgmtExtention& contactMgr = - MVIMPSTEngineContactMgmtExtention::Cast (*contactFeature); - iError = contactMgr.AddServerContactL( KListNameAllBuddy, xspIdPtr ,KNullDesC ); - } - } - if(KErrNone == iError ) - { - iError = storage->CreateNewContactFromRetrivedIdL( index ); - } - else if( iCommandId == ECmdProcessSelectedContactNew ) - { - // delete the contact which got created in phonebook but failed to add in servicetab - storage->DeleteNewContactFromRetrivedIdL( index ); - } - } - else if( xspIdPtr.Length() ) - { - // xspId ownership is transfered to iXSPList - iSelectedEntries.iXSPList.AppendL( xspIdPtr.AllocL() ); - } - } - } - else if( ( iCommandId == ECmdProcessAcceptedContactNew || - iCommandId == ECmdProcessAcceptedContactExist )&& - iError == KErrNone )// for accepted contact - { - // just add and return - // contact is already added in storage in RetrieveContactL - // if sucess ,storage will take ownership else we need to delete contact - iError = storage->CreateNewContactFromRetrivedIdL( 0 ); // for accepting invitation take the first contact which is retirved - if( iError != KErrNone && iCommandId == ECmdProcessAcceptedContactNew ) - { - // delete the contact which got created in phonebook but failed to add in servicetab - storage->DeleteNewContactFromRetrivedIdL( 0 ); - } - } - if( !localStore ) - { - // in case of server we have a selection dialog - // so this error does not matter - // set to 0 - iError = KErrNone; - } - } - else - { - iError = KErrGeneral; - } - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdProcessSelectedContact::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdProcessSelectedContact::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdProcessSelectedContact::Result() const - { - //return valid data regd the command operation - return iError; - } - - // -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::Result -// -------------------------------------------------------------------------- -// -// -------------------------------------------------------------------------- -// CVIMPSTCmdProcessSelectedContact::IsContactBlocked -// -------------------------------------------------------------------------- -TBool CVIMPSTCmdProcessSelectedContact::IsContactBlocked(const TDesC& aUserId) - { - TRACER_AUTO; - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - - RPointerArray *blockedlist = presence .GetBlockedList(); - - if(blockedlist) - { - for(TInt i=0; iCount(); ++i) - { - if(0 == aUserId.CompareC((*blockedlist)[i]->Des())) - { - return ETrue; - } - } - } - } - return EFalse; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdsearch.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdsearch.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for search -* -*/ - - -// INCLUDE FILES -#include "cvimpstcmdsearch.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "mvimpstenginesearchmgrextention.h" - -#include "mvimpstengineextentionfeatures.h" - -// -------------------------------------------------------------------------- -// CVIMPSTCmdSearch::CVIMPSTCmdSearch -// -------------------------------------------------------------------------- -// -CVIMPSTCmdSearch::CVIMPSTCmdSearch( - const TInt aCommandId , - RArray& aKeyDataArray, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iKeyDataArray( aKeyDataArray ), - iEngine(aEngine) - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdSearch::~CVIMPSTCmdSearch -// -------------------------------------------------------------------------- -// -CVIMPSTCmdSearch::~CVIMPSTCmdSearch() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdSearch::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdSearch* CVIMPSTCmdSearch::NewL( - const TInt aCommandId, - RArray& aKeyDataArray, - MVIMPSTEngine& aEngine ) - { - CVIMPSTCmdSearch* self = new (ELeave ) CVIMPSTCmdSearch( aCommandId ,aKeyDataArray, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdSearch::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdSearch::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdSearch::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdSearch::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - //make search request using search manager in engine - MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::ESearch); - if (feature) - { - MVIMPSTEngineSearchMgrExtention& searchMgr = - MVIMPSTEngineSearchMgrExtention::Cast - (*feature); - - iError = searchMgr.SearchContactsL( iKeyDataArray ); - } - - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdSearch::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdSearch::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdSearch::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdSearch::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdSearch::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdSearch::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstcmdunblockcontact.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstcmdunblockcontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -/* -* Copyright (c) 2008 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: execute command for unblocking contact -* -*/ - -// INCLUDE FILES -#include "cvimpstcmdunblockcontact.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" - -#include "mvimpstenginesubservice.h" -#include "mvimpstenginepresencesubservice.h" -#include "tvimpstconsts.h" -// -------------------------------------------------------------------------- -// CVIMPSTCmdUnBlockContact::CVIMPSTCmdDeleteContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdUnBlockContact::CVIMPSTCmdUnBlockContact( - const TInt aCommandId , const TDesC& aContactId, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iContactId( aContactId ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdUnBlockContact::~CVIMPSTCmdUnBlockContact -// -------------------------------------------------------------------------- -// -CVIMPSTCmdUnBlockContact::~CVIMPSTCmdUnBlockContact() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdUnBlockContact::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdUnBlockContact* CVIMPSTCmdUnBlockContact::NewL( - const TInt aCommandId, const TDesC& aContactId, - MVIMPSTEngine& aEngine) - { - CVIMPSTCmdUnBlockContact* self = new (ELeave ) CVIMPSTCmdUnBlockContact( aCommandId ,aContactId, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdUnBlockContact::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdUnBlockContact::ConstructL() - { - iError = KErrNotFound; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdUnBlockContact::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdUnBlockContact::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - if(iContactId.Length()) - { - //Get Presence SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - if (subService && iEngine.IsBlockSupportedL()) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - HBufC* userId = HBufC::NewLC(KPropertyMaxLength); // 2 onto cleanup stack - TPtr userIdPtr = userId->Des(); - userIdPtr = iContactId; - TRACE("userId: %s", &userIdPtr); - iError = presence.RemoveFromBlockListL(*userId); - TRACE("iError: %d", iError); - CleanupStack::PopAndDestroy(userId);//2 - - } - } - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdUnBlockContact::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdUnBlockContact::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdUnBlockContact::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdUnBlockContact::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdUnBlockContact::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdUnBlockContact::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstprocessArray.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstprocessArray.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1981 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation for command process array -* -*/ - - -// INCLUDE FILES -#include - -#include "uiservicetabtracer.h" - -#include "cvimpstprocessarray.h" - -#include "mvimpstprocessArrayobserver.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" -#include "tvimpstenums.h" -#include "cvimpstprocessarrayitem.h" -#include "mvimpststorageitemmodel.h" -#include "tvimpstconsts.h" -#include "mvimpststoragecontactlist.h" -#include "mvimpststoragevpbkstorehandler.h" -#include "mvimpstengine.h" -#include "cvimpstprocessfriendrequestitem.h" -#include "mvimpstenginesubservice.h" -#include -#include -#include -//rsg file for resource id -#include -#include "vimpstutils.h" -#include -#include -#include "mvimpstengineimsubservice.h" -#include "mvimpstenginepresencesubservice.h" - -#include -#include "imcvuiparams.h" - -// -------------------------------------------------------------------------- -// CVIMPSTProcessArray::CIMArrayProcess -// -------------------------------------------------------------------------- -// -CVIMPSTProcessArray::CVIMPSTProcessArray( MVIMPSTEngine& aEngine) -:iOwnDataIndex(KOwnDataIndex), -iContactListIndex(KOwnDataIndex), -iEngine(aEngine) - { - iServiceId = iEngine.ServiceId(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTProcessArray::~CVIMPSTProcessArray -// -------------------------------------------------------------------------- -// -CVIMPSTProcessArray::~CVIMPSTProcessArray() - { - - TRACER_AUTO; - if(iContactInterface) - { - iContactInterface->RemoveObserver( this ); - } - iItemArray.ResetAndDestroy(); - //iItemArray.Close(); - - - iUnKnownContactArray.Close(); - iAddRequestArray.Close(); - - if(iData) - { - delete iData; - iData = NULL; - } - //Get IM SubService - MVIMPSTEngineSubService* subService1 = - (iEngine.SubService(TVIMPSTEnums::EIM)); - - if(subService1) - { - MVIMPSTEngineIMSubService& imSubService = - MVIMPSTEngineIMSubService::Cast (*subService1); - imSubService.UnRegisterChatObserver(this); - } - - //subscribe for ownpresencechangeevent - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - presence.UnRegisterPresenceEventObserver(this); - } - - - } - -// -------------------------------------------------------------------------- -// CVIMPSTProcessArray::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTProcessArray* CVIMPSTProcessArray::NewL( - MVIMPSTEngine& aEngine) - { - TRACER_AUTO; - CVIMPSTProcessArray* self = new(ELeave) CVIMPSTProcessArray(aEngine); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - - } - -// -------------------------------------------------------------------------- -// CVIMPSTProcessArray::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTProcessArray::ConstructL() - { - - TRACER_AUTO; - iContactInterface = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - if(iContactInterface) - { - iContactInterface->AddObserverL( this );// listen these events.. - HBufC* unnamed = VIMPSTUtils::LoadResourceL( R_SERVTAB_UNNAMED ); - if( unnamed ) - { - CleanupStack::PushL( unnamed ); - iContactInterface->SetUnnamedTextL(unnamed); // takes ownership - CleanupStack::Pop( unnamed ); - } - } - iContactListModel = CVIMPSTStorageManagerFactory::ItemModelInterfaceL(iServiceId); - iLoginState = iEngine.ServiceState(); - - iIMSupported = EFalse; - iPresenceSupported = EFalse; - //Get IM SubService - MVIMPSTEngineSubService* subService1 =(iEngine.SubService(TVIMPSTEnums::EIM)); - if(subService1) - { - MVIMPSTEngineIMSubService& imSubService = - MVIMPSTEngineIMSubService::Cast (*subService1); - imSubService.RegisterChatObserver(this); - iIMSupported = ETrue; - } - iData = HBufC::NewL(512); - iAddRequestArray.Reset(); - iUnKnownContactArray.Reset(); - //subscribe for ownpresencechangeevent - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - presence.RegisterPresenceEventObserverL(this); - iPresenceSupported = ETrue; - } - ResetArray(); - - } -// -------------------------------------------------------------------------- -// CVIMPSTProcessArray::HandleStorageChangeL -// -------------------------------------------------------------------------- -// -void CVIMPSTProcessArray::HandleStorageChangeL( TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType, - MVIMPSTStorageContactList* /*aList*/, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ) - { - - TRACER_AUTO; - // 0th index OwnItem + unknow contacts + add request - aContactIndex = aContactIndex + 1 + iUnKnownContactArray.Count() + iAddRequestArray.Count(); - - switch( aEventType ) - { - case TVIMPSTEnums::EStorageContactReadComplete: - { - TRACE("EStorageContactReadComplete"); - if(iProcessObservers) - { - /* passing 0 so that the focus is on owndata item */ - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EOwnStatusItem, 0 ); // focus own item - } - break; - } - case TVIMPSTEnums::EStorageContactFetchComplete: - { - TRACE("EStorageContactFetchComplete"); - TRACE( " iItemArray Count: %d", iItemArray.Count() ); - - if(iProcessObservers) - { - /* passing 0 so that the focus is on owndata item */ - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EOwnStatusItem, 0 ); // focus own item - } - - ResetArray(); - iFetchCompleted = ETrue; - GetAndCreateOpenChatListL(); - TRACE( "EStorageContactFetchComplete End" ); - break; - } - case TVIMPSTEnums::EStorageContactReading: - case TVIMPSTEnums::EStorageContactFetching: - case TVIMPSTEnums::EStorageContactSynchronizing: - { - TRACE( "EStorageContactFetching/EStorageContactFetching" ); - /* - * This event occurs whenever we have contacts added to contactlist. This happens in the following scenarios - * 1. At the time of login, when we fetch contacts, contact-by-contact is added to the storage. so we get this event. - * 2. When we add a contact manually (either from phonebook, or manu adding etc.. ) we get this callback. - */ - TRACE( "contactindex = %d",aContactIndex ); - CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (*this, const_cast(aContact->Name() ), - const_cast(aContact->UserId() ), - aContact->ContactLink(), - const_cast(aContact->StatusText()), - aContact->OnlineStatus()); - - contactItem->SetAvatarIndex(aContact->AvatarIndex()); - - /* All the time the index should be less than the item array's count, but during the fetch of contacts from cdb file to the view, - * if we havent got a contactviewready, and during that if I get contactaddition, before getting contactFetchComplete, we should keep - * appending the items to the array for display, once we get the entire list, its sorted anyway while insertion, and when presence occurs - * the contacts are re-sorted. - */ - TRACE( "itemarraycount = %d",iItemArray.Count() ); - if (aContactIndex >= iItemArray.Count() ) - { - TRACE( "append contact item %d", contactItem); - iItemArray.Append(contactItem); - } - else - { - TRACE( "Insert at index = %d", aContactIndex); - iItemArray.Insert(contactItem, aContactIndex ); - } - if(iProcessObservers) - { - /* passing 0 so that the focus is on owndata item */ - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EOwnStatusItem, 0); - } - if( aContact->AvatarContent().Length() && iProcessObservers ) - { - iProcessObservers->HandleAvatarChangeL( aContact->UserId() ); - } - - break; - } - case TVIMPSTEnums::EStorageEventContactAddition: - { - TRACE("EStorageEventContactAddition"); - - TBool removed = RemoveFromUnknonOrInvitationListL( aContact->UserId(), EFalse ); - if( removed ) - { - aContactIndex = aContactIndex - 1; // one contact is removed from iUnknownContactArray - } - /* - * This event occurs whenever we have contacts added to contactlist. This happens in the following scenarios - * 1. At the time of login, when we fetch contacts, contact-by-contact is added to the storage. so we get this event. - * 2. When we add a contact manually (either from phonebook, or manu adding etc.. ) we get this callback. - */ - TPtrC userId = aContact->UserId(); - TRACE( "contactindex = %d",aContactIndex ); - CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL ( *this, aContact->Name() , - userId, - aContact->ContactLink(), - const_cast(aContact->StatusText()), - aContact->OnlineStatus() ); - - contactItem->SetAvatarIndex(aContact->AvatarIndex()); - /* All the time the index should be less than the item array's count, but during the fetch of contacts from cdb file to the view, - * if we havent got a contactviewready, and during that if I get contactaddition, before getting contactFetchComplete, we should keep - * appending the items to the array for display, once we get the entire list, its sorted anyway while insertion, and when presence occurs - * the contacts are re-sorted. - */ - TRACE( "itemarraycount = %d",iItemArray.Count() ); - if (aContactIndex >= iItemArray.Count() ) - { - TRACE( "append contact item = %d", contactItem); - iItemArray.Append(contactItem); - } - else - { - TRACE( "Insert at index = %d", aContactIndex); - iItemArray.Insert(contactItem, aContactIndex ); - } - // check if pending message exist - if( TVIMPSTEnums::ESVCERegistered == iLoginState && userId.Length() ) - { - if( IsConversationExistL( userId ) ) - { - contactItem->SetConversationOpen(ETrue); - } - if( IsUnreadMessageExistsL( userId ) ) - { - contactItem->SetMsgPending(ETrue); - } - } - - if(iProcessObservers) - { - if (aContact->AvatarContent().Length()) - { - iProcessObservers->HandleAvatarChangeL(aContact->UserId()); - } - /* passing aContactIndex so that the focus is on owndata item */ - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, aContactIndex ); - } - - break; - } - case TVIMPSTEnums::EStorageEventContactDelete: - { - TRACE( " EStorageEventContactDelete" ); - TRACE( "contactindex = %d",aContactIndex ); - TRACE( "itemarraycount = %d",iItemArray.Count() ); - if( aContactIndex < iItemArray.Count() ) - { - MVIMPSTProcessArrayItem* deletedItem = iItemArray[ aContactIndex ]; - TRACE( "contact removed in item array of index = %d",aContactIndex ); - iItemArray.Remove (aContactIndex); - delete deletedItem; - iItemArray.Compress(); - TRACE( "contactindex = %d",aContactIndex ); - } - if(iProcessObservers) - { - iProcessObservers->HandleDeletionL(TVIMPSTEnums::EContactItem, aContactIndex); - } - break; - } - case TVIMPSTEnums::EStorageAvatarChange: - { - TRACE("EStorageAvatarChange"); - if(iProcessObservers && aContact ) - { - TRACE( "EStorageAvatarChange inside if" ); - TPtrC aUserId = aContact->UserId(); - TRACE( "EStorageAvatarChange aUserId = %S", &aUserId ); - iProcessObservers->HandleAvatarChangeL( aContact->UserId() ); - } - break; - } - case TVIMPSTEnums::EStorageOwnPresenceChange: - { - TRACE( "EStorageOwnPresenceChange" ); - if(iProcessObservers) - { - /* passing index as 0, so thta focus remains at the owndata item */ - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EOwnStatusItem, KErrNotFound ); - } - break; - } - case TVIMPSTEnums::EStorageMultiplePresenceChange: - { - TRACE("EStorageMultiplePresenceChange " ); - // mostly this will get called after just login and fetch time - ResetArray(); - if(iProcessObservers ) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound ); - } - break; - } - case TVIMPSTEnums::EStoragePresenceChange: - { - TRACE( " EStoragePresenceChange" ); - /* - * After Sort we get the new index... So first we need to remove the contact from the old position, - * and then re-insert it at the correct obtained position (newIndex in this case) - */ - TRACE("contactindex = %d",aContactIndex ); - TRACE( "itemarraycount = %d",iItemArray.Count() ); - if( aContactIndex < iItemArray.Count() ) - { - TInt newIndex = iContactListModel->IndexOfContact( aContact ); - TRACE( "new index = %d",newIndex ); - CVIMPSTProcessContactItem* newItem = CVIMPSTProcessContactItem::NewL(*this, const_cast(aContact->Name() ), - const_cast(aContact->UserId() ), - aContact->ContactLink(), - const_cast(aContact->StatusText()), - aContact->OnlineStatus() ); - - - MVIMPSTProcessArrayItem* oldItem = iItemArray[ aContactIndex ]; - newItem->SetAvatarIndex(aContact->AvatarIndex()); // copy the avatar index too. - - TBool isOldConversationExists(EFalse); - TBool isOldMsgPending(EFalse); - // checking if previously chat/msgs were existing - if( TVIMPSTEnums::ESVCERegistered == iLoginState && aContact->UserId().Length() ) - { - - if( IsConversationExistL( aContact->UserId() ) ) - { - isOldConversationExists = ETrue; - } - if( IsUnreadMessageExistsL( aContact->UserId() ) ) - { - isOldMsgPending = ETrue; - } - } - TRACE( "contact removed in item array of index = %d",aContactIndex ); - iItemArray.Remove(aContactIndex ); - delete oldItem; - iItemArray.Compress(); - - // restoring if previously chat/msgs were existing - if( TVIMPSTEnums::ESVCERegistered == iLoginState && aContact->UserId().Length() ) - { - if( isOldConversationExists ) - { - newItem->SetConversationOpen(ETrue); - } - if( isOldMsgPending ) - { - newItem->SetMsgPending(ETrue); - } - } - // Add it in the new index - newIndex = newIndex + 1 + iUnKnownContactArray.Count()+ iAddRequestArray.Count(); - if (newIndex >= iItemArray.Count()) - { - TRACE( "append contact item = %d", newIndex); - iItemArray.Append (newItem); - } - else - { - TRACE( "Insert at index = %d", newItem); - iItemArray.Insert (newItem, newIndex); - } - } - if(iProcessObservers ) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound ); - } - - break; - } - case TVIMPSTEnums::EStorageEventOwnUserChanged: - { - TRACE( "EStorageEventOwnUserChanged " ); - TRACE( " start Event = %d",aEventType ); - ResetArray(); - if(iProcessObservers ) - { - iProcessObservers->HandleDeletionL(TVIMPSTEnums::EOwnStatusItem, 0 ); // focus own item - - if( aContact ) - { - iProcessObservers->HandleAvatarChangeL( aContact->UserId() ); - } - } - - - break; - } - case TVIMPSTEnums::EStorageAllContactRemoved: - { - TRACE("EStorageAllContactRemoved"); - TRACE( "EStorageAllContactRemoved count = %d", iItemArray.Count() ); - ResetArray(); - if(iProcessObservers ) - { - iProcessObservers->HandleDeletionL(TVIMPSTEnums::EOwnStatusItem, 0 ); // focus own item - } - - break; - } - case TVIMPSTEnums::EStorageEventContactChange: - { - TRACE("EStorageEventContactChange"); - // display name is changed ,might be contact is re-arranged - TRACE( "contactindex = %d",aContactIndex ); - TRACE( "itemarraycount = %d",iItemArray.Count() ); - if( aContactIndex < iItemArray.Count() ) - { - if ( aContact ) - { - CVIMPSTProcessContactItem* newItem = CVIMPSTProcessContactItem::NewL(*this, const_cast(aContact->Name() ), - const_cast(aContact->UserId() ), - aContact->ContactLink(), - const_cast(aContact->StatusText()), - aContact->OnlineStatus() ); - - - MVIMPSTProcessArrayItem* oldItem = iItemArray[ aContactIndex ]; - newItem->SetAvatarIndex(aContact->AvatarIndex()); // copy the avatar index too. - TRACE("contact removed in item array of index = %d",aContactIndex ); - // set the conversation open flag from old contact, as only the display name would have changed. - newItem->SetConversationOpen(oldItem->IsConversationOpen()); - newItem->SetMsgPending( oldItem->IsMsgPending() ); - iItemArray.Remove(aContactIndex ); - delete oldItem; - iItemArray.Compress(); - TRACE( "Insert at index = %d", aContactIndex); - TInt newIndex = iContactListModel->IndexOfContact( aContact ); - // Add it in the new index - newIndex = newIndex + 1 + iUnKnownContactArray.Count() + iAddRequestArray.Count(); - if (newIndex >= iItemArray.Count()) - { - TRACE("append contact item = %d", newIndex); - iItemArray.Append (newItem); - } - else - { - TRACE( "Insert at index = %d", newItem); - iItemArray.Insert(newItem, newIndex); - } - // inform the cv about the display name changes - if(aContact && aContact->UserId().Length() && newItem->IsConversationOpen()) - { - TRACE("EStorageEventContactChange "); - TApaTaskList taskList( CCoeEnv::Static()->WsSession() ); - TApaTask task( taskList.FindApp( KConversationViewAppUid ) ); - - if ( task.Exists() ) - { - TRACE("EStorageEventContactChange - task exists"); - // packing of data ,passed to conversation view - TPckgBuf< TIMCVUiParams > params; - params().iBuddyId = aContact->UserId(); - params().iBuddyName = aContact->Name(); - params().iServiceId = iServiceId; - params().iUpdate = ETrue; - task.SendMessage( - TUid::Uid( KUidApaMessageSwitchOpenFileValue ), params ); - } - } - } - - } - if(iProcessObservers ) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, aContactIndex ); - } - break; - } - case TVIMPSTEnums::EStorageEventUserIdPostChange: - { - TRACE( "EStorageEventUserIdPostChange" ); - TRACE( "contactindex = %d",aContactIndex ); - TRACE( "itemarraycount = %d",iItemArray.Count() ); - if( aContactIndex < iItemArray.Count() ) - { - CVIMPSTProcessContactItem* newItem = CVIMPSTProcessContactItem::NewL(*this, const_cast(aContact->Name() ), - const_cast(aContact->UserId() ), - aContact->ContactLink(), - const_cast(aContact->StatusText()), - aContact->OnlineStatus() ); - - - MVIMPSTProcessArrayItem* oldItem = iItemArray[ aContactIndex ]; - newItem->SetAvatarIndex(aContact->AvatarIndex()); // copy the avatar index too. - TRACE( "contact removed in item array of index = %d",aContactIndex ); - iItemArray.Remove(aContactIndex ); - delete oldItem; - iItemArray.Compress(); - TRACE( "Insert at index = %d", aContactIndex); - iItemArray.InsertL (newItem, aContactIndex); - } - if(iProcessObservers ) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, aContactIndex ); - } - TRACE( "EStorageEventUserIdPostChange" ); - break; - } - default: - { - TRACE("default"); - break; - } - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTProcessArray::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTProcessArray::AddObserver( MVIMPSTProcessArrayObserver* aObserver ) - { - iProcessObservers = aObserver; - } -// -------------------------------------------------------------------------- -// CVIMPSTProcessArray::RemoveObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTProcessArray::RemoveObserver( ) - { - iProcessObservers = NULL; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::GetItemNameTextL -// ----------------------------------------------------------------------------- - -TPtrC CVIMPSTProcessArray::GetItemNameText(TInt aIndex) - { - TVIMPSTEnums::TItem itemtype = GetType( aIndex ); - MVIMPSTProcessArrayItem* arrayItem = NULL; - /* Codescanner warning is ignored, since Bound check is done - * inside the GetType() - * method*/ - switch(itemtype) - { - case TVIMPSTEnums::EOwnStatusItem: - { - MVIMPSTProcessArrayItem *arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex]; - return arrayItem->GetItemUserId(); // no name for own user - } - case TVIMPSTEnums::EContactListItem: - case TVIMPSTEnums::EContactItem: - { - arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex]; - break; - } - case TVIMPSTEnums::EFriendRequestItem: - { - arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex]; - break; - } - case TVIMPSTEnums::EUnknonContactItem: - { - arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex]; - break; - } - case TVIMPSTEnums::EInvalid: - default: - { - break; - } - } - if( arrayItem ) - { - return arrayItem->GetItemNameText(); - } - return KNullDesC(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::GetItemUserId -// ----------------------------------------------------------------------------- - -TPtrC CVIMPSTProcessArray::GetItemUserId(TInt aIndex) - { - TVIMPSTEnums::TItem itemtype = GetType( aIndex ); - - /* Codescanner warning is ignored, since Bound check is done - * inside the GetType() - * method*/ - switch(itemtype) - { - case TVIMPSTEnums::EContactItem: - case TVIMPSTEnums::EFriendRequestItem: - case TVIMPSTEnums::EUnknonContactItem: - case TVIMPSTEnums::EOwnStatusItem: - { - MVIMPSTProcessArrayItem *arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex]; - return arrayItem->GetItemUserId(); // no name for own user - } - default: - { - return KNullDesC(); - } - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::ContactLink -// ----------------------------------------------------------------------------- - -MVPbkContactLink* CVIMPSTProcessArray::ContactLink(TInt aIndex) - { - TVIMPSTEnums::TItem itemtype = GetType( aIndex ); - - /* Codescanner warning is ignored, since Bound check is done - * inside the GetType() - * method*/ - switch(itemtype) - { - case TVIMPSTEnums::EOwnStatusItem: - { - return NULL; - } - case TVIMPSTEnums::EContactListItem: - case TVIMPSTEnums::EContactItem: - { - MVIMPSTProcessArrayItem *arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex]; - return arrayItem->ContactLink(); - } - case TVIMPSTEnums::EInvalid: - default: - { - } - } - return NULL; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::Count -// ----------------------------------------------------------------------------- - -TInt CVIMPSTProcessArray::Count() const - { - // return the total count here. - return iItemArray.Count() ; - } -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::IsSubServiceSupportedL -// ----------------------------------------------------------------------------- - -TBool CVIMPSTProcessArray::IsSubServiceSupportedL(TVIMPSTEnums::SubServiceType aType ) const - { - return iEngine.IsSubServiceSupportedL(aType ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::IsIMSupported -// ----------------------------------------------------------------------------- -TBool CVIMPSTProcessArray::IsIMSupported() - { - return iIMSupported; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::IsPresenceSupported -// ----------------------------------------------------------------------------- -TBool CVIMPSTProcessArray::IsPresenceSupported() - { - return iPresenceSupported; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::GetType -// Get the type from engine and return the type -// ----------------------------------------------------------------------------- - -TVIMPSTEnums::TItem CVIMPSTProcessArray::GetType(TInt aIndex) const - { - TInt itemArrayCount = iItemArray.Count(); - if(itemArrayCount <=0 || (aIndex < 0 || aIndex >= itemArrayCount) ) - { - return TVIMPSTEnums::EInvalid; - } - - else if(itemArrayCount>0) - { - TInt index = aIndex <= 0 ? 0 : aIndex; - MVIMPSTProcessArrayItem* item = iItemArray[ index ]; - return item->Type(); - } - else - { - return TVIMPSTEnums::EInvalid; - } - } -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FillItemL -// Fill up the complete array one item at a time -// ----------------------------------------------------------------------------- - -void CVIMPSTProcessArray::FillItemL() - { - TRACER_AUTO; - TInt count = 0; - if(iContactListModel) - { - count = iContactListModel->Count(); - } - - // the index is starting from 1, because we already added owndata item to the list....... - for ( TInt index = 0; index < count ; index++) - { - // fetch the item and process correct type - MVIMPSTStorageItemModel::SItem item = iContactListModel->Item( index ); - switch( item.iType ) - { - case MVIMPSTStorageItemModel::EContactList: - break; - case MVIMPSTStorageItemModel::EContactItem: - { - // contact item - // add this items to contact item -- CONTACT - // create an object of this type and append this to the rpointerarray - MVIMPSTStorageContact* contact = item.iContact; - TPtrC userId = contact->UserId(); - CVIMPSTProcessContactItem* contactItem = - CVIMPSTProcessContactItem::NewL(*this, contact->Name(), - userId , - contact->ContactLink(), - const_cast(contact->StatusText()), - contact->OnlineStatus() ); - - contactItem->SetAvatarIndex(contact->AvatarIndex()); - - TInt otherCount = 1 + iUnKnownContactArray.Count() + iAddRequestArray.Count(); - contactItem->SetItemIndex(index + otherCount ); - //append this to the array - iItemArray.AppendL(contactItem); - if( TVIMPSTEnums::ESVCERegistered == iLoginState && userId.Length() ) - { - if( IsUnreadMessageExistsL( userId ) ) - { - contactItem->SetMsgPending(ETrue); - } - if( IsConversationExistL( userId ) ) - { - contactItem->SetConversationOpen(ETrue); - } - } - break; - } - default: - { - // the call shouldn't be here - break; - } - } - } - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FillOwnDataL -// FillOwnDataL implementation -// ----------------------------------------------------------------------------- -// fill the owndata at the begining of array..... -TBool CVIMPSTProcessArray::FillOwnDataL() - { - TRACER_AUTO; - TBool ownDataAdded = EFalse; - TPtr dataPtr = iData->Des(); - // Check whether the user has logged in before, if has - // then dont update anything just return - //check if its logged in or not. - // 1. if not logged in append - switch(iLoginState) - { - case TVIMPSTEnums::ESVCERegistered: - { - TPtrC userId = iContactInterface->OwnContactL().UserId(); - dataPtr.Copy(userId); - break; - } - case TVIMPSTEnums::ESVCENetworkConnecting: - { - HBufC* tempStr = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_LOGGING_LIST_ITEM ); - if(tempStr) - { - dataPtr.Copy(*tempStr); - delete tempStr; - } - - break; - } - case TVIMPSTEnums::ESVCEUpdatingContacts: - { - HBufC* tempStr = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_UPDATING_LIST_ITEM ); - if(tempStr) - { - dataPtr.Copy(*tempStr); - delete tempStr; - } - - break; - } - case TVIMPSTEnums::ESVCEWaitingForNetwork: - { - HBufC* tempStr = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_WAITING_LIST_ITEM ); - if(tempStr) - { - dataPtr.Copy(*tempStr); - delete tempStr; - } - break; - } - case TVIMPSTEnums::ESVCENetworkDisConnecting: - { - HBufC* tempStr = NULL; - if ( iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EPresence) ) - { - // if presence enabled use double line listbox string - tempStr= VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_LOGGINGOUT_LIST_ITEM ); - } - else - { - // if presence is not enabled use single line listbox string - tempStr= VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SINGLE_LINE_LOGGINGOUT_LIST_ITEM ); - } - - if(tempStr) - { - dataPtr.Copy(*tempStr); - delete tempStr; - } - - break; - } - case TVIMPSTEnums::ESVCENotRegistered: - default: - { - HBufC* str = NULL; - if ( iEngine.SubService( TVIMPSTEnums::EPresence) ) - { - // if presence enabled use double line listbox string - str = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_LOGIN_LIST_ITEM ); - } - else - { - // if presence is not enabled use single line listbox string - // get the username from settings - TPtrC ownUserId = iContactInterface->OwnContactL().UserId(); - if ( ownUserId.Length() ) - { - // if username is available then show with login item - // remove domain part and give it to resource laoder - str= VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SINGLE_LINE_LOGIN_LIST_ITEM_WITH_USERNAME , VIMPSTUtils::DisplayId( ownUserId ) ); - } - else - { - // this condition occures when there is allocated memory for username with NO data (length =0 ) - // just make sure "no memory leak" without depending on the Function LoginUserNameFromSettingsL() - // since that would return the allocated memory without Data (length=0 ) - // just show login item since no username is available in the settings - str= VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SINGLE_LINE_LOGIN_LIST_ITEM ); - } - } - if( str ) - { - dataPtr.Copy(*str); - delete str; - } - break; - } - } - if( iItemArray.Count() ) - { - // own item is already exist delete it before adding a fresh one - MVIMPSTProcessArrayItem* arrayItem = iItemArray[ 0 ]; // should be own data - if( arrayItem->Type() == TVIMPSTEnums::EOwnStatusItem ) - { - iItemArray.Remove(0); //iItemArray takes ownership of owndataItem, do not delete here - delete arrayItem; - iItemArray.Compress(); - } - } - //common code for all the above cases to update the owndata item to list at index 0 - CVIMPSTProcessOwnDataItem* owndataItem = CVIMPSTProcessOwnDataItem::NewL(*this, *iData); - owndataItem->SetItemIndex(0); - //append this to the array - iItemArray.InsertL( owndataItem,0 ); //iItemArray takes ownership of owndataItem, do not delete here - iContactListIndex = 0; - ownDataAdded = ETrue; - return ownDataAdded; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FillArrayL -// ----------------------------------------------------------------------------- - -void CVIMPSTProcessArray::FillArrayL() - { - if(FillOwnDataL() ) - { - // then fill the conversations..or open chats.... - } - else - { - iContactListIndex = 0; // we have not added any thing to main array..so index is zero... - } - FillUnknownContactsL(); //will fill all unknown contact from iUnknownContactArray to iItemArray. - FillAddRequestDataL();//will fill all requests from iAddRequestArray to iItemArray. - FillItemL(); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::ResetArray -// ----------------------------------------------------------------------------- - -void CVIMPSTProcessArray::ResetArray() - { - RemoveUnKnownContacts(); //will remove all the unknown contacts from iItemArray. - RemoveAddRequestData();//will remove all the requests from iItemArray. - iItemArray.ResetAndDestroy(); - TRAPD( err, FillArrayL()); - if ( err != KErrNone ) - { - CActiveScheduler::Current()->Error( err ); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::SetLoginState -// ----------------------------------------------------------------------------- - -void CVIMPSTProcessArray::SetLoginStateL(TVIMPSTEnums::TVIMPSTRegistrationState aLoginState) - { - TRACER_AUTO; - iLoginState = aLoginState; - if(aLoginState != TVIMPSTEnums::ESVCERegistered ) - { - iFetchCompleted = EFalse; - RemoveUnKnownContacts(); - RemoveAddRequestData(); - iUnKnownContactArray.ResetAndDestroy();// delete all items - iUnKnownContactArray.Reset(); - iAddRequestArray.ResetAndDestroy();// delete all items - iAddRequestArray.Reset(); - - // Reset contact list array (append the contacts to contact list array - // by getting from contactlist model) before contacts update. - if(aLoginState == TVIMPSTEnums::ESVCENotRegistered ) - { - ResetArray(); - } - - // reset the status of all the contacts. - // no need to check the item type here. by the time its here all the other - // type except contact item are removed. - TInt count = iItemArray.Count(); - for(TInt i = 0; i < count ; i++) - { - iItemArray[i]->DoFormatStringL(); - } - } - FillOwnDataL(); // this will change the own item based on connection status - } -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::GetLoginState -// ----------------------------------------------------------------------------- - -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTProcessArray::GetLoginState() - { - return iLoginState; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::GetOnlineStatus -// ----------------------------------------------------------------------------- - -TVIMPSTEnums::TOnlineStatus CVIMPSTProcessArray::GetOnlineStatusL(TInt aIndex) - { - TRACER_AUTO; - TVIMPSTEnums::TItem itemtype = GetType( aIndex ); - TVIMPSTEnums::TOnlineStatus status = TVIMPSTEnums::EUnknown; - switch(itemtype) - { - case TVIMPSTEnums::EOwnStatusItem: - { - if( iContactInterface ) - { - status = iContactInterface->OwnContactL().OnlineStatus(); - } - break; - } - case TVIMPSTEnums::EContactItem: - { - - status = iItemArray[aIndex]->OnlineStatus(); - break; - } - case TVIMPSTEnums::EInvalid: - default: - { - break; - } - } - return status; - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::StatusText -//----------------------------------------------------------- -// -const TDesC& CVIMPSTProcessArray::StatusTextL(TInt aIndex ) - { - TRACER_AUTO; - TVIMPSTEnums::TItem itemtype = GetType( aIndex ); - switch(itemtype) - { - case TVIMPSTEnums::EOwnStatusItem: - { - if( iContactInterface ) - { - return iContactInterface->OwnContactL().StatusText(); - } - break; - } - case TVIMPSTEnums::EContactItem: - { - return iItemArray[aIndex]->StatusText(); - } - case TVIMPSTEnums::EInvalid: - default: - { - break; - } - } - return KNullDesC; - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::RemoveFromUnknonOrInvitationListL -//----------------------------------------------------------- -// -TBool CVIMPSTProcessArray::RemoveFromUnknonOrInvitationListL( const TDesC& aAddedUserId ,TBool aBlocked ) - { - TRACER_AUTO; - TBool found = RemoveFromUnknonListL( aAddedUserId ); - if( !found ) - { - found = RemoveFromInvitationListL( aAddedUserId ); - } - //Get IM SubService - if( aBlocked && found && aAddedUserId.Length() ) - { - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EIM)); - - if(subService ) - { - MVIMPSTEngineIMSubService& imSubService = - MVIMPSTEngineIMSubService::Cast (*subService); - imSubService.CloseConversationL( aAddedUserId ); - } - } - return found; - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::RemoveFromUnknonListL -//----------------------------------------------------------- -// -TBool CVIMPSTProcessArray::RemoveFromUnknonListL( const TDesC& aAddedUserId ) - { - - TRACER_AUTO; - TPtrC addedUserId = VIMPSTUtils::DisplayId( aAddedUserId ); - TBool found = EFalse; - TInt count = iUnKnownContactArray.Count(); - CVIMPSTProcessUnknownContactItem* unknownItem = NULL; - TInt index = KErrNotFound; - TInt itemIndex = KErrNotFound; - // check in unknon array - for(index = 0 ; index < count ; index++) - { - unknownItem = iUnKnownContactArray[index]; - TPtrC contactId = VIMPSTUtils::DisplayId( unknownItem->GetItemUserId() ); - if( addedUserId.Compare( contactId ) == 0 ) - { - itemIndex = iItemArray.Find(unknownItem); - if( itemIndex > -1 ) - { - found = ETrue; - } - break; - } - - } - if( found ) - { - iItemArray.Remove(itemIndex); - iUnKnownContactArray.Remove( index ); - delete unknownItem; - unknownItem = NULL; - iItemArray.Compress(); - iUnKnownContactArray.Compress(); - if( iProcessObservers ) - { - // this is to refresh the list box - // KErrNotFound , focus remain at same position - iProcessObservers->HandleDeletionL(TVIMPSTEnums::EUnknonContactItem, KErrNotFound ); - } - } - - return found; - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::RemoveFromInvitationListL -//----------------------------------------------------------- -// -TBool CVIMPSTProcessArray::RemoveFromInvitationListL( const TDesC& aAddedUserId ) - { - TRACER_AUTO; - TPtrC addedUserId = VIMPSTUtils::DisplayId( aAddedUserId ); - TBool found = EFalse; - TInt index = KErrNotFound; - TInt itemIndex = KErrNotFound; - // item not foun in unknown list - // check in invitation item array - TInt count = iAddRequestArray.Count(); - CVIMPSTProcessFriendRequestItem* requestItem = NULL; - for(index = 0 ; index < count ; index++) - { - requestItem = iAddRequestArray[index]; - TPtrC contactId = VIMPSTUtils::DisplayId( requestItem->GetItemUserId() ); - if( addedUserId.Compare( contactId ) == 0 ) - { - itemIndex = iItemArray.Find(requestItem); - if( itemIndex > -1 ) - { - found = ETrue; - } - break; - } - } - if( found ) - { - iItemArray.Remove(itemIndex); - iAddRequestArray.Remove( index ); - delete requestItem; - requestItem = NULL; - iItemArray.Compress(); - iAddRequestArray.Compress(); - if( iProcessObservers ) - { - // this is to refresh the list box - // KErrNotFound , focus remain at same position - iProcessObservers->HandleDeletionL(TVIMPSTEnums::EFriendRequestItem, KErrNotFound ); - } - } - return found; - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::MapContactListPositions -//----------------------------------------------------------- -// -void CVIMPSTProcessArray::MapContactListPositions(RArray& aPos ) - { - // add conversation also this list ..and return.. - RArray listPos; - - // iContactListModel->MapContactListPositions(listPos); - TInt positionIndex = 0; - // if count is more than 0..fill the maparray... - if(iItemArray.Count() + iContactListIndex > 0) - { - - TInt count = listPos.Count(); - - for(TInt posIndex = 0; posIndex < count; posIndex++, positionIndex++) - { - aPos.Append( listPos[posIndex] + iContactListIndex ); - } - } - listPos.Close(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::GetAndCreateOpenChatListL -// return contact index including friend request. -// ----------------------------------------------------------------------------- -void CVIMPSTProcessArray::GetAndCreateOpenChatListL() - { - TRACER_AUTO; - //Get IM SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EIM)); - RArray openChats; - openChats.Reset(); - if(subService) - { - MVIMPSTEngineIMSubService& imSubService = - MVIMPSTEngineIMSubService::Cast (*subService); - openChats = imSubService.GetOpenChatListL(); - } - while( openChats.Count() ) - { - SIMCacheChatItem chat = openChats[ 0 ]; // first item - TPtrC contactId = *chat.iBuddyId; - MVIMPSTProcessArrayItem* arrayItem = FindArrayItem( contactId ); - TBool msgPending = EFalse; - if( contactId.Length() ) - { - if( IsUnreadMessageExistsL( contactId ) ) - { - msgPending = ETrue; - } - } - if( arrayItem ) - { - arrayItem->SetConversationOpen( ETrue ); - arrayItem->SetMsgPending( msgPending ); - } - else - { - // not in buddy List - DoHandleUnKnownContactMessageL( contactId ,msgPending ); - } - openChats.Remove( 0 ); - delete chat.iBuddyId; - chat.iBuddyId = NULL; - openChats.Compress(); - } - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::FindArrayItem -//----------------------------------------------------------- -// -MVIMPSTProcessArrayItem* CVIMPSTProcessArray::FindArrayItem( const TDesC& aSenderId ) - { - TPtrC senderId = VIMPSTUtils::DisplayId( aSenderId ); - MVIMPSTProcessArrayItem* arrayItem = NULL; - TInt count = iItemArray.Count(); - for( TInt i = 1; i < count; i++ ) - { - MVIMPSTProcessArrayItem* contactItem = (MVIMPSTProcessArrayItem *)iItemArray[i]; - TPtrC contactId = VIMPSTUtils::DisplayId( contactItem->GetItemUserId() ); - if( senderId.Compare( contactId ) == 0 ) - { - arrayItem = contactItem; - break; - } - } - return arrayItem; - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::HandleChatMessageEventL -//----------------------------------------------------------- -// -void CVIMPSTProcessArray::HandleChatMessageEventL( TVIMPSTEnums::TIMEventType aEventType , - const TDesC& aSender ) - { - TRACER_AUTO; - if( !iFetchCompleted ) - { - // contact matching will not be correct until fetching completed - // hence return - return; - } - switch( aEventType ) - { - case TVIMPSTEnums::EIMUnreadMessage: - { - if( FindAndMarkContactAsOpenChat( aSender , ETrue ) ) - { - if(iProcessObservers) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound ); - } - } - else - { - DoHandleUnKnownContactMessageL( aSender , ETrue ); - } - break; - } - case TVIMPSTEnums::EIMUnreadChange: - { - FindAndMarkContactAsOpenChat( aSender , EFalse ) ; - if(iProcessObservers) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem,KErrNotFound ); - } - break; - } - case TVIMPSTEnums::EIMChatStarted: - { - if( FindAndMarkContactAsOpenChat( aSender , EFalse ) ) - { - if(iProcessObservers) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound ); - } - } - else - { - DoHandleUnKnownContactMessageL( aSender, EFalse ); - } - break; - } - case TVIMPSTEnums::EIMChatClosed: - { - if( !RemoveFromUnknonListL( aSender ) ) - { - MVIMPSTProcessArrayItem* arrayItem = FindArrayItem( aSender ); - if( arrayItem ) - { - arrayItem->SetConversationOpen( EFalse ); - arrayItem->SetMsgPending( EFalse ); - } - } - if(iProcessObservers) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound ); - } - break; - } - case TVIMPSTEnums::EIMAllChatClosed: - { - RemoveUnKnownContacts(); - iUnKnownContactArray.ResetAndDestroy();// delete all items - ResetOpenConversationPendingMsg(); - if(iProcessObservers) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound ); - } - break; - } - case TVIMPSTEnums::EIMRequestCompleted: - { - if(iProcessObservers) - { - iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound ); - } - break; - } - default: - { - // do nothing - } - } - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::HandleAddRequestEventL -//----------------------------------------------------------- -// -void CVIMPSTProcessArray::HandleAddRequestEventL(TVIMPSTEnums::TOperationType aType, const TDesC& aRequesterId, - const TDesC& aRequestorDisplayName ) - { - TRACER_AUTO; - //add new add request item at top of list(i.e at index 1, as 0 is own id). - //when request is entertained remove item from list. - switch( aType ) - { - case TVIMPSTEnums::EAddItem : - { - if( (!FindAnyAddRequest(aRequesterId ) )&& ( !FindAnyContactServiceField( aRequesterId ) ) && !(IsContactBlocked( aRequesterId )) ) - { - CVIMPSTProcessFriendRequestItem* addRequestItem = CVIMPSTProcessFriendRequestItem::NewL(*this, aRequesterId,aRequestorDisplayName); - /* Add it as the first Item of IAddRequestARray as its like stack */ - iAddRequestArray.Insert(addRequestItem,0); - /* - * always the new friend request will be shown in the beginning, so 0th item is own item, 1st item is new friendrequest - * and remaining remains same.. - */ - // ownership is in iItemArray - TInt invitationIndex = iUnKnownContactArray.Count()+1; - iItemArray.Insert(addRequestItem, invitationIndex); - if(iProcessObservers) - { - iProcessObservers->HandleAdditionL( TVIMPSTEnums::EFriendRequestItem ,KErrNotFound ); - } - } - break; - } - case TVIMPSTEnums::ERemoveItem : - { - TInt count = iAddRequestArray.Count(); - CVIMPSTProcessFriendRequestItem* requestItem = NULL; - for(TInt i = 0 ; i < count ; i++) - { - requestItem = iAddRequestArray[i]; - if( aRequesterId.Compare(requestItem->GetItemUserId()) == 0 ) - { - TInt index = iItemArray.Find(requestItem); - if(index != KErrNotFound) - { - iItemArray.Remove(index); - iItemArray.Compress(); - } - iAddRequestArray.Remove(i); - delete requestItem; - iAddRequestArray.Compress(); - break; - } - } - if(iProcessObservers) - { - iProcessObservers->HandleDeletionL(TVIMPSTEnums::EFriendRequestItem, KErrNotFound ); - } - break; - } - default : - break; - } - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::DoHandleUnKnownContactMessageL -//----------------------------------------------------------- -// -void CVIMPSTProcessArray::DoHandleUnKnownContactMessageL( const TDesC& aSenderId ,TBool aIsMsgPending ) - { - TRACER_AUTO; - TBool contactExist = EFalse ; - TInt count = iUnKnownContactArray.Count(); - CVIMPSTProcessUnknownContactItem* unknownItem = NULL; - for( TInt i=0; iGetItemUserId() ) == 0 ) - { - contactExist = ETrue; - unknownItem->SetConversationOpen(ETrue); - unknownItem->SetMsgPending( aIsMsgPending ); - break; - } - } - if( !contactExist ) - { - CVIMPSTProcessUnknownContactItem* addItem = CVIMPSTProcessUnknownContactItem::NewL(*this, aSenderId); - /* Add it as the first Item of IAddRequestARray as its like stack */ - iUnKnownContactArray.Insert(addItem,0); - // ownership is in iItemArray - iItemArray.Insert(addItem, 1); // just after own Item - addItem->SetMsgPending( aIsMsgPending ); - addItem->SetConversationOpen(ETrue); - } - if(iProcessObservers) - { - iProcessObservers->HandleAdditionL( TVIMPSTEnums::EUnknonContactItem ,KErrNotFound ); - } - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::IsMsgPending -//----------------------------------------------------------- -// -TBool CVIMPSTProcessArray::IsMsgPending(TInt aIndex) - { - if( aIndex < iItemArray.Count() && aIndex >= 0 ) - { - MVIMPSTProcessArrayItem* item = (MVIMPSTProcessArrayItem *)iItemArray[aIndex]; - if(item) - { - return item->IsMsgPending(); - } - } - return EFalse; - } - -//----------------------------------------------------------- -//CVIMPSTProcessArray::IsConversationExist -//----------------------------------------------------------- -// -TBool CVIMPSTProcessArray::IsConversationExist(TInt aIndex) - { - if( aIndex < iItemArray.Count() && aIndex >= 0 ) - { - MVIMPSTProcessArrayItem* item = (MVIMPSTProcessArrayItem *)iItemArray[aIndex]; - if(item) - { - return item->IsConversationOpen(); - } - } - return EFalse; - } - -//----------------------------------------------------------- -//CVIMPSTProcessArray::ResetPendingMsg -//----------------------------------------------------------- -// -void CVIMPSTProcessArray::ResetPendingMsg(TInt aIndex) - { - if( aIndex < iItemArray.Count() && aIndex >= 0 ) - { - MVIMPSTProcessArrayItem* item = (MVIMPSTProcessArrayItem *)iItemArray[aIndex]; - if(item) - { - item->SetMsgPending( EFalse ); - } - } - } -//----------------------------------------------------------- -//CVIMPSTProcessArray::ResetOpenConversationPendingMsg -//----------------------------------------------------------- -// -void CVIMPSTProcessArray::ResetOpenConversationPendingMsg() - { - for( TInt index = 0; index < iItemArray.Count() ;index++ ) - { - MVIMPSTProcessArrayItem* item = (MVIMPSTProcessArrayItem *)iItemArray[index]; - if(item) - { - item->SetConversationOpen( EFalse ); - item->SetMsgPending( EFalse ); - } - } - } -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FindAnyContact -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- -TBool CVIMPSTProcessArray::FindAnyContact( const TDesC& aContactId ) - { - if(aContactId.Length() != 0) - { - MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId(aContactId); - if( contact ) - { - return ETrue; - } - } - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FindAnyContactServiceField -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- -TBool CVIMPSTProcessArray::FindAnyContactServiceField( const TDesC& aContactId ) - { - if(aContactId.Length() != 0) - { - MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId(aContactId); - if( contact ) - { - return ETrue; - } - } - return EFalse; - } -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FindAndMarkContactAsOpenChat -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- -TBool CVIMPSTProcessArray::FindAndMarkContactAsOpenChat( const TDesC& aContactId, TBool aMesssagePending ) - { - TPtrC senderId = VIMPSTUtils::DisplayId( aContactId ); - TBool ret = EFalse; - TInt count = iItemArray.Count(); - for( TInt i = 1; i < count; i++ ) - { - MVIMPSTProcessArrayItem* contactItem = (MVIMPSTProcessArrayItem *)iItemArray[i]; - TPtrC contactId = VIMPSTUtils::DisplayId( contactItem->GetItemUserId() ); - if( senderId.Compare( contactId ) == 0 ) - { - contactItem->SetConversationOpen( ETrue ); - contactItem->SetMsgPending( aMesssagePending ); - ret = ETrue; - break; - } - } - return ret; - } -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::IsUnreadMessageExists -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TBool CVIMPSTProcessArray::IsUnreadMessageExistsL(const TDesC& aRecipientId) - { - TBool ret = EFalse; - TInt unreaMsgCount = KErrNone; - //Get IM SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EIM)); - if(subService) - { - MVIMPSTEngineIMSubService& imSubService = - MVIMPSTEngineIMSubService::Cast (*subService); - unreaMsgCount = imSubService.GetUnreadCountL( aRecipientId ); - } - if( unreaMsgCount ) - { - ret = ETrue; - } - return ret; - } -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::IsConversationExistL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TBool CVIMPSTProcessArray::IsConversationExistL(const TDesC& aRecipientId) - { - //Get IM SubService - MVIMPSTEngineSubService* subService1 = - (iEngine.SubService(TVIMPSTEnums::EIM)); - if(subService1) - { - MVIMPSTEngineIMSubService& imSubService = - MVIMPSTEngineIMSubService::Cast (*subService1); - return imSubService.IsConversationExistL( aRecipientId ); - } - return EFalse; - } -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FindContactIndexL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CVIMPSTProcessArray::FindContactIndexL( const TDesC& aContactId ) - { - MVIMPSTStorageContact* newContact = iContactInterface->FindContactByUserId( aContactId ); - if(newContact) - { - // return the index of contact rather bool value.. - // 1 is for own data item. - return (iContactListIndex + 1 + iContactListModel->IndexOfContact( newContact )); - } - return KErrNotFound; - } - - -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FillUnknownContactsL -// ( Other items commented in header ) -//------------------------------------------------------------------------------ -void CVIMPSTProcessArray::FillUnknownContactsL() - { - TInt count = iUnKnownContactArray.Count(); - /* - * Index = 1 cos 0th index will be OwnData, and 1 - n where n is the number of friend requests, will be friend requests - */ - TInt index = 1; - for(TInt i = 0 ; i < count ; i++) - { - // all friend request item ownership is transfered to iItemArray - CVIMPSTProcessUnknownContactItem* unknownItem = iUnKnownContactArray[i]; - unknownItem->SetItemIndex(index); - iItemArray.Insert(unknownItem, index); - index ++; - } - } - -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FillAddRequestDataL -// ( Other items commented in header ) -//------------------------------------------------------------------------------ -void CVIMPSTProcessArray::FillAddRequestDataL() - { - TInt count = iAddRequestArray.Count(); - /* - * Index = unknowncontacts are tops so after that 1 cos 0th index will be OwnData, and 1 - n where n is the number of friend requests, will be friend requests - */ - TInt index = iUnKnownContactArray.Count() +1 ; - for(TInt i = 0 ; i < count ; i++) - { - // all friend request item ownership is transfered to iItemArray - CVIMPSTProcessFriendRequestItem* requestItem = iAddRequestArray[i]; - requestItem->SetItemIndex(index ); - iItemArray.Insert(requestItem, index); - index ++; - } - } - -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::RemoveUnKnownContacts -// ( Other items commented in header ) -//------------------------------------------------------------------------------ -void CVIMPSTProcessArray::RemoveUnKnownContacts() - { - TInt count = iUnKnownContactArray.Count(); - for(TInt i = 0 ; i < count ; i++) - { - CVIMPSTProcessUnknownContactItem* unknownItem = iUnKnownContactArray[i]; - TInt index = iItemArray.Find(unknownItem); - if(index > -1) - { - iItemArray.Remove(index); - iItemArray.Compress(); - } - } - } -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::RemoveAddRequestData -// ( Other items commented in header ) -//------------------------------------------------------------------------------ -void CVIMPSTProcessArray::RemoveAddRequestData() - { - TInt count = iAddRequestArray.Count(); - for(TInt i = 0 ; i < count ; i++) - { - CVIMPSTProcessFriendRequestItem* requestItem = iAddRequestArray[i]; - TInt index = iItemArray.Find(requestItem); - if(index > -1) - { - iItemArray.Remove(index); - iItemArray.Compress(); - } - } - - } -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::LoginUserIdFromStoreL -// ( Other items commented in header ) -//------------------------------------------------------------------------------ - -const TDesC& CVIMPSTProcessArray::LoginUserIdFromStoreL() const - { - if( iContactInterface ) - { - // most of the time this get called - return iContactInterface->OwnContactL().UserId(); - } - return KNullDesC; - } - -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::AvatarIndex -// ( Other items commented in header ) -//------------------------------------------------------------------------------ - -TInt CVIMPSTProcessArray::AvatarIndex(TInt aContactIndex) - { - TVIMPSTEnums::TItem itemtype = GetType( aContactIndex ); - /* Codescanner warning is ignored, since Bound check is done - * inside the GetType() method*/ - - if( TVIMPSTEnums::EContactItem == itemtype ) - { - // if the type is a contact item then return the index - MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId( GetItemUserId(aContactIndex) ); - if(contact) - { - // if any contact is found then return the index - return contact->AvatarIndex(); - } - } - return KErrNone; - } -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::SetAvatarIndex -// ( Other items commented in header ) -//------------------------------------------------------------------------------ - -void CVIMPSTProcessArray::SetAvatarIndex( TInt aContactIndex ,TInt aAvatarIndex ) - { - TVIMPSTEnums::TItem itemtype = GetType( aContactIndex ); - if( TVIMPSTEnums::EContactItem == itemtype ) - { - // if the type is a contact item then set the index - MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId(GetItemUserId(aContactIndex)); - if(contact) - { - // if any contact is found then set the index - contact->SetAvatarIndex( aAvatarIndex ); - } - - iItemArray[aContactIndex]->SetAvatarIndex(aAvatarIndex); - } - - } - -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::AvatarContent -// ( Other items commented in header ) -//------------------------------------------------------------------------------ - -const TDesC8& CVIMPSTProcessArray::AvatarContent(TInt aContactIndex) - { - TVIMPSTEnums::TItem itemtype = GetType( aContactIndex ); - - if( itemtype == TVIMPSTEnums::EContactItem ) - { - // if the type is a contact item then get the avatar content from strorage - MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId(GetItemUserId(aContactIndex)); - if(contact) - { - // if any contact is found then get the content - return contact->AvatarContent(); - } - } - return KNullDesC8(); - } -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::OwnAvatarContentL -// ( Other items commented in header ) -//------------------------------------------------------------------------------ - -const TDesC8& CVIMPSTProcessArray::OwnAvatarContentL( ) const - { - MVIMPSTStorageContact& contact = iContactInterface->OwnContactL(); - // if any contact is found then get the content - return contact.AvatarContent(); - } -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::OwnAvatarIndexL -// ( Other items commented in header ) -//------------------------------------------------------------------------------ - -TInt CVIMPSTProcessArray::OwnAvatarIndexL( ) - { - MVIMPSTStorageContact& contact = iContactInterface->OwnContactL(); - return contact.AvatarIndex(); - } -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::SetOwnAvatarIndexL -// ( Other items commented in header ) -//------------------------------------------------------------------------------ - -void CVIMPSTProcessArray::SetOwnAvatarIndexL( TInt aAvatarIndex ) - { - MVIMPSTStorageContact& contact = iContactInterface->OwnContactL(); - contact.SetAvatarIndex( aAvatarIndex ); - } - -//----------------------------------------------------------------------------- -// CVIMPSTProcessArray::FindAnyAddRequest -// ( Other items commented in header ) -//------------------------------------------------------------------------------ - -TInt CVIMPSTProcessArray::FindAnyAddRequest( const TDesC& aRequesterId ) - { - TInt count = iAddRequestArray.Count(); - for(TInt i=0; iGetItemUserId()))==0 ) - { - return ETrue; - } - } - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessArray::GetSelectedItemIndex -// return contact index including friend request. -// ----------------------------------------------------------------------------- -TInt CVIMPSTProcessArray::GetSelectedItemIndex(const TDesC& aContactId) - { - TInt itemArrayCount = iItemArray.Count(); - for(TInt index=0; indexGetItemUserId())) - { - return index; - } - } - return KErrNotFound; - } - -// -------------------------------------------------------------------------- -// CVIMPSTProcessArray::IsContactBlocked -// -------------------------------------------------------------------------- -TBool CVIMPSTProcessArray::IsContactBlocked(const TDesC& aUserId) - { - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - - RPointerArray *blockedlist = presence .GetBlockedList(); - - if(blockedlist) - { - for(TInt i=0; iCount(); ++i) - { - if(0 == aUserId.CompareC((*blockedlist)[i]->Des())) - { - return ETrue; - } - } - } - } - return EFalse; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTProcessArray::GetFormattedString -// -------------------------------------------------------------------------- -TPtrC16 CVIMPSTProcessArray::GetFormattedString(TInt aIndex) - { - if((aIndex >= 0) && (aIndex< iItemArray.Count())) - return iItemArray[aIndex]->FormattedItemString(); - else - return KNullDesC(); - } - -//END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstprocessarrayitem.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstprocessarrayitem.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,764 +0,0 @@ -/* -* Copyright (c) 2008 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: CVIMPSTProcessContactItem, CVIMPSTProcessContactListItem, CVIMPSTProcessOwnDataItem, - CVIMPSTProcessConversationItem: Method implementation -* -*/ - - -#include "cvimpstprocessarrayitem.h" -#include "tvimpstconsts.h" -#include "vimpstutils.h" -#include -#include - - -const TInt KAvtarLength = 3; - _LIT( KAvatarString , "%d\t" ); - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessContactItem::NewL -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessContactItem* CVIMPSTProcessContactItem::NewL(CVIMPSTProcessArray& aParent,const TDesC& aContactName, - const TDesC& aContactId , - MVPbkContactLink* aContactLink, - const TDesC& aStatusText, - TVIMPSTEnums::TOnlineStatus aOnlineStatus) - { - CVIMPSTProcessContactItem* self = new( ELeave ) CVIMPSTProcessContactItem - ( aParent, aContactLink); - CleanupStack::PushL( self ); - self->ConstructL(aContactId,aContactName,aStatusText,aOnlineStatus ); - CleanupStack::Pop(); //Codescanner warning ignored - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessContactItem::ConstructL -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessContactItem::ConstructL(const TDesC& aContactId, - const TDesC& aContactName, - const TDesC& aStatusText, - TVIMPSTEnums::TOnlineStatus aOnlineStatus ) - { - iContactUserId = aContactId.AllocL(); - iItemNameTextContact = aContactName.AllocL(); - iSMsgPending = EFalse; - iStatusText = aStatusText.AllocL(); - iOnlineStatus = aOnlineStatus; - - TInt maxLengthOfIcons = KDefaultAvatar().Length()+ // longest A-Column icon - (KTab().Length() * 2)+ // length of tabs between items - KContactOnlineIconA().Length(); // longest D-Column icon - - iFormattedString = HBufC::NewL( KFriendsListMaxIdentificationLength + - KStatusMsgMaxLength + - maxLengthOfIcons ); - - - DoFormatStringL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessContactItem::CVIMPSTProcessContactItem -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessContactItem::CVIMPSTProcessContactItem(CVIMPSTProcessArray& aParent, MVPbkContactLink* aContactLink) -: iParent(aParent), - iContactLink(aContactLink) - { - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessContactItem::~CVIMPSTProcessContactItem -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessContactItem::~CVIMPSTProcessContactItem() - { - delete iContactUserId; - delete iItemNameTextContact; - if(iStatusText) - { - delete iStatusText; - } - if(iFormattedString) - delete iFormattedString; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactItem: Type -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TItem CVIMPSTProcessContactItem::Type() - { - return TVIMPSTEnums::EContactItem; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactItem: GetItemNameText -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTProcessContactItem::GetItemNameText() - { - if( iItemNameTextContact ) - { - return *iItemNameTextContact; - } - return KNullDesC(); - } - - // ----------------------------------------------------------------------------- -//CVIMPSTProcessContactItem: GetItemUserId -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTProcessContactItem::GetItemUserId() - { - if( iContactUserId ) - { - return *iContactUserId; - } - return KNullDesC(); - } - - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactItem::StatusText -// ----------------------------------------------------------------------------- -// -const TDesC& CVIMPSTProcessContactItem::StatusText() - { - if( iStatusText ) - { - return *iStatusText; - } - return KNullDesC; - } -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactItem::OnlineStatus -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TOnlineStatus CVIMPSTProcessContactItem::OnlineStatus() - { - return iOnlineStatus; - } - - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactItem: SetMsgPending -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessContactItem::SetMsgPending(TBool aPendingMessageStatus) - { - iSMsgPending = aPendingMessageStatus; - - TRAP_IGNORE(DoFormatStringL()); - } -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactItem: GetMsgPending -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTProcessContactItem::IsMsgPending() - { - return iSMsgPending; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactItem: SetConversationOpen -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessContactItem::SetConversationOpen(TBool aConversationOpen) - { - iIsConversationOpen = aConversationOpen; - - TRAP_IGNORE(DoFormatStringL()); - } -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactItem: IsConversationOpen -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTProcessContactItem::IsConversationOpen() - { - return iIsConversationOpen; - } - -void CVIMPSTProcessContactItem::DoFormatStringL() - { - TPtr dataPtr( iFormattedString->Des() ); - dataPtr.Zero(); - - TVIMPSTEnums::TVIMPSTRegistrationState loginstate = iParent.GetLoginState(); - - TInt avtarIndex = AvatarIndex(); - - TVIMPSTEnums::TOnlineStatus status = OnlineStatus(); - - if( avtarIndex && (status != TVIMPSTEnums::EBlocked)) - { - // if there is any avatar index then append that icon - TBuf buf; - buf.Format( KAvatarString, avtarIndex); - dataPtr.Append( buf); - } - else if( status == TVIMPSTEnums::EPending && TVIMPSTEnums::ESVCERegistered == loginstate)//if contact is remote pending - { - // append friend request icon online for column A - dataPtr.Append( KRemotePendingRequest ); - } - else if( status == TVIMPSTEnums::EBlocked && TVIMPSTEnums::ESVCERegistered == loginstate)//if contact is remote pending - { - // append blocked icon for column A - dataPtr.Append( KFrndBlockedIcon ); - } - else - { - // append default avatar for column A - dataPtr.Append( KDefaultAvatar ); - } - - // B-column append dispplay id - TPtrC identification(GetItemNameText()); - // append only max length of the user id allowed : extra check - dataPtr.Append( identification.Left( KFriendsListMaxIdentificationLength ) ); - - // append \t before second line text - dataPtr.Append( KTab ); - - // append status text for second line and Icon for column D based on conditions - if ( ( TVIMPSTEnums::ESVCERegistered == loginstate ) && ( iParent.IsPresenceSupported() ) ) - { - - TPtrC statusText = StatusText(); - if( statusText.Length() > 0) // if status text show it - { - // append only KStatusMsgMaxLenght of status masg - dataPtr.Append( statusText.Left( KStatusMsgMaxLength ) ); - } - else - { // show default if no status text based on status - switch(status) - { - case TVIMPSTEnums::EOnline: - { - - HBufC* onlineText = StringLoader::LoadLC( R_QTN_SERVTAB_DEFAULT_STATUSTEXT_ONLINE ); - dataPtr.Append( onlineText->Des()); - CleanupStack::PopAndDestroy(); //onlineText - break; - } - case TVIMPSTEnums::EBusy: - { - HBufC* busyText = StringLoader::LoadLC( R_SERVDETAIL_STATUSTEXT_BUSY ) ; - dataPtr.Append( busyText->Des()); - CleanupStack::PopAndDestroy(); //busyText - break; - } - case TVIMPSTEnums::EAway: - { - HBufC* awayText = StringLoader::LoadLC( R_QTN_SERVTAB_DEFAULT_STATUSTEXT_AWAY ); - dataPtr.Append( awayText->Des()); - CleanupStack::PopAndDestroy(); //Away text - break; - } - case TVIMPSTEnums::EOnPhone: - { - HBufC* onphoneText = StringLoader::LoadLC( R_SERVDETAIL_STATUSTEXT_ONTHEPHONE ); - dataPtr.Append( onphoneText->Des()); - CleanupStack::PopAndDestroy(); // on phone text - break; - } - case TVIMPSTEnums::EDoNotDisturb: - { - HBufC* dndText = StringLoader::LoadLC( R_SERVDETAIL_STATUSTEXT_DND ); - dataPtr.Append( dndText->Des()); - CleanupStack::PopAndDestroy(); //dnd Text - break; - } - case TVIMPSTEnums::EPending: - { - HBufC* pndText = StringLoader::LoadLC( R_REMOTEPENDING_STATUSTEXT ); - dataPtr.Append( pndText->Des()); - CleanupStack::PopAndDestroy(); //pnd Text - break; - } - case TVIMPSTEnums::EBlocked: - { - HBufC* blockedText = StringLoader::LoadLC( R_QTN_SERVTAB_DEFAULT_STATUSTEXT_BLOCKED ); - dataPtr.Append( blockedText->Des()); - CleanupStack::PopAndDestroy(); //blockedText - break; - } - case TVIMPSTEnums::EOffline: //Flowthrough - { - HBufC* offlineText = StringLoader::LoadLC( R_QTN_SERVTAB_DEFAULT_STATUSTEXT_OFFLINE ); - dataPtr.Append( offlineText->Des()); - CleanupStack::PopAndDestroy(); //offlineText - break; - } - case TVIMPSTEnums::ECallForward: //Flowthrough - { - HBufC* callforwardText = StringLoader::LoadLC( R_QTN_SERVTAB_DEFAULT_STATUSTEXT_CALLFORWARD ); - dataPtr.Append( callforwardText->Des()); - CleanupStack::PopAndDestroy(); //callforwardText - break; - } - case TVIMPSTEnums::EServiceOut: - default: - { - break; - } - }// end of switch - }// end of else - - // append tab before appending icon - dataPtr.Append( KTab ); - - switch(status) - { - case TVIMPSTEnums::EOnline: - { - dataPtr.Append( KContactOnlineIconA ); - break; - } - case TVIMPSTEnums::EInvisible: - { - dataPtr.Append( KListInvisibleIcon ); - break; - } - case TVIMPSTEnums::EBusy: - case TVIMPSTEnums::EDoNotDisturb: - { - dataPtr.Append( KListBusyIcon ); - break; - } - case TVIMPSTEnums::EAway: - { - dataPtr.Append( KListAwayIcon ); - break; - } - case TVIMPSTEnums::EOnPhone: - { - dataPtr.Append( KFrndOnMobileIcon ); - break; - } - case TVIMPSTEnums::EOffline: //Flowthrough - { - dataPtr.Append( KContactOfflineIconA ); - break; - } - case TVIMPSTEnums::ECallForward: //Flowthrough - { - dataPtr.Append( KCallForward ); - break; - } - case TVIMPSTEnums::EBlocked: - case TVIMPSTEnums::EPending: - case TVIMPSTEnums::EServiceOut: - default: - { - dataPtr.Append( KEmptyIconA ); - break; - } - }//end switch - - if( iParent.IsIMSupported() ) - { - - if( IsMsgPending() ) - { - // unread message - dataPtr.Append( KContactNewMsgIcon ); - } - else if( IsConversationOpen() ) - { - // open conversation - dataPtr.Append( KContactOpenConvIcon ); - } - else - { - //empty - dataPtr.Append( KEmptyIconC ); - } - } - } - - } - - -TPtrC16 CVIMPSTProcessContactItem::FormattedItemString() - { - if(iFormattedString) - return iFormattedString->Des(); - else - return KNullDesC(); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessContactListItem::NewL -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessContactListItem* CVIMPSTProcessContactListItem::NewL(CVIMPSTProcessArray& aParent) - { - CVIMPSTProcessContactListItem* self = new( ELeave ) CVIMPSTProcessContactListItem(aParent); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop();//Codescanner warning ignored - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessContactListItem::ConstructL -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessContactListItem::ConstructL() - { - iItemNameTextList = HBufC::NewL(KFriendsListMaxIdentificationLength); - } -// ----------------------------------------------------------------------------- -// CVIMPSTProcessContactListItem::c++ default constructor -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessContactListItem::CVIMPSTProcessContactListItem(CVIMPSTProcessArray& aParent) -: iParent(aParent) - { - - } -// ----------------------------------------------------------------------------- -// CVIMPSTProcessContactListItemPC::~CVIMPSTProcessContactListItemPC destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessContactListItem::~CVIMPSTProcessContactListItem() - { - delete iItemNameTextList; - iItemNameTextList = NULL; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactListItem: Type -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TItem CVIMPSTProcessContactListItem::Type() - { - return TVIMPSTEnums::EContactListItem; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactListItem: IsCollapsed -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTProcessContactListItem::IsCollapsed() - { - return iCollapsedStatus; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactListItem: SetCollapsed -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessContactListItem::SetCollapsed(TBool aCollapsedStatus) - { - iCollapsedStatus = aCollapsedStatus; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactListItem: GetItemNameText -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTProcessContactListItem::GetItemNameText() - { - return *iItemNameTextList; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessContactListItem: SetItemNameText -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessContactListItem::SetItemNameText(const TDesC& aItemName) - { - *iItemNameTextList = aItemName; - } - - -void CVIMPSTProcessContactListItem::DoFormatStringL() - { - //not implemented - } - -TPtrC16 CVIMPSTProcessContactListItem::FormattedItemString() - { - //Not Implemented - return KNullDesC(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessOwnDataItem::NewL -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessOwnDataItem* CVIMPSTProcessOwnDataItem::NewL(CVIMPSTProcessArray& aParent, TDesC& aOwnId) - { - CVIMPSTProcessOwnDataItem* self = new( ELeave ) CVIMPSTProcessOwnDataItem(aParent, aOwnId); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); //Codescanner warning ignored - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessOwnDataItem::ConstructL -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessOwnDataItem::ConstructL() - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessOwnDataItem::CVIMPSTProcessOwnDataItem -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessOwnDataItem::CVIMPSTProcessOwnDataItem(CVIMPSTProcessArray& aParent, TDesC& aOwnId) -:iParent(aParent), - iOwnDataId(aOwnId) - { - - } -// ----------------------------------------------------------------------------- -// CVIMPSTProcessOwnDataItem::~CVIMPSTProcessOwnDataItem -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessOwnDataItem::~CVIMPSTProcessOwnDataItem() - { - - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessOwnDataItem: Type -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TItem CVIMPSTProcessOwnDataItem::Type() - { - return TVIMPSTEnums::EOwnStatusItem; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessOwnDataItemPC: GetItemUserId -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTProcessOwnDataItem::GetItemUserId() - { - return iOwnDataId; - } - -void CVIMPSTProcessOwnDataItem::DoFormatStringL() - { - //not implemented - } - -TPtrC16 CVIMPSTProcessOwnDataItem::FormattedItemString() - { - //Not Implemented - return KNullDesC(); - } - -///////////////////////////////////////////////////////////////////////// -///////////////////////////////// Unknowncontact item //////////////////// - - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessUnknownContactItem::default constructor -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessUnknownContactItem::CVIMPSTProcessUnknownContactItem(CVIMPSTProcessArray& aParent) -: iParent(aParent) - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessUnknownContactItem::NewL -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessUnknownContactItem* CVIMPSTProcessUnknownContactItem::NewL(CVIMPSTProcessArray& aParent, const TDesC& aBuddyId ) - { - CVIMPSTProcessUnknownContactItem* self = new (ELeave) CVIMPSTProcessUnknownContactItem(aParent); - CleanupStack::PushL(self); - self->ConstructL(aBuddyId); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessUnknownContactItem::ConstructL -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessUnknownContactItem::ConstructL(const TDesC& aBuddyId) - { - iUesrId = aBuddyId.AllocL(); - //load formatted string from resource. - iItemNameText = VIMPSTUtils::LoadResourceL(R_SERVTAB_UNKNOWN_BUDDY); - iIndex = -1;//default index if no index is set. - - TInt maxLengthOfIcons = KDefaultAvatar().Length()+ // longest A-Column icon - (KTab().Length() * 2)+ // length of tabs between items - KContactOnlineIconA().Length(); // longest D-Column icon - - iFormattedString = HBufC::NewL( KFriendsListMaxIdentificationLength + - KStatusMsgMaxLength + - maxLengthOfIcons ); - - DoFormatStringL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessUnknownContactItem::destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessUnknownContactItem::~CVIMPSTProcessUnknownContactItem() - { - delete iItemNameText; - delete iUesrId; - - if(iFormattedString) - delete iFormattedString; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessUnknownContactItem::GetItemNameText -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTProcessUnknownContactItem::GetItemNameText() - { - return iItemNameText->Des(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessUnknownContactItem::Type -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TItem CVIMPSTProcessUnknownContactItem::Type() - { - return TVIMPSTEnums::EUnknonContactItem; - } -/** -* Returns the user id of the listbox item -* @return TPtrC: user id of the listbox item. -*/ -TPtrC CVIMPSTProcessUnknownContactItem::GetItemUserId() - { - return iUesrId->Des(); - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessUnknownContactItem: SetMsgPending -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessUnknownContactItem::SetMsgPending(TBool aPendingMessageStatus) - { - iSMsgPending = aPendingMessageStatus; - - TRAP_IGNORE(DoFormatStringL()); - } -// ----------------------------------------------------------------------------- -//CVIMPSTProcessUnknownContactItem: GetMsgPending -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTProcessUnknownContactItem::IsMsgPending() - { - return iSMsgPending; - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessUnknownContactItem: SetConversationOpen -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessUnknownContactItem::SetConversationOpen(TBool aConversationOpen) - { - iIsConversationOpen = aConversationOpen; - - TRAP_IGNORE(DoFormatStringL()); - } -// ----------------------------------------------------------------------------- -//CVIMPSTProcessUnknownContactItem: IsConversationOpen -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTProcessUnknownContactItem::IsConversationOpen() - { - return iIsConversationOpen; - } - -void CVIMPSTProcessUnknownContactItem::DoFormatStringL() - { - TPtr dataPtr( iFormattedString->Des() ); - dataPtr.Zero(); - - if ( TVIMPSTEnums::ESVCERegistered == iParent.GetLoginState()) - { - // append friend request icon online for column A - dataPtr.Append( KDefaultAvatar ); - } - else - {// append friend request icon offline for column A - dataPtr.Append( KLocalPendingRequestOffline ); - } - - // B-column append friend request text - dataPtr.Append(GetItemUserId().Left( KFriendsListMaxIdentificationLength )); - - // append \t before second line text - dataPtr.Append( KTab ); - - TPtrC identification(GetItemNameText() ); - - dataPtr.Append( identification ); - - - - - // append tab before appending icon - dataPtr.Append( KTab ); - - dataPtr.Append( KEmptyIconA ); - - if( iParent.IsIMSupported() ) - { - if( this->IsMsgPending() ) - { - // unread message - dataPtr.Append( KContactNewMsgIcon ); - } - else if( this->IsConversationOpen()) - { - // open conversation - dataPtr.Append( KContactOpenConvIcon ); - } - else - { - //empty - dataPtr.Append( KEmptyIconC ); - } - } - - } - - -TPtrC16 CVIMPSTProcessUnknownContactItem::FormattedItemString() - { - if(iFormattedString) - return iFormattedString->Des(); - else - return KNullDesC(); - } - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimpstprocessfriendrequestitem.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimpstprocessfriendrequestitem.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,194 +0,0 @@ -/* -* Copyright (c) 2008 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: implementation for CVIMPSTProcessFriendRequestItem -* -*/ - -#include "cvimpstprocessfriendrequestitem.h" -#include "vimpstutils.h" -#include -#include -#include "tvimpstconsts.h" - - - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessFriendRequestItem::default constructor -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessFriendRequestItem::CVIMPSTProcessFriendRequestItem(CVIMPSTProcessArray& aParent): - iParent(aParent) - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessFriendRequestItem::NewL -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessFriendRequestItem* CVIMPSTProcessFriendRequestItem::NewL(CVIMPSTProcessArray& aParent, const TDesC& aRequesterId, - const TDesC& aRequestorDisplayName) - { - CVIMPSTProcessFriendRequestItem* self = new (ELeave) CVIMPSTProcessFriendRequestItem(aParent); - CleanupStack::PushL(self); - self->ConstructL(aRequesterId,aRequestorDisplayName); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessFriendRequestItem::ConstructL -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessFriendRequestItem::ConstructL(const TDesC& aRequesterId, const TDesC& aRequestorDisplayName) - { - iUesrId = aRequesterId.AllocL(); - iDisplayName = aRequestorDisplayName.AllocL(); - iIndex = -1;//default index if no index is set. - - TInt maxLengthOfIcons = KDefaultAvatar().Length()+ // longest A-Column icon - (KTab().Length() * 2)+ // length of tabs between items - KContactOnlineIconA().Length(); // longest D-Column icon - - iFormattedString = HBufC::NewL( KFriendsListMaxIdentificationLength + - KStatusMsgMaxLength + - maxLengthOfIcons ); - - DoFormatStringL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessFriendRequestItem::destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTProcessFriendRequestItem::~CVIMPSTProcessFriendRequestItem() - { - delete iUesrId; - delete iDisplayName; - - if(iFormattedString) - delete iFormattedString; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessFriendRequestItem::GetItemNameText -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTProcessFriendRequestItem::GetItemNameText() - { - if((*iDisplayName).Length()) - return iDisplayName->Des(); - else - return iUesrId->Des(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessFriendRequestItem::Type -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TItem CVIMPSTProcessFriendRequestItem::Type() - { - return TVIMPSTEnums::EFriendRequestItem; - } - -/** -* Returns the user id of the listbox item -* @return TPtrC: user id of the listbox item. -*/ -TPtrC CVIMPSTProcessFriendRequestItem::GetItemUserId() - { - return iUesrId->Des(); - } - -// ----------------------------------------------------------------------------- -//CVIMPSTProcessFriendRequestItem: SetMsgPending -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessFriendRequestItem::SetMsgPending(TBool aPendingMessageStatus) - { - iSMsgPending = aPendingMessageStatus; - - TRAP_IGNORE(DoFormatStringL()); - } -// ----------------------------------------------------------------------------- -//CVIMPSTProcessFriendRequestItem: GetMsgPending -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTProcessFriendRequestItem::IsMsgPending() - { - return iSMsgPending; - } -// ----------------------------------------------------------------------------- -//CVIMPSTProcessFriendRequestItem: SetConversationOpen -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessFriendRequestItem::SetConversationOpen(TBool aConversationOpen) - { - iIsConversationOpen = aConversationOpen; - - TRAP_IGNORE(DoFormatStringL()); - } -// ----------------------------------------------------------------------------- -//CVIMPSTProcessFriendRequestItem: IsConversationOpen -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTProcessFriendRequestItem::IsConversationOpen() - { - return iIsConversationOpen; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessFriendRequestItem::FormattedItemString -// ----------------------------------------------------------------------------- -// -TPtrC16 CVIMPSTProcessFriendRequestItem::FormattedItemString() - { - if(iFormattedString) - return iFormattedString->Des(); - else - return KNullDesC(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTProcessFriendRequestItem::DoFormatString -// ----------------------------------------------------------------------------- -// -void CVIMPSTProcessFriendRequestItem::DoFormatStringL() - { - - TPtr dataPtr( iFormattedString->Des() ); - dataPtr.Zero(); - - - if ( TVIMPSTEnums::ESVCERegistered == iParent.GetLoginState()) - { - // append friend request icon online for column A - dataPtr.Append( KLocalPendingRequest ); - } - else - {// append friend request icon offline for column A - dataPtr.Append( KLocalPendingRequestOffline ); - } - - // B-column append friend request text - HBufC* friendRequestText = StringLoader::LoadLC(R_SERVTAB_FRIEND_REQUEST); - dataPtr.Append( friendRequestText->Des() ); - CleanupStack::PopAndDestroy(friendRequestText); - - // append \t before second line text - dataPtr.Append( KTab ); - // append the user id - dataPtr.Append(GetItemNameText().Left( KFriendsListMaxIdentificationLength )); - - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/src/cvimstcmdfriendrequest.cpp --- a/uiservicetab/vimpstcmdprocess/src/cvimstcmdfriendrequest.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* Copyright (c) 2008 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: command process for friend request -* -*/ - - -// INCLUDE FILES -#include "cvimstcmdfriendrequest.h" - -#include "vimpstcmd.hrh" -#include "mvimpstcmdobserver.h" - -#include "uiservicetabtracer.h" - -#include -#include "mvimpstengine.h" -#include "mvimpstenginepresencesubservice.h" -#include "mvimpstenginesubservice.h" - -// Constants - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFriendRequest::CVIMPSTCmdFriendRequest -// -------------------------------------------------------------------------- -// -CVIMPSTCmdFriendRequest::CVIMPSTCmdFriendRequest( - const TInt aCommandId ,const TDesC& aContactId, - MVIMPSTEngine& aEngine) : - iCommandId( aCommandId ), - iContactId( aContactId ), - iEngine(aEngine) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFriendRequest::~CVIMPSTCmdFriendRequest -// -------------------------------------------------------------------------- -// -CVIMPSTCmdFriendRequest::~CVIMPSTCmdFriendRequest() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFriendRequest::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTCmdFriendRequest* CVIMPSTCmdFriendRequest::NewL( - const TInt aCommandId,const TDesC& aContactId, - MVIMPSTEngine& aEngine) - { - CVIMPSTCmdFriendRequest* self = new (ELeave ) CVIMPSTCmdFriendRequest( aCommandId ,aContactId, aEngine); - self->ConstructL(); //use contsurctL if necessary - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTCmdFriendRequest::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFriendRequest::ConstructL() - { - iError = KErrNone; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFriendRequest::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFriendRequest::ExecuteLD() - { - - TRACER_AUTO; - //push to the cleanupstack - CleanupStack::PushL( this ); - - //Get Presence SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - presence.SendPresenceGrantPresentityL(iContactId, ( iCommandId == EFriendAccpeted )); - } - - - - if(iObserver) - { - iObserver->CommandFinishedL(*this); - } - - CleanupStack::PopAndDestroy(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFriendRequest::AddObserver -// -------------------------------------------------------------------------- -// -void CVIMPSTCmdFriendRequest::AddObserver( MVIMPSTCmdObserver& aObserver ) - { - // store the observer to notify the command completion - iObserver = &aObserver; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFriendRequest::CommandId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdFriendRequest::CommandId() const - { - return iCommandId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTCmdFriendRequest::Result -// -------------------------------------------------------------------------- -// -TInt CVIMPSTCmdFriendRequest::Result() const - { - //return valid data regd the command operation - return iError; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/bmarm/vimpstcmdprocess_utestu.def --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/bmarm/vimpstcmdprocess_utestu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -EXPORTS - LibEntryL__Fv @ 1 NONAME R3UNUSED ; LibEntryL(void) - SetRequirements__FRP16CTestModuleParamRUl @ 2 NONAME R3UNUSED ; SetRequirements(CTestModuleParam *&, unsigned long &) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/bwins/vimpstcmdprocess_utestu.def --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/bwins/vimpstcmdprocess_utestu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * __cdecl LibEntryL(void) - ?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int __cdecl SetRequirements(class CTestModuleParam * &,unsigned long &) - ?InitialiseLibraryL@CVIMPSTStorageManagerFactory@@SAXXZ @ 3 NONAME ; void CVIMPSTStorageManagerFactory::InitialiseLibraryL(void) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@ABVTDesC8@@ABVMVPbkContactStoreList@@@Z @ 4 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class TDesC8 const &, class MVPbkContactStoreList const &) - ?Remove@CVPbkContactLinkArray@@QAEXH@Z @ 5 NONAME ; void CVPbkContactLinkArray::Remove(int) - ?Delete@CVPbkContactLinkArray@@QAEXH@Z @ 6 NONAME ; void CVPbkContactLinkArray::Delete(int) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@XZ @ 7 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(void) - ?ResetAndDestroy@CVPbkContactLinkArray@@QAEXXZ @ 8 NONAME ; void CVPbkContactLinkArray::ResetAndDestroy(void) - ?NewParameterL@TCCAFactory@@SAPAVMCCAParameter@@XZ @ 9 NONAME ; class MCCAParameter * TCCAFactory::NewParameterL(void) - ?NewL@CVPbkContactLinkArray@@SAPAV1@XZ @ 10 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewL(void) - ?NewConnectionL@TCCAFactory@@SAPAVMCCAConnection@@XZ @ 11 NONAME ; class MCCAConnection * TCCAFactory::NewConnectionL(void) - ?InitialiseViewL@CVIMPSTStorageManagerFactory@@SAXKABVTDesC16@@0@Z @ 12 NONAME ; void CVIMPSTStorageManagerFactory::InitialiseViewL(unsigned long, class TDesC16 const &, class TDesC16 const &) - ?AppendL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@@Z @ 13 NONAME ; void CVPbkContactLinkArray::AppendL(class MVPbkContactLink *) - ?ItemModelInterfaceL@CVIMPSTStorageManagerFactory@@SAPAVMVIMPSTStorageItemModel@@K@Z @ 14 NONAME ; class MVIMPSTStorageItemModel * CVIMPSTStorageManagerFactory::ItemModelInterfaceL(unsigned long) - ?Reset@CVPbkContactLinkArray@@QAEXXZ @ 15 NONAME ; void CVPbkContactLinkArray::Reset(void) - ?ContactListInterfaceL@CVIMPSTStorageManagerFactory@@SAPAVMVIMPSTStorageServiceView@@K@Z @ 16 NONAME ; class MVIMPSTStorageServiceView * CVIMPSTStorageManagerFactory::ContactListInterfaceL(unsigned long) - ?Release@CVIMPSTStorageManagerFactory@@SAHXZ @ 17 NONAME ; int CVIMPSTStorageManagerFactory::Release(void) - ?NewL@CVIMPSTCmdHandler@@SAPAV1@AAVMVIMPSTEngine@@@Z @ 18 NONAME ; class CVIMPSTCmdHandler * CVIMPSTCmdHandler::NewL(class MVIMPSTEngine &) - ?PackedBufferSize@CVPbkContactLinkArray@@QBEHXZ @ 19 NONAME ; int CVPbkContactLinkArray::PackedBufferSize(void) const - ?InsertL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@H@Z @ 20 NONAME ; void CVPbkContactLinkArray::InsertL(class MVPbkContactLink *, int) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@AAVRReadStream@@ABVMVPbkContactStoreList@@@Z @ 21 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class RReadStream &, class MVPbkContactStoreList const &) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/ReadMe.txt --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/ReadMe.txt Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -# -# 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: ReadMe.txt -# -# - -This Test Code is written in Stiff ( Unit) -Total Number of Test Cases - 65 -Branch Coverage - 56 -Function Coverage - 59 - -To update a Test Case: - Update t_vimpstcmdprocess_processarray_utest.cpp - Update t_vimpstcmdprocess_cmdfactory_utestCases.cpp diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/TestReport.txt --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/TestReport.txt Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,366 +0,0 @@ -# -# 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: TestReport.txt -# -# - -*************************************************************************** -Tuesday 06th October 2009 -4:25:11 pm --- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -SUMMARY: - Passed cases: 65 - Failed cases: 0 - Timeout cases: 0 - Crashed cases: 0 - Total cases: 65 - --- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -ENVIRONMENT INFO: -HW Info: - Manufacturer: 0x4, MachineUid: 0x10005f62, Model: 0x4d24 - HW Rev: 0x1, CPU: 0x2, CPU Speed: 2844 MHz - Language: 1 -SW Info: - SW Rev: 0x100, SW Build: 0x250 -Memory Info: - RAM: 48 MB, RAM Free: 18 MB - --- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -TESTCASE SUMMARY: -[vimpstcmdprocess_utest][][0] Title:[t_ProcArr_HandleChatMessageEventL] - StartTime: 4:25:40.9856 pm, EndTime: 4:25:40.9906 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][1] Title:[t_ProcArr_HandleAddRequestEventL] - StartTime: 4:25:41.0200 pm, EndTime: 4:25:41.0200 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][2] Title:[t_ProcArr_Count] - StartTime: 4:25:41.0300 pm, EndTime: 4:25:41.0300 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][3] Title:[t_ProcArr_IsSubServiceSupportedL] - StartTime: 4:25:41.0900 pm, EndTime: 4:25:41.0900 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][4] Title:[t_ProcArr_GetType] - StartTime: 4:25:41.1000 pm, EndTime: 4:25:41.1000 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][5] Title:[t_ProcArr_GetItemNameText] - StartTime: 4:25:41.1100 pm, EndTime: 4:25:41.1100 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][6] Title:[t_ProcArr_Set_Get_LoginStateL] - StartTime: 4:25:41.1200 pm, EndTime: 4:25:41.1200 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][7] Title:[t_ProcArr_ContactLink] - StartTime: 4:25:41.1300 pm, EndTime: 4:25:41.1300 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][8] Title:[t_ProcArr_GetOnlineStatusL] - StartTime: 4:25:41.1400 pm, EndTime: 4:25:41.1400 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][9] Title:[t_ProcArr_StatusTextL] - StartTime: 4:25:41.1550 pm, EndTime: 4:25:41.1550 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][10] Title:[t_ProcArr_IsMsgPending] - StartTime: 4:25:41.2350 pm, EndTime: 4:25:41.2350 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][11] Title:[t_ProcArr_FindAnyContact] - StartTime: 4:25:41.2450 pm, EndTime: 4:25:41.2450 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][12] Title:[t_ProcArr_FindAnyContactServiceField] - StartTime: 4:25:41.2600 pm, EndTime: 4:25:41.2600 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][13] Title:[t_ProcArr_FindAnyAddRequest] - StartTime: 4:25:41.2700 pm, EndTime: 4:25:41.2700 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][14] Title:[t_ProcArr_IsContactBlocked] - StartTime: 4:25:41.2800 pm, EndTime: 4:25:41.2800 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][15] Title:[t_ProcArr_IsConversationExistL] - StartTime: 4:25:41.2950 pm, EndTime: 4:25:41.2950 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][16] Title:[t_ProcArr_FindContactIndexL] - StartTime: 4:25:41.3050 pm, EndTime: 4:25:41.3050 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][17] Title:[t_ProcArr_GetItemUserId] - StartTime: 4:25:41.3150 pm, EndTime: 4:25:41.3150 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][18] Title:[t_ProcArr_LoginUserIdFromStoreL] - StartTime: 4:25:41.4100 pm, EndTime: 4:25:41.4100 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][19] Title:[t_ProcArr_OwnAvatarIndexL] - StartTime: 4:25:41.4200 pm, EndTime: 4:25:41.4200 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][20] Title:[t_ProcArr_OwnAvatarContentL] - StartTime: 4:25:41.4300 pm, EndTime: 4:25:41.4300 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][21] Title:[t_ProcArr_AvatarContent] - StartTime: 4:25:41.4400 pm, EndTime: 4:25:41.4450 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][22] Title:[t_ProcArr_SetAvatarIndex] - StartTime: 4:25:41.4550 pm, EndTime: 4:25:41.4550 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][23] Title:[t_ProcArr_FindArrayItem] - StartTime: 4:25:41.4650 pm, EndTime: 4:25:41.4650 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][24] Title:[t_ProcArr_GetSelectedItemIndex] - StartTime: 4:25:41.4750 pm, EndTime: 4:25:41.4750 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][25] Title:[t_ProcArr_HandleStorageChangeL] - StartTime: 4:25:41.4850 pm, EndTime: 4:25:41.4850 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][26] Title:[t_CreateCommand_login] - StartTime: 4:25:41.5900 pm, EndTime: 4:25:41.6506 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][27] Title:[t_CreateCommand_logout] - StartTime: 4:25:41.6606 pm, EndTime: 4:25:41.6656 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][28] Title:[t_CreateCommand_LaunchCCA] - StartTime: 4:25:41.7868 pm, EndTime: 4:25:41.7868 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][29] Title:[t_CreateCommand_AddContact] - StartTime: 4:25:41.7968 pm, EndTime: 4:25:41.8018 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][30] Title:[t_CreateCommand_DeleteContact] - StartTime: 4:25:41.8118 pm, EndTime: 4:25:41.8168 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][31] Title:[t_CreateCommand_ChangeOwnStatus] - StartTime: 4:25:41.9468 pm, EndTime: 4:25:41.9518 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][32] Title:[t_CreateCommand_ChangeOwnMessage] - StartTime: 4:25:41.9618 pm, EndTime: 4:25:41.9668 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][33] Title:[t_CreateCommand_Search] - StartTime: 4:25:41.9818 pm, EndTime: 4:25:42.1300 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][34] Title:[t_CreateCommand_FriendRejected] - StartTime: 4:25:42.1400 pm, EndTime: 4:25:42.1450 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][35] Title:[t_CreateCommand_ChangeOwnAvtar] - StartTime: 4:25:42.1550 pm, EndTime: 4:25:42.2850 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][36] Title:[t_CreateCommand_CloseConversation] - StartTime: 4:25:42.3000 pm, EndTime: 4:25:42.3000 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][37] Title:[t_CreateCommand_AddToPbk] - StartTime: 4:25:42.3150 pm, EndTime: 4:25:42.3150 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][38] Title:[t_CreateCommand_CancelLogin] - StartTime: 4:25:42.4550 pm, EndTime: 4:25:42.4650 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][39] Title:[t_CreateCommand_ProcessAcceptedContactNew] - StartTime: 4:25:42.4750 pm, EndTime: 4:25:42.4800 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][40] Title:[t_CreateCommand_ProcessSelectedContactNew] - StartTime: 4:25:42.4900 pm, EndTime: 4:25:42.6250 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][41] Title:[t_CreateCommand_ProcessAcceptedContactExist] - StartTime: 4:25:42.6406 pm, EndTime: 4:25:42.6406 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][42] Title:[t_CreateCommand_ProcessSelectedContactExist] - StartTime: 4:25:42.6556 pm, EndTime: 4:25:42.6606 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][43] Title:[t_ExeCommand_login] - StartTime: 4:25:42.8206 pm, EndTime: 4:25:42.8256 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][44] Title:[t_ExeCommand_logout] - StartTime: 4:25:42.8356 pm, EndTime: 4:25:42.8406 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][45] Title:[t_ExeCommand_LaunchCCA] - StartTime: 4:25:42.8556 pm, EndTime: 4:25:42.8556 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][46] Title:[t_ExeCommand_AddContact] - StartTime: 4:25:43.0100 pm, EndTime: 4:25:43.0150 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][47] Title:[t_ExeCommand_DeleteContact] - StartTime: 4:25:43.0250 pm, EndTime: 4:25:43.0300 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][48] Title:[t_ExeCommand_ChangeOwnStatus] - StartTime: 4:25:43.2050 pm, EndTime: 4:25:43.2100 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][49] Title:[t_ExeCommand_ChangeOwnMessage] - StartTime: 4:25:43.2250 pm, EndTime: 4:25:43.2300 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][50] Title:[t_ExeCommand_Search] - StartTime: 4:25:43.2400 pm, EndTime: 4:25:43.3900 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][51] Title:[t_ExeCommand_FriendRejected] - StartTime: 4:25:43.7156 pm, EndTime: 4:25:43.7156 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][52] Title:[t_ExeCommand_ChangeOwnAvtar] - StartTime: 4:25:43.7306 pm, EndTime: 4:25:43.7356 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][53] Title:[t_ExeCommand_CloseConversation] - StartTime: 4:25:43.7456 pm, EndTime: 4:25:43.7456 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][54] Title:[t_ExeCommand_AddToPbk] - StartTime: 4:25:43.7556 pm, EndTime: 4:25:43.7606 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][55] Title:[t_ExeCommand_CancelLogin] - StartTime: 4:25:43.7706 pm, EndTime: 4:25:43.7756 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][56] Title:[t_CreateCommand_BlockContact] - StartTime: 4:25:43.7856 pm, EndTime: 4:25:43.7856 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][57] Title:[t_CreateCommand_UnBlockContact] - StartTime: 4:25:43.8006 pm, EndTime: 4:25:43.8006 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][58] Title:[t_ExecuteCommand_BlockContact] - StartTime: 4:25:43.8106 pm, EndTime: 4:25:43.8156 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][59] Title:[t_ExecuteCommand_UnBlockContact] - StartTime: 4:25:43.8256 pm, EndTime: 4:25:43.8306 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][60] Title:[t_ExecuteCommand_FetchBlockContactList] - StartTime: 4:25:43.8406 pm, EndTime: 4:25:43.8456 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][61] Title:[t_ExecuteCommand_ProcessAcceptedContactNew] - StartTime: 4:25:43.8656 pm, EndTime: 4:25:43.8706 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][62] Title:[t_ExecuteCommand_ProcessSelectedContactNew] - StartTime: 4:25:43.8806 pm, EndTime: 4:25:43.8806 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][63] Title:[t_ExecuteCommand_ProcessAcceptedContactExist] - StartTime: 4:25:43.8956 pm, EndTime: 4:25:43.8956 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - -[vimpstcmdprocess_utest][][64] Title:[t_ExecuteCommand_ProcessSelectedContactExist] - StartTime: 4:25:43.9106 pm, EndTime: 4:25:43.9106 pm - Result: 0 [] ==> PASSED -- - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/blue.gif Binary file uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/blue.gif has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/ctc.css --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/ctc.css Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -/************************************************************************ -* CSS stylesheet file generated by ctc2html v2.4 -* Copyright (c) 2006-2008 Testwell Oy -************************************************************************/ - - .head1 {font-family: verdana, arial, helvetica, sans-serif; color: #000088; - font-size: 17pt; background-color: white; font-weight: bold;} - .head2 {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - font-size: 17pt; background-color: white;} - .head3 {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - font-size: 10pt; background-color: white;} - .black {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - font-size: 10pt; background-color: white;} - .blackDecoNo {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - text-decoration: none; font-size: 10pt; background-color: white;} - .red {font-family: verdana, arial, helvetica, sans-serif; color: #FF0000; - text-decoration: none; font-size: 10pt; background-color: white;} - .blue {font-family: verdana, arial, helvetica, sans-serif; color: #101080; - text-decoration: none; font-size: 10pt; background-color: white;} - .black_source {font-family: "courier new", courier, monospace; color: #000000; - font-size: 9pt; background-color: white;} - .red_source {font-family: "courier new", courier, monospace; color: #FF0000; - font-size: 9pt; background-color: white;} - .black_profile {font-family: "courier new", courier, monospace; color: #000000; - font-size: 9pt; background-color: #DFDFE5;} - .red_profile {font-family: "courier new", courier, monospace; color: #FF0000; - font-size: 9pt; background-color: #DFDFE5;} - a:hover {text-decoration: underline;} - table.sortable thead {font-family: verdana, arial, helvetica, sans-serif; color: #000000; - font-size: 10pt; background-color: white; - font-weight: bold; cursor: default;} - table.sortable th {border-bottom: thin solid black; padding-bottom: 0.20em; - padding-right: 0.20em;} - table.sortable td {padding-top: 0.20em; padding-right: 0.20em;} - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/ctc.js --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/ctc.js Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,353 +0,0 @@ -///////////////////////////////////////////////////////////////////////// -// Javascript file generated by ctc2html v2.4 -// Copyright (c) 2006-2008 Testwell Oy -///////////////////////////////////////////////////////////////////////// -target=location.hash; -function load(){ -if(target=="#a1"){ -parent.index.location="indexC.html#a1"; -parent.profile.location="indexD1.html"; -} -if(target=="#a2"){ -parent.index.location="indexC.html#a2"; -parent.profile.location="indexD2.html"; -} -if(target=="#a3"){ -parent.index.location="indexC.html#a3"; -parent.profile.location="indexD3.html"; -} -if(target=="#a4"){ -parent.index.location="indexC.html#a4"; -parent.profile.location="indexD4.html"; -} -if(target=="#a5"){ -parent.index.location="indexC.html#a5"; -parent.profile.location="indexD5.html"; -} -if(target=="#a6"){ -parent.index.location="indexC.html#a6"; -parent.profile.location="indexD6.html"; -} -if(target=="#a7"){ -parent.index.location="indexC.html#a7"; -parent.profile.location="indexD7.html"; -} -if(target=="#a8"){ -parent.index.location="indexC.html#a8"; -parent.profile.location="indexD8.html"; -} -if(target=="#a9"){ -parent.index.location="indexC.html#a9"; -parent.profile.location="indexD9.html"; -} -if(target=="#a10"){ -parent.index.location="indexC.html#a10"; -parent.profile.location="indexD10.html"; -} -if(target=="#a11"){ -parent.index.location="indexC.html#a11"; -parent.profile.location="indexD11.html"; -} -if(target=="#a12"){ -parent.index.location="indexC.html#a12"; -parent.profile.location="indexD12.html"; -} -if(target=="#a13"){ -parent.index.location="indexC.html#a13"; -parent.profile.location="indexD13.html"; -} -if(target=="#a14"){ -parent.index.location="indexC.html#a14"; -parent.profile.location="indexD14.html"; -} -if(target=="#a15"){ -parent.index.location="indexC.html#a15"; -parent.profile.location="indexD15.html"; -} -if(target=="#a16"){ -parent.index.location="indexC.html#a16"; -parent.profile.location="indexD16.html"; -} -if(target=="#a17"){ -parent.index.location="indexC.html#a17"; -parent.profile.location="indexD17.html"; -} -if(target=="#a18"){ -parent.index.location="indexC.html#a18"; -parent.profile.location="indexD18.html"; -} -if(target=="#a19"){ -parent.index.location="indexC.html#a19"; -parent.profile.location="indexD19.html"; -} -if(target=="#a20"){ -parent.index.location="indexC.html#a20"; -parent.profile.location="indexD20.html"; -} -if(target=="#a21"){ -parent.index.location="indexC.html#a21"; -parent.profile.location="indexD21.html"; -} -if(target=="#a22"){ -parent.index.location="indexC.html#a22"; -parent.profile.location="indexD22.html"; -} -if(target=="#a23"){ -parent.index.location="indexC.html#a23"; -parent.profile.location="indexD23.html"; -} -if(target=="#a24"){ -parent.index.location="indexC.html#a24"; -parent.profile.location="indexD24.html"; -} -if(target=="#a25"){ -parent.index.location="indexC.html#a25"; -parent.profile.location="indexD25.html"; -} -if(target=="#a26"){ -parent.index.location="indexC.html#a26"; -parent.profile.location="indexD26.html"; -} -if(target=="#a27"){ -parent.index.location="indexC.html#a27"; -parent.profile.location="indexD27.html"; -} -if(target=="#a28"){ -parent.index.location="indexC.html#a28"; -parent.profile.location="indexD28.html"; -} -if(target=="#a29"){ -parent.index.location="indexC.html#a29"; -parent.profile.location="indexD29.html"; -} -if(target=="#a30"){ -parent.index.location="indexC.html#a30"; -parent.profile.location="indexD30.html"; -} -if(target=="#a31"){ -parent.index.location="indexC.html#a31"; -parent.profile.location="indexD31.html"; -} -if(target=="#a32"){ -parent.index.location="indexC.html#a32"; -parent.profile.location="indexD32.html"; -} -if(target=="#a33"){ -parent.index.location="indexC.html#a33"; -parent.profile.location="indexD33.html"; -} -if(target=="#a34"){ -parent.index.location="indexC.html#a34"; -parent.profile.location="indexD34.html"; -} -if(target=="#a35"){ -parent.index.location="indexC.html#a35"; -parent.profile.location="indexD35.html"; -} -if(target=="#a36"){ -parent.index.location="indexC.html#a36"; -parent.profile.location="indexD36.html"; -} -if(target=="#a37"){ -parent.index.location="indexC.html#a37"; -parent.profile.location="indexD37.html"; -} -if(target=="#a38"){ -parent.index.location="indexC.html#a38"; -parent.profile.location="indexD38.html"; -} -if(target=="#a39"){ -parent.index.location="indexC.html#a39"; -parent.profile.location="indexD39.html"; -} -if(target=="#a40"){ -parent.index.location="indexC.html#a40"; -parent.profile.location="indexD40.html"; -} -if(target=="#a41"){ -parent.index.location="indexC.html#a41"; -parent.profile.location="indexD41.html"; -} -if(target=="#a42"){ -parent.index.location="indexC.html#a42"; -parent.profile.location="indexD42.html"; -} -if(target=="#a43"){ -parent.index.location="indexC.html#a43"; -parent.profile.location="indexD43.html"; -} -} -function load2(){ -if(target=="#ad1"){ -parent.index2.location="indexH.html#ad1"; -parent.functions.location="indexB1.html"; -} -if(target=="#ad1"){ -parent.index2.location="indexH.html#ad1"; -parent.functions.location="indexB1.html"; -} -if(target=="#ad1"){ -parent.index2.location="indexH.html#ad1"; -parent.functions.location="indexB1.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad2"){ -parent.index2.location="indexH.html#ad2"; -parent.functions.location="indexB2.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -if(target=="#ad3"){ -parent.index2.location="indexH.html#ad3"; -parent.functions.location="indexB3.html"; -} -} diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/index.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/index.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Files Summary

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- - - - - - - - - - - - -
Symbol file(s): MON.sym (Thu Sep 24 11:02:15 2009)
Data file(s): MON.dat (Thu Sep 24 11:40:46 2009)
Listing produced at: Thu Sep 24 11:40:57 2009
Coverage view: As instrumented
 
Input listing: profile.txt
Html generated at: Thu Sep 24 11:41:19 2009
ctc2html v2.4 options: -i profile.txt 
Threshold percent: 100 %

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  File

Directory: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src
100 %   0/ 0 t_vimpstcmdprocess_cmdfactory_utestcases.cpp
100 %   0/ 0 t_vimpstcmdprocess_processarray_utest.cpp
75 % - 33/ 44 vimpstcmdprocess_utest.cpp
75 % - 33/ 44 DIRECTORY OVERALL (\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src)
 
Directory: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub
0 % - 0/ 3 s_ccafactory.cpp
0 % - 0/ 39 s_cvpbkcontactlinkarray.cpp
55 % - 6/ 11 s_engineextentionfeatures.cpp
46 % - 6/ 13 s_enginesearchextention.cpp
0 % - 0/ 23 s_imsubservice.cpp
40 % - 2/ 5 s_mccaconnection.cpp
0 % - 0/ 12 s_mccaparameter.cpp
12 % - 2/ 17 s_mvpbkcontactlinkstub.cpp
100 %   5/ 5 s_processarrayobserver.cpp
57 % - 8/ 14 s_storageitemmodel.cpp
50 % - 1/ 2 s_vimpstcmdobserver.cpp
52 % - 33/ 63 s_vimpstengin.cpp
43 % - 24/ 56 s_vimpstenginepresencesubservice.cpp
0 % - 0/ 18 s_vimpstprocessarrayitem.cpp
78 % - 18/ 23 s_vimpststoragecontact.cpp
0 % - 0/ 27 s_vimpststoragecontactlist.cpp
63 % - 5/ 8 s_vimpststoragemanagerfactory.cpp
55 % - 30/ 55 s_vimpststorageserviceview.cpp
36 % - 140/ 394 DIRECTORY OVERALL (\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub)
 
Directory: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src
72 % - 26/ 36 cvimpstcmdaddcontact.cpp
93 % - 14/ 15 cvimpstcmdaddtopbk.cpp
79 % - 15/ 19 cvimpstcmdblockcontact.cpp
100 %   12/ 12 cvimpstcmdcancellogin.cpp
33 % - 6/ 18 cvimpstcmdcca.cpp
93 % - 14/ 15 cvimpstcmdchangeownavtar.cpp
93 % - 14/ 15 cvimpstcmdchangeownmessage.cpp
88 % - 15/ 17 cvimpstcmdchangeownstatus.cpp
93 % - 14/ 15 cvimpstcmdcloseconversation.cpp
43 % - 15/ 35 cvimpstcmddeletecontact.cpp
76 % - 44/ 58 cvimpstcmdfactory.cpp
92 % - 12/ 13 cvimpstcmdfetchblockedlist.cpp
0 % - 0/ 16 cvimpstcmdhandler.cpp
100 %   13/ 13 cvimpstcmdlogin.cpp
100 %   13/ 13 cvimpstcmdlogout.cpp
78 % - 42/ 54 cvimpstcmdprocessselectedcontact.cpp
93 % - 14/ 15 cvimpstcmdsearch.cpp
82 % - 14/ 17 cvimpstcmdunblockcontact.cpp
56 % - 285/ 511 cvimpstprocessarray.cpp
48 % - 30/ 62 cvimpstprocessarrayitem.cpp
41 % - 7/ 17 cvimpstprocessfriendrequestitem.cpp
93 % - 14/ 15 cvimstcmdfriendrequest.cpp
63 % - 633/ 1001 DIRECTORY OVERALL (\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src)
 

56 % - 806/ 1439 OVERALL

- - - - - - - -
Number of directories: 3
Number of monitored source files: 43
Number of functions: 497
Number of source lines: 8382
Number of measurement points: 1945
TER: 56% (decision)

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexA.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexA.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexB1.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexB1.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Functions Summary -   #1/3

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Index | No Index


-Directory: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src
-TER: 75 % ( 33/ 44)

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\t_vimpstcmdprocess_cmdfactory_utestcases.cpp
-Instrumentation mode: function-decision
-TER: 100 % (  0/  0)
-To files: Previous | -Next

- - - - - - - - -
TER % - covered/ all  Calls Line Function


100 %   0/ 0   t_vimpstcmdprocess_cmdfactory_utestcases.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\t_vimpstcmdprocess_processarray_utest.cpp
-Instrumentation mode: function-decision
-TER: 100 % (  0/  0)
-To files: Previous | -Next

- - - - - - - - -
TER % - covered/ all  Calls Line Function


100 %   0/ 0   t_vimpstcmdprocess_processarray_utest.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\vimpstcmdprocess_utest.cpp
-Instrumentation mode: function-decision
-TER: 75 % ( 33/ 44)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 102 Cvimpstcmdprocess_utest::Cvimpstcmdprocess_utest()
100 %   1/ 1 118 Cvimpstcmdprocess_utest::ConstructL()
100 %   2/ 2 136 Cvimpstcmdprocess_utest::NewL()
100 %   1/ 1 149 Cvimpstcmdprocess_utest::~Cvimpstcmdprocess_utest()
100 %   2/ 2 159 Cvimpstcmdprocess_utest::InitL()
100 %   2/ 2 175 Cvimpstcmdprocess_utest::GetTestCasesL()
53 % - 9/ 17 65 190 Cvimpstcmdprocess_utest::RunTestCaseL()
100 %   2/ 2 65 237 Cvimpstcmdprocess_utest::OOMTestQueryL()
0 % - 0/ 1 258 Cvimpstcmdprocess_utest::OOMTestInitializeL()
0 % - 0/ 1 276 Cvimpstcmdprocess_utest::OOMHandleWarningL()
0 % - 0/ 1 291 Cvimpstcmdprocess_utest::OOMTestFinalizeL()
100 %   1/ 1 302 Cvimpstcmdprocess_utest::SendTestModuleVersion()
100 %   2/ 2 323 LibEntryL()
100 %   2/ 2 335 SetRequirements()
100 %   8/ 8 196 386 Cvimpstcmdprocess_utest::MainTestL()

75 % - 33/ 44   vimpstcmdprocess_utest.cpp
 

75 % - 33/ 44   DIRECTORY OVERALL (\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src)

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexB2.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexB2.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,728 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Functions Summary -   #2/3

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Index | No Index


-Directory: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub
-TER: 36 % ( 140/ 394)

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_ccafactory.cpp
-Instrumentation mode: function-decision
-TER: 0 % (  0/  3)
-To files: Previous | -Next

- - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 2 32 TCCAFactory::NewParameterL()
0 % - 0/ 1 44 TCCAFactory::NewConnectionL()

0 % - 0/ 3   s_ccafactory.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_cvpbkcontactlinkarray.cpp
-Instrumentation mode: function-decision
-TER: 0 % (  0/ 39)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 2 27 CVPbkContactLinkArray::NewL()
0 % - 0/ 2 35 CVPbkContactLinkArray::NewLC()
0 % - 0/ 2 51 CVPbkContactLinkArray::NewLC()
0 % - 0/ 2 70 CVPbkContactLinkArray::NewLC()
0 % - 0/ 2 90 CVPbkContactLinkArray::NewLC()
0 % - 0/ 1 102 CVPbkContactLinkArray::~CVPbkContactLinkArray()
0 % - 0/ 1 114 CVPbkContactLinkArray::AppendL()
0 % - 0/ 1 128 CVPbkContactLinkArray::InsertL()
0 % - 0/ 1 136 CVPbkContactLinkArray::Remove()
0 % - 0/ 1 144 CVPbkContactLinkArray::Delete()
0 % - 0/ 1 149 CVPbkContactLinkArray::ResetAndDestroy()
0 % - 0/ 1 156 CVPbkContactLinkArray::Reset()
0 % - 0/ 2 161 CVPbkContactLinkArray::PackedBufferSize()
0 % - 0/ 2 164 CVPbkContactLinkArray::Count()
0 % - 0/ 2 165 CVPbkContactLinkArray::At()
0 % - 0/ 2 171 CVPbkContactLinkArray::Find()
0 % - 0/ 2 172 CVPbkContactLinkArray::PackLC()
0 % - 0/ 2 184 CVPbkContactLinkArray::Streamable()
0 % - 0/ 1 190 CVPbkContactLinkArray::CVPbkContactLinkArray()
0 % - 0/ 1 191 CVPbkContactLinkArray::ConstructL()
0 % - 0/ 1 192 CVPbkContactLinkArray::ConstructL()
0 % - 0/ 1 194 CVPbkContactLinkArray::ConstructL()
0 % - 0/ 2 196 CVPbkContactLinkArray::DoCalculatePackedBufferSizeV2()
0 % - 0/ 1 197 CVPbkContactLinkArray::DoFillPackedBufferV2L()
0 % - 0/ 1 198 CVPbkContactLinkArray::InternalizeFromBufferL()
0 % - 0/ 1 200 CVPbkContactLinkArray::DoInternalizeFromBufferL()
0 % - 0/ 1 202 CVPbkContactLinkArray::DoInternalizeFromBufferV2L()

0 % - 0/ 39   s_cvpbkcontactlinkarray.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_engineextentionfeatures.cpp
-Instrumentation mode: function-decision
-TER: 55 % (  6/ 11)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 23 extentionfeatures_stub::NewL()
0 % - 0/ 2 29 extentionfeatures_stub::IsSupported()
0 % - 0/ 1 38 extentionfeatures_stub::SetSupported()
100 %   2/ 2 49 extentionfeatures_stub::Type()
100 %   2/ 2 74 extentionfeatures_stub::AddServerContactL()
0 % - 0/ 2 81 extentionfeatures_stub::DeleteServerContactL()

55 % - 6/ 11   s_engineextentionfeatures.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_enginesearchextention.cpp
-Instrumentation mode: function-decision
-TER: 46 % (  6/ 13)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 23 searchextention_stub::NewL()
0 % - 0/ 2 29 searchextention_stub::IsSupported()
0 % - 0/ 1 38 searchextention_stub::SetSupported()
100 %   2/ 2 49 searchextention_stub::Type()
0 % - 0/ 1 54 searchextention_stub::RegisterObserver()
0 % - 0/ 1 60 searchextention_stub::UnRegisterObserver()
100 %   2/ 2 65 searchextention_stub::SearchContactsL()
0 % - 0/ 2 70 searchextention_stub::SubscribeForSearchKeysL()

46 % - 6/ 13   s_enginesearchextention.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_imsubservice.cpp
-Instrumentation mode: function-decision
-TER: 0 % (  0/ 23)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 1 34 CVIMPSTEngineImSubService_Stub::CVIMPSTEngineImSubService_Stub()
0 % - 0/ 1 42 CVIMPSTEngineImSubService_Stub::ConstructL()
0 % - 0/ 2 53 CVIMPSTEngineImSubService_Stub::NewL()
0 % - 0/ 2 65 CVIMPSTEngineImSubService_Stub::NewLC()
0 % - 0/ 1 79 CVIMPSTEngineImSubService_Stub::~CVIMPSTEngineImSubService_Stub()
0 % - 0/ 2 85 CVIMPSTEngineImSubService_Stub::SubServiceState()
0 % - 0/ 2 96 CVIMPSTEngineImSubService_Stub::Type()
0 % - 0/ 1 108 CVIMPSTEngineImSubService_Stub::RegisterChatObserver()
0 % - 0/ 1 116 CVIMPSTEngineImSubService_Stub::UnRegisterChatObserver()
0 % - 0/ 2 124 CVIMPSTEngineImSubService_Stub::GetUnreadCountL()
0 % - 0/ 5 134 CVIMPSTEngineImSubService_Stub::IsConversationExistL()
0 % - 0/ 1 145 CVIMPSTEngineImSubService_Stub::CloseConversationL()
0 % - 0/ 2 154 CVIMPSTEngineImSubService_Stub::GetOpenChatListL()

0 % - 0/ 23   s_imsubservice.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mccaconnection.cpp
-Instrumentation mode: function-decision
-TER: 40 % (  2/  5)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 28 MCCAConnectionStub::NewL()
0 % - 0/ 1 34 MCCAConnectionStub::Close()
0 % - 0/ 1 42 MCCAConnectionStub::LaunchApplicationL()
0 % - 0/ 1 49 MCCAConnectionStub::LaunchAppL()

40 % - 2/ 5   s_mccaconnection.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mccaparameter.cpp
-Instrumentation mode: function-decision
-TER: 0 % (  0/ 12)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 2 43 MCCAParameterstub::NewL()
0 % - 0/ 1 54 MCCAParameterstub::ConnectionFlag()
0 % - 0/ 1 64 MCCAParameterstub::ContactDataFlag()
0 % - 0/ 1 75 MCCAParameterstub::ContactDataL()
0 % - 0/ 1 85 MCCAParameterstub::LaunchedViewUid()
0 % - 0/ 1 95 MCCAParameterstub::Version()
0 % - 0/ 1 107 MCCAParameterstub::SetConnectionFlag()
0 % - 0/ 1 119 MCCAParameterstub::SetContactDataFlag()
0 % - 0/ 1 135 MCCAParameterstub::SetContactDataL()
0 % - 0/ 1 147 MCCAParameterstub::SetLaunchedViewUid()
0 % - 0/ 1 152 MCCAParameterstub::Close()

0 % - 0/ 12   s_mccaparameter.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mvpbkcontactlinkstub.cpp
-Instrumentation mode: function-decision
-TER: 12 % (  2/ 17)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 76 23 CVPbkContactLinkStub::NewL()
0 % - 0/ 2 33 CVPbkContactLinkStub::ContactStore()
0 % - 0/ 5 46 CVPbkContactLinkStub::IsSame()
0 % - 0/ 2 59 CVPbkContactLinkStub::RefersTo()
0 % - 0/ 2 69 CVPbkContactLinkStub::Streamable()
0 % - 0/ 2 80 CVPbkContactLinkStub::Packing()
0 % - 0/ 2 90 CVPbkContactLinkStub::CloneLC()

12 % - 2/ 17   s_mvpbkcontactlinkstub.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_processarrayobserver.cpp
-Instrumentation mode: function-decision
-TER: 100 % (  5/  5)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 22 vimpstprocessarrayobserver_stub::NewL()
100 %   1/ 1 32 28 vimpstprocessarrayobserver_stub::HandleAdditionL()
100 %   1/ 1 10 33 vimpstprocessarrayobserver_stub::HandleDeletionL()
100 %   1/ 1 37 vimpstprocessarrayobserver_stub::HandleAvatarChangeL()

100 %   5/ 5   s_processarrayobserver.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_storageitemmodel.cpp
-Instrumentation mode: function-decision
-TER: 57 % (  8/ 14)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 64 35 vimpststorageitemlist_stub::NewL()
100 %   2/ 2 66 43 vimpststorageitemlist_stub::Count()
100 %   2/ 2 66 54 vimpststorageitemlist_stub::Item()
100 %   2/ 2 69 vimpststorageitemlist_stub::IndexOfContact()
0 % - 0/ 2 82 vimpststorageitemlist_stub::IndexOfList()
0 % - 0/ 2 94 vimpststorageitemlist_stub::MdcaCount()
0 % - 0/ 2 105 vimpststorageitemlist_stub::MdcaPoint()

57 % - 8/ 14   s_storageitemmodel.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstcmdobserver.cpp
-Instrumentation mode: function-decision
-TER: 50 % (  1/  2)
-To files: Previous | -Next

- - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 34 23 vimpstcmdobserver_stub::CommandFinishedL()
0 % - 0/ 1 28 vimpstcmdobserver_stub::HandleCommandEventL()

50 % - 1/ 2   s_vimpstcmdobserver.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstengin.cpp
-Instrumentation mode: function-decision
-TER: 52 % ( 33/ 63)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 2 44 vimpstengine_stub::GetBrandInfoL()
100 %   2/ 2 118 54 vimpstengine_stub::ServiceState()
100 %   2/ 2 206 65 vimpstengine_stub::ServiceId()
100 %   2/ 2 83 vimpstengine_stub::IsSubServiceSupportedL()
0 % - 0/ 2 95 vimpstengine_stub::IsSubServiceEnabled()
100 %   1/ 1 68 106 vimpstengine_stub::ContactStoreIdL()
100 %   2/ 2 68 116 vimpstengine_stub::ServiceName()
100 %   1/ 1 68 126 vimpstengine_stub::RegisterServiceSessionObserverL()
100 %   1/ 1 46 136 vimpstengine_stub::UnRegisterServiceSessionObserver()
100 %   1/ 1 68 146 vimpstengine_stub::IntializeStorageL()
100 %   1/ 1 46 154 vimpstengine_stub::UnIntializeStorage()
70 % - 7/ 10 521 176 vimpstengine_stub::SubService()
50 % - 7/ 14 12 203 vimpstengine_stub::ExtentionFeatures()
100 %   2/ 2 273 vimpstengine_stub::Login()
100 %   1/ 1 281 vimpstengine_stub::LogoutL()
0 % - 0/ 1 293 vimpstengine_stub::DefaultDomainNameL()
100 %   2/ 2 302 vimpstengine_stub::IsBlockSupportedL()
0 % - 0/ 2 307 vimpstengine_stub::ChangeConnectionL()
0 % - 0/ 2 317 vimpstengine_stub::IsPasswordAvailableL()
0 % - 0/ 1 326 vimpstengine_stub::DeleteDataBaseL()
0 % - 0/ 5 333 vimpstengine_stub::GetPreseceSubService()
100 %   1/ 1 349 vimpstengine_stub::FetchBlockedListL()
0 % - 0/ 1 357 vimpstengine_stub::RegisterBlockedListObserver()
0 % - 0/ 2 363 vimpstengine_stub::GetOwnUserIdFromCChOrStorageL()
0 % - 0/ 1 369 vimpstengine_stub::RetriveContextIfCChEnabledL()
0 % - 0/ 1 373 vimpstengine_stub::SetOwnUserIdIfChangedL()

52 % - 33/ 63   s_vimpstengin.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstenginepresencesubservice.cpp
-Instrumentation mode: function-decision
-TER: 43 % ( 24/ 56)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 212 35 CVIMPSTEnginePresenceSubService_Stub::CVIMPSTEnginePresenceSubService_Stub()
100 %   1/ 1 212 43 CVIMPSTEnginePresenceSubService_Stub::ConstructL()
100 %   2/ 2 212 54 CVIMPSTEnginePresenceSubService_Stub::NewL()
100 %   2/ 2 212 66 CVIMPSTEnginePresenceSubService_Stub::NewLC()
0 % - 0/ 1 80 CVIMPSTEnginePresenceSubService_Stub::~CVIMPSTEnginePresenceSubService_Stub()
0 % - 0/ 1 86 CVIMPSTEnginePresenceSubService_Stub::FetchPresenceOfSingleContactL()
0 % - 0/ 2 96 CVIMPSTEnginePresenceSubService_Stub::SubServiceState()
100 %   2/ 2 208 107 CVIMPSTEnginePresenceSubService_Stub::Type()
0 % - 0/ 2 118 CVIMPSTEnginePresenceSubService_Stub::Enabled()
0 % - 0/ 1 129 CVIMPSTEnginePresenceSubService_Stub::SubscribePresenceOfSingleContactL()
0 % - 0/ 1 138 CVIMPSTEnginePresenceSubService_Stub::UnSubscribePresenceOfSingleContactL()
100 %   2/ 2 12 148 CVIMPSTEnginePresenceSubService_Stub::PublishOwnPresenceL()
0 % - 0/ 2 162 CVIMPSTEnginePresenceSubService_Stub::FetchPresenceFromCache()
0 % - 0/ 1 171 CVIMPSTEnginePresenceSubService_Stub::SubscribeToPresenceCacheL()
0 % - 0/ 1 181 CVIMPSTEnginePresenceSubService_Stub::UnSubscribeToPresenceCacheL()
0 % - 0/ 1 194 CVIMPSTEnginePresenceSubService_Stub::UnSubscribeForAuthorizationL()
0 % - 0/ 1 202 CVIMPSTEnginePresenceSubService_Stub::SubscribeForAuthorizationL()
100 %   2/ 2 209 CVIMPSTEnginePresenceSubService_Stub::SendPresenceGrantPresentityL()
0 % - 0/ 2 219 CVIMPSTEnginePresenceSubService_Stub::IsChangeOwnStatusSupported()
0 % - 0/ 2 229 CVIMPSTEnginePresenceSubService_Stub::IsStatusMsgSupported()
0 % - 0/ 2 239 CVIMPSTEnginePresenceSubService_Stub::IsAvatarSupported()
0 % - 0/ 1 248 CVIMPSTEnginePresenceSubService_Stub::SetAvatarSupported()
100 %   1/ 1 118 258 CVIMPSTEnginePresenceSubService_Stub::RegisterPresenceEventObserverL()
100 %   1/ 1 46 269 CVIMPSTEnginePresenceSubService_Stub::UnRegisterPresenceEventObserver()
50 % - 4/ 8 278 CVIMPSTEnginePresenceSubService_Stub::AddToBlockListL()
100 %   2/ 2 24 296 CVIMPSTEnginePresenceSubService_Stub::GetBlockedList()
0 % - 0/ 1 314 CVIMPSTEnginePresenceSubService_Stub::FetchBlockedListFromServerL()
50 % - 4/ 8 322 CVIMPSTEnginePresenceSubService_Stub::RemoveFromBlockListL()
0 % - 0/ 1 335 CVIMPSTEnginePresenceSubService_Stub::FetchPresenceOfSinleContactL()
0 % - 0/ 1 339 CVIMPSTEnginePresenceSubService_Stub::UpdatePresenceStateL()

43 % - 24/ 56   s_vimpstenginepresencesubservice.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstprocessarrayitem.cpp
-Instrumentation mode: function-decision
-TER: 0 % (  0/ 18)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 2 25 vimpstprocessarrayitem_stub::NewL()
0 % - 0/ 1 31 vimpstprocessarrayitem_stub::vimpstprocessarrayitem_stub()
0 % - 0/ 2 57 vimpstprocessarrayitem_stub::IsMsgPending()
0 % - 0/ 1 62 vimpstprocessarrayitem_stub::SetMsgPending()
0 % - 0/ 2 70 vimpstprocessarrayitem_stub::Type()
0 % - 0/ 2 91 vimpstprocessarrayitem_stub::GetItemIndex()
0 % - 0/ 2 99 vimpstprocessarrayitem_stub::ContactLink()
0 % - 0/ 1 110 vimpstprocessarrayitem_stub::SetItemIndex()
0 % - 0/ 2 119 vimpstprocessarrayitem_stub::GetItemUserId()
0 % - 0/ 2 128 vimpstprocessarrayitem_stub::AvatarIndex()
0 % - 0/ 1 137 vimpstprocessarrayitem_stub::SetAvatarIndex()

0 % - 0/ 18   s_vimpstprocessarrayitem.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragecontact.cpp
-Instrumentation mode: function-decision
-TER: 78 % ( 18/ 23)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 155 35 vimpststoragecontact_stub::NewL()
100 %   1/ 1 42 vimpststoragecontact_stub::~vimpststoragecontact_stub()
100 %   2/ 2 150 52 vimpststoragecontact_stub::UserId()
100 %   2/ 2 76 62 vimpststoragecontact_stub::Name()
100 %   2/ 2 67 71 vimpststoragecontact_stub::OnlineStatus()
0 % - 0/ 1 83 vimpststoragecontact_stub::SetOnlineStatus()
100 %   2/ 2 95 vimpststoragecontact_stub::StatusText()
0 % - 0/ 1 105 vimpststoragecontact_stub::SetStatusTextL()
0 % - 0/ 1 115 vimpststoragecontact_stub::SetAvatarContentL()
0 % - 0/ 1 126 vimpststoragecontact_stub::SetUserIdL()
0 % - 0/ 1 136 vimpststoragecontact_stub::SetNameL()
100 %   2/ 2 76 144 vimpststoragecontact_stub::ContactLink()
100 %   2/ 2 154 vimpststoragecontact_stub::AvatarContent()
100 %   1/ 1 163 vimpststoragecontact_stub::SetAvatarIndex()
100 %   2/ 2 172 vimpststoragecontact_stub::AvatarIndex()

78 % - 18/ 23   s_vimpststoragecontact.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragecontactlist.cpp
-Instrumentation mode: function-decision
-TER: 0 % (  0/ 27)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 2 28 vimpststoragecontactlist_stub::ListId()
0 % - 0/ 2 37 vimpststoragecontactlist_stub::DisplayName()
0 % - 0/ 1 45 vimpststoragecontactlist_stub::AddStorageContactToCacheL()
0 % - 0/ 1 54 vimpststoragecontactlist_stub::RemoveContactFromCacheL()
0 % - 0/ 1 63 vimpststoragecontactlist_stub::RemoveContactFromCacheL()
0 % - 0/ 1 71 vimpststoragecontactlist_stub::ContactCount()
0 % - 0/ 1 81 vimpststoragecontactlist_stub::FindContactIndex()
0 % - 0/ 1 91 vimpststoragecontactlist_stub::FindContactEntry()
0 % - 0/ 1 99 vimpststoragecontactlist_stub::Sort()
0 % - 0/ 1 108 vimpststoragecontactlist_stub::ResortContact()
0 % - 0/ 1 118 vimpststoragecontactlist_stub::FindIndexOfContact()
0 % - 0/ 2 129 vimpststoragecontactlist_stub::Count()
0 % - 0/ 1 139 vimpststoragecontactlist_stub::OnlineCount()
0 % - 0/ 1 148 vimpststoragecontactlist_stub::operator_[]()
0 % - 0/ 1 158 vimpststoragecontactlist_stub::OnlineContact()
0 % - 0/ 1 168 vimpststoragecontactlist_stub::FilteredContact()
0 % - 0/ 2 179 vimpststoragecontactlist_stub::FilteredCount()
0 % - 0/ 2 189 vimpststoragecontactlist_stub::FilterAllowsContact()
0 % - 0/ 1 199 vimpststoragecontactlist_stub::FindContact()
0 % - 0/ 1 207 vimpststoragecontactlist_stub::FindContactByContactLink()
0 % - 0/ 2 216 vimpststoragecontactlist_stub::FindContactByLinkL()

0 % - 0/ 27   s_vimpststoragecontactlist.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragemanagerfactory.cpp
-Instrumentation mode: function-decision
-TER: 63 % (  5/  8)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 1 36 CVIMPSTStorageManagerFactory::InitialiseLibraryL()
0 % - 0/ 2 46 CVIMPSTStorageManagerFactory::Release()
100 %   1/ 1 38 55 CVIMPSTStorageManagerFactory::InitialiseViewL()
100 %   2/ 2 77 68 CVIMPSTStorageManagerFactory::ContactListInterfaceL()
100 %   2/ 2 63 78 CVIMPSTStorageManagerFactory::ItemModelInterfaceL()

63 % - 5/ 8   s_vimpststoragemanagerfactory.cpp

-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststorageserviceview.cpp
-Instrumentation mode: function-decision
-TER: 55 % ( 30/ 55)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 78 23 vimpstserviceview_stub::NewL()
100 %   1/ 1 63 29 vimpstserviceview_stub::AddObserverL()
100 %   1/ 1 23 34 vimpstserviceview_stub::RemoveObserver()
100 %   5/ 5 19 40 vimpstserviceview_stub::FindContactByUserId()
0 % - 0/ 2 51 vimpstserviceview_stub::ListCount()
0 % - 0/ 2 56 vimpstserviceview_stub::ListAt()
0 % - 0/ 2 64 vimpstserviceview_stub::FindContactList()
0 % - 0/ 2 69 vimpstserviceview_stub::CreateContactListL()
0 % - 0/ 1 77 vimpstserviceview_stub::RemoveContactList()
0 % - 0/ 2 83 vimpstserviceview_stub::ContactCount()
0 % - 0/ 2 90 vimpstserviceview_stub::UpdatePresenceL()
0 % - 0/ 2 99 vimpstserviceview_stub::UpdateAvatarL()
0 % - 0/ 2 105 vimpstserviceview_stub::CreateNewContactL()
100 %   2/ 2 114 vimpstserviceview_stub::CreateNewContactFromRetrivedIdL()
100 %   2/ 2 119 vimpstserviceview_stub::DeleteNewContactFromRetrivedIdL()
0 % - 0/ 2 124 vimpstserviceview_stub::RemoveContactL()
0 % - 0/ 1 130 vimpstserviceview_stub::CreateNewFetchContactsL()
100 %   2/ 2 137 vimpstserviceview_stub::IsLocalStore()
100 %   2/ 2 143 vimpstserviceview_stub::RetriveLinkXSPIdsL()
90 % - 9/ 10 12 147 vimpstserviceview_stub::GetRetrieveXSPIdL()
100 %   2/ 2 167 vimpstserviceview_stub::FindContactByLink()
0 % - 0/ 1 173 vimpstserviceview_stub::Sort()
100 %   2/ 2 72 178 vimpstserviceview_stub::OwnContactL()
0 % - 0/ 1 185 vimpstserviceview_stub::DeleteDatabaseL()
0 % - 0/ 1 190 vimpstserviceview_stub::SetOwnUserIdL()
0 % - 0/ 1 195 vimpstserviceview_stub::SetUnnamedTextL()

55 % - 30/ 55   s_vimpststorageserviceview.cpp
 

36 % - 140/ 394   DIRECTORY OVERALL (\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub)

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexB3.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexB3.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,848 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Functions Summary -   #3/3

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Index | No Index


-Directory: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src
-TER: 63 % ( 633/ 1001)

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdaddcontact.cpp
-Instrumentation mode: function-decision
-TER: 72 % ( 26/ 36)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 50 CVIMPSTCmdAddContact::CVIMPSTCmdAddContact()
100 %   1/ 1 63 CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact()
100 %   2/ 2 72 CVIMPSTCmdAddContact::NewL()
100 %   1/ 1 84 CVIMPSTCmdAddContact::ConstructL()
60 % - 9/ 15 93 CVIMPSTCmdAddContact::ExecuteLD()
64 % - 7/ 11 152 CVIMPSTCmdAddContact::IsContactBlocked()
100 %   1/ 1 181 CVIMPSTCmdAddContact::AddObserver()
100 %   2/ 2 192 CVIMPSTCmdAddContact::CommandId()
100 %   2/ 2 201 CVIMPSTCmdAddContact::Result()

72 % - 26/ 36   cvimpstcmdaddcontact.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdaddtopbk.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 37 CVIMPSTCmdAddToPbk::CVIMPSTCmdAddToPbk()
100 %   1/ 1 50 CVIMPSTCmdAddToPbk::~CVIMPSTCmdAddToPbk()
100 %   2/ 2 59 CVIMPSTCmdAddToPbk::NewL()
100 %   1/ 1 71 CVIMPSTCmdAddToPbk::ConstructL()
80 % - 4/ 5 80 CVIMPSTCmdAddToPbk::ExecuteLD()
100 %   1/ 1 108 CVIMPSTCmdAddToPbk::AddObserver()
100 %   2/ 2 119 CVIMPSTCmdAddToPbk::CommandId()
100 %   2/ 2 128 CVIMPSTCmdAddToPbk::Result()

93 % - 14/ 15   cvimpstcmdaddtopbk.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdblockcontact.cpp
-Instrumentation mode: function-decision
-TER: 79 % ( 15/ 19)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 41 CVIMPSTCmdBlockContact::CVIMPSTCmdBlockContact()
100 %   1/ 1 56 CVIMPSTCmdBlockContact::~CVIMPSTCmdBlockContact()
100 %   2/ 2 65 CVIMPSTCmdBlockContact::NewL()
100 %   1/ 1 78 CVIMPSTCmdBlockContact::ConstructL()
56 % - 5/ 9 87 CVIMPSTCmdBlockContact::ExecuteLD()
100 %   1/ 1 125 CVIMPSTCmdBlockContact::AddObserver()
100 %   2/ 2 136 CVIMPSTCmdBlockContact::CommandId()
100 %   2/ 2 145 CVIMPSTCmdBlockContact::Result()

79 % - 15/ 19   cvimpstcmdblockcontact.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcancellogin.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 12/ 12)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 35 CVIMPSTCmdCancelLogin::CVIMPSTCmdCancelLogin()
100 %   1/ 1 46 CVIMPSTCmdCancelLogin::~CVIMPSTCmdCancelLogin()
100 %   2/ 2 54 CVIMPSTCmdCancelLogin::NewL()
100 %   3/ 3 67 CVIMPSTCmdCancelLogin::ExecuteLD()
100 %   1/ 1 93 CVIMPSTCmdCancelLogin::AddObserver()
100 %   2/ 2 104 CVIMPSTCmdCancelLogin::CommandId()
100 %   2/ 2 113 CVIMPSTCmdCancelLogin::Result()

100 %   12/ 12   cvimpstcmdcancellogin.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcca.cpp
-Instrumentation mode: function-decision
-TER: 33 % (  6/ 18)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 42 CVIMPSTCmdCCA::CVIMPSTCmdCCA()
0 % - 0/ 1 60 CVIMPSTCmdCCA::~CVIMPSTCmdCCA()
100 %   2/ 2 68 CVIMPSTCmdCCA::NewL()
100 %   1/ 1 82 CVIMPSTCmdCCA::ConstructL()
0 % - 0/ 3 93 CVIMPSTCmdCCA::ExecuteLD()
0 % - 0/ 1 114 CVIMPSTCmdCCA::AddObserver()
100 %   2/ 2 125 CVIMPSTCmdCCA::CommandId()
0 % - 0/ 2 134 CVIMPSTCmdCCA::Result()
0 % - 0/ 5 144 CVIMPSTCmdCCA::LaunchCcaL()

33 % - 6/ 18   cvimpstcmdcca.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownavtar.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 36 CVIMPSTCmdChangeOwnAvtar::CVIMPSTCmdChangeOwnAvtar()
100 %   1/ 1 49 CVIMPSTCmdChangeOwnAvtar::~CVIMPSTCmdChangeOwnAvtar()
100 %   2/ 2 58 CVIMPSTCmdChangeOwnAvtar::NewL()
100 %   1/ 1 70 CVIMPSTCmdChangeOwnAvtar::ConstructL()
80 % - 4/ 5 79 CVIMPSTCmdChangeOwnAvtar::ExecuteLD()
100 %   1/ 1 111 CVIMPSTCmdChangeOwnAvtar::AddObserver()
100 %   2/ 2 122 CVIMPSTCmdChangeOwnAvtar::CommandId()
100 %   2/ 2 131 CVIMPSTCmdChangeOwnAvtar::Result()

93 % - 14/ 15   cvimpstcmdchangeownavtar.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownmessage.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 37 CVIMPSTCmdChangeOwnMessage::CVIMPSTCmdChangeOwnMessage()
100 %   1/ 1 51 CVIMPSTCmdChangeOwnMessage::~CVIMPSTCmdChangeOwnMessage()
100 %   2/ 2 60 CVIMPSTCmdChangeOwnMessage::NewL()
100 %   1/ 1 72 CVIMPSTCmdChangeOwnMessage::ConstructL()
80 % - 4/ 5 81 CVIMPSTCmdChangeOwnMessage::ExecuteLD()
100 %   1/ 1 114 CVIMPSTCmdChangeOwnMessage::AddObserver()
100 %   2/ 2 125 CVIMPSTCmdChangeOwnMessage::CommandId()
100 %   2/ 2 134 CVIMPSTCmdChangeOwnMessage::Result()

93 % - 14/ 15   cvimpstcmdchangeownmessage.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownstatus.cpp
-Instrumentation mode: function-decision
-TER: 88 % ( 15/ 17)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 37 CVIMPSTCmdChangeOwnStatus::CVIMPSTCmdChangeOwnStatus()
100 %   1/ 1 51 CVIMPSTCmdChangeOwnStatus::~CVIMPSTCmdChangeOwnStatus()
100 %   2/ 2 60 CVIMPSTCmdChangeOwnStatus::NewL()
100 %   1/ 1 72 CVIMPSTCmdChangeOwnStatus::ConstructL()
71 % - 5/ 7 81 CVIMPSTCmdChangeOwnStatus::ExecuteLD()
100 %   1/ 1 124 CVIMPSTCmdChangeOwnStatus::AddObserver()
100 %   2/ 2 135 CVIMPSTCmdChangeOwnStatus::CommandId()
100 %   2/ 2 144 CVIMPSTCmdChangeOwnStatus::Result()

88 % - 15/ 17   cvimpstcmdchangeownstatus.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcloseconversation.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 37 CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation()
100 %   1/ 1 50 CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation()
100 %   2/ 2 59 CVIMPSTCmdCloseConversation::NewL()
100 %   1/ 1 71 CVIMPSTCmdCloseConversation::ConstructL()
80 % - 4/ 5 80 CVIMPSTCmdCloseConversation::ExecuteLD()
100 %   1/ 1 112 CVIMPSTCmdCloseConversation::AddObserver()
100 %   2/ 2 123 CVIMPSTCmdCloseConversation::CommandId()
100 %   2/ 2 132 CVIMPSTCmdCloseConversation::Result()

93 % - 14/ 15   cvimpstcmdcloseconversation.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmddeletecontact.cpp
-Instrumentation mode: function-decision
-TER: 43 % ( 15/ 35)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 49 CVIMPSTCmdDeleteContact::CVIMPSTCmdDeleteContact()
100 %   1/ 1 62 CVIMPSTCmdDeleteContact::~CVIMPSTCmdDeleteContact()
100 %   2/ 2 71 CVIMPSTCmdDeleteContact::NewL()
100 %   1/ 1 83 CVIMPSTCmdDeleteContact::ConstructL()
20 % - 5/ 25 92 CVIMPSTCmdDeleteContact::ExecuteLD()
100 %   1/ 1 159 CVIMPSTCmdDeleteContact::AddObserver()
100 %   2/ 2 170 CVIMPSTCmdDeleteContact::CommandId()
100 %   2/ 2 179 CVIMPSTCmdDeleteContact::Result()

43 % - 15/ 35   cvimpstcmddeletecontact.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdfactory.cpp
-Instrumentation mode: function-decision
-TER: 76 % ( 44/ 58)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 68 54 CVIMPSTCmdFactory::CVIMPSTCmdFactory()
100 %   1/ 1 68 64 CVIMPSTCmdFactory::ConstructL()
100 %   2/ 2 68 95 CVIMPSTCmdFactory::NewL()
100 %   1/ 1 46 109 CVIMPSTCmdFactory::~CVIMPSTCmdFactory()
93 % - 39/ 42 68 127 CVIMPSTCmdFactory::CreateCommandForIdL()
0 % - 0/ 3 255 CVIMPSTCmdFactory::HandleServiceEventL()
0 % - 0/ 3 270 CVIMPSTCmdFactory::AddObserverL()
0 % - 0/ 3 282 CVIMPSTCmdFactory::RemoveObserver()
0 % - 0/ 2 299 CVIMPSTCmdFactory::GetProcessInterface()

76 % - 44/ 58   cvimpstcmdfactory.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdfetchblockedlist.cpp
-Instrumentation mode: function-decision
-TER: 92 % ( 12/ 13)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 40 CVIMPSTCmdFetchBlockedContactList::CVIMPSTCmdFetchBlockedContactList()
100 %   1/ 1 51 CVIMPSTCmdFetchBlockedContactList::~CVIMPSTCmdFetchBlockedContactList()
100 %   2/ 2 60 CVIMPSTCmdFetchBlockedContactList::NewL()
100 %   1/ 1 71 CVIMPSTCmdFetchBlockedContactList::ConstructL()
67 % - 2/ 3 80 CVIMPSTCmdFetchBlockedContactList::ExecuteLD()
100 %   1/ 1 105 CVIMPSTCmdFetchBlockedContactList::AddObserver()
100 %   2/ 2 116 CVIMPSTCmdFetchBlockedContactList::CommandId()
100 %   2/ 2 125 CVIMPSTCmdFetchBlockedContactList::Result()

92 % - 12/ 13   cvimpstcmdfetchblockedlist.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdhandler.cpp
-Instrumentation mode: function-decision
-TER: 0 % (  0/ 16)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

0 % - 0/ 1 31 CVIMPSTCmdHandler::CVIMPSTCmdHandler()
0 % - 0/ 1 39 CVIMPSTCmdHandler::~CVIMPSTCmdHandler()
0 % - 0/ 2 48 CVIMPSTCmdHandler::NewL()
0 % - 0/ 1 61 CVIMPSTCmdHandler::ConstructL()
0 % - 0/ 7 70 CVIMPSTCmdHandler::HandleCommandL()
0 % - 0/ 1 94 CVIMPSTCmdHandler::RegisterEventObserverL()
0 % - 0/ 1 103 CVIMPSTCmdHandler::UnRegisterEventObserver()
0 % - 0/ 2 111 CVIMPSTCmdHandler::GetProcessInterface()

0 % - 0/ 16   cvimpstcmdhandler.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdlogin.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 13/ 13)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 35 CVIMPSTCmdLogin::CVIMPSTCmdLogin()
100 %   1/ 1 48 CVIMPSTCmdLogin::~CVIMPSTCmdLogin()
100 %   2/ 2 57 CVIMPSTCmdLogin::NewL()
100 %   1/ 1 69 CVIMPSTCmdLogin::ConstructL()
100 %   3/ 3 78 CVIMPSTCmdLogin::ExecuteLD()
100 %   1/ 1 103 CVIMPSTCmdLogin::AddObserver()
100 %   2/ 2 114 CVIMPSTCmdLogin::CommandId()
100 %   2/ 2 123 CVIMPSTCmdLogin::Result()

100 %   13/ 13   cvimpstcmdlogin.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdlogout.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 13/ 13)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 38 CVIMPSTCmdLogout::CVIMPSTCmdLogout()
100 %   1/ 1 51 CVIMPSTCmdLogout::~CVIMPSTCmdLogout()
100 %   2/ 2 60 CVIMPSTCmdLogout::NewL()
100 %   1/ 1 72 CVIMPSTCmdLogout::ConstructL()
100 %   3/ 3 81 CVIMPSTCmdLogout::ExecuteLD()
100 %   1/ 1 106 CVIMPSTCmdLogout::AddObserver()
100 %   2/ 2 117 CVIMPSTCmdLogout::CommandId()
100 %   2/ 2 126 CVIMPSTCmdLogout::Result()

100 %   13/ 13   cvimpstcmdlogout.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdprocessselectedcontact.cpp
-Instrumentation mode: function-decision
-TER: 78 % ( 42/ 54)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 49 CVIMPSTCmdProcessSelectedContact::CVIMPSTCmdProcessSelectedContact()
100 %   1/ 1 62 CVIMPSTCmdProcessSelectedContact::~CVIMPSTCmdProcessSelectedContact()
100 %   2/ 2 71 CVIMPSTCmdProcessSelectedContact::NewL()
100 %   1/ 1 83 CVIMPSTCmdProcessSelectedContact::ConstructL()
70 % - 23/ 33 92 CVIMPSTCmdProcessSelectedContact::ExecuteLD()
100 %   1/ 1 195 CVIMPSTCmdProcessSelectedContact::AddObserver()
100 %   2/ 2 206 CVIMPSTCmdProcessSelectedContact::CommandId()
100 %   2/ 2 215 CVIMPSTCmdProcessSelectedContact::Result()
82 % - 9/ 11 12 228 CVIMPSTCmdProcessSelectedContact::IsContactBlocked()

78 % - 42/ 54   cvimpstcmdprocessselectedcontact.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdsearch.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 36 CVIMPSTCmdSearch::CVIMPSTCmdSearch()
100 %   1/ 1 51 CVIMPSTCmdSearch::~CVIMPSTCmdSearch()
100 %   2/ 2 60 CVIMPSTCmdSearch::NewL()
100 %   1/ 1 73 CVIMPSTCmdSearch::ConstructL()
80 % - 4/ 5 82 CVIMPSTCmdSearch::ExecuteLD()
100 %   1/ 1 115 CVIMPSTCmdSearch::AddObserver()
100 %   2/ 2 126 CVIMPSTCmdSearch::CommandId()
100 %   2/ 2 135 CVIMPSTCmdSearch::Result()

93 % - 14/ 15   cvimpstcmdsearch.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdunblockcontact.cpp
-Instrumentation mode: function-decision
-TER: 82 % ( 14/ 17)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 38 CVIMPSTCmdUnBlockContact::CVIMPSTCmdUnBlockContact()
100 %   1/ 1 51 CVIMPSTCmdUnBlockContact::~CVIMPSTCmdUnBlockContact()
100 %   2/ 2 60 CVIMPSTCmdUnBlockContact::NewL()
100 %   1/ 1 72 CVIMPSTCmdUnBlockContact::ConstructL()
57 % - 4/ 7 81 CVIMPSTCmdUnBlockContact::ExecuteLD()
100 %   1/ 1 123 CVIMPSTCmdUnBlockContact::AddObserver()
100 %   2/ 2 134 CVIMPSTCmdUnBlockContact::CommandId()
100 %   2/ 2 143 CVIMPSTCmdUnBlockContact::Result()

82 % - 14/ 17   cvimpstcmdunblockcontact.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessarray.cpp
-Instrumentation mode: function-decision
-TER: 56 % (285/511)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 118 55 CVIMPSTProcessArray::CVIMPSTProcessArray()
56 % - 5/ 9 46 67 CVIMPSTProcessArray::~CVIMPSTProcessArray()
100 %   2/ 2 118 113 CVIMPSTProcessArray::NewL()
56 % - 5/ 9 118 130 CVIMPSTProcessArray::ConstructL()
62 % - 55/ 89 28 174 CVIMPSTProcessArray::HandleStorageChangeL()
100 %   1/ 1 539 CVIMPSTProcessArray::AddObserver()
0 % - 0/ 1 547 CVIMPSTProcessArray::RemoveObserver()
41 % - 7/ 17 556 CVIMPSTProcessArray::GetItemNameText()
75 % - 6/ 8 12 603 CVIMPSTProcessArray::GetItemUserId()
56 % - 5/ 9 631 CVIMPSTProcessArray::ContactLink()
0 % - 0/ 2 662 CVIMPSTProcessArray::Count()
100 %   2/ 2 671 CVIMPSTProcessArray::IsSubServiceSupportedL()
80 % - 8/ 10 32 680 CVIMPSTProcessArray::GetType()
59 % - 10/ 17 124 704 CVIMPSTProcessArray::FillItemL()
22 % - 8/ 37 126 765 CVIMPSTProcessArray::FillOwnDataL()
67 % - 2/ 3 124 900 CVIMPSTProcessArray::FillArrayL()
50 % - 3/ 6 124 920 CVIMPSTProcessArray::ResetArray()
67 % - 2/ 3 936 CVIMPSTProcessArray::SetLoginStateL()
100 %   2/ 2 955 CVIMPSTProcessArray::GetLoginState()
38 % - 5/ 13 964 CVIMPSTProcessArray::GetOnlineStatusL()
27 % - 4/ 15 999 CVIMPSTProcessArray::StatusTextL()
50 % - 4/ 8 1035 CVIMPSTProcessArray::RemoveFromUnknonOrInvitationListL()
77 % - 10/ 13 1061 CVIMPSTProcessArray::RemoveFromUnknonListL()
31 % - 4/ 13 1108 CVIMPSTProcessArray::RemoveFromInvitationListL()
0 % - 0/ 5 1153 CVIMPSTProcessArray::MapContactListPositions()
27 % - 3/ 11 1177 CVIMPSTProcessArray::GetAndCreateOpenChatListL()
86 % - 6/ 7 1223 CVIMPSTProcessArray::FindArrayItem()
59 % - 22/ 37 12 1244 CVIMPSTProcessArray::HandleChatMessageEventL()
65 % - 13/ 20 18 1340 CVIMPSTProcessArray::HandleAddRequestEventL()
40 % - 4/ 10 1402 CVIMPSTProcessArray::DoHandleUnKnownContactMessageL()
0 % - 0/ 7 1437 CVIMPSTProcessArray::IsMsgPending()
0 % - 0/ 7 1454 CVIMPSTProcessArray::IsConversationExist()
0 % - 0/ 5 1471 CVIMPSTProcessArray::ResetPendingMsg()
80 % - 4/ 5 1486 CVIMPSTProcessArray::ResetOpenConversationPendingMsg()
100 %   7/ 7 1502 CVIMPSTProcessArray::FindAnyContact()
100 %   7/ 7 1519 CVIMPSTProcessArray::FindAnyContactServiceField()
100 %   7/ 7 1535 CVIMPSTProcessArray::FindAndMarkContactAsOpenChat()
67 % - 4/ 6 68 1558 CVIMPSTProcessArray::IsUnreadMessageExistsL()
60 % - 3/ 5 71 1581 CVIMPSTProcessArray::IsConversationExistL()
100 %   5/ 5 1598 CVIMPSTProcessArray::FindContactIndexL()
67 % - 2/ 3 124 1615 CVIMPSTProcessArray::FillUnknownContactsL()
67 % - 2/ 3 124 1636 CVIMPSTProcessArray::FillAddRequestDataL()
40 % - 2/ 5 126 1657 CVIMPSTProcessArray::RemoveUnKnownContacts()
40 % - 2/ 5 124 1675 CVIMPSTProcessArray::RemoveAddRequestData()
60 % - 3/ 5 1695 CVIMPSTProcessArray::LoginUserIdFromStoreL()
57 % - 4/ 7 1710 CVIMPSTProcessArray::AvatarIndex()
60 % - 3/ 5 1733 CVIMPSTProcessArray::SetAvatarIndex()
57 % - 4/ 7 1754 CVIMPSTProcessArray::AvatarContent()
100 %   2/ 2 1775 CVIMPSTProcessArray::OwnAvatarContentL()
100 %   2/ 2 1786 CVIMPSTProcessArray::OwnAvatarIndexL()
0 % - 0/ 1 1796 CVIMPSTProcessArray::SetOwnAvatarIndexL()
100 %   7/ 7 20 1807 CVIMPSTProcessArray::FindAnyAddRequest()
100 %   7/ 7 1824 CVIMPSTProcessArray::GetSelectedItemIndex()
82 % - 9/ 11 1841 CVIMPSTProcessArray::IsContactBlocked()

56 % - 285/ 511   cvimpstprocessarray.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessarrayitem.cpp
-Instrumentation mode: function-decision
-TER: 48 % ( 30/ 62)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   2/ 2 86 29 CVIMPSTProcessContactItem::NewL()
100 %   1/ 1 86 45 CVIMPSTProcessContactItem::ConstructL()
100 %   1/ 1 86 57 CVIMPSTProcessContactItem::CVIMPSTProcessContactItem()
100 %   1/ 1 35 66 CVIMPSTProcessContactItem::~CVIMPSTProcessContactItem()
100 %   2/ 2 17 76 CVIMPSTProcessContactItem::Type()
0 % - 0/ 5 85 CVIMPSTProcessContactItem::GetItemNameText()
60 % - 3/ 5 15 98 CVIMPSTProcessContactItem::GetItemUserId()
100 %   1/ 1 110 CVIMPSTProcessContactItem::SetMsgPending()
0 % - 0/ 2 118 CVIMPSTProcessContactItem::IsMsgPending()
100 %   1/ 1 127 CVIMPSTProcessContactItem::SetConversationOpen()
0 % - 0/ 2 135 CVIMPSTProcessContactItem::IsConversationOpen()
0 % - 0/ 2 143 CVIMPSTProcessContactListItem::NewL()
0 % - 0/ 1 156 CVIMPSTProcessContactListItem::ConstructL()
0 % - 0/ 1 164 CVIMPSTProcessContactListItem::CVIMPSTProcessContactListItem()
0 % - 0/ 1 172 CVIMPSTProcessContactListItem::~CVIMPSTProcessContactListItem()
0 % - 0/ 2 182 CVIMPSTProcessContactListItem::Type()
0 % - 0/ 2 191 CVIMPSTProcessContactListItem::IsCollapsed()
0 % - 0/ 1 200 CVIMPSTProcessContactListItem::SetCollapsed()
0 % - 0/ 2 209 CVIMPSTProcessContactListItem::GetItemNameText()
0 % - 0/ 1 218 CVIMPSTProcessContactListItem::SetItemNameText()
100 %   2/ 2 135 227 CVIMPSTProcessOwnDataItem::NewL()
100 %   1/ 1 135 240 CVIMPSTProcessOwnDataItem::ConstructL()
100 %   1/ 1 135 248 CVIMPSTProcessOwnDataItem::CVIMPSTProcessOwnDataItem()
100 %   1/ 1 63 257 CVIMPSTProcessOwnDataItem::~CVIMPSTProcessOwnDataItem()
100 %   2/ 2 12 266 CVIMPSTProcessOwnDataItem::Type()
100 %   2/ 2 14 275 CVIMPSTProcessOwnDataItem::GetItemUserId()
100 %   1/ 1 288 CVIMPSTProcessUnknownContactItem::CVIMPSTProcessUnknownContactItem()
100 %   2/ 2 297 CVIMPSTProcessUnknownContactItem::NewL()
100 %   1/ 1 310 CVIMPSTProcessUnknownContactItem::ConstructL()
100 %   1/ 1 322 CVIMPSTProcessUnknownContactItem::~CVIMPSTProcessUnknownContactItem()
0 % - 0/ 2 332 CVIMPSTProcessUnknownContactItem::GetItemNameText()
0 % - 0/ 2 341 CVIMPSTProcessUnknownContactItem::Type()
100 %   2/ 2 349 CVIMPSTProcessUnknownContactItem::GetItemUserId()
100 %   1/ 1 358 CVIMPSTProcessUnknownContactItem::SetMsgPending()
0 % - 0/ 2 366 CVIMPSTProcessUnknownContactItem::IsMsgPending()
100 %   1/ 1 375 CVIMPSTProcessUnknownContactItem::SetConversationOpen()
0 % - 0/ 2 383 CVIMPSTProcessUnknownContactItem::IsConversationOpen()

48 % - 30/ 62   cvimpstprocessarrayitem.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessfriendrequestitem.cpp
-Instrumentation mode: function-decision
-TER: 41 % (  7/ 17)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 27 CVIMPSTProcessFriendRequestItem::CVIMPSTProcessFriendRequestItem()
100 %   2/ 2 36 CVIMPSTProcessFriendRequestItem::NewL()
100 %   1/ 1 49 CVIMPSTProcessFriendRequestItem::ConstructL()
100 %   1/ 1 61 CVIMPSTProcessFriendRequestItem::~CVIMPSTProcessFriendRequestItem()
0 % - 0/ 2 71 CVIMPSTProcessFriendRequestItem::GetItemNameText()
0 % - 0/ 2 80 CVIMPSTProcessFriendRequestItem::Type()
100 %   2/ 2 18 89 CVIMPSTProcessFriendRequestItem::GetItemUserId()
0 % - 0/ 1 98 CVIMPSTProcessFriendRequestItem::SetMsgPending()
0 % - 0/ 2 106 CVIMPSTProcessFriendRequestItem::IsMsgPending()
0 % - 0/ 1 114 CVIMPSTProcessFriendRequestItem::SetConversationOpen()
0 % - 0/ 2 122 CVIMPSTProcessFriendRequestItem::IsConversationOpen()

41 % - 7/ 17   cvimpstprocessfriendrequestitem.cpp

-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimstcmdfriendrequest.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)
-To files: Previous | -Next

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TER % - covered/ all  Calls Line Function

100 %   1/ 1 37 CVIMPSTCmdFriendRequest::CVIMPSTCmdFriendRequest()
100 %   1/ 1 50 CVIMPSTCmdFriendRequest::~CVIMPSTCmdFriendRequest()
100 %   2/ 2 59 CVIMPSTCmdFriendRequest::NewL()
100 %   1/ 1 71 CVIMPSTCmdFriendRequest::ConstructL()
80 % - 4/ 5 80 CVIMPSTCmdFriendRequest::ExecuteLD()
100 %   1/ 1 113 CVIMPSTCmdFriendRequest::AddObserver()
100 %   2/ 2 124 CVIMPSTCmdFriendRequest::CommandId()
100 %   2/ 2 133 CVIMPSTCmdFriendRequest::Result()

93 % - 14/ 15   cvimstcmdfriendrequest.cpp
 

63 % - 633/ 1001   DIRECTORY OVERALL (\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src)

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To directories: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexC.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexC.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,598 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -Index
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\t_vimpstcmdprocess_cmdfactory_utestcases.cpp
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\t_vimpstcmdprocess_processarray_utest.cpp
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\vimpstcmdprocess_utest.cpp
   Cvimpstcmdprocess_utest::Cvimpstcmdprocess_utest()
   Cvimpstcmdprocess_utest::ConstructL()
   Cvimpstcmdprocess_utest::NewL()
   Cvimpstcmdprocess_utest::~Cvimpstcmdprocess_utest()
   Cvimpstcmdprocess_utest::InitL()
   Cvimpstcmdprocess_utest::GetTestCasesL()
   Cvimpstcmdprocess_utest::RunTestCaseL()
   Cvimpstcmdprocess_utest::OOMTestQueryL()
   Cvimpstcmdprocess_utest::OOMTestInitializeL()
   Cvimpstcmdprocess_utest::OOMHandleWarningL()
   Cvimpstcmdprocess_utest::OOMTestFinalizeL()
   Cvimpstcmdprocess_utest::SendTestModuleVersion()
   LibEntryL()
   SetRequirements()
   Cvimpstcmdprocess_utest::MainTestL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_ccafactory.cpp
   TCCAFactory::NewParameterL()
   TCCAFactory::NewConnectionL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_cvpbkcontactlinkarray.cpp
   CVPbkContactLinkArray::NewL()
   CVPbkContactLinkArray::NewLC()
   CVPbkContactLinkArray::NewLC()
   CVPbkContactLinkArray::NewLC()
   CVPbkContactLinkArray::NewLC()
   CVPbkContactLinkArray::~CVPbkContactLinkArray()
   CVPbkContactLinkArray::AppendL()
   CVPbkContactLinkArray::InsertL()
   CVPbkContactLinkArray::Remove()
   CVPbkContactLinkArray::Delete()
   CVPbkContactLinkArray::ResetAndDestroy()
   CVPbkContactLinkArray::Reset()
   CVPbkContactLinkArray::PackedBufferSize()
   CVPbkContactLinkArray::Count()
   CVPbkContactLinkArray::At()
   CVPbkContactLinkArray::Find()
   CVPbkContactLinkArray::PackLC()
   CVPbkContactLinkArray::Streamable()
   CVPbkContactLinkArray::CVPbkContactLinkArray()
   CVPbkContactLinkArray::ConstructL()
   CVPbkContactLinkArray::ConstructL()
   CVPbkContactLinkArray::ConstructL()
   CVPbkContactLinkArray::DoCalculatePackedBufferSizeV2()
   CVPbkContactLinkArray::DoFillPackedBufferV2L()
   CVPbkContactLinkArray::InternalizeFromBufferL()
   CVPbkContactLinkArray::DoInternalizeFromBufferL()
   CVPbkContactLinkArray::DoInternalizeFromBufferV2L()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_engineextentionfeatures.cpp
   extentionfeatures_stub::NewL()
   extentionfeatures_stub::IsSupported()
   extentionfeatures_stub::SetSupported()
   extentionfeatures_stub::Type()
   extentionfeatures_stub::AddServerContactL()
   extentionfeatures_stub::DeleteServerContactL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_enginesearchextention.cpp
   searchextention_stub::NewL()
   searchextention_stub::IsSupported()
   searchextention_stub::SetSupported()
   searchextention_stub::Type()
   searchextention_stub::RegisterObserver()
   searchextention_stub::UnRegisterObserver()
   searchextention_stub::SearchContactsL()
   searchextention_stub::SubscribeForSearchKeysL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_imsubservice.cpp
   CVIMPSTEngineImSubService_Stub::CVIMPSTEngineImSubService_Stub()
   CVIMPSTEngineImSubService_Stub::ConstructL()
   CVIMPSTEngineImSubService_Stub::NewL()
   CVIMPSTEngineImSubService_Stub::NewLC()
   CVIMPSTEngineImSubService_Stub::~CVIMPSTEngineImSubService_Stub()
   CVIMPSTEngineImSubService_Stub::SubServiceState()
   CVIMPSTEngineImSubService_Stub::Type()
   CVIMPSTEngineImSubService_Stub::RegisterChatObserver()
   CVIMPSTEngineImSubService_Stub::UnRegisterChatObserver()
   CVIMPSTEngineImSubService_Stub::GetUnreadCountL()
   CVIMPSTEngineImSubService_Stub::IsConversationExistL()
   CVIMPSTEngineImSubService_Stub::CloseConversationL()
   CVIMPSTEngineImSubService_Stub::GetOpenChatListL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mccaconnection.cpp
   MCCAConnectionStub::NewL()
   MCCAConnectionStub::Close()
   MCCAConnectionStub::LaunchApplicationL()
   MCCAConnectionStub::LaunchAppL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mccaparameter.cpp
   MCCAParameterstub::NewL()
   MCCAParameterstub::ConnectionFlag()
   MCCAParameterstub::ContactDataFlag()
   MCCAParameterstub::ContactDataL()
   MCCAParameterstub::LaunchedViewUid()
   MCCAParameterstub::Version()
   MCCAParameterstub::SetConnectionFlag()
   MCCAParameterstub::SetContactDataFlag()
   MCCAParameterstub::SetContactDataL()
   MCCAParameterstub::SetLaunchedViewUid()
   MCCAParameterstub::Close()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mvpbkcontactlinkstub.cpp
   CVPbkContactLinkStub::NewL()
   CVPbkContactLinkStub::ContactStore()
   CVPbkContactLinkStub::IsSame()
   CVPbkContactLinkStub::RefersTo()
   CVPbkContactLinkStub::Streamable()
   CVPbkContactLinkStub::Packing()
   CVPbkContactLinkStub::CloneLC()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_processarrayobserver.cpp
   vimpstprocessarrayobserver_stub::NewL()
   vimpstprocessarrayobserver_stub::HandleAdditionL()
   vimpstprocessarrayobserver_stub::HandleDeletionL()
   vimpstprocessarrayobserver_stub::HandleAvatarChangeL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_storageitemmodel.cpp
   vimpststorageitemlist_stub::NewL()
   vimpststorageitemlist_stub::Count()
   vimpststorageitemlist_stub::Item()
   vimpststorageitemlist_stub::IndexOfContact()
   vimpststorageitemlist_stub::IndexOfList()
   vimpststorageitemlist_stub::MdcaCount()
   vimpststorageitemlist_stub::MdcaPoint()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstcmdobserver.cpp
   vimpstcmdobserver_stub::CommandFinishedL()
   vimpstcmdobserver_stub::HandleCommandEventL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstengin.cpp
   vimpstengine_stub::GetBrandInfoL()
   vimpstengine_stub::ServiceState()
   vimpstengine_stub::ServiceId()
   vimpstengine_stub::IsSubServiceSupportedL()
   vimpstengine_stub::IsSubServiceEnabled()
   vimpstengine_stub::ContactStoreIdL()
   vimpstengine_stub::ServiceName()
   vimpstengine_stub::RegisterServiceSessionObserverL()
   vimpstengine_stub::UnRegisterServiceSessionObserver()
   vimpstengine_stub::IntializeStorageL()
   vimpstengine_stub::UnIntializeStorage()
   vimpstengine_stub::SubService()
   vimpstengine_stub::ExtentionFeatures()
   vimpstengine_stub::Login()
   vimpstengine_stub::LogoutL()
   vimpstengine_stub::DefaultDomainNameL()
   vimpstengine_stub::IsBlockSupportedL()
   vimpstengine_stub::ChangeConnectionL()
   vimpstengine_stub::IsPasswordAvailableL()
   vimpstengine_stub::DeleteDataBaseL()
   vimpstengine_stub::GetPreseceSubService()
   vimpstengine_stub::FetchBlockedListL()
   vimpstengine_stub::RegisterBlockedListObserver()
   vimpstengine_stub::GetOwnUserIdFromCChOrStorageL()
   vimpstengine_stub::RetriveContextIfCChEnabledL()
   vimpstengine_stub::SetOwnUserIdIfChangedL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstenginepresencesubservice.cpp
   CVIMPSTEnginePresenceSubService_Stub::CVIMPSTEnginePresenceSubService_Stub()
   CVIMPSTEnginePresenceSubService_Stub::ConstructL()
   CVIMPSTEnginePresenceSubService_Stub::NewL()
   CVIMPSTEnginePresenceSubService_Stub::NewLC()
   CVIMPSTEnginePresenceSubService_Stub::~CVIMPSTEnginePresenceSubService_Stub()
   CVIMPSTEnginePresenceSubService_Stub::FetchPresenceOfSingleContactL()
   CVIMPSTEnginePresenceSubService_Stub::SubServiceState()
   CVIMPSTEnginePresenceSubService_Stub::Type()
   CVIMPSTEnginePresenceSubService_Stub::Enabled()
   CVIMPSTEnginePresenceSubService_Stub::SubscribePresenceOfSingleContactL()
   CVIMPSTEnginePresenceSubService_Stub::UnSubscribePresenceOfSingleContactL()
   CVIMPSTEnginePresenceSubService_Stub::PublishOwnPresenceL()
   CVIMPSTEnginePresenceSubService_Stub::FetchPresenceFromCache()
   CVIMPSTEnginePresenceSubService_Stub::SubscribeToPresenceCacheL()
   CVIMPSTEnginePresenceSubService_Stub::UnSubscribeToPresenceCacheL()
   CVIMPSTEnginePresenceSubService_Stub::UnSubscribeForAuthorizationL()
   CVIMPSTEnginePresenceSubService_Stub::SubscribeForAuthorizationL()
   CVIMPSTEnginePresenceSubService_Stub::SendPresenceGrantPresentityL()
   CVIMPSTEnginePresenceSubService_Stub::IsChangeOwnStatusSupported()
   CVIMPSTEnginePresenceSubService_Stub::IsStatusMsgSupported()
   CVIMPSTEnginePresenceSubService_Stub::IsAvatarSupported()
   CVIMPSTEnginePresenceSubService_Stub::SetAvatarSupported()
   CVIMPSTEnginePresenceSubService_Stub::RegisterPresenceEventObserverL()
   CVIMPSTEnginePresenceSubService_Stub::UnRegisterPresenceEventObserver()
   CVIMPSTEnginePresenceSubService_Stub::AddToBlockListL()
   CVIMPSTEnginePresenceSubService_Stub::GetBlockedList()
   CVIMPSTEnginePresenceSubService_Stub::FetchBlockedListFromServerL()
   CVIMPSTEnginePresenceSubService_Stub::RemoveFromBlockListL()
   CVIMPSTEnginePresenceSubService_Stub::FetchPresenceOfSinleContactL()
   CVIMPSTEnginePresenceSubService_Stub::UpdatePresenceStateL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstprocessarrayitem.cpp
   vimpstprocessarrayitem_stub::NewL()
   vimpstprocessarrayitem_stub::vimpstprocessarrayitem_stub()
   vimpstprocessarrayitem_stub::IsMsgPending()
   vimpstprocessarrayitem_stub::SetMsgPending()
   vimpstprocessarrayitem_stub::Type()
   vimpstprocessarrayitem_stub::GetItemIndex()
   vimpstprocessarrayitem_stub::ContactLink()
   vimpstprocessarrayitem_stub::SetItemIndex()
   vimpstprocessarrayitem_stub::GetItemUserId()
   vimpstprocessarrayitem_stub::AvatarIndex()
   vimpstprocessarrayitem_stub::SetAvatarIndex()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragecontact.cpp
   vimpststoragecontact_stub::NewL()
   vimpststoragecontact_stub::~vimpststoragecontact_stub()
   vimpststoragecontact_stub::UserId()
   vimpststoragecontact_stub::Name()
   vimpststoragecontact_stub::OnlineStatus()
   vimpststoragecontact_stub::SetOnlineStatus()
   vimpststoragecontact_stub::StatusText()
   vimpststoragecontact_stub::SetStatusTextL()
   vimpststoragecontact_stub::SetAvatarContentL()
   vimpststoragecontact_stub::SetUserIdL()
   vimpststoragecontact_stub::SetNameL()
   vimpststoragecontact_stub::ContactLink()
   vimpststoragecontact_stub::AvatarContent()
   vimpststoragecontact_stub::SetAvatarIndex()
   vimpststoragecontact_stub::AvatarIndex()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragecontactlist.cpp
   vimpststoragecontactlist_stub::ListId()
   vimpststoragecontactlist_stub::DisplayName()
   vimpststoragecontactlist_stub::AddStorageContactToCacheL()
   vimpststoragecontactlist_stub::RemoveContactFromCacheL()
   vimpststoragecontactlist_stub::RemoveContactFromCacheL()
   vimpststoragecontactlist_stub::ContactCount()
   vimpststoragecontactlist_stub::FindContactIndex()
   vimpststoragecontactlist_stub::FindContactEntry()
   vimpststoragecontactlist_stub::Sort()
   vimpststoragecontactlist_stub::ResortContact()
   vimpststoragecontactlist_stub::FindIndexOfContact()
   vimpststoragecontactlist_stub::Count()
   vimpststoragecontactlist_stub::OnlineCount()
   vimpststoragecontactlist_stub::operator_[]()
   vimpststoragecontactlist_stub::OnlineContact()
   vimpststoragecontactlist_stub::FilteredContact()
   vimpststoragecontactlist_stub::FilteredCount()
   vimpststoragecontactlist_stub::FilterAllowsContact()
   vimpststoragecontactlist_stub::FindContact()
   vimpststoragecontactlist_stub::FindContactByContactLink()
   vimpststoragecontactlist_stub::FindContactByLinkL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragemanagerfactory.cpp
   CVIMPSTStorageManagerFactory::InitialiseLibraryL()
   CVIMPSTStorageManagerFactory::Release()
   CVIMPSTStorageManagerFactory::InitialiseViewL()
   CVIMPSTStorageManagerFactory::ContactListInterfaceL()
   CVIMPSTStorageManagerFactory::ItemModelInterfaceL()
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststorageserviceview.cpp
   vimpstserviceview_stub::NewL()
   vimpstserviceview_stub::AddObserverL()
   vimpstserviceview_stub::RemoveObserver()
   vimpstserviceview_stub::FindContactByUserId()
   vimpstserviceview_stub::ListCount()
   vimpstserviceview_stub::ListAt()
   vimpstserviceview_stub::FindContactList()
   vimpstserviceview_stub::CreateContactListL()
   vimpstserviceview_stub::RemoveContactList()
   vimpstserviceview_stub::ContactCount()
   vimpstserviceview_stub::UpdatePresenceL()
   vimpstserviceview_stub::UpdateAvatarL()
   vimpstserviceview_stub::CreateNewContactL()
   vimpstserviceview_stub::CreateNewContactFromRetrivedIdL()
   vimpstserviceview_stub::DeleteNewContactFromRetrivedIdL()
   vimpstserviceview_stub::RemoveContactL()
   vimpstserviceview_stub::CreateNewFetchContactsL()
   vimpstserviceview_stub::IsLocalStore()
   vimpstserviceview_stub::RetriveLinkXSPIdsL()
   vimpstserviceview_stub::GetRetrieveXSPIdL()
   vimpstserviceview_stub::FindContactByLink()
   vimpstserviceview_stub::Sort()
   vimpstserviceview_stub::OwnContactL()
   vimpstserviceview_stub::DeleteDatabaseL()
   vimpstserviceview_stub::SetOwnUserIdL()
   vimpstserviceview_stub::SetUnnamedTextL()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdaddcontact.cpp
   CVIMPSTCmdAddContact::CVIMPSTCmdAddContact()
   CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact()
   CVIMPSTCmdAddContact::NewL()
   CVIMPSTCmdAddContact::ConstructL()
   CVIMPSTCmdAddContact::ExecuteLD()
   CVIMPSTCmdAddContact::IsContactBlocked()
   CVIMPSTCmdAddContact::AddObserver()
   CVIMPSTCmdAddContact::CommandId()
   CVIMPSTCmdAddContact::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdaddtopbk.cpp
   CVIMPSTCmdAddToPbk::CVIMPSTCmdAddToPbk()
   CVIMPSTCmdAddToPbk::~CVIMPSTCmdAddToPbk()
   CVIMPSTCmdAddToPbk::NewL()
   CVIMPSTCmdAddToPbk::ConstructL()
   CVIMPSTCmdAddToPbk::ExecuteLD()
   CVIMPSTCmdAddToPbk::AddObserver()
   CVIMPSTCmdAddToPbk::CommandId()
   CVIMPSTCmdAddToPbk::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdblockcontact.cpp
   CVIMPSTCmdBlockContact::CVIMPSTCmdBlockContact()
   CVIMPSTCmdBlockContact::~CVIMPSTCmdBlockContact()
   CVIMPSTCmdBlockContact::NewL()
   CVIMPSTCmdBlockContact::ConstructL()
   CVIMPSTCmdBlockContact::ExecuteLD()
   CVIMPSTCmdBlockContact::AddObserver()
   CVIMPSTCmdBlockContact::CommandId()
   CVIMPSTCmdBlockContact::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcancellogin.cpp
   CVIMPSTCmdCancelLogin::CVIMPSTCmdCancelLogin()
   CVIMPSTCmdCancelLogin::~CVIMPSTCmdCancelLogin()
   CVIMPSTCmdCancelLogin::NewL()
   CVIMPSTCmdCancelLogin::ExecuteLD()
   CVIMPSTCmdCancelLogin::AddObserver()
   CVIMPSTCmdCancelLogin::CommandId()
   CVIMPSTCmdCancelLogin::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcca.cpp
   CVIMPSTCmdCCA::CVIMPSTCmdCCA()
   CVIMPSTCmdCCA::~CVIMPSTCmdCCA()
   CVIMPSTCmdCCA::NewL()
   CVIMPSTCmdCCA::ConstructL()
   CVIMPSTCmdCCA::ExecuteLD()
   CVIMPSTCmdCCA::AddObserver()
   CVIMPSTCmdCCA::CommandId()
   CVIMPSTCmdCCA::Result()
   CVIMPSTCmdCCA::LaunchCcaL()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownavtar.cpp
   CVIMPSTCmdChangeOwnAvtar::CVIMPSTCmdChangeOwnAvtar()
   CVIMPSTCmdChangeOwnAvtar::~CVIMPSTCmdChangeOwnAvtar()
   CVIMPSTCmdChangeOwnAvtar::NewL()
   CVIMPSTCmdChangeOwnAvtar::ConstructL()
   CVIMPSTCmdChangeOwnAvtar::ExecuteLD()
   CVIMPSTCmdChangeOwnAvtar::AddObserver()
   CVIMPSTCmdChangeOwnAvtar::CommandId()
   CVIMPSTCmdChangeOwnAvtar::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownmessage.cpp
   CVIMPSTCmdChangeOwnMessage::CVIMPSTCmdChangeOwnMessage()
   CVIMPSTCmdChangeOwnMessage::~CVIMPSTCmdChangeOwnMessage()
   CVIMPSTCmdChangeOwnMessage::NewL()
   CVIMPSTCmdChangeOwnMessage::ConstructL()
   CVIMPSTCmdChangeOwnMessage::ExecuteLD()
   CVIMPSTCmdChangeOwnMessage::AddObserver()
   CVIMPSTCmdChangeOwnMessage::CommandId()
   CVIMPSTCmdChangeOwnMessage::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownstatus.cpp
   CVIMPSTCmdChangeOwnStatus::CVIMPSTCmdChangeOwnStatus()
   CVIMPSTCmdChangeOwnStatus::~CVIMPSTCmdChangeOwnStatus()
   CVIMPSTCmdChangeOwnStatus::NewL()
   CVIMPSTCmdChangeOwnStatus::ConstructL()
   CVIMPSTCmdChangeOwnStatus::ExecuteLD()
   CVIMPSTCmdChangeOwnStatus::AddObserver()
   CVIMPSTCmdChangeOwnStatus::CommandId()
   CVIMPSTCmdChangeOwnStatus::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcloseconversation.cpp
   CVIMPSTCmdCloseConversation::CVIMPSTCmdCloseConversation()
   CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation()
   CVIMPSTCmdCloseConversation::NewL()
   CVIMPSTCmdCloseConversation::ConstructL()
   CVIMPSTCmdCloseConversation::ExecuteLD()
   CVIMPSTCmdCloseConversation::AddObserver()
   CVIMPSTCmdCloseConversation::CommandId()
   CVIMPSTCmdCloseConversation::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmddeletecontact.cpp
   CVIMPSTCmdDeleteContact::CVIMPSTCmdDeleteContact()
   CVIMPSTCmdDeleteContact::~CVIMPSTCmdDeleteContact()
   CVIMPSTCmdDeleteContact::NewL()
   CVIMPSTCmdDeleteContact::ConstructL()
   CVIMPSTCmdDeleteContact::ExecuteLD()
   CVIMPSTCmdDeleteContact::AddObserver()
   CVIMPSTCmdDeleteContact::CommandId()
   CVIMPSTCmdDeleteContact::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdfactory.cpp
   CVIMPSTCmdFactory::CVIMPSTCmdFactory()
   CVIMPSTCmdFactory::ConstructL()
   CVIMPSTCmdFactory::NewL()
   CVIMPSTCmdFactory::~CVIMPSTCmdFactory()
   CVIMPSTCmdFactory::CreateCommandForIdL()
   CVIMPSTCmdFactory::HandleServiceEventL()
   CVIMPSTCmdFactory::AddObserverL()
   CVIMPSTCmdFactory::RemoveObserver()
   CVIMPSTCmdFactory::GetProcessInterface()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdfetchblockedlist.cpp
   CVIMPSTCmdFetchBlockedContactList::CVIMPSTCmdFetchBlockedContactList()
   CVIMPSTCmdFetchBlockedContactList::~CVIMPSTCmdFetchBlockedContactList()
   CVIMPSTCmdFetchBlockedContactList::NewL()
   CVIMPSTCmdFetchBlockedContactList::ConstructL()
   CVIMPSTCmdFetchBlockedContactList::ExecuteLD()
   CVIMPSTCmdFetchBlockedContactList::AddObserver()
   CVIMPSTCmdFetchBlockedContactList::CommandId()
   CVIMPSTCmdFetchBlockedContactList::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdhandler.cpp
   CVIMPSTCmdHandler::CVIMPSTCmdHandler()
   CVIMPSTCmdHandler::~CVIMPSTCmdHandler()
   CVIMPSTCmdHandler::NewL()
   CVIMPSTCmdHandler::ConstructL()
   CVIMPSTCmdHandler::HandleCommandL()
   CVIMPSTCmdHandler::RegisterEventObserverL()
   CVIMPSTCmdHandler::UnRegisterEventObserver()
   CVIMPSTCmdHandler::GetProcessInterface()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdlogin.cpp
   CVIMPSTCmdLogin::CVIMPSTCmdLogin()
   CVIMPSTCmdLogin::~CVIMPSTCmdLogin()
   CVIMPSTCmdLogin::NewL()
   CVIMPSTCmdLogin::ConstructL()
   CVIMPSTCmdLogin::ExecuteLD()
   CVIMPSTCmdLogin::AddObserver()
   CVIMPSTCmdLogin::CommandId()
   CVIMPSTCmdLogin::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdlogout.cpp
   CVIMPSTCmdLogout::CVIMPSTCmdLogout()
   CVIMPSTCmdLogout::~CVIMPSTCmdLogout()
   CVIMPSTCmdLogout::NewL()
   CVIMPSTCmdLogout::ConstructL()
   CVIMPSTCmdLogout::ExecuteLD()
   CVIMPSTCmdLogout::AddObserver()
   CVIMPSTCmdLogout::CommandId()
   CVIMPSTCmdLogout::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdprocessselectedcontact.cpp
   CVIMPSTCmdProcessSelectedContact::CVIMPSTCmdProcessSelectedContact()
   CVIMPSTCmdProcessSelectedContact::~CVIMPSTCmdProcessSelectedContact()
   CVIMPSTCmdProcessSelectedContact::NewL()
   CVIMPSTCmdProcessSelectedContact::ConstructL()
   CVIMPSTCmdProcessSelectedContact::ExecuteLD()
   CVIMPSTCmdProcessSelectedContact::AddObserver()
   CVIMPSTCmdProcessSelectedContact::CommandId()
   CVIMPSTCmdProcessSelectedContact::Result()
   CVIMPSTCmdProcessSelectedContact::IsContactBlocked()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdsearch.cpp
   CVIMPSTCmdSearch::CVIMPSTCmdSearch()
   CVIMPSTCmdSearch::~CVIMPSTCmdSearch()
   CVIMPSTCmdSearch::NewL()
   CVIMPSTCmdSearch::ConstructL()
   CVIMPSTCmdSearch::ExecuteLD()
   CVIMPSTCmdSearch::AddObserver()
   CVIMPSTCmdSearch::CommandId()
   CVIMPSTCmdSearch::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdunblockcontact.cpp
   CVIMPSTCmdUnBlockContact::CVIMPSTCmdUnBlockContact()
   CVIMPSTCmdUnBlockContact::~CVIMPSTCmdUnBlockContact()
   CVIMPSTCmdUnBlockContact::NewL()
   CVIMPSTCmdUnBlockContact::ConstructL()
   CVIMPSTCmdUnBlockContact::ExecuteLD()
   CVIMPSTCmdUnBlockContact::AddObserver()
   CVIMPSTCmdUnBlockContact::CommandId()
   CVIMPSTCmdUnBlockContact::Result()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessarray.cpp
   CVIMPSTProcessArray::CVIMPSTProcessArray()
   CVIMPSTProcessArray::~CVIMPSTProcessArray()
   CVIMPSTProcessArray::NewL()
   CVIMPSTProcessArray::ConstructL()
   CVIMPSTProcessArray::HandleStorageChangeL()
   CVIMPSTProcessArray::AddObserver()
   CVIMPSTProcessArray::RemoveObserver()
   CVIMPSTProcessArray::GetItemNameText()
   CVIMPSTProcessArray::GetItemUserId()
   CVIMPSTProcessArray::ContactLink()
   CVIMPSTProcessArray::Count()
   CVIMPSTProcessArray::IsSubServiceSupportedL()
   CVIMPSTProcessArray::GetType()
   CVIMPSTProcessArray::FillItemL()
   CVIMPSTProcessArray::FillOwnDataL()
   CVIMPSTProcessArray::FillArrayL()
   CVIMPSTProcessArray::ResetArray()
   CVIMPSTProcessArray::SetLoginStateL()
   CVIMPSTProcessArray::GetLoginState()
   CVIMPSTProcessArray::GetOnlineStatusL()
   CVIMPSTProcessArray::StatusTextL()
   CVIMPSTProcessArray::RemoveFromUnknonOrInvitationListL()
   CVIMPSTProcessArray::RemoveFromUnknonListL()
   CVIMPSTProcessArray::RemoveFromInvitationListL()
   CVIMPSTProcessArray::MapContactListPositions()
   CVIMPSTProcessArray::GetAndCreateOpenChatListL()
   CVIMPSTProcessArray::FindArrayItem()
   CVIMPSTProcessArray::HandleChatMessageEventL()
   CVIMPSTProcessArray::HandleAddRequestEventL()
   CVIMPSTProcessArray::DoHandleUnKnownContactMessageL()
   CVIMPSTProcessArray::IsMsgPending()
   CVIMPSTProcessArray::IsConversationExist()
   CVIMPSTProcessArray::ResetPendingMsg()
   CVIMPSTProcessArray::ResetOpenConversationPendingMsg()
   CVIMPSTProcessArray::FindAnyContact()
   CVIMPSTProcessArray::FindAnyContactServiceField()
   CVIMPSTProcessArray::FindAndMarkContactAsOpenChat()
   CVIMPSTProcessArray::IsUnreadMessageExistsL()
   CVIMPSTProcessArray::IsConversationExistL()
   CVIMPSTProcessArray::FindContactIndexL()
   CVIMPSTProcessArray::FillUnknownContactsL()
   CVIMPSTProcessArray::FillAddRequestDataL()
   CVIMPSTProcessArray::RemoveUnKnownContacts()
   CVIMPSTProcessArray::RemoveAddRequestData()
   CVIMPSTProcessArray::LoginUserIdFromStoreL()
   CVIMPSTProcessArray::AvatarIndex()
   CVIMPSTProcessArray::SetAvatarIndex()
   CVIMPSTProcessArray::AvatarContent()
   CVIMPSTProcessArray::OwnAvatarContentL()
   CVIMPSTProcessArray::OwnAvatarIndexL()
   CVIMPSTProcessArray::SetOwnAvatarIndexL()
   CVIMPSTProcessArray::FindAnyAddRequest()
   CVIMPSTProcessArray::GetSelectedItemIndex()
   CVIMPSTProcessArray::IsContactBlocked()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessarrayitem.cpp
   CVIMPSTProcessContactItem::NewL()
   CVIMPSTProcessContactItem::ConstructL()
   CVIMPSTProcessContactItem::CVIMPSTProcessContactItem()
   CVIMPSTProcessContactItem::~CVIMPSTProcessContactItem()
   CVIMPSTProcessContactItem::Type()
   CVIMPSTProcessContactItem::GetItemNameText()
   CVIMPSTProcessContactItem::GetItemUserId()
   CVIMPSTProcessContactItem::SetMsgPending()
   CVIMPSTProcessContactItem::IsMsgPending()
   CVIMPSTProcessContactItem::SetConversationOpen()
   CVIMPSTProcessContactItem::IsConversationOpen()
   CVIMPSTProcessContactListItem::NewL()
   CVIMPSTProcessContactListItem::ConstructL()
   CVIMPSTProcessContactListItem::CVIMPSTProcessContactListItem()
   CVIMPSTProcessContactListItem::~CVIMPSTProcessContactListItem()
   CVIMPSTProcessContactListItem::Type()
   CVIMPSTProcessContactListItem::IsCollapsed()
   CVIMPSTProcessContactListItem::SetCollapsed()
   CVIMPSTProcessContactListItem::GetItemNameText()
   CVIMPSTProcessContactListItem::SetItemNameText()
   CVIMPSTProcessOwnDataItem::NewL()
   CVIMPSTProcessOwnDataItem::ConstructL()
   CVIMPSTProcessOwnDataItem::CVIMPSTProcessOwnDataItem()
   CVIMPSTProcessOwnDataItem::~CVIMPSTProcessOwnDataItem()
   CVIMPSTProcessOwnDataItem::Type()
   CVIMPSTProcessOwnDataItem::GetItemUserId()
   CVIMPSTProcessUnknownContactItem::CVIMPSTProcessUnknownContactItem()
   CVIMPSTProcessUnknownContactItem::NewL()
   CVIMPSTProcessUnknownContactItem::ConstructL()
   CVIMPSTProcessUnknownContactItem::~CVIMPSTProcessUnknownContactItem()
   CVIMPSTProcessUnknownContactItem::GetItemNameText()
   CVIMPSTProcessUnknownContactItem::Type()
   CVIMPSTProcessUnknownContactItem::GetItemUserId()
   CVIMPSTProcessUnknownContactItem::SetMsgPending()
   CVIMPSTProcessUnknownContactItem::IsMsgPending()
   CVIMPSTProcessUnknownContactItem::SetConversationOpen()
   CVIMPSTProcessUnknownContactItem::IsConversationOpen()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessfriendrequestitem.cpp
   CVIMPSTProcessFriendRequestItem::CVIMPSTProcessFriendRequestItem()
   CVIMPSTProcessFriendRequestItem::NewL()
   CVIMPSTProcessFriendRequestItem::ConstructL()
   CVIMPSTProcessFriendRequestItem::~CVIMPSTProcessFriendRequestItem()
   CVIMPSTProcessFriendRequestItem::GetItemNameText()
   CVIMPSTProcessFriendRequestItem::Type()
   CVIMPSTProcessFriendRequestItem::GetItemUserId()
   CVIMPSTProcessFriendRequestItem::SetMsgPending()
   CVIMPSTProcessFriendRequestItem::IsMsgPending()
   CVIMPSTProcessFriendRequestItem::SetConversationOpen()
   CVIMPSTProcessFriendRequestItem::IsConversationOpen()
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimstcmdfriendrequest.cpp
   CVIMPSTCmdFriendRequest::CVIMPSTCmdFriendRequest()
   CVIMPSTCmdFriendRequest::~CVIMPSTCmdFriendRequest()
   CVIMPSTCmdFriendRequest::NewL()
   CVIMPSTCmdFriendRequest::ConstructL()
   CVIMPSTCmdFriendRequest::ExecuteLD()
   CVIMPSTCmdFriendRequest::AddObserver()
   CVIMPSTCmdFriendRequest::CommandId()
   CVIMPSTCmdFriendRequest::Result()
diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD1.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD1.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,755 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #1/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\t_vimpstcmdprocess_cmdfactory_utestcases.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 0/ 0)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : t_vimpstcmdprocess_cmdfactory_utestCases.cpp
  4 *  Part of     : vimpstcmdprocess_utest
  5 *
  6 *  Description : vimpstcmdprocess_utest test module.
  7 *  Version:   %version: 3 %
  8 *
  9 *  Copyright (C) 2002 - 2007 Nokia Corporation.
  10 *  This material, including documentation and any related 
  11 *  computer programs, is protected by copyright controlled by 
  12 *  Nokia Corporation. All rights are reserved. Copying, 
  13 *  including reproducing, storing,  adapting or translating, any 
  14 *  or all of this material requires the prior written consent of 
  15 *  Nokia Corporation. This material also contains confidential 
  16 *  information which may not be disclosed to others without the 
  17 *  prior written consent of Nokia Corporation.
  18 *
  19 * ============================================================================
  20 */
  21 
  22 /**
  23  * GLOBAL VARIABLES SECTION
  24  */
  25 #ifdef TEST_VAR_DECLARATIONS
  26    //Global variable declration    
  27 #endif
  28 /**
  29  * END OF GLOBAL VARIABLES SECTION
  30  */
  31 
  32 
  33 /**
  34  * TEST CASES SECTION
  35  */
  36 #ifdef TEST_CASES
  37 /**
  38  * STIF_SETUP defines activities needed before every test case.
  39  */
  40 STIF_SETUP
  41 {
  42 //No set up required
  43 }
  44 
  45 /**
  46  * STIF_TEARDOWN defines activities needed after every test case
  47  */
  48 STIF_TEARDOWN
  49 {
  50 
  51 }
  52 
  53 /**
  54  * STIF_TESTDEFINE defines a test case
  55  *
  56  *  Example test case - length of string is checked.
  57  *  The only argument of macro is a name of test case.
  58  */
  59 STIF_TESTDEFINE(t_CreateCommand_login)
  60 {
  61 vimpstengine_stub engin;
  62 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  63 TInt data  = 1;
  64 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELoginService,&data) ;
  65 //delete factory;
  66 //factory = NULL;
  67 TInt comm_sent = ELoginService;
  68 TInt comm_recev = commd->CommandId();
  69 commd->ExecuteLD();
  70 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  71 }
  72 
  73 
  74 STIF_TESTDEFINE(t_CreateCommand_logout)
  75 {
  76 vimpstengine_stub engin;
  77 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  78 TInt data  = 1;
  79 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELogoutService,&data) ;
  80 TInt comm_sent = ELogoutService;
  81 TInt comm_recev = commd->CommandId();
  82 commd->ExecuteLD();
  83 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  84 }
  85 
  86 STIF_TESTDEFINE(t_CreateCommand_LaunchCCA)
  87 {
  88 vimpstengine_stub engin;
  89 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  90 TLaunchCCAData data;
  91 data.iIndex = 1;
  92 data.iConnection = MCCAConnectionStub::NewL();
  93 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELaunchCCA,&data) ;
  94 TInt comm_sent = ELaunchCCA;
  95 TInt comm_recev = commd->CommandId();
  96 //commd->ExecuteLD();
  97 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  98 }
  99 
  100 STIF_TESTDEFINE(t_CreateCommand_AddContact)
  101 {
  102 vimpstengine_stub engin;
  103 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  104 TInt data  = 1;
  105 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EAddContact,&data) ;
  106 TInt comm_sent = EAddContact;
  107 TInt comm_recev = commd->CommandId();
  108 commd->ExecuteLD();
  109 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  110 }
  111 
  112 STIF_TESTDEFINE(t_CreateCommand_DeleteContact)
  113 {
  114 vimpstengine_stub engin;
  115 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  116 TInt data  = 1;
  117 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EDeleteContact,&data) ;
  118 delete factory;
  119 factory = NULL;
  120 TInt comm_sent = EDeleteContact;
  121 TInt comm_recev = commd->CommandId();
  122 commd->ExecuteLD();
  123 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  124 }
  125 
  126 
  127 STIF_TESTDEFINE(t_CreateCommand_ChangeOwnStatus)
  128 {
  129 vimpstengine_stub engin;
  130 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  131 TStatusAndStatusText status;
  132 _LIT(KStatusMsg,"away");
  133 status.iStatusText.Copy(KStatusMsg);
  134 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnStatus,&status) ;
  135 delete factory;
  136 factory = NULL;
  137 TInt comm_sent = EChangeOwnStatus;
  138 TInt comm_recev = commd->CommandId();
  139 commd->ExecuteLD();
  140 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  141 }
  142 
  143 STIF_TESTDEFINE(t_CreateCommand_ChangeOwnMessage)
  144 {
  145 vimpstengine_stub engin;
  146 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  147 
  148 TStatusAndStatusText status;
  149 _LIT(KStatusMsg,"away");
  150 status.iStatusText.Copy(KStatusMsg);
  151 
  152 TInt data  = 1;
  153 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnMessage,&status) ;
  154 delete factory;
  155 factory = NULL;
  156 TInt comm_sent = EChangeOwnMessage;
  157 TInt comm_recev = commd->CommandId();
  158 commd->ExecuteLD();
  159 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  160 }
  161 
  162 STIF_TESTDEFINE(t_CreateCommand_Search)
  163 {
  164 vimpstengine_stub engin;
  165 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  166 RArray<TVIMPSTSearchKeyData> aKeyDataArray;
  167 
  168 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ESearch,&aKeyDataArray) ;
  169 delete factory;
  170 factory = NULL;
  171 TInt comm_sent = ESearch;
  172 TInt comm_recev = commd->CommandId();
  173 commd->ExecuteLD();
  174 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  175 }
  176 
  177 
  178 STIF_TESTDEFINE(t_CreateCommand_FriendRejected)
  179 {
  180 vimpstengine_stub engin;
  181 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  182 _LIT(KContactId,"contact");
  183 TBufC<10> buf (KContactId);
  184 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EFriendRejected, &buf) ;
  185 delete factory;
  186 factory = NULL;
  187 TInt comm_sent = EFriendRejected;
  188 TInt comm_recev = commd->CommandId();
  189 commd->ExecuteLD();
  190 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  191 }
  192 
  193 
  194 STIF_TESTDEFINE(t_CreateCommand_ChangeOwnAvtar)
  195 {
  196 vimpstengine_stub engin;
  197 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  198 TAvatarData data;
  199 
  200 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnAvtar,&data) ;
  201 delete factory;
  202 factory = NULL;
  203 TInt comm_sent = EChangeOwnAvtar;
  204 TInt comm_recev = commd->CommandId();
  205 commd->ExecuteLD();
  206 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  207 }
  208 
  209 
  210 STIF_TESTDEFINE(t_CreateCommand_CloseConversation)
  211 {
  212 vimpstengine_stub engin;
  213 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  214 _LIT(KContactId,"contact");
  215 TBufC<10> buf(KContactId);
  216 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECloseConversation,&buf) ;
  217 delete factory;
  218 factory = NULL;
  219 TInt comm_sent = ECloseConversation;
  220 TInt comm_recev = commd->CommandId();
  221 commd->ExecuteLD();
  222 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  223 }
  224 
  225 
  226 STIF_TESTDEFINE(t_CreateCommand_AddToPbk)
  227 {
  228 vimpstengine_stub engin;
  229 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  230 
  231 vimpststoragecontact_stub store;
  232 
  233 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EAddToPbk,&store) ;
  234 delete factory;
  235 factory = NULL;
  236 TInt comm_sent = EAddToPbk;
  237 TInt comm_recev = commd->CommandId();
  238 commd->ExecuteLD();
  239 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  240 }
  241 
  242 
  243 STIF_TESTDEFINE(t_CreateCommand_CancelLogin)
  244 {
  245 vimpstengine_stub engin;
  246 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  247 TInt data  = 1;
  248 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECancelLogin,&data) ;
  249 delete factory;
  250 factory = NULL;
  251 TInt comm_sent = ECancelLogin;
  252 TInt comm_recev = commd->CommandId();
  253 commd->ExecuteLD();
  254 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  255 }
  256 
  257 STIF_TESTDEFINE(t_CreateCommand_ProcessAcceptedContactNew)
  258 {
  259 vimpstengine_stub engin;
  260 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  261 TVPbkSelectedData iSelectedData;
  262 
  263 _LIT8(KContactId,"contact");
  264 TPtrC8 buddy = KContactId;
  265 iSelectedData.iPackedLinks = buddy.AllocL();
  266 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessAcceptedContactNew,&iSelectedData) ;
  267 //delete factory;
  268 //factory = NULL;
  269 TInt comm_sent = ECmdProcessAcceptedContactNew;
  270 TInt comm_recev = commd->CommandId();
  271 commd->ExecuteLD();
  272 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  273 }
  274 STIF_TESTDEFINE(t_CreateCommand_ProcessSelectedContactNew)
  275 {
  276 vimpstengine_stub engin;
  277 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  278 TVPbkSelectedData iSelectedData;
  279 
  280 _LIT8(KContactId,"contact");
  281 TPtrC8 buddy = KContactId;
  282 iSelectedData.iPackedLinks = buddy.AllocL();
  283 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessSelectedContactNew,&iSelectedData) ;
  284 //delete factory;
  285 //factory = NULL;
  286 TInt comm_sent = ECmdProcessSelectedContactNew;
  287 TInt comm_recev = commd->CommandId();
  288 commd->ExecuteLD();
  289 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  290 }
  291 STIF_TESTDEFINE(t_CreateCommand_ProcessAcceptedContactExist)
  292 {
  293 vimpstengine_stub engin;
  294 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  295 TVPbkSelectedData iSelectedData;
  296 
  297 _LIT8(KContactId,"contact");
  298 TPtrC8 buddy = KContactId;
  299 iSelectedData.iPackedLinks = buddy.AllocL();
  300 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessAcceptedContactExist,&iSelectedData) ;
  301 //delete factory;
  302 //factory = NULL;
  303 TInt comm_sent = ECmdProcessAcceptedContactExist;
  304 TInt comm_recev = commd->CommandId();
  305 commd->ExecuteLD();
  306 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  307 }
  308 STIF_TESTDEFINE(t_CreateCommand_ProcessSelectedContactExist)
  309 {
  310 vimpstengine_stub engin;
  311 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  312 TVPbkSelectedData iSelectedData;
  313 
  314 _LIT8(KContactId,"contact");
  315 TPtrC8 buddy = KContactId;
  316 iSelectedData.iPackedLinks = buddy.AllocL();
  317 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessSelectedContactExist,&iSelectedData) ;
  318 //delete factory;
  319 //factory = NULL;
  320 TInt comm_sent = ECmdProcessSelectedContactExist;
  321 TInt comm_recev = commd->CommandId();
  322 commd->ExecuteLD();
  323 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  324 }
  325 
  326 //============================ExecuteLD---------------------
  327 
  328 STIF_TESTDEFINE(t_ExeCommand_login)
  329 {
  330 vimpstengine_stub engin;
  331 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  332 TInt data  = 1;
  333 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELoginService,&data) ;
  334 TInt comm_sent = ELoginService;
  335 TInt comm_recev = commd->CommandId();
  336 vimpstcmdobserver_stub ob;
  337 commd->AddObserver(ob);
  338 commd->ExecuteLD();
  339 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  340 }
  341 
  342 
  343 STIF_TESTDEFINE(t_ExeCommand_logout)
  344 {
  345 vimpstengine_stub engin;
  346 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  347 TInt data  = 1;
  348 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELogoutService,&data) ;
  349 TInt comm_sent = ELogoutService;
  350 TInt comm_recev = commd->CommandId();
  351 vimpstcmdobserver_stub ob;
  352 commd->AddObserver(ob);
  353 commd->ExecuteLD();
  354 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  355 }
  356 
  357 STIF_TESTDEFINE(t_ExeCommand_LaunchCCA)
  358 {/*
  359 vimpstengine_stub engin;
  360 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  361 TLaunchCCAData data;
  362 data.iIndex = 2;
  363 //TInt data  = 1;
  364 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELaunchCCA,&data) ;
  365 TInt comm_sent = ELaunchCCA;
  366 TInt comm_recev = commd->CommandId();
  367 vimpstcmdobserver_stub ob;
  368 commd->AddObserver(ob);
  369 //commd->iIndex = 0;
  370 commd->ExecuteLD();
  371 STIF_ASSERT_EQUALS(comm_sent, comm_recev );*/
  372 }
  373 STIF_TESTDEFINE(t_ExeCommand_AddContact)
  374 {
  375 vimpstengine_stub engin;
  376 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  377 TInt data  = 1;
  378 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EAddContact,&data) ;
  379 TInt comm_sent = EAddContact;
  380 TInt comm_recev = commd->CommandId();
  381 vimpstcmdobserver_stub ob;
  382 commd->AddObserver(ob);
  383 commd->ExecuteLD();
  384 
  385 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  386 }
  387 
  388 STIF_TESTDEFINE(t_ExeCommand_DeleteContact)
  389 {
  390 vimpstengine_stub engin;
  391 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  392 TInt data  = 1;
  393 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EDeleteContact,&data) ;
  394 delete factory;
  395 factory = NULL;
  396 TInt comm_sent = EDeleteContact;
  397 TInt comm_recev = commd->CommandId();
  398 vimpstcmdobserver_stub ob;
  399 commd->AddObserver(ob);
  400 commd->ExecuteLD();
  401 
  402 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  403 }
  404 
  405 
  406 STIF_TESTDEFINE(t_ExeCommand_ChangeOwnStatus)
  407 {
  408 vimpstengine_stub engin;
  409 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  410 TStatusAndStatusText status;
  411 _LIT(KStatusMsg,"away");
  412 status.iStatusText.Copy(KStatusMsg);
  413 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnStatus,&status) ;
  414 delete factory;
  415 factory = NULL;
  416 TInt comm_sent = EChangeOwnStatus;
  417 TInt comm_recev = commd->CommandId();
  418 vimpstcmdobserver_stub ob;
  419 commd->AddObserver(ob);
  420 commd->ExecuteLD();
  421 
  422 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  423 }
  424 
  425 STIF_TESTDEFINE(t_ExeCommand_ChangeOwnMessage)
  426 {
  427 vimpstengine_stub engin;
  428 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  429 
  430 TStatusAndStatusText status;
  431 _LIT(KStatusMsg,"away");
  432 status.iStatusText.Copy(KStatusMsg);
  433 
  434 TInt data  = 1;
  435 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnMessage,&status) ;
  436 delete factory;
  437 factory = NULL;
  438 TInt comm_sent = EChangeOwnMessage;
  439 TInt comm_recev = commd->CommandId();
  440 vimpstcmdobserver_stub ob;
  441 commd->AddObserver(ob);
  442 commd->ExecuteLD();
  443 
  444 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  445 }
  446 
  447 STIF_TESTDEFINE(t_ExeCommand_Search)
  448 {
  449 vimpstengine_stub engin;
  450 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  451 RArray<TVIMPSTSearchKeyData> aKeyDataArray;
  452 
  453 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ESearch,&aKeyDataArray) ;
  454 delete factory;
  455 factory = NULL;
  456 TInt comm_sent = ESearch;
  457 TInt comm_recev = commd->CommandId();
  458 vimpstcmdobserver_stub ob;
  459 commd->AddObserver(ob);
  460 commd->ExecuteLD();
  461 
  462 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  463 }
  464 
  465 
  466 STIF_TESTDEFINE(t_ExeCommand_FriendRejected)
  467 {
  468 vimpstengine_stub engin;
  469 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  470 _LIT(KContactId,"contact");
  471 TBufC<10> buf (KContactId);
  472 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EFriendRejected, &buf) ;
  473 delete factory;
  474 factory = NULL;
  475 TInt comm_sent = EFriendRejected;
  476 TInt comm_recev = commd->CommandId();
  477 vimpstcmdobserver_stub ob;
  478 commd->AddObserver(ob);
  479 commd->ExecuteLD();
  480 
  481 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  482 }
  483 
  484 
  485 STIF_TESTDEFINE(t_ExeCommand_ChangeOwnAvtar)
  486 {
  487 vimpstengine_stub engin;
  488 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  489 TAvatarData data;
  490 
  491 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnAvtar,&data) ;
  492 delete factory;
  493 factory = NULL;
  494 TInt comm_sent = EChangeOwnAvtar;
  495 TInt comm_recev = commd->CommandId();
  496 vimpstcmdobserver_stub ob;
  497 commd->AddObserver(ob);
  498 commd->ExecuteLD();
  499 
  500 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  501 }
  502 
  503 
  504 STIF_TESTDEFINE(t_ExeCommand_CloseConversation)
  505 {
  506 vimpstengine_stub engin;
  507 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  508 _LIT(KContactId,"contact");
  509 TBufC<10> buf(KContactId);
  510 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECloseConversation,&buf) ;
  511 delete factory;
  512 factory = NULL;
  513 TInt comm_sent = ECloseConversation;
  514 TInt comm_recev = commd->CommandId();
  515 vimpstcmdobserver_stub ob;
  516 commd->AddObserver(ob);
  517 commd->ExecuteLD();
  518 
  519 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  520 }
  521 
  522 
  523 STIF_TESTDEFINE(t_ExeCommand_AddToPbk)
  524 {
  525 vimpstengine_stub engin;
  526 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  527 
  528 vimpststoragecontact_stub store;
  529 
  530 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EAddToPbk,&store) ;
  531 delete factory;
  532 factory = NULL;
  533 TInt comm_sent = EAddToPbk;
  534 TInt comm_recev = commd->CommandId();
  535 vimpstcmdobserver_stub ob;
  536 commd->AddObserver(ob);
  537 commd->ExecuteLD();
  538 
  539 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  540 }
  541 
  542 
  543 STIF_TESTDEFINE(t_ExeCommand_CancelLogin)
  544 {
  545 vimpstengine_stub engin;
  546 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  547 TInt data  = 1;
  548 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECancelLogin,&data) ;
  549 delete factory;
  550 factory = NULL;
  551 TInt comm_sent = ECancelLogin;
  552 TInt comm_recev = commd->CommandId();
  553 vimpstcmdobserver_stub ob;
  554 commd->AddObserver(ob);
  555 commd->ExecuteLD();
  556 
  557 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  558 }
  559 
  560 //Test case for Block/unblock...
  561 
  562 STIF_TESTDEFINE(t_CreateCommand_BlockContact)
  563 {
  564 vimpstengine_stub engin;
  565 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  566 _LIT(KContactId,"contact");
  567 TBufC<10> buf (KContactId);
  568 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdBlockContact, &buf) ;
  569 delete factory;
  570 factory = NULL;
  571 TInt comm_sent = ECmdBlockContact;
  572 TInt comm_recev = commd->CommandId();
  573 
  574 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  575 }
  576 
  577 STIF_TESTDEFINE(t_CreateCommand_UnBlockContact)
  578 {
  579 vimpstengine_stub engin;
  580 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  581 _LIT(KContactId,"contact");
  582 TBufC<10> buf (KContactId);
  583 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdUnBlockContact, &buf) ;
  584 delete factory;
  585 factory = NULL;
  586 TInt comm_sent = ECmdUnBlockContact;
  587 TInt comm_recev = commd->CommandId();
  588 
  589 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  590 }
  591 
  592 STIF_TESTDEFINE(t_ExecuteCommand_BlockContact)
  593 {
  594 vimpstengine_stub engin;
  595 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  596 _LIT(KContactId,"contact");
  597 TBufC<10> buf (KContactId);
  598 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdBlockContact, &buf) ;
  599 delete factory;
  600 factory = NULL;
  601 vimpstcmdobserver_stub observer;
  602 commd->AddObserver(observer);
  603 TInt comm_sent = ECmdBlockContact;
  604 TInt comm_recev = commd->CommandId();
  605 TRAPD(err,commd->ExecuteLD());
  606 
  607 STIF_ASSERT_EQUALS(err, KErrNone );
  608 }
  609 
  610 STIF_TESTDEFINE(t_ExecuteCommand_UnBlockContact)
  611 {
  612 vimpstengine_stub engin;
  613 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  614 _LIT(KContactId,"contact");
  615 TBufC<10> buf (KContactId);
  616 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdUnBlockContact, &buf) ;
  617 delete factory;
  618 factory = NULL;
  619 vimpstcmdobserver_stub observer;
  620 commd->AddObserver(observer);
  621 TInt comm_sent = ECmdUnBlockContact;
  622 TInt comm_recev = commd->CommandId();
  623 TRAPD(err,commd->ExecuteLD());
  624 
  625 STIF_ASSERT_EQUALS(err, KErrNone);
  626 }
  627 STIF_TESTDEFINE(t_ExecuteCommand_FetchBlockContactList)
  628 {
  629 vimpstengine_stub engin;
  630 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  631 _LIT(KContactId,"contact");
  632 TBufC<10> buf (KContactId);
  633 MVIMPSTCmd* commd = factory->CreateCommandForIdL(EFetchBlockedList) ;
  634 delete factory;
  635 factory = NULL;
  636 vimpstcmdobserver_stub observer;
  637 commd->AddObserver(observer);
  638 TInt comm_sent = EFetchBlockedList;
  639 TInt comm_recev = commd->CommandId();
  640 TRAPD(err,commd->ExecuteLD());
  641 
  642 STIF_ASSERT_EQUALS(err, KErrNone);
  643 }
  644 STIF_TESTDEFINE(t_ExecuteCommand_ProcessAcceptedContactNew)
  645 {
  646 vimpstengine_stub engin;
  647 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  648 TVPbkSelectedData iSelectedData;
  649 
  650 _LIT8(KPackedlink,"packedlink");
  651 TPtrC8 link = KPackedlink;
  652 iSelectedData.iPackedLinks = link.AllocL();
  653 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessAcceptedContactNew,&iSelectedData) ;
  654 //delete factory;
  655 //factory = NULL;
  656 vimpstcmdobserver_stub observer;
  657 commd->AddObserver(observer);
  658 TInt comm_sent = ECmdProcessAcceptedContactNew;
  659 TInt comm_recev = commd->CommandId();
  660 commd->ExecuteLD();
  661 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  662 }
  663 
  664 STIF_TESTDEFINE(t_ExecuteCommand_ProcessSelectedContactNew)
  665 {
  666 vimpstengine_stub engin;
  667 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  668 TVPbkSelectedData iSelectedData;
  669 
  670 _LIT8(KPackedlink,"packedlink");
  671 TPtrC8 link = KPackedlink;
  672 iSelectedData.iPackedLinks = link.AllocL();
  673 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessSelectedContactNew,&iSelectedData) ;
  674 //delete factory;
  675 //factory = NULL;
  676 vimpstcmdobserver_stub observer;
  677 commd->AddObserver(observer);
  678 TInt comm_sent = ECmdProcessSelectedContactNew;
  679 TInt comm_recev = commd->CommandId();
  680 commd->ExecuteLD();
  681 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  682 }
  683 
  684 STIF_TESTDEFINE(t_ExecuteCommand_ProcessAcceptedContactExist)
  685 {
  686 vimpstengine_stub engin;
  687 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  688 TVPbkSelectedData iSelectedData;
  689 
  690 _LIT8(KPackedlink,"packedlink");
  691 TPtrC8 link = KPackedlink;
  692 iSelectedData.iPackedLinks = link.AllocL();
  693 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessAcceptedContactExist,&iSelectedData) ;
  694 //delete factory;
  695 //factory = NULL;
  696 vimpstcmdobserver_stub observer;
  697 commd->AddObserver(observer);
  698 TInt comm_sent = ECmdProcessAcceptedContactExist;
  699 TInt comm_recev = commd->CommandId();
  700 commd->ExecuteLD();
  701 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  702 }
  703 
  704 STIF_TESTDEFINE(t_ExecuteCommand_ProcessSelectedContactExist)
  705 {
  706 vimpstengine_stub engin;
  707 CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin);
  708 TVPbkSelectedData iSelectedData;
  709 
  710 _LIT8(KPackedlink,"packedlink");
  711 TPtrC8 link = KPackedlink;
  712 iSelectedData.iPackedLinks = link.AllocL();
  713 MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessSelectedContactExist,&iSelectedData) ;
  714 //delete factory;
  715 //factory = NULL;
  716 vimpstcmdobserver_stub observer;
  717 commd->AddObserver(observer);
  718 TInt comm_sent = ECmdProcessSelectedContactExist;
  719 TInt comm_recev = commd->CommandId();
  720 commd->ExecuteLD();
  721 STIF_ASSERT_EQUALS(comm_sent, comm_recev );
  722 }
  723 
  724 #endif
  725 /**
  726  * END OF TEST CASES SECTION
  727  */
***TER 100% (0/0) of SOURCE FILE t_vimpstcmdprocess_cmdfactory_utestcases.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD10.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD10.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #10/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mccaparameter.cpp
-Instrumentation mode: function-decision
-TER: 0 % ( 0/ 12)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2  * ============================================================================
  3  *  Name        : mccaparameter.cpp
  4  *  Part of     : CCA / CCAClient
  5  *  Description : This is a class for creating data of contact
  6  *                for launching CCA application.
  7  *  Version     : %version: 5 % << Don't touch! Updated by Synergy at check-out.
  8  *
  9  *  Copyright © 2007 Nokia.  All rights reserved.
  10  *  This material, including documentation and any related computer
  11  *  programs, is protected by copyright controlled by Nokia.  All
  12  *  rights are reserved.  Copying, including reproducing, storing,
  13  *  adapting or translating, any or all of this material requires the
  14  *  prior written consent of Nokia.  This material also contains
  15  *  confidential information which may not be disclosed to others
  16  *  without the prior written consent of Nokia.
  17  * ============================================================================
  18  * Template version: 4.2
  19  */
  20 
  21 #include "s_mccaparameter.h"
  22 
  23 
  24 /** @file mccaparameter.h
  25  *
  26  *  MCCAParameter class is used to store, control and define how the CCA application is launched
  27  *  with the contact specified data.
  28  *
  29  *  Example usage of the API:
  30  *  @code
  31  *   MCCAParameter* aParameter = TCCAFactory::NewParameterL()
  32  *   aParameter->SetConnectionFlag(ENormal);
  33  *   aParameter->SetContactDataFlag(EContactId);
  34  *   aParameter->SetContactDataL(aString);
  35  *
  36  *   aParameter->SetLaunchedViewUid(aUid);
  37  *
  38  *  @endcode
  39  *
  40  *  @lib ccaclient
  41  *  @since S60 v5.0
  42  */
 
- 43 MCCAParameter* MCCAParameterstub::NewL()
  44     {
  45     MCCAParameter* parameter = new(ELeave)MCCAParameterstub;
 - 46         return parameter;
  47     }
  48 
  49     /**
  50      * Getter for the flags of connection.
  51      * @since S60 5.0
  52      * @return the flags.
  53      */
 
- 54      MCCAParameter::TConnectionFlags MCCAParameterstub::ConnectionFlag()
  55         {
  56         
  57         }
  58 
  59     /**
  60      * Getter for the contact data flags.
  61      * @since S60 5.0
  62      * @return the flags.
  63      */
 
- 64      MCCAParameter::TContactDataFlags MCCAParameterstub::ContactDataFlag()
  65         {
  66         
  67         }
  68 
  69     /**
  70      * Getter for the contact data.
  71      * @leave KErrArgument if data not set.
  72      * @since S60 5.0
  73      * @return the reference of contact data.
  74      */
 
- 75      HBufC& MCCAParameterstub::ContactDataL()
  76         {
  77         
  78         }
  79 
  80     /**
  81      * Getter for the view uid.
  82      * @since S60 5.0
  83      * @return the Uid.
  84      */
 
- 85      TUid MCCAParameterstub::LaunchedViewUid()
  86         {
  87         
  88         }
  89 
  90     /**
  91      * Getter for the version.
  92      * @since S60 5.0
  93      * @return the version.
  94      */
 
- 95      TInt32 MCCAParameterstub::Version()
  96         {
  97                 
  98                 }
  99 
  100     /**
  101      * Setter for the flag of connection.
  102      *
  103      * @see TConnectionFlags
  104      * @since S60 5.0
  105      * @param aFlags: flags of connection
  106      */
 
- 107      void MCCAParameterstub::SetConnectionFlag(const MCCAParameter::TConnectionFlags aConnectionFlags)
  108         {
  109         
  110         }
  111 
  112     /**
  113      * Setter for the contact data flag.
  114      *
  115      * @see TContactDataFlags
  116      * @since S60 5.0
  117      * @param aFlags: flags of connection
  118      */
 
- 119      void MCCAParameterstub::SetContactDataFlag(const MCCAParameter::TContactDataFlags aContactDataFlags)
  120         {
  121         }        
  122 
  123     /**
  124      * Setter for the contact data.
  125      * If you are using TContactDataFlags::EContactLink, the MVPbkContactLink
  126      * should be streamed with PackLC before given for this method.
  127      * Ownership is NOT transferred.
  128      * @see MVPbkContactLink from  phonebook.
  129      * @leave KErrNotFound if contact data flag is not
  130      *        set before calling this method.
  131      * @see MCCAParameter::SetContactDataFlags
  132      * @since S60 5.0
  133      * @param aContactData: given contact data.
  134      */
 
- 135      void MCCAParameterstub::SetContactDataL(const TDesC& aContactData)
  136         {
  137         }
  138 
  139     /**
  140      * Setter for the launched view uid. Use this when there
  141      * is need to get a particular view opened first on launch of CCA.
  142      * If view uid is not set, CCA uses the default view.
  143      * NOT IMPLEMENTED YET!
  144      * @since S60 5.0
  145      * @param aContactData: given contact data.
  146      */
 
- 147      void MCCAParameterstub::SetLaunchedViewUid(const TUid aUid)
  148         {
  149         
  150         }
  151 
 
- 152     void MCCAParameterstub::Close() 
  153          {
  154          
  155          }
  156 
  157     
  158     // End of File
  159     
***TER 0% (0/12) of SOURCE FILE s_mccaparameter.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD11.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD11.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #11/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mvpbkcontactlinkstub.cpp
-Instrumentation mode: function-decision
-TER: 12 % ( 2/ 17)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : s_MVPbkContactLinkstub.cpp
  4 *  Part of     : Virtual Phonebook / VPbkEng.dll
  5 *  Description : Virtual Phonebook contact link for referencing contacts 
  6 *                in different stores.
  7 *  Version     : %version: 1 %
  8 *
  9 *  Copyright © 2002-2007 Nokia.  All rights reserved.
  10 *  This material, including documentation and any related computer
  11 *  programs, is protected by copyright controlled by Nokia.  All
  12 *  rights are reserved.  Copying, including reproducing, storing,
  13 *  adapting or translating, any or all of this material requires the
  14 *  prior written consent of Nokia.  This material also contains
  15 *  confidential information which may not be disclosed to others
  16 *  without the prior written consent of Nokia.
  17 * ============================================================================
  18 */
  19 
  20 // INCLUDES
  21 #include "s_MVPbkContactLinkstub.h"
  22 
 
76   23 MVPbkContactLink* CVPbkContactLinkStub::NewL()
  24     {
  25     MVPbkContactLink* list = new(ELeave)CVPbkContactLinkStub;
76    26         return list;
  27     }
  28 
  29 /**
  30  * Returns the contact store which this link belongs to.
  31  * @return Contact store associated with this link.
  32  */
 
- 33 MVPbkContactStore& CVPbkContactLinkStub::ContactStore() const 
  34 {
  35 MVPbkContactStore* ret=NULL;
 - 36 return *ret;   
  37 }
  38 
  39 /**
  40  * Returns ETrue if this link refers to the same contact than
  41  * aOther, EFalse otherwise.
  42  * @param aOther Contact to check equality for.
  43  * @return ETrue if this link refers to the same contact than
  44  *         aOther, EFalse otherwise.
  45  */
 
- 46 TBool CVPbkContactLinkStub::IsSame(const MVPbkContactLink& aOther) const 
  47 {
- 48 if (this == &aOther)
 - 49 return ETrue;
  50 
 - 51 return EFalse;
  52 }
  53 
  54 /**
  55  * Checks if this link refers to the contact aContact.
  56  * @param aContact Contact to check.
  57  * @return ETrue if this link refers to aContact, EFalse otherwise.
  58  */
 
- 59 TBool CVPbkContactLinkStub::RefersTo(const MVPbkBaseContact& /*aContact*/) const 
  60 {
 - 61 return ETrue;   
  62 }
  63 
  64 /**
  65  * Returns persistent streaming interface for this object, or NULL
  66  * if persistent streaming is not supported.
  67  * @return Persistent streaming object or NULL if not supported.
  68  */
 
- 69 const MVPbkStreamable* CVPbkContactLinkStub::Streamable() const 
  70 {
 - 71 return NULL;   
  72 };
  73 
  74 /**
  75  * Returns a packing interface for this link.
  76  * @see CVPbkContactLinkArray
  77  * @internal
  78  * @return Link packing object.
  79  */
 
- 80 const MVPbkContactLinkPacking& CVPbkContactLinkStub::Packing() const 
  81 {
  82 MVPbkContactLinkPacking* ret = NULL;
 - 83 return *ret;   
  84 };
  85 
  86 /**
  87  * Returns a clone of this contact link.
  88  * @return Contact link copy.
  89  */
 
- 90 MVPbkContactLink* CVPbkContactLinkStub::CloneLC() const 
  91 {
  92 MVPbkContactLink* link = CVPbkContactLinkStub::NewL();
 - 93     return link;   
  94 }
  95 
  96 
  97         
  98     
  99 // End of File
***TER 12% (2/17) of SOURCE FILE s_mvpbkcontactlinkstub.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD12.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD12.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #12/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_processarrayobserver.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 5/ 5)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ============================================================================
  3 *  Name        : s_processarrayobserver.cpp
  4 *  Part of     : 
  5 *  Description : 
  6 *  Version     : %version: 2 %
  7 *
  8 *  Copyright © 2006, 2007 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 * Template version: 4.1
  18 */
  19 
  20 #include "s_processarrayobserver.h"
  21 
 
  22 MVIMPSTProcessArrayObserver* vimpstprocessarrayobserver_stub::NewL()
  23     {
  24   MVIMPSTProcessArrayObserver* ob = new(ELeave)vimpstprocessarrayobserver_stub;
   25         return ob;
  26     }
  27 
 
32 32   28 void vimpstprocessarrayobserver_stub::HandleAdditionL(TVIMPSTEnums::TItem type,  TInt aIndex)
  29 {
  30    
  31 }
  32 
 
10 10   33 void vimpstprocessarrayobserver_stub::HandleDeletionL(TVIMPSTEnums::TItem type, TInt aIndex)
  34 {
  35    
  36 }
 
  37 void vimpstprocessarrayobserver_stub:: HandleAvatarChangeL( const TDesC& aUserId )
  38 {
  39     
  40 }
  41         
  42 
  43 // End of File
***TER 100% (5/5) of SOURCE FILE s_processarrayobserver.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD13.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD13.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #13/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_storageitemmodel.cpp
-Instrumentation mode: function-decision
-TER: 57 % ( 8/ 14)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : cvimpststoragecontact.cpp
  4 *  Part of     : IMUiserviceTab / vimpststorage
  5 *  Description : Implementation of contact data container
  6 *  Version     : %version: 29 %
  7 *
  8 *  Copyright (c) 2008 Nokia Corporation.
  9 *  This material, including documentation and any related 
  10 *  computer programs, is protected by copyright controlled by 
  11 *  Nokia Corporation. All rights are reserved. Copying, 
  12 *  including reproducing, storing, adapting or translating, any 
  13 *  or all of this material requires the prior written consent of 
  14 *  Nokia Corporation. This material also contains confidential 
  15 *  information which may not be disclosed to others without the 
  16 *  prior written consent of Nokia Corporation.
  17 * ==============================================================================
  18 */
  19 
  20 
  21 // INCLUDE FILES
  22 #include "s_storageitemmodel.h"
  23 #include "s_vimpststoragecontact.h"
  24 
  25 
  26 // ============================ MEMBER FUNCTIONS ===============================
  27 
  28 
  29 
  30 // -----------------------------------------------------------------------------
  31 // CVIMPSTStorageContact::NewL
  32 // Two-phased constructor.
  33 // -----------------------------------------------------------------------------
  34 //
 
64   35 MVIMPSTStorageItemModel* vimpststorageitemlist_stub::NewL()
  36     {
  37     MVIMPSTStorageItemModel* list = new(ELeave)vimpststorageitemlist_stub;
64    38         return list;
  39     }
  40 
  41 
  42     
 
66   43 TInt vimpststorageitemlist_stub::Count() const
  44 {
66    45 return 1;
  46 }
  47 
  48            /**
  49             * Returns List item at given index.
  50             * @param aIndex
  51             * @return SItem List item
  52   
  53             */
 
66   54 MVIMPSTStorageItemModel::SItem vimpststorageitemlist_stub::Item( TInt aIndex  ) const
  55 {
  56 MVIMPSTStorageItemModel::SItem item;
  57 item.iType = MVIMPSTStorageItemModel::EContactItem;
  58 item.iContactList = NULL;
  59 item.iContact = vimpststoragecontact_stub::NewL();
66    60 return item;
  61 }
  62            
  63            
  64            /**
  65             * Get index for contact.
  66             * @param aContact. Contact item to be found.
  67             * @return TInt Index of contact. If contact not found returns KErrNotFound
  68             */
 
  69            TInt vimpststorageitemlist_stub::IndexOfContact( MVIMPSTStorageContact* aContact ) const 
  70            {
   71            return 1;
  72            }
  73            
  74            /**
  75             * Get index for list
  76             * @param aList. Contact item to be found.
  77             * @param aIgnoreOwnItem. If ETrue own item is not taken into account
  78             *                        when resolving index.
  79             * @param aIgnoreEmptyLists If ETrue, empty lists are ignored.
  80             * @return TInt Index of list. If list not found returns KErrNotFound
  81             */
 
- 82            TInt vimpststorageitemlist_stub::IndexOfList( MVIMPSTStorageContactList* aList,
  83                                      TBool aIgnoreOwnItem ,
  84                                      TBool aIgnoreEmptyLists ) const
  85                                      {
 - 86                                      return 1;
  87                                      }
  88            
  89            // -----------------------------------------------------------------------------
  90            // CVIMPSTContactListModel::MdcaCount
  91            // (other items were commented in a header).
  92            // -----------------------------------------------------------------------------
  93            //
 
- 94            TInt vimpststorageitemlist_stub::MdcaCount() const
  95                {
  96                
 - 97                return Count();
  98                }
  99 
  100            // -----------------------------------------------------------------------------
  101            // CVIMPSTContactListModel::MdcaPoint
  102            // (other items were commented in a header).
  103            // -----------------------------------------------------------------------------
  104            //
 
- 105            TPtrC vimpststorageitemlist_stub::MdcaPoint( TInt /*aIndex */) const
  106                {
  107                
  108                // These will be filtered out
 - 109                return KNullDesC();
  110                } 
  111 
  112 //  End of File  
***TER 57% (8/14) of SOURCE FILE s_storageitemmodel.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD14.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD14.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #14/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstcmdobserver.cpp
-Instrumentation mode: function-decision
-TER: 50 % ( 1/ 2)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ============================================================================
  3 *  Name        : s_vimpstcmdobserver.cpp
  4 *  Part of     : 
  5 *  Description : 
  6 *  Version     : %version: 2 %
  7 *
  8 *  Copyright © 2006, 2007 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 * Template version: 4.1
  18 */
  19 
  20 #include "s_vimpstcmdobserver.h"
  21 #include "mvimpstcmd.h"
  22 
 
34 34   23 void vimpstcmdobserver_stub::CommandFinishedL(const MVIMPSTCmd& aCommand ) 
  24 {
  25 TInt res = aCommand.Result();
  26 }
  27 
 
- 28 void vimpstcmdobserver_stub::HandleCommandEventL(TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt aServiceError) 
  29 {
  30    
  31 }
  32 
  33 
  34 // End of File
***TER 50% (1/2) of SOURCE FILE s_vimpstcmdobserver.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD15.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD15.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,438 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #15/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstengin.cpp
-Instrumentation mode: function-decision
-TER: 52 % ( 33/ 63)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ============================================================================
  3 *  Name        : s_vimpstengin.cpp
  4 *  Part of     : 
  5 *  Description : Interface for presence context.
  6 *  Version     : %version: 9 %
  7 *
  8 *  Copyright © 2006, 2007 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 * Template version: 4.1
  18 */
  19 
  20 #include "s_vimpstengin.h"
  21 //#include "s_enginecontmgtextfeatures.h"
  22 #include "s_enginesearchextention.h"
  23 #include "s_vimpstenginepresencesubservice.h"
  24 #include "s_imsubservice.h"
  25 #include "tvimpstenums.h"
  26 #include "s_engineextentionfeatures.h"
  27 
  28 /*
  29 */
  30 /*MVIMPSTEngine& vimpstengine_stub::NewL()
  31 {
  32    return new vimpstengine_stub;
  33 }*/
  34 
  35 /**
  36 * Gets the Brand Information for the current service
  37 * @param aBrandLanguage - Holds the BrandLanguage
  38 * @param aBrandVersion - Holds the Version to be used
  39 * @param aBrandId - Holds the brandId 
  40 * caller should allocate memory for all params and send the same to this API
  41 * The result will be available in the InParams otself.
  42 * @return TInt Error code
  43 */
 
- 44 TInt vimpstengine_stub::GetBrandInfoL(TLanguage& /*aBrandLanguage*/, 
  45       TInt& /*aBrandVersion*/, TDes8& /*aBrandId*/) const 
  46    {
 - 47    return 1;         
  48    }
  49 
  50 /**
  51 * Returns the Service State - Cumulative Service State of the SubServices
  52 * @return TVIMPSTRegistrationState, current service state.
  53 */
 
118   54 TVIMPSTEnums::TVIMPSTRegistrationState vimpstengine_stub::ServiceState() const 
  55    {
  56    TVIMPSTEnums::TVIMPSTRegistrationState state = TVIMPSTEnums::ESVCERegistered;
118    57    return state;
  58    }
  59 
  60 
  61 /**
  62 * Gets the Service Id
  63 * @return TUint32 Service Id
  64 */
 
206   65 TUint32 vimpstengine_stub::ServiceId() const
  66 {
206    67 return 1;   
  68    
  69 }
  70    
  71 
  72 
  73 
  74 
  75 
  76 
  77 /**
  78 * Returns a SubService is Supported or not
  79 * Components intertested in knowing whether a SubService is Supported or not can use this API
  80 * @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h
  81 * @return TBool, ETrue if the SubService is Supported in this Service, else returns EFalse
  82 */         
 
  83 TBool vimpstengine_stub::IsSubServiceSupportedL(TVIMPSTEnums::SubServiceType /*aType*/) const 
  84    {
   85    return ETrue;
  86    }
  87       
  88 
  89 /**
  90 * Returns TBool whether a SubService is Enabled or not
  91 * Components intertested in knowing whether a SubService is Enabled or not can use this API
  92 * @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h
  93 * @return TBool, ETrue if the SubService is Enabled in this Service, else returns EFalse
  94 */
 
- 95 TBool vimpstengine_stub::IsSubServiceEnabled(TVIMPSTEnums::SubServiceType /*aType*/) const 
  96 {
 - 97    return ETrue;
  98 }
  99 
  100 /**
  101 * Gets the StoreName for given service
  102 * @param aContactStoreId, Virtual store id. 
  103 * The caller of the this function has to assign required memory for aContactStoreId
  104 * aContactStoreId will be filled with the Virtual Store Id by this API
  105 */
 
68 68   106 void vimpstengine_stub::ContactStoreIdL( 
  107       TDes& /*aContactStoreId*/ ) const 
  108 {
  109    
  110 }
  111 
  112 /**
  113 * returns the Service Name   
  114 * @return TDesC&, reference to service name. Ownership is not transferred.
  115 */
 
68   116 const TDesC& vimpstengine_stub::ServiceName() const 
  117 {
68    118    return KNullDesC;
  119 }
  120 
  121 
  122 /**
  123 * Register Session Observer.
  124 * @aObserver, observer ot be registered.
  125 */
 
68 68   126 void vimpstengine_stub::RegisterServiceSessionObserverL
  127             (MVIMPSTEngineServiceStateEventObserver* /*aObserver*/) 
  128 {
  129    
  130 }
  131 
  132 /**
  133 * UnRegisters Session Observer
  134 * @aObserver, observer ot be Unregistered.   
  135 */
 
46 46   136 void vimpstengine_stub::UnRegisterServiceSessionObserver
  137             (MVIMPSTEngineServiceStateEventObserver* /*aObserver*/) 
  138 {
  139    
  140 }
  141 
  142   
  143 /**
  144 * intialize storage 
  145 */   
 
68 68   146 void vimpstengine_stub::IntializeStorageL() 
  147 {
  148    
  149 }
  150 
  151 /**
  152 * unintialize storage
  153 */   
 
46 46   154 void vimpstengine_stub::UnIntializeStorage() 
  155 {
  156    
  157 }
  158 
  159 
  160 /**
  161 * Get the Ptr to the SubService given the Type of the SubService
  162 * This API returns a Generalised SubService Class MVIMPSTEngineSubService
  163 * Ownership of the SubService is not Transferred to the Caller
  164 * The Caller can use this (MVIMPSTEngineSubService*) ptr to typecast to appropriate SubService Interface
  165 * Usage    :          MVIMPSTEngineIMSubService* imSubService = 
  166 *                           dynamic_cast<MVIMPSTEngineIMSubService*> 
  167 *                           (iEngine.SubService(TVIMPSTEnums::EIM));
  168 *             
  169 *                if(imSubService)
  170 *                    {
  171 *                    imSubService->CloseConversationL( iContactId );
  172 *                    }
  173 * @param aType - SubService Type (TVIMPSTEnums::SubServiceType) defined in tvimpstenums.h
  174 * @return - Ptr to the SubService - Value can even be NULL
  175 */ 
 
521   176 MVIMPSTEngineSubService* vimpstengine_stub::SubService(TVIMPSTEnums::SubServiceType aType) const
  177 {
  178 MVIMPSTEngineSubService* subservice = NULL;
    179 switch(aType)
  180         {
212    181         case TVIMPSTEnums::EPresence:
  182             {
212 212   183             TRAP_IGNORE(subservice = CVIMPSTEnginePresenceSubService_Stub::NewL());
 - 183       catch (XLeaveException & l)
 - 183       catch (...)
212    184             return subservice ;
 - 185             break;
  186             }
  187      /*   case TVIMPSTEnums::EIM:
  188                     {
  189                     TRAP_IGNORE(subservice = CVIMPSTEngineImSubService_Stub::NewL());
  190                     return subservice ;
  191                     break;
  192                     }*/
  193             
309    194         default:
309    195             break;
  196         }
309    197    return subservice;
  198 }
  199 
  200 
  201 /**
  202 */
 
12   203 MVIMPSTEngineExtentionFeatures* vimpstengine_stub::ExtentionFeatures(TVIMPSTEnums::ExtentionType aType) const 
  204 {
  205    MVIMPSTEngineExtentionFeatures* extFeature = NULL;
    206    switch(aType)
  207       {
   208       case TVIMPSTEnums::EContactManagement:
  209          {
  210          TRAP_IGNORE(extFeature = extentionfeatures_stub::NewL());
 - 210       catch (XLeaveException & l)
 - 210       catch (...)
   211          return extFeature ;
 - 212          break;
  213          }
   214       case TVIMPSTEnums::ESearch:
  215          {
  216          TRAP_IGNORE(extFeature = searchextention_stub::NewL());
 - 216       catch (XLeaveException & l)
 - 216       catch (...)
   217          return extFeature ;
 - 218          break;
  219          }
  220       }
  221       
 - 222       return extFeature;
  223 }
  224 
  225 /**
  226 * Sets the User Name for the Service 
  227 * Stores the username to CCH Plugin
  228 *
  229 void vimpstengine_stub::SetUserNameL(const TDesC& /*aUserid) 
  230 {
  231    
  232 }
  233 */
  234 /**
  235 * Sets the Password for the Service 
  236 * Stores the Password to CCH Plugin
  237 * @param Password, Password to be stored.
  238 *
  239 void vimpstengine_stub::SetPassword(const TDesC& /*aPassword) 
  240 {
  241    
  242 }
  243 
  244 
  245 /**
  246 * gets the UserName for the Service          
  247 * @return HBufC* - Ownership is transferred to the caller
  248 * This API allocates memory for the UserName and transfers the Ownership to the Caller
  249 *
  250 HBufC* vimpstengine_stub::UserNameL() const 
  251 {
  252 _LIT(KText,"Nutan@presence");
  253    HBufC* buf = HBufC::NewL(20);
  254   
  255    *buf = KText; 
  256 
  257    return buf;
  258 }
  259 
  260 /**
  261 * gets the Password for the Service          
  262 * @return HBufC* - Ownership is transferred to the caller
  263 * This API allocates memory for the Password and transfers the Ownership to the Caller
  264 *
  265 HBufC* vimpstengine_stub::PasswordL() const 
  266 {
  267    return NULL;
  268 }
  269 */
  270 /**
  271 * API used to login to the Service                  
  272 */
 
  273 TInt vimpstengine_stub::Login() 
  274 {
   275    return 1;
  276 }
  277 
  278 /**
  279 * API used to Logout to the Service                  
  280 */
 
  281 void vimpstengine_stub::LogoutL() 
  282 {
  283    
  284 }
  285 
  286 
  287 /**
  288 * Gets the default domain name for given service
  289 * @param aDefaultDomainName, Domain Name. 
  290 * The caller of the this function has to assign required memory for aDefaultDomainName
  291 * aDefaultDomainName will be filled with the deafault domain name by this API
  292 */         
 
- 293 void vimpstengine_stub::DefaultDomainNameL( TDes& /*aDefaultDomainName */) const 
  294 {
  295    
  296 }
  297 /**
  298  * IsBlockSupportedL
  299  * @returns ETrue if block/unblock is supported 
  300  * else EFalse
  301  */
 
  302 TBool vimpstengine_stub::IsBlockSupportedL()
  303 {
   304    return ETrue;
  305 }
  306 
 
- 307 TInt vimpstengine_stub::ChangeConnectionL()
  308 {
 - 309    return 1;
  310 }
  311 /**
  312 * See MVIMPSTEngine
  313 
  314 * @return True if password is present in the settings else returns false
  315 *
  316 */
 
- 317 TBool vimpstengine_stub::IsPasswordAvailableL()
  318 {
 - 319 return ETrue;
  320 }
  321 
  322 
  323 /**
  324           * Inform storage that data base need to be deleted.
  325           */
 
- 326  void  vimpstengine_stub::DeleteDataBaseL()
  327     {
  328     
  329     }
  330  /*----------------------------------------------------------
  331   * vimpstengine_stub::GetPreseceSubService
  332   *-----------------------------------------------------------*/
 
- 333  MVIMPSTEnginePresenceSubService* vimpstengine_stub::GetPreseceSubService()
  334      {
  335      MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence);
- 336      if (subService)
  337          {
  338          //Get Presence SubService     
  339          MVIMPSTEnginePresenceSubService& presenceSubService = 
  340          MVIMPSTEnginePresenceSubService::Cast(*subService);
 - 341          return &presenceSubService ;
  342          }
 - 343      return NULL;
  344      }
  345  /*----------------------------------------------------------
  346   * vimpstengine_stub::FetchBlockedListL
  347   *-----------------------------------------------------------*/
  348 
 
  349  void vimpstengine_stub::FetchBlockedListL()
  350      {
  351      
  352      }
  353  /*----------------------------------------------------------
  354   * vimpstengine_stub::RegisterBlockedListObserver
  355   *-----------------------------------------------------------*/
  356 
 
- 357  void vimpstengine_stub::RegisterBlockedListObserver(
  358                      MVIMPSTEngineBlockedListFetchEventObserver* aOb)
  359      {
  360      
  361      }
  362  
 
- 363  HBufC* vimpstengine_stub::GetOwnUserIdFromCChOrStorageL() const
  364  {
  365  HBufC* temp = NULL;
 - 366  return temp;
  367  }
  368  
 
- 369  void vimpstengine_stub::RetriveContextIfCChEnabledL() 
  370      {
  371      
  372      }
 
- 373  void vimpstengine_stub::SetOwnUserIdIfChangedL(const TDesC& aUserId ) 
  374      {
  375      
  376      }
  377      
  378 //end of file
***TER 52% (33/63) of SOURCE FILE s_vimpstengin.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD16.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD16.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,401 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #16/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstenginepresencesubservice.cpp
-Instrumentation mode: function-decision
-TER: 43 % ( 24/ 56)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2  * ==============================================================================
  3  *  Name        : s_vimpstenginepresencesubservice.cpp
  4  *  Part of     : IMUiServiceTab\internal\vimstcmdprocess_ut
  5  *  Description : Handles the use of Precense Framework
  6  *
  7  *  Copyright © 2007 Nokia.  All rights reserved.
  8  *  This material, including documentation and any related computer
  9  *  programs, is protected by copyright controlled by Nokia.  All
  10  *  rights are reserved.  Copying, including reproducing, storing,
  11  *  adapting or translating, any or all of this material requires the
  12  *  prior written consent of Nokia.  This material also contains
  13  *  confidential information which may not be disclosed to others
  14  *  without the prior written consent of Nokia.
  15  * ============================================================================
  16  * Template version: 4.2
  17  */
  18 
  19 // INCLUDE FILES
  20 #include "s_vimpstenginepresencesubservice.h"
  21 //Presence Observer
  22 //#include "mvimpstenginepresencesubserviceeventobserver.h"
  23 
  24 // CONTANTS
  25 const TInt KUriMaxLength = 255; 
  26 _LIT( KListNameAllBuddy ,"buddylist" );
  27 
  28 // ================= MEMBER FUNCTIONS =======================
  29 
  30 // ---------------------------------------------------------------------------
  31 // CVIMPSTEnginePresenceSubService_Stub::
  32 //      CVIMPSTEnginePresenceSubService_Stub()
  33 // ---------------------------------------------------------------------------
  34 //
 
212 212   35 CVIMPSTEnginePresenceSubService_Stub::CVIMPSTEnginePresenceSubService_Stub(  ) 
  36         {
  37         }
  38 
  39 // ---------------------------------------------------------------------------
  40 // CVIMPSTEnginePresenceSubService_Stub::ConstructL()
  41 // ---------------------------------------------------------------------------
  42 //
 
212 212   43 void CVIMPSTEnginePresenceSubService_Stub::ConstructL()
  44     {
  45    
  46 
  47     }
  48 
  49 // ---------------------------------------------------------------------------
  50 // CVIMPSTEnginePresenceSubService_Stub::NewL()
  51 // ---------------------------------------------------------------------------
  52 //
  53 CVIMPSTEnginePresenceSubService_Stub* 
 
212   54 CVIMPSTEnginePresenceSubService_Stub::NewL(  )
  55     {
  56     CVIMPSTEnginePresenceSubService_Stub* self = NewLC();
  57     CleanupStack::Pop(self);
212    58     return self;
  59     }
  60 
  61 // ---------------------------------------------------------------------------
  62 // CVIMPSTEnginePresenceSubService_Stub::NewLC()
  63 // ---------------------------------------------------------------------------
  64 //
  65 CVIMPSTEnginePresenceSubService_Stub* 
 
212   66 CVIMPSTEnginePresenceSubService_Stub::NewLC( )
  67     {
  68     CVIMPSTEnginePresenceSubService_Stub* self =
  69     new (ELeave) CVIMPSTEnginePresenceSubService_Stub( );
  70     CleanupStack::PushL(self);
  71     self->ConstructL();
212    72     return self;
  73     }
  74 
  75 // ---------------------------------------------------------------------------
  76 // CVIMPSTEnginePresenceSubService_Stub::
  77 //      ~CVIMPSTEnginePresenceSubService_Stub()
  78 // ---------------------------------------------------------------------------
  79 //
 
- 80 CVIMPSTEnginePresenceSubService_Stub::~CVIMPSTEnginePresenceSubService_Stub()
  81     {
  82    
  83     }
  84 
  85 
 
- 86  void CVIMPSTEnginePresenceSubService_Stub::FetchPresenceOfSingleContactL(const TDesC& aContact)
  87     {
  88     
  89     }
  90 // ---------------------------------------------------------------------------
  91 // CVIMPSTEnginePresenceSubService_Stub::
  92 //      ServiceState()
  93 // ---------------------------------------------------------------------------
  94 //
  95 
 
- 96 TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEnginePresenceSubService_Stub::SubServiceState() const
  97    {
 - 98    return TVIMPSTEnums::ESVCERegistered;
  99    }
  100 
  101 // ---------------------------------------------------------------------------
  102 // CVIMPSTEnginePresenceSubService_Stub::
  103 //      Type()
  104 // ---------------------------------------------------------------------------
  105 //
  106 
 
208   107 TVIMPSTEnums::SubServiceType CVIMPSTEnginePresenceSubService_Stub::Type() const
  108     {             
208    109    return TVIMPSTEnums::EPresence;
  110    }
  111 
  112 // ---------------------------------------------------------------------------
  113 // CVIMPSTEnginePresenceSubService_Stub::
  114 //      Enabled()
  115 // ---------------------------------------------------------------------------
  116 //
  117 
 
- 118 TBool CVIMPSTEnginePresenceSubService_Stub::Enabled()
  119     {
 - 120     return  ETrue;    
  121     }
  122 
  123 
  124 
  125 // ---------------------------------------------------------------------------
  126 // CVIMPSTEnginePresenceSubService_Stub::SubscribePresenceOfSingleContactL
  127 // ---------------------------------------------------------------------------
  128 //
 
- 129 void CVIMPSTEnginePresenceSubService_Stub::SubscribePresenceOfSingleContactL( const TDesC& /*aUriOfTheContact*/)
  130     {
  131     
  132     }
  133 // ---------------------------------------------------------------------------
  134 // CVIMPSTEnginePresenceSubService_Stub::
  135 //      UnsubscribePrecenseOfSingleContactL
  136 // ---------------------------------------------------------------------------
  137 //
 
- 138 void CVIMPSTEnginePresenceSubService_Stub::UnSubscribePresenceOfSingleContactL(
  139         const TDesC& /*aUriOfTheContact */)
  140     {
  141    
  142     }
  143 
  144 // ---------------------------------------------------------
  145 // CVIMPSTEnginePresenceSubService_Stub::PublishOwnPresenceL
  146 // 
  147 // ---------------------------------------------------------    
 
12   148 TInt CVIMPSTEnginePresenceSubService_Stub::PublishOwnPresenceL(TVIMPSTEnums::TOnlineStatus /*aStatus*/, 
  149                                             const TDesC& /*aValue*/,
  150                                                const TDesC&  /*aFilename= KNullDesC*/, 
  151                                                const TDesC8& /*aMimetype = KNullDesC8*/,
  152                                                TBool /*aIsAvatar = EFalse*/ )
  153     {
12    154    return KErrNone;
  155     }
  156 
  157 
  158 /// ---------------------------------------------------------
  159 // CVIMPSTEnginePresenceSubService_Stub::FetchPresenceFormCache
  160 // 
  161 // ---------------------------------------------------------    
 
- 162 TInt CVIMPSTEnginePresenceSubService_Stub::FetchPresenceFromCache()
  163     {
  164    
 - 165    return KErrNone;
  166     }
  167 // ---------------------------------------------------------------------------
  168 // CVIMPSTEnginePresenceSubService_Stub::SubscribeToPresenceCacheL
  169 // ---------------------------------------------------------------------------
  170 //  
 
- 171 void CVIMPSTEnginePresenceSubService_Stub::SubscribeToPresenceCacheL(const TDesC& /*aUserId*/ )
  172     {
  173                                               
  174     }
  175 
  176 
  177 // ---------------------------------------------------------------------------
  178 // CVIMPSTEnginePresenceSubService_Stub::UnSubscribeToPresenceCacheL
  179 // ---------------------------------------------------------------------------
  180 //  
 
- 181 void CVIMPSTEnginePresenceSubService_Stub::UnSubscribeToPresenceCacheL(const TDesC& /*aWVID*/)
  182     {
  183                                            
  184     }
  185 
  186 
  187 
  188 
  189 
  190 // ---------------------------------------------------------
  191 // CVIMPSTEnginePresenceSubService_Stub::UnSubscribeForAuthorizationL
  192 //  
  193 // ---------------------------------------------------------    
 
- 194 void  CVIMPSTEnginePresenceSubService_Stub::UnSubscribeForAuthorizationL()
  195     {
  196         }
  197 
  198 // ---------------------------------------------------------
  199 // CVIMPSTEnginePresenceSubService_Stub::SubscribeForAuthorizationL
  200 //  
  201 // ---------------------------------------------------------    
 
- 202 void  CVIMPSTEnginePresenceSubService_Stub::SubscribeForAuthorizationL()
  203     {
  204        }
  205 // ---------------------------------------------------------
  206 // CVIMPSTEnginePresenceSubService_Stub::SendPresenceGrantPresentityResponseL
  207 //  
  208 // ---------------------------------------------------------    
 
  209 TInt CVIMPSTEnginePresenceSubService_Stub::SendPresenceGrantPresentityL( const TDesC& /*aContactId*/ , TBool /*aResponse*/ )
  210     {
   211     return KErrNone;
  212     }  
  213 
  214 // ---------------------------------------------------------
  215 // CVIMPSTEnginePresenceSubService_Stub::IsChangeOwnStatusSupported
  216 // 
  217 // ---------------------------------------------------------        
  218 
 
- 219 TBool CVIMPSTEnginePresenceSubService_Stub::IsChangeOwnStatusSupported() 
  220     {
  221     //TODO:: get the feature supported from ximp and return
 - 222     return ETrue;
  223     }
  224 
  225 // ---------------------------------------------------------
  226 // CVIMPSTEnginePresenceSubService_Stub::IsStatusMsgSupported
  227 // 
  228 // ---------------------------------------------------------        
 
- 229 TBool CVIMPSTEnginePresenceSubService_Stub::IsStatusMsgSupported()
  230     {
  231     //TODO:: get the feature supported from ximp and return
 - 232     return ETrue;
  233     }
  234 
  235 // ---------------------------------------------------------
  236 // CVIMPSTEnginePresenceSubService_Stub::IsAvatarSupported
  237 // 
  238 // ---------------------------------------------------------        
 
- 239 TBool CVIMPSTEnginePresenceSubService_Stub::IsAvatarSupported()
  240     {
 - 241     return EFalse;
  242     }
  243  
  244  // ---------------------------------------------------------
  245 // CVIMPSTEnginePresenceSubService_Stub::SetAvatarSupported
  246 // 
  247 // ---------------------------------------------------------        
 
- 248 void CVIMPSTEnginePresenceSubService_Stub::SetAvatarSupported(TBool /*aSupported*/ )
  249     {
  250    
  251     }
  252 
  253 // ---------------------------------------------------------
  254 // CVIMPSTEnginePresenceSubService_Stub::RegisterPresenceEventObserver
  255 // 
  256 // ---------------------------------------------------------   
  257 //TODO::Should be named as RegisterPresenceEventObserverL
 
118 118   258 void CVIMPSTEnginePresenceSubService_Stub::RegisterPresenceEventObserverL(
  259         MVIMPSTEnginePresenceSubServiceEventObserver* /*aObserver*/)
  260     {
  261     
  262     }
  263 
  264 // ---------------------------------------------------------
  265 // CVIMPSTEnginePresenceSubService_Stub::UnRegisterPresenceEventObserver
  266 // 
  267 // ---------------------------------------------------------   
  268 
 
46 46   269 void CVIMPSTEnginePresenceSubService_Stub::UnRegisterPresenceEventObserver(
  270         MVIMPSTEnginePresenceSubServiceEventObserver* /*aObserver*/)
  271     {
  272     
  273     }   
  274 // ---------------------------------------------------------------------------
  275 // CVIMPSTEnginePresenceSubService_Stub::AddToBlockListL
  276 // ---------------------------------------------------------------------------
  277 //
 
  278 TInt CVIMPSTEnginePresenceSubService_Stub::AddToBlockListL( const TDesC& aUriOfTheContact )
  279     {
  280     TInt err = KErrNotFound;
  281    _LIT(KAt, "@");
  282    TInt loc = aUriOfTheContact.Find(KAt());
- 283    if( 0 == aUriOfTheContact.Length())
 - 284        return KErrNotFound;
  285    
- 286    else if(KErrNotFound == loc )
   287       return KErrNotFound;
    288    else
  289        err = KErrNone;
 - 290     return err;
  291     }
  292 // ---------------------------------------------------------------------------
  293 // CVIMPSTEnginePresenceSubService_Stub::GetBlockedList
  294 // ---------------------------------------------------------------------------
  295 //
 
24   296 RPointerArray<HBufC>* CVIMPSTEnginePresenceSubService_Stub::GetBlockedList()
  297     {
  298     RPointerArray<HBufC> *blockedlist =  new (ELeave) RPointerArray<HBufC>;
  299     
  300     _LIT(KText,"blocked@presence");
  301         HBufC* buddyId = HBufC::NewL(32);
  302         CleanupStack::PushL(buddyId);
  303         *buddyId = KText;
  304         blockedlist->Append(buddyId);
  305 
  306         CleanupStack::Pop();
  307       
24    308     return blockedlist;
  309     }
  310 // ---------------------------------------------------------------------------
  311 // CVIMPSTEnginePresenceSubService_Stub::FetchBlockedListFromServerL
  312 // ---------------------------------------------------------------------------
  313 //
 
- 314 void CVIMPSTEnginePresenceSubService_Stub::FetchBlockedListFromServerL(MVIMPSTEngineBlockedListFetchEventObserver* aOb)
  315     {
  316     
  317     }
  318 // ---------------------------------------------------------------------------
  319 // CVIMPSTEnginePresenceSubService_Stub::RemoveFromBlockListL
  320 // ---------------------------------------------------------------------------
  321 //
 
  322 TInt CVIMPSTEnginePresenceSubService_Stub::RemoveFromBlockListL( const TDesC& aUriOfTheContact )
  323     {
  324     TInt err = KErrNotFound;
  325     _LIT(KAt, "@");
  326     TInt loc = aUriOfTheContact.Find(KAt());
- 327     if( 0 == aUriOfTheContact.Length())
 - 328       return KErrNotFound;
- 329    else if(KErrNotFound == loc )
   330        return KErrNotFound;
    331    else
  332        err = KErrNone;
 - 333      return err;
  334     }
 
- 335  void CVIMPSTEnginePresenceSubService_Stub::FetchPresenceOfSinleContactL(const TDesC& aUserId)
  336     {
  337     }
  338  
 
- 339  void CVIMPSTEnginePresenceSubService_Stub::UpdatePresenceStateL()
  340     {
  341        
  342     }
  343 // End of file
***TER 43% (24/56) of SOURCE FILE s_vimpstenginepresencesubservice.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD17.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD17.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #17/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstprocessarrayitem.cpp
-Instrumentation mode: function-decision
-TER: 0 % ( 0/ 18)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ============================================================================
  3 *  Name        : s_vimpstcmdobserver.cpp
  4 *  Part of     : 
  5 *  Description : 
  6 *  Version     : %version: 1 %
  7 *
  8 *  Copyright © 2006, 2007 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 * Template version: 4.1
  18 */
  19 
  20 #include "s_vimpstprocessarrayItem.h"
  21 #include "tvimpstenums.h"
  22 
  23     
  24     
 
- 25     MVIMPSTProcessArrayItem* vimpstprocessarrayitem_stub::NewL(TDesC & aItemName)
  26        {
  27        MVIMPSTProcessArrayItem* item = new(ELeave) vimpstprocessarrayitem_stub(aItemName);
 - 28        return item;
  29        }
  30   
 
- 31   vimpstprocessarrayitem_stub::vimpstprocessarrayitem_stub(TDesC & aItemName)
  32   :iItemName(aItemName)
  33   {
  34      
  35   }
  36   
  37   
  38   
  39      
  40      
  41      /**
  42       * Sets the name of the listbox item 
  43       * @param aName: Name of the listbox item to be set
  44       * @return void
  45       */
  46 
  47      
  48 
  49      /**
  50       * gets the messages pending status of the contact item 
  51       * @return iSMsgPending: true if the contact has pending messages 
  52       * else false
  53       */
  54      
  55          
  56 
 
- 57    TBool vimpstprocessarrayitem_stub::IsMsgPending() 
  58       {
 - 59       return EFalse;
  60       }
  61   
 
- 62    void vimpstprocessarrayitem_stub::SetMsgPending(TBool aMsgPending) 
  63       {
  64       
  65       }
  66     /**
  67     * Returns the default type of the listbox item 
  68     * @return TEnumsPC::TItem: type of the listbox item as either EContactitem, EContactListItem etc
  69     */
 
- 70      TVIMPSTEnums::TItem vimpstprocessarrayitem_stub::Type() 
  71         {
 - 72         return TVIMPSTEnums::EContactItem;
  73         }
  74     
  75     /**
  76     * Returns the name of the listbox item 
  77     * @return TPtrC: name of the listbox item to be displayed
  78     */
  79      
  80     /**
  81     * Sets the name of the listbox item 
  82     * @param aName: Name of the listbox item to be set
  83     * @return void
  84     */
  85     //virtual void SetItemNameText(const TDesC& aName) = 0;
  86         
  87     /**
  88     * Returns the array index of the listbox item on engine/storage side
  89     * @return TInt: index of the listbox item on engine/storage side
  90     */
 
- 91      TInt vimpstprocessarrayitem_stub::GetItemIndex() 
  92      {
 - 93         return 0;
  94      }
  95     
  96     /**
  97     * return the VPBK Contact Link
  98     */
 
- 99      MVPbkContactLink* vimpstprocessarrayitem_stub::ContactLink() 
  100      {
 - 101         return NULL;
  102      }
  103     
  104     
  105     /**
  106     * Sets the on engine/storage side index of the listbox item 
  107     * @param aIndex: index of the listbox item on engine/storage side
  108     * @return void
  109     */
 
- 110     void vimpstprocessarrayitem_stub::SetItemIndex(TInt aIndex) 
  111     {
  112        
  113     }
  114     
  115     /**
  116     * Returns the user id of the listbox item 
  117     * @return TPtrC: user id of the listbox item.
  118     */
 
- 119     TPtrC vimpstprocessarrayitem_stub::GetItemUserId() 
  120     {
  121     TPtrC ptr;
 - 122     return ptr;   
  123     }
  124     /**
  125      * Returns the avatar index of the listbox item 
  126      * @return TInt: avatar index of the listbox item.
  127      */
 
- 128     TInt  vimpstprocessarrayitem_stub::AvatarIndex() 
  129     {
 - 130        return 0;
  131     }
  132     
  133     /**
  134      * sets the avatar index of the listbox item 
  135      * @param aAvatarIndex: avatar index to be set 
  136      */
 
- 137     void  vimpstprocessarrayitem_stub::SetAvatarIndex(TInt aAvatarIndex )
  138     {
  139        
  140     }
  141    
  142    
  143     
  144     
  145     
  146 
  147 // End of File
***TER 0% (0/18) of SOURCE FILE s_vimpstprocessarrayitem.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD18.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD18.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #18/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragecontact.cpp
-Instrumentation mode: function-decision
-TER: 78 % ( 18/ 23)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : cvimpststoragecontact.cpp
  4 *  Part of     : IMUiserviceTab / vimpststorage
  5 *  Description : Implementation of contact data container
  6 *  Version     : %version: 29 %
  7 *
  8 *  Copyright (c) 2008 Nokia Corporation.
  9 *  This material, including documentation and any related 
  10 *  computer programs, is protected by copyright controlled by 
  11 *  Nokia Corporation. All rights are reserved. Copying, 
  12 *  including reproducing, storing, adapting or translating, any 
  13 *  or all of this material requires the prior written consent of 
  14 *  Nokia Corporation. This material also contains confidential 
  15 *  information which may not be disclosed to others without the 
  16 *  prior written consent of Nokia Corporation.
  17 * ==============================================================================
  18 */
  19 
  20 
  21 // INCLUDE FILES
  22 #include "s_vimpststoragecontact.h"
  23 #include <MVPBKSTORECONTACT.H>
  24  #include "s_MVPbkContactLinkstub.h"
  25  
  26 // ============================ MEMBER FUNCTIONS ===============================
  27 
  28 
  29 
  30 // -----------------------------------------------------------------------------
  31 // CVIMPSTStorageContact::NewL
  32 // Two-phased constructor.
  33 // -----------------------------------------------------------------------------
  34 //
 
155   35 MVIMPSTStorageContact* vimpststoragecontact_stub::NewL()
  36     {
  37     MVIMPSTStorageContact* contact = new(ELeave)vimpststoragecontact_stub;
155    38         return contact;
  39     }
  40 
  41 // Destructor
 
  42 vimpststoragecontact_stub::~vimpststoragecontact_stub()
  43     {
  44     
  45     }
  46     
  47 // -----------------------------------------------------------------------------
  48 // CVIMPSTStorageContact::UserId
  49 // From MVIMPSTStorageContact
  50 // -----------------------------------------------------------------------------
  51 //
 
150   52 const TDesC& vimpststoragecontact_stub::UserId() const
  53     {
150    54     return KDummy();
  55     }
  56 
  57 // -----------------------------------------------------------------------------
  58 // CVIMPSTStorageContact::UserId
  59 // From MVIMPSTStorageContact
  60 // -----------------------------------------------------------------------------
  61 //
 
76   62 const TDesC& vimpststoragecontact_stub::Name() const
  63 {
76    64 return KDummy();
  65 }
  66 // -----------------------------------------------------------------------------
  67 // CVIMPSTStorageContact::OnlineStatus
  68 // From MVIMPSTStorageContact
  69 // -----------------------------------------------------------------------------
  70 //
 
67   71 TVIMPSTEnums::TOnlineStatus vimpststoragecontact_stub::OnlineStatus() const
  72 {
  73 TVIMPSTEnums::TOnlineStatus status = TVIMPSTEnums::EOffline;
67    74 return status;       
  75 }
  76 
  77 
  78 // -----------------------------------------------------------------------------
  79 // CVIMPSTStorageContact::SetOnlineStatus
  80 // From MVIMPSTStorageContact
  81 // -----------------------------------------------------------------------------
  82 //
 
- 83 void vimpststoragecontact_stub::SetOnlineStatus( 
  84                         TVIMPSTEnums::TOnlineStatus /*aOnlineStatus*/ )
  85     {
  86       //iPresenceStatus = aOnlineStatus;
  87     }
  88         
  89 
  90 // -----------------------------------------------------------------------------
  91 // CVIMPSTStorageContact::StatusText
  92 // From MVIMPSTStorageContact
  93 // -----------------------------------------------------------------------------
  94 //
 
  95 const TDesC& vimpststoragecontact_stub::StatusText() const
  96     {
   97     return KDummy();
  98     }
  99 
  100 // -----------------------------------------------------------------------------
  101 // CVIMPSTStorageContact::SetStatusTextL
  102 // From MVIMPSTStorageContact
  103 // -----------------------------------------------------------------------------
  104 //
 
- 105 void vimpststoragecontact_stub::SetStatusTextL( const TDesC& /*aStatusText*/ )
  106     {
  107     
  108     }
  109 
  110 // -----------------------------------------------------------------------------
  111 // CVIMPSTStorageContact::SetAvatarContentL
  112 // From MVIMPSTStorageContact
  113 // -----------------------------------------------------------------------------
  114 //
 
- 115 void vimpststoragecontact_stub::SetAvatarContentL( const TDesC8& /*aAvatarContent*/, MVIMPSTStorageVPbkContactStore& /*aVPPkStoreHandler*/ )
  116     {
  117     
  118     }
  119 
  120    
  121 // -----------------------------------------------------------------------------
  122 // CVIMPSTStorageContact::SetUserIdL
  123 // From MVIMPSTStorageExtendedStorageContact
  124 // -----------------------------------------------------------------------------
  125 //
 
- 126 void vimpststoragecontact_stub::SetUserIdL( const TDesC& /*aUserId*/ )
  127     {
  128     
  129     }
  130 
  131 // -----------------------------------------------------------------------------
  132 // CVIMPSTStorageContact::SetNameL
  133 // From MVIMPSTStorageExtendedStorageContact
  134 // -----------------------------------------------------------------------------
  135 //
 
- 136 void vimpststoragecontact_stub::SetNameL( const TDesC& /*aName*/ )
  137     {
  138     
  139     }
  140 // ---------------------------------------------------------------------------
  141 // CVIMPSTStorageContact::ContactLink()
  142 // ---------------------------------------------------------------------------
  143 // 
 
76   144 MVPbkContactLink* vimpststoragecontact_stub::ContactLink() const
  145     {
  146     MVPbkContactLink* link = CVPbkContactLinkStub::NewL();
76    147     return link;
  148     }
  149  
  150 // ---------------------------------------------------------------------------
  151 // CVIMPSTStorageContact::AvatarContent
  152 // ---------------------------------------------------------------------------
  153 //  
 
  154 const TDesC8& vimpststoragecontact_stub::AvatarContent() const
  155     {
  156     _LIT8(Kavatar,"avatar");
   157     return Kavatar();
  158     }
  159 // ---------------------------------------------------------------------------
  160 // CVIMPSTStorageContact::SetAvatarIndex()
  161 // ---------------------------------------------------------------------------
  162 // 
 
  163 void vimpststoragecontact_stub::SetAvatarIndex(TInt aIndex ) 
  164     {
  165    iAvatarIndex = aIndex;
  166     }
  167  
  168 // ---------------------------------------------------------------------------
  169 // CVIMPSTStorageContact::AvatarIndex
  170 // ---------------------------------------------------------------------------
  171 //  
 
  172 TInt vimpststoragecontact_stub::AvatarIndex() const
  173     {
   174     return 1;
  175     }
  176 
  177 //  End of File  
***TER 78% (18/23) of SOURCE FILE s_vimpststoragecontact.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD19.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD19.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #19/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragecontactlist.cpp
-Instrumentation mode: function-decision
-TER: 0 % ( 0/ 27)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : cvimpststoragecontactlist.cpp
  4 *  Part of     : IMUiServiceTab / vimpststorage
  5 *  Description : Contact list container implementation
  6 *  Version     : %version: ou1s60rt#15.1.7 %
  7 *
  8 *  Copyright (c) 2008 Nokia Corporation.
  9 *  This material, including documentation and any related 
  10 *  computer programs, is protected by copyright controlled by 
  11 *  Nokia Corporation. All rights are reserved. Copying, 
  12 *  including reproducing, storing, adapting or translating, any 
  13 *  or all of this material requires the prior written consent of 
  14 *  Nokia Corporation. This material also contains confidential 
  15 *  information which may not be disclosed to others without the 
  16 *  prior written consent of Nokia Corporation.
  17 * ==============================================================================
  18 */
  19 
  20 // INCLUDE FILES
  21 #include "s_vimpststoragecontactlist.h"
  22 
  23 // ============================ MEMBER FUNCTIONS ===============================    
  24 // -----------------------------------------------------------------------------
  25 // CVIMPSTStorageContactList::ListId
  26 // -----------------------------------------------------------------------------
  27 //
 
- 28 const TDesC& vimpststoragecontactlist_stub::ListId() const
  29     {
 - 30     return KNullDesC;    
  31     }
  32     
  33 // -----------------------------------------------------------------------------
  34 // CVIMPSTStorageContactList::DisplayName
  35 // -----------------------------------------------------------------------------
  36 //
 
- 37 TPtrC vimpststoragecontactlist_stub::DisplayName() const
  38     {
 - 39     return NULL;
  40     }
  41 // -----------------------------------------------------------------------------
  42 // CVIMPSTStorageContactList::AddStorageContactToCacheL
  43 // -----------------------------------------------------------------------------
  44 //
 
- 45 TInt vimpststoragecontactlist_stub::AddStorageContactToCacheL( MVIMPSTStorageContact* aContact, TInt& aIndex )
  46     {
  47     
  48     }
  49  
  50 // -----------------------------------------------------------------------------
  51 // CVIMPSTStorageContactList::RemoveContactFromCacheL
  52 // -----------------------------------------------------------------------------
  53 //
 
- 54 TInt vimpststoragecontactlist_stub::RemoveContactFromCacheL( const TDesC& aContactId, TInt& aIndex )
  55     {
  56     
  57     }
  58 
  59 // -----------------------------------------------------------------------------
  60 // CVIMPSTStorageContactList::RemoveContactFromCacheL
  61 // -----------------------------------------------------------------------------
  62 //
 
- 63 TInt vimpststoragecontactlist_stub::RemoveContactFromCacheL( const MVPbkContactLink& aContactLink, TInt& index )
  64     {
  65     
  66     }    
  67  // -----------------------------------------------------------------------------
  68 // CVIMPSTStorageContactList::FindContact
  69 // -----------------------------------------------------------------------------
  70 //
 
- 71 TInt vimpststoragecontactlist_stub::ContactCount( TBool aSkipOfflineContacts,
  72                      TBool aSkipBlocekedContacts ) const
  73     {
  74     
  75     }
  76             
  77 // -----------------------------------------------------------------------------
  78 // CVIMPSTStorageContactList::FindContactIndex
  79 // -----------------------------------------------------------------------------
  80 //
 
- 81 TInt vimpststoragecontactlist_stub::FindContactIndex( const TDesC& aUserId,
  82                                        TInt& aOrderedIndex ) const
  83     {
  84      
  85     }
  86 
  87 // -----------------------------------------------------------------------------
  88 // CVIMPSTStorageContactList::FindContactEntry
  89 // -----------------------------------------------------------------------------
  90 //
 
- 91 TInt vimpststoragecontactlist_stub::FindContactEntry( const MVIMPSTStorageContact* aContact ) const
  92     {
  93     
  94     }
  95 // -----------------------------------------------------------------------------
  96 // CVIMPSTStorageContactList::Sort
  97 // -----------------------------------------------------------------------------
  98 //
 
- 99 void vimpststoragecontactlist_stub::Sort()
  100     {
  101     
  102     }
  103 
  104 // -----------------------------------------------------------------------------
  105 // CVIMPSTStorageContactList::ResortContact
  106 // -----------------------------------------------------------------------------
  107 //
 
- 108 void vimpststoragecontactlist_stub::ResortContact( MVIMPSTStorageContact* aContact )
  109     {
  110     
  111     }
  112    
  113 // -----------------------------------------------------------------------------
  114 // CVIMPSTStorageContactList::FindIndexOfContact
  115 // From MVIMPSTContactList
  116 // -----------------------------------------------------------------------------
  117 //
 
- 118 TInt vimpststoragecontactlist_stub::FindIndexOfContact( const MVIMPSTStorageContact* aContact,
  119                             TVIMPSTEnums::TFilterType aFilter  ) const
  120     {    
  121     
  122     }
  123        
  124 // -----------------------------------------------------------------------------
  125 // CVIMPSTStorageContactList::Count
  126 // From MVIMPSTStorageContactList
  127 // -----------------------------------------------------------------------------
  128 //
 
- 129 TInt vimpststoragecontactlist_stub::Count() const
  130     {
 - 131     return 1;
  132     }
  133     
  134 // -----------------------------------------------------------------------------
  135 // CVIMPSTStorageContactList::OnlineCount
  136 // From MVIMPSTStorageContactList
  137 // -----------------------------------------------------------------------------
  138 //
 
- 139 TInt vimpststoragecontactlist_stub::OnlineCount() const
  140     {
  141     
  142     }
  143 // -----------------------------------------------------------------------------
  144 // CVIMPSTStorageContactList::operator[]
  145 // From MVIMPSTStorageContactList
  146 // -----------------------------------------------------------------------------
  147 //
 
- 148 MVIMPSTStorageContact& vimpststoragecontactlist_stub::operator[]( TInt aIndex ) const
  149     {
  150     
  151     }
  152     
  153 // -----------------------------------------------------------------------------
  154 // CVIMPSTStorageContactList::OnlineContact
  155 // From MVIMPSTContactList
  156 // -----------------------------------------------------------------------------
  157 //
 
- 158 MVIMPSTStorageContact& vimpststoragecontactlist_stub::OnlineContact( TInt aIndex ) const
  159     {
  160     
  161     }
  162  
  163 // -----------------------------------------------------------------------------
  164 // CVIMPSTStorageContactList::FilteredContact
  165 // From MVIMPSTContactList
  166 // -----------------------------------------------------------------------------
  167 //
 
- 168 MVIMPSTStorageContact& vimpststoragecontactlist_stub::FilteredContact( 
  169                 TInt aIndex, TVIMPSTEnums::TFilterType aFilter ) const
  170    {
  171     
  172    }
  173 
  174 // -----------------------------------------------------------------------------
  175 // CVIMPSTStorageContactList::FilteredCount
  176 // From MVIMPSTContactList
  177 // -----------------------------------------------------------------------------
  178 //
 
- 179 TInt vimpststoragecontactlist_stub::FilteredCount( 
  180                             TVIMPSTEnums::TFilterType aFilter ) const
  181    {
 - 182     return 1;
  183      }
  184 
  185 // -----------------------------------------------------------------------------
  186 // CVIMPSTStorageContactList::FilterAllowsContact
  187 // -----------------------------------------------------------------------------
  188 //
 
- 189 TBool vimpststoragecontactlist_stub::FilterAllowsContact( const MVIMPSTStorageContact* aContact,
  190                              TVIMPSTEnums::TFilterType aFilter ) const
  191     {
 - 192     return ETrue;
  193     }
  194 
  195 // -----------------------------------------------------------------------------
  196 // CVIMPSTStorageContactList::FindContact
  197 // -----------------------------------------------------------------------------
  198 //
 
- 199 MVIMPSTStorageContact* vimpststoragecontactlist_stub::FindContact( const TDesC& aContactId )
  200     {
  201     //return NULL;
  202     }
  203 // -----------------------------------------------------------------------------
  204 // CVIMPSTStorageContactList::FindContactByContactLinkL
  205 // -----------------------------------------------------------------------------
  206 //
 
- 207 MVIMPSTStorageContact* vimpststoragecontactlist_stub::FindContactByContactLink( const MVPbkContactLink& aContactLink )
  208     {
  209     //return NULL;
  210     }
  211     
  212 // -----------------------------------------------------------------------------
  213 // CVIMPSTStorageContactList::FindContactByLinkL
  214 // -----------------------------------------------------------------------------
  215 //
 
- 216 TInt vimpststoragecontactlist_stub::FindContactByLinkL( const MVPbkContactLink& aContactLink,
  217                                           TInt& aIndexOrderedArray ) const
  218     {
 - 219     return NULL;
  220     }        
  221     
  222 //  End of File
***TER 0% (0/27) of SOURCE FILE s_vimpststoragecontactlist.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD2.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD2.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,739 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #2/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\t_vimpstcmdprocess_processarray_utest.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 0/ 0)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : vimpstcmdprocess_utestCases.cpp
  4 *  Part of     : vimpstcmdprocess_utest
  5 *
  6 *  Description : vimpstcmdprocess_utest test module.
  7 *  Version:   %version: 6 %
  8 *
  9 *  Copyright (C) 2002 - 2007 Nokia Corporation.
  10 *  This material, including documentation and any related 
  11 *  computer programs, is protected by copyright controlled by 
  12 *  Nokia Corporation. All rights are reserved. Copying, 
  13 *  including reproducing, storing,  adapting or translating, any 
  14 *  or all of this material requires the prior written consent of 
  15 *  Nokia Corporation. This material also contains confidential 
  16 *  information which may not be disclosed to others without the 
  17 *  prior written consent of Nokia Corporation.
  18 *
  19 * ============================================================================
  20 */
  21 
  22 /**
  23  * GLOBAL VARIABLES SECTION
  24  */
  25 #ifdef TEST_VAR_DECLARATIONS
  26 #endif
  27 /**
  28  * END OF GLOBAL VARIABLES SECTION
  29  */
  30 
  31 /**
  32  * TEST CASES SECTION
  33  */
  34 #ifdef TEST_CASES
  35 /**
  36  * STIF_SETUP defines activities needed before every test case.
  37  */
  38 STIF_SETUP
  39 {
  40 }
  41 
  42 /**
  43  * STIF_TEARDOWN defines activities needed after every test case
  44  */
  45 STIF_TEARDOWN
  46 {
  47 }
  48 
  49 /**
  50  * STIF_TESTDEFINE defines a test case
  51  *
  52  *  Example test case - length of string is checked.
  53  *  The only argument of macro is a name of test case.
  54  */
  55 STIF_TESTDEFINE(t_ProcArr_HandleChatMessageEventL)
  56     {
  57     //void  HandleChatMessageEventL(TVIMPSTEnums::TIMEventType aEventType ,const TDesC& aSender );
  58     vimpstengine_stub engin;
  59     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  60     procArray->iFetchCompleted = ETrue;
  61     vimpststoragecontactlist_stub contactlist;
  62    // vimpststoragecontact_stub contact;
  63 
  64     _LIT(KText,"Nutan@presence");
  65     HBufC* buddyId = HBufC::NewL(32);
  66     CleanupStack::PushL(buddyId);
  67     *buddyId = KText;
  68     
  69     MVIMPSTProcessArrayObserver* ob = vimpstprocessarrayobserver_stub::NewL();
  70     procArray->AddObserver(ob);
  71     procArray->iContactInterface = vimpstserviceview_stub::NewL();
  72     procArray->HandleChatMessageEventL(TVIMPSTEnums::EIMRequestCompleted,buddyId->Des() );
  73     STIF_ASSERT_NOT_NULL(procArray);
  74 
  75     //procArray->HandleChatMessageEventL(TVIMPSTEnums::EIMNewMessage,buddyId->Des() );
  76     //STIF_ASSERT_NOT_NULL(procArray);
  77     MVIMPSTStorageContact* contact = vimpststoragecontact_stub::NewL();
  78        CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (const_cast<TDesC&>(contact->Name() ),
  79                const_cast<TDesC&>(contact->UserId() ),contact->ContactLink() );
  80 
  81        procArray->iItemArray.Append(contactItem );
  82     procArray->HandleChatMessageEventL(TVIMPSTEnums::EIMUnreadMessage,buddyId->Des() );
  83     STIF_ASSERT_NOT_NULL(procArray);
  84 
  85     procArray->HandleChatMessageEventL(TVIMPSTEnums::EIMUnreadChange,buddyId->Des() );
  86     STIF_ASSERT_NOT_NULL(procArray);
  87 
  88    // procArray->HandleChatMessageEventL(TVIMPSTEnums::EIMNewChat,buddyId->Des() );
  89    // STIF_ASSERT_NOT_NULL(procArray);
  90 
  91     procArray->HandleChatMessageEventL(TVIMPSTEnums::EIMChatStarted,buddyId->Des() );
  92     STIF_ASSERT_NOT_NULL(procArray);
  93 
  94     procArray->HandleChatMessageEventL(TVIMPSTEnums::EIMChatClosed,buddyId->Des() );
  95     STIF_ASSERT_NOT_NULL(procArray);
  96 
  97     procArray->HandleChatMessageEventL(TVIMPSTEnums::EIMAllChatClosed,buddyId->Des() );
  98     CleanupStack::PopAndDestroy(buddyId);
  99     STIF_ASSERT_NOT_NULL(procArray);
  100 
  101 
  102     }
  103 
  104 STIF_TESTDEFINE(t_ProcArr_HandleAddRequestEventL)
  105     {
  106     //void  HandleAddRequestEventL(TVIMPSTEnums::TOperationType aType, const TDesC& aRequesterId);
  107     vimpstengine_stub engin;
  108     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  109 
  110     _LIT(KText,"addcontact@presence");
  111     HBufC* buf = HBufC::NewL(32);
  112     CleanupStack::PushL(buf);
  113     *buf = KText;
  114     ///////Test case for Add request//////
  115     procArray->HandleAddRequestEventL(TVIMPSTEnums::EAddItem,buf->Des());
  116     STIF_ASSERT_NOT_NULL(procArray);
  117 
  118     for(TInt i=0;i<3;i++)
  119         {
  120         procArray->HandleAddRequestEventL(TVIMPSTEnums::EAddItem,buf->Des());
  121         }
  122     TInt count = procArray->iAddRequestArray.Count();
  123     STIF_ASSERT_EQUALS(1,count);
  124 
  125     ///////Test case for Update request//////
  126     //procArray->HandleAddRequestEventL(TVIMPSTEnums::EUpdateItem,buf->Des());
  127    // count = procArray->iAddRequestArray.Count();
  128   //  CleanupStack::PopAndDestroy(buf);
  129    // STIF_ASSERT_EQUALS(1,count);
  130     MVIMPSTProcessArrayObserver* ob = vimpstprocessarrayobserver_stub::NewL();
  131         procArray->AddObserver(ob);
  132     ///////Test case for Remove request//////
  133     procArray->HandleAddRequestEventL(TVIMPSTEnums::ERemoveItem,buf->Des());
  134     count = procArray->iAddRequestArray.Count();
  135     CleanupStack::PopAndDestroy(buf);
  136     STIF_ASSERT_EQUALS(0,count);
  137     }
  138 
  139 /* No test case for functions below as they will not leave or return any value
  140 void AddObserver(MVIMPSTProcessArrayObserver* aObserver)  ;
  141 void RemoveObserver() ;
  142 void ResetArray();
  143 void MapContactListPositions(RArray<TInt>& aPositionArray );
  144 void RemoveFriendRequestL(const TDesC& aRequesterId);
  145 void SetOwnAvatarIndexL( TInt aAvatarIndex );
  146 void ResetOpenConversationPendingMsg(); 
  147  */
  148 STIF_TESTDEFINE(t_ProcArr_Count)
  149     {
  150     vimpstengine_stub engin;
  151     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  152     _LIT(KText,"addcontact@presence");
  153     TPtrC buf = KText;
  154     procArray->HandleAddRequestEventL(TVIMPSTEnums::EAddItem,buf);
  155 
  156     for(TInt i=0;i<3;i++)
  157         {
  158         procArray->HandleAddRequestEventL(TVIMPSTEnums::EAddItem,buf);
  159         }
  160     TInt count = procArray->iAddRequestArray.Count();
  161     STIF_ASSERT_EQUALS(1,count);
  162     }
  163 
  164 STIF_TESTDEFINE(t_ProcArr_IsSubServiceSupportedL)
  165     {
  166     //TBool IsSubServiceSupportedL( TVIMPSTEnums::SubServiceType aType  ) const ;
  167     vimpstengine_stub engin;
  168     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  169     TBool result;
  170     result = procArray->IsSubServiceSupportedL(TVIMPSTEnums::EVoip);
  171     STIF_ASSERT_EQUALS(1,result);
  172     result = procArray->IsSubServiceSupportedL(TVIMPSTEnums::EPresence);
  173     STIF_ASSERT_EQUALS(1,result);
  174     result = procArray->IsSubServiceSupportedL(TVIMPSTEnums::EIM);
  175     STIF_ASSERT_EQUALS(1,result);
  176     result = procArray->IsSubServiceSupportedL(TVIMPSTEnums::ELast);
  177     STIF_ASSERT_EQUALS(1,result);
  178     }
  179 
  180 STIF_TESTDEFINE(t_ProcArr_GetType)
  181     {
  182     // virtual TVIMPSTEnums::TItem GetType(TInt aIndex) const;
  183     vimpstengine_stub engin;
  184     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  185 
  186     /*HBufC* contactData = HBufC::NewL(512);
  187     TPtr contactDataPtr( contactData->Des() );
  188     contactDataPtr = ;
  189      */
  190     _LIT(KText,"Nutan@presence");
  191     TDesC contactData = KText;
  192     MVIMPSTStorageContact* contact = vimpststoragecontact_stub::NewL();
  193     CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (const_cast<TDesC&>(contact->Name() ),
  194             const_cast<TDesC&>(contact->UserId() ),contact->ContactLink() );
  195 
  196     procArray->iItemArray.Append(contactItem );
  197 
  198     //EInvalid = -1, /* unknown Item */
  199     //EOwnStatusItem, /* Own item */
  200     //EContactItem, /* Contact Item */
  201     //EContactListItem, /* ContactList Item */
  202     //EFriendRequestItem,/* Friend request item */
  203     //EUnknonContactItem, /* contact item but not in friend list */
  204 
  205     TInt index = 0;
  206     TVIMPSTEnums::TItem itemType = procArray->GetType( index );
  207 
  208     STIF_ASSERT_EQUALS(TVIMPSTEnums::EOwnStatusItem,itemType);
  209     index = 2;
  210     itemType = procArray->GetType( index );
  211     STIF_ASSERT_EQUALS(TVIMPSTEnums::EContactItem,itemType);
  212     procArray->iItemArray.ResetAndDestroy();
  213     }
  214 
  215 STIF_TESTDEFINE(t_ProcArr_GetItemNameText)
  216     {
  217     //virtual TPtrC GetItemNameText(TInt aIndex); 
  218     vimpstengine_stub engin;
  219     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  220     //_LIT(KDummy,"dummy@gmail.com");
  221     _LIT(KDummy1,"dummy1@gmail.com");
  222    
  223     TPtrC contactData = KDummy1;
  224     //TDesC contactData = KDummy1;
  225     CVIMPSTProcessOwnDataItem* ownitem = CVIMPSTProcessOwnDataItem::NewL(contactData);
  226        procArray->iItemArray.Append(ownitem );
  227        MVIMPSTStorageContact* contact = vimpststoragecontact_stub::NewL();
  228            CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (const_cast<TDesC&>(contact->Name() ),
  229                    const_cast<TDesC&>(contact->UserId() ),contact->ContactLink() );
  230            procArray->iItemArray.Append(contactItem );
  231          
  232     TInt itemindex = 2;
  233     TPtrC itemname = procArray->GetItemNameText(itemindex);
  234     STIF_ASSERT_EQUALS( contactData,itemname);
  235 
  236     itemindex = -1;
  237     TPtrC itemname1 = procArray->GetItemNameText(itemindex);
  238     
  239     procArray->iItemArray.ResetAndDestroy();
  240     TPtrC nulldata = KNullDesC;
  241     STIF_ASSERT_EQUALS(nulldata,itemname1);
  242    // STIF_ASSERT_NULL(itemname1);
  243     }
  244 
  245 STIF_TESTDEFINE(t_ProcArr_Set_Get_LoginStateL)
  246     {
  247     //virtual TVIMPSTEnums::TVIMPSTRegistrationState GetLoginState();
  248     vimpstengine_stub engin;
  249     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  250 
  251     procArray->SetLoginStateL( TVIMPSTEnums::ESVCERegistered );
  252     TVIMPSTEnums::TVIMPSTRegistrationState aState = procArray->GetLoginState();
  253 
  254     STIF_ASSERT_EQUALS( TVIMPSTEnums::ESVCERegistered,aState);
  255     }
  256 
  257 STIF_TESTDEFINE(t_ProcArr_ContactLink)
  258     {
  259     //MVPbkContactLink* ContactLink(TInt aIndex);
  260     vimpstengine_stub engin;
  261     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  262 
  263     procArray->ContactLink( 1 );
  264     STIF_ASSERT_EQUALS( 1,1);
  265     }
  266 
  267 STIF_TESTDEFINE(t_ProcArr_GetOnlineStatusL)
  268     {
  269     //TVIMPSTEnums::TOnlineStatus GetOnlineStatusL(TInt aIndex);
  270     vimpstengine_stub engin;
  271     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  272     /*
  273                 EUnknown = -1, // unknown status 
  274                 EOffline, // Offline status 
  275                 EOnline, // Online status 
  276                 EInvisible, // Invisible status 
  277                 EAway, // Away status 
  278                 EBusy, // Busy status 
  279                 EOnPhone,
  280                 EDoNotDisturb,
  281                 EPending,
  282                 EBlocked
  283      */
  284     TInt index = 0;
  285     TVIMPSTEnums::TOnlineStatus aState = procArray->GetOnlineStatusL(index);
  286 
  287     STIF_ASSERT_EQUALS( TVIMPSTEnums::EOffline,aState);
  288     }
  289 
  290 STIF_TESTDEFINE(t_ProcArr_StatusTextL)
  291     {
  292     //const TDesC& StatusTextL(TInt aIndex ) ;
  293     vimpstengine_stub engin;
  294     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  295     TInt index = 0;
  296     _LIT(temptext, "dummy");
  297     TPtrC statustxt = KDummy(); 
  298     TPtrC statustext = procArray->StatusTextL(index);
  299     STIF_ASSERT_EQUALS( statustxt,statustext);
  300     }
  301 
  302 STIF_TESTDEFINE(t_ProcArr_IsMsgPending)
  303     {
  304     /*//TBool IsMsgPending(TInt aIndex);
  305     //void ResetPendingMsg(TInt aIndex);
  306     vimpstengine_stub engin;
  307     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  308     TInt index = 0;
  309     TBool pendingMsg = procArray->IsMsgPending(index);
  310     STIF_ASSERT_EQUALS( 0,pendingMsg);
  311     procArray->ResetPendingMsg(index);
  312     STIF_ASSERT_EQUALS( 0,pendingMsg);*/
  313     }
  314 
  315 STIF_TESTDEFINE(t_ProcArr_FindAnyContact)
  316     {
  317     //TBool FindAnyContact( const TDesC& aContactId );
  318     vimpstengine_stub engin;
  319     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  320     _LIT(KText,"dummy@presence");
  321     TPtrC contactData = KText;
  322     TBool contactExist = procArray->FindAnyContact(contactData);
  323     STIF_ASSERT_EQUALS( 1,contactExist);
  324     
  325     TPtrC contactData1 = KNullDesC;
  326     contactExist = procArray->FindAnyContact(contactData1);
  327     STIF_ASSERT_EQUALS( 0,contactExist);
  328     }
  329 
  330 STIF_TESTDEFINE(t_ProcArr_FindAnyContactServiceField)
  331     {
  332     vimpstengine_stub engin;
  333         CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  334         _LIT(KText,"dummy@presence");
  335         TPtrC contactData = KText;
  336         TBool contactExist = procArray->FindAnyContactServiceField(contactData);
  337         STIF_ASSERT_EQUALS( 1,contactExist);
  338         
  339         TPtrC contactData1 = KNullDesC;
  340         contactExist = procArray->FindAnyContactServiceField(contactData1);
  341         STIF_ASSERT_EQUALS( 0,contactExist);
  342     //TBool FindAnyContactServiceField( const TDesC& aContactId );
  343    
  344     }
  345 
  346 STIF_TESTDEFINE(t_ProcArr_FindAnyAddRequest)
  347     {
  348     //TBool FindAnyAddRequest( const TDesC& aRequesterId );
  349     vimpstengine_stub engin;
  350     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  351     _LIT(KText,"Nutan@presence");
  352     TPtrC contactData = KText;
  353     CVIMPSTProcessFriendRequestItem* frn = CVIMPSTProcessFriendRequestItem::NewL(contactData);
  354     procArray->iAddRequestArray.AppendL(frn);
  355     TBool addRequest = procArray->FindAnyAddRequest(contactData);
  356     STIF_ASSERT_EQUALS( 1,addRequest);
  357     _LIT(KText1,"Nutan1@presence");
  358     TPtrC contactData1 = KText1;
  359     addRequest = procArray->FindAnyAddRequest(contactData1);
  360     STIF_ASSERT_EQUALS( 0,addRequest);
  361     }
  362 
  363 STIF_TESTDEFINE(t_ProcArr_IsContactBlocked)
  364     {
  365     //TBool IsContactBlocked( const TDesC& aRequesterId );
  366     vimpstengine_stub engin;
  367     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  368     _LIT(KText,"blocked@presence");
  369     TPtrC contactData = KText;
  370     TBool contactBlocked = procArray->IsContactBlocked(contactData);
  371     STIF_ASSERT_EQUALS( 1,contactBlocked);
  372     _LIT(KText1,"Nutan1@presence");
  373     TPtrC contactData1 = KText1;
  374     contactBlocked = procArray->IsContactBlocked(contactData1);
  375     STIF_ASSERT_EQUALS( 0,contactBlocked);
  376     }
  377 
  378 STIF_TESTDEFINE(t_ProcArr_IsConversationExistL)
  379     {
  380     //TBool IsConversationExistL(const TDesC& aRecipientId) ;
  381     vimpstengine_stub engin;
  382     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  383     _LIT(KText,"addcontact@presence");
  384     TDesC contactData = KText;
  385     TBool conversationExist = procArray->IsConversationExistL(contactData);
  386     STIF_ASSERT_EQUALS( 0,conversationExist);
  387     }
  388 
  389 STIF_TESTDEFINE(t_ProcArr_FindContactIndexL)
  390     {
  391     //TInt FindContactIndexL( const TDesC& aContactId ) ;
  392     vimpstengine_stub engin;
  393     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  394     procArray->iContactListModel = vimpststorageitemlist_stub::NewL();
  395     _LIT(KText,"dummy@presence");
  396     TPtrC contactData = KText;
  397     
  398     TInt contactIndex = procArray->FindContactIndexL(contactData);
  399     STIF_ASSERT_EQUALS( 2,contactIndex);
  400     _LIT(KText1,"addcontact@presence");
  401     TPtrC contactData1 = KText1;
  402     contactIndex = procArray->FindContactIndexL(contactData1);
  403     STIF_ASSERT_EQUALS( -1,contactIndex);
  404     }
  405 
  406 STIF_TESTDEFINE(t_ProcArr_GetItemUserId)
  407     {
  408     //TPtrC GetItemUserId(TInt aIndex);
  409     vimpstengine_stub engin;
  410     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  411     _LIT(KText,"ownid@presence");
  412     TPtrC tempusrId = KText;
  413     CVIMPSTProcessOwnDataItem* ownitem = CVIMPSTProcessOwnDataItem::NewL(tempusrId);
  414     procArray->iItemArray.Append(ownitem );
  415 
  416     TInt index = 2;
  417     TPtrC userId = procArray->GetItemUserId(index);
  418     STIF_ASSERT_EQUALS(tempusrId,userId);
  419              
  420           
  421     MVIMPSTStorageContact* contact = vimpststoragecontact_stub::NewL();
  422     CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (const_cast<TDesC&>(contact->Name() ),
  423             const_cast<TDesC&>(contact->UserId() ),contact->ContactLink() );
  424     procArray->iItemArray.Append(contactItem );
  425 
  426     index = 3;
  427     _LIT(KText1,"dummy@presence");
  428     TPtrC tempusrId1 = KText1;
  429     TPtrC userId1 = procArray->GetItemUserId(index);
  430     STIF_ASSERT_EQUALS(tempusrId1,userId1);
  431     
  432     index = 4;
  433 
  434     TPtrC userId2 = procArray->GetItemUserId(index);
  435     TPtrC null = KNullDesC;
  436     STIF_ASSERT_EQUALS(null,userId2);
  437         
  438  
  439     }
  440 
  441 STIF_TESTDEFINE(t_ProcArr_LoginUserIdFromStoreL)
  442     {
  443     //const TDesC& LoginUserIdFromStoreL() const;
  444     vimpstengine_stub engin;
  445     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  446     _LIT(KText,"dummy@presence");
  447     TPtrC ownuserId = KText ;
  448     TPtrC userId = procArray->LoginUserIdFromStoreL();
  449     STIF_ASSERT_EQUALS(ownuserId ,userId);
  450     }
  451 
  452 STIF_TESTDEFINE(t_ProcArr_OwnAvatarIndexL)
  453     {
  454     //TInt OwnAvatarIndexL( ) ;
  455     vimpstengine_stub engin;
  456     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  457     _LIT(KText,"Nutan@presence");
  458     TInt avatarIndex = procArray->OwnAvatarIndexL();
  459     STIF_ASSERT_EQUALS(1 ,avatarIndex);
  460     }
  461 
  462 STIF_TESTDEFINE(t_ProcArr_OwnAvatarContentL)
  463     {
  464     //const TDesC8& OwnAvatarContentL( ) const ;
  465     vimpstengine_stub engin;
  466     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  467     _LIT8(KText,"avatar");
  468    
  469     TPtrC8 ownavacontent = KText;
  470     TPtrC8 avatarContent = procArray->OwnAvatarContentL();
  471     STIF_ASSERT_EQUALS( ownavacontent,avatarContent);
  472     }
  473 
  474 STIF_TESTDEFINE(t_ProcArr_AvatarContent)
  475     {
  476     //const TDesC8& AvatarContent(TInt aContactIndex) ;
  477     vimpstengine_stub engin;
  478     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  479     _LIT8(KText,"avatar");
  480     
  481     TPtrC8 avacontent = KText;
  482     MVIMPSTStorageContact* contact = vimpststoragecontact_stub::NewL();
  483        CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (const_cast<TDesC&>(contact->Name() ),
  484                const_cast<TDesC&>(contact->UserId() ),contact->ContactLink() );
  485        procArray->iItemArray.Append(contactItem );
  486     TInt index = 1;
  487     TPtrC8 avatarContent = procArray->AvatarContent(index);
  488     STIF_ASSERT_EQUALS(avacontent,avatarContent);
  489     }
  490 
  491 STIF_TESTDEFINE(t_ProcArr_SetAvatarIndex)
  492     {
  493     //void SetAvatarIndex( TInt aContactIndex, TInt aAvatarIndex );
  494     //TInt AvatarIndex(TInt aContactIndex) ;
  495     vimpstengine_stub engin;
  496     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  497     TInt ContactIndex = 1;
  498     TInt index = 1;
  499     MVIMPSTStorageContact* contact = vimpststoragecontact_stub::NewL();
  500          CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (const_cast<TDesC&>(contact->Name() ),
  501                  const_cast<TDesC&>(contact->UserId() ),contact->ContactLink() );
  502          procArray->iItemArray.Append(contactItem );
  503     procArray->SetAvatarIndex(ContactIndex, index);
  504     TInt avaIndex = procArray->AvatarIndex(ContactIndex);
  505     STIF_ASSERT_EQUALS(index ,avaIndex);
  506     }
  507 
  508 STIF_TESTDEFINE(t_ProcArr_FindArrayItem)
  509     {
  510     //MVIMPSTProcessArrayItem* FindArrayItem( const TDesC& aSenderId );
  511     vimpstengine_stub engin;
  512     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  513     _LIT(KText,"ownid@presence");
  514         TPtrC tempusrId = KText;
  515         CVIMPSTProcessOwnDataItem* ownitem = CVIMPSTProcessOwnDataItem::NewL(tempusrId);
  516         procArray->iItemArray.Append(ownitem );
  517 
  518     MVIMPSTProcessArrayItem* arrayItem = procArray->FindArrayItem(tempusrId);
  519     TPtrC userid = arrayItem->GetItemUserId();
  520     STIF_ASSERT_EQUALS( tempusrId,userid);
  521     }
  522 /*
  523                                     
  524 private: // Implementation         
  525       /**
  526        * FillItemL: fill up the individual item in the array
  527        * @return void
  528        **
  529        void FillItemL();
  530       /**
  531        * FillOwnDataL: fill up fill the owndata item
  532        * @return void
  533        **
  534        TBool  FillOwnDataL();
  535        
  536       /**
  537        * FillArray: fill up the complete array
  538        * @return void
  539        **
  540        void FillArrayL();
  541         
  542        /**
  543         * fill the unknown contact to main array
  544         * @return void
  545         **
  546        void FillUnknownContactsL();
  547        /**
  548         * FillAddRequestDataL: fill up the add request to array
  549         * @return void
  550         **
  551        void FillAddRequestDataL();
  552       
  553        /**
  554         * remove all the unknown contacts from main array iItemArray,
  555         * so that unknown contact can pesist till the session is entertainesd.
  556         * @return void
  557         **
  558        void RemoveUnKnownContacts();
  559         /**
  560          * RemoveAddRequestData: removes data from iItemArray,
  561          * so that request can pesist till the reqest is entertainesd.
  562          * @return void
  563          **
  564        void RemoveAddRequestData();
  565        
  566        /**
  567         * handlle the message which is from unknown buddy 
  568         * @param aSenderId , Sender Id 
  569         * @return void
  570         **
  571        void DoHandleUnKnownContactMessageL( const TDesC& aSenderId ,TBool aIsMsgPending);
  572        
  573        /**
  574         * get the all open chat and append unknown contacts
  575         * @return void
  576         **
  577        void GetAndCreateOpenChatListL();
  578        
  579        /**
  580         * remove the item from invitation or unknown array if found
  581         * @param aContactId :  conatct user Id
  582         * @return ETrue if contact is removed
  583         *
  584        TBool RemoveFromUnknonOrInvitationListL( const TDesC& aContactId , TBool aBlocked )  ;
  585        /**
  586         * play the incoming message tone.
  587         *
  588        void PlayMsgBeepL();
  589        
  590        /**
  591         * @return ETrue if unread message exist
  592         *
  593        TBool IsUnreadMessageExistsL(const TDesC& aRecipientId);
  594        /**
  595         * helper method for removing unknown contacts
  596         * @return ETrue if contact is removed
  597         *
  598        TBool RemoveFromUnknonListL( const TDesC& aAddedUserId );
  599        /**
  600         * helper method for removing invitation contacts
  601         * @return ETrue if contact is removed
  602         *
  603        TBool RemoveFromInvitationListL( const TDesC& aAddedUserId );
  604        /**
  605         * helper method for finding and marking as open chat
  606         * @return ETrue if contact is find
  607         *
  608        TBool FindAndMarkContactAsOpenChat( const TDesC& aContactId, TBool aMesssagePending  );        
  609 */
  610 
  611 
  612 STIF_TESTDEFINE(t_ProcArr_GetSelectedItemIndex)
  613 {
  614     vimpstengine_stub engin;
  615     CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  616     _LIT(KDummy,"dummy@presence");
  617     _LIT(KDummy1,"dummy1@gmail.com");
  618 
  619     TInt index = procArray->GetSelectedItemIndex(KDummy1);
  620     STIF_ASSERT_EQUALS(index ,KErrNotFound);
  621     
  622    procArray->iItemArray.ResetAndDestroy();
  623     
  624     _LIT(KText,"ownid@presence");
  625             TPtrC tempusrId = KText;
  626             CVIMPSTProcessOwnDataItem* ownitem = CVIMPSTProcessOwnDataItem::NewL(tempusrId);
  627             procArray->iItemArray.Append(ownitem );
  628             
  629             TInt index1 = procArray->GetSelectedItemIndex(tempusrId);
  630                STIF_ASSERT_EQUALS(index1 ,0);
  631             
  632             MVIMPSTStorageContact* contact = vimpststoragecontact_stub::NewL();
  633                  CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (const_cast<TDesC&>(contact->Name() ),
  634                          const_cast<TDesC&>(contact->UserId() ),contact->ContactLink() );
  635                  procArray->iItemArray.Append(contactItem );
  636     
  637    
  638     
  639     TInt index2 = procArray->GetSelectedItemIndex(KDummy);
  640        STIF_ASSERT_EQUALS(index2 ,1);
  641 }
  642 
  643 STIF_TESTDEFINE(t_ProcArr_HandleStorageChangeL)
  644 {
  645 vimpstengine_stub engin;
  646 CVIMPSTProcessArray* procArray = CVIMPSTProcessArray::NewL(engin);
  647 vimpststoragecontactlist_stub contactlist;
  648 vimpststoragecontact_stub contact;
  649 MVIMPSTProcessArrayObserver* ob = vimpstprocessarrayobserver_stub::NewL();
  650 procArray->AddObserver(ob);
  651 
  652 TVIMPSTEnums::TVIMPSTStorgaeEventType eventType = TVIMPSTEnums::EStorageEventContactAddition;
  653 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  654 STIF_ASSERT_NOT_NULL(procArray);
  655 
  656 eventType = TVIMPSTEnums::EStorageEventContactDelete;
  657 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  658 STIF_ASSERT_NOT_NULL(procArray);
  659 
  660 eventType = TVIMPSTEnums::EStorageEventContactChange;
  661 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  662 STIF_ASSERT_NOT_NULL(procArray);
  663 
  664 eventType = TVIMPSTEnums::EStorageAvatarChange;
  665 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  666 STIF_ASSERT_NOT_NULL(procArray);
  667 
  668 eventType = TVIMPSTEnums::EStoragePresenceChange;
  669 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  670 STIF_ASSERT_NOT_NULL(procArray);
  671 
  672 eventType = TVIMPSTEnums::EStorageMultiplePresenceChange;
  673 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  674 STIF_ASSERT_NOT_NULL(procArray);
  675 
  676 eventType = TVIMPSTEnums::EStorageOwnPresenceChange;
  677 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  678 STIF_ASSERT_NOT_NULL(procArray);
  679 
  680 eventType = TVIMPSTEnums::EStorageAllContactRemoved;
  681 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  682 STIF_ASSERT_NOT_NULL(procArray);
  683 
  684 eventType = TVIMPSTEnums::EStorageContactFetchComplete;
  685 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  686 STIF_ASSERT_NOT_NULL(procArray);
  687 
  688 eventType = TVIMPSTEnums::EStorageEventOwnUserChanged;
  689 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  690 STIF_ASSERT_NOT_NULL(procArray);
  691 
  692 eventType = TVIMPSTEnums::EStorageEventUserIdPostChange;
  693 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  694 STIF_ASSERT_NOT_NULL(procArray);
  695 
  696 eventType = TVIMPSTEnums::EStorageContactReadComplete;
  697 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  698 STIF_ASSERT_NOT_NULL(procArray);
  699 
  700 eventType = TVIMPSTEnums::EStorageContactReading;
  701 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  702 STIF_ASSERT_NOT_NULL(procArray);
  703 
  704 eventType = TVIMPSTEnums::EStorageContactFetching;
  705 procArray->HandleStorageChangeL(eventType,&contactlist,&contact,ETrue);
  706 STIF_ASSERT_NOT_NULL(procArray);
  707 }
  708 #endif
  709 /**
  710  * END OF TEST CASES SECTION
  711  */
***TER 100% (0/0) of SOURCE FILE t_vimpstcmdprocess_processarray_utest.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD20.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD20.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #20/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragemanagerfactory.cpp
-Instrumentation mode: function-decision
-TER: 63 % ( 5/ 8)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : cvimpststoragemanagerfactory.cpp
  4 *  Part of     : IMUiServiceTab / vimpststorage
  5 *  Description : Implementation of CVIMPSTStorageManagerFactory
  6 *  Version     : %version: 3.1.2 %
  7 *
  8 *  Copyright (c) 2008 Nokia Corporation.
  9 *  This material, including documentation and any related 
  10 *  computer programs, is protected by copyright controlled by 
  11 *  Nokia Corporation. All rights are reserved. Copying, 
  12 *  including reproducing, storing, adapting or translating, any 
  13 *  or all of this material requires the prior written consent of 
  14 *  Nokia Corporation. This material also contains confidential 
  15 *  information which may not be disclosed to others without the 
  16 *  prior written consent of Nokia Corporation.
  17 * ==============================================================================
  18 */
  19 
  20 
  21 // INCLUDE FILES
  22 #include "cvimpststoragemanagerfactory.h"
  23 #include "s_vimpststoragecontact.h"
  24 #include "MVIMPSTSTORAGECONTACT.H"
  25 #include "s_vimpststorageserviceview.h"
  26 #include "s_storageitemmodel.h"
  27 
  28 // ============================ MEMBER FUNCTIONS ===============================
  29 
  30 // -----------------------------------------------------------------------------
  31 // CVIMPSTStorageManagerFactory::InitialiseLibraryL
  32 // Factory method that initialises the vimpststorage library
  33 // used by CVIMPSTViewIdFactory
  34 // -----------------------------------------------------------------------------
  35 //
 
- 36 EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseLibraryL()
  37     {
  38    
  39     }
  40 
  41 // -----------------------------------------------------------------------------
  42 // CVIMPSTStorageManagerFactory::Release
  43 // Factory method to release the resource owned by the vimpststorage library
  44 // -----------------------------------------------------------------------------
  45 //
 
- 46 EXPORT_C TInt CVIMPSTStorageManagerFactory::Release()
  47     {
 - 48     return 1;  
  49     }
  50 
  51 // -----------------------------------------------------------------------------
  52 // CVIMPSTStorageManager::InitialiseViewL()
  53 // -----------------------------------------------------------------------------
  54 //
 
38 38   55 EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseViewL(
  56                                     TUint32 aServiceId,
  57                                     const TDesC& aStoreName,
  58                                     const TDesC& aServiceName)
  59     {
  60     
  61     }    
  62     
  63 
  64 // -----------------------------------------------------------------------------
  65 // CVIMPSTStorageManager::ContactListInterfaceL()
  66 // -----------------------------------------------------------------------------
  67 //
 
77   68 EXPORT_C MVIMPSTStorageServiceView* CVIMPSTStorageManagerFactory::ContactListInterfaceL(TUint32 aServiceId)
  69     {
  70     MVIMPSTStorageServiceView *contact = vimpstserviceview_stub::NewL();
77    71     return contact ;
  72     }    
  73  
  74 // -----------------------------------------------------------------------------
  75 // CVIMPSTStorageManagerFactory::ItemModelInterfaceL
  76 // -----------------------------------------------------------------------------
  77 //
 
63   78 EXPORT_C MVIMPSTStorageItemModel* CVIMPSTStorageManagerFactory::ItemModelInterfaceL( TUint32 aServiceId )
  79    {
  80    MVIMPSTStorageItemModel* model = vimpststorageitemlist_stub::NewL();
63    81    return model;
  82     }      
  83 
  84 //  End of File
***TER 63% (5/8) of SOURCE FILE s_vimpststoragemanagerfactory.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD21.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD21.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,256 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #21/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststorageserviceview.cpp
-Instrumentation mode: function-decision
-TER: 55 % ( 30/ 55)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ============================================================================
  3 *  Name        : s_vimpststorageserviceview.cpp
  4 *  Part of     : 
  5 *  Description : 
  6 *  Version     : %version: 2 %
  7 *
  8 *  Copyright © 2006, 2007 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 * Template version: 4.1
  18 */
  19 
  20 #include "s_vimpststorageserviceview.h"
  21 #include "s_vimpststoragecontact.h"
  22 
 
78   23 MVIMPSTStorageServiceView* vimpstserviceview_stub::NewL()
  24     {
  25     MVIMPSTStorageServiceView* ob = new(ELeave)vimpstserviceview_stub;
78    26         return ob;
  27     }
  28 
 
63 63   29 void vimpstserviceview_stub::AddObserverL( MVIMPSTStorageContactsObserver* aObserver ) 
  30     {
  31 
  32     }
  33 
 
23 23   34 void vimpstserviceview_stub::RemoveObserver( MVIMPSTStorageContactsObserver* aObserver )
  35     {
  36     
  37     }
  38 
  39 
 
19   40 MVIMPSTStorageContact* vimpstserviceview_stub::FindContactByUserId( const TDesC& aUserId )
  41     {
10   42     if(aUserId.Compare(_L("dummy@presence"))==0)
  43         {
  44     MVIMPSTStorageContact* contact = vimpststoragecontact_stub::NewL();
10    45     return contact;
  46         }
   47     return NULL;
  48     }
  49 
  50 
 
- 51 TInt vimpstserviceview_stub::ListCount() const
  52 {
 - 53 return 1;
  54 }
  55 
 
- 56 MVIMPSTStorageContactList& vimpstserviceview_stub::ListAt( TInt aIndex ) const 
  57 {
  58 MVIMPSTStorageContactList *abc = NULL;
  59     
 - 60 return *abc;
  61 }
  62 
  63 
 
- 64 MVIMPSTStorageContactList* vimpstserviceview_stub::FindContactList( const TDesC& aListId )
  65     {
 - 66     return NULL;
  67     }
  68 
 
- 69 MVIMPSTStorageContactList* vimpstserviceview_stub::CreateContactListL( const TDesC& aContactListId, 
  70         const TDesC& aDisplayName ) 
  71     {
  72     MVIMPSTStorageContactList *abc = NULL;
  73         
 - 74     return abc;
  75     }
  76 
 
- 77 void vimpstserviceview_stub::RemoveContactList( const TDesC& aContactListId )
  78     {
  79     
  80     }
  81 
  82 
 
- 83 TInt vimpstserviceview_stub::ContactCount(TBool aSkipOfflineContacts ) const
  84 {
 - 85 return 0;
  86 }
  87 
  88 
  89 
 
- 90 MVIMPSTStorageContact* vimpstserviceview_stub::UpdatePresenceL(const TDesC& aContactId, 
  91         TVIMPSTEnums::TOnlineStatus aStatus, 
  92         const TDesC& aStatusText,
  93         const TDesC8& aAvatarData,
  94         TBool aIsClearingAvatar ) 
  95     {
 - 96     return NULL;
  97     }
  98 
 
- 99 MVIMPSTStorageContact* vimpstserviceview_stub::UpdateAvatarL(const TDesC& aContactId,
  100         const TDesC8& aAvatarData )
  101     {
 - 102     return NULL;
  103     }
  104 
 
- 105 MVIMPSTStorageContact* vimpstserviceview_stub::CreateNewContactL(const TDesC& aUserId, 
  106         const TDesC& aDisplayName,
  107         TBool aIsInvitationItem ,
  108         TBool aInvitationAutoAccept)
  109     {
  110     MVIMPSTStorageContact* contact = NULL;
 - 111     return  contact;
  112     }
  113 
 
  114 TInt vimpstserviceview_stub::CreateNewContactFromRetrivedIdL(  TInt aIndexToUse  )
  115     {
   116     return 1;
  117     }
  118 
 
  119 TInt vimpstserviceview_stub::DeleteNewContactFromRetrivedIdL(  TInt aIndexToUse  )
  120     {
   121     return 0;
  122     }
  123 
 
- 124 TInt vimpstserviceview_stub::RemoveContactL( MVIMPSTStorageContact* aContact  )
  125     {
 - 126     return 0;
  127     }
  128 
  129 
 
- 130 void vimpstserviceview_stub::CreateNewFetchContactsL( RArray <TPtrC> &aFirstNameList, 
  131         RArray <TPtrC> &aServiceField )
  132     {
  133     
  134     }
  135 
  136 
 
  137 TBool  vimpstserviceview_stub::IsLocalStore() const
  138 {
   139 return ETrue;
  140 }
  141 
  142 
 
  143 TInt vimpstserviceview_stub::RetriveLinkXSPIdsL(const TDesC8& aContactPackLink )
  144     {
   145     return 3;
  146     }
 
12   147 const TDesC& vimpstserviceview_stub::GetRetrieveXSPIdL(TInt aIndex )
  148     {
  149     if(aIndex ==0)
  150         {
  151         _LIT(KText1,"blocked@presence");
   152         return KText1();
  153         }
  154     if(aIndex ==1)
  155         {
  156         _LIT(KText2,"dummy@presence");
   157         return KText2();
  158         }
- 159     if(aIndex ==2)
  160         {
  161         _LIT(KText3,"contact@presence");
   162         return KText3();
  163         }
  164 
  165     }
  166 
 
  167 MVIMPSTStorageContact* vimpstserviceview_stub::FindContactByLink(const MVPbkContactLink& aContactLink )
  168     {
   169     return NULL;
  170     }
  171 
  172 
 
- 173 void vimpstserviceview_stub::Sort( const TDesC& aContactListId)
  174     {
  175     
  176     }
  177 
 
72   178 MVIMPSTStorageContact& vimpstserviceview_stub::OwnContactL() 
  179     {
  180     MVIMPSTStorageContact *abc = vimpststoragecontact_stub::NewL();
  181         
72    182     return *abc;
  183     }
  184 
 
- 185 void vimpstserviceview_stub::DeleteDatabaseL() 
  186     {
  187     
  188     }
  189 
 
- 190 void vimpstserviceview_stub::SetOwnUserIdL(const TDesC& aUserId ) 
  191     {
  192     
  193     }
  194 
 
- 195 void vimpstserviceview_stub::SetUnnamedTextL(HBufC* aUnnamedText )
  196     {
  197     
  198     }
  199 
  200 
  201 
  202 // End of File
***TER 55% (30/55) of SOURCE FILE s_vimpststorageserviceview.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD22.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD22.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #22/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdaddcontact.cpp
-Instrumentation mode: function-decision
-TER: 72 % ( 26/ 36)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstcmdaddcontact.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version: ou1s60rt#19 %
  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 "cvimpstcmdaddcontact.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 "mvimpstenginecontactmgmtextention.h"
  29 #include "mvimpstengineextentionfeatures.h"
  30 #include <MVPbkStoreContact.h>
  31 #include <MVPbkFieldType.h>
  32 #include <MVPbkContactFieldTextData.h>
  33 #include <MVPbkContactFieldUriData.h>
  34 
  35 #include "cvimpststoragemanagerfactory.h"
  36 #include "mvimpststorageserviceview.h"
  37 #include "mvimpststoragecontact.h"
  38 #include "tvimpstenums.h" 
  39 #include "tvimpstconsts.h"
  40 #include "mvimpstenginesubservice.h"
  41 #include "mvimpstenginepresencesubservice.h"
  42 
  43 // Constants
  44 _LIT( KListNameAllBuddy ,"buddylist" );
  45 
  46 // --------------------------------------------------------------------------
  47 // CVIMPSTCmdAddContact::CVIMPSTCmdAddContact
  48 // --------------------------------------------------------------------------
  49 //
 
  50 CVIMPSTCmdAddContact::CVIMPSTCmdAddContact( 
  51         const TInt aCommandId ,const TDesC& aContactId,
  52         MVIMPSTEngine& aEngine) :            
  53             iCommandId( aCommandId ),
  54             iContactId( aContactId ),
  55             iEngine(aEngine)
  56     {
  57     }
  58 
  59 // --------------------------------------------------------------------------
  60 // CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact
  61 // --------------------------------------------------------------------------
  62 //
 
  63 CVIMPSTCmdAddContact::~CVIMPSTCmdAddContact()
  64     {    
  65     
  66     }
  67 
  68 // --------------------------------------------------------------------------
  69 // CVIMPSTCmdAddContact::NewL
  70 // --------------------------------------------------------------------------
  71 //
 
  72 CVIMPSTCmdAddContact* CVIMPSTCmdAddContact::NewL( 
  73         const TInt aCommandId,const TDesC& aContactId,
  74         MVIMPSTEngine& aEngine)
  75     {
  76     CVIMPSTCmdAddContact* self = new (ELeave ) CVIMPSTCmdAddContact( aCommandId ,aContactId, aEngine);
  77     self->ConstructL(); //use contsurctL if necessary
   78     return self;
  79     }
  80 // --------------------------------------------------------------------------
  81 // CVIMPSTCmdAddContact::ConstructL
  82 // --------------------------------------------------------------------------
  83 //
 
  84 void CVIMPSTCmdAddContact::ConstructL()
  85     {    
  86     iError = KErrNone;
  87     }
  88 
  89 // --------------------------------------------------------------------------
  90 // CVIMPSTCmdAddContact::ExecuteLD
  91 // --------------------------------------------------------------------------
  92 //
 
  93 void CVIMPSTCmdAddContact::ExecuteLD()
  94     {
  95       CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd::ExecuteLD");
  96     //push to the cleanupstack
  97     CleanupStack::PushL( this );
  98     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iEngine.ServiceId()) ;
- 99     if(storage )
  100         {
- 101         if( !IsContactBlocked(iContactId) )
  102            {
  103            MVIMPSTStorageContact* alreadyExist = storage->FindContactByUserId( iContactId );
- 104            if( !alreadyExist )
  105             {
  106             iError = KErrNone;
  107             MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::EContactManagement);
- 108             if (feature)   
  109                {
  110                MVIMPSTEngineContactMgmtExtention& contactMgr = 
  111                                  MVIMPSTEngineContactMgmtExtention::Cast (*feature);
  112                // if there is a scenario when the user enters only the firstname , then userid is null.
  113                //In this case don't send it to the server, Add the contact to the servicetab and 
  114                //presence will not be visible.
  115                // check if contact is in the blocked list.
  116                // iError already exist
- 117                if( iContactId.Length() )
  118                   {
  119                   iError = contactMgr.AddServerContactL(KListNameAllBuddy,iContactId, KNullDesC() );
  120                   }//End if(iContactId)
  121                }   //End if(feature)
- 122             if(KErrNone == iError)
  123                {
  124                storage->CreateNewContactL( iContactId );   
  125                }
  126             }//End if(alreadyExist)
    127           else   
  128                {
  129                iError = EErrExistInContactList;      
  130                }
  131            }
    132         else
  133            {
  134            iError = EErrExistInBlockList;      
  135            }
  136         }//End  if(storage)
  137             
  138     CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd:: CommandFinished");
  139 
  140     if(iObserver)
  141        {
  142        iObserver->CommandFinishedL(*this);
  143        }
  144    CHAT_DP_FUNC_ENTER("CVIMPSTEnableServiceCmd:: CommandFinished");   
  145    CleanupStack::PopAndDestroy();   
  146    CHAT_DP_FUNC_DONE("CVIMPSTEnableServiceCmd::ExecuteLD");   
  147     }
  148 
  149 // --------------------------------------------------------------------------
  150 // CVIMPSTCmdAddContact::IsContactBlocked
  151 // --------------------------------------------------------------------------
 
  152 TBool CVIMPSTCmdAddContact::IsContactBlocked(const TDesC& aUserId)
  153    {
  154       MVIMPSTEngineSubService* subService =          
  155                         (iEngine.SubService(TVIMPSTEnums::EPresence));
- 156     if(subService)
  157         {
  158         MVIMPSTEnginePresenceSubService& presence = 
  159               MVIMPSTEnginePresenceSubService::Cast (*subService);
  160               
  161         RPointerArray<HBufC> *blockedlist = presence .GetBlockedList();
  162         
- 163         if(blockedlist)
  164            {
  165            for(TInt i=0; i<blockedlist->Count(); ++i)
  166             {
- 167             if(0 == aUserId.CompareC((*blockedlist)[i]->Des()))
  168                {
 - 169                return ETrue;
  170                }
  171             }
  172            }
  173         }
   174     return EFalse;  
  175    }
  176 
  177 // --------------------------------------------------------------------------
  178 // CVIMPSTCmdAddContact::AddObserver
  179 // --------------------------------------------------------------------------
  180 //
 
  181 void CVIMPSTCmdAddContact::AddObserver( MVIMPSTCmdObserver& aObserver )
  182     {
  183     // store the observer to notify the command completion
  184     iObserver = &aObserver;
  185     }
  186 
  187 
  188 // --------------------------------------------------------------------------
  189 // CVIMPSTCmdAddContact::CommandId
  190 // --------------------------------------------------------------------------
  191 //
 
  192 TInt CVIMPSTCmdAddContact::CommandId() const
  193    {
   194    return iCommandId;   
  195    }
  196 
  197 // --------------------------------------------------------------------------
  198 // CVIMPSTCmdAddContact::Result
  199 // --------------------------------------------------------------------------
  200 //
 
  201 TInt CVIMPSTCmdAddContact::Result() const
  202    {
  203    //return valid data regd the command operation
   204    return iError;
  205    }
  206 
  207 // End of File
***TER 72% (26/36) of SOURCE FILE cvimpstcmdaddcontact.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD23.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD23.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #23/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdaddtopbk.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 //
 
  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 //
 
  50 CVIMPSTCmdAddToPbk::~CVIMPSTCmdAddToPbk()
  51     {    
  52     
  53     }
  54 
  55 // --------------------------------------------------------------------------
  56 // CVIMPSTCmdAddToPbk::NewL
  57 // --------------------------------------------------------------------------
  58 //
 
  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 //
 
  71 void CVIMPSTCmdAddToPbk::ConstructL()
  72     {    
  73     iError = KErrNone;
  74     }
  75 
  76 // --------------------------------------------------------------------------
  77 // CVIMPSTCmdAddToPbk::ExecuteLD
  78 // --------------------------------------------------------------------------
  79 //
 
  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 //
 
  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 //
 
  119 TInt CVIMPSTCmdAddToPbk::CommandId() const
  120     {
   121     return iCommandId;  
  122     }
  123 
  124 // --------------------------------------------------------------------------
  125 // CVIMPSTCmdAddToPbk::Result
  126 // --------------------------------------------------------------------------
  127 //
 
  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 93% (14/15) of SOURCE FILE cvimpstcmdaddtopbk.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD24.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD24.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #24/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdblockcontact.cpp
-Instrumentation mode: function-decision
-TER: 79 % ( 15/ 19)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstcmdblockcontact.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version: 10 %
  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 "cvimpstcmdblockcontact.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 "cvimpststoragemanagerfactory.h"
  29 #include "mvimpststorageserviceview.h"
  30 
  31 #include "mvimpstenginesubservice.h"
  32 #include "mvimpstenginepresencesubservice.h"
  33 #include "tvimpstconsts.h"
  34 #include "MVIMPSTProcessArray.h"
  35 // Constants
  36 
  37 // --------------------------------------------------------------------------
  38 // CVIMPSTCmdBlockContact::CVIMPSTCmdBlockContact
  39 // --------------------------------------------------------------------------
  40 //
 
  41 CVIMPSTCmdBlockContact::CVIMPSTCmdBlockContact( 
  42         const TInt aCommandId , const TDesC& aContactId,
  43         MVIMPSTProcessArray& aArrayProcess,
  44         MVIMPSTEngine& aEngine) :            
  45             iCommandId( aCommandId ),
  46             iContactId( aContactId ),
  47             iProcessArray( aArrayProcess ),
  48             iEngine(aEngine)
  49     {
  50     }
  51 
  52 // --------------------------------------------------------------------------
  53 // CVIMPSTCmdBlockContact::~CVIMPSTCmdBlockContact
  54 // --------------------------------------------------------------------------
  55 //
 
  56 CVIMPSTCmdBlockContact::~CVIMPSTCmdBlockContact()
  57     {    
  58     
  59     }
  60 
  61 // --------------------------------------------------------------------------
  62 // CVIMPSTCmdBlockContact::NewL
  63 // --------------------------------------------------------------------------
  64 //
 
  65 CVIMPSTCmdBlockContact* CVIMPSTCmdBlockContact::NewL( 
  66         const TInt aCommandId, const TDesC& aContactId,
  67         MVIMPSTProcessArray& aArrayProcess,
  68         MVIMPSTEngine& aEngine)
  69     {
  70     CVIMPSTCmdBlockContact* self = new (ELeave ) CVIMPSTCmdBlockContact( aCommandId ,aContactId, aArrayProcess ,aEngine);
  71     self->ConstructL(); //use contsurctL if necessary
   72     return self;
  73     }
  74 // --------------------------------------------------------------------------
  75 // CVIMPSTCmdBlockContact::ConstructL
  76 // --------------------------------------------------------------------------
  77 //
 
  78 void CVIMPSTCmdBlockContact::ConstructL()
  79     {    
  80     iError = KErrNotFound;
  81     }
  82 
  83 // --------------------------------------------------------------------------
  84 // CVIMPSTCmdBlockContact::ExecuteLD
  85 // --------------------------------------------------------------------------
  86 //
 
  87 void CVIMPSTCmdBlockContact::ExecuteLD()
  88     {
  89       CHAT_DP_FUNC_ENTER("CVIMPSTCmdBlockContact::ExecuteLD");
  90     //push to the cleanupstack
  91     CleanupStack::PushL( this );       
  92     iError = KErrGeneral;
- 93     if(iContactId.Length())
  94         {
  95         //Get Presence SubService           
  96         MVIMPSTEngineSubService* subService =          
  97         (iEngine.SubService(TVIMPSTEnums::EPresence));
- 98         if (subService && iEngine.IsBlockSupportedL())
  99             {
  100             MVIMPSTEnginePresenceSubService& presence = 
  101                 MVIMPSTEnginePresenceSubService::Cast (*subService);
  102             iError = presence.AddToBlockListL(iContactId);
  103             CHAT_DP( D_CHAT_LIT(" -> After iError: %d" ), iError);
  104             }
  105         }
  106     CHAT_DP_FUNC_ENTER("CVIMPSTCmdBlockContact:: CommandFinished");
- 107     if( iError == KErrNone )
  108         {
  109         iProcessArray.RemoveFromUnknonOrInvitationListL( iContactId ,ETrue );
  110         }
- 111     if(iObserver)
  112        {
  113        iObserver->CommandFinishedL(*this);
  114        }
  115    CHAT_DP_FUNC_ENTER("CVIMPSTCmdBlockContact:: CommandFinished");   
  116    CleanupStack::PopAndDestroy();   
  117    CHAT_DP_FUNC_DONE("CVIMPSTCmdBlockContact::ExecuteLD");   
  118     }
  119 
  120 
  121 // --------------------------------------------------------------------------
  122 // CVIMPSTCmdBlockContact::AddObserver
  123 // --------------------------------------------------------------------------
  124 //
 
  125 void CVIMPSTCmdBlockContact::AddObserver( MVIMPSTCmdObserver& aObserver )
  126     {
  127     // store the observer to notify the command completion
  128     iObserver = &aObserver;
  129     }
  130 
  131 
  132 // --------------------------------------------------------------------------
  133 // CVIMPSTCmdBlockContact::CommandId
  134 // --------------------------------------------------------------------------
  135 //
 
  136 TInt CVIMPSTCmdBlockContact::CommandId() const
  137    {
   138    return iCommandId;   
  139    }
  140 
  141 // --------------------------------------------------------------------------
  142 // CVIMPSTCmdBlockContact::Result
  143 // --------------------------------------------------------------------------
  144 //
 
  145 TInt CVIMPSTCmdBlockContact::Result() const
  146    {
  147    //return valid data regd the command operation
   148    return iError;
  149    }
  150 
  151 // End of File
***TER 79% (15/19) of SOURCE FILE cvimpstcmdblockcontact.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD25.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD25.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #25/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcancellogin.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 12/ 12)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstcmdcancellogin.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : cancel login command implementation 
  6 *  Version     : %version: 2 %
  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 
  21 #include "cvimpstcmdcancellogin.h"
  22 
  23 #include "vimpstcmd.hrh"
  24 #include "mvimpstcmdobserver.h"
  25 #include "vimpstdebugprint.h" 
  26 
  27 #include <e32def.h>
  28 #include "mvimpstengine.h"
  29 
  30 
  31 // --------------------------------------------------------------------------
  32 // CVIMPSTCmdLogout::CVIMPSTCmdLogout
  33 // --------------------------------------------------------------------------
  34 //
 
  35 CVIMPSTCmdCancelLogin::CVIMPSTCmdCancelLogin( const TInt aCommandId, 
  36         MVIMPSTEngine& aEngine) :     
  37         iCommandId( aCommandId ),
  38         iEngine(aEngine)
  39         {
  40         }
  41 
  42 // --------------------------------------------------------------------------
  43 // CVIMPSTCmdCancelLogin::~CVIMPSTCmdCancelLogin
  44 // --------------------------------------------------------------------------
  45 //
 
  46 CVIMPSTCmdCancelLogin::~CVIMPSTCmdCancelLogin()
  47     {    
  48     }
  49 
  50 // --------------------------------------------------------------------------
  51 // CVIMPSTCmdCancelLogin::NewL
  52 // --------------------------------------------------------------------------
  53 //
 
  54 CVIMPSTCmdCancelLogin* CVIMPSTCmdCancelLogin::NewL( 
  55         const TInt aCommandId,
  56         MVIMPSTEngine& aEngine)
  57     {
  58     // return the object created 
  59     CHAT_DP_FUNC_ENTER("CVIMPSTCmdCancelLogin::NewL");
   60     return  new (ELeave ) CVIMPSTCmdCancelLogin( aCommandId , aEngine);
  61     }
  62 
  63 // --------------------------------------------------------------------------
  64 // CVIMPSTCmdCancelLogin::ExecuteLD
  65 // --------------------------------------------------------------------------
  66 //
 
  67 void CVIMPSTCmdCancelLogin::ExecuteLD()
  68     {
  69       CHAT_DP_FUNC_ENTER("CVIMPSTCmdCancelLogin::ExecuteLD");
  70     //push to the cleanupstack
  71     CleanupStack::PushL( this );    
  72     
  73     // now  call logout for cancel login
  74     // protocol adaptation has to take care of this 
  75     iEngine.LogoutL();
  76       
  77     CHAT_DP_FUNC_ENTER("CVIMPSTCmdCancelLogin:: CommandFinished");
  78 
  79     if(iObserver)
  80        {
  81        iObserver->CommandFinishedL(*this);
  82        }
  83    CHAT_DP_FUNC_ENTER("CVIMPSTCmdCancelLogin:: CommandFinished");   
  84    CleanupStack::PopAndDestroy();   
  85    CHAT_DP_FUNC_DONE("CVIMPSTCmdCancelLogin::ExecuteLD");   
  86     }
  87 
  88 
  89 // --------------------------------------------------------------------------
  90 // CVIMPSTCmdCancelLogin::AddObserver
  91 // --------------------------------------------------------------------------
  92 //
 
  93 void CVIMPSTCmdCancelLogin::AddObserver( MVIMPSTCmdObserver& aObserver )
  94     {
  95     // store the observer to notify the command completion
  96     iObserver = &aObserver;
  97     }
  98 
  99 
  100 // --------------------------------------------------------------------------
  101 // CVIMPSTCmdCancelLogin::CommandId
  102 // --------------------------------------------------------------------------
  103 //
 
  104 TInt CVIMPSTCmdCancelLogin::CommandId() const
  105    {
   106    return iCommandId;   
  107    }
  108 
  109 // --------------------------------------------------------------------------
  110 // CVIMPSTCmdCancelLogin::Result
  111 // --------------------------------------------------------------------------
  112 //
 
  113 TInt CVIMPSTCmdCancelLogin::Result() const
  114    {
  115    // return KErrNone since iEngine.Logout() doesnot return any error value
   116    return KErrNone;
  117    }
  118 
  119 // End of File
***TER 100% (12/12) of SOURCE FILE cvimpstcmdcancellogin.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD26.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD26.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #26/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcca.cpp
-Instrumentation mode: function-decision
-TER: 33 % ( 6/ 18)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstcmdcca.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version: 12 %
  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 
  21 
  22 #include "vimpstcmd.hrh"
  23 #include "mvimpstcmdobserver.h"
  24 #include "cvimpstcmdcca.h"
  25 #include "mvimpstengine.h"
  26 #include "MVIMPSTProcessArray.h"
  27 
  28 #include <MVPbkContactLink.h> 
  29 
  30 #include <e32def.h>
  31 #include <e32property.h>
  32 #include <imconnectionproviderconsts.h>
  33 #include "tvimpstconsts.h"
  34 #include "vimpstdetailsviewpluginuids.hrh"
  35 
  36 // Constants
  37 
  38 // --------------------------------------------------------------------------
  39 // CVIMPSTCmdCCA::CVIMPSTCmdCCA
  40 // --------------------------------------------------------------------------
  41 //
 
  42 CVIMPSTCmdCCA::CVIMPSTCmdCCA( 
  43         const TInt aCommandId,
  44             TInt& aIndex, 
  45             MCCAConnection* aConnection,
  46             MVIMPSTProcessArray& mArrayProcess,
  47             MVIMPSTEngine& aEngine ) :            
  48     iCommandId( aCommandId ),
  49     iIndex(aIndex),
  50     iConnection(aConnection),
  51     iArrayProcess(mArrayProcess),
  52     iEngine( aEngine)
  53     {
  54     }
  55 
  56 // --------------------------------------------------------------------------
  57 // CVIMPSTCmdCCA::~CVIMPSTCmdCCA
  58 // --------------------------------------------------------------------------
  59 //
 
- 60 CVIMPSTCmdCCA::~CVIMPSTCmdCCA()
  61     {   
  62     }
  63 
  64 // --------------------------------------------------------------------------
  65 // CVIMPSTCmdCCA::NewL
  66 // --------------------------------------------------------------------------
  67 //
 
  68 CVIMPSTCmdCCA* CVIMPSTCmdCCA::NewL( 
  69         const TInt aCommandId,TInt& aIndex,
  70         MCCAConnection* aConnection,
  71            MVIMPSTProcessArray& aArrayProcess,
  72         MVIMPSTEngine& aEngine )
  73     {
  74     CVIMPSTCmdCCA* self = new (ELeave ) CVIMPSTCmdCCA( aCommandId,aIndex,aConnection,aArrayProcess, aEngine );
  75     self->ConstructL(); //use contsurctL if necessary
   76     return self;
  77     }
  78 // --------------------------------------------------------------------------
  79 // CVIMPSTCmdCCA::ConstructL
  80 // --------------------------------------------------------------------------
  81 //
 
  82 void CVIMPSTCmdCCA::ConstructL()
  83     {
  84     RProperty::Define(KMeCoPropertyUid, KMeCoXSPDetailsServiceIdKey, RProperty::EInt,
  85                           ECapabilityReadUserData ,ECapabilityWriteUserData); 
  86  
  87     }
  88 
  89 // --------------------------------------------------------------------------
  90 // CVIMPSTCmdCCA::ExecuteLD
  91 // --------------------------------------------------------------------------
  92 //
 
- 93 void CVIMPSTCmdCCA::ExecuteLD()
  94     {
  95       // CHAT_DP_FUNC_ENTER("CVIMPSTSettingsCmd::ExecuteLD");
  96     //push to the cleanupstack
  97     CleanupStack::PushL( this );    
  98      
  99    LaunchCcaL();
- 100     if(iObserver)
  101        {
  102        iObserver->CommandFinishedL(*this);
  103        }
  104    // CHAT_DP_FUNC_ENTER("CVIMPSTSettingsCmd:: CommandFinished");   
  105    CleanupStack::PopAndDestroy();   
  106    // CHAT_DP_FUNC_DONE("CVIMPSTSettingsCmd::ExecuteLD");   
  107     }
  108 
  109 
  110 // --------------------------------------------------------------------------
  111 // CVIMPSTCmdCCA::AddObserver
  112 // --------------------------------------------------------------------------
  113 //
 
- 114 void CVIMPSTCmdCCA::AddObserver( MVIMPSTCmdObserver& aObserver )
  115     {
  116     // store the observer to notify the command completion
  117     iObserver = &aObserver;
  118     }
  119 
  120 
  121 // --------------------------------------------------------------------------
  122 // CVIMPSTCmdCCA::CommandId
  123 // --------------------------------------------------------------------------
  124 //
 
  125 TInt CVIMPSTCmdCCA::CommandId() const
  126    {
   127    return iCommandId;   
  128    }
  129 
  130 // --------------------------------------------------------------------------
  131 // CVIMPSTCmdCCA::Result
  132 // --------------------------------------------------------------------------
  133 //
 
- 134 TInt CVIMPSTCmdCCA::Result() const
  135    {
  136    //return valid data regd the command operation
 - 137    return KErrNone;
  138    }
  139 
  140 // --------------------------------------------------------------------------
  141 // CVIMPSTCmdCCA::LaunchCcaL
  142 // --------------------------------------------------------------------------
  143 //
 
- 144 void CVIMPSTCmdCCA::LaunchCcaL()
  145    {   
  146 
- 147    if ( iParameter )
  148       {
  149       iParameter->Close();
  150       iParameter = NULL;
  151       }
  152 
  153    // The lifetime of this cmd object is too short to hold
  154    // iParameterRef, caller of this must own it    
  155    iParameter = TCCAFactory::NewParameterL();
  156    iParameter->SetConnectionFlag(MCCAParameter::ENormal);
  157    iParameter->SetContactDataFlag(MCCAParameter::EContactLink);
  158    
  159    TUid uid( TUid::Null() );
  160    uid.iUid = KVIMPSTDetailsViewPluginImplmentationUid + iEngine.ServiceId(); // service details view implementation uid
  161    iParameter->SetLaunchedViewUid( uid );
  162    
  163    RProperty::Set(KMeCoPropertyUid, KMeCoXSPDetailsServiceIdKey, iEngine.ServiceId() ); 
  164     
  165    MVPbkContactLink* link = iArrayProcess.ContactLink( iIndex )->CloneLC();  
- 166    if (link)
  167       {
  168       HBufC8* link8 = link->PackLC(); 
  169       HBufC16* link16 = HBufC16::NewLC( link8->Length() );
  170       link16->Des().Copy( *link8);
  171       iParameter->SetContactDataL(link16->Des() );
  172       CleanupStack::PopAndDestroy(3); 
  173       }
  174    // Sync call
  175    //iParameter ownership passed to iConnection
  176    iConnection->LaunchApplicationL(*iParameter);            
  177              
  178    }
  179 // End of File
***TER 33% (6/18) of SOURCE FILE cvimpstcmdcca.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD27.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD27.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #27/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownavtar.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 //
 
  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 //
 
  49 CVIMPSTCmdChangeOwnAvtar::~CVIMPSTCmdChangeOwnAvtar()
  50     {    
  51     
  52     }
  53 
  54 // --------------------------------------------------------------------------
  55 // CVIMPSTCmdChangeOwnAvtar::NewL
  56 // --------------------------------------------------------------------------
  57 //
 
  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
   64     return self;
  65     }
  66 // --------------------------------------------------------------------------
  67 // CVIMPSTCmdChangeOwnAvtar::ConstructL
  68 // --------------------------------------------------------------------------
  69 //
 
  70 void CVIMPSTCmdChangeOwnAvtar::ConstructL()
  71     {    
  72     iError = KErrNone;
  73     }
  74 
  75 // --------------------------------------------------------------------------
  76 // CVIMPSTCmdChangeOwnAvtar::ExecuteLD
  77 // --------------------------------------------------------------------------
  78 //
 
  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));
- 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 
  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 //
 
  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 //
 
  122 TInt CVIMPSTCmdChangeOwnAvtar::CommandId() const
  123    {
   124    return iCommandId;   
  125    }
  126 
  127 // --------------------------------------------------------------------------
  128 // CVIMPSTCmdChangeOwnAvtar::Result
  129 // --------------------------------------------------------------------------
  130 //
 
  131 TInt CVIMPSTCmdChangeOwnAvtar::Result() const
  132    {
  133    //return valid data regd the command operation
   134    return iError;
  135    }
  136 
  137 // End of File
***TER 93% (14/15) of SOURCE FILE cvimpstcmdchangeownavtar.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD28.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD28.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #28/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownmessage.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

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

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD29.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD29.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #29/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownstatus.cpp
-Instrumentation mode: function-decision
-TER: 88 % ( 15/ 17)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstcmdchangeownstatus.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version: 5.1.2 %
  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 "cvimpstcmdchangeownstatus.h"
  21 #include "mvimpstenginepresencesubservice.h"
  22 
  23 #include "vimpstcmd.hrh"
  24 #include "mvimpstcmdobserver.h"
  25 #include "vimpstdebugprint.h" 
  26 
  27 #include <e32def.h>
  28 #include "mvimpstengine.h"
  29 #include "mvimpstenginesubservice.h"
  30 
  31 // Constants
  32 
  33 // --------------------------------------------------------------------------
  34 // CVIMPSTCmdChangeOwnStatus::CVIMPSTCmdChangeOwnStatus
  35 // --------------------------------------------------------------------------
  36 //
 
  37 CVIMPSTCmdChangeOwnStatus::CVIMPSTCmdChangeOwnStatus( 
  38         const TInt aCommandId ,TStatusAndStatusText aStatus,
  39         MVIMPSTEngine& aEngine) :            
  40             iCommandId( aCommandId ),
  41             iStatus(aStatus.iStatus),
  42             iEngine(aEngine)
  43     {
  44     iStatusText.Copy(aStatus.iStatusText);
  45     }
  46 
  47 // --------------------------------------------------------------------------
  48 // CVIMPSTCmdChangeOwnStatus::~CVIMPSTCmdChangeOwnStatus
  49 // --------------------------------------------------------------------------
  50 //
 
  51 CVIMPSTCmdChangeOwnStatus::~CVIMPSTCmdChangeOwnStatus()
  52     {    
  53     
  54     }
  55 
  56 // --------------------------------------------------------------------------
  57 // CVIMPSTCmdChangeOwnStatus::NewL
  58 // --------------------------------------------------------------------------
  59 //
 
  60 CVIMPSTCmdChangeOwnStatus* CVIMPSTCmdChangeOwnStatus::NewL( 
  61         const TInt aCommandId,TStatusAndStatusText aStatus,
  62         MVIMPSTEngine& aEngine)
  63     {
  64     CVIMPSTCmdChangeOwnStatus* self = new (ELeave ) CVIMPSTCmdChangeOwnStatus( aCommandId ,aStatus, aEngine);
  65     self->ConstructL(); //use contsurctL if necessary
   66     return self;
  67     }
  68 // --------------------------------------------------------------------------
  69 // CVIMPSTCmdChangeOwnStatus::ConstructL
  70 // --------------------------------------------------------------------------
  71 //
 
  72 void CVIMPSTCmdChangeOwnStatus::ConstructL()
  73     {    
  74     iError = KErrNone;
  75     }
  76 
  77 // --------------------------------------------------------------------------
  78 // CVIMPSTCmdChangeOwnStatus::ExecuteLD
  79 // --------------------------------------------------------------------------
  80 //
 
  81 void CVIMPSTCmdChangeOwnStatus::ExecuteLD()
  82     {
  83     CHAT_DP_FUNC_ENTER("CVIMPSTCmdChangeOwnStatus::ExecuteLD");
  84     //push to the cleanupstack
  85     CleanupStack::PushL( this );   
  86    
  87    //Get Presence SubService           
  88       MVIMPSTEngineSubService* subService =          
  89                   (iEngine.SubService(TVIMPSTEnums::EPresence));
  90     
- 91     if(subService)
  92         {
  93         MVIMPSTEnginePresenceSubService& presence = 
  94               MVIMPSTEnginePresenceSubService::Cast (*subService);
  95                         
- 96           if ( iStatus == TVIMPSTEnums::EInvisible)
  97               {
  98               //Status set to Appear Offline
  99               iError = presence.PublishOwnPresenceL(iStatus, KNullDesC);
  100               }
    101           else
  102               {
  103               iError = presence.PublishOwnPresenceL(iStatus, iStatusText);
  104               }
  105           }       
  106       
  107     if(iObserver)
  108         {
  109         iObserver->CommandFinishedL(*this);
  110         }
  111         
  112    
  113     
  114    CHAT_DP_FUNC_ENTER("CVIMPSTCmdChangeOwnStatus:: CommandFinished");   
  115    CleanupStack::PopAndDestroy();   
  116    CHAT_DP_FUNC_DONE("CVIMPSTCmdChangeOwnStatus::ExecuteLD");   
  117     }
  118 
  119 
  120 // --------------------------------------------------------------------------
  121 // CVIMPSTCmdChangeOwnStatus::AddObserver
  122 // --------------------------------------------------------------------------
  123 //
 
  124 void CVIMPSTCmdChangeOwnStatus::AddObserver( MVIMPSTCmdObserver& aObserver )
  125     {
  126     // store the observer to notify the command completion
  127     iObserver = &aObserver;
  128     }
  129 
  130 
  131 // --------------------------------------------------------------------------
  132 // CVIMPSTCmdChangeOwnStatus::CommandId
  133 // --------------------------------------------------------------------------
  134 //
 
  135 TInt CVIMPSTCmdChangeOwnStatus::CommandId() const
  136    {
   137    return iCommandId;   
  138    }
  139 
  140 // --------------------------------------------------------------------------
  141 // CVIMPSTCmdChangeOwnStatus::Result
  142 // --------------------------------------------------------------------------
  143 //
 
  144 TInt CVIMPSTCmdChangeOwnStatus::Result() const
  145    {
  146    //return valid data regd the command operation
   147    return iError;
  148    }
  149 
  150 // End of File
***TER 88% (15/17) of SOURCE FILE cvimpstcmdchangeownstatus.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD3.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD3.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,476 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #3/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\vimpstcmdprocess_utest.cpp
-Instrumentation mode: function-decision
-TER: 75 % ( 33/ 44)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : vimpstcmdprocess_processarray_utest.cpp
  4 *  Part of     : vimpstcmdprocess_utest
  5 *
  6 *  Description : vimpstcmdprocess_utest class member functions
  7 *  Version:   %version: 3 %
  8 *
  9 *  Copyright (C) 2002 - 2007 Nokia Corporation.
  10 *  This material, including documentation and any related 
  11 *  computer programs, is protected by copyright controlled by 
  12 *  Nokia Corporation. All rights are reserved. Copying, 
  13 *  including reproducing, storing,  adapting or translating, any 
  14 *  or all of this material requires the prior written consent of 
  15 *  Nokia Corporation. This material also contains confidential 
  16 *  information which may not be disclosed to others without the 
  17 *  prior written consent of Nokia Corporation.
  18 *
  19 * ============================================================================
  20 */
  21 
  22 
  23 // INCLUDE FILES
  24 #include <Stiftestinterface.h>
  25 #include "vimpstcmdprocess_utest.h"
  26 #include <e32math.h>
  27 
  28 #include "cvimpstcmdfactory.h"
  29 #include "cvimpstprocessarray.h"
  30 #include "cvimpstprocessfriendrequestitem.h"
  31 #include "s_vimpstengin.h"
  32 #include "s_vimpststoragecontact.h"
  33 #include "s_vimpststoragecontactlist.h"
  34 #include "s_vimpstcmdobserver.h"
  35 //#include "s_cvimpstprocessfriendrequestitem.h"
  36 #include "mvimpstcmd.h"
  37 #include "tvimpstconsts.h"
  38 #include "s_vimpstprocessarrayItem.h"
  39 #include "s_processarrayobserver.h" 
  40 #include "s_vimpststorageserviceview.h"
  41 #include "s_storageitemmodel.h"
  42 #include "s_mccaconnection.h"
  43 
  44 
  45 // EXTERNAL DATA STRUCTURES
  46 //extern  ?external_data;
  47 
  48 // EXTERNAL FUNCTION PROTOTYPES  
  49 //extern ?external_function( ?arg_type,?arg_type );
  50 
  51 // CONSTANTS
  52 //const ?type ?constant_var = ?constant;
  53 
  54 // MACROS
  55 //#define ?macro ?macro_def
  56 
  57 // LOCAL CONSTANTS AND MACROS
  58 //const ?type ?constant_var = ?constant;
  59 //#define ?macro_name ?macro_def
  60 
  61 // MODULE DATA STRUCTURES
  62 //enum ?declaration
  63 //typedef ?declaration
  64 
  65 // LOCAL FUNCTION PROTOTYPES
  66 //?type ?function_name( ?arg_type, ?arg_type );
  67 
  68 // FORWARD DECLARATIONS
  69 //class ?FORWARD_CLASSNAME;
  70 
  71 // ============================= LOCAL FUNCTIONS ===============================
  72 
  73 // -----------------------------------------------------------------------------
  74 // ?function_name ?description.
  75 // ?description
  76 // Returns: ?value_1: ?description
  77 //          ?value_n: ?description_line1
  78 //                    ?description_line2
  79 // -----------------------------------------------------------------------------
  80 //
  81 /*
  82 ?type ?function_name(
  83     ?arg_type arg,  // ?description
  84     ?arg_type arg)  // ?description
  85     {
  86 
  87     ?code  // ?comment
  88 
  89     // ?comment
  90     ?code
  91     }
  92 */
  93 
  94 // ============================ MEMBER FUNCTIONS ===============================
  95 
  96 // -----------------------------------------------------------------------------
  97 // Cvimpstcmdprocess_utest::Cvimpstcmdprocess_utest
  98 // C++ default constructor can NOT contain any code, that
  99 // might leave.
  100 // -----------------------------------------------------------------------------
  101 //
 
  102 Cvimpstcmdprocess_utest::Cvimpstcmdprocess_utest()
  103     {
  104 
  105     }
  106 
  107 // -----------------------------------------------------------------------------
  108 // Cvimpstcmdprocess_utest::ConstructL
  109 // Symbian 2nd phase constructor can leave.
  110 //
  111 // Note: If OOM test case uses STIF Logger, then STIF Logger must be created
  112 // with static buffer size parameter (aStaticBufferSize). Otherwise Logger 
  113 // allocates memory from heap and therefore causes error situations with OOM 
  114 // testing. For more information about STIF Logger construction, see STIF Users 
  115 // Guide.
  116 // -----------------------------------------------------------------------------
  117 //
 
  118 void Cvimpstcmdprocess_utest::ConstructL()
  119     {
  120     iLog = CStifLogger::NewL( Kvimpstcmdprocess_utestLogPath, 
  121                           Kvimpstcmdprocess_utestLogFile);
  122 
  123     // Sample how to use logging
  124     _LIT( KLogStart, "vimpstcmdprocess_utest logging starts!" );
  125     iLog->Log( KLogStart );
  126 
  127     iVersionLogged = EFalse;
  128     iNumberOfTestCases = 0;
  129     }
  130 
  131 // -----------------------------------------------------------------------------
  132 // Cvimpstcmdprocess_utest::NewL
  133 // Two-phased constructor.
  134 // -----------------------------------------------------------------------------
  135 //
 
  136 Cvimpstcmdprocess_utest* Cvimpstcmdprocess_utest::NewL()
  137     {
  138     Cvimpstcmdprocess_utest* self = new (ELeave) Cvimpstcmdprocess_utest;
  139 
  140     CleanupStack::PushL( self );
  141     self->ConstructL();
  142     CleanupStack::Pop();
  143 
   144     return self;
  145 
  146     }
  147 
  148 // Destructor
 
  149 Cvimpstcmdprocess_utest::~Cvimpstcmdprocess_utest()
  150     {
  151     delete iLog;
  152     }
  153 
  154 // -----------------------------------------------------------------------------
  155 // Cvimpstcmdprocess_utest::InitL
  156 // InitL is used to initialize the Test Module.
  157 // -----------------------------------------------------------------------------
  158 //
 
  159 TInt Cvimpstcmdprocess_utest::InitL( 
  160     TFileName& /*aIniFile*/, 
  161     TBool /*aFirstTime*/ )
  162     {
   163     return KErrNone;
  164 
  165     }
  166 
  167 // -----------------------------------------------------------------------------
  168 // Cvimpstcmdprocess_utest::GetTestCasesL
  169 // GetTestCases is used to inquire test cases from the Test Module. Test
  170 // cases are stored to array of test cases. The Test Framework will be 
  171 // the owner of the data in the RPointerArray after GetTestCases return
  172 // and it does the memory deallocation. 
  173 // -----------------------------------------------------------------------------
  174 //
 
  175 TInt Cvimpstcmdprocess_utest::GetTestCasesL( 
  176     const TFileName& /*aConfig*/, 
  177     RPointerArray<TTestCaseInfo>& aTestCases )
  178     {
  179     TTestResult dummyResult;
   180     return MainTestL(Cvimpstcmdprocess_utest::EEnumerateTestCases, -1, aTestCases, dummyResult); 
  181     }
  182 
  183 // -----------------------------------------------------------------------------
  184 // Cvimpstcmdprocess_utest::RunTestCaseL
  185 // RunTestCaseL is used to run an individual test case specified 
  186 // by aTestCase. Test cases that can be run may be requested from 
  187 // Test Module by GetTestCases method before calling RunTestCase.
  188 // -----------------------------------------------------------------------------
  189 //
 
65   190 TInt Cvimpstcmdprocess_utest::RunTestCaseL( 
  191     const TInt aCaseNumber,   
  192     const TFileName& /*aConfig*/,
  193     TTestResult& aResult )
  194     {
64   195     if(!iVersionLogged)
  196        {
  197        SendTestModuleVersion();
  198        iVersionLogged = ETrue;
  199        }
  200 
  201     RPointerArray<TTestCaseInfo> aTestCases; //temporary
  202 
  203     /**
  204      * SetupL is responsible for inicialization of all fields (etc.) common for all testcases
  205      * MainTestL starts required testcase
  206      * TeardownL destroys all data that was created by SetupL
  207      */
  208     TInt errSetup = KErrNone;
  209     TInt errTestcase = KErrNone;
  210     
65 - 211     if(aCaseNumber > iNumberOfTestCases)
 - 212        return KErrNotFound;
  213        
  214     
  215     TRAP(errSetup, MainTestL(Cvimpstcmdprocess_utest::ERunTestCase, STIF_RUN_SETUP, aTestCases, aResult); TRAP(errTestcase, MainTestL(Cvimpstcmdprocess_utest::ERunTestCase, aCaseNumber, aTestCases, aResult))\
65 65   216           MainTestL(Cvimpstcmdprocess_utest::ERunTestCase, STIF_RUN_TEARDOWN, aTestCases, aResult));
65 65   216       try
 - 216       catch (XLeaveException & l)
 - 216       catch (...)
 - 216   catch (XLeaveException & l)
 - 216   catch (...)
  217     
  218     
65 - 219     if(errTestcase != KErrNone)
  220        {
  221        aResult.SetResult(errTestcase, _L("Testcase failed"));
  222        }
65 - 223     if(errSetup != KErrNone)
  224        {
  225        aResult.SetResult(errSetup, _L("Setup or teardown failed"));
  226        }
  227    
65    228     return KErrNone;
  229     }
  230 
  231 // -----------------------------------------------------------------------------
  232 // Cvimpstcmdprocess_utest::OOMTestQueryL
  233 // Used to check if a particular test case should be run in OOM conditions and 
  234 // which memory allocations should fail.    
  235 // -----------------------------------------------------------------------------
  236 //
 
65   237 TBool Cvimpstcmdprocess_utest::OOMTestQueryL( 
  238                                 const TFileName& /* aTestCaseFile */, 
  239                                 const TInt /*aCaseNumber*/, 
  240                                 TOOMFailureType& /* aFailureType */, 
  241                                 TInt& /*aFirstMemFailure*/, 
  242                                 TInt& /*aLastMemFailure*/ ) 
  243     {
65    244     return EFalse;
  245     }
  246 
  247 // -----------------------------------------------------------------------------
  248 // Cvimpstcmdprocess_utest::OOMTestInitializeL
  249 // Used to perform the test environment setup for a particular OOM test case. 
  250 // Test Modules may use the initialization file to read parameters for Test 
  251 // Module initialization but they can also have their own configure file or 
  252 // some other routine to initialize themselves.  
  253 //
  254 // NOTE: User may add implementation for OOM test environment initialization.
  255 // Usually no implementation is required.
  256 // -----------------------------------------------------------------------------
  257 //
 
- 258 void Cvimpstcmdprocess_utest::OOMTestInitializeL( 
  259                                 const TFileName& /* aTestCaseFile */, 
  260                                 const TInt /* aCaseNumber */ )
  261     {
  262     }
  263 
  264 // -----------------------------------------------------------------------------
  265 // Cvimpstcmdprocess_utest::OOMHandleWarningL
  266 // In some cases the heap memory allocation should be skipped, either due to
  267 // problems in the OS code or components used by the code being tested, or even 
  268 // inside the tested components which are implemented this way on purpose (by 
  269 // design), so it is important to give the tester a way to bypass allocation 
  270 // failures.
  271 //
  272 // NOTE: User may add implementation for OOM test warning handling. Usually no
  273 // implementation is required.
  274 // -----------------------------------------------------------------------------
  275 //
 
- 276 void Cvimpstcmdprocess_utest::OOMHandleWarningL( 
  277                                 const TFileName& /* aTestCaseFile */,
  278                                 const TInt /* aCaseNumber */, 
  279                                 TInt& /* aFailNextValue */ )
  280     {
  281     }
  282 
  283 // -----------------------------------------------------------------------------
  284 // Cvimpstcmdprocess_utest::OOMTestFinalizeL
  285 // Used to perform the test environment cleanup for a particular OOM test case.
  286 //
  287 // NOTE: User may add implementation for OOM test environment finalization.
  288 // Usually no implementation is required.
  289 // -----------------------------------------------------------------------------
  290 //
 
- 291 void Cvimpstcmdprocess_utest::OOMTestFinalizeL( 
  292                                 const TFileName& /* aTestCaseFile */, 
  293                                 const TInt /* aCaseNumber */ )
  294     {
  295     }
  296 
  297 //-----------------------------------------------------------------------------
  298 // Cvimpstcmdprocess_utest::SendTestModuleVersion
  299 // Method used to send version of test module
  300 //-----------------------------------------------------------------------------
  301 //
 
  302 void Cvimpstcmdprocess_utest::SendTestModuleVersion()
  303    {
  304    TVersion moduleVersion;
  305    moduleVersion.iMajor = TEST_MODULE_VERSION_MAJOR;
  306    moduleVersion.iMinor = TEST_MODULE_VERSION_MINOR;
  307    moduleVersion.iBuild = TEST_MODULE_VERSION_BUILD;
  308    
  309    TFileName moduleName;
  310    moduleName = _L("vimpstcmdprocess_utest.dll");
  311 
  312    TBool newVersionOfMethod = ETrue;
  313    TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod);
  314    }
  315 
  316 // ========================== OTHER EXPORTED FUNCTIONS =========================
  317 
  318 // -----------------------------------------------------------------------------
  319 // LibEntryL is a polymorphic Dll entry point
  320 // Returns: CTestModuleBase*: Pointer to Test Module object
  321 // -----------------------------------------------------------------------------
  322 //
 
  323 EXPORT_C CTestModuleBase* LibEntryL()
  324     {
   325     return Cvimpstcmdprocess_utest::NewL();
  326 
  327     }
  328 
  329 // -----------------------------------------------------------------------------
  330 // SetRequirements handles test module parameters(implements evolution
  331 // version 1 for test module's heap and stack sizes configuring).
  332 // Returns: TInt: Symbian error code.
  333 // -----------------------------------------------------------------------------
  334 //
 
  335 EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/, 
  336                                 TUint32& /*aParameterValid*/ )
  337     {
  338 
  339     /* --------------------------------- NOTE ---------------------------------
  340     USER PANICS occurs in test thread creation when:
  341     1) "The panic occurs when the value of the stack size is negative."
  342     2) "The panic occurs if the minimum heap size specified is less
  343        than KMinHeapSize".
  344        KMinHeapSize: "Functions that require a new heap to be allocated will
  345        either panic, or will reset the required heap size to this value if
  346        a smaller heap size is specified".
  347     3) "The panic occurs if the minimum heap size specified is greater than
  348        the maximum size to which the heap can grow".
  349     Other:
  350     1) Make sure that your hardware or Symbian OS is supporting given sizes.
  351        e.g. Hardware might support only sizes that are divisible by four.
  352     ------------------------------- NOTE end ------------------------------- */
  353 
  354     // Normally STIF uses default heap and stack sizes for test thread, see:
  355     // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
  356     // If needed heap and stack sizes can be configured here by user. Remove
  357     // comments and define sizes.
  358 
  359 /*
  360     aParameterValid = KStifTestModuleParameterChanged;
  361 
  362     CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
  363     // Stack size
  364     param->iTestThreadStackSize= 16384; // 16K stack
  365     // Heap sizes
  366     param->iTestThreadMinHeap = 4096;   // 4K heap min
  367     param->iTestThreadMaxHeap = 1048576;// 1M heap max
  368 
  369     aTestModuleParam = param;
  370 */
   371     return KErrNone;
  372 
  373     }
  374 
  375 // -----------------------------------------------------------------------------
  376 // Cvimpstcmdprocess_utest::MainTestL
  377 // Method responsible for enumerating and running test cases (and also setup and teardown activities before
  378 // and after each test case).
  379 // 
  380 // arguments:
  381 // Cvimpstcmdprocess_utest::TCallReason aRunReason - defines aim of a call - enumeration or run of test cases
  382 // TInt aTestToRun - in case of running test case - defines number of test case to run
  383 // RPointerArray<TTestCaseInfo>& aTestCases - in case of enumerating test cases - array to locate test cases infos in
  384 // -----------------------------------------------------------------------------
  385 //
 
196   386 TInt Cvimpstcmdprocess_utest::MainTestL(Cvimpstcmdprocess_utest::TCallReason aRunReason, 
  387                              TInt aTestToRun, 
  388                              RPointerArray<TTestCaseInfo>& aTestCases,
  389                              TTestResult& aResult)
  390     {
195   391     if(aRunReason == Cvimpstcmdprocess_utest::ERunTestCase)
  392         {
130 65   393         if(aTestToRun < 0)
  394            {
  395             iLog->Log(_L("Running setup or teardown"));
  396             }
    397         else
  398            {
  399            iLog->Log(_L("Running test case #%d"), aTestToRun);
  400            }
  401         }
    402     else
  403         {
  404         iLog->Log(_L("Enumerating test cases."));
  405         }
  406     
  407     TInt _test_case_no = -1;
  408     
  409     //test cases, setup and teardown include
  410    #define TEST_CASES
  411     #include "..\src\t_vimpstcmdprocess_processarray_utest.cpp"
  412     #include "..\src\t_vimpstcmdprocess_cmdfactory_utestCases.cpp"
  413    #undef TEST_CASES
  414    
  415    
  416    
  417     
195   418     if(aRunReason != Cvimpstcmdprocess_utest::ERunTestCase)
  419         {
  420         iNumberOfTestCases = _test_case_no;
  421         iLog->Log(_L("Enumeration completed."));
  422         }
  423     
  424     // Test case was executed
196    425     return KErrNone;
  426     }
  427 
  428 //  End of File
***TER 75% (33/44) of SOURCE FILE vimpstcmdprocess_utest.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD30.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD30.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #30/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcloseconversation.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 //
 
  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 //
 
  50 CVIMPSTCmdCloseConversation::~CVIMPSTCmdCloseConversation()
  51     {    
  52     
  53     }
  54 
  55 // --------------------------------------------------------------------------
  56 // CVIMPSTCmdCloseConversation::NewL
  57 // --------------------------------------------------------------------------
  58 //
 
  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
   65     return self;
  66     }
  67 // --------------------------------------------------------------------------
  68 // CVIMPSTCmdCloseConversation::ConstructL
  69 // --------------------------------------------------------------------------
  70 //
 
  71 void CVIMPSTCmdCloseConversation::ConstructL()
  72     {    
  73     iError = KErrNone;
  74     }
  75 
  76 // --------------------------------------------------------------------------
  77 // CVIMPSTCmdCloseConversation::ExecuteLD
  78 // --------------------------------------------------------------------------
  79 //
 
  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     
- 90     if(subService1)
  91         {
  92         MVIMPSTEngineIMSubService& imSubService = 
  93               MVIMPSTEngineIMSubService::Cast (*subService1);
  94         imSubService.CloseConversationL( iContactId );
  95         }
  96    
  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 //
 
  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 //
 
  123 TInt CVIMPSTCmdCloseConversation::CommandId() const
  124     {
   125     return iCommandId;  
  126     }
  127 
  128 // --------------------------------------------------------------------------
  129 // CVIMPSTCmdCloseConversation::Result
  130 // --------------------------------------------------------------------------
  131 //
 
  132 TInt CVIMPSTCmdCloseConversation::Result() const
  133     {
  134     //return valid data regd the command operation
   135     return iError;
  136     }
  137 
  138 // End of File
***TER 93% (14/15) of SOURCE FILE cvimpstcmdcloseconversation.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD31.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD31.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,225 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #31/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmddeletecontact.cpp
-Instrumentation mode: function-decision
-TER: 43 % ( 15/ 35)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstcmddaletecontact.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version: ou1s60rt#14 %
  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 "cvimpstcmddeletecontact.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 "cvimpststoragemanagerfactory.h"
  29 #include "mvimpststorageserviceview.h"
  30 #include "mvimpstenginesubservice.h"
  31 #include "mvimpstenginecontactmgmtextention.h"
  32 #include "mvimpstengineextentionfeatures.h"
  33 #include "mvimpstengineimsubservice.h"
  34 #include "tvimpstenums.h"
  35 #include "tvimpstconsts.h"
  36 #include "mvimpstenginesubservice.h"
  37 #include "mvimpstenginepresencesubservice.h"
  38 #include "mvimpstenginepresencesubservice.h"
  39 
  40 // Constants
  41 _LIT( KListNameAllBuddy ,"buddylist" );
  42 _LIT( KPresenceBlockedList, "blockedcontacts");
  43 
  44 
  45 // --------------------------------------------------------------------------
  46 // CVIMPSTCmdDeleteContact::CVIMPSTCmdDeleteContact
  47 // --------------------------------------------------------------------------
  48 //
 
  49 CVIMPSTCmdDeleteContact::CVIMPSTCmdDeleteContact( 
  50         const TInt aCommandId , MVPbkContactLink* aContactLink,
  51         MVIMPSTEngine& aEngine) :            
  52             iCommandId( aCommandId ),
  53             iContactLink( aContactLink ),
  54             iEngine(aEngine)
  55     {
  56     }
  57 
  58 // --------------------------------------------------------------------------
  59 // CVIMPSTCmdDeleteContact::~CVIMPSTCmdDeleteContact
  60 // --------------------------------------------------------------------------
  61 //
 
  62 CVIMPSTCmdDeleteContact::~CVIMPSTCmdDeleteContact()
  63     {    
  64     
  65     }
  66 
  67 // --------------------------------------------------------------------------
  68 // CVIMPSTCmdDeleteContact::NewL
  69 // --------------------------------------------------------------------------
  70 //
 
  71 CVIMPSTCmdDeleteContact* CVIMPSTCmdDeleteContact::NewL( 
  72         const TInt aCommandId, MVPbkContactLink* aContactLink,
  73         MVIMPSTEngine& aEngine)
  74     {
  75     CVIMPSTCmdDeleteContact* self = new (ELeave ) CVIMPSTCmdDeleteContact( aCommandId ,aContactLink, aEngine);
  76     self->ConstructL(); //use contsurctL if necessary
   77     return self;
  78     }
  79 // --------------------------------------------------------------------------
  80 // CVIMPSTCmdDeleteContact::ConstructL
  81 // --------------------------------------------------------------------------
  82 //
 
  83 void CVIMPSTCmdDeleteContact::ConstructL()
  84     {    
  85     iError = KErrNone;
  86     }
  87 
  88 // --------------------------------------------------------------------------
  89 // CVIMPSTCmdDeleteContact::ExecuteLD
  90 // --------------------------------------------------------------------------
  91 //
 
  92 void CVIMPSTCmdDeleteContact::ExecuteLD()
  93     {
  94       CHAT_DP_FUNC_ENTER("CVIMPSTCmdDeleteContact::ExecuteLD");
  95     //push to the cleanupstack
  96     CleanupStack::PushL( this );       
  97     iError = KErrNone;
  98     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId()) ;         
- 99    if(storage)
  100       {
  101       MVIMPSTStorageContact* contact = storage->FindContactByLink( *iContactLink );
- 102       if (contact  )
  103          {
  104          TBuf<KUsernameMaxLength> listId;
  105          listId.Zero();
  106          listId.Append(KListNameAllBuddy);
- 107          if(TVIMPSTEnums::EBlocked ==  contact->OnlineStatus())
  108             {
  109             listId.Zero();
  110             listId.Append(KPresenceBlockedList);
  111             }
  112          TPtrC userIdPtr = contact->UserId();
  113          MVIMPSTEngineSubService* subService = iEngine.SubService(TVIMPSTEnums::EPresence);
  114          MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::EContactManagement);
  115          //Get IM SubService     
  116          MVIMPSTEngineSubService* imService =  iEngine.SubService(TVIMPSTEnums::EIM) ;   
  117          //for each userid in the service details, unsubscribe 
- 118          if( userIdPtr.Length() )
  119             {
- 120             if( subService )
  121                {
  122                MVIMPSTEnginePresenceSubService& presenceSubService = MVIMPSTEnginePresenceSubService::Cast(*subService);
  123                presenceSubService.UnSubscribePresenceOfSingleContactL( userIdPtr );   
  124                }
- 125             if (feature )   
  126                {
  127                MVIMPSTEngineContactMgmtExtention& contactMgr = MVIMPSTEngineContactMgmtExtention::Cast(*feature);
- 128                TRAP(iError, contactMgr.DeleteServerContactL(listId, userIdPtr ) );
 - 128           catch (XLeaveException & l)
 - 128           catch (...)
  129                }
- 130             if(imService )
  131                {
  132                MVIMPSTEngineIMSubService& imSubService = 
  133                                     MVIMPSTEngineIMSubService::Cast (*imService);
- 134                TRAP_IGNORE( imSubService.CloseConversationL( userIdPtr ));
 - 134           catch (XLeaveException & l)
 - 134           catch (...)
  135                }      
  136             }
- 137          if( iError == KErrNone )
  138             {
  139              storage->RemoveContactL( contact );   
  140                 }
  141          } // contact
  142       } // storage
  143    CHAT_DP_FUNC_ENTER("CVIMPSTCmdDeleteContact:: CommandFinished");
  144 
  145     if(iObserver)
  146        {
  147        iObserver->CommandFinishedL(*this);
  148        }
  149    CHAT_DP_FUNC_ENTER("CVIMPSTCmdDeleteContact:: CommandFinished");   
  150    CleanupStack::PopAndDestroy();   
  151    CHAT_DP_FUNC_DONE("CVIMPSTCmdDeleteContact::ExecuteLD");   
  152     }
  153 
  154 
  155 // --------------------------------------------------------------------------
  156 // CVIMPSTCmdDeleteContact::AddObserver
  157 // --------------------------------------------------------------------------
  158 //
 
  159 void CVIMPSTCmdDeleteContact::AddObserver( MVIMPSTCmdObserver& aObserver )
  160     {
  161     // store the observer to notify the command completion
  162     iObserver = &aObserver;
  163     }
  164 
  165 
  166 // --------------------------------------------------------------------------
  167 // CVIMPSTCmdDeleteContact::CommandId
  168 // --------------------------------------------------------------------------
  169 //
 
  170 TInt CVIMPSTCmdDeleteContact::CommandId() const
  171    {
   172    return iCommandId;   
  173    }
  174 
  175 // --------------------------------------------------------------------------
  176 // CVIMPSTCmdDeleteContact::Result
  177 // --------------------------------------------------------------------------
  178 //
 
  179 TInt CVIMPSTCmdDeleteContact::Result() const
  180    {
  181    //return valid data regd the command operation
   182    return iError;
  183    }
  184 
  185 // End of File
***TER 43% (15/35) of SOURCE FILE cvimpstcmddeletecontact.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD32.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD32.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,341 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #32/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdfactory.cpp
-Instrumentation mode: function-decision
-TER: 76 % ( 44/ 58)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ============================================================================
  3 *  Name        : cvimpstcmdfactory.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version: 34 %
  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 "cvimpstcmdfactory.h"
  21 #include "cvimpstprocessarray.h"
  22 #include "cvimpstcmdcca.h"
  23 #include "cvimpstcmdlogin.h"
  24 #include "cvimpstcmdlogout.h"
  25 #include "cvimpstcmdcancellogin.h"
  26 
  27 #include "mvimpstcmdobserver.h"
  28 #include "mvimpstengine.h"
  29 #include "tvimpstconsts.h"
  30 #include "cvimpststoragemanagerfactory.h"
  31 #include "cvimpstcmdaddcontact.h"
  32 #include "cvimpstcmddeletecontact.h"
  33 #include "TVImpstConsts.h"
  34 #include "cvimpstcmdchangeownstatus.h"
  35 #include "cvimpstcmdchangeownmessage.h"
  36 #include "cvimpstcmdsearch.h"
  37 #include "cvimstcmdfriendrequest.h"
  38 #include "cvimpstcmdchangeownavtar.h"
  39 #include "cvimpstcmdcloseconversation.h"
  40 #include "cvimpstcmdaddtopbk.h"
  41 #include "cvimpstcmdprocessselectedcontact.h"
  42 #include "cvimpstcmdblockcontact.h"
  43 #include "cvimpstcmdunblockcontact.h"
  44 #include "cvimpstcmdfetchblockedlist.h"
  45 
  46 
  47 // ================= MEMBER FUNCTIONS =======================
  48 
  49 
  50 // --------------------------------------------------------------------------
  51 // CVIMPSTCmdFactory::CVIMPSTCmdFactory
  52 // --------------------------------------------------------------------------
  53 //
 
68 68   54 CVIMPSTCmdFactory::CVIMPSTCmdFactory(MVIMPSTEngine& aEngine) :
  55 iEngine(aEngine)
  56     {
  57     }
  58 
  59 
  60 // --------------------------------------------------------------------------
  61 // CVIMPSTCmdFactory::ConstructL
  62 // --------------------------------------------------------------------------
  63 //
 
68 68   64 void CVIMPSTCmdFactory::ConstructL()
  65     {
  66     
  67     TUint32 serviceId = iEngine.ServiceId();
  68     
  69     //Make sure we initialise the Storage view for this service
  70     HBufC* storeName = HBufC::NewLC( KVIMPSTUISPSMaxPropertyLength );
  71    
  72    TPtr storeNamePtr( storeName->Des() );  
  73    
  74    iEngine.ContactStoreIdL(storeNamePtr);
  75    
  76     CVIMPSTStorageManagerFactory::InitialiseViewL(serviceId, *storeName, iEngine.ServiceName());
  77     
  78     CleanupStack::PopAndDestroy(); //storeName   
  79     
  80     iEngine.IntializeStorageL();
  81        
  82     
  83     //create the array process
  84     iArrayProcess =  CVIMPSTProcessArray::NewL( iEngine );
  85 
  86    iEngine.RegisterServiceSessionObserverL(this);
  87    
  88     }
  89 
  90 
  91 // --------------------------------------------------------------------------
  92 // CVIMPSTCmdFactory::NewL
  93 // --------------------------------------------------------------------------
  94 //
 
68   95 CVIMPSTCmdFactory* CVIMPSTCmdFactory::NewL(MVIMPSTEngine& aEngine)
  96     {
  97     CVIMPSTCmdFactory* self = new (ELeave) CVIMPSTCmdFactory(aEngine);
  98     CleanupStack::PushL(self);
  99     self->ConstructL();
  100     CleanupStack::Pop(self);
68    101     return self;
  102     }
  103 
  104 
  105 // --------------------------------------------------------------------------
  106 // CVIMPSTCmdFactory::~CVIMPSTCmdFactory
  107 // --------------------------------------------------------------------------
  108 //
 
46 46   109 CVIMPSTCmdFactory::~CVIMPSTCmdFactory()
  110     {
  111     
  112     iEngine.UnIntializeStorage();
  113     iEngine.UnRegisterServiceSessionObserver(this);
  114     
  115     delete iArrayProcess;
  116     iArrayProcess = NULL;
  117     
  118     iObservers.Reset();
  119     iObservers.Close();
  120     }
  121 
  122 
  123 // --------------------------------------------------------------------------
  124 // CVIMPSTCmdFactory::CreateCommandForIdL
  125 // --------------------------------------------------------------------------
  126 //
 
68   127 MVIMPSTCmd* CVIMPSTCmdFactory::CreateCommandForIdL(
  128         TImCommandId aCommandId,TAny* aData /*NULL*/) 
  129     {
  130     
  131     MVIMPSTCmd* commd = NULL;
  132    
  133    //Instantiate appropriate command    
    134     switch ( aCommandId )
  135        {
   136           case ELoginService:    
  137           {           
  138           commd = CVIMPSTCmdLogin::NewL(aCommandId,*(TUint32*)aData, iEngine);
   139           break;   
  140           }
  141           
   142        case ELogoutService:
  143           {          
  144           commd = CVIMPSTCmdLogout::NewL(aCommandId,*(TUint32*)aData, iEngine);
   145           break;      
  146           }
   147        case ELaunchCCA:
  148           {
  149           commd = CVIMPSTCmdCCA::NewL(aCommandId,                                
  150                                (*(TLaunchCCAData*)aData).iIndex,
  151                                (*(TLaunchCCAData*)aData).iConnection,
  152                                *iArrayProcess, 
  153                                iEngine );
   154           break;
  155                 
  156           }
   157        case EAddContact:
  158           {
  159           commd = CVIMPSTCmdAddContact::NewL(aCommandId,*(TDesC*) aData, iEngine);
   160           break;
  161                 
  162           }
   163        case EDeleteContact:
  164           {
  165           commd = CVIMPSTCmdDeleteContact::NewL(aCommandId,*(MVPbkContactLink**) aData, iEngine);
   166           break;
  167                 
  168           }
   169        case EChangeOwnStatus:
  170           {
  171           commd = CVIMPSTCmdChangeOwnStatus::NewL(aCommandId,*(TStatusAndStatusText*) aData, iEngine);
   172           break;
  173                 
  174           }
   175        case EChangeOwnMessage:
  176           {
  177           commd = CVIMPSTCmdChangeOwnMessage::NewL(aCommandId,*(TStatusAndStatusText*) aData, iEngine);
   178           break;
  179                 
  180           }                 
   181         case ESearch:
  182           {
  183           commd = CVIMPSTCmdSearch::NewL(aCommandId,*(RArray<TVIMPSTSearchKeyData>*) aData, iEngine);
   184           break;
  185                 
  186           }    
 - 187         case EFriendAccpeted:
   188         case EFriendRejected:
  189             {
  190             commd = CVIMPSTCmdFriendRequest::NewL(aCommandId,*(TDesC*) aData, iEngine);
   191             break;
  192             }    
   193         case EChangeOwnAvtar:
  194             {
  195             commd = CVIMPSTCmdChangeOwnAvtar::NewL(aCommandId,*(TAvatarData*) aData, iEngine);
   196             break;
  197             }
   198         case ECloseConversation:
  199             {
  200             commd = CVIMPSTCmdCloseConversation::NewL(aCommandId,*(TDesC*) aData, iEngine);
   201             break;
  202             }
  203                   
   204         case EAddToPbk:
  205             {
  206             commd = CVIMPSTCmdAddToPbk::NewL(aCommandId,*(MVIMPSTStorageContact*) aData, iEngine);
   207             break;
  208             }
   209         case ECancelLogin:
  210             {
  211             commd = CVIMPSTCmdCancelLogin::NewL(aCommandId ,iEngine);
   212             break;
  213             }
  214         
   215         case ECmdProcessAcceptedContactNew:    
   216         case ECmdProcessSelectedContactNew:
   217         case ECmdProcessAcceptedContactExist:
   218         case ECmdProcessSelectedContactExist:
  219             {
  220             commd = CVIMPSTCmdProcessSelectedContact::NewL( aCommandId, *(TVPbkSelectedData*)aData, iEngine );                    
   221             break;
  222             }
   223         case ECmdBlockContact:
  224              {
  225              commd = CVIMPSTCmdBlockContact::NewL(aCommandId,*(TDesC*) aData, *iArrayProcess , iEngine);
   226              break;
  227                      
  228              }
   229         case ECmdUnBlockContact:
  230              {
  231              commd = CVIMPSTCmdUnBlockContact::NewL(aCommandId,*(TDesC*) aData, iEngine);
   232              break;
  233                      
  234              }
   235       case EFetchBlockedList:
  236          {
  237              commd = CVIMPSTCmdFetchBlockedContactList::NewL(aCommandId, iEngine);
   238          break;
  239          }
 - 240        default:
  241           {
 - 242           break;   
  243           }
  244              
  245        }   
  246        
68    247     return commd;
  248     
  249     }
  250 
  251 // --------------------------------------------------------------------------
  252 // CVIMPSTCmdFactory::HandleServiceEventL
  253 // --------------------------------------------------------------------------
  254 //
 
- 255 void CVIMPSTCmdFactory::HandleServiceEventL
  256                 ( TVIMPSTEnums::TVIMPSTRegistrationState aState,TInt aServiceError )
  257    {
  258    // need not to store update complete state
  259    iArrayProcess->SetLoginStateL( aState );
- 260    for( TInt index( 0 ); index < iObservers.Count(); ++index )
  261       {
  262       iObservers[index]->HandleCommandEventL(aState,aServiceError);
  263       }
  264 
  265    }
  266 // --------------------------------------------------------------------------
  267 // CVIMPSTCmdFactory::AddObserver
  268 // --------------------------------------------------------------------------
  269 //
 
- 270 void CVIMPSTCmdFactory::AddObserverL(MVIMPSTCmdObserver* aObserver)
  271    {
- 272    if( iObservers.Find( aObserver ) == KErrNotFound )
  273         {
  274         User::LeaveIfError( iObservers.Append( aObserver ) );
  275         }
  276 
  277    }
  278 // --------------------------------------------------------------------------
  279 // CVIMPSTCmdFactory::RemoveObserver
  280 // --------------------------------------------------------------------------
  281 //
 
- 282 void CVIMPSTCmdFactory::RemoveObserver(MVIMPSTCmdObserver* aObserver)
  283    {
  284    
  285    TInt index( iObservers.Find( aObserver) );
  286     
- 287     if( index != KErrNotFound )
  288         {
  289         iObservers.Remove( index );
  290         }
  291     
  292    }
  293 
  294 
  295 // --------------------------------------------------------------------------
  296 // CVIMPSTCmdFactory::GetProcessInterface
  297 // --------------------------------------------------------------------------
  298 //
 
- 299 MVIMPSTProcessArray& CVIMPSTCmdFactory::GetProcessInterface() 
  300    {
 - 301    return *iArrayProcess;    
  302    }   
  303 // End of File
  304 
***TER 76% (44/58) of SOURCE FILE cvimpstcmdfactory.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD33.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD33.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #33/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdfetchblockedlist.cpp
-Instrumentation mode: function-decision
-TER: 92 % ( 12/ 13)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

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

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD34.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD34.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #34/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdhandler.cpp
-Instrumentation mode: function-decision
-TER: 0 % ( 0/ 16)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstcmdhandler.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version: 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 "cvimpstcmdhandler.h"
  21 #include "cvimpstcmdfactory.h"
  22 
  23 #include "mvimpstcmd.h"
  24 #include "mvimpstengine.h"
  25 
  26 
  27 // --------------------------------------------------------------------------
  28 // CVIMPSTCmdHandler::CVIMPSTCmdHandler
  29 // --------------------------------------------------------------------------
  30 //
 
- 31 CVIMPSTCmdHandler::CVIMPSTCmdHandler()
  32     {
  33     }
  34 
  35 // --------------------------------------------------------------------------
  36 // CVIMPSTCmdHandler::~CVIMPSTCmdHandler
  37 // --------------------------------------------------------------------------
  38 //
 
- 39 CVIMPSTCmdHandler::~CVIMPSTCmdHandler()
  40     {
  41     delete iCommandFactory;
  42     }
  43 
  44 // --------------------------------------------------------------------------
  45 // CVIMPSTCmdHandler::NewL
  46 // --------------------------------------------------------------------------
  47 //
 
- 48 EXPORT_C CVIMPSTCmdHandler* CVIMPSTCmdHandler::NewL(MVIMPSTEngine& aEngine)
  49     {
  50     CVIMPSTCmdHandler* self = new(ELeave) CVIMPSTCmdHandler();
  51     CleanupStack::PushL(self);
  52     self->ConstructL(aEngine);
  53     CleanupStack::Pop(self);
 - 54     return self;
  55     }
  56 
  57 // --------------------------------------------------------------------------
  58 // CVIMPSTCmdHandler::ConstructL
  59 // --------------------------------------------------------------------------
  60 //
 
- 61 inline void CVIMPSTCmdHandler::ConstructL(MVIMPSTEngine& aEngine)
  62     {
  63     iCommandFactory = CVIMPSTCmdFactory::NewL(aEngine);
  64     }
  65 
  66 // --------------------------------------------------------------------------
  67 // CVIMPSTCmdHandler::HandleCommandL
  68 // --------------------------------------------------------------------------
  69 //
 
- 70 TBool CVIMPSTCmdHandler::HandleCommandL
  71         ( const TImCommandId aCommandId, MVIMPSTCmdObserver* aObserver, 
  72           TAny* aData )
  73     {
  74     TBool ret = EFalse;
  75 
  76    //use the variable aData to set the command related data
  77     MVIMPSTCmd* cmd = iCommandFactory->CreateCommandForIdL(
  78             aCommandId,aData);
  79     
- 80     if (cmd)
  81        {
  82        cmd->AddObserver(*aObserver);
- 83        TRAPD (err, cmd->ExecuteLD());
 - 83     catch (XLeaveException & l)
 - 83     catch (...)
  84        User::LeaveIfError(err);
  85        ret = ETrue;
  86        }
  87 
 - 88     return ret;
  89     }
  90  // --------------------------------------------------------------------------
  91 // CVIMPSTCmdHandler::RegisterEventObserver
  92 // --------------------------------------------------------------------------
  93 //
 
- 94 void CVIMPSTCmdHandler::RegisterEventObserverL( MVIMPSTCmdObserver* aObserver ) 
  95    {
  96    iCommandFactory->AddObserverL(aObserver);
  97    
  98    }
  99 // --------------------------------------------------------------------------
  100 // CVIMPSTCmdHandler::UnRegisterEventObserver
  101 // --------------------------------------------------------------------------
  102 //
 
- 103 void CVIMPSTCmdHandler::UnRegisterEventObserver( MVIMPSTCmdObserver* aObserver ) 
  104    {
  105    iCommandFactory->RemoveObserver(aObserver);
  106    }
  107 // --------------------------------------------------------------------------
  108 // CVIMPSTCmdHandler::GetProcessInterface
  109 // --------------------------------------------------------------------------
  110 //
 
- 111 MVIMPSTProcessArray& CVIMPSTCmdHandler::GetProcessInterface() 
  112    {
 - 113    return iCommandFactory->GetProcessInterface();    
  114    }
  115    
  116    
  117 // End of File
***TER 0% (0/16) of SOURCE FILE cvimpstcmdhandler.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD35.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD35.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #35/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdlogin.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 13/ 13)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

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

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD36.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD36.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #36/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdlogout.cpp
-Instrumentation mode: function-decision
-TER: 100 % ( 13/ 13)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

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

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD37.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD37.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,289 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #37/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdprocessselectedcontact.cpp
-Instrumentation mode: function-decision
-TER: 78 % ( 42/ 54)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstcmdprocessselectedcontact.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version: 12 %
  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 "cvimpstcmdprocessselectedcontact.h"
  21 
  22 #include <MVPbkStoreContact.h>
  23 #include <MVPbkFieldType.h>
  24 #include <MVPbkContactFieldTextData.h>
  25 #include <MVPbkContactFieldUriData.h>
  26 
  27 #include "vimpstcmd.hrh"
  28 #include "mvimpstcmdobserver.h"
  29 #include "vimpstdebugprint.h"
  30 
  31 #include <e32def.h>
  32 #include <mvpbkcontactlinkarray.h>
  33 #include "mvimpstengine.h"
  34 
  35 #include "mvimpststorageserviceview.h"
  36 #include "cvimpststoragemanagerfactory.h"
  37 #include "mvimpstenginecontactmgmtextention.h"
  38 #include "tvimpstconsts.h"
  39 #include "mvimpstenginesubservice.h"
  40 #include "mvimpstenginepresencesubservice.h"
  41 
  42 // Constants
  43 _LIT( KListNameAllBuddy ,"buddylist" );
  44 
  45 // --------------------------------------------------------------------------
  46 // CVIMPSTCmdProcessSelectedContact::CVIMPSTCmdProcessSelectedContact
  47 // --------------------------------------------------------------------------
  48 //
 
  49 CVIMPSTCmdProcessSelectedContact::CVIMPSTCmdProcessSelectedContact( const TInt aCommandId ,
  50                                                                     TVPbkSelectedData& aSelectedEntries,
  51                                                                     MVIMPSTEngine& aEngine ):            
  52                                                                     iCommandId( aCommandId ),
  53                                                                     iSelectedEntries( aSelectedEntries ),
  54                                                                     iEngine(aEngine)
  55     {
  56     }
  57 
  58 // --------------------------------------------------------------------------
  59 // CVIMPSTCmdProcessSelectedContact::~CVIMPSTCmdProcessSelectedContact
  60 // --------------------------------------------------------------------------
  61 //
 
  62 CVIMPSTCmdProcessSelectedContact::~CVIMPSTCmdProcessSelectedContact()
  63     {    
  64     
  65     }
  66 
  67 // --------------------------------------------------------------------------
  68 // CVIMPSTCmdProcessSelectedContact::NewL
  69 // --------------------------------------------------------------------------
  70 //
 
  71 CVIMPSTCmdProcessSelectedContact* CVIMPSTCmdProcessSelectedContact::NewL( const TInt aCommandId,
  72                                                                           TVPbkSelectedData& aSelectedEntries,
  73                                                                           MVIMPSTEngine& aEngine )
  74     {
  75     CVIMPSTCmdProcessSelectedContact* self = new (ELeave ) CVIMPSTCmdProcessSelectedContact( aCommandId ,aSelectedEntries, aEngine);
  76     self->ConstructL(); //use contsurctL if necessary
   77     return self;
  78     }
  79 // --------------------------------------------------------------------------
  80 // CVIMPSTCmdProcessSelectedContact::ConstructL
  81 // --------------------------------------------------------------------------
  82 //
 
  83 void CVIMPSTCmdProcessSelectedContact::ConstructL()
  84     {    
  85     iError = KErrNone;
  86     }
  87 
  88 // --------------------------------------------------------------------------
  89 // CVIMPSTCmdProcessSelectedContact::ExecuteLD
  90 // --------------------------------------------------------------------------
  91 //
 
  92 void CVIMPSTCmdProcessSelectedContact::ExecuteLD()
  93     {
  94     CHAT_DP_FUNC_ENTER("CVIMPSTCmdProcessSelectedContact::ExecuteLD");
  95     //push to the cleanupstack
  96     CleanupStack::PushL( this );
  97     MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ;
- 98     if(storage)
  99         {
  100         TBool localStore = storage->IsLocalStore();
  101         //retrieve contact from links  
  102         TPtrC8 pacledLinks = iSelectedEntries.iPackedLinks->Des();
  103         TInt  count = storage->RetriveLinkXSPIdsL( pacledLinks  );
- 104         if( !count )
  105             {
  106             iError = KErrGeneral;   
  107             }
  108        if( (iCommandId == ECmdProcessSelectedContactNew  ||
  109                iCommandId == ECmdProcessSelectedContactExist )&& 
  110                iError == KErrNone )
  111            {
  112            MVIMPSTEngineExtentionFeatures* contactFeature = iEngine.ExtentionFeatures(TVIMPSTEnums::EContactManagement);
  113            MVIMPSTEngineSubService* presenceService = iEngine.SubService(TVIMPSTEnums::EPresence);
12   114             for(TInt index = 0; index < count; index++ )
  115                {
  116                TPtrC xspIdPtr = storage->GetRetrieveXSPIdL( index ); // xspId is owned here
12 - 117                if( localStore )
  118                {
  119                iError = KErrNone;
12 - 120                if( xspIdPtr.Length() )
  121                   {
  122                   if( IsContactBlocked( xspIdPtr ) )
  123                      {
  124                      iError = EErrExistInBlockList;   
  125                      }
  126                   else if( storage->FindContactByUserId( xspIdPtr ) )
  127                      {
  128                      iError = EErrExistInContactList;   
  129                      }
- 130                   else if( contactFeature  )
  131                      {
  132                      // add to server and store if sucess
  133                      MVIMPSTEngineContactMgmtExtention& contactMgr = 
  134                                  MVIMPSTEngineContactMgmtExtention::Cast (*contactFeature);
  135                      iError = contactMgr.AddServerContactL( KListNameAllBuddy, xspIdPtr ,KNullDesC );                     
  136                      }
  137                   }
12 - 138                if(KErrNone == iError )
  139                   {
  140                   iError = storage->CreateNewContactFromRetrivedIdL( index );
  141                   }
  142                else if( iCommandId == ECmdProcessSelectedContactNew  )
  143                    {
  144                    // delete the contact which got created in phonebook but failed to add in servicetab
  145                    storage->DeleteNewContactFromRetrivedIdL( index );
  146                    }
  147                }
- 148                else if( xspIdPtr.Length() )
  149                {
  150                // xspId ownership is transfered to iXSPList
  151                iSelectedEntries.iXSPList.AppendL( xspIdPtr.AllocL() );
  152                }
  153                  }
  154            }
  155        else if( ( iCommandId == ECmdProcessAcceptedContactNew || 
  156                iCommandId == ECmdProcessAcceptedContactExist )&& 
- 157                iError == KErrNone )// for accepted contact 
  158           {
  159           // just add and return
  160           // contact is already added in storage in RetrieveContactL
  161           // if sucess ,storage will take ownership else we need to delete contact
  162           iError = storage->CreateNewContactFromRetrivedIdL( 0 ); // for accepting invitation take the first contact which is retirved
  163           if( iError != KErrNone && iCommandId == ECmdProcessAcceptedContactNew )
  164               {
  165               // delete the contact which got created in phonebook but failed to add in servicetab
  166               storage->DeleteNewContactFromRetrivedIdL( 0 );
  167               }
  168           }
- 169      if( !localStore )
  170         {
  171         // in case of server we have a selection dialog 
  172         // so this error does not matter 
  173         // set to 0
  174         iError = KErrNone;   
  175         }
  176        }
    177     else
  178         {
  179         iError = KErrGeneral;
  180         }
  181     if(iObserver)
  182         {
  183         iObserver->CommandFinishedL(*this);
  184         }
  185     CHAT_DP_FUNC_ENTER("CVIMPSTCmdProcessSelectedContact:: CommandFinished");    
  186     CleanupStack::PopAndDestroy();  
  187     CHAT_DP_FUNC_DONE("CVIMPSTCmdProcessSelectedContact::ExecuteLD");    
  188     }
  189 
  190 
  191 // --------------------------------------------------------------------------
  192 // CVIMPSTCmdProcessSelectedContact::AddObserver
  193 // --------------------------------------------------------------------------
  194 //
 
  195 void CVIMPSTCmdProcessSelectedContact::AddObserver( MVIMPSTCmdObserver& aObserver )
  196     {
  197     // store the observer to notify the command completion
  198     iObserver = &aObserver;
  199     }
  200 
  201 
  202 // --------------------------------------------------------------------------
  203 // CVIMPSTCmdProcessSelectedContact::CommandId
  204 // --------------------------------------------------------------------------
  205 //
 
  206 TInt CVIMPSTCmdProcessSelectedContact::CommandId() const
  207     {
   208     return iCommandId;  
  209     }
  210 
  211 // --------------------------------------------------------------------------
  212 // CVIMPSTCmdProcessSelectedContact::Result
  213 // --------------------------------------------------------------------------
  214 //
 
  215 TInt CVIMPSTCmdProcessSelectedContact::Result() const
  216     {
  217     //return valid data regd the command operation
   218     return iError;
  219     }
  220  
  221  // --------------------------------------------------------------------------
  222 // CVIMPSTCmdProcessSelectedContact::Result
  223 // --------------------------------------------------------------------------
  224 //
  225 // --------------------------------------------------------------------------
  226 // CVIMPSTCmdProcessSelectedContact::IsContactBlocked
  227 // --------------------------------------------------------------------------
 
12   228 TBool CVIMPSTCmdProcessSelectedContact::IsContactBlocked(const TDesC& aUserId)
  229    {
  230       MVIMPSTEngineSubService* subService =          
  231                         (iEngine.SubService(TVIMPSTEnums::EPresence));
12 - 232     if(subService)
  233         {
  234         MVIMPSTEnginePresenceSubService& presence = 
  235               MVIMPSTEnginePresenceSubService::Cast (*subService);
  236               
  237         RPointerArray<HBufC> *blockedlist = presence .GetBlockedList();
  238         
12 - 239         if(blockedlist)
  240            {
12   241            for(TInt i=0; i<blockedlist->Count(); ++i)
  242             {
  243             if(0 == aUserId.CompareC((*blockedlist)[i]->Des()))
  244                {
   245                return ETrue;
  246                }
  247             }
  248            }
  249         }
   250     return EFalse;  
  251    }       
  252 // End of File
***TER 78% (42/54) of SOURCE FILE cvimpstcmdprocessselectedcontact.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD38.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD38.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #38/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdsearch.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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 //
 
  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 //
 
  51 CVIMPSTCmdSearch::~CVIMPSTCmdSearch()
  52     {    
  53     
  54     }
  55 
  56 // --------------------------------------------------------------------------
  57 // CVIMPSTCmdSearch::NewL
  58 // --------------------------------------------------------------------------
  59 //
 
  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 //
 
  73 void CVIMPSTCmdSearch::ConstructL()
  74     {    
  75     iError = KErrNone;
  76     }
  77 
  78 // --------------------------------------------------------------------------
  79 // CVIMPSTCmdSearch::ExecuteLD
  80 // --------------------------------------------------------------------------
  81 //
 
  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 //
 
  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 //
 
  126 TInt CVIMPSTCmdSearch::CommandId() const
  127    {
   128    return iCommandId;   
  129    }
  130 
  131 // --------------------------------------------------------------------------
  132 // CVIMPSTCmdSearch::Result
  133 // --------------------------------------------------------------------------
  134 //
 
  135 TInt CVIMPSTCmdSearch::Result() const
  136    {
  137    //return valid data regd the command operation
   138    return iError;
  139    }
  140 
  141 // End of File
***TER 93% (14/15) of SOURCE FILE cvimpstcmdsearch.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD39.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD39.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,185 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #39/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdunblockcontact.cpp
-Instrumentation mode: function-decision
-TER: 82 % ( 14/ 17)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstcmdunblockcontact.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version:  8 %
  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 "cvimpstcmdunblockcontact.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 "cvimpststoragemanagerfactory.h"
  29 #include "mvimpststorageserviceview.h"
  30 
  31 #include "mvimpstenginesubservice.h"
  32 #include "mvimpstenginepresencesubservice.h"
  33 #include "tvimpstconsts.h"
  34 // --------------------------------------------------------------------------
  35 // CVIMPSTCmdUnBlockContact::CVIMPSTCmdDeleteContact
  36 // --------------------------------------------------------------------------
  37 //
 
  38 CVIMPSTCmdUnBlockContact::CVIMPSTCmdUnBlockContact( 
  39         const TInt aCommandId ,  const TDesC& aContactId,
  40         MVIMPSTEngine& aEngine) :            
  41             iCommandId( aCommandId ),
  42             iContactId( aContactId ),
  43             iEngine(aEngine)
  44     {
  45     }
  46 
  47 // --------------------------------------------------------------------------
  48 // CVIMPSTCmdUnBlockContact::~CVIMPSTCmdUnBlockContact
  49 // --------------------------------------------------------------------------
  50 //
 
  51 CVIMPSTCmdUnBlockContact::~CVIMPSTCmdUnBlockContact()
  52     {    
  53     
  54     }
  55 
  56 // --------------------------------------------------------------------------
  57 // CVIMPSTCmdUnBlockContact::NewL
  58 // --------------------------------------------------------------------------
  59 //
 
  60 CVIMPSTCmdUnBlockContact* CVIMPSTCmdUnBlockContact::NewL( 
  61         const TInt aCommandId, const TDesC& aContactId,
  62         MVIMPSTEngine& aEngine)
  63     {
  64     CVIMPSTCmdUnBlockContact* self = new (ELeave ) CVIMPSTCmdUnBlockContact( aCommandId ,aContactId, aEngine);
  65     self->ConstructL(); //use contsurctL if necessary
   66     return self;
  67     }
  68 // --------------------------------------------------------------------------
  69 // CVIMPSTCmdUnBlockContact::ConstructL
  70 // --------------------------------------------------------------------------
  71 //
 
  72 void CVIMPSTCmdUnBlockContact::ConstructL()
  73     {    
  74     iError = KErrNotFound;
  75     }
  76 
  77 // --------------------------------------------------------------------------
  78 // CVIMPSTCmdUnBlockContact::ExecuteLD
  79 // --------------------------------------------------------------------------
  80 //
 
  81 void CVIMPSTCmdUnBlockContact::ExecuteLD()
  82     {
  83     CHAT_DP_FUNC_ENTER("CVIMPSTCmdUnBlockContact::ExecuteLD");
  84     //push to the cleanupstack
  85     CleanupStack::PushL( this );       
- 86     if(iContactId.Length())
  87         {
  88         //Get Presence SubService           
  89         MVIMPSTEngineSubService* subService =          
  90         (iEngine.SubService(TVIMPSTEnums::EPresence));
- 91         if (subService && iEngine.IsBlockSupportedL())
  92             {
  93             MVIMPSTEnginePresenceSubService& presence = 
  94             MVIMPSTEnginePresenceSubService::Cast (*subService);
  95             HBufC* userId = HBufC::NewLC(KPropertyMaxLength); //  2 onto cleanup stack
  96             TPtr userIdPtr = userId->Des();
  97             userIdPtr = iContactId;
  98           
  99             CHAT_DP( D_CHAT_LIT(" -> userId: %s" ), &userIdPtr);
  100             iError = presence.RemoveFromBlockListL(*userId);
  101             CHAT_DP( D_CHAT_LIT(" -> iError: %d" ), iError);
  102             CleanupStack::PopAndDestroy(userId);//2
  103           
  104             }
  105         }
  106 
  107     CHAT_DP_FUNC_ENTER("CVIMPSTCmdUnBlockContact:: CommandFinished");
  108 
- 109     if(iObserver)
  110         {
  111         iObserver->CommandFinishedL(*this);
  112         }
  113     CHAT_DP_FUNC_ENTER("CVIMPSTCmdUnBlockContact:: CommandFinished"); 
  114     CleanupStack::PopAndDestroy();  
  115     CHAT_DP_FUNC_DONE("CVIMPSTCmdUnBlockContact::ExecuteLD"); 
  116     }
  117 
  118 
  119 // --------------------------------------------------------------------------
  120 // CVIMPSTCmdUnBlockContact::AddObserver
  121 // --------------------------------------------------------------------------
  122 //
 
  123 void CVIMPSTCmdUnBlockContact::AddObserver( MVIMPSTCmdObserver& aObserver )
  124     {
  125     // store the observer to notify the command completion
  126     iObserver = &aObserver;
  127     }
  128 
  129 
  130 // --------------------------------------------------------------------------
  131 // CVIMPSTCmdUnBlockContact::CommandId
  132 // --------------------------------------------------------------------------
  133 //
 
  134 TInt CVIMPSTCmdUnBlockContact::CommandId() const
  135    {
   136    return iCommandId;   
  137    }
  138 
  139 // --------------------------------------------------------------------------
  140 // CVIMPSTCmdUnBlockContact::Result
  141 // --------------------------------------------------------------------------
  142 //
 
  143 TInt CVIMPSTCmdUnBlockContact::Result() const
  144    {
  145    //return valid data regd the command operation
   146    return iError;
  147    }
  148 
  149 // End of File
***TER 82% (14/17) of SOURCE FILE cvimpstcmdunblockcontact.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD4.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD4.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #4/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_ccafactory.cpp
-Instrumentation mode: function-decision
-TER: 0 % ( 0/ 3)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 
  2 /*
  3  * ============================================================================
  4  *  Name        : ccafactory.cpp
  5  *  Part of     : CCA / CCAClient
  6  *  Description : Factory class for CCA Client
  7  *  Version     : %version: 2 % << Don't touch! Updated by Synergy at check-out.
  8  *
  9  *  Copyright © 2007 Nokia.  All rights reserved.
  10  *  This material, including documentation and any related computer
  11  *  programs, is protected by copyright controlled by Nokia.  All
  12  *  rights are reserved.  Copying, including reproducing, storing,
  13  *  adapting or translating, any or all of this material requires the
  14  *  prior written consent of Nokia.  This material also contains
  15  *  confidential information which may not be disclosed to others
  16  *  without the prior written consent of Nokia.
  17  * ============================================================================
  18  * Template version: 4.2
  19  */
  20 #include <ccafactory.h>
  21 #include "s_mccaparameter.h"
  22 
  23 class MCCAConnection;
  24 class MCCAParameter;
  25 
  26     /**
  27      * Create new CCA client parameter entity.
  28      * Ownership is transferred.
  29      * @since S60 5.0
  30      * @return MCCAParameter, ownership is transferred.
  31      */
 
- 32     EXPORT_C  MCCAParameter* TCCAFactory::NewParameterL( )
  33     {
  34     MCCAParameter* parameter = MCCAParameterstub::NewL();
 - 35     return parameter;
  36     }
  37 
  38     /**
  39      * Create new CCA client connection entity.
  40      * Ownership is transferred.
  41      * @since S60 5.0
  42      * @return MCCAConnection, ownership is transferred.
  43      */
 
- 44     EXPORT_C  MCCAConnection* TCCAFactory::NewConnectionL( )
  45     {
  46     }
  47 // End of File
  48     
***TER 0% (0/3) of SOURCE FILE s_ccafactory.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD40.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD40.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1952 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #40/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessarray.cpp
-Instrumentation mode: function-decision
-TER: 56 % (285/511)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2  * ===========================================================================
  3  *  Name        : cvimpstprocessarray.cpp
  4  *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5  *  Description : 
  6  *  Version     : %version: 68.1.29 %
  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 <coemain.h>
  21 #include    "vimpstdebugprint.h" 
  22 
  23 #include "cvimpstprocessarray.h"
  24 
  25 #include "mvimpstprocessarrayobserver.h"
  26 #include "cvimpststoragemanagerfactory.h"
  27 #include "mvimpststorageserviceview.h"
  28 #include "TVIMPSTEnums.h"
  29 #include "cvimpstprocessarrayitem.h"
  30 #include "mvimpststorageitemmodel.h"
  31 #include "tvimpstconsts.h"
  32 #include "mvimpststoragecontactlist.h"
  33 #include "mvimpststoragevpbkstorehandler.h"
  34 #include "mvimpstengine.h"
  35 #include "cvimpstprocessfriendrequestitem.h"
  36 #include "mvimpstenginesubservice.h"
  37 #include <mvpbkfieldtype.h>
  38 #include <mvpbkcontactfielduridata.h>
  39 #include <MVPbkContactFieldTextData.h>
  40 //rsg file for resource id
  41 #include <vimpstuires.rsg>
  42 #include "vimpstutils.h"
  43 #include <mvpbkcontactlink.h>
  44 #include <vpbkeng.rsg>
  45 #include "mvimpstengineimsubservice.h"
  46 #include "mvimpstenginepresencesubservice.h"
  47 #include "vimpstdebugtrace.h"
  48 #include <APGTASK.H> 
  49 #include "imcvuiparams.h"
  50 
  51 // --------------------------------------------------------------------------
  52 // CVIMPSTProcessArray::CIMArrayProcess
  53 // --------------------------------------------------------------------------
  54 //
 
118 118   55 CVIMPSTProcessArray::CVIMPSTProcessArray( MVIMPSTEngine& aEngine)
  56 :iOwnDataIndex(KOwnDataIndex),
  57 iContactListIndex(KOwnDataIndex),
  58 iEngine(aEngine)
  59         {
  60         iServiceId = iEngine.ServiceId();
  61         }
  62 
  63 // --------------------------------------------------------------------------
  64 // CVIMPSTProcessArray::~CVIMPSTProcessArray
  65 // --------------------------------------------------------------------------
  66 //
 
46 46   67 CVIMPSTProcessArray::~CVIMPSTProcessArray()
  68     {
  69     TRACE( T_LIT("CVIMPSTProcessArray::~CVIMPSTProcessArray Start") );
46 - 70     if(iContactInterface)
  71         {
  72         iContactInterface->RemoveObserver( this );   
  73         }
  74     iItemArray.ResetAndDestroy();
  75     iItemArray.Close();
  76     iUnKnownContactArray.Close();
  77     iAddRequestArray.Close();
  78     
46 - 79     if(iData)
  80         {
  81         delete iData;
  82         iData = NULL;
  83         }
  84     //Get IM SubService     
  85     MVIMPSTEngineSubService* subService1 =          
  86     (iEngine.SubService(TVIMPSTEnums::EIM));
  87 
46 - 88     if(subService1)
  89         {
  90         MVIMPSTEngineIMSubService& imSubService = 
  91         MVIMPSTEngineIMSubService::Cast (*subService1);
  92         imSubService.UnRegisterChatObserver(this);
  93         }
  94 
  95     //subscribe for ownpresencechangeevent             
  96     MVIMPSTEngineSubService* subService =          
  97     (iEngine.SubService(TVIMPSTEnums::EPresence));
  98 
46 - 99     if(subService)
  100         {
  101         MVIMPSTEnginePresenceSubService& presence = 
  102         MVIMPSTEnginePresenceSubService::Cast (*subService);
  103         presence.UnRegisterPresenceEventObserver(this);
  104         } 
  105 
  106     TRACE( T_LIT("CVIMPSTProcessArray::~CVIMPSTProcessArray End") );
  107     }
  108 
  109 // --------------------------------------------------------------------------
  110 // CVIMPSTProcessArray::NewL
  111 // --------------------------------------------------------------------------
  112 //
 
118   113 CVIMPSTProcessArray* CVIMPSTProcessArray::NewL(
  114         MVIMPSTEngine& aEngine)
  115     {
  116     TRACE( T_LIT("CVIMPSTProcessArray::NewL Start") );
  117     CVIMPSTProcessArray* self = new(ELeave) CVIMPSTProcessArray(aEngine);
  118     CleanupStack::PushL(self);
  119     self->ConstructL();
  120     CleanupStack::Pop(self);
  121     TRACE( T_LIT("CVIMPSTProcessArray::NewL End") );
118    122     return self;
  123     
  124     }
  125 
  126 // --------------------------------------------------------------------------
  127 // CVIMPSTProcessArray::ConstructL
  128 // --------------------------------------------------------------------------
  129 //
 
118 118   130 void CVIMPSTProcessArray::ConstructL()
  131     {
  132     TRACE( T_LIT("CVIMPSTProcessArray::ConstructL Start") );
  133     iContactInterface = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId);
118 - 134     if(iContactInterface)
  135         {        
  136         iContactInterface->AddObserverL( this );// listen these events..        
  137         }
  138     HBufC* unnamed = VIMPSTUtils::LoadResourceL( R_SERVTAB_UNNAMED );
118 - 139     if( unnamed )
  140        {
  141        CleanupStack::PushL( unnamed );
  142        iContactInterface->SetUnnamedTextL(unnamed); // takes ownership
  143        CleanupStack::Pop( unnamed );   
  144        }
  145     iContactListModel = CVIMPSTStorageManagerFactory::ItemModelInterfaceL(iServiceId);
  146     iLoginState = iEngine.ServiceState();
  147     //Get IM SubService     
  148     MVIMPSTEngineSubService* subService1 =(iEngine.SubService(TVIMPSTEnums::EIM));
118 - 149     if(subService1)
  150         {
  151         MVIMPSTEngineIMSubService& imSubService = 
  152         MVIMPSTEngineIMSubService::Cast (*subService1);
  153         imSubService.RegisterChatObserver(this);
  154         }
  155     iData = HBufC::NewL(512);
  156     iAddRequestArray.Reset();
  157     iUnKnownContactArray.Reset();
  158     //subscribe for ownpresencechangeevent
  159     MVIMPSTEngineSubService* subService =          
  160     (iEngine.SubService(TVIMPSTEnums::EPresence));
118 - 161     if(subService)
  162         {        
  163         MVIMPSTEnginePresenceSubService& presence = 
  164         MVIMPSTEnginePresenceSubService::Cast (*subService);
  165         presence.RegisterPresenceEventObserverL(this);        
  166         }
  167    ResetArray();
  168    TRACE( T_LIT("CVIMPSTProcessArray::ConstructL end") );
  169     }
  170 // --------------------------------------------------------------------------
  171 // CVIMPSTProcessArray::HandleStorageChangeL
  172 // --------------------------------------------------------------------------
  173 //
 
28 28   174 void CVIMPSTProcessArray::HandleStorageChangeL( TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType,
  175                                        MVIMPSTStorageContactList* /*aList*/, 
  176                                       MVIMPSTStorageContact* aContact,
  177                                       TInt aContactIndex )
  178     {
  179     TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL Function Start") );
  180     // 0th index OwnItem + unknow contacts + add request
  181     aContactIndex = aContactIndex + 1 + iUnKnownContactArray.Count() + iAddRequestArray.Count();
  182     
    183     switch( aEventType )
  184         {
   185         case TVIMPSTEnums::EStorageContactReadComplete:
  186             {
  187             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageContactReadComplete Start") );
- 188             if(iProcessObservers)
  189                 {
  190                 /* passing 0 so that the focus is on owndata item */
  191                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EOwnStatusItem, 0 ); // focus own item
  192                 }
  193             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageContactReadComplete End") );
   194             break;
  195             }
   196         case TVIMPSTEnums::EStorageContactFetchComplete:
  197             {
  198             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageContactFetchComplete Start") );
  199             TRACE( T_LIT("HandleStorageChangeL EStorageContactFetchComplete iItemArray Count: %d"), iItemArray.Count() );
  200 
- 201             if(iProcessObservers)
  202                 {
  203                 /* passing 0 so that the focus is on owndata item */
  204                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EOwnStatusItem, 0 ); // focus own item
  205                 }
  206             iFetchCompleted = ETrue;
  207             GetAndCreateOpenChatListL();
  208             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageContactFetchComplete End") );
   209             break;    
  210             }
   211         case TVIMPSTEnums::EStorageContactReading:
   212         case TVIMPSTEnums::EStorageContactFetching:
 - 213         case TVIMPSTEnums::EStorageContactSynchronizing:
  214             {
  215             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageContactFetching/EStorageContactFetching Start") );
  216             /*
  217              *   This event occurs whenever we have contacts added to contactlist. This happens in the following scenarios
  218              *   1. At the time of login, when we fetch contacts, contact-by-contact is added to the storage. so we get this event.
  219              *    2. When we add a contact manually (either from phonebook, or manu adding etc.. ) we get this callback.
  220              */
  221             TRACE( T_LIT("contactindex = %d"),aContactIndex );
  222             CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (const_cast<TDesC&>(aContact->Name() ),
  223                     const_cast<TDesC&>(aContact->UserId() ),
  224                     aContact->ContactLink() );
  225 
  226             /* All the time the index should be less than the item array's count, but during the fetch of contacts from cdb file to the view, 
  227              * if we havent got a contactviewready, and during that if I get contactaddition, before getting contactFetchComplete, we should keep 
  228              * appending the items to the array for display, once we get the entire list, its sorted anyway while insertion, and when presence occurs
  229              * the contacts are re-sorted. 
  230              */
  231             TRACE( T_LIT("itemarraycount = %d"),iItemArray.Count() );
  232             if (aContactIndex >= iItemArray.Count() )
  233                 {
  234                 TRACE( T_LIT("append contact item %d"), contactItem);
  235                 iItemArray.Append(contactItem);
  236                 }
    237             else
  238                 {
  239                 TRACE( T_LIT("Insert at index = %d"), aContactIndex);
  240                 iItemArray.Insert(contactItem, aContactIndex );
  241                 }               
- 242             if(iProcessObservers)
  243                 {
  244                 /* passing 0 so that the focus is on owndata item */
  245                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EOwnStatusItem, 0);
  246                 }
- 247             if( aContact->AvatarContent().Length() && iProcessObservers )
  248                 {
  249                 iProcessObservers->HandleAvatarChangeL( aContact->UserId() );
  250                 }
  251             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageContactFetching/EStorageContactFetching End") );
   252             break;
  253             }
   254         case TVIMPSTEnums::EStorageEventContactAddition:
  255             {
  256             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventContactAddition Start") );
  257 
  258             TBool removed = RemoveFromUnknonOrInvitationListL( aContact->UserId(), EFalse );
- 259             if( removed )
  260                 {
  261                 aContactIndex = aContactIndex - 1; // one contact is removed from iUnknownContactArray 
  262                 }
  263             /*
  264              *   This event occurs whenever we have contacts added to contactlist. This happens in the following scenarios
  265              *   1. At the time of login, when we fetch contacts, contact-by-contact is added to the storage. so we get this event.
  266              *    2. When we add a contact manually (either from phonebook, or manu adding etc.. ) we get this callback.
  267              */
  268             TPtrC userId = aContact->UserId();
  269             TRACE( T_LIT("contactindex = %d"),aContactIndex );
  270             CVIMPSTProcessContactItem* contactItem = CVIMPSTProcessContactItem::NewL (aContact->Name() ,
  271                                                                                         userId,
  272                                                                                         aContact->ContactLink() );
  273 
  274             /* All the time the index should be less than the item array's count, but during the fetch of contacts from cdb file to the view, 
  275              * if we havent got a contactviewready, and during that if I get contactaddition, before getting contactFetchComplete, we should keep 
  276              * appending the items to the array for display, once we get the entire list, its sorted anyway while insertion, and when presence occurs
  277              * the contacts are re-sorted. 
  278              */
  279             TRACE( T_LIT("itemarraycount = %d"),iItemArray.Count() );
- 280             if (aContactIndex >= iItemArray.Count() )
  281                 {
  282                 TRACE( T_LIT("append contact item = %d"), contactItem);
  283                 iItemArray.Append(contactItem);
  284                 }                
    285             else
  286                 {
  287                 TRACE( T_LIT("Insert at index = %d"), aContactIndex);
  288                 iItemArray.Insert(contactItem, aContactIndex );
  289                 }                
  290              // check if  pending message exist
- 291             if( TVIMPSTEnums::ESVCERegistered == iLoginState && userId.Length() )
  292                 {
- 293                 if( IsConversationExistL( userId ) )
  294                     {
  295                     contactItem->SetConversationOpen(ETrue);
  296                     }
- 297                 if( IsUnreadMessageExistsL( userId ) )
  298                     {
  299                     contactItem->SetMsgPending(ETrue);
  300                     }
  301                 }
  302 
- 303             if(iProcessObservers)
  304                 {
  305                 /* passing aContactIndex so that the focus is on owndata item */
  306                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, aContactIndex );
  307                 }   
  308             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventContactAddition End") );
   309             break;
  310             }
   311         case TVIMPSTEnums::EStorageEventContactDelete:
  312             {
  313             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventContactDelete Start") );
  314             TRACE( T_LIT("contactindex = %d"),aContactIndex );
  315             TRACE( T_LIT("itemarraycount = %d"),iItemArray.Count() );
  316             if( aContactIndex < iItemArray.Count() )
  317                 {
  318                 MVIMPSTProcessArrayItem* deletedItem = iItemArray[ aContactIndex ]; 
  319                 TRACE( T_LIT("contact removed in item array of index = %d"),aContactIndex );
  320                 iItemArray.Remove (aContactIndex);
  321                 delete deletedItem;
  322                 iItemArray.Compress();
  323                 TRACE( T_LIT("contactindex = %d"),aContactIndex );
  324                 }
- 325             if(iProcessObservers)
  326                 {
  327                 iProcessObservers->HandleDeletionL(TVIMPSTEnums::EContactItem, aContactIndex);
  328                 }
  329             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventContactDelete End") );
   330             break;
  331             }
   332         case TVIMPSTEnums::EStorageAvatarChange:
  333             {
  334             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAvatarChange Start") );
- 335             if(iProcessObservers  && aContact )
  336                 {
  337                 TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAvatarChange inside if") );
  338                 TPtrC aUserId = aContact->UserId();
  339                 TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAvatarChange aUserId = %S"), &aUserId );
  340                 iProcessObservers->HandleAvatarChangeL( aContact->UserId() );
  341                 }
  342             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAvatarChange End") );
   343             break;            
  344             }
   345         case TVIMPSTEnums::EStorageOwnPresenceChange:
  346             {
  347             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAvatarChange Start") );
- 348             if(iProcessObservers)
  349                 {
  350                 /* passing index as 0, so thta focus remains at the owndata item */
  351                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EOwnStatusItem, KErrNotFound );
  352                 }
  353             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAvatarChange End") );
   354             break;
  355             }
   356         case TVIMPSTEnums::EStorageMultiplePresenceChange:
  357            {
  358            TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAvatarChange Start") );
  359            // mostly this will get called after just login and fetch time
  360            ResetArray();
- 361             if(iProcessObservers )
  362                 {
  363                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound );
  364                 }
  365             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAvatarChange End") );
   366            break;   
  367            }
   368         case TVIMPSTEnums::EStoragePresenceChange:
  369             {
  370             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStoragePresenceChange Start") );
  371             /* 
  372              *   After Sort we get the new index... So first we need to remove the contact from the old position, 
  373              *   and then re-insert it at the correct obtained position (newIndex in this case)
  374              */
  375             TRACE( T_LIT("contactindex = %d"),aContactIndex );
  376             TRACE( T_LIT("itemarraycount = %d"),iItemArray.Count() );
- 377             if( aContactIndex < iItemArray.Count() )
  378                 {                
  379                 TInt newIndex = iContactListModel->IndexOfContact( aContact );
  380                 TRACE( T_LIT("new index = %d"),newIndex );
  381                 CVIMPSTProcessContactItem* newItem = CVIMPSTProcessContactItem::NewL(const_cast<TDesC&>(aContact->Name() ),
  382                         const_cast<TDesC&>(aContact->UserId() ),
  383                         aContact->ContactLink() );
  384                 MVIMPSTProcessArrayItem* oldItem = iItemArray[ aContactIndex ]; 
  385                 TRACE( T_LIT("contact removed in item array of index = %d"),aContactIndex );
  386                 iItemArray.Remove(aContactIndex );
  387                 delete oldItem;
  388                 iItemArray.Compress();
  389                 // Add it in the new index
  390                 newIndex = newIndex + 1 + iUnKnownContactArray.Count()+ iAddRequestArray.Count();
- 391                 if (newIndex >= iItemArray.Count())
  392                     {
  393                     TRACE( T_LIT("append contact item = %d"), newIndex);
  394                     iItemArray.Append (newItem);
  395                     }
    396                 else
  397                     {
  398                     TRACE( T_LIT("Insert at index = %d"), newItem);
  399                     iItemArray.Insert (newItem, newIndex);
  400                     }   
  401                 }
- 402             if(iProcessObservers )
  403                 {
  404                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound );
  405                 }
  406             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStoragePresenceChange End") );
   407             break;
  408             }
   409         case TVIMPSTEnums::EStorageEventOwnUserChanged:
  410             {
  411             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventOwnUserChanged Start") );
  412             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL start Event = %d"),aEventType );
  413             ResetArray();
- 414             if(iProcessObservers )
  415                 {
  416                 iProcessObservers->HandleDeletionL(TVIMPSTEnums::EOwnStatusItem, 0 ); // focus own item
  417 
- 418                 if( aContact )
  419                     {
  420                     iProcessObservers->HandleAvatarChangeL( aContact->UserId() );
  421                     }
  422                 }
  423             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventOwnUserChanged End") );
  424 
   425             break;
  426             }
   427         case TVIMPSTEnums::EStorageAllContactRemoved:
  428             {
  429             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAllContactRemoved Start") );
  430             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAllContactRemoved count = %d"), iItemArray.Count() );
  431             ResetArray();
- 432             if(iProcessObservers )
  433                 {
  434                 iProcessObservers->HandleDeletionL(TVIMPSTEnums::EOwnStatusItem, 0 ); // focus own item
  435                 }
  436             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageAllContactRemoved End") );
   437             break;
  438             }
   439         case TVIMPSTEnums::EStorageEventContactChange: 
  440            {
  441            TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventContactChange Start") );
  442            // display name is changed ,might be contact is re-arranged
  443             TRACE( T_LIT("contactindex = %d"),aContactIndex );
  444             TRACE( T_LIT("itemarraycount = %d"),iItemArray.Count() );
- 445             if( aContactIndex < iItemArray.Count() )
  446                 {
  447                 CVIMPSTProcessContactItem* newItem = CVIMPSTProcessContactItem::NewL(const_cast<TDesC&>(aContact->Name() ),
  448                         const_cast<TDesC&>(aContact->UserId() ),
  449                         aContact->ContactLink() );
  450                 
  451                 MVIMPSTProcessArrayItem* oldItem = iItemArray[ aContactIndex ];
  452                 TRACE( T_LIT("contact removed in item array of index = %d"),aContactIndex );
  453                 // set the conversation open flag from old contact, as only the display name would have changed.
  454                 newItem->SetConversationOpen(oldItem->IsConversationOpen());
  455                 newItem->SetMsgPending( oldItem->IsMsgPending() );
  456                 iItemArray.Remove(aContactIndex );
  457                 delete oldItem;
  458                 iItemArray.Compress();
  459                 TRACE( T_LIT("Insert at index = %d"), aContactIndex);
  460                 TInt newIndex = iContactListModel->IndexOfContact( aContact );
  461                  // Add it in the new index
  462                 newIndex = newIndex + 1 + iUnKnownContactArray.Count() + iAddRequestArray.Count();
- 463                 if (newIndex >= iItemArray.Count())
  464                     {
  465                     TRACE( T_LIT("append contact item = %d"), newIndex);
  466                     iItemArray.Append (newItem);
  467                     }
    468                 else
  469                     {
  470                     TRACE( T_LIT("Insert at index = %d"), newItem);
  471                     iItemArray.Insert(newItem, newIndex);
  472                     } 
  473                 // inform the cv about the display name changes
- 474                 if(aContact && aContact->UserId().Length() && newItem->IsConversationOpen())
  475                     {
  476                     TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventContactChange "));
  477                     TApaTaskList taskList( CCoeEnv::Static()->WsSession() );
  478                     TApaTask task( taskList.FindApp( KConversationViewAppUid ) );
  479 
- 480                     if ( task.Exists() )
  481                         {
  482                         TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventContactChange:task exists"));
  483                         // packing of data ,passed to conversation view
  484                         TPckgBuf< TIMCVUiParams > params;
  485                         params().iBuddyId = aContact->UserId();
  486                         params().iBuddyName = aContact->Name();
  487                         params().iServiceId = iServiceId;
  488                         params().iUpdate = ETrue;
  489                         task.SendMessage( 
  490                                 TUid::Uid( KUidApaMessageSwitchOpenFileValue ), params );
  491                         }
  492                     }
  493                 }
- 494             if(iProcessObservers )
  495                 {
  496                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, aContactIndex );
  497                 }
  498             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventContactChange End") );
   499            break;   
  500            }          
   501         case TVIMPSTEnums::EStorageEventUserIdPostChange:
  502             {
  503             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventUserIdPostChange Start") );
  504             TRACE( T_LIT("contactindex = %d"),aContactIndex );
  505             TRACE( T_LIT("itemarraycount = %d"),iItemArray.Count() );
- 506             if( aContactIndex < iItemArray.Count() )
  507                 {
  508                 CVIMPSTProcessContactItem* newItem = CVIMPSTProcessContactItem::NewL(const_cast<TDesC&>(aContact->Name() ),
  509                         const_cast<TDesC&>(aContact->UserId() ),
  510                         aContact->ContactLink() );
  511                 MVIMPSTProcessArrayItem* oldItem = iItemArray[ aContactIndex ];
  512                 TRACE( T_LIT("contact removed in item array of index = %d"),aContactIndex );
  513                 iItemArray.Remove(aContactIndex );
  514                 delete oldItem;
  515                 iItemArray.Compress();
  516                 TRACE( T_LIT("Insert at index = %d"), aContactIndex);
  517                 iItemArray.InsertL (newItem, aContactIndex);
  518                 }
- 519             if(iProcessObservers )
  520                 {
  521                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, aContactIndex );
  522                 }
  523             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL EStorageEventUserIdPostChange End") );
   524             break;
  525             }
 - 526         default:
  527             {
  528             TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL Event default") );
 - 529             break;
  530             }
  531         }
  532     TRACE( T_LIT("CVIMPSTProcessArray::HandleStorageChangeL Function End") );
  533     }
  534 
  535 // --------------------------------------------------------------------------
  536 // CVIMPSTProcessArray::AddObserver
  537 // --------------------------------------------------------------------------
  538 //
 
  539 void CVIMPSTProcessArray::AddObserver( MVIMPSTProcessArrayObserver* aObserver ) 
  540     {
  541     iProcessObservers = aObserver;
  542     }
  543 // --------------------------------------------------------------------------
  544 // CVIMPSTProcessArray::RemoveObserver
  545 // --------------------------------------------------------------------------
  546 //
 
- 547 void CVIMPSTProcessArray::RemoveObserver( ) 
  548     {
  549     iProcessObservers = NULL;
  550     }
  551 
  552 // -----------------------------------------------------------------------------
  553 // CVIMPSTProcessArray::GetItemNameTextL
  554 // -----------------------------------------------------------------------------
  555 
 
  556 TPtrC CVIMPSTProcessArray::GetItemNameText(TInt aIndex)
  557     {
  558     TVIMPSTEnums::TItem itemtype = GetType( aIndex );
  559    MVIMPSTProcessArrayItem* arrayItem = NULL;
  560     /* Codescanner warning is ignored, since Bound check is done 
  561      * inside the GetType()
  562      * method*/
    563     switch(itemtype)
  564         {
   565         case TVIMPSTEnums::EOwnStatusItem:
  566             {
  567             MVIMPSTProcessArrayItem *arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex];
   568             return arrayItem->GetItemUserId(); // no name for own user   
  569             }
 - 570         case TVIMPSTEnums::EContactListItem:
 - 571         case TVIMPSTEnums::EContactItem:
  572             { 
  573             arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex];
 - 574               break;   
  575             }
 - 576         case TVIMPSTEnums::EFriendRequestItem:
  577             {
  578             arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex];
 - 579             break;
  580             }
 - 581        case TVIMPSTEnums::EUnknonContactItem:
  582            {
  583            arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex];
 - 584            break;
  585            }
   586         case TVIMPSTEnums::EInvalid:
 - 587         default:
  588             {
   589             break;
  590             }
  591         }
- 592    if( arrayItem )
  593       {
 - 594       return arrayItem->GetItemNameText();   
  595       }
   596    return KNullDesC();
  597     }
  598 
  599 // -----------------------------------------------------------------------------
  600 // CVIMPSTProcessArray::GetItemUserId
  601 // -----------------------------------------------------------------------------
  602 
 
12   603 TPtrC CVIMPSTProcessArray::GetItemUserId(TInt aIndex)
  604     {
  605     TVIMPSTEnums::TItem itemtype = GetType( aIndex );
  606 
  607     /* Codescanner warning is ignored, since Bound check is done 
  608      * inside the GetType()
  609      * method*/
    610     switch(itemtype)    
  611         {
   612         case TVIMPSTEnums::EContactItem:
 - 613         case TVIMPSTEnums::EFriendRequestItem:
 - 614         case TVIMPSTEnums::EUnknonContactItem:
   615         case TVIMPSTEnums::EOwnStatusItem:
  616             {
  617             MVIMPSTProcessArrayItem *arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex];
10    618             return arrayItem->GetItemUserId(); // no name for own user   
  619             }
   620         default:
  621             {
   622             return KNullDesC(); 
  623             }
  624         }
  625     }
  626 
  627 // -----------------------------------------------------------------------------
  628 // CVIMPSTProcessArray::ContactLink
  629 // -----------------------------------------------------------------------------
  630 
 
  631 MVPbkContactLink* CVIMPSTProcessArray::ContactLink(TInt aIndex)
  632     {
  633     TVIMPSTEnums::TItem itemtype = GetType( aIndex );
  634 
  635     /* Codescanner warning is ignored, since Bound check is done 
  636      * inside the GetType()
  637      * method*/
    638     switch(itemtype)
  639         {
 - 640         case TVIMPSTEnums::EOwnStatusItem:
  641             {
 - 642             return NULL;   
  643             }
 - 644         case TVIMPSTEnums::EContactListItem:
   645         case TVIMPSTEnums::EContactItem:
  646             {    
  647             MVIMPSTProcessArrayItem *arrayItem = (MVIMPSTProcessArrayItem *)iItemArray[aIndex];
   648             return arrayItem->ContactLink();   
  649             }
   650         case TVIMPSTEnums::EInvalid:
 - 651         default:
  652             {
  653             }
  654         }
   655     return NULL;
  656     }
  657 
  658 // -----------------------------------------------------------------------------
  659 // CVIMPSTProcessArray::Count
  660 // -----------------------------------------------------------------------------
  661 
 
- 662 TInt CVIMPSTProcessArray::Count() const
  663    {
  664    // return the total count here.
 - 665    return iItemArray.Count() ;
  666    }
  667 // -----------------------------------------------------------------------------
  668 // CVIMPSTProcessArray::IsSubServiceSupportedL
  669 // -----------------------------------------------------------------------------
  670 
 
  671 TBool CVIMPSTProcessArray::IsSubServiceSupportedL(TVIMPSTEnums::SubServiceType aType ) const
  672    {
   673    return iEngine.IsSubServiceSupportedL(aType );
  674    }
  675 // -----------------------------------------------------------------------------
  676 // CVIMPSTProcessArray::GetType
  677 // Get the type from engine and return the type
  678 // -----------------------------------------------------------------------------
  679 
 
32   680 TVIMPSTEnums::TItem CVIMPSTProcessArray::GetType(TInt aIndex) const
  681    {
  682    TInt itemArrayCount = iItemArray.Count();
27   683    if(itemArrayCount <=0 || (aIndex < 0 || aIndex >= itemArrayCount) )
  684        {
   685        return TVIMPSTEnums::EInvalid;
  686        }
  687 
27 - 688    else if(itemArrayCount>0)
  689        {
    690        TInt index = aIndex <= 0 ? 0 : aIndex;
22   690   ternary-?: aIndex <= 0
  691        MVIMPSTProcessArrayItem* item = iItemArray[ index ];   
27    692        return item->Type();
  693        }
    694    else
  695        {
 - 696        return TVIMPSTEnums::EInvalid;
  697        }   
  698    }
  699 // -----------------------------------------------------------------------------
  700 // CVIMPSTProcessArray::FillItemL
  701 // Fill up the complete array one item at a time
  702 // -----------------------------------------------------------------------------
  703 
 
124 124   704 void CVIMPSTProcessArray::FillItemL()
  705     {
  706     TInt count = 0;
66 58   707     if(iContactListModel)
  708         {
  709         count = iContactListModel->Count();
  710         }
  711 
  712     // the index is starting from 1, because we already added owndata item to the list.......
66 124   713     for ( TInt index = 0; index < count ; index++)
  714         {
  715         // fetch the item and process correct type
  716         MVIMPSTStorageItemModel::SItem item = iContactListModel->Item( index );
    717         switch( item.iType )
  718             {
 - 719             case MVIMPSTStorageItemModel::EContactList:
 - 720                 break;
66    721             case MVIMPSTStorageItemModel::EContactItem:
  722                 {
  723                 // contact item
  724                 // add this items to contact item -- CONTACT 
  725                 // create an object of this type and append this to the rpointerarray
  726                 MVIMPSTStorageContact* contact = item.iContact;                        
  727                 TPtrC userId = contact->UserId();
  728                 CVIMPSTProcessContactItem* contactItem = 
  729                 CVIMPSTProcessContactItem::NewL(contact->Name(),
  730                                         userId ,
  731                                           contact->ContactLink() );
  732                 TInt otherCount = 1 + iUnKnownContactArray.Count() + iAddRequestArray.Count();
  733                 contactItem->SetItemIndex(index + otherCount );
  734                 //append this to the array
  735                 iItemArray.AppendL(contactItem);
  736                 if( TVIMPSTEnums::ESVCERegistered == iLoginState &&
66 - 737                      TVIMPSTEnums::EBlocked != contact->OnlineStatus() && userId.Length() )
  738                     {
66 - 739                     if( IsUnreadMessageExistsL( userId ) )
  740                         {
  741                         contactItem->SetMsgPending(ETrue);
  742                         }
66 - 743                     if( IsConversationExistL( userId ) )
  744                         {
  745                         contactItem->SetConversationOpen(ETrue);
  746                         }
  747                     }
66    748                 break;
  749                 }
 - 750             default:
  751                 {
  752                 // the call shouldn't be here
 - 753                 break;
  754                 }
  755             }
  756         }
  757 
  758     }
  759 
  760 // -----------------------------------------------------------------------------
  761 // CVIMPSTProcessArray::FillOwnDataL
  762 // FillOwnDataL implementation
  763 // -----------------------------------------------------------------------------
  764 // fill the owndata at the begining of array.....
 
126   765 TBool CVIMPSTProcessArray::FillOwnDataL()
  766     {
  767     TBool ownDataAdded = EFalse;
  768     TPtr dataPtr = iData->Des();    
  769     // Check whether the user has logged in before, if has
  770     // then dont update anything just return   
  771     //check if its logged in or not.
  772     // 1. if not logged in append 
    773     switch(iLoginState)
  774         {
126    775         case TVIMPSTEnums::ESVCERegistered:
  776             {
126 - 777             if(iContactInterface)
  778                 {
  779             TPtrC userId = iContactInterface->OwnContactL().UserId();
  780             dataPtr.Copy(userId);
  781                 }
126    782             break;
  783             }
 - 784         case TVIMPSTEnums::ESVCENetworkConnecting:
  785             {
  786             HBufC* tempStr = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_LOGGING_LIST_ITEM );
- 787             if(tempStr)
  788                 {
  789                 dataPtr.Copy(*tempStr);     
  790                 delete tempStr; 
  791                 }
  792 
 - 793             break;
  794             }
 - 795         case TVIMPSTEnums::ESVCEUpdatingContacts:
  796             {
  797             HBufC* tempStr = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_UPDATING_LIST_ITEM );
- 798             if(tempStr)
  799                 {
  800                 dataPtr.Copy(*tempStr);     
  801                 delete tempStr; 
  802                 }
  803 
 - 804             break;
  805             }
 - 806         case TVIMPSTEnums::ESVCEWaitingForNetwork:
  807             {
  808             HBufC* tempStr = KNetworkError().AllocL();
- 809             if(tempStr)
  810                 {
  811                 dataPtr.Copy(*tempStr);     
  812                 delete tempStr; 
  813                 }
 - 814          break;   
  815             }
 - 816         case TVIMPSTEnums::ESVCENetworkDisConnecting:
  817             {
  818             HBufC* tempStr = NULL;
- 819             if ( iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EPresence) ) 
  820                 {
  821                 // if presence enabled use double line listbox string
  822                 tempStr= VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_LOGGINGOUT_LIST_ITEM );
  823                 }
    824             else
  825                 { 
  826                 // if  presence is not enabled use  single line listbox string
  827                 tempStr= VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SINGLE_LINE_LOGGINGOUT_LIST_ITEM );
  828                 }
  829 
- 830             if(tempStr)
  831                 {
  832                 dataPtr.Copy(*tempStr);     
  833                 delete tempStr;
  834                 }         
  835 
 - 836             break;
  837             }
 - 838         case TVIMPSTEnums::ESVCENotRegistered:
 - 839         default:
  840             {
  841             HBufC* str = NULL;
- 842             if ( iEngine.SubService( TVIMPSTEnums::EPresence) ) 
  843                 {
  844                 // if presence enabled use double line listbox string
  845                 str = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_LOGIN_LIST_ITEM );
  846                 }
    847             else
  848                 { 
  849                 // if  presence is not enabled use  single line listbox string
  850                 // get  the username from settings
  851                 TPtrC ownUserId = iContactInterface->OwnContactL().UserId();
- 852                 if ( ownUserId.Length() )
  853                     { 
  854                     // if username is available then show with login item
  855                     // remove domain part and give it to resource laoder
  856                     str= VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SINGLE_LINE_LOGIN_LIST_ITEM_WITH_USERNAME , VIMPSTUtils::DisplayId( ownUserId ) );
  857                     }
    858                 else
  859                     {
  860                     // this condition occures when there is allocated memory for username with NO data (length =0 )
  861                     // just make sure "no memory leak" without depending on the Function  LoginUserNameFromSettingsL()
  862                     // since that would return the allocated memory without Data (length=0 ) 
  863                     // just show login item since no username is available in the settings
  864                     str= VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SINGLE_LINE_LOGIN_LIST_ITEM );
  865                     }
  866                 }
- 867             if( str )
  868                 {
  869                 dataPtr.Copy(*str);      
  870                 delete str;      
  871                 }
 - 872             break;
  873             }
  874         }
124   875     if( iItemArray.Count() )
  876        {
  877        // own item is already exist delete it before adding a fresh one
  878        MVIMPSTProcessArrayItem* arrayItem = iItemArray[ 0 ]; // should be own data
- 879        if( arrayItem->Type() == TVIMPSTEnums::EOwnStatusItem )
  880           {
  881           iItemArray.Remove(0);   //iItemArray takes ownership of owndataItem, do not delete here
  882           delete arrayItem;
  883           iItemArray.Compress();
  884           }
  885        }
  886     //common code for all the above cases to update the owndata item to list at index 0
  887     CVIMPSTProcessOwnDataItem* owndataItem = CVIMPSTProcessOwnDataItem::NewL(*iData);
  888     owndataItem->SetItemIndex(0);
  889     //append this to the array
  890     iItemArray.InsertL( owndataItem,0 );   //iItemArray takes ownership of owndataItem, do not delete here
  891     iContactListIndex = 0;
  892     ownDataAdded = ETrue;     
126    893     return ownDataAdded;
  894     }
  895 
  896 // -----------------------------------------------------------------------------
  897 // CVIMPSTProcessArray::FillArrayL
  898 // -----------------------------------------------------------------------------
  899 
 
124 124   900 void CVIMPSTProcessArray::FillArrayL()
  901     {
124 - 902     if(FillOwnDataL() )
  903         {
  904         // then fill the conversations..or open chats....   
  905         }
    906     else
  907         {
  908         iContactListIndex = 0; // we have not added any thing to main array..so index is zero...
  909         }
  910     FillUnknownContactsL(); //will fill all unknown contact from iUnknownContactArray to iItemArray.
  911     FillAddRequestDataL();//will fill all requests from iAddRequestArray to iItemArray.
  912     FillItemL();   
  913     }
  914 
  915 
  916 // -----------------------------------------------------------------------------
  917 // CVIMPSTProcessArray::ResetArray
  918 // -----------------------------------------------------------------------------
  919 
 
124 124   920 void CVIMPSTProcessArray::ResetArray()
  921     {
  922     RemoveUnKnownContacts(); //will remove all the unknown contacts from iItemArray.
  923     RemoveAddRequestData();//will remove all the requests from iItemArray.
  924     iItemArray.ResetAndDestroy();
124 124   925     TRAPD( err, FillArrayL());
 - 925   catch (XLeaveException & l)
 - 925   catch (...)
124 - 926     if ( err != KErrNone )
  927         {
  928         CActiveScheduler::Current()->Error( err );
  929         }
  930     }
  931 
  932 // -----------------------------------------------------------------------------
  933 // CVIMPSTProcessArray::SetLoginState
  934 // -----------------------------------------------------------------------------
  935 
 
  936 void CVIMPSTProcessArray::SetLoginStateL(TVIMPSTEnums::TVIMPSTRegistrationState aLoginState)
  937     {
  938     iLoginState = aLoginState;
- 939     if(aLoginState != TVIMPSTEnums::ESVCERegistered )
  940         {
  941         iFetchCompleted = EFalse;
  942         RemoveUnKnownContacts();
  943         RemoveAddRequestData();
  944         iUnKnownContactArray.ResetAndDestroy();// delete all items
  945         iUnKnownContactArray.Reset();
  946         iAddRequestArray.ResetAndDestroy();// delete all items
  947         iAddRequestArray.Reset();
  948         }
  949     FillOwnDataL(); // this will change the own item based on connection status
  950     }
  951 // -----------------------------------------------------------------------------
  952 // CVIMPSTProcessArray::GetLoginState
  953 // -----------------------------------------------------------------------------
  954 
 
  955 TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTProcessArray::GetLoginState()
  956     {
   957     return iLoginState;
  958     }
  959 
  960 // -----------------------------------------------------------------------------
  961 // CVIMPSTProcessArray::GetOnlineStatus
  962 // -----------------------------------------------------------------------------
  963 
 
  964 TVIMPSTEnums::TOnlineStatus CVIMPSTProcessArray::GetOnlineStatusL(TInt aIndex)
  965     {
  966     TVIMPSTEnums::TItem itemtype = GetType( aIndex );
  967     TVIMPSTEnums::TOnlineStatus status = TVIMPSTEnums::EUnknown;
    968     switch(itemtype)
  969         {
   970         case TVIMPSTEnums::EOwnStatusItem:
  971             {
- 972             if( iContactInterface )
  973                {
  974                  status = iContactInterface->OwnContactL().OnlineStatus();
  975                }
   976             break;
  977             }
 - 978         case TVIMPSTEnums::EContactItem:
  979             { 
  980             MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId( GetItemUserId(aIndex) );
- 981             if(contact)
  982                 {
  983                 status = contact->OnlineStatus();
  984                 }
 - 985             break;
  986             }
 - 987         case TVIMPSTEnums::EInvalid:
 - 988         default:
  989             {
 - 990             break;
  991             }
  992         }
   993     return status;
  994     }
  995 //-----------------------------------------------------------
  996 //CVIMPSTProcessArray::StatusText
  997 //-----------------------------------------------------------
  998 // 
 
  999 const TDesC&  CVIMPSTProcessArray::StatusTextL(TInt aIndex ) 
  1000     {
  1001     TVIMPSTEnums::TItem itemtype = GetType( aIndex );
    1002     switch(itemtype)
  1003         {
   1004         case TVIMPSTEnums::EOwnStatusItem:
  1005             {
- 1006             if( iContactInterface )
  1007                {
   1008                return iContactInterface->OwnContactL().StatusText();   
  1009                }
 - 1010             break;
  1011             }
 - 1012         case TVIMPSTEnums::EContactItem:
  1013             { 
  1014             MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId(GetItemUserId(aIndex));
- 1015             if(contact && contact->StatusText().Length() )
  1016                 {
  1017                 // KStatusMsgMaxLenght is the max length of the status message shown
  1018                 // make sure that it copies only that much
 - 1019                 return contact->StatusText();
  1020                 }
 - 1021             break;
  1022             }
 - 1023         case TVIMPSTEnums::EInvalid:
 - 1024         default:
  1025             {
 - 1026             break;
  1027             }
  1028         }
 - 1029     return KNullDesC;
  1030     }
  1031 //-----------------------------------------------------------
  1032 //CVIMPSTProcessArray::RemoveFromUnknonOrInvitationListL
  1033 //-----------------------------------------------------------
  1034 //
 
  1035 TBool CVIMPSTProcessArray::RemoveFromUnknonOrInvitationListL( const TDesC& aAddedUserId ,TBool aBlocked )
  1036     {
  1037     TBool found = RemoveFromUnknonListL( aAddedUserId );
- 1038     if( !found )
  1039         {
  1040         found = RemoveFromInvitationListL( aAddedUserId );
  1041         }
  1042     //Get IM SubService  
- 1043     if( aBlocked && found && aAddedUserId.Length() )
  1044         {
  1045         MVIMPSTEngineSubService* subService =         
  1046         (iEngine.SubService(TVIMPSTEnums::EIM));
  1047 
- 1048         if(subService )
  1049             {
  1050             MVIMPSTEngineIMSubService& imSubService = 
  1051             MVIMPSTEngineIMSubService::Cast (*subService);
  1052             imSubService.CloseConversationL( aAddedUserId );
  1053             }
  1054         }
   1055     return found;
  1056     }
  1057 //-----------------------------------------------------------
  1058 //CVIMPSTProcessArray::RemoveFromUnknonListL
  1059 //-----------------------------------------------------------
  1060 //
 
  1061 TBool CVIMPSTProcessArray::RemoveFromUnknonListL( const TDesC& aAddedUserId )
  1062     {
  1063     TRACE( T_LIT("CVIMPSTProcessArray::RemoveFromUnknonListL start ") );
  1064     TPtrC addedUserId = VIMPSTUtils::DisplayId( aAddedUserId );
  1065     TBool found = EFalse;
  1066     TInt count = iUnKnownContactArray.Count();
  1067     CVIMPSTProcessUnknownContactItem* unknownItem = NULL;
  1068     TInt index = KErrNotFound;
  1069     TInt itemIndex = KErrNotFound;
  1070     // check in unknon array
  1071     for(index = 0 ; index < count ; index++)
  1072         {
  1073         unknownItem = iUnKnownContactArray[index];
  1074         TPtrC contactId = VIMPSTUtils::DisplayId( unknownItem->GetItemUserId() );
- 1075         if( addedUserId.Compare(  contactId ) == 0 )
  1076             {
  1077             itemIndex = iItemArray.Find(unknownItem);
- 1078             if( itemIndex > -1 )
  1079                 {
  1080                 found = ETrue;
  1081                 }
   1082             break;
  1083             }
  1084         TRACE( T_LIT("CVIMPSTProcessArray::RemoveFromUnknonListL  for ends") );
  1085         }
  1086     if( found )
  1087         {
  1088         iItemArray.Remove(itemIndex);
  1089         iUnKnownContactArray.Remove( index );
  1090         delete unknownItem;
  1091         unknownItem = NULL;
  1092         iItemArray.Compress();
  1093         iUnKnownContactArray.Compress();
- 1094         if( iProcessObservers )
  1095             {
  1096             // this is to refresh the list box
  1097             // KErrNotFound , focus remain at same position
  1098             iProcessObservers->HandleDeletionL(TVIMPSTEnums::EUnknonContactItem, KErrNotFound );
  1099             }
  1100         }
  1101     TRACE( T_LIT("CVIMPSTProcessArray::RemoveFromUnknonListL end ") );
   1102     return found;
  1103     }
  1104 //-----------------------------------------------------------
  1105 //CVIMPSTProcessArray::RemoveFromInvitationListL
  1106 //-----------------------------------------------------------
  1107 //
 
  1108 TBool CVIMPSTProcessArray::RemoveFromInvitationListL( const TDesC& aAddedUserId )
  1109     {
  1110     TPtrC addedUserId = VIMPSTUtils::DisplayId( aAddedUserId );
  1111     TBool found = EFalse;
  1112     TInt index = KErrNotFound;
  1113     TInt itemIndex = KErrNotFound;
  1114     // item not foun in unknown list
  1115     // check in invitation item array
  1116     TInt count = iAddRequestArray.Count();
  1117     CVIMPSTProcessFriendRequestItem* requestItem = NULL;
- 1118     for(index = 0 ; index < count ; index++)
  1119         {
  1120         requestItem = iAddRequestArray[index];
  1121         TPtrC contactId = VIMPSTUtils::DisplayId( requestItem->GetItemUserId() );
- 1122         if( addedUserId.Compare( contactId ) == 0 )
  1123             {
  1124             itemIndex = iItemArray.Find(requestItem);
- 1125             if( itemIndex > -1 )
  1126                 {
  1127                 found = ETrue;
  1128                 }
 - 1129             break;
  1130             }
  1131         }
- 1132     if( found )
  1133         {
  1134         iItemArray.Remove(itemIndex);
  1135         iAddRequestArray.Remove( index );
  1136         delete requestItem;
  1137         requestItem = NULL;
  1138         iItemArray.Compress();
  1139         iAddRequestArray.Compress();
- 1140         if( iProcessObservers )
  1141             {
  1142             // this is to refresh the list box
  1143             // KErrNotFound , focus remain at same position
  1144             iProcessObservers->HandleDeletionL(TVIMPSTEnums::EFriendRequestItem, KErrNotFound );
  1145             }
  1146         }
   1147     return found;
  1148     }
  1149 //-----------------------------------------------------------
  1150 //CVIMPSTProcessArray::MapContactListPositions
  1151 //-----------------------------------------------------------
  1152 //
 
- 1153 void CVIMPSTProcessArray::MapContactListPositions(RArray<TInt>& aPos )
  1154     {
  1155     // add conversation also this list ..and return..
  1156     RArray<TInt> listPos; 
  1157 
  1158     //   iContactListModel->MapContactListPositions(listPos);
  1159     TInt positionIndex = 0;
  1160     // if count is more than 0..fill the maparray...
- 1161     if(iItemArray.Count()  + iContactListIndex > 0) 
  1162         {
  1163 
  1164         TInt count = listPos.Count();
  1165 
- 1166         for(TInt posIndex = 0; posIndex < count; posIndex++, positionIndex++)
  1167             {
  1168             aPos.Append( listPos[posIndex] + iContactListIndex );
  1169             }
  1170         }
  1171     listPos.Close();   
  1172     }
  1173 // -----------------------------------------------------------------------------
  1174 // CVIMPSTProcessArray::GetAndCreateOpenChatListL
  1175 // return contact index including friend request.
  1176 // -----------------------------------------------------------------------------
 
  1177 void CVIMPSTProcessArray::GetAndCreateOpenChatListL() 
  1178     {
  1179     //Get IM SubService     
  1180     MVIMPSTEngineSubService* subService =         
  1181                 (iEngine.SubService(TVIMPSTEnums::EIM));
  1182     RArray<SIMCacheChatItem> openChats;
  1183     openChats.Reset();
- 1184     if(subService)
  1185         {
  1186         MVIMPSTEngineIMSubService& imSubService = 
  1187             MVIMPSTEngineIMSubService::Cast (*subService);
  1188         openChats = imSubService.GetOpenChatListL();
  1189         }
- 1190     while( openChats.Count() )
  1191         {
  1192         SIMCacheChatItem chat = openChats[ 0 ]; // first item 
  1193         TPtrC contactId = *chat.iBuddyId;
  1194         MVIMPSTProcessArrayItem* arrayItem = FindArrayItem( contactId );
  1195         TBool msgPending = EFalse;
- 1196         if( contactId.Length() )
  1197             {
- 1198             if( IsUnreadMessageExistsL( contactId ) )
  1199                 {
  1200                 msgPending = ETrue;
  1201                 }
  1202             }
- 1203         if( arrayItem )
  1204             {
  1205             arrayItem->SetConversationOpen( ETrue );
  1206             arrayItem->SetMsgPending( msgPending );
  1207             }
    1208         else
  1209             {
  1210             // not in buddy List
  1211             DoHandleUnKnownContactMessageL( contactId ,msgPending );
  1212             }
  1213         openChats.Remove( 0 );
  1214         delete chat.iBuddyId;
  1215         chat.iBuddyId = NULL;
  1216         openChats.Compress();
  1217         }
  1218     }
  1219 //-----------------------------------------------------------
  1220 //CVIMPSTProcessArray::FindArrayItem
  1221 //-----------------------------------------------------------
  1222 // 
 
  1223 MVIMPSTProcessArrayItem* CVIMPSTProcessArray::FindArrayItem( const TDesC& aSenderId )
  1224     {
  1225     TPtrC senderId = VIMPSTUtils::DisplayId( aSenderId );
  1226     MVIMPSTProcessArrayItem* arrayItem = NULL;
  1227     TInt count = iItemArray.Count();
- 1228     for( TInt i = 1; i < count; i++ )
  1229         {
  1230         MVIMPSTProcessArrayItem* contactItem = (MVIMPSTProcessArrayItem *)iItemArray[i];
  1231         TPtrC contactId = VIMPSTUtils::DisplayId( contactItem->GetItemUserId() );
  1232         if( senderId.Compare(  contactId ) == 0 )
  1233             {
  1234             arrayItem = contactItem;
   1235             break;
  1236             }
  1237         }
   1238     return arrayItem;
  1239     }
  1240 //-----------------------------------------------------------
  1241 //CVIMPSTProcessArray::HandleChatMessageEventL
  1242 //-----------------------------------------------------------
  1243 // 
 
12 12   1244 void CVIMPSTProcessArray::HandleChatMessageEventL( TVIMPSTEnums::TIMEventType aEventType ,
  1245                                                     const TDesC& aSender )
  1246     {
12 - 1247     if( !iFetchCompleted )
  1248         {
  1249         // contact matching will not be correct until fetching completed
  1250         // hence return 
 - 1251         return;
  1252         }
    1253     switch( aEventType )
  1254         {
   1255         case TVIMPSTEnums::EIMUnreadMessage:
  1256             {
- 1257             if( FindAndMarkContactAsOpenChat( aSender , ETrue ) )
  1258                 {
- 1259                 if(iProcessObservers)
  1260                     {
  1261                     iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound );
  1262                     }
  1263                 }
    1264             else 
  1265                 {
  1266                 DoHandleUnKnownContactMessageL( aSender , ETrue );
  1267                 }
   1268             break;
  1269             }
   1270         case TVIMPSTEnums::EIMUnreadChange:
  1271             {
  1272             FindAndMarkContactAsOpenChat( aSender , EFalse ) ;
- 1273             if(iProcessObservers)
  1274                 {
  1275                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem,KErrNotFound );
  1276                 }
   1277             break;
  1278             }
   1279         case TVIMPSTEnums::EIMChatStarted:
  1280             {
- 1281             if( FindAndMarkContactAsOpenChat( aSender , EFalse ) )
  1282                 {
- 1283                 if(iProcessObservers)
  1284                     {
  1285                     iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound );
  1286                     }
  1287                 }
    1288             else 
  1289                 {
  1290                 DoHandleUnKnownContactMessageL( aSender, EFalse );
  1291                 }
   1292             break;
  1293             }
   1294         case TVIMPSTEnums::EIMChatClosed:
  1295             {
- 1296             if( !RemoveFromUnknonListL( aSender ) )
  1297                 {
  1298                 MVIMPSTProcessArrayItem* arrayItem = FindArrayItem( aSender );
- 1299                 if( arrayItem )
  1300                     {
  1301                     arrayItem->SetConversationOpen( EFalse );
  1302                     arrayItem->SetMsgPending( EFalse );
  1303                     }
  1304                 }
- 1305             if(iProcessObservers)
  1306                 {
  1307                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound );
  1308                 }
   1309             break;
  1310             }
   1311         case TVIMPSTEnums::EIMAllChatClosed:
  1312             {
  1313             RemoveUnKnownContacts();
  1314             iUnKnownContactArray.ResetAndDestroy();// delete all items
  1315             ResetOpenConversationPendingMsg();
- 1316             if(iProcessObservers)
  1317                 {
  1318                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound );
  1319                 }
   1320             break;
  1321             }
   1322         case TVIMPSTEnums::EIMRequestCompleted:
  1323             {
- 1324             if(iProcessObservers)
  1325                 {
  1326                 iProcessObservers->HandleAdditionL(TVIMPSTEnums::EContactItem, KErrNotFound );
  1327                 }
   1328             break;
  1329             }
 - 1330         default:
  1331             {
  1332             // do nothing
  1333             }
  1334         }
  1335     }
  1336 //-----------------------------------------------------------
  1337 //CVIMPSTProcessArray::HandleAddRequestEventL
  1338 //-----------------------------------------------------------
  1339 // 
 
18 18   1340 void  CVIMPSTProcessArray::HandleAddRequestEventL(TVIMPSTEnums::TOperationType aType, const TDesC& aRequesterId )
  1341     {
  1342      //add new add request item at top of list(i.e at index 1, as 0 is own id).
  1343     //when request is entertained remove item from list.
    1344     switch( aType )
  1345        {
16    1346       case TVIMPSTEnums::EAddItem :
  1347          {
12   1348          if( (!FindAnyAddRequest(aRequesterId ) )&& ( !FindAnyContactServiceField( aRequesterId ) ) && !(IsContactBlocked( aRequesterId )) )
  1349             {
  1350             CVIMPSTProcessFriendRequestItem* addRequestItem = CVIMPSTProcessFriendRequestItem::NewL(aRequesterId);
  1351             /* Add it as the first Item of IAddRequestARray as its like stack */
  1352             iAddRequestArray.Insert(addRequestItem,0); 
  1353             /*
  1354             *   always the new friend request will be shown in the beginning, so 0th item is own item, 1st item is new friendrequest
  1355             *   and remaining remains same.. 
  1356             */
  1357             // ownership is in iItemArray
  1358             TInt invitationIndex = iUnKnownContactArray.Count()+1;
  1359             iItemArray.Insert(addRequestItem, invitationIndex); 
- 1360             if(iProcessObservers)
  1361                {
  1362                iProcessObservers->HandleAdditionL( TVIMPSTEnums::EFriendRequestItem ,KErrNotFound );
  1363                }
  1364             }
16    1365          break;
  1366          }
   1367       case TVIMPSTEnums::ERemoveItem :
  1368          {
  1369          TInt count = iAddRequestArray.Count();
  1370          CVIMPSTProcessFriendRequestItem* requestItem = NULL;
- 1371          for(TInt i = 0 ; i < count ; i++)
  1372             {
  1373             requestItem = iAddRequestArray[i];
- 1374             if( aRequesterId.Compare(requestItem->GetItemUserId()) == 0 )
  1375                {
  1376                TInt index = iItemArray.Find(requestItem);
- 1377                if(index != KErrNotFound)
  1378                   {
  1379                   iItemArray.Remove(index);
  1380                   iItemArray.Compress();
  1381                   }
  1382                iAddRequestArray.Remove(i);        
  1383                delete requestItem;
  1384                iAddRequestArray.Compress();
   1385                break;
  1386                }        
  1387             }    
- 1388          if(iProcessObservers)
  1389             {
  1390             iProcessObservers->HandleDeletionL(TVIMPSTEnums::EFriendRequestItem, KErrNotFound );
  1391             }
   1392          break;
  1393          } 
 - 1394       default :
 - 1395          break;
  1396       }
  1397     }
  1398 //-----------------------------------------------------------
  1399 //CVIMPSTProcessArray::DoHandleUnKnownContactMessageL
  1400 //-----------------------------------------------------------
  1401 // 
 
  1402 void CVIMPSTProcessArray::DoHandleUnKnownContactMessageL( const TDesC& aSenderId ,TBool aIsMsgPending )
  1403     {
  1404     TBool contactExist = EFalse ;
  1405     TInt count = iUnKnownContactArray.Count();
  1406     CVIMPSTProcessUnknownContactItem* unknownItem = NULL;
- 1407     for( TInt i=0; i<count; i++ )
  1408         {
  1409         unknownItem = iUnKnownContactArray[i];
- 1410         if( aSenderId.Compare( unknownItem->GetItemUserId() ) == 0 )
  1411             {
  1412             contactExist = ETrue;
  1413             unknownItem->SetConversationOpen(ETrue);
  1414             unknownItem->SetMsgPending( aIsMsgPending );
 - 1415             break;
  1416             }
  1417         }
- 1418     if( !contactExist )
  1419         {
  1420         CVIMPSTProcessUnknownContactItem* addItem = CVIMPSTProcessUnknownContactItem::NewL(aSenderId);
  1421         /* Add it as the first Item of IAddRequestARray as its like stack */
  1422         iUnKnownContactArray.Insert(addItem,0); 
  1423         // ownership is in iItemArray
  1424         iItemArray.Insert(addItem, 1);  // just after own Item
  1425         addItem->SetMsgPending( aIsMsgPending );
  1426         addItem->SetConversationOpen(ETrue);
  1427         }
- 1428     if(iProcessObservers)
  1429         {
  1430         iProcessObservers->HandleAdditionL( TVIMPSTEnums::EUnknonContactItem ,KErrNotFound );
  1431         }
  1432     }
  1433 //-----------------------------------------------------------
  1434 //CVIMPSTProcessArray::IsMsgPending
  1435 //-----------------------------------------------------------
  1436 // 
 
- 1437 TBool CVIMPSTProcessArray::IsMsgPending(TInt aIndex)
  1438     {
- 1439     if( aIndex < iItemArray.Count() && aIndex >= 0 )
  1440         {
  1441         MVIMPSTProcessArrayItem* item = (MVIMPSTProcessArrayItem *)iItemArray[aIndex];
- 1442         if(item)
  1443             {   
 - 1444             return item->IsMsgPending();
  1445             }   
  1446         }
 - 1447     return EFalse;
  1448     }
  1449 
  1450 //-----------------------------------------------------------
  1451 //CVIMPSTProcessArray::IsConversationExist
  1452 //-----------------------------------------------------------
  1453 // 
 
- 1454 TBool CVIMPSTProcessArray::IsConversationExist(TInt aIndex)
  1455     {
- 1456     if( aIndex < iItemArray.Count() && aIndex >= 0 )
  1457         {
  1458         MVIMPSTProcessArrayItem* item = (MVIMPSTProcessArrayItem *)iItemArray[aIndex];
- 1459         if(item)
  1460             {   
 - 1461             return item->IsConversationOpen();
  1462             }   
  1463         }
 - 1464     return EFalse;
  1465     }
  1466 
  1467 //-----------------------------------------------------------
  1468 //CVIMPSTProcessArray::ResetPendingMsg
  1469 //-----------------------------------------------------------
  1470 // 
 
- 1471 void CVIMPSTProcessArray::ResetPendingMsg(TInt aIndex)
  1472     {
- 1473     if( aIndex < iItemArray.Count() && aIndex >= 0 )
  1474         {
  1475         MVIMPSTProcessArrayItem* item = (MVIMPSTProcessArrayItem *)iItemArray[aIndex];
- 1476         if(item)
  1477             {   
  1478             item->SetMsgPending( EFalse );
  1479             }   
  1480         }
  1481     }
  1482 //-----------------------------------------------------------
  1483 //CVIMPSTProcessArray::ResetOpenConversationPendingMsg
  1484 //-----------------------------------------------------------
  1485 // 
 
  1486 void CVIMPSTProcessArray::ResetOpenConversationPendingMsg()
  1487     {
  1488     for( TInt index  = 0; index < iItemArray.Count() ;index++ )
  1489         {
  1490         MVIMPSTProcessArrayItem* item = (MVIMPSTProcessArrayItem *)iItemArray[index];
- 1491         if(item)
  1492             {   
  1493             item->SetConversationOpen( EFalse );
  1494             item->SetMsgPending( EFalse );
  1495             }   
  1496         }
  1497     }
  1498 // -----------------------------------------------------------------------------
  1499 // CVIMPSTProcessArray::FindAnyContact
  1500 // Try to load with given ID, return NULL if not found.
  1501 // -----------------------------------------------------------------------------
 
  1502 TBool CVIMPSTProcessArray::FindAnyContact( const TDesC& aContactId )
  1503     {
  1504     if(aContactId.Length() != 0)
  1505         {
  1506         MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId(aContactId);
  1507         if( contact )
  1508             {
   1509             return ETrue;
  1510             }
  1511         }
   1512     return EFalse;
  1513     }
  1514 
  1515 // -----------------------------------------------------------------------------
  1516 // CVIMPSTProcessArray::FindAnyContactServiceField
  1517 // Try to load with given ID, return NULL if not found.
  1518 // -----------------------------------------------------------------------------
 
  1519 TBool CVIMPSTProcessArray::FindAnyContactServiceField( const TDesC& aContactId )
  1520     {
  1521     if(aContactId.Length() != 0)
  1522         {
  1523         MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId(aContactId);
  1524         if( contact )
  1525             {
   1526             return ETrue;
  1527             }
  1528         }
   1529     return EFalse;
  1530     }
  1531 // -----------------------------------------------------------------------------
  1532 // CVIMPSTProcessArray::FindAndMarkContactAsOpenChat
  1533 // Try to load with given ID, return NULL if not found.
  1534 // -----------------------------------------------------------------------------
 
  1535 TBool CVIMPSTProcessArray::FindAndMarkContactAsOpenChat( const TDesC& aContactId, TBool aMesssagePending )
  1536     {
  1537     TPtrC senderId = VIMPSTUtils::DisplayId( aContactId );
  1538     TBool ret = EFalse;
  1539     TInt count = iItemArray.Count();
  1540     for( TInt i = 1; i < count; i++ )
  1541         {
  1542         MVIMPSTProcessArrayItem* contactItem = (MVIMPSTProcessArrayItem *)iItemArray[i];
  1543         TPtrC contactId = VIMPSTUtils::DisplayId( contactItem->GetItemUserId() );
  1544         if( senderId.Compare(  contactId ) == 0 )
  1545             {
  1546             contactItem->SetConversationOpen( ETrue );
  1547             contactItem->SetMsgPending( aMesssagePending );
  1548             ret = ETrue;
   1549             break;
  1550             }
  1551         }
   1552     return ret;
  1553     }
  1554 //-----------------------------------------------------------------------------
  1555 // CVIMPSTProcessArray::IsUnreadMessageExists
  1556 // ( Other items commented in header )
  1557 //-----------------------------------------------------------------------------    
 
68   1558 TBool CVIMPSTProcessArray::IsUnreadMessageExistsL(const TDesC& aRecipientId) 
  1559     {
  1560     TBool ret = EFalse;
  1561     TInt unreaMsgCount = KErrNone;
  1562     //Get IM SubService     
  1563     MVIMPSTEngineSubService* subService =         
  1564             (iEngine.SubService(TVIMPSTEnums::EIM));
68 - 1565     if(subService)
  1566         {
  1567         MVIMPSTEngineIMSubService& imSubService = 
  1568         MVIMPSTEngineIMSubService::Cast (*subService);
  1569         unreaMsgCount = imSubService.GetUnreadCountL( aRecipientId );
  1570         }
68 - 1571     if( unreaMsgCount )
  1572         {
  1573         ret = ETrue;
  1574         }
68    1575     return ret; 
  1576     }
  1577 //-----------------------------------------------------------------------------
  1578 // CVIMPSTProcessArray::IsConversationExistL
  1579 // ( Other items commented in header )
  1580 //-----------------------------------------------------------------------------    
 
71   1581 TBool CVIMPSTProcessArray::IsConversationExistL(const TDesC& aRecipientId) 
  1582     {
  1583     //Get IM SubService     
  1584     MVIMPSTEngineSubService* subService1 =          
  1585                 (iEngine.SubService(TVIMPSTEnums::EIM));
71 - 1586     if(subService1)
  1587         {
  1588         MVIMPSTEngineIMSubService& imSubService = 
  1589                     MVIMPSTEngineIMSubService::Cast (*subService1);
 - 1590         return imSubService.IsConversationExistL( aRecipientId );
  1591         }
71    1592     return EFalse; 
  1593     }
  1594 //-----------------------------------------------------------------------------
  1595 // CVIMPSTProcessArray::FindContactIndexL
  1596 // ( Other items commented in header )
  1597 //-----------------------------------------------------------------------------    
 
  1598 TInt CVIMPSTProcessArray::FindContactIndexL( const TDesC& aContactId )
  1599     {
  1600     MVIMPSTStorageContact* newContact = iContactInterface->FindContactByUserId( aContactId );
  1601     if(newContact)
  1602         {
  1603         // return the index of contact rather bool value..
  1604         // 1 is for own data item.
   1605         return (iContactListIndex + 1 + iContactListModel->IndexOfContact( newContact ));
  1606         }
   1607     return KErrNotFound;
  1608     }
  1609 
  1610 
  1611 //-----------------------------------------------------------------------------
  1612 // CVIMPSTProcessArray::FillUnknownContactsL
  1613 // ( Other items commented in header )
  1614 //------------------------------------------------------------------------------
 
124 124   1615 void CVIMPSTProcessArray::FillUnknownContactsL()
  1616     {
  1617     TInt count = iUnKnownContactArray.Count();
  1618     /* 
  1619      * Index = 1 cos 0th index will be OwnData, and 1 - n where n is the number of friend requests, will be friend requests 
  1620      */
  1621     TInt index = 1; 
124 - 1622     for(TInt i = 0 ; i < count ; i++)
  1623         {
  1624         // all friend request item ownership is transfered to iItemArray
  1625         CVIMPSTProcessUnknownContactItem* unknownItem = iUnKnownContactArray[i];
  1626         unknownItem->SetItemIndex(index);        
  1627         iItemArray.Insert(unknownItem, index);        
  1628         index ++;
  1629         }
  1630     }
  1631 
  1632 //-----------------------------------------------------------------------------
  1633 // CVIMPSTProcessArray::FillAddRequestDataL
  1634 // ( Other items commented in header )
  1635 //------------------------------------------------------------------------------
 
124 124   1636 void CVIMPSTProcessArray::FillAddRequestDataL()
  1637     {
  1638     TInt count = iAddRequestArray.Count();
  1639    /* 
  1640     * Index = unknowncontacts are tops so after that 1 cos 0th index will be OwnData, and 1 - n where n is the number of friend requests, will be friend requests 
  1641     */
  1642    TInt index = iUnKnownContactArray.Count() +1 ; 
124 - 1643     for(TInt i = 0 ; i < count ; i++)
  1644         {
  1645         // all friend request item ownership is transfered to iItemArray
  1646         CVIMPSTProcessFriendRequestItem* requestItem = iAddRequestArray[i];
  1647         requestItem->SetItemIndex(index );        
  1648         iItemArray.Insert(requestItem, index);        
  1649       index ++;
  1650         }
  1651     }
  1652 
  1653 //-----------------------------------------------------------------------------
  1654 // CVIMPSTProcessArray::RemoveUnKnownContacts
  1655 // ( Other items commented in header )
  1656 //------------------------------------------------------------------------------
 
126 126   1657 void CVIMPSTProcessArray::RemoveUnKnownContacts()
  1658     {
  1659     TInt count = iUnKnownContactArray.Count();
126 - 1660     for(TInt i = 0 ; i < count ; i++)
  1661         {
  1662         CVIMPSTProcessUnknownContactItem* unknownItem = iUnKnownContactArray[i];
  1663         TInt index = iItemArray.Find(unknownItem);
- 1664         if(index > -1)
  1665             {            
  1666             iItemArray.Remove(index);
  1667             iItemArray.Compress();
  1668             }       
  1669         }
  1670     }
  1671 //-----------------------------------------------------------------------------
  1672 // CVIMPSTProcessArray::RemoveAddRequestData
  1673 // ( Other items commented in header )
  1674 //------------------------------------------------------------------------------
 
124 124   1675 void CVIMPSTProcessArray::RemoveAddRequestData()
  1676     {
  1677     TInt count = iAddRequestArray.Count();
124 - 1678     for(TInt i = 0 ; i < count ; i++)
  1679         {
  1680         CVIMPSTProcessFriendRequestItem* requestItem = iAddRequestArray[i];
  1681         TInt index = iItemArray.Find(requestItem);
- 1682         if(index > -1)
  1683             {            
  1684             iItemArray.Remove(index);
  1685             iItemArray.Compress();
  1686             }       
  1687         }
  1688     
  1689     }
  1690 //-----------------------------------------------------------------------------
  1691 // CVIMPSTProcessArray::LoginUserIdFromStoreL
  1692 // ( Other items commented in header )
  1693 //------------------------------------------------------------------------------
  1694 
 
  1695 const TDesC& CVIMPSTProcessArray::LoginUserIdFromStoreL() const
  1696     {
- 1697     if( iContactInterface )
  1698       {
  1699       // most of the time this get called 
   1700       return iContactInterface->OwnContactL().UserId();
  1701       }
 - 1702     return KNullDesC;
  1703     }
  1704 
  1705 //-----------------------------------------------------------------------------
  1706 // CVIMPSTProcessArray::AvatarIndex
  1707 // ( Other items commented in header )
  1708 //------------------------------------------------------------------------------
  1709 
 
  1710 TInt CVIMPSTProcessArray::AvatarIndex(TInt aContactIndex)
  1711     {
  1712     TVIMPSTEnums::TItem itemtype = GetType( aContactIndex );
  1713     /* Codescanner warning is ignored, since Bound check is done 
  1714      * inside the GetType()   method*/
  1715 
- 1716     if( TVIMPSTEnums::EContactItem == itemtype )
  1717         {
  1718        // if the type is a contact item then return the index
  1719         MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId( GetItemUserId(aContactIndex) );
- 1720         if(contact)
  1721             {
  1722             // if any contact is found then return the index
   1723             return contact->AvatarIndex();
  1724             }
  1725         }
 - 1726     return KErrNone;
  1727     }
  1728 //-----------------------------------------------------------------------------
  1729 // CVIMPSTProcessArray::SetAvatarIndex
  1730 // ( Other items commented in header )
  1731 //------------------------------------------------------------------------------
  1732 
 
  1733 void CVIMPSTProcessArray::SetAvatarIndex( TInt aContactIndex ,TInt aAvatarIndex )
  1734     {
  1735     TVIMPSTEnums::TItem itemtype = GetType( aContactIndex );
- 1736     if( TVIMPSTEnums::EContactItem == itemtype )
  1737         {
  1738         // if the type is a contact item then set the index 
  1739         MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId(GetItemUserId(aContactIndex));
- 1740         if(contact)
  1741             {
  1742             // if any contact is found then set the index
  1743             contact->SetAvatarIndex( aAvatarIndex );
  1744             }
  1745         }
  1746 
  1747     }
  1748 
  1749 //-----------------------------------------------------------------------------
  1750 // CVIMPSTProcessArray::AvatarContent
  1751 // ( Other items commented in header )
  1752 //------------------------------------------------------------------------------
  1753 
 
  1754 const TDesC8& CVIMPSTProcessArray::AvatarContent(TInt aContactIndex)
  1755     {   
  1756     TVIMPSTEnums::TItem itemtype = GetType( aContactIndex );
  1757 
- 1758     if(  itemtype == TVIMPSTEnums::EContactItem )
  1759         {
  1760         // if the type is a contact item then get the avatar content from strorage
  1761         MVIMPSTStorageContact* contact = iContactInterface->FindContactByUserId(GetItemUserId(aContactIndex));
- 1762         if(contact)
  1763             {
  1764             // if any contact is found then get the content
   1765             return contact->AvatarContent();
  1766             }
  1767         }
 - 1768     return KNullDesC8();
  1769     }
  1770 //-----------------------------------------------------------------------------
  1771 // CVIMPSTProcessArray::OwnAvatarContentL
  1772 // ( Other items commented in header )
  1773 //------------------------------------------------------------------------------
  1774 
 
  1775 const TDesC8& CVIMPSTProcessArray::OwnAvatarContentL( ) const
  1776    {   
  1777     MVIMPSTStorageContact& contact = iContactInterface->OwnContactL();             
  1778     // if any contact is found then get the content
   1779     return contact.AvatarContent();
  1780    }
  1781 //-----------------------------------------------------------------------------
  1782 // CVIMPSTProcessArray::OwnAvatarIndexL
  1783 // ( Other items commented in header )
  1784 //------------------------------------------------------------------------------
  1785 
 
  1786 TInt CVIMPSTProcessArray::OwnAvatarIndexL( )
  1787     {
  1788     MVIMPSTStorageContact& contact = iContactInterface->OwnContactL();  
   1789     return contact.AvatarIndex();           
  1790     }
  1791 //-----------------------------------------------------------------------------
  1792 // CVIMPSTProcessArray::SetOwnAvatarIndexL
  1793 // ( Other items commented in header )
  1794 //------------------------------------------------------------------------------
  1795 
 
- 1796 void CVIMPSTProcessArray::SetOwnAvatarIndexL( TInt aAvatarIndex )
  1797     {
  1798     MVIMPSTStorageContact& contact = iContactInterface->OwnContactL();             
  1799     contact.SetAvatarIndex( aAvatarIndex );
  1800     }
  1801 
  1802 //-----------------------------------------------------------------------------
  1803 // CVIMPSTProcessArray::FindAnyAddRequest
  1804 // ( Other items commented in header )
  1805 //------------------------------------------------------------------------------
  1806 
 
20   1807 TInt CVIMPSTProcessArray::FindAnyAddRequest( const TDesC& aRequesterId )
  1808     {
  1809     TInt count = iAddRequestArray.Count();
16   1810     for(TInt i=0; i<count; i++)
  1811         {   
14   1812         if((aRequesterId.Compare(iAddRequestArray[i]->GetItemUserId()))==0 )                
  1813             {
14    1814             return ETrue;
  1815             }
  1816         }
   1817     return EFalse;
  1818     }
  1819 
  1820 // -----------------------------------------------------------------------------
  1821 // CVIMPSTProcessArray::GetSelectedItemIndex
  1822 // return contact index including friend request.
  1823 // -----------------------------------------------------------------------------
 
  1824 TInt CVIMPSTProcessArray::GetSelectedItemIndex(const TDesC& aContactId) 
  1825    {
  1826    TInt itemArrayCount = iItemArray.Count();
  1827    for(TInt index=0; index<itemArrayCount; index++)
  1828       {
  1829       MVIMPSTProcessArrayItem* item = iItemArray[ index ];
  1830       if(0 == aContactId.Compare(item->GetItemUserId()))
  1831           {
   1832           return index; 
  1833           }
  1834       }
   1835    return KErrNotFound;
  1836    }
  1837 
  1838 // --------------------------------------------------------------------------
  1839 // CVIMPSTProcessArray::IsContactBlocked
  1840 // --------------------------------------------------------------------------
 
  1841 TBool CVIMPSTProcessArray::IsContactBlocked(const TDesC& aUserId)
  1842     {
  1843     MVIMPSTEngineSubService* subService =          
  1844                         (iEngine.SubService(TVIMPSTEnums::EPresence));
- 1845     if(subService)
  1846         {
  1847         MVIMPSTEnginePresenceSubService& presence = 
  1848                 MVIMPSTEnginePresenceSubService::Cast (*subService);
  1849                 
  1850         RPointerArray<HBufC> *blockedlist = presence .GetBlockedList();
  1851         
- 1852         if(blockedlist)
  1853             {
  1854             for(TInt i=0; i<blockedlist->Count(); ++i)
  1855                 {
  1856                 if(0 == aUserId.CompareC((*blockedlist)[i]->Des()))
  1857                     {
   1858                     return ETrue;
  1859                     }
  1860                 }
  1861             }
  1862         }
   1863     return EFalse;  
  1864     }       
  1865 
  1866 
  1867 //END OF FILE
***TER 56% (285/511) of SOURCE FILE cvimpstprocessarray.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD41.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD41.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,451 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #41/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessarrayitem.cpp
-Instrumentation mode: function-decision
-TER: 48 % ( 30/ 62)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : cvimpstprocessarrayitem.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : CVIMPSTProcessContactItem, CVIMPSTProcessContactListItem, CVIMPSTProcessOwnDataItem,
  6              CVIMPSTProcessConversationItem:  Method implementation
  7 *  Version     : %vision: 10 %
  8 *
  9 *  Copyright © 2008 Nokia Corporation.
  10 *  This material, including documentation and any related 
  11 *  computer programs, is protected by copyright controlled by 
  12 *  Nokia Corporation. All rights are reserved. Copying, 
  13 *  including reproducing, storing, adapting or translating, any 
  14 *  or all of this material requires the prior written consent of 
  15 *  Nokia Corporation. This material also contains confidential 
  16 *  information which may not be disclosed to others without the 
  17 *  prior written consent of Nokia Corporation.
  18 * ==============================================================================
  19 */
  20 
  21 #include "cvimpstprocessarrayitem.h"
  22 #include "tvimpstconsts.h"
  23 #include "vimpstutils.h"
  24 #include <vimpstuires.rsg>
  25 // -----------------------------------------------------------------------------
  26 // CVIMPSTProcessContactItem::NewL
  27 // -----------------------------------------------------------------------------
  28 //
 
86   29 CVIMPSTProcessContactItem* CVIMPSTProcessContactItem::NewL(const TDesC& aContactName,
  30                                           const TDesC& aContactId ,
  31                                        MVPbkContactLink* aContactLink)
  32     {
  33     CVIMPSTProcessContactItem* self = new( ELeave ) CVIMPSTProcessContactItem
  34                          ( aContactLink);
  35     CleanupStack::PushL( self );
  36     self->ConstructL(aContactId,aContactName );
  37     CleanupStack::Pop(); //Codescanner warning ignored
86    38     return self;
  39     }
  40 
  41 // -----------------------------------------------------------------------------
  42 // CVIMPSTProcessContactItem::ConstructL
  43 // -----------------------------------------------------------------------------
  44 //
 
86 86   45 void CVIMPSTProcessContactItem::ConstructL(const TDesC& aContactId,
  46                                 const TDesC& aContactName )
  47     {
  48     iContactUserId = aContactId.AllocL();
  49     iItemNameTextContact = aContactName.AllocL();
  50     iSMsgPending = EFalse;
  51     }
  52 
  53 // -----------------------------------------------------------------------------
  54 // CVIMPSTProcessContactItem::CVIMPSTProcessContactItem
  55 // -----------------------------------------------------------------------------
  56 //   
 
86 86   57 CVIMPSTProcessContactItem::CVIMPSTProcessContactItem(MVPbkContactLink* aContactLink)
  58 : iContactLink(aContactLink)
  59     {
  60     } 
  61     
  62 // -----------------------------------------------------------------------------
  63 // CVIMPSTProcessContactItem::~CVIMPSTProcessContactItem
  64 // -----------------------------------------------------------------------------
  65 //  
 
35 35   66 CVIMPSTProcessContactItem::~CVIMPSTProcessContactItem()
  67    {
  68    delete iContactUserId;
  69    delete iItemNameTextContact;
  70    }
  71       
  72 // -----------------------------------------------------------------------------
  73 //CVIMPSTProcessContactItem: Type
  74 // -----------------------------------------------------------------------------
  75 //
 
17   76 TVIMPSTEnums::TItem CVIMPSTProcessContactItem::Type()
  77    {
17    78    return TVIMPSTEnums::EContactItem;
  79    }
  80 
  81 // -----------------------------------------------------------------------------
  82 //CVIMPSTProcessContactItem: GetItemNameText
  83 // -----------------------------------------------------------------------------
  84 //
 
- 85 TPtrC CVIMPSTProcessContactItem::GetItemNameText()
  86     {
- 87      if( iItemNameTextContact )
  88        {
 - 89        return *iItemNameTextContact;   
  90        }
 - 91    return KNullDesC();
  92     }
  93  
  94  // -----------------------------------------------------------------------------
  95 //CVIMPSTProcessContactItem: GetItemUserId
  96 // -----------------------------------------------------------------------------
  97 //
 
15   98 TPtrC CVIMPSTProcessContactItem::GetItemUserId()
  99     {
15 - 100     if( iContactUserId )
  101        {
15    102        return *iContactUserId;   
  103        }
 - 104    return KNullDesC();
  105     }
  106 // -----------------------------------------------------------------------------
  107 //CVIMPSTProcessContactItem: SetMsgPending
  108 // -----------------------------------------------------------------------------
  109 //
 
  110 void CVIMPSTProcessContactItem::SetMsgPending(TBool aPendingMessageStatus)
  111     {
  112     iSMsgPending = aPendingMessageStatus;
  113     }
  114 // -----------------------------------------------------------------------------
  115 //CVIMPSTProcessContactItem: GetMsgPending
  116 // -----------------------------------------------------------------------------
  117 //
 
- 118 TBool CVIMPSTProcessContactItem::IsMsgPending()
  119     {
 - 120     return iSMsgPending;
  121     }
  122 
  123 // -----------------------------------------------------------------------------
  124 //CVIMPSTProcessContactItem: SetConversationOpen
  125 // -----------------------------------------------------------------------------
  126 //
 
  127 void CVIMPSTProcessContactItem::SetConversationOpen(TBool aConversationOpen)
  128     {
  129     iIsConversationOpen = aConversationOpen;
  130     }
  131 // -----------------------------------------------------------------------------
  132 //CVIMPSTProcessContactItem: IsConversationOpen
  133 // -----------------------------------------------------------------------------
  134 //
 
- 135 TBool CVIMPSTProcessContactItem::IsConversationOpen()
  136     {
 - 137     return iIsConversationOpen;
  138     }
  139 // -----------------------------------------------------------------------------
  140 // CVIMPSTProcessContactListItem::NewL
  141 // -----------------------------------------------------------------------------
  142 //
 
- 143 CVIMPSTProcessContactListItem* CVIMPSTProcessContactListItem::NewL()
  144     {
  145     CVIMPSTProcessContactListItem* self = new( ELeave ) CVIMPSTProcessContactListItem();
  146     CleanupStack::PushL( self );
  147     self->ConstructL();
  148     CleanupStack::Pop();//Codescanner warning ignored
 - 149     return self;
  150     }
  151 
  152 // -----------------------------------------------------------------------------
  153 // CVIMPSTProcessContactListItem::ConstructL
  154 // -----------------------------------------------------------------------------
  155 //
 
- 156 void CVIMPSTProcessContactListItem::ConstructL()
  157     {
  158     iItemNameTextList = HBufC::NewL(KFriendsListMaxIdentificationLength);
  159     }
  160 // -----------------------------------------------------------------------------
  161 // CVIMPSTProcessContactListItem::c++ default constructor
  162 // -----------------------------------------------------------------------------
  163 //   
 
- 164 CVIMPSTProcessContactListItem::CVIMPSTProcessContactListItem()
  165     {
  166        
  167     }    
  168 // -----------------------------------------------------------------------------
  169 // CVIMPSTProcessContactListItemPC::~CVIMPSTProcessContactListItemPC destructor
  170 // -----------------------------------------------------------------------------
  171 //
 
- 172 CVIMPSTProcessContactListItem::~CVIMPSTProcessContactListItem()
  173     {
  174     delete iItemNameTextList;
  175     iItemNameTextList = NULL;
  176     }    
  177         
  178 // -----------------------------------------------------------------------------
  179 //CVIMPSTProcessContactListItem: Type
  180 // -----------------------------------------------------------------------------
  181 //
 
- 182 TVIMPSTEnums::TItem CVIMPSTProcessContactListItem::Type()
  183    {
 - 184    return TVIMPSTEnums::EContactListItem;
  185    }
  186 
  187 // -----------------------------------------------------------------------------
  188 //CVIMPSTProcessContactListItem: IsCollapsed
  189 // -----------------------------------------------------------------------------
  190 //
 
- 191 TBool CVIMPSTProcessContactListItem::IsCollapsed()
  192    {
 - 193    return iCollapsedStatus;
  194    }
  195 
  196 // -----------------------------------------------------------------------------
  197 //CVIMPSTProcessContactListItem: SetCollapsed
  198 // -----------------------------------------------------------------------------
  199 //
 
- 200 void CVIMPSTProcessContactListItem::SetCollapsed(TBool aCollapsedStatus)
  201    {
  202    iCollapsedStatus = aCollapsedStatus;
  203    }
  204 
  205 // -----------------------------------------------------------------------------
  206 //CVIMPSTProcessContactListItem: GetItemNameText
  207 // -----------------------------------------------------------------------------
  208 //
 
- 209 TPtrC CVIMPSTProcessContactListItem::GetItemNameText()
  210    {
 - 211    return *iItemNameTextList;
  212    }
  213 
  214 // -----------------------------------------------------------------------------
  215 //CVIMPSTProcessContactListItem: SetItemNameText
  216 // -----------------------------------------------------------------------------
  217 //
 
- 218 void CVIMPSTProcessContactListItem::SetItemNameText(const TDesC& aItemName)
  219    {
  220    *iItemNameTextList = aItemName;
  221    }
  222 
  223 // -----------------------------------------------------------------------------
  224 // CVIMPSTProcessOwnDataItem::NewL
  225 // -----------------------------------------------------------------------------
  226 //
 
135   227 CVIMPSTProcessOwnDataItem* CVIMPSTProcessOwnDataItem::NewL(TDesC& aOwnId)
  228     {
  229     CVIMPSTProcessOwnDataItem* self = new( ELeave ) CVIMPSTProcessOwnDataItem(aOwnId);
  230     CleanupStack::PushL( self );
  231     self->ConstructL();
  232     CleanupStack::Pop(); //Codescanner warning ignored
135    233     return self;
  234     }
  235 
  236 // -----------------------------------------------------------------------------
  237 // CVIMPSTProcessOwnDataItem::ConstructL
  238 // -----------------------------------------------------------------------------
  239 //
 
135 135   240 void CVIMPSTProcessOwnDataItem::ConstructL()
  241     {
  242     }
  243     
  244 // -----------------------------------------------------------------------------
  245 // CVIMPSTProcessOwnDataItem::CVIMPSTProcessOwnDataItem
  246 // -----------------------------------------------------------------------------
  247 //   
 
135 135   248 CVIMPSTProcessOwnDataItem::CVIMPSTProcessOwnDataItem(TDesC& aOwnId)
  249 :iOwnDataId(aOwnId) 
  250     {
  251        
  252     }
  253 // -----------------------------------------------------------------------------
  254 // CVIMPSTProcessOwnDataItem::~CVIMPSTProcessOwnDataItem
  255 // -----------------------------------------------------------------------------
  256 //   
 
63 63   257 CVIMPSTProcessOwnDataItem::~CVIMPSTProcessOwnDataItem()
  258     {
  259        
  260     }
  261 
  262 // -----------------------------------------------------------------------------
  263 //CVIMPSTProcessOwnDataItem: Type
  264 // -----------------------------------------------------------------------------
  265 //
 
12   266 TVIMPSTEnums::TItem CVIMPSTProcessOwnDataItem::Type()
  267    {
12    268    return TVIMPSTEnums::EOwnStatusItem;
  269    }
  270 
  271 // -----------------------------------------------------------------------------
  272 //CVIMPSTProcessOwnDataItemPC: GetItemUserId
  273 // -----------------------------------------------------------------------------
  274 //
 
14   275 TPtrC CVIMPSTProcessOwnDataItem::GetItemUserId() 
  276    {
14    277    return iOwnDataId;
  278    }
  279 
  280 /////////////////////////////////////////////////////////////////////////
  281 ///////////////////////////////// Unknowncontact item ////////////////////
  282 
  283 
  284 // -----------------------------------------------------------------------------
  285 // CVIMPSTProcessUnknownContactItem::default constructor
  286 // -----------------------------------------------------------------------------
  287 //
 
  288 CVIMPSTProcessUnknownContactItem::CVIMPSTProcessUnknownContactItem()
  289     {
  290     
  291     }
  292 
  293 // -----------------------------------------------------------------------------
  294 // CVIMPSTProcessUnknownContactItem::NewL
  295 // -----------------------------------------------------------------------------
  296 //
 
  297 CVIMPSTProcessUnknownContactItem* CVIMPSTProcessUnknownContactItem::NewL(const TDesC& aBuddyId )
  298     {
  299     CVIMPSTProcessUnknownContactItem* self = new (ELeave) CVIMPSTProcessUnknownContactItem();
  300     CleanupStack::PushL(self);
  301     self->ConstructL(aBuddyId);
  302     CleanupStack::Pop();
   303     return self;
  304     }
  305 
  306 // -----------------------------------------------------------------------------
  307 // CVIMPSTProcessUnknownContactItem::ConstructL
  308 // -----------------------------------------------------------------------------
  309 //
 
  310 void CVIMPSTProcessUnknownContactItem::ConstructL(const TDesC& aBuddyId)
  311     {
  312      iUesrId = aBuddyId.AllocL();
  313      //load formatted string from resource.
  314      iItemNameText = VIMPSTUtils::LoadResourceL(R_SERVTAB_UNKNOWN_BUDDY);
  315      iIndex = -1;//default index if no index is set.
  316     }
  317 
  318 // -----------------------------------------------------------------------------
  319 // CVIMPSTProcessUnknownContactItem::destructor
  320 // -----------------------------------------------------------------------------
  321 //
 
  322 CVIMPSTProcessUnknownContactItem::~CVIMPSTProcessUnknownContactItem()
  323     {
  324     delete iItemNameText;
  325     delete iUesrId;
  326     }
  327 
  328 // -----------------------------------------------------------------------------
  329 // CVIMPSTProcessUnknownContactItem::GetItemNameText
  330 // -----------------------------------------------------------------------------
  331 //
 
- 332 TPtrC CVIMPSTProcessUnknownContactItem::GetItemNameText()
  333     {
 - 334     return iItemNameText->Des();
  335     }
  336 
  337 // -----------------------------------------------------------------------------
  338 // CVIMPSTProcessUnknownContactItem::Type
  339 // -----------------------------------------------------------------------------
  340 //
 
- 341 TVIMPSTEnums::TItem CVIMPSTProcessUnknownContactItem::Type()
  342     {
 - 343     return TVIMPSTEnums::EUnknonContactItem;
  344     }
  345 /**
  346 * Returns the user id of the listbox item 
  347 * @return TPtrC: user id of the listbox item.
  348 */
 
  349 TPtrC CVIMPSTProcessUnknownContactItem::GetItemUserId()
  350     {
   351     return iUesrId->Des();
  352     }
  353 
  354 // -----------------------------------------------------------------------------
  355 //CVIMPSTProcessUnknownContactItem: SetMsgPending
  356 // -----------------------------------------------------------------------------
  357 //
 
  358 void CVIMPSTProcessUnknownContactItem::SetMsgPending(TBool aPendingMessageStatus)
  359     {
  360     iSMsgPending = aPendingMessageStatus;
  361     }
  362 // -----------------------------------------------------------------------------
  363 //CVIMPSTProcessUnknownContactItem: GetMsgPending
  364 // -----------------------------------------------------------------------------
  365 //
 
- 366 TBool CVIMPSTProcessUnknownContactItem::IsMsgPending()
  367     {
 - 368     return iSMsgPending;
  369     }
  370 
  371 // -----------------------------------------------------------------------------
  372 //CVIMPSTProcessUnknownContactItem: SetConversationOpen
  373 // -----------------------------------------------------------------------------
  374 //
 
  375 void CVIMPSTProcessUnknownContactItem::SetConversationOpen(TBool aConversationOpen)
  376     {
  377     iIsConversationOpen = aConversationOpen;
  378     }
  379 // -----------------------------------------------------------------------------
  380 //CVIMPSTProcessUnknownContactItem: IsConversationOpen
  381 // -----------------------------------------------------------------------------
  382 //
 
- 383 TBool CVIMPSTProcessUnknownContactItem::IsConversationOpen()
  384     {
 - 385     return iIsConversationOpen;
  386     }
***TER 48% (30/62) of SOURCE FILE cvimpstprocessarrayitem.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD42.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD42.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #42/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessfriendrequestitem.cpp
-Instrumentation mode: function-decision
-TER: 41 % ( 7/ 17)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ===========================================================================
  3 *  Name        : cvimpstprocessfriendrequestitem.cpp
  4 *  Part of     : IMUiServiceTab/vimpstcmdprocess
  5 *  Description : 
  6 *  Version     : %version: 4.1.2 %
  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 #include "cvimpstprocessfriendrequestitem.h"
  19 #include "vimpstutils.h"
  20 #include <vimpstuires.rsg>
  21 
  22 
  23 // -----------------------------------------------------------------------------
  24 // CVIMPSTProcessFriendRequestItem::default constructor
  25 // -----------------------------------------------------------------------------
  26 //
 
  27 CVIMPSTProcessFriendRequestItem::CVIMPSTProcessFriendRequestItem()
  28     {
  29     
  30     }
  31 
  32 // -----------------------------------------------------------------------------
  33 // CVIMPSTProcessFriendRequestItem::NewL
  34 // -----------------------------------------------------------------------------
  35 //
 
  36 CVIMPSTProcessFriendRequestItem* CVIMPSTProcessFriendRequestItem::NewL(const TDesC& aRequesterId)
  37     {
  38     CVIMPSTProcessFriendRequestItem* self = new (ELeave) CVIMPSTProcessFriendRequestItem();
  39     CleanupStack::PushL(self);
  40     self->ConstructL(aRequesterId);
  41     CleanupStack::Pop();
   42     return self;
  43     }
  44 
  45 // -----------------------------------------------------------------------------
  46 // CVIMPSTProcessFriendRequestItem::ConstructL
  47 // -----------------------------------------------------------------------------
  48 //
 
  49 void CVIMPSTProcessFriendRequestItem::ConstructL(const TDesC& aRequesterId)
  50     {
  51      iUesrId = aRequesterId.AllocL();
  52      //load formatted string from resource.
  53      iItemNameText = VIMPSTUtils::LoadResourceL(R_SERVTAB_FRIEND_REQUEST);
  54      iIndex = -1;//default index if no index is set.
  55     }
  56 
  57 // -----------------------------------------------------------------------------
  58 // CVIMPSTProcessFriendRequestItem::destructor
  59 // -----------------------------------------------------------------------------
  60 //
 
  61 CVIMPSTProcessFriendRequestItem::~CVIMPSTProcessFriendRequestItem()
  62     {
  63     delete iItemNameText;
  64     delete iUesrId;
  65     }
  66 
  67 // -----------------------------------------------------------------------------
  68 // CVIMPSTProcessFriendRequestItem::GetItemNameText
  69 // -----------------------------------------------------------------------------
  70 //
 
- 71 TPtrC CVIMPSTProcessFriendRequestItem::GetItemNameText()
  72     {
 - 73     return iItemNameText->Des();
  74     }
  75 
  76 // -----------------------------------------------------------------------------
  77 // CVIMPSTProcessFriendRequestItem::Type
  78 // -----------------------------------------------------------------------------
  79 //
 
- 80 TVIMPSTEnums::TItem CVIMPSTProcessFriendRequestItem::Type()
  81     {
 - 82     return TVIMPSTEnums::EFriendRequestItem;
  83     }
  84 
  85 /**
  86 * Returns the user id of the listbox item 
  87 * @return TPtrC: user id of the listbox item.
  88 */
 
18   89 TPtrC CVIMPSTProcessFriendRequestItem::GetItemUserId()
  90     {
18    91     return iUesrId->Des();
  92     }
  93 
  94 // -----------------------------------------------------------------------------
  95 //CVIMPSTProcessFriendRequestItem: SetMsgPending
  96 // -----------------------------------------------------------------------------
  97 //
 
- 98 void CVIMPSTProcessFriendRequestItem::SetMsgPending(TBool aPendingMessageStatus)
  99     {
  100     iSMsgPending = aPendingMessageStatus;
  101     }
  102 // -----------------------------------------------------------------------------
  103 //CVIMPSTProcessFriendRequestItem: GetMsgPending
  104 // -----------------------------------------------------------------------------
  105 //
 
- 106 TBool CVIMPSTProcessFriendRequestItem::IsMsgPending()
  107     {
 - 108     return iSMsgPending;
  109     }
  110 // -----------------------------------------------------------------------------
  111 //CVIMPSTProcessFriendRequestItem: SetConversationOpen
  112 // -----------------------------------------------------------------------------
  113 //
 
- 114 void CVIMPSTProcessFriendRequestItem::SetConversationOpen(TBool aConversationOpen)
  115     {
  116     iIsConversationOpen = aConversationOpen;
  117     }
  118 // -----------------------------------------------------------------------------
  119 //CVIMPSTProcessFriendRequestItem: IsConversationOpen
  120 // -----------------------------------------------------------------------------
  121 //
 
- 122 TBool CVIMPSTProcessFriendRequestItem::IsConversationOpen()
  123     {
 - 124     return iIsConversationOpen;
  125     }
***TER 41% (7/17) of SOURCE FILE cvimpstprocessfriendrequestitem.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD43.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD43.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #43/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimstcmdfriendrequest.cpp
-Instrumentation mode: function-decision
-TER: 93 % ( 14/ 15)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

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

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD5.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD5.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,266 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #5/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_cvpbkcontactlinkarray.cpp
-Instrumentation mode: function-decision
-TER: 0 % ( 0/ 39)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ==============================================================================
  3 *  Name        : s_CVPbkContactLinkArray.cpp
  4 *  Part of     : Virtual Phonebook / VPbkEng.dll
  5 *  Description : An array for contact links.
  6 *  Version     : %version: 1 %
  7 *
  8 *  Copyright © 2002-2007 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 
  20 // INCLUDES
  21 #include <CVPbkContactLinkArray.h>
  22 /**
  23  * Creates an empty link array.
  24  *
  25  * @return A new instance of this class
  26  */
 
- 27 EXPORT_C  CVPbkContactLinkArray* CVPbkContactLinkArray::NewL(){ return new (ELeave) CVPbkContactLinkArray; }
 - 27 return new ( ELeave ) CVPbkContactLinkArray
  28 
  29 /**
  30  * Creates an empty link array. Leaves the created array object on
  31  * the cleanup stack.
  32  *
  33  * @return A new instance of this class
  34  */
 
- 35 EXPORT_C  CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC()
  36 
  37 CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; 
  38 CleanupStack::PushL(self);
 - 39 return self;
  40 }
  41 
  42 /**
  43  * Creates a link array from a packed descriptor of links.
  44  *
  45  * @param aPackedLinks a buffer that was created using PackLC
  46  *        of MVPbkContactLinkArray or MVPbkContactLink
  47  * @param aStoreList the list of stores that contain the
  48  *        stores that links belong.
  49  * @return A new instance of this class
  50  */
 
- 51 EXPORT_C  CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC(
  52         const TDesC8& /*aPackedLinks*/,
  53         const MVPbkContactStoreList& /*aStoreList*/)
  54    { 
  55    CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; 
  56    CleanupStack::PushL(self);
 - 57    return self;
  58    }
  59 
  60 /**
  61  * Creates a link array from a stream of links.
  62  *
  63  * @param aStream a stream of contact link that was created
  64  *                using MVPbkStreamable interface of
  65  *                MVPbkContactLink
  66  * @param aStoreList the list of stores that contain the
  67  *                stores that links belong.
  68  * @return A new instance of this class
  69  */
 
- 70 EXPORT_C  CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC(
  71         RReadStream& /*aStream*/,
  72         const MVPbkContactStoreList& /*aStoreList*/)
  73         { 
  74       CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; 
  75       CleanupStack::PushL(self);
 - 76       return self;
  77       }
  78 
  79 /**
  80  * Creates a link array from a stream of links. Uses aLoader
  81  * to find and load stores.
  82  * aLoader must exist the life time of this object.
  83  *
  84  * @param aStream a stream of contact link that was created
  85  *                using MVPbkStreamable interface of
  86  *                MVPbkContactLink
  87  * @param aLoader the contact store loader for internalization.
  88  * @return A new instance of this class
  89  */
 
- 90  CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC(
  91         RReadStream& /*aStream*/,
  92         MVPbkContactStoreLoader& /*aLoader*/ )
  93        { 
  94       CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; 
  95       CleanupStack::PushL(self);
 - 96       return self;
  97       }
  98 
  99 /**
  100  * Destructor.
  101  */
 
- 102 CVPbkContactLinkArray::~CVPbkContactLinkArray(){ }
  103 
  104 
  105 /**
  106  * Appends a link to this array.
  107  *
  108  * @param aLink the link object to append. This array takes ownership
  109  *              of the link if append is succesful.
  110  * @pre aLink != NULL
  111  * @post Array count is increased by one and the link is in the last 
  112  * element of the array.
  113  */
 
- 114 EXPORT_C void CVPbkContactLinkArray::AppendL(MVPbkContactLink* /*aLink*/){ }
  115 
  116 /**
  117  * Inserts a link to this array.
  118  *
  119  * @param aLink the link object to insert. This array takes ownership
  120  *              of the link if insertion is succesful.
  121  * @param aIndex    position where to insert the link.
  122  * @exception KErrNoMemory  if out of memory.
  123  * @pre aLink != NULL
  124  * @pre aIndex >= 0 && aIndex <= Count()
  125  * @post Array count is increased by one and the link is in the position 
  126  * marked by the aIndex element of the array.
  127  */
 
- 128 EXPORT_C void CVPbkContactLinkArray::InsertL(MVPbkContactLink* /*aLink*/, TInt /*aIndex*/){ }
  129 
  130 /**
  131  * Removes a link at aIndex from this array.
  132  *  
  133  * @pre aIndex >= 0 && aIndex <= Count()
  134  * @post The array count is decreased by one.
  135  */
 
- 136 EXPORT_C void CVPbkContactLinkArray::Remove(TInt /*aIndex*/){ }
  137 
  138 /**
  139  * Removes and deletes a link at aIndex from this array.
  140  *
  141  * @pre aIndex >= 0 && aIndex <= Count()
  142  * @post The array count is decreased by one.
  143  */
 
- 144 EXPORT_C void CVPbkContactLinkArray::Delete(TInt /*aIndex*/){ }
  145 
  146 /**
  147  * Resets the array and destroys the links
  148  */
 
- 149 EXPORT_C void CVPbkContactLinkArray::ResetAndDestroy(){ }
  150 
  151 /**
  152  * Resets this array but doesn't destroy links
  153  * 
  154  * @post Count() == 0
  155  */
 
- 156 EXPORT_C void CVPbkContactLinkArray::Reset(){ }
  157 
  158 /**
  159  * Returns the size of the packed link array
  160  */
 
- 161 EXPORT_C TInt CVPbkContactLinkArray::PackedBufferSize() const{ return 0; }
 - 161 return 0
  162 
  163 
 
- 164 TInt CVPbkContactLinkArray::Count() const{ return 0; }
 - 164 return 0
 
- 165 const MVPbkContactLink& CVPbkContactLinkArray::At(TInt /*aIndex*/) const
  166    { 
  167    MVPbkContactLink* ret = NULL;
 - 168    return *ret;
  169    }
  170 
 
- 171 TInt CVPbkContactLinkArray::Find(const MVPbkContactLink& /*aLink*/) const{ return 0; }
 - 171 return 0
 
- 172 HBufC8* CVPbkContactLinkArray::PackLC() const
  173 {  
  174 _LIT8(KText,"Nutan@presence");
  175    
  176     HBufC8* temp = HBufC8::NewLC( 32 );
  177     TPtr8 tempptr = temp->Des();
  178     tempptr.Zero();
  179     tempptr.Append( KText );
  180   
  181     //CleanupStack::PushL( temp );
 - 182     return temp;
  183 }
 
- 184 const MVPbkStreamable* CVPbkContactLinkArray::Streamable() const
  185 
 - 186 return NULL;
  187 }
  188 
  189 
 
- 190 CVPbkContactLinkArray::CVPbkContactLinkArray(){ }
 
- 191 void CVPbkContactLinkArray::ConstructL(){ }
 
- 192 void CVPbkContactLinkArray::ConstructL(const TDesC8& /*aPackedLinks*/, 
  193         const MVPbkContactStoreList& /*aOperations*/){ }
 
- 194 void CVPbkContactLinkArray::ConstructL(RReadStream& /*aStream*/, 
  195         const MVPbkContactStoreList& /*aOperations*/){ }
 
- 196 TInt CVPbkContactLinkArray::DoCalculatePackedBufferSizeV2() const{ return 0; }
 - 196 return 0
 
- 197 void CVPbkContactLinkArray::DoFillPackedBufferV2L(RWriteStream& /*aWriteStream*/) const{ }
 
- 198 void CVPbkContactLinkArray::InternalizeFromBufferL( RReadStream& /*aReadStream*/, 
  199         const MVPbkContactStoreList& /*aStoreList*/ ){ }
 
- 200 void CVPbkContactLinkArray::DoInternalizeFromBufferL( RReadStream& /*aReadStream*/, 
  201         const MVPbkContactStoreList& /*aStoreList*/){ }
 
- 202 void CVPbkContactLinkArray::DoInternalizeFromBufferV2L(RReadStream& /*aReadStream*/, 
  203         const MVPbkContactStoreList& /*aStoreList*/){ }
  204 
  205     
  206 // End of file
***TER 0% (0/39) of SOURCE FILE s_cvpbkcontactlinkarray.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD6.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD6.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #6/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_engineextentionfeatures.cpp
-Instrumentation mode: function-decision
-TER: 55 % ( 6/ 11)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ============================================================================
  3 *  Name        : s_engineextentionfeatures.cpp
  4 *  Part of     : 
  5 *  Description : 
  6 *  Version     : %version: 1 %
  7 *
  8 *  Copyright © 2006, 2007 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 * Template version: 4.1
  18 */
  19 
  20 #include "s_engineextentionfeatures.h"
  21 #include "tvimpstenums.h"
  22 
 
  23 MVIMPSTEngineExtentionFeatures* extentionfeatures_stub::NewL()
  24 {
  25    MVIMPSTEngineExtentionFeatures * extFeature = new(ELeave) extentionfeatures_stub;
   26    return extFeature ;
  27 }
  28 
 
- 29 TVIMPSTEnums::FeatureSupport extentionfeatures_stub::IsSupported() const 
  30 {
 - 31    return TVIMPSTEnums::ESupported;
  32 }
  33 
  34 /**
  35 * SetSupported
  36 * @param TVIMPSTEnums::FeatureSupport defined in tvimpstenums.h
  37 */
 
- 38 void extentionfeatures_stub::SetSupported(TVIMPSTEnums::FeatureSupport /*aSupported*/ )
  39 {
  40    
  41 }
  42 
  43 
  44 /**
  45 * Type of the Extention Feature
  46 * @return TVIMPSTEnums::ExtentionType defined in tvimpstenums.h
  47 */
  48 
 
  49 TVIMPSTEnums::ExtentionType extentionfeatures_stub::Type() const
  50 {
   51    return TVIMPSTEnums::EContactManagement;
  52 }
  53 
  54 /*
  55 MVIMPSTEngineContactMgmtExtention& extentionfeatures_stub::Cast(
  56             MVIMPSTEngineExtentionFeatures& aExtentionFeature)
  57 {
  58     __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EServerContactManagement,
  59         User::Panic(KErrNotFound) );
  60     return static_cast<MVIMPSTEngineContactMgmtExtention&>(aExtentionFeature);
  61 }
  62 
  63     
  64 const MVIMPSTEngineContactMgmtExtention& extentionfeatures_stub::Cast(
  65         const MVIMPSTEngineExtentionFeatures& aExtentionFeature)
  66 {
  67     __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EServerContactManagement,
  68         User::Panic(KErrNotFound) );
  69     return static_cast<const MVIMPSTEngineContactMgmtExtention&>(aExtentionFeature);
  70 }
  71   */    
  72 
  73 
 
  74 TInt extentionfeatures_stub::AddServerContactL(const TDesC& /*aContactList*/, 
  75                        const TDesC& aUserId,const TDesC& /*aNickname*/,TBool /*aWaitToComplete */  ) 
  76 {
   77    return KErrNotFound;
  78 }
  79     
  80     
 
- 81 TInt extentionfeatures_stub::DeleteServerContactL( const TDesC& /*aContactListId*/, 
  82                           const TDesC& /*aUserId*/ ) 
  83 {
 - 84    return KErrNotFound;
  85 }
  86 
  87 
  88 //end of file
***TER 55% (6/11) of SOURCE FILE s_engineextentionfeatures.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD7.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD7.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #7/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_enginesearchextention.cpp
-Instrumentation mode: function-decision
-TER: 46 % ( 6/ 13)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2 * ============================================================================
  3 *  Name        : s_engineextentionfeatures.cpp
  4 *  Part of     : 
  5 *  Description : 
  6 *  Version     : %version: 2 %
  7 *
  8 *  Copyright © 2006, 2007 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 * Template version: 4.1
  18 */
  19 
  20 #include "s_enginesearchextention.h"
  21 #include "tvimpstenums.h"
  22 
 
  23 MVIMPSTEngineSearchMgrExtention* searchextention_stub::NewL()
  24 {
  25    MVIMPSTEngineSearchMgrExtention* extFeature = new(ELeave) searchextention_stub;
   26    return extFeature ;
  27 }
  28 
 
- 29 TVIMPSTEnums::FeatureSupport searchextention_stub::IsSupported() const 
  30 {
 - 31    return TVIMPSTEnums::ESupported;
  32 }
  33 
  34 /**
  35 * SetSupported
  36 * @param TVIMPSTEnums::FeatureSupport defined in tvimpstenums.h
  37 */
 
- 38 void searchextention_stub::SetSupported(TVIMPSTEnums::FeatureSupport /*aSupported*/ )
  39 {
  40    
  41 }
  42 
  43 
  44 /**
  45 * Type of the Extention Feature
  46 * @return TVIMPSTEnums::ExtentionType defined in tvimpstenums.h
  47 */
  48 
 
  49 TVIMPSTEnums::ExtentionType searchextention_stub::Type() const
  50 {
   51    return TVIMPSTEnums::ESearch;
  52 }
  53 
 
- 54 void searchextention_stub::RegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* /*aObserver*/)
  55 {
  56    
  57 }
  58 
  59 
 
- 60 void  searchextention_stub::UnRegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* /*aObserver*/ ) 
  61 {
  62    
  63 }
  64 
 
  65 TInt searchextention_stub::SearchContactsL( RArray<TVIMPSTSearchKeyData>& /*aKeyDataArray*/ ) 
  66 {
   67    return 1;
  68 }
  69  
 
- 70 TInt searchextention_stub::SubscribeForSearchKeysL() 
  71 {
 - 72    return 1;
  73 }
  74 
  75 
  76 //end of file
***TER 46% (6/13) of SOURCE FILE s_enginesearchextention.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD8.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD8.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #8/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_imsubservice.cpp
-Instrumentation mode: function-decision
-TER: 0 % ( 0/ 23)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2  * ==============================================================================
  3  *  Name        : s_vimpstenginepresencesubservice.cpp
  4  *  Part of     : IMUiServiceTab\internal\vimstcmdprocess_ut
  5  *  Description : Handles the use of Precense Framework
  6  *
  7  *  Copyright © 2007 Nokia.  All rights reserved.
  8  *  This material, including documentation and any related computer
  9  *  programs, is protected by copyright controlled by Nokia.  All
  10  *  rights are reserved.  Copying, including reproducing, storing,
  11  *  adapting or translating, any or all of this material requires the
  12  *  prior written consent of Nokia.  This material also contains
  13  *  confidential information which may not be disclosed to others
  14  *  without the prior written consent of Nokia.
  15  * ============================================================================
  16  * Template version: 4.2
  17  */
  18 
  19 // INCLUDE FILES
  20 #include "s_imsubservice.h"
  21 
  22 //Presence Observer
  23 //#include "mvimpstenginepresencesubserviceeventobserver.h"
  24 
  25 
  26 
  27 // ================= MEMBER FUNCTIONS =======================
  28 
  29 // ---------------------------------------------------------------------------
  30 // CVIMPSTEnginePresenceSubService_Stub::
  31 //      CVIMPSTEnginePresenceSubService_Stub()
  32 // ---------------------------------------------------------------------------
  33 //
 
- 34 CVIMPSTEngineImSubService_Stub::CVIMPSTEngineImSubService_Stub(  ) 
  35         {
  36         }
  37 
  38 // ---------------------------------------------------------------------------
  39 // CVIMPSTEnginePresenceSubService_Stub::ConstructL()
  40 // ---------------------------------------------------------------------------
  41 //
 
- 42 void CVIMPSTEngineImSubService_Stub::ConstructL()
  43     {
  44    
  45 
  46     }
  47 
  48 // ---------------------------------------------------------------------------
  49 // CVIMPSTEnginePresenceSubService_Stub::NewL()
  50 // ---------------------------------------------------------------------------
  51 //
  52 CVIMPSTEngineImSubService_Stub* 
 
- 53 CVIMPSTEngineImSubService_Stub::NewL(  )
  54     {
  55     CVIMPSTEngineImSubService_Stub* self = NewLC();
  56     CleanupStack::Pop(self);
 - 57     return self;
  58     }
  59 
  60 // ---------------------------------------------------------------------------
  61 // CVIMPSTEnginePresenceSubService_Stub::NewLC()
  62 // ---------------------------------------------------------------------------
  63 //
  64 CVIMPSTEngineImSubService_Stub* 
 
- 65 CVIMPSTEngineImSubService_Stub::NewLC( )
  66     {
  67     CVIMPSTEngineImSubService_Stub* self =
  68     new (ELeave) CVIMPSTEngineImSubService_Stub( );
  69     CleanupStack::PushL(self);
  70     self->ConstructL();
 - 71     return self;
  72     }
  73 
  74 // ---------------------------------------------------------------------------
  75 // CVIMPSTEnginePresenceSubService_Stub::
  76 //      ~CVIMPSTEnginePresenceSubService_Stub()
  77 // ---------------------------------------------------------------------------
  78 //
 
- 79 CVIMPSTEngineImSubService_Stub::~CVIMPSTEngineImSubService_Stub()
  80     {
  81    
  82     }
  83 
  84 
 
- 85 TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEngineImSubService_Stub::SubServiceState() const
  86     {
 - 87     return TVIMPSTEnums::ESVCERegistered;
  88     }
  89 
  90 // ---------------------------------------------------------------------------
  91 // CVIMPSTEnginePresenceSubService_Stub::
  92 //      Type()
  93 // ---------------------------------------------------------------------------
  94 //
  95 
 
- 96 TVIMPSTEnums::SubServiceType CVIMPSTEngineImSubService_Stub::Type() const
  97     {               
 - 98     return TVIMPSTEnums::EPresence;
  99     } 
  100 
  101 
  102 
  103    
  104 
  105         /**
  106         * @see MVIMPSTIMSubService
  107         */
 
- 108         void CVIMPSTEngineImSubService_Stub::RegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver)
  109             {
  110             
  111             }
  112 
  113         /**
  114         * @see MVIMPSTIMSubService
  115         */
 
- 116         void CVIMPSTEngineImSubService_Stub::UnRegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver)
  117             {
  118             
  119             }
  120 
  121         /**
  122         * @see MVIMPSTIMSubService
  123         */
 
- 124         TInt CVIMPSTEngineImSubService_Stub::GetUnreadCountL(const TDesC& aSender)
  125         {
 - 126         return 0;
  127         }
  128         
  129 
  130 
  131         /**
  132         * @see MVIMPSTIMSubService
  133         */
 
- 134         TBool CVIMPSTEngineImSubService_Stub::IsConversationExistL(const TDesC& aRecipientId) const 
  135         {
- 136         if(aRecipientId.Length())
 - 137             return ETrue;
    138         else
 - 139             return EFalse;
  140         }
  141 
  142         /**
  143         * @see MVIMPSTIMSubService
  144         */
 
- 145         void CVIMPSTEngineImSubService_Stub::CloseConversationL( const TDesC& aContactId )
  146         {
  147         
  148         }
  149         
  150         /**
  151         * @see MVIMPSTIMSubService
  152         */
  153         
 
- 154         RArray<SIMCacheChatItem>CVIMPSTEngineImSubService_Stub::GetOpenChatListL()
  155             {
  156 
  157             RArray<SIMCacheChatItem> item;
 - 158             return item;
  159             }
  160 // End of file
***TER 0% (0/23) of SOURCE FILE s_imsubservice.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD9.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexD9.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Execution Profile -   #9/43

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Index | No Index


-File: \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mccaconnection.cpp
-Instrumentation mode: function-decision
-TER: 40 % ( 2/ 5)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Start/ End/    
True False - Line Source

  1 /*
  2  * ============================================================================
  3  *  Name        : mccaconnection.cpp
  4  *  Part of     : CCA / CCAClient
  5  *  Description : This is a class for launching CCA application.
  6  *  Version     : %version: 6 %
  7  *
  8  *  Copyright © 2007 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  * Template version: 4.2
  18  */
  19 
  20 
  21 #include "s_mccaconnection.h"
  22 
  23 
  24 class MCCAParameter;
  25 class MCCAObserver;
  26 
  27 
 
  28 MCCAConnection* MCCAConnectionStub::NewL()
  29     {
  30     MCCAConnection* parameter = new(ELeave)MCCAConnectionStub;
   31         return parameter;
  32     }
  33 
 
- 34 void MCCAConnectionStub::Close() 
  35     {
  36     
  37     }
  38     /**
  39      * DEPRECATED - USE LaunchAppL() instead!
  40      * Ownership of MCCAParameter is NOT transferred.
  41      */
 
- 42      void MCCAConnectionStub::LaunchApplicationL( MCCAParameter& aParameter )
  43          {
  44          
  45          }
  46 
  47    
  48 
 
- 49      void MCCAConnectionStub::LaunchAppL(
  50         MCCAParameter& aParameter,
  51         MCCAObserver* aObserver  )
  52          {
  53          
  54          }
  55     // End of File
  56     
***TER 40% (2/5) of SOURCE FILE s_mccaconnection.cpp

-Directory Summary | Files Summary | Functions Summary | Execution Profile
-To files: First | Previous | Next | Last | Top | Index | No Index


- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexE.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexE.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -Source Files Not Found - - - - - - - - -The following source files were not found by ctc2html: -

- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexF.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexF.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -CTC++ Coverage Report - -Directory Summary

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- - - - - - - - - - - - -
Symbol file(s): MON.sym (Thu Sep 24 11:02:15 2009)
Data file(s): MON.dat (Thu Sep 24 11:40:46 2009)
Listing produced at: Thu Sep 24 11:40:57 2009
Coverage view: As instrumented
 
Input listing: profile.txt
Html generated at: Thu Sep 24 11:41:19 2009
ctc2html v2.4 options: -i profile.txt 
Threshold percent: 100 %

-(Click on header to sort) - - - - - - - - - - - - - - - - - - -
TER%- Covered Not-covered All Directory
75%-331144\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src
36%-140254394\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub
63%-6333681001\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src

56%-8066331439OVERALL

- - - - - - - -
Number of directories: 3
Number of monitored source files: 43
Number of functions: 497
Number of source lines: 8382
Number of measurement points: 1945
TER: 56% (decision)

-Directory Summary | Files Summary | Functions Summary | Execution Profile

- diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexG.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexG.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexH.html --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/indexH.html Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ - - -CTC++ Coverage Report - - - - - - - - -Index
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\t_vimpstcmdprocess_cmdfactory_utestcases.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\t_vimpstcmdprocess_processarray_utest.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\vimpstcmdprocess_utest.cpp
 
\meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_ccafactory.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_cvpbkcontactlinkarray.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_engineextentionfeatures.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_enginesearchextention.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_imsubservice.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mccaconnection.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mccaparameter.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_mvpbkcontactlinkstub.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_processarrayobserver.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_storageitemmodel.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstcmdobserver.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstengin.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstenginepresencesubservice.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpstprocessarrayitem.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragecontact.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragecontactlist.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststoragemanagerfactory.cpp
   \meco_domain\conversations\uiservicetab\internal\tsrc\vimpstcmdprocess_utest\src\stub\s_vimpststorageserviceview.cpp
 
\meco_domain\conversations\uiservicetab\vimpstcmdprocess\src
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdaddcontact.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdaddtopbk.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdblockcontact.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcancellogin.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcca.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownavtar.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownmessage.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdchangeownstatus.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdcloseconversation.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmddeletecontact.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdfactory.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdfetchblockedlist.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdhandler.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdlogin.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdlogout.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdprocessselectedcontact.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdsearch.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstcmdunblockcontact.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessarray.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessarrayitem.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimpstprocessfriendrequestitem.cpp
   \meco_domain\conversations\uiservicetab\vimpstcmdprocess\src\cvimstcmdfriendrequest.cpp
diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/red.gif Binary file uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/red.gif has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/sorttable.js --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/sorttable.js Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,492 +0,0 @@ -/* - SortTable - version 2 - 7th April 2007 - Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ - - Instructions: - Download this file - Add to your HTML - Add class="sortable" to any table you'd like to make sortable - Click on the headers to sort - - Thanks to many, many people for contributions and suggestions. - Licenced as X11: http://www.kryogenix.org/code/browser/licence.html - This basically means: do what you want with it. -*/ - - -var stIsIE = /*@cc_on!@*/false; - -sorttable = { - init: function() { - // quit if this function has already been called - if (arguments.callee.done) return; - // flag this function so we don't do the same thing twice - arguments.callee.done = true; - // kill the timer - if (_timer) clearInterval(_timer); - - if (!document.createElement || !document.getElementsByTagName) return; - - sorttable.DATE_RE = /^(dd?)[/.-](dd?)[/.-]((dd)?dd)$/; - - forEach(document.getElementsByTagName('table'), function(table) { - if (table.className.search(/\bsortable\b/) != -1) { - sorttable.makeSortable(table); - } - }); - - }, - - makeSortable: function(table) { - if (table.getElementsByTagName('thead').length == 0) { - // table doesn't have a tHead. Since it should have, create one and - // put the first table row in it. - the = document.createElement('thead'); - the.appendChild(table.rows[0]); - table.insertBefore(the,table.firstChild); - } - // Safari doesn't support table.tHead, sigh - if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; - - if (table.tHead.rows.length != 1) return; // can't cope with two header rows - - // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as - // "total" rows, for example). This is B&R, since what you're supposed - // to do is put them in a tfoot. So, if there are sortbottom rows, - // for backwards compatibility, move them to tfoot (creating it if needed). - sortbottomrows = []; - for (var i=0; i5' : ' ▴'; - this.appendChild(sortrevind); - return; - } - if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { - // if we're already sorted by this column in reverse, just - // re-reverse the table, which is quicker - sorttable.reverse(this.sorttable_tbody); - this.className = this.className.replace('sorttable_sorted_reverse', - 'sorttable_sorted'); - this.removeChild(document.getElementById('sorttable_sortrevind')); - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - return; - } - - // remove sorttable_sorted classes - theadrow = this.parentNode; - forEach(theadrow.childNodes, function(cell) { - if (cell.nodeType == 1) { // an element - cell.className = cell.className.replace('sorttable_sorted_reverse',''); - cell.className = cell.className.replace('sorttable_sorted',''); - } - }); - sortfwdind = document.getElementById('sorttable_sortfwdind'); - if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } - sortrevind = document.getElementById('sorttable_sortrevind'); - if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } - - this.className += ' sorttable_sorted'; - sortfwdind = document.createElement('span'); - sortfwdind.id = "sorttable_sortfwdind"; - sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; - this.appendChild(sortfwdind); - - // build an array to sort. This is a Schwartzian transform thing, - // i.e., we "decorate" each row with the actual sort key, - // sort based on the sort keys, and then put the rows back in order - // which is a lot faster because you only do getInnerText once per row - row_array = []; - col = this.sorttable_columnindex; - rows = this.sorttable_tbody.rows; - for (var j=0; j 12) { - // definitely dd/mm - return sorttable.sort_ddmm; - } else if (second > 12) { - return sorttable.sort_mmdd; - } else { - // looks like a date, but we can't tell which, so assume - // that it's dd/mm (English imperialism!) and keep looking - sortfn = sorttable.sort_ddmm; - } - } - } - } - return sortfn; - }, - - getInnerText: function(node) { - // gets the text we want to use for sorting for a cell. - // strips leading and trailing whitespace. - // this is *not* a generic getInnerText function; it's special to sorttable. - // for example, you can override the cell text with a customkey attribute. - // it also gets .value for fields. - - hasInputs = (typeof node.getElementsByTagName == 'function') && - node.getElementsByTagName('input').length; - - if (node.getAttribute("sorttable_customkey") != null) { - return node.getAttribute("sorttable_customkey"); - } - else if (typeof node.textContent != 'undefined' && !hasInputs) { - return node.textContent.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.innerText != 'undefined' && !hasInputs) { - return node.innerText.replace(/^\s+|\s+$/g, ''); - } - else if (typeof node.text != 'undefined' && !hasInputs) { - return node.text.replace(/^\s+|\s+$/g, ''); - } - else { - switch (node.nodeType) { - case 3: - if (node.nodeName.toLowerCase() == 'input') { - return node.value.replace(/^\s+|\s+$/g, ''); - } - case 4: - return node.nodeValue.replace(/^\s+|\s+$/g, ''); - break; - case 1: - case 11: - var innerText = ''; - for (var i = 0; i < node.childNodes.length; i++) { - innerText += sorttable.getInnerText(node.childNodes[i]); - } - return innerText.replace(/^\s+|\s+$/g, ''); - break; - default: - return ''; - } - } - }, - - reverse: function(tbody) { - // reverse the rows in a tbody - newrows = []; - for (var i=0; i=0; i--) { - tbody.appendChild(newrows[i]); - } - delete newrows; - }, - - /* sort functions - each sort function takes two parameters, a and b - you are comparing a[0] and b[0] */ - sort_numeric: function(a,b) { - aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); - if (isNaN(aa)) aa = 0; - bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); - if (isNaN(bb)) bb = 0; - return aa-bb; - }, - sort_alpha: function(a,b) { - if (a[0]==b[0]) return 0; - if (a[0] 0 ) { - var q = list[i]; list[i] = list[i+1]; list[i+1] = q; - swap = true; - } - } // for - t--; - - if (!swap) break; - - for(var i = t; i > b; --i) { - if ( comp_func(list[i], list[i-1]) < 0 ) { - var q = list[i]; list[i] = list[i-1]; list[i-1] = q; - swap = true; - } - } // for - b++; - - } // while(swap) - } -} - -/* ****************************************************************** - Supporting functions: bundled here to avoid depending on a library - ****************************************************************** */ - -// Dean Edwards/Matthias Miller/John Resig - -/* for Mozilla/Opera9 */ -if (document.addEventListener) { - document.addEventListener("DOMContentLoaded", sorttable.init, false); -} - -/* for Internet Explorer */ -/*@cc_on @*/ -/*@if (@_win32) - document.write(""); - var script = document.getElementById("__ie_onload"); - script.onreadystatechange = function() { - if (this.readyState == "complete") { - sorttable.init(); // call the onload handler - } - }; -/*@end @*/ - -/* for Safari */ -if (/WebKit/i.test(navigator.userAgent)) { // sniff - var _timer = setInterval(function() { - if (/loaded|complete/.test(document.readyState)) { - sorttable.init(); // call the onload handler - } - }, 10); -} - -/* for other browsers */ -window.onload = sorttable.init; - -// written by Dean Edwards, 2005 -// with input from Tino Zijdel, Matthias Miller, Diego Perini - -// http://dean.edwards.name/weblog/2005/10/add-event/ - -function dean_addEvent(element, type, handler) { - if (element.addEventListener) { - element.addEventListener(type, handler, false); - } else { - // assign each event handler a unique ID - if (!handler.$$guid) handler.$$guid = dean_addEvent.guid++; - // create a hash table of event types for the element - if (!element.events) element.events = {}; - // create a hash table of event handlers for each element/event pair - var handlers = element.events[type]; - if (!handlers) { - handlers = element.events[type] = {}; - // store the existing event handler (if there is one) - if (element["on" + type]) { - handlers[0] = element["on" + type]; - } - } - // store the event handler in the hash table - handlers[handler.$$guid] = handler; - // assign a global event handler to do all the work - element["on" + type] = handleEvent; - } -}; -// a counter used to create unique IDs -dean_addEvent.guid = 1; - -function removeEvent(element, type, handler) { - if (element.removeEventListener) { - element.removeEventListener(type, handler, false); - } else { - // delete the event handler from the hash table - if (element.events && element.events[type]) { - delete element.events[type][handler.$$guid]; - } - } -}; - -function handleEvent(event) { - var returnValue = true; - // grab the event object (IE uses a global event object) - event = event || fixEvent(((this.ownerDocument || this.document || this).parentWindow || window).event); - // get a reference to the hash table of event handlers - var handlers = this.events[event.type]; - // execute each event handler - for (var i in handlers) { - this.$$handleEvent = handlers[i]; - if (this.$$handleEvent(event) === false) { - returnValue = false; - } - } - return returnValue; -}; - -function fixEvent(event) { - // add W3C standard event methods - event.preventDefault = fixEvent.preventDefault; - event.stopPropagation = fixEvent.stopPropagation; - return event; -}; -fixEvent.preventDefault = function() { - this.returnValue = false; -}; -fixEvent.stopPropagation = function() { - this.cancelBubble = true; -} - -// Dean's forEach: http://dean.edwards.name/base/forEach.js -/* - forEach, version 1.0 - Copyright 2006, Dean Edwards - License: http://www.opensource.org/licenses/mit-license.php -*/ - -// array-like enumeration -if (!Array.forEach) { // mozilla already supports this - Array.forEach = function(array, block, context) { - for (var i = 0; i < array.length; i++) { - block.call(context, array[i], i, array); - } - }; -} - -// generic enumeration -Function.prototype.forEach = function(object, block, context) { - for (var key in object) { - if (typeof this.prototype[key] == "undefined") { - block.call(context, object[key], key, object); - } - } -}; - -// character enumeration -String.forEach = function(string, block, context) { - Array.forEach(string.split(""), function(chr, index) { - block.call(context, chr, index, string); - }); -}; - -// globally resolve forEach enumeration -var forEach = function(object, block, context) { - if (object) { - var resolve = Object; // default - if (object instanceof Function) { - // functions have a "length" property - resolve = Function; - } else if (object.forEach instanceof Function) { - // the object implements a custom forEach method so use that - object.forEach(block, context); - return; - } else if (typeof object == "string") { - // the object is a string - resolve = String; - } else if (typeof object.length == "number") { - // the object is array-like - resolve = Array; - } - resolve.forEach(object, block, context); - } -}; diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/white.gif Binary file uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/data/branch_coverage/white.gif has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/eabi/vimpstcmdprocess_utestu.def --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/eabi/vimpstcmdprocess_utestu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -EXPORTS - _Z9LibEntryLv @ 1 NONAME - _Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME - _ZN11TCCAFactory13NewParameterLEv @ 3 NONAME - _ZN11TCCAFactory14NewConnectionLEv @ 4 NONAME - _ZN17CVIMPSTCmdHandler4NewLER13MVIMPSTEngine @ 5 NONAME - _ZN21CVPbkContactLinkArray15ResetAndDestroyEv @ 6 NONAME - _ZN21CVPbkContactLinkArray4NewLEv @ 7 NONAME - _ZN21CVPbkContactLinkArray5NewLCER11RReadStreamRK21MVPbkContactStoreList @ 8 NONAME - _ZN21CVPbkContactLinkArray5NewLCERK6TDesC8RK21MVPbkContactStoreList @ 9 NONAME - _ZN21CVPbkContactLinkArray5NewLCEv @ 10 NONAME - _ZN21CVPbkContactLinkArray5ResetEv @ 11 NONAME - _ZN21CVPbkContactLinkArray6DeleteEi @ 12 NONAME - _ZN21CVPbkContactLinkArray6RemoveEi @ 13 NONAME - _ZN21CVPbkContactLinkArray7AppendLEP16MVPbkContactLink @ 14 NONAME - _ZN21CVPbkContactLinkArray7InsertLEP16MVPbkContactLinki @ 15 NONAME - _ZN28CVIMPSTStorageManagerFactory15InitialiseViewLEmRK7TDesC16S2_ @ 16 NONAME - _ZN28CVIMPSTStorageManagerFactory18InitialiseLibraryLEv @ 17 NONAME - _ZN28CVIMPSTStorageManagerFactory19ItemModelInterfaceLEm @ 18 NONAME - _ZN28CVIMPSTStorageManagerFactory21ContactListInterfaceLEm @ 19 NONAME - _ZN28CVIMPSTStorageManagerFactory7ReleaseEv @ 20 NONAME - _ZNK21CVPbkContactLinkArray16PackedBufferSizeEv @ 21 NONAME - _ZTI17CVIMPSTCmdHandler @ 22 NONAME - _ZTI17MCCAParameterstub @ 23 NONAME - _ZTI17vimpstengine_stub @ 24 NONAME - _ZTI18MCCAConnectionStub @ 25 NONAME - _ZTI19CVIMPSTProcessArray @ 26 NONAME - _ZTI20CVPbkContactLinkStub @ 27 NONAME - _ZTI20searchextention_stub @ 28 NONAME - _ZTI21CVPbkContactLinkArray @ 29 NONAME - _ZTI22extentionfeatures_stub @ 30 NONAME - _ZTI22vimpstcmdobserver_stub @ 31 NONAME - _ZTI22vimpstserviceview_stub @ 32 NONAME - _ZTI23vimpststorecontact_stub @ 33 NONAME - _ZTI25CVIMPSTProcessContactItem @ 34 NONAME - _ZTI25CVIMPSTProcessOwnDataItem @ 35 NONAME - _ZTI25vimpststoragecontact_stub @ 36 NONAME - _ZTI26vimpststorageitemlist_stub @ 37 NONAME - _ZTI27vimpstprocessarrayitem_stub @ 38 NONAME - _ZTI29CVIMPSTProcessContactListItem @ 39 NONAME - _ZTI29vimpststoragecontactlist_stub @ 40 NONAME - _ZTI31CVIMPSTProcessFriendRequestItem @ 41 NONAME - _ZTI31vimpstprocessarrayobserver_stub @ 42 NONAME - _ZTI32CVIMPSTCmdProcessSelectedContact @ 43 NONAME - _ZTI32CVIMPSTProcessUnknownContactItem @ 44 NONAME - _ZTV17CVIMPSTCmdHandler @ 45 NONAME - _ZTV17MCCAParameterstub @ 46 NONAME - _ZTV17vimpstengine_stub @ 47 NONAME - _ZTV18MCCAConnectionStub @ 48 NONAME - _ZTV19CVIMPSTProcessArray @ 49 NONAME - _ZTV20CVPbkContactLinkStub @ 50 NONAME - _ZTV20searchextention_stub @ 51 NONAME - _ZTV21CVPbkContactLinkArray @ 52 NONAME - _ZTV22extentionfeatures_stub @ 53 NONAME - _ZTV22vimpstcmdobserver_stub @ 54 NONAME - _ZTV22vimpstserviceview_stub @ 55 NONAME - _ZTV23vimpststorecontact_stub @ 56 NONAME - _ZTV25CVIMPSTProcessContactItem @ 57 NONAME - _ZTV25CVIMPSTProcessOwnDataItem @ 58 NONAME - _ZTV25vimpststoragecontact_stub @ 59 NONAME - _ZTV26vimpststorageitemlist_stub @ 60 NONAME - _ZTV27vimpstprocessarrayitem_stub @ 61 NONAME - _ZTV29CVIMPSTProcessContactListItem @ 62 NONAME - _ZTV29vimpststoragecontactlist_stub @ 63 NONAME - _ZTV31CVIMPSTProcessFriendRequestItem @ 64 NONAME - _ZTV31vimpstprocessarrayobserver_stub @ 65 NONAME - _ZTV32CVIMPSTCmdProcessSelectedContact @ 66 NONAME - _ZTV32CVIMPSTProcessUnknownContactItem @ 67 NONAME - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/group/bld.inf --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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: -* -*/ - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these - - DEFAULT - -PRJ_TESTEXPORTS -// NOTE: If using ARS requirements all export operations should be done under this. -// 'abld test export' - -PRJ_EXPORTS -// Specify the source file followed by its destination here -// copy will be used to copy the source file to its destination -// If there's no destination then the source file will be copied - -// Example: - - -PRJ_TESTMMPFILES - - vimpstcmdprocess_utest.mmp - -PRJ_MMPFILES - - vimpstcmdprocess_utest_nrm.mmp - -// Specify the .mmp files required for building the important component -// releasables. -// -// Specify "tidy" if the component you need to build doesn't need to be -// released. Specify "ignore" if the MMP file exists but should be -// ignored. -// Example: - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/group/vimpstcmdprocess_utest.mmp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/group/vimpstcmdprocess_utest.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/*TYPE STIFUNIT*/ -/* -* 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: MMP file for STIF Test Framework's STIFUnit test module. -* -*/ - -#include - -TARGET vimpstcmdprocess_utest.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E7 - -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE vimpstcmdprocess_utest.def - -USERINCLUDE ../inc - -OS_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../src - -SOURCE vimpstcmdprocess_utest.cpp -SOURCE vimpstcmdprocess_utestCases.cpp - -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdaddcontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdaddtopbk.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdcancellogin.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdcca.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdchangeownavtar.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdchangeownmessage.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdchangeownstatus.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdcloseconversation.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmddeletecontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdfactory.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdhandler.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdlogin.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdlogout.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdprocessselectedcontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdsearch.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstprocessArray.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstprocessarrayitem.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstprocessfriendrequestitem.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimstcmdfriendrequest.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdunblockcontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdblockcontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdfetchblockedlist.cpp - - -SOURCE ../src/stub/s_CVPbkContactLinkArray.cpp -SOURCE ../src/stub/s_MVPbkContactLinkstub.cpp -SOURCE ../src/stub/s_ccafactory.cpp -SOURCE ../src/stub/s_engineextentionfeatures.cpp -SOURCE ../src/stub/s_enginesearchextention.cpp -SOURCE ../src/stub/s_imsubservice.cpp -SOURCE ../src/stub/s_mccaparameter.cpp -SOURCE ../src/stub/s_processarrayobserver.cpp -SOURCE ../src/stub/s_storageitemmodel.cpp -SOURCE ../src/stub/s_vimpstcmdobserver.cpp -SOURCE ../src/stub/s_vimpstengin.cpp -SOURCE ../src/stub/s_vimpstenginepresencesubservice.cpp -SOURCE ../src/stub/s_vimpstprocessarrayItem.cpp -SOURCE ../src/stub/s_vimpststoragecontact.cpp -SOURCE ../src/stub/s_vimpststoragecontactlist.cpp -SOURCE ../src/stub/s_vimpststoragemanagerfactory.cpp -SOURCE ../src/stub/s_vimpststorageserviceview.cpp -SOURCE ../src/stub/s_vimpststorecontact.cpp -SOURCE ../src/stub/s_mccaconnection.cpp - -//RESOURCE resource_file -//RESOURCE resource_file2 - -USERINCLUDE ../../../../../group -USERINCLUDE ../inc -USERINCLUDE ../../../../vimpstcmdprocess/inc -USERINCLUDE ../../../inc -USERINCLUDE ../../../../inc -USERINCLUDE ../../../../vimpstengine/inc -USERINCLUDE ../../../../vimpststorage/inc -USERINCLUDE ../../../../vimpstdetailsviewplugin/inc -USERINCLUDE ../../../../vimpstutils/inc - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/internal - -MW_LAYER_SYSTEMINCLUDE -APP_LAYER_SYSTEMINCLUDE -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY vimpstutils.lib -LIBRARY vimpststorage.lib -LIBRARY vimpstengine.lib -LIBRARY estor.lib -LIBRARY efsrv.lib -LIBRARY edbms.lib - -LIBRARY sysutil.lib - -LIBRARY cone.lib ecom.lib bafl.lib -LIBRARY eikcore.lib eikctl.lib eikcoctl.lib -LIBRARY avkon.lib aknnotify.lib -LIBRARY commonengine.lib - -// dependency to PbkGcServiceTab components -//LIBRARY serviceprovidersettings.lib - -// Dependencies to other Phonebook 2 components -LIBRARY VPbkEng.lib Pbk2Presentation.lib -LIBRARY Pbk2CommonUI.lib - -//CCA -LIBRARY ccaclient.lib - -LIBRARY aiwdialdata.lib - -LIBRARY ServiceHandler.lib -LIBRARY apgrfx.lib -LIBRARY flogger.lib -LIBRARY imcacheclient.lib - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/group/vimpstcmdprocess_utest.pkg --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/group/vimpstcmdprocess_utest.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -; -; 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: -; -; Installation file for STIF -; - -; Languages -&EN - -; Provide value for uid -#{"STIF"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 3.0 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None - -; Install files -"\epoc32\release\armv5\udeb\vimpstcmdprocess_utest.dll" - "!:\Sys\Bin\vimpstcmdprocess_utest.dll" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/group/vimpstcmdprocess_utest_nrm.mmp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/group/vimpstcmdprocess_utest_nrm.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ -/*TYPE STIFUNIT*/ -/* -* 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: MMP file for STIF Test Framework's STIFUnit test -* module. -* -*/ - -#include - -TARGET vimpstcmdprocess_utest.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E7 - -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE vimpstcmdprocess_utest.def - -USERINCLUDE ../inc - -OS_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../src - - -SOURCE vimpstcmdprocess_utest.cpp -SOURCE vimpstcmdprocess_utestCases.cpp - -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdaddcontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdaddtopbk.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdcancellogin.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdcca.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdchangeownavtar.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdchangeownmessage.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdchangeownstatus.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdcloseconversation.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmddeletecontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdfactory.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdhandler.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdlogin.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdlogout.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdprocessselectedcontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdsearch.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstprocessArray.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstprocessarrayitem.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstprocessfriendrequestitem.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimstcmdfriendrequest.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdunblockcontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdblockcontact.cpp -SOURCE ../../../../vimpstcmdprocess/src/cvimpstcmdfetchblockedlist.cpp - - -SOURCE ../src/stub/s_CVPbkContactLinkArray.cpp -SOURCE ../src/stub/s_MVPbkContactLinkstub.cpp -SOURCE ../src/stub/s_ccafactory.cpp -SOURCE ../src/stub/s_engineextentionfeatures.cpp -SOURCE ../src/stub/s_enginesearchextention.cpp -SOURCE ../src/stub/s_imsubservice.cpp -SOURCE ../src/stub/s_mccaparameter.cpp -SOURCE ../src/stub/s_processarrayobserver.cpp -SOURCE ../src/stub/s_storageitemmodel.cpp -SOURCE ../src/stub/s_vimpstcmdobserver.cpp -SOURCE ../src/stub/s_vimpstengin.cpp -SOURCE ../src/stub/s_vimpstenginepresencesubservice.cpp -SOURCE ../src/stub/s_vimpstprocessarrayItem.cpp -SOURCE ../src/stub/s_vimpststoragecontact.cpp -SOURCE ../src/stub/s_vimpststoragecontactlist.cpp -SOURCE ../src/stub/s_vimpststoragemanagerfactory.cpp -SOURCE ../src/stub/s_vimpststorageserviceview.cpp -SOURCE ../src/stub/s_vimpststorecontact.cpp -SOURCE ../src/stub/s_mccaconnection.cpp - -//RESOURCE resource_file -//RESOURCE resource_file2 - -USERINCLUDE ../../../../../group -USERINCLUDE ../inc -USERINCLUDE ../../../../vimpstcmdprocess/inc -USERINCLUDE ../../../inc -USERINCLUDE ../../../../inc -USERINCLUDE ../../../../vimpstengine/inc -USERINCLUDE ../../../../vimpststorage/inc -USERINCLUDE ../../../../vimpstdetailsviewplugin/inc -USERINCLUDE ../../../../vimpstutils/inc - -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/internal - -MW_LAYER_SYSTEMINCLUDE -APP_LAYER_SYSTEMINCLUDE -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY vimpstutils.lib -LIBRARY vimpststorage.lib -LIBRARY vimpstengine.lib -LIBRARY estor.lib -LIBRARY efsrv.lib -LIBRARY edbms.lib - -LIBRARY sysutil.lib - -LIBRARY cone.lib ecom.lib bafl.lib -LIBRARY eikcore.lib eikctl.lib eikcoctl.lib -LIBRARY avkon.lib aknnotify.lib -LIBRARY commonengine.lib - -// dependency to PbkGcServiceTab components -//LIBRARY serviceprovidersettings.lib - -// Dependencies to other Phonebook 2 components -LIBRARY VPbkEng.lib Pbk2Presentation.lib -LIBRARY Pbk2CommonUI.lib - -//CCA -LIBRARY ccaclient.lib - -LIBRARY aiwdialdata.lib - -LIBRARY ServiceHandler.lib -LIBRARY apgrfx.lib -LIBRARY flogger.lib -LIBRARY imcacheclient.lib - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_MVPbkContactLinkstub.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_MVPbkContactLinkstub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef CVPBKCONTACTLINKSTUB_H -#define CVPBKCONTACTLINKSTUB_H - -// INCLUDES -#include -#include - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook Contact link. - * An object that uniquely identifies a single Contact and its ContactStore. - */ -class CVPbkContactLinkStub : public MVPbkContactLink - { - public: // destructor - /** - * Destructor. - */ - - public: // interface - static MVPbkContactLink* NewL(); - /** - * Returns the contact store which this link belongs to. - * @return Contact store associated with this link. - */ - MVPbkContactStore& ContactStore() const ; - - /** - * Returns ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - * @param aOther Contact to check equality for. - * @return ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - */ - TBool IsSame(const MVPbkContactLink& aOther) const ; - - /** - * Checks if this link refers to the contact aContact. - * @param aContact Contact to check. - * @return ETrue if this link refers to aContact, EFalse otherwise. - */ - TBool RefersTo(const MVPbkBaseContact& aContact) const ; - - /** - * Returns persistent streaming interface for this object, or NULL - * if persistent streaming is not supported. - * @return Persistent streaming object or NULL if not supported. - */ - const MVPbkStreamable* Streamable() const ; - - /** - * Returns a packing interface for this link. - * @see CVPbkContactLinkArray - * @internal - * @return Link packing object. - */ - const MVPbkContactLinkPacking& Packing() const ; - - /** - * Returns a clone of this contact link. - * @return Contact link copy. - */ - MVPbkContactLink* CloneLC() const ; - - // INLINE FUNCTIONS - inline HBufC8* CVPbkContactLinkStub::PackLC() - { - - CVPbkContactLinkArray* array = CVPbkContactLinkArray::NewLC(); - MVPbkContactLink* clone = CloneLC(); - array->AppendL(clone); - CleanupStack::Pop(); // clone - HBufC8* packed = array->PackLC(); - CleanupStack::Pop(); // packed - CleanupStack::PopAndDestroy(); // array - CleanupStack::PushL(packed); - return packed; - } - - }; - - - -#endif // CVPBKCONTACTLINKSTUB_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_enginecontmgtextfeatures.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_enginecontmgtextfeatures.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "mvimpstenginecontactmgmtextention.h" - -class contactmanagementextention_stub : public MVIMPSTEngineContactMgmtExtention - { - public: - - static MVIMPSTEngineExtentionFeatures* NewL(); - - TVIMPSTEnums::FeatureSupport IsSupported() const ; - - /** - * SetSupported - * @param TVIMPSTEnums::FeatureSupport defined in tvimpstenums.h - */ - void SetSupported(TVIMPSTEnums::FeatureSupport aSupported ); - - - /** - * Type of the Extention Feature - * @return TVIMPSTEnums::ExtentionType defined in tvimpstenums.h - */ - TVIMPSTEnums::ExtentionType Type() const ; - - - TInt AddServerContactL(const TDesC& aContactList, - const TDesC& aUserId,const TDesC& aNickname ); - - - TInt DeleteServerContactL( const TDesC& aContactListId, - const TDesC& aUserId ) ; - - - - }; - -//end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_engineextentionfeatures.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_engineextentionfeatures.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ -#include "mvimpstenginecontactmgmtextention.h" - -class extentionfeatures_stub : public MVIMPSTEngineContactMgmtExtention - { - public: - - static MVIMPSTEngineExtentionFeatures* NewL(); - - TVIMPSTEnums::FeatureSupport IsSupported() const ; - - /** - * SetSupported - * @param TVIMPSTEnums::FeatureSupport defined in tvimpstenums.h - */ - void SetSupported(TVIMPSTEnums::FeatureSupport aSupported ); - - - /** - * Type of the Extention Feature - * @return TVIMPSTEnums::ExtentionType defined in tvimpstenums.h - */ - - TVIMPSTEnums::ExtentionType Type() const ; - -/* static MVIMPSTEngineContactMgmtExtention& Cast( - MVIMPSTEngineExtentionFeatures& aExtentionFeature); - - - static const MVIMPSTEngineContactMgmtExtention& Cast( - const MVIMPSTEngineExtentionFeatures& aExtentionFeature); -*/ - - TInt AddServerContactL(const TDesC& aContactList, - const TDesC& aUserId,const TDesC& aNickname ,TBool aWaitToComplete = ETrue); - - - TInt DeleteServerContactL( const TDesC& aContactListId, - const TDesC& aUserId ) ; - - - - }; - -//end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_enginesearchextention.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_enginesearchextention.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "mvimpstenginesearchmgrextention.h" - -class searchextention_stub : public MVIMPSTEngineSearchMgrExtention - { - public: - - static MVIMPSTEngineSearchMgrExtention* NewL(); - - TVIMPSTEnums::FeatureSupport IsSupported() const ; - - /** - * SetSupported - * @param TVIMPSTEnums::FeatureSupport defined in tvimpstenums.h - */ - void SetSupported(TVIMPSTEnums::FeatureSupport aSupported ); - - - /** - * Type of the Extention Feature - * @return TVIMPSTEnums::ExtentionType defined in tvimpstenums.h - */ - - TVIMPSTEnums::ExtentionType Type() const ; - - - /* static MVIMPSTEngineSearchMgrExtention& Cast( - MVIMPSTEngineExtentionFeatures& aExtentionFeature); - - static const MVIMPSTEngineSearchMgrExtention& Cast( - const MVIMPSTEngineExtentionFeatures& aExtentionFeature); */ - - - void RegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver) ; - - void UnRegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver ) ; - - TInt SearchContactsL( RArray& aKeyDataArray ) ; - - TInt SubscribeForSearchKeysL() ; - - - - }; - -//end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_imsubservice.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_imsubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ -#ifndef S_IMSUBSERVICE_CPP_ -#define S_IMSUBSERVICE_CPP_ - -// INCLUDES -#include -#include "tvimpstenums.h" - -//base - -#include "mvimpstenginesubservice.h" -#include "mvimpstengineimsubservice.h" - - -// FORWARD DECLARATIONS - -class MVIMPSTEngineIMSubServiceEventObserver; - - - - -//CLASS DECLARATION - -/** - * class handling im sub service - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineImSubService_Stub ): public CBase, - public MVIMPSTEngineIMSubService - { - //for testcases - - - public: // Two-phased constructors and destructor - /** - * Two-phased constructor. - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - static CVIMPSTEngineImSubService_Stub* NewL( ); - - /** - * Two-phased constructor. - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - static CVIMPSTEngineImSubService_Stub* NewLC(); - - /** - * Standard C++ destructor - */ - ~CVIMPSTEngineImSubService_Stub(); - - - public: //From MVIMPSTEngineSubService - - /** - * @see MVIMPSTEngineSubService - */ - TVIMPSTEnums::TVIMPSTRegistrationState SubServiceState() const; - - /** - * @see MVIMPSTEngineSubService - */ - TVIMPSTEnums::SubServiceType Type() const; - - - - public: //From MVIMPSTIMSubService - - /** - * @see MVIMPSTIMSubService - */ - void RegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver); - - /** - * @see MVIMPSTIMSubService - */ - void UnRegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver); - - /** - * @see MVIMPSTIMSubService - */ - TInt GetUnreadCountL(const TDesC& aSender); - - - /** - * @see MVIMPSTIMSubService - */ - TBool IsConversationExistL(const TDesC& aRecipientId) const ; - - /** - * @see MVIMPSTIMSubService - */ - void CloseConversationL( const TDesC& aContactId ); - - /** - * @see MVIMPSTIMSubService - */ - - RArray GetOpenChatListL(); - - - - -private: - /** - * Standard C++ constructor - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - CVIMPSTEngineImSubService_Stub( ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - private : - - - - - }; - - -#endif /* S_IMSUBSERVICE_CPP_ */ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_mccaconnection.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_mccaconnection.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_MCCACONNECTION_H_ -#define S_MCCACONNECTION_H_ - -#include - -class MCCAParameter; - -/** @file mccaconnection.h - * - * MCCAObserver is used to get notifications from CCA application. - * - * @lib ccaclient - * @since S60 v5.0 - */ - -class MCCAConnectionStub:public MCCAConnection - { - -public: - static MCCAConnection* MCCAConnectionStub::NewL(); - /** - * Destroy this entity - * - * @since S60 5.0 - */ - void Close() ; - - /** - * DEPRECATED - USE LaunchAppL() instead! - * Ownership of MCCAParameter is NOT transferred. - */ - void LaunchApplicationL( MCCAParameter& aParameter ) ; - - /** - * Launches CCA application with the given parameter. - * See above for example instructions. - * - * Ownership of MCCAParameter is transferred. - * - * Leaves KErrArgument if there is no contact data in the - * given parameter. - * Leaves KErrAlreadyExists if there is already CCApplication - * running simultaneously. - * - * @see MCCAParameter::SetContactDataL - * @since S60 5.0 - * @param aParameter to launch application - * @param aObserver to get notifications (see MCCAObserver) - */ - void LaunchAppL( - MCCAParameter& aParameter, - MCCAObserver* aObserver = NULL ) ; - }; - - - - - -#endif /* S_MCCACONNECTION_H_ */ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_mccaparameter.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_mccaparameter.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_MCCAPARAMETER_H_ -#define S_MCCAPARAMETER_H_ - - -#include -#include -#include -#include - -/** @file mccaparameter.h - * - * MCCAParameter class is used to store, control and define how the CCA application is launched - * with the contact specified data. - * - * Example usage of the API: - * @code - * MCCAParameter* aParameter = TCCAFactory::NewParameterL() - * aParameter->SetConnectionFlag(ENormal); - * aParameter->SetContactDataFlag(EContactId); - * aParameter->SetContactDataL(aString); - * - * aParameter->SetLaunchedViewUid(aUid); - * - * @endcode - * - * @lib ccaclient - * @since S60 v5.0 - */ -class MCCAParameterstub:public MCCAParameter - { - -public: - static MCCAParameter* MCCAParameterstub::NewL(); - /** - * Destroy this parameter entity and all its data. - * @since S60 5.0 - */ - void Close() ; - - /** - * Getter for the flags of connection. - * @since S60 5.0 - * @return the flags. - */ - MCCAParameter::TConnectionFlags ConnectionFlag() ; - - /** - * Getter for the contact data flags. - * @since S60 5.0 - * @return the flags. - */ - MCCAParameter::TContactDataFlags ContactDataFlag() ; - - /** - * Getter for the contact data. - * @leave KErrArgument if data not set. - * @since S60 5.0 - * @return the reference of contact data. - */ - HBufC& ContactDataL() ; - - /** - * Getter for the view uid. - * @since S60 5.0 - * @return the Uid. - */ - TUid LaunchedViewUid() ; - - /** - * Getter for the version. - * @since S60 5.0 - * @return the version. - */ - TInt32 Version() ; - - /** - * Setter for the flag of connection. - * - * @see TConnectionFlags - * @since S60 5.0 - * @param aFlags: flags of connection - */ - void - SetConnectionFlag(const MCCAParameter::TConnectionFlags aConnectionFlags) ; - - /** - * Setter for the contact data flag. - * - * @see TContactDataFlags - * @since S60 5.0 - * @param aFlags: flags of connection - */ - void - SetContactDataFlag(const MCCAParameter::TContactDataFlags aContactDataFlags) ; - - /** - * Setter for the contact data. - * If you are using TContactDataFlags::EContactLink, the MVPbkContactLink - * should be streamed with PackLC before given for this method. - * Ownership is NOT transferred. - * @see MVPbkContactLink from phonebook. - * @leave KErrNotFound if contact data flag is not - * set before calling this method. - * @see MCCAParameter::SetContactDataFlags - * @since S60 5.0 - * @param aContactData: given contact data. - */ - void SetContactDataL(const TDesC& aContactData) ; - - /** - * Setter for the launched view uid. Use this when there - * is need to get a particular view opened first on launch of CCA. - * If view uid is not set, CCA uses the default view. - * NOT IMPLEMENTED YET! - * @since S60 5.0 - * @param aContactData: given contact data. - */ - void SetLaunchedViewUid(const TUid aUid) ; - - /** - * Returns an extension point for this interface or NULL. - * @param aExtensionUid Uid of extension - * @return Extension point or NULL - */ - TAny* CcaParameterExtension( - TUid /*aExtensionUid*/ ) { return NULL; } - - }; - - -#endif /* S_MCCAPARAMETER_H_ */ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_processarrayobserver.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_processarrayobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_MVIMPSTPROCESSARRAYOBSERVER_H -#define S_MVIMPSTPROCESSARRAYOBSERVER_H - -#include "mvimpstprocessArrayobserver.h" - -// INCLUDES -#include -#include - - - -class vimpstprocessarrayobserver_stub : public MVIMPSTProcessArrayObserver - { - public : - static MVIMPSTProcessArrayObserver* NewL(); - void HandleAdditionL(TVIMPSTEnums::TItem type, - TInt aIndex); - - void HandleDeletionL(TVIMPSTEnums::TItem type, TInt aIndex); - void HandleAvatarChangeL( const TDesC& aUserId ); - }; - - - -#endif // MVIMPSTPROCESSARRAYOBSERVER_H - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_storageitemmodel.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_storageitemmodel.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ - -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_STORAGEITEMMODEL_H_ -#define S_STORAGEITEMMODEL_H_ - - -#include "mvimpststorageitemmodel.h" -class MVIMPSTStorageContact; -class MVIMPSTStorageContactList; -// INCLUDES -#include -#include - - - -class vimpststorageitemlist_stub : public MVIMPSTStorageItemModel - { - public: // New functions - - - static MVIMPSTStorageItemModel* NewL(); - /** - * @return TInt Count of items - */ - TInt Count() const; - - /** - * Returns List item at given index. - * @param aIndex - * @return SItem List item - */ - MVIMPSTStorageItemModel::SItem Item( TInt aIndex ) const; - - - /** - * Get index for contact. - * @param aContact. Contact item to be found. - * @return TInt Index of contact. If contact not found returns KErrNotFound - */ - TInt IndexOfContact( MVIMPSTStorageContact* aContact ) const; - - /** - * Get index for list - * @param aList. Contact item to be found. - * @param aIgnoreOwnItem. If ETrue own item is not taken into account - * when resolving index. - * @param aIgnoreEmptyLists If ETrue, empty lists are ignored. - * @return TInt Index of list. If list not found returns KErrNotFound - */ - TInt IndexOfList( MVIMPSTStorageContactList* aList, - TBool aIgnoreOwnItem = EFalse, - TBool aIgnoreEmptyLists = ETrue ) const; - - /** - * @see MDesCArray - */ - TInt MdcaCount() const; - - /** - * @see MDesCArray - */ - TPtrC MdcaPoint(TInt aIndex) const; - - - - - - - - }; - -#endif /* S_STORAGEITEMMODEL_H_ */ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpstcmdobserver.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpstcmdobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_VIMPSTCMDOBSERVER_H -#define S_VIMPSTCMDOBSERVER_H - -#include "mvimpstcmdobserver.h" - -// INCLUDES -#include -#include - - - -class vimpstcmdobserver_stub : public MVIMPSTCmdObserver - { - public : - void CommandFinishedL(const MVIMPSTCmd& aCommand ) ; - - void HandleCommandEventL(TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt aServiceError) ; - }; - -#endif // S_VIMPSTCMDOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpstengin.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpstengin.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,258 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "mvimpstengine.h" -#include "mvimpststoragecontactsobserver.h" -#include "mvimpstenginecchuieventobserver.h" - -class TVIMPSTEnums; -class MVIMPSTEngineExtentionFeatures; - -class vimpstengine_stub : public MVIMPSTEngine -{ -public: - - /** - * See MVIMPSTEngine - * - */ - TUint32 ServiceId() const ; - - - /** - * See MVIMPSTEngine - * - */ - TVIMPSTEnums::TVIMPSTRegistrationState ServiceState() const ; - - - /** - * See MVIMPSTEngine - * - */ - TInt GetBrandInfoL(TLanguage& aBrandLanguage, - TInt& aBrandVersion, TDes8& aBrandId) const ; - - - - /** - * See MVIMPSTEngine - * - */ - TBool IsSubServiceSupportedL(TVIMPSTEnums::SubServiceType aType) const ; - - - /** - * See MVIMPSTEngine - * - */ - TBool IsSubServiceEnabled(TVIMPSTEnums::SubServiceType aType) const ; - - /** - * See MVIMPSTEngine - * - */ - void ContactStoreIdL( - TDes& aContactStoreId ) const ; - - /** - * See MVIMPSTEngine - * - */ - const TDesC& ServiceName() const ; - - /* - * See MVIMPSTEngine - */ - TBool IsUnInstalled(); - /** - * See MVIMPSTEngine - * - */ - void RegisterServiceSessionObserverL - (MVIMPSTEngineServiceStateEventObserver* aObserver) ; - - /** - * See MVIMPSTEngine - * - */ - void UnRegisterServiceSessionObserver - (MVIMPSTEngineServiceStateEventObserver* aObserver) ; - - - /** - * See MVIMPSTEngine - * - */ - void IntializeStorageL() ; - - /** - * See MVIMPSTEngine - * - */ - void UnIntializeStorage() ; - - - /** - * See MVIMPSTEngine - * - */ - MVIMPSTEngineSubService* SubService(TVIMPSTEnums::SubServiceType aType) const; - - - /** - * See MVIMPSTEngine - * - */ - MVIMPSTEngineExtentionFeatures* ExtentionFeatures(TVIMPSTEnums::ExtentionType aType) const ; - - - - /** - * See MVIMPSTEngine - * - */ - HBufC* GetOwnUserIdFromCChOrStorageL() const; - - - - /** - * See MVIMPSTEngine - * - */ - TInt Login(); - - /** - * See MVIMPSTEngine - * - */ - void LogoutL(); - - /** - * See MVIMPSTEngine - * - */ - void DefaultDomainNameL( TDes& aDefaultDomainName ) const; - - /** - * See MVIMPSTEngine - * - */ - TInt ChangeConnectionL(); - /** - * See MVIMPSTEngine - * - * @return True if password is present in the settings else returns false - * - */ - TBool IsPasswordAvailableL(); - - /** - * See MVIMPSTEngine - * - */ - TBool IsBlockSupportedL(); - - /** - * See MVIMPSTEngine - * - */ - void DeleteDataBaseL(); - - /** - * See MVIMPSTEngine - * - */ - MVIMPSTEnginePresenceSubService* GetPreseceSubService(); - - /** - * See MVIMPSTEngine - * - */ - void FetchBlockedListL(); - - /** - * See MVIMPSTEngine - * - */ - void RegisterBlockedListObserver( - MVIMPSTEngineBlockedListFetchEventObserver* aOb); - - - /** - * See MVIMPSTEngine - * - */ - void SetOwnUserIdIfChangedL(const TDesC& aUserId ) ; - - - /** - * See MVIMPSTEngine - * - */ - void RetriveContextIfCChEnabledL() ; - - private: // From MVIMPSTEngineServiceConnectionEventObserver - /** - * See MVIMPSTEngineServiceConnectionEventObserver - */ - void HandleServceConnectionEventL(); - - private: - /** - * Returns a SubService is Supported or not - * Components intertested in knowing whether a SubService is Supported or not can use this API - * @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h - * @return TBool, ETrue if the SubService is Supported in this Service, else returns EFalse - */ - TBool IsSubServiceSupportedInternal(TVIMPSTEnums::SubServiceType aType) const ; - - public: - /** - * Called when all the contacts are fetched from the virtual store. - * - * @since s60 5.0 - */ - void HandleContactFetchedL(); - - public: // From MVIMPSTStorageContactsObserver - - - /** - * HandleChange: To handle the Chnage event from the MCAStoredContactsObserver - * @see MCAStoredContactsObserver - * @param aList: reference to the list at which a change has occured - * @param aContact: reference to the contact at which a change has occured - * @param aEventType: TVIMPSTEnums::TCAObserverEventType,type of change event that has occured - * @param aUserIdChanged, ETrue if userid has changed, else EFalse. - * @return void - */ - void HandleStorageChangeL( TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType, - MVIMPSTStorageContactList* aList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ); - - - //From MVIMPSTEngineCchUiEventObserver - /** - * Handles the change connection event from CCHUI - *@ return void - */ - void HandleChangeConnectionEventL(); - -}; - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpstenginepresencesubservice.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpstenginepresencesubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,296 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_VIMPSTENGINEPRESENCESUBSERVICE_H -#define S_VIMPSTENGINEPRESENCESUBSERVICE_H - -// INCLUDES -#include -#include "mvimpstenginepresencesubservice.h" -#include "mvimpstenginesubservice.h" - -//FORWARD DECLARATIONS - -class MVIMPSTEnginePresenceSubServiceEventObserver; -// CLASS DECLARATION -/** - * Presence sub service - * This class implements the presence subservice - * The problem in VOIP case would be that this "sip" must be hardcoded. Can this be avoided - * - * - * The Presence Information can be fetched either thro PresenceCache or - * thro XIMP's MPresentityPresenceEvent. So somehow we should be able to differentiate - * which service uses PresenceCache or XIMP's MPresentityPresenceEvent during the creation of this object - * One of the proposal could be is to use the CCH, if it could provide us this information or SP Settings - * - * All the Block/Friend Request/Presence information of a contact should be passed - * to the VIMPSTStorage which will update the list on the UI. - * - */ - - -NONSHARABLE_CLASS( CVIMPSTEnginePresenceSubService_Stub ): public CBase, - public MVIMPSTEnginePresenceSubService - - { - public: - - /** - * Two-phased constructor. - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - static CVIMPSTEnginePresenceSubService_Stub* NewL( ); - - /** - * Two-phased constructor. - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - static CVIMPSTEnginePresenceSubService_Stub* NewLC(); - - /** - * Standard C++ destructor - */ - ~CVIMPSTEnginePresenceSubService_Stub(); - - public: //From MVIMPSTSubService - - /** - * @return TVIMPSTRegistrationState Service State of this service - */ - TVIMPSTEnums::TVIMPSTRegistrationState SubServiceState() const; - - - TVIMPSTEnums::SubServiceType Type() const; - - - /** - * @see MVIMPSTSubService - */ - TBool Enabled(); - - - public: //From MVIMPSTEnginePresenceSubService - void FetchPresenceOfSingleContactL(const TDesC& aContact); - - void FetchPresenceOfSinleContactL(const TDesC& aUserId); - /** - * @see MVIMPSTEnginePresenceSubService - */ - void RegisterPresenceEventObserverL( - MVIMPSTEnginePresenceSubServiceEventObserver* aObserver); - - /** - * @see MVIMPSTEnginePresenceSubService - */ - void UnRegisterPresenceEventObserver( - MVIMPSTEnginePresenceSubServiceEventObserver* aObserver); - - /** - * Subsribes presence of a single contact - * Can be done for the contacts who are already subscribed(Required atleast in XMPP Case) - * This function can be used on FriendRequests also wherein it performs 2 operation - * 1. Accepts the invitation if Friend Request is Pending(GrantPresenceForPresentityL) - * 2. Subscribes for the presence either to PresenceCache - * or XIMP (MPresentityPresenceEvent) - * - * - * @since S60 5.0 - * @param aUriOfTheContact, Presence URI to be subscribed - */ - void SubscribePresenceOfSingleContactL( const TDesC& aUriOfTheContact ); - - - /** - * Unsubsribes presence of a single contact - * Used for those contact whose presence has been subscribed - * Can be used for Friend Requests also - * 1. Denies the invitation for the contact (WithdrawPresenceGrantFromPresentityL) - * 2. Sends a unsubscribe to PresenceCache - * or XIMP (UnsubscribePresentityPresenceL) - * - * @since S60 5.0 - * @param aUriOfTheContact, Presence URI to be subscribed - */ - void UnSubscribePresenceOfSingleContactL( const TDesC& aUriOfTheContact ); - - /** - * Fetches presence from presencecache. - * - * @since 5.0 - **/ - TInt FetchPresenceFromCache(); - - - /** - * Subscribe each contact. - * - * @since 5.0 - * @param aWVID id of the contact to be subscribed for. - */ - void SubscribeToPresenceCacheL(const TDesC& aWVID); - - /** - * UnSubscribe each contact. - * - * @since 5.0 - * @param aWVID id of the contact to be unsubscribed for. - */ - void UnSubscribeToPresenceCacheL(const TDesC& aWVID); - - /** - * Requests the XIMPFw to terminate presence - * grant request list subscription. - */ - void UnSubscribeForAuthorizationL(); - - /** - * Requests the XIMPFw to subscribe for presence - * grant request list subscription. - */ - void SubscribeForAuthorizationL(); - - /** - * sends PresenceGrantForPresentity response to server - * @param aContactId, id of the requesting party.. - * @param aResponse , Etrue if accpeted else rejected. - * @return TInt error if any - */ - TInt SendPresenceGrantPresentityL( const TDesC& aContactId , TBool aResponse ); - - /** - * IsChangeOwnStatusSupported by the protocol - * - * @since S60 5.0 - * @return TBool ETrue if supported else EFalse. - */ - TBool IsChangeOwnStatusSupported() ; - - /** - * IsStatusMsgSupported by the protocol - * - * @since S60 5.0 - * @return TBool ETrue if supported else EFalse. - */ - TBool IsStatusMsgSupported(); - - /** - * IsAvatarSupported by the protocol - * - * @since S60 5.0 - * @return TBool ETrue if supported else EFalse. - */ - TBool IsAvatarSupported() ; - - /** - * SetAvatarSupported by the protocol - * - * @since S60 5.0 - * @param aSupported, TBool ETrue if supported else EFalse. - */ - void SetAvatarSupported(TBool aSupported ) ; - - - /** - * PublishOwnPresenceL - * to update the ownstatus to server. - * and publishes the own status. - * - * @param aStatus ,status to be updated to the server. - * @param aValue , text for the status message - * @param aFilename , avatar file name - * @param aMimetype , a mime type - * @param aIsAvatar , a avatar field included - * @return TInt error if any - */ - TInt PublishOwnPresenceL(TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aValue, - const TDesC& aFilename = KNullDesC, - const TDesC8& aMimetype = KNullDesC8, - TBool aIsAvatar = EFalse ); - - - /** - * Removes URI from block list - * - * @since S60 5.0 - * @param aUriOfTheContact, URI to be removed - * @return error. - */ - TInt RemoveFromBlockListL( const TDesC& aUriOfTheContact ); - - /** - * Adds URI to block list - * - * @since S60 5.0 - * @param aUriOfTheContact, URI to be added - * @return error. - */ - TInt AddToBlockListL( const TDesC& aUriOfTheContact ); - /** - * Returns the blocked list. - * it returns the blocked list that it maintains locally in engine. - * @since S60 5.0 - * @return blocked list. - */ - RPointerArray* GetBlockedList(); - void FetchBlockedListFromServerL(MVIMPSTEngineBlockedListFetchEventObserver* aOb); - void UpdatePresenceStateL(); - void UnsubscribeListsL(); - - private: // Implementation - - /** - * Standard C++ constructor - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - CVIMPSTEnginePresenceSubService_Stub( ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - - private: // Data - - // Service identifier - TUint32 iServiceId; - - - }; - -#endif //S_VIMPSTENGINEPRESENCESUBSERVICE_H - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpstprocessarrayItem.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpstprocessarrayItem.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,154 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ -#include "cvimpstprocessarrayitem.h" - -class vimpstprocessarrayitem_stub: public MVIMPSTProcessArrayItem -{ - private: - - vimpstprocessarrayitem_stub(TDesC & aItemName); - - public: - - static MVIMPSTProcessArrayItem* NewL(TDesC & aItemName); - - - - TPtrC GetItemNameText() - { - return KNullDesC(); - } - - - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - - void SetConversationOpen(TBool aConvOpen ) - { - - } - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - TBool IsConversationOpen() - { - return EFalse; - } - /** - * Returns the default type of the listbox item - * @return TEnumsPC::TItem: type of the listbox item as either EContactitem, EContactListItem etc - */ - TVIMPSTEnums::TItem Type() ; - - /** - * Returns the name of the listbox item - * @return TPtrC: name of the listbox item to be displayed - */ - // TPtrC GetItemNameText() ; - - TBool IsMsgPending(); - void SetMsgPending(TBool aMsgPending); - - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - //virtual void SetItemNameText(const TDesC& aName) = 0; - - /** - * Returns the array index of the listbox item on engine/storage side - * @return TInt: index of the listbox item on engine/storage side - */ - TInt GetItemIndex() ; - - /** - * return the VPBK Contact Link - */ - MVPbkContactLink* ContactLink() ; - - - /** - * Sets the on engine/storage side index of the listbox item - * @param aIndex: index of the listbox item on engine/storage side - * @return void - */ - void SetItemIndex(TInt aIndex) ; - - /** - * Returns the user id of the listbox item - * @return TPtrC: user id of the listbox item. - */ - TPtrC GetItemUserId() ; - /** - * Returns the avatar index of the listbox item - * @return TInt: avatar index of the listbox item. - */ - TInt AvatarIndex() ; - - /** - * sets the avatar index of the listbox item - * @param aAvatarIndex: avatar index to be set - */ - void SetAvatarIndex(TInt aAvatarIndex ) ; - - /** - * returns status text of the contact - */ - const TDesC& StatusText() - { - - } - - /** - * returns online status of the contact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus() - { - - } - - - /** - * return formatted string needed for listbox for this item - */ - TPtrC16 FormattedItemString() - { - - } - - /** - * return formatted string needed for listbox for this item - */ - void DoFormatStringL() - { - - } - - private: - - TDesC& iItemName; - - }; - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststoragecontact.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststoragecontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_VIMPSTSTORAGECONTACT_H -#define S_VIMPSTSTORAGECONTACT_H - -#include "mvimpststoragecontact.h" - -// INCLUDES -#include -#include - -_LIT(KDummy,"dummy@presence"); - -class vimpststoragecontact_stub : public MVIMPSTStorageContact - { - public : - ~vimpststoragecontact_stub(); - - static MVIMPSTStorageContact* NewL(); - - /** - * @see MVIMPSTStorageContact - */ - void SetUserIdL( const TDesC& aUserId ); - - void SetAvatarContentL( const TDesC8& aAvatarContent , - MVIMPSTStorageVPbkContactStore& aVPPkStoreHandler) ; - //void SetAvatarContentL( const TDesC8& aAvatarContent ); - - /** - * Set User ID - * @param aUserId, user id to be set. - */ - void SetNameL( const TDesC& aName ) ; - - /** - * @see MVIMPSTStorageContact - */ - MVPbkContactLink* ContactLink() const; - - - /** - * @see MVIMPSTStorageContact - */ - const TDesC8& AvatarContent() const; - - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& UserId() const; - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& Name() const; - - - /** - * @see MVIMPSTStorageContact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus() const; - - - /** - * @see MVIMPSTStorageContact - */ - void SetOnlineStatus( - TVIMPSTEnums::TOnlineStatus aOnlineStatus ); - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& StatusText() const; - - /** - * @see MVIMPSTStorageContact - */ - void SetStatusTextL( const TDesC& aStatusText ); - - - void SetAvatarIndex(TInt aIndex ) ; - - - TInt AvatarIndex() const; - - private: - - /** - * C++ default constructor. - * @param aObserver contact data container observer - * @param aContactManager reference to virtual pbk manager - * @param aStoreContact pointer to the stored contact - * @param aContactManagementObserver - Notified of ContactOperation Add/Deleted - */ - //CVIMPSTStorageContact(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(const TDesC& aUserId, - const TDesC& aDisplayName, - const MVPbkContactLink& aContactLink - ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(const TDesC& aUserId, - const TDesC& aDisplayName ); - private: - RPointerArray iServiceDetailArray ; - TInt iAvatarIndex; - }; - -#endif // S_VIMPSTSTORECONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststoragecontactlist.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststoragecontactlist.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_VIMPSTSTORAGECONTACTLIST_H -#define S_VIMPSTSTORAGECONTACTLIST_H - -#include "mvimpststoragecontactlist.h" - -// INCLUDES -#include -#include - -class vimpststoragecontactlist_stub : public MVIMPSTStorageContactList - { - public: - - /** - * @see MVIMPSTStorageContactList - */ - const TDesC& ListId() const; - - /** - * @see MVIMPSTStorageContactList - */ - TPtrC DisplayName() const; - - /** - * @see MVIMPSTStorageContactList - */ - TInt Count() const; - - /** - * @see MVIMPSTContactList - */ - MVIMPSTStorageContact& operator[]( TInt aIndex ) const; - - /** - * @see MVIMPSTStorageContactList - */ - MVIMPSTStorageContact& FilteredContact( - TInt aIndex, TVIMPSTEnums::TFilterType aFilter ) const; - - /** - * @see MVIMPSTStorageContactList - */ - virtual TInt FilteredCount( - TVIMPSTEnums::TFilterType aFilter ) const; - - - /** - * @see MVIMPSTStorageContactList - */ - void Sort(); - - /** - * @see MVIMPSTStorageContactList - */ - void ResortContact( MVIMPSTStorageContact* aContact ); - - /** - * @see MVIMPSTStorageContactList - */ - TInt FindIndexOfContact( - const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter = - TVIMPSTEnums::EFilterAll ) const; - - /** - * @see MVIMPSTStorageContactList - */ - TBool FilterAllowsContact( const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter ) const; - public: // New functions - - MVIMPSTStorageContact* FindContact( const TDesC& aContactId ); - - - /** - * Find contact by MVPbkContactLink Contact Link VPBK. - * @param aContactLink. Contact Link to find. - * @return Pointer to found contact. NULL if not found. - */ - MVIMPSTStorageContact* FindContactByContactLink( const MVPbkContactLink& aContactLink ); - - - /** - * Remove contact from list - * @param aContactId. Id of contact to be removed. - */ - TInt RemoveContactFromCacheL( const TDesC& aContactId, TInt& index ); - - - /** - * Remove contact from list - * @param aContactLink. Contact Link of the item to be removed. - */ - TInt RemoveContactFromCacheL( const MVPbkContactLink& aContactLink, TInt& index ); - - /** - * add contact to list - * @param aContact. Contact item to be added. - * @param index of index - */ - TInt AddStorageContactToCacheL( MVIMPSTStorageContact* aContact, TInt& aIndex ); - - /** - * Count of contacts in list. Skipp all ofline contacts. - */ - TInt ContactCount( TBool aSkipOfflineContacts, - TBool aSkipBlocekedContacts ) const; - - /** - * Count of online items in list - * @return count of online contacts - */ - TInt OnlineCount() const; - - - /** - * Get online list item by index from list - * @param aIndex. Index of online item. - * @return Online contact in index. - */ - MVIMPSTStorageContact& OnlineContact( TInt aIndex ) const; - - - private: // Own methods - - /** - * Find Contact based on contact link - */ - TInt FindContactByLinkL( const MVPbkContactLink& aContactLink, - TInt& aIndexOrderedArray ) const; - - /** - * Gets the index of given aContact - */ - TInt FindContactEntry( const MVIMPSTStorageContact* aContact ) const; - - - TInt FindContactIndex( const TDesC& aContactId, - TInt& aOrderedIndex ) const; - - }; - -#endif // S_VIMPSTSTORAGECONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststoragemanagerfactory.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststoragemanagerfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_VIMPSTSTORAGEMANAGERFACTORY_H -#define S_VIMPSTSTORAGEMANAGERFACTORY_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class MVIMPSTStorageContacts; -class MVIMPSTStorageItemModel; - -// CLASS DECLARATION - -/** - * Factory to create contact and group list interfaces. - * @lib vimpststorage.lib - * @since S60 5.0 - */ -class CVIMPSTStorageManagerFactory : public CBase - { - public: // New functions - - /** - * Initialises the Library - */ - static void InitialiseLibraryL(); - - /** - * Release the resources allocated - */ - static TInt Release(); - - /** - * Inititalises the Store for the Service Id - * Must be called before using ContactListInterfaceL, - * ItemInterfaceL API's. - * @param aServiceId service id - * @param aStoreName storename for this service - * @param aServiceName ServiceName - */ - static void InitialiseViewL( TUint32 aServiceId, - const TDesC& aStoreName, - const TDesC& aServiceName) ; - - /** - * Returns the pointer to MVIMPSTStorageContacts - * this pointer can be used to perform numerous operations on - * contacts - * @param aServiceId service id - * @return MVIMPSTStorageServiceView* instance of the contact list interface - */ - static MVIMPSTStorageServiceView* ContactListInterfaceL(TUint32 aServiceId); - - /** - * Returns the pointer to MVIMPSTStorageItemModel - * this pointer can be used to perform numerous operations on - * contactlist - * @param aServiceId service id - * @return MVIMPSTStorageItemModel* interface to itemmodel - */ - static MVIMPSTStorageItemModel* ItemModelInterfaceL( TUint32 aServiceId ) ; - - }; - -#endif // CVIMPSTSTORAGEMANAGERFACTORY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststorageserviceview.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststorageserviceview.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_VIMPSTSTORAGESERVICEVIEW_H -#define S_VIMPSTSTORAGESERVICEVIEW_H - -#include "mvimpststorageserviceview.h" - -// INCLUDES -#include -#include - -class MVIMPSTStorageContact; - -class vimpstserviceview_stub : public MVIMPSTStorageServiceView - { - public : - static MVIMPSTStorageServiceView* NewL(); - void AddObserverL( MVIMPSTStorageContactsObserver* aObserver ) ; - - void RemoveObserver( MVIMPSTStorageContactsObserver* aObserver ); - - - MVIMPSTStorageContact* FindContactByUserId( const TDesC& aUserId ); - - - TInt ListCount() const; - - MVIMPSTStorageContactList& ListAt( TInt aIndex ) const ; - - - MVIMPSTStorageContactList* FindContactList( const TDesC& aListId ); - - MVIMPSTStorageContactList* CreateContactListL( const TDesC& aContactListId, - const TDesC& aDisplayName ) ; - - void RemoveContactList( const TDesC& aContactListId ); - - - TInt ContactCount(TBool aSkipOfflineContacts = EFalse ) const; - - - - MVIMPSTStorageContact* UpdatePresenceL(const TDesC& aContactId, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aStatusText, - const TDesC8& aAvatarData, - TBool aIsClearingAvatar = EFalse) ; - - MVIMPSTStorageContact* UpdateAvatarL(const TDesC& aContactId, - const TDesC8& aAvatarData ); - - MVIMPSTStorageContact* CreateNewContactL(const TDesC& aUserId, - const TDesC& aDisplayName = KNullDesC, - TBool aIsInvitationItem = EFalse , - TBool aInvitationAutoAccept = EFalse); - - TInt CreateNewContactFromRetrivedIdL( TInt aIndexToUse ); - - TInt DeleteNewContactFromRetrivedIdL( TInt aIndexToUse ); - - TInt RemoveContactL( MVIMPSTStorageContact* aContact ); - - - void CreateNewFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ); - - - TBool IsLocalStore() const; - - - TInt RetriveLinkXSPIdsL(const TDesC8& aContactPackLink ); - const TDesC& GetRetrieveXSPIdL(TInt aIndex ); - - MVIMPSTStorageContact* FindContactByLink(const MVPbkContactLink& aContactLink ); - - - void Sort( const TDesC& aContactListId = KNullDesC ); - - MVIMPSTStorageContact& OwnContactL() ; - - void DeleteDatabaseL() ; - - void SetOwnUserIdL(const TDesC& aUserId ) ; - - void SetUnnamedTextL(HBufC* aUnnamedText ); - RPointerArray< MVIMPSTStorageContactsObserver > iContactObservers; - - - }; - - - - -#endif // S_VIMPSTSTORAGESERVICEVIEW_H - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststorecontact.h --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/inc/s_vimpststorecontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#ifndef S_VIMPSTSTORECONTACT_H -#define S_VIMPSTSTORECONTACT_H - -#include "mvimpststoragecontact.h" - -// INCLUDES -#include -#include - -_LIT(KDummy,"dummy"); -class MVPbkStoreContact; -class MVPbkContactObserver; -class MVIMPSTContactOperationCompleteObserver; -class MVIMPSTStorageVPbkContactStore; - -class vimpststorecontact_stub : public MVIMPSTStorageContact - { - public : - - void SetNameL( const TDesC& aName ); - void SetAvatarContentL( const TDesC8& aAvatarContent , - MVIMPSTStorageVPbkContactStore& aVPPkStoreHandler); - - static MVIMPSTStorageContact* NewL(); - - const TDesC8& AvatarContent() const ; - - TInt AvatarIndex() const ; - - void SetAvatarIndex( TInt avatarIndex); - - const TDesC& UserId() const ; - - TVIMPSTEnums::TOnlineStatus OnlineStatus() const ; - - void SetOnlineStatus( TVIMPSTEnums::TOnlineStatus aOnlineStatus ) ; - - void SignalChanges() ; - - const TDesC& Name() const; - - void SignalAvatarChange() ; - - void SetUserIdL( const TDesC& aUserId ) ; - - const TDesC& StatusText() const ; - - void SetStatusTextL( const TDesC& aStatusText ) ; - - MVPbkContactLink* ContactLink() const; - - MVPbkStoreContact* VPbkStoreContact() const ; - - RPointerArray& ServiceDetails() ; - /** - * Get the impp field for the contact - * @return TDesC& reference to the impp field. - */ - const TDesC& ImppField(); - - void Commit(MVPbkContactObserver* aObserver = NULL, - MVIMPSTContactOperationCompleteObserver* aContactOperationObserver = NULL) ; - - void ResetAvatarContent() ; - - void SetContactOperationObserver( MVIMPSTContactOperationCompleteObserver* - aContactOperationObserver ); - - ~vimpststorecontact_stub(); - - HBufC* GetContactFieldDataLC( const TDesC& aDefaultDomain /*= KNullDesC */, - TInt aFieldResId /*= R_VPBK_FIELD_TYPE_IMPP*/); - - private: - RPointerArray iServiceDetailArray ; - }; - -#endif // S_VIMPSTSTORECONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_CVPbkContactLinkArray.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_CVPbkContactLinkArray.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - - -// INCLUDES -#include -/** - * Creates an empty link array. - * - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewL(){ return new (ELeave) CVPbkContactLinkArray; } - -/** - * Creates an empty link array. Leaves the created array object on - * the cleanup stack. - * - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC() -{ -CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; -CleanupStack::PushL(self); -return self; -} - -/** - * Creates a link array from a packed descriptor of links. - * - * @param aPackedLinks a buffer that was created using PackLC - * of MVPbkContactLinkArray or MVPbkContactLink - * @param aStoreList the list of stores that contain the - * stores that links belong. - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC( - const TDesC8& /*aPackedLinks*/, - const MVPbkContactStoreList& /*aStoreList*/) - { - CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; - CleanupStack::PushL(self); - return self; - } - -/** - * Creates a link array from a stream of links. - * - * @param aStream a stream of contact link that was created - * using MVPbkStreamable interface of - * MVPbkContactLink - * @param aStoreList the list of stores that contain the - * stores that links belong. - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC( - RReadStream& /*aStream*/, - const MVPbkContactStoreList& /*aStoreList*/) - { - CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; - CleanupStack::PushL(self); - return self; - } - -/** - * Creates a link array from a stream of links. Uses aLoader - * to find and load stores. - * aLoader must exist the life time of this object. - * - * @param aStream a stream of contact link that was created - * using MVPbkStreamable interface of - * MVPbkContactLink - * @param aLoader the contact store loader for internalization. - * @return A new instance of this class - */ - CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC( - RReadStream& /*aStream*/, - MVPbkContactStoreLoader& /*aLoader*/ ) - { - CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; - CleanupStack::PushL(self); - return self; - } - -/** - * Destructor. - */ -CVPbkContactLinkArray::~CVPbkContactLinkArray(){ } - - -/** - * Appends a link to this array. - * - * @param aLink the link object to append. This array takes ownership - * of the link if append is succesful. - * @pre aLink != NULL - * @post Array count is increased by one and the link is in the last - * element of the array. - */ -EXPORT_C void CVPbkContactLinkArray::AppendL(MVPbkContactLink* /*aLink*/){ } - -/** - * Inserts a link to this array. - * - * @param aLink the link object to insert. This array takes ownership - * of the link if insertion is succesful. - * @param aIndex position where to insert the link. - * @exception KErrNoMemory if out of memory. - * @pre aLink != NULL - * @pre aIndex >= 0 && aIndex <= Count() - * @post Array count is increased by one and the link is in the position - * marked by the aIndex element of the array. - */ -EXPORT_C void CVPbkContactLinkArray::InsertL(MVPbkContactLink* /*aLink*/, TInt /*aIndex*/){ } - -/** - * Removes a link at aIndex from this array. - * - * @pre aIndex >= 0 && aIndex <= Count() - * @post The array count is decreased by one. - */ -EXPORT_C void CVPbkContactLinkArray::Remove(TInt /*aIndex*/){ } - -/** - * Removes and deletes a link at aIndex from this array. - * - * @pre aIndex >= 0 && aIndex <= Count() - * @post The array count is decreased by one. - */ -EXPORT_C void CVPbkContactLinkArray::Delete(TInt /*aIndex*/){ } - -/** - * Resets the array and destroys the links - */ -EXPORT_C void CVPbkContactLinkArray::ResetAndDestroy(){ } - -/** - * Resets this array but doesn't destroy links - * - * @post Count() == 0 - */ -EXPORT_C void CVPbkContactLinkArray::Reset(){ } - -/** - * Returns the size of the packed link array - */ -EXPORT_C TInt CVPbkContactLinkArray::PackedBufferSize() const{ return 0; } - - -TInt CVPbkContactLinkArray::Count() const{ return 0; } -const MVPbkContactLink& CVPbkContactLinkArray::At(TInt /*aIndex*/) const - { - MVPbkContactLink* ret = NULL; - return *ret; - } - -TInt CVPbkContactLinkArray::Find(const MVPbkContactLink& /*aLink*/) const{ return 0; } -HBufC8* CVPbkContactLinkArray::PackLC() const -{ -_LIT8(KText,"Nutan@presence"); - - HBufC8* temp = HBufC8::NewLC( 32 ); - TPtr8 tempptr = temp->Des(); - tempptr.Zero(); - tempptr.Append( KText ); - - //CleanupStack::PushL( temp ); - return temp; -} -const MVPbkStreamable* CVPbkContactLinkArray::Streamable() const -{ -return NULL; -} - - -CVPbkContactLinkArray::CVPbkContactLinkArray(){ } -void CVPbkContactLinkArray::ConstructL(){ } -void CVPbkContactLinkArray::ConstructL(const TDesC8& /*aPackedLinks*/, - const MVPbkContactStoreList& /*aOperations*/){ } -void CVPbkContactLinkArray::ConstructL(RReadStream& /*aStream*/, - const MVPbkContactStoreList& /*aOperations*/){ } -TInt CVPbkContactLinkArray::DoCalculatePackedBufferSizeV2() const{ return 0; } -void CVPbkContactLinkArray::DoFillPackedBufferV2L(RWriteStream& /*aWriteStream*/) const{ } -void CVPbkContactLinkArray::InternalizeFromBufferL( RReadStream& /*aReadStream*/, - const MVPbkContactStoreList& /*aStoreList*/ ){ } -void CVPbkContactLinkArray::DoInternalizeFromBufferL( RReadStream& /*aReadStream*/, - const MVPbkContactStoreList& /*aStoreList*/){ } -void CVPbkContactLinkArray::DoInternalizeFromBufferV2L(RReadStream& /*aReadStream*/, - const MVPbkContactStoreList& /*aStoreList*/){ } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_MVPbkContactLinkstub.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_MVPbkContactLinkstub.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -// INCLUDES -#include "s_MVPbkContactLinkstub.h" - -MVPbkContactLink* CVPbkContactLinkStub::NewL() - { - MVPbkContactLink* list = new(ELeave)CVPbkContactLinkStub; - return list; - } - -/** - * Returns the contact store which this link belongs to. - * @return Contact store associated with this link. - */ -MVPbkContactStore& CVPbkContactLinkStub::ContactStore() const -{ -MVPbkContactStore* ret=NULL; -return *ret; -} - -/** - * Returns ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - * @param aOther Contact to check equality for. - * @return ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - */ -TBool CVPbkContactLinkStub::IsSame(const MVPbkContactLink& aOther) const -{ -if (this == &aOther) -return ETrue; - -return EFalse; -} - -/** - * Checks if this link refers to the contact aContact. - * @param aContact Contact to check. - * @return ETrue if this link refers to aContact, EFalse otherwise. - */ -TBool CVPbkContactLinkStub::RefersTo(const MVPbkBaseContact& /*aContact*/) const -{ -return ETrue; -} - -/** - * Returns persistent streaming interface for this object, or NULL - * if persistent streaming is not supported. - * @return Persistent streaming object or NULL if not supported. - */ -const MVPbkStreamable* CVPbkContactLinkStub::Streamable() const -{ -return NULL; -}; - -/** - * Returns a packing interface for this link. - * @see CVPbkContactLinkArray - * @internal - * @return Link packing object. - */ -const MVPbkContactLinkPacking& CVPbkContactLinkStub::Packing() const -{ -MVPbkContactLinkPacking* ret = NULL; -return *ret; -}; - -/** - * Returns a clone of this contact link. - * @return Contact link copy. - */ -MVPbkContactLink* CVPbkContactLinkStub::CloneLC() const -{ -MVPbkContactLink* link = CVPbkContactLinkStub::NewL(); - return link; -} - - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_ccafactory.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_ccafactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ -#include -#include "s_mccaparameter.h" - -class MCCAConnection; -class MCCAParameter; - - /** - * Create new CCA client parameter entity. - * Ownership is transferred. - * @since S60 5.0 - * @return MCCAParameter, ownership is transferred. - */ - EXPORT_C MCCAParameter* TCCAFactory::NewParameterL( ) - { - MCCAParameter* parameter = MCCAParameterstub::NewL(); - return parameter; - } - - /** - * Create new CCA client connection entity. - * Ownership is transferred. - * @since S60 5.0 - * @return MCCAConnection, ownership is transferred. - */ - EXPORT_C MCCAConnection* TCCAFactory::NewConnectionL( ) - { - } -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_engineextentionfeatures.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_engineextentionfeatures.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "s_engineextentionfeatures.h" -#include "tvimpstenums.h" - -MVIMPSTEngineExtentionFeatures* extentionfeatures_stub::NewL() -{ - MVIMPSTEngineExtentionFeatures * extFeature = new(ELeave) extentionfeatures_stub; - return extFeature ; -} - -TVIMPSTEnums::FeatureSupport extentionfeatures_stub::IsSupported() const -{ - return TVIMPSTEnums::ESupported; -} - -/** -* SetSupported -* @param TVIMPSTEnums::FeatureSupport defined in tvimpstenums.h -*/ -void extentionfeatures_stub::SetSupported(TVIMPSTEnums::FeatureSupport /*aSupported*/ ) -{ - -} - - -/** -* Type of the Extention Feature -* @return TVIMPSTEnums::ExtentionType defined in tvimpstenums.h -*/ - -TVIMPSTEnums::ExtentionType extentionfeatures_stub::Type() const -{ - return TVIMPSTEnums::EContactManagement; -} - -/* -MVIMPSTEngineContactMgmtExtention& extentionfeatures_stub::Cast( - MVIMPSTEngineExtentionFeatures& aExtentionFeature) -{ - __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EServerContactManagement, - User::Panic(KErrNotFound) ); - return static_cast(aExtentionFeature); -} - - -const MVIMPSTEngineContactMgmtExtention& extentionfeatures_stub::Cast( - const MVIMPSTEngineExtentionFeatures& aExtentionFeature) -{ - __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EServerContactManagement, - User::Panic(KErrNotFound) ); - return static_cast(aExtentionFeature); -} - */ - - -TInt extentionfeatures_stub::AddServerContactL(const TDesC& /*aContactList*/, - const TDesC& aUserId,const TDesC& /*aNickname*/,TBool /*aWaitToComplete */ ) -{ - return KErrNotFound; -} - - -TInt extentionfeatures_stub::DeleteServerContactL( const TDesC& /*aContactListId*/, - const TDesC& /*aUserId*/ ) -{ - return KErrNotFound; -} - - -//end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_enginesearchextention.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_enginesearchextention.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "s_enginesearchextention.h" -#include "tvimpstenums.h" - -MVIMPSTEngineSearchMgrExtention* searchextention_stub::NewL() -{ - MVIMPSTEngineSearchMgrExtention* extFeature = new(ELeave) searchextention_stub; - return extFeature ; -} - -TVIMPSTEnums::FeatureSupport searchextention_stub::IsSupported() const -{ - return TVIMPSTEnums::ESupported; -} - -/** -* SetSupported -* @param TVIMPSTEnums::FeatureSupport defined in tvimpstenums.h -*/ -void searchextention_stub::SetSupported(TVIMPSTEnums::FeatureSupport /*aSupported*/ ) -{ - -} - - -/** -* Type of the Extention Feature -* @return TVIMPSTEnums::ExtentionType defined in tvimpstenums.h -*/ - -TVIMPSTEnums::ExtentionType searchextention_stub::Type() const -{ - return TVIMPSTEnums::ESearch; -} - -void searchextention_stub::RegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* /*aObserver*/) -{ - -} - - -void searchextention_stub::UnRegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* /*aObserver*/ ) -{ - -} - -TInt searchextention_stub::SearchContactsL( RArray& /*aKeyDataArray*/ ) -{ - return 1; -} - -TInt searchextention_stub::SubscribeForSearchKeysL() -{ - return 1; -} - - -//end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_imsubservice.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_imsubservice.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -// INCLUDE FILES -#include "s_imsubservice.h" - -//Presence Observer -//#include "mvimpstenginepresencesubserviceeventobserver.h" - - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// CVIMPSTEnginePresenceSubService_Stub() -// --------------------------------------------------------------------------- -// -CVIMPSTEngineImSubService_Stub::CVIMPSTEngineImSubService_Stub( ) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::ConstructL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineImSubService_Stub::ConstructL() - { - - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::NewL() -// --------------------------------------------------------------------------- -// -CVIMPSTEngineImSubService_Stub* -CVIMPSTEngineImSubService_Stub::NewL( ) - { - CVIMPSTEngineImSubService_Stub* self = NewLC(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::NewLC() -// --------------------------------------------------------------------------- -// -CVIMPSTEngineImSubService_Stub* -CVIMPSTEngineImSubService_Stub::NewLC( ) - { - CVIMPSTEngineImSubService_Stub* self = - new (ELeave) CVIMPSTEngineImSubService_Stub( ); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// ~CVIMPSTEnginePresenceSubService_Stub() -// --------------------------------------------------------------------------- -// -CVIMPSTEngineImSubService_Stub::~CVIMPSTEngineImSubService_Stub() - { - - } - - -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEngineImSubService_Stub::SubServiceState() const - { - return TVIMPSTEnums::ESVCERegistered; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// Type() -// --------------------------------------------------------------------------- -// - -TVIMPSTEnums::SubServiceType CVIMPSTEngineImSubService_Stub::Type() const - { - return TVIMPSTEnums::EPresence; - } - - - - - - /** - * @see MVIMPSTIMSubService - */ - void CVIMPSTEngineImSubService_Stub::RegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver) - { - - } - - /** - * @see MVIMPSTIMSubService - */ - void CVIMPSTEngineImSubService_Stub::UnRegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver) - { - - } - - /** - * @see MVIMPSTIMSubService - */ - TInt CVIMPSTEngineImSubService_Stub::GetUnreadCountL(const TDesC& aSender) - { - return 0; - } - - - - /** - * @see MVIMPSTIMSubService - */ - TBool CVIMPSTEngineImSubService_Stub::IsConversationExistL(const TDesC& aRecipientId) const - { - if(aRecipientId.Length()) - return ETrue; - else - return EFalse; - } - - /** - * @see MVIMPSTIMSubService - */ - void CVIMPSTEngineImSubService_Stub::CloseConversationL( const TDesC& aContactId ) - { - - } - - /** - * @see MVIMPSTIMSubService - */ - - RArrayCVIMPSTEngineImSubService_Stub::GetOpenChatListL() - { - - RArray item; - return item; - } -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_mccaconnection.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_mccaconnection.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - - -#include "s_mccaconnection.h" - - -class MCCAParameter; -class MCCAObserver; - - -MCCAConnection* MCCAConnectionStub::NewL() - { - MCCAConnection* parameter = new(ELeave)MCCAConnectionStub; - return parameter; - } - -void MCCAConnectionStub::Close() - { - - } - /** - * DEPRECATED - USE LaunchAppL() instead! - * Ownership of MCCAParameter is NOT transferred. - */ - void MCCAConnectionStub::LaunchApplicationL( MCCAParameter& aParameter ) - { - - } - - - - void MCCAConnectionStub::LaunchAppL( - MCCAParameter& aParameter, - MCCAObserver* aObserver ) - { - - } - // End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_mccaparameter.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_mccaparameter.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "s_mccaparameter.h" - - -/** @file mccaparameter.h - * - * MCCAParameter class is used to store, control and define how the CCA application is launched - * with the contact specified data. - * - * Example usage of the API: - * @code - * MCCAParameter* aParameter = TCCAFactory::NewParameterL() - * aParameter->SetConnectionFlag(ENormal); - * aParameter->SetContactDataFlag(EContactId); - * aParameter->SetContactDataL(aString); - * - * aParameter->SetLaunchedViewUid(aUid); - * - * @endcode - * - * @lib ccaclient - * @since S60 v5.0 - */ -MCCAParameter* MCCAParameterstub::NewL() - { - MCCAParameter* parameter = new(ELeave)MCCAParameterstub; - return parameter; - } - - /** - * Getter for the flags of connection. - * @since S60 5.0 - * @return the flags. - */ - MCCAParameter::TConnectionFlags MCCAParameterstub::ConnectionFlag() - { - - } - - /** - * Getter for the contact data flags. - * @since S60 5.0 - * @return the flags. - */ - MCCAParameter::TContactDataFlags MCCAParameterstub::ContactDataFlag() - { - - } - - /** - * Getter for the contact data. - * @leave KErrArgument if data not set. - * @since S60 5.0 - * @return the reference of contact data. - */ - HBufC& MCCAParameterstub::ContactDataL() - { - - } - - /** - * Getter for the view uid. - * @since S60 5.0 - * @return the Uid. - */ - TUid MCCAParameterstub::LaunchedViewUid() - { - - } - - /** - * Getter for the version. - * @since S60 5.0 - * @return the version. - */ - TInt32 MCCAParameterstub::Version() - { - - } - - /** - * Setter for the flag of connection. - * - * @see TConnectionFlags - * @since S60 5.0 - * @param aFlags: flags of connection - */ - void MCCAParameterstub::SetConnectionFlag(const MCCAParameter::TConnectionFlags aConnectionFlags) - { - - } - - /** - * Setter for the contact data flag. - * - * @see TContactDataFlags - * @since S60 5.0 - * @param aFlags: flags of connection - */ - void MCCAParameterstub::SetContactDataFlag(const MCCAParameter::TContactDataFlags aContactDataFlags) - { - } - - /** - * Setter for the contact data. - * If you are using TContactDataFlags::EContactLink, the MVPbkContactLink - * should be streamed with PackLC before given for this method. - * Ownership is NOT transferred. - * @see MVPbkContactLink from phonebook. - * @leave KErrNotFound if contact data flag is not - * set before calling this method. - * @see MCCAParameter::SetContactDataFlags - * @since S60 5.0 - * @param aContactData: given contact data. - */ - void MCCAParameterstub::SetContactDataL(const TDesC& aContactData) - { - } - - /** - * Setter for the launched view uid. Use this when there - * is need to get a particular view opened first on launch of CCA. - * If view uid is not set, CCA uses the default view. - * NOT IMPLEMENTED YET! - * @since S60 5.0 - * @param aContactData: given contact data. - */ - void MCCAParameterstub::SetLaunchedViewUid(const TUid aUid) - { - - } - - void MCCAParameterstub::Close() - { - - } - - - // End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_processarrayobserver.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_processarrayobserver.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "s_processarrayobserver.h" - -MVIMPSTProcessArrayObserver* vimpstprocessarrayobserver_stub::NewL() - { - MVIMPSTProcessArrayObserver* ob = new(ELeave)vimpstprocessarrayobserver_stub; - return ob; - } - -void vimpstprocessarrayobserver_stub::HandleAdditionL(TVIMPSTEnums::TItem type, TInt aIndex) -{ - -} - -void vimpstprocessarrayobserver_stub::HandleDeletionL(TVIMPSTEnums::TItem type, TInt aIndex) -{ - -} -void vimpstprocessarrayobserver_stub:: HandleAvatarChangeL( const TDesC& aUserId ) -{ - -} - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_storageitemmodel.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_storageitemmodel.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -// INCLUDE FILES -#include "s_storageitemmodel.h" -#include "s_vimpststoragecontact.h" - - -// ============================ MEMBER FUNCTIONS =============================== - - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageItemModel* vimpststorageitemlist_stub::NewL() - { - MVIMPSTStorageItemModel* list = new(ELeave)vimpststorageitemlist_stub; - return list; - } - - - -TInt vimpststorageitemlist_stub::Count() const -{ -return 1; -} - - /** - * Returns List item at given index. - * @param aIndex - * @return SItem List item - - */ -MVIMPSTStorageItemModel::SItem vimpststorageitemlist_stub::Item( TInt aIndex ) const -{ -MVIMPSTStorageItemModel::SItem item; -item.iType = MVIMPSTStorageItemModel::EContactItem; -item.iContactList = NULL; -item.iContact = vimpststoragecontact_stub::NewL(); -return item; -} - - - /** - * Get index for contact. - * @param aContact. Contact item to be found. - * @return TInt Index of contact. If contact not found returns KErrNotFound - */ - TInt vimpststorageitemlist_stub::IndexOfContact( MVIMPSTStorageContact* aContact ) const - { - return 1; - } - - /** - * Get index for list - * @param aList. Contact item to be found. - * @param aIgnoreOwnItem. If ETrue own item is not taken into account - * when resolving index. - * @param aIgnoreEmptyLists If ETrue, empty lists are ignored. - * @return TInt Index of list. If list not found returns KErrNotFound - */ - TInt vimpststorageitemlist_stub::IndexOfList( MVIMPSTStorageContactList* aList, - TBool aIgnoreOwnItem , - TBool aIgnoreEmptyLists ) const - { - return 1; - } - - // ----------------------------------------------------------------------------- - // CVIMPSTContactListModel::MdcaCount - // (other items were commented in a header). - // ----------------------------------------------------------------------------- - // - TInt vimpststorageitemlist_stub::MdcaCount() const - { - - return Count(); - } - - // ----------------------------------------------------------------------------- - // CVIMPSTContactListModel::MdcaPoint - // (other items were commented in a header). - // ----------------------------------------------------------------------------- - // - TPtrC vimpststorageitemlist_stub::MdcaPoint( TInt /*aIndex */) const - { - - // These will be filtered out - return KNullDesC(); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpstcmdobserver.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpstcmdobserver.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "s_vimpstcmdobserver.h" -#include "mvimpstcmd.h" - -void vimpstcmdobserver_stub::CommandFinishedL(const MVIMPSTCmd& aCommand ) -{ -TInt res = aCommand.Result(); -} - -void vimpstcmdobserver_stub::HandleCommandEventL(TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt aServiceError) -{ - -} - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpstengin.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpstengin.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,382 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "s_vimpstengin.h" -//#include "s_enginecontmgtextfeatures.h" -#include "s_enginesearchextention.h" -#include "s_vimpstenginepresencesubservice.h" -#include "s_imsubservice.h" -#include "tvimpstenums.h" -#include "s_engineextentionfeatures.h" - -/* -*/ -/*MVIMPSTEngine& vimpstengine_stub::NewL() -{ - return new vimpstengine_stub; -}*/ - -/** -* Gets the Brand Information for the current service -* @param aBrandLanguage - Holds the BrandLanguage -* @param aBrandVersion - Holds the Version to be used -* @param aBrandId - Holds the brandId -* caller should allocate memory for all params and send the same to this API -* The result will be available in the InParams otself. -* @return TInt Error code -*/ -TInt vimpstengine_stub::GetBrandInfoL(TLanguage& /*aBrandLanguage*/, - TInt& /*aBrandVersion*/, TDes8& /*aBrandId*/) const - { - return 1; - } - -/** -* Returns the Service State - Cumulative Service State of the SubServices -* @return TVIMPSTRegistrationState, current service state. -*/ -TVIMPSTEnums::TVIMPSTRegistrationState vimpstengine_stub::ServiceState() const - { - TVIMPSTEnums::TVIMPSTRegistrationState state = TVIMPSTEnums::ESVCERegistered; - return state; - } - - -/** -* Gets the Service Id -* @return TUint32 Service Id -*/ -TUint32 vimpstengine_stub::ServiceId() const -{ -return 1; - -} - - - - - - - -/** -* Returns a SubService is Supported or not -* Components intertested in knowing whether a SubService is Supported or not can use this API -* @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h -* @return TBool, ETrue if the SubService is Supported in this Service, else returns EFalse -*/ -TBool vimpstengine_stub::IsSubServiceSupportedL(TVIMPSTEnums::SubServiceType /*aType*/) const - { - return ETrue; - } - - -/** -* Returns TBool whether a SubService is Enabled or not -* Components intertested in knowing whether a SubService is Enabled or not can use this API -* @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h -* @return TBool, ETrue if the SubService is Enabled in this Service, else returns EFalse -*/ -TBool vimpstengine_stub::IsSubServiceEnabled(TVIMPSTEnums::SubServiceType /*aType*/) const -{ - return ETrue; -} - -/** -* Gets the StoreName for given service -* @param aContactStoreId, Virtual store id. -* The caller of the this function has to assign required memory for aContactStoreId -* aContactStoreId will be filled with the Virtual Store Id by this API -*/ -void vimpstengine_stub::ContactStoreIdL( - TDes& /*aContactStoreId*/ ) const -{ - -} - -/** -* returns the Service Name -* @return TDesC&, reference to service name. Ownership is not transferred. -*/ -const TDesC& vimpstengine_stub::ServiceName() const -{ - return KNullDesC; -} - - -/** -* Register Session Observer. -* @aObserver, observer ot be registered. -*/ -void vimpstengine_stub::RegisterServiceSessionObserverL - (MVIMPSTEngineServiceStateEventObserver* /*aObserver*/) -{ - -} - -/** -* UnRegisters Session Observer -* @aObserver, observer ot be Unregistered. -*/ -void vimpstengine_stub::UnRegisterServiceSessionObserver - (MVIMPSTEngineServiceStateEventObserver* /*aObserver*/) -{ - -} - - -/** -* intialize storage -*/ -void vimpstengine_stub::IntializeStorageL() -{ - -} - -/** -* unintialize storage -*/ -void vimpstengine_stub::UnIntializeStorage() -{ - -} - - -/** -* Get the Ptr to the SubService given the Type of the SubService -* This API returns a Generalised SubService Class MVIMPSTEngineSubService -* Ownership of the SubService is not Transferred to the Caller -* The Caller can use this (MVIMPSTEngineSubService*) ptr to typecast to appropriate SubService Interface -* Usage : MVIMPSTEngineIMSubService* imSubService = -* dynamic_cast -* (iEngine.SubService(TVIMPSTEnums::EIM)); -* -* if(imSubService) -* { -* imSubService->CloseConversationL( iContactId ); -* } -* @param aType - SubService Type (TVIMPSTEnums::SubServiceType) defined in tvimpstenums.h -* @return - Ptr to the SubService - Value can even be NULL -*/ -MVIMPSTEngineSubService* vimpstengine_stub::SubService(TVIMPSTEnums::SubServiceType aType) const -{ -MVIMPSTEngineSubService* subservice = NULL; -switch(aType) - { - case TVIMPSTEnums::EPresence: - { - TRAP_IGNORE(subservice = CVIMPSTEnginePresenceSubService_Stub::NewL()); - return subservice ; - break; - } - /* case TVIMPSTEnums::EIM: - { - TRAP_IGNORE(subservice = CVIMPSTEngineImSubService_Stub::NewL()); - return subservice ; - break; - }*/ - - default: - break; - } - return subservice; -} - - -/** -*/ -MVIMPSTEngineExtentionFeatures* vimpstengine_stub::ExtentionFeatures(TVIMPSTEnums::ExtentionType aType) const -{ - MVIMPSTEngineExtentionFeatures* extFeature = NULL; - switch(aType) - { - case TVIMPSTEnums::EContactManagement: - { - TRAP_IGNORE(extFeature = extentionfeatures_stub::NewL()); - return extFeature ; - break; - } - case TVIMPSTEnums::ESearch: - { - TRAP_IGNORE(extFeature = searchextention_stub::NewL()); - return extFeature ; - break; - } - } - - return extFeature; -} - -/** -* Sets the User Name for the Service -* Stores the username to CCH Plugin -* -void vimpstengine_stub::SetUserNameL(const TDesC& /*aUserid) -{ - -} -*/ -/** -* Sets the Password for the Service -* Stores the Password to CCH Plugin -* @param Password, Password to be stored. -* -void vimpstengine_stub::SetPassword(const TDesC& /*aPassword) -{ - -} - - -/** -* gets the UserName for the Service -* @return HBufC* - Ownership is transferred to the caller -* This API allocates memory for the UserName and transfers the Ownership to the Caller -* -HBufC* vimpstengine_stub::UserNameL() const -{ -_LIT(KText,"Nutan@presence"); - HBufC* buf = HBufC::NewL(20); - - *buf = KText; - - return buf; -} - -/** -* gets the Password for the Service -* @return HBufC* - Ownership is transferred to the caller -* This API allocates memory for the Password and transfers the Ownership to the Caller -* -HBufC* vimpstengine_stub::PasswordL() const -{ - return NULL; -} -*/ -/** -* API used to login to the Service -*/ -TInt vimpstengine_stub::Login() -{ - return 1; -} - -/** -* API used to Logout to the Service -*/ -void vimpstengine_stub::LogoutL() -{ - -} - - -/** -* Gets the default domain name for given service -* @param aDefaultDomainName, Domain Name. -* The caller of the this function has to assign required memory for aDefaultDomainName -* aDefaultDomainName will be filled with the deafault domain name by this API -*/ -void vimpstengine_stub::DefaultDomainNameL( TDes& /*aDefaultDomainName */) const -{ - -} -/** - * IsBlockSupportedL - * @returns ETrue if block/unblock is supported - * else EFalse - */ -TBool vimpstengine_stub::IsBlockSupportedL() -{ - return ETrue; -} - -TInt vimpstengine_stub::ChangeConnectionL() -{ - return 1; -} -/** -* See MVIMPSTEngine -* -* @return True if password is present in the settings else returns false -* -*/ -TBool vimpstengine_stub::IsPasswordAvailableL() -{ -return ETrue; -} - - -/** - * Inform storage that data base need to be deleted. - */ - void vimpstengine_stub::DeleteDataBaseL() - { - - } - /*---------------------------------------------------------- - * vimpstengine_stub::GetPreseceSubService - *-----------------------------------------------------------*/ - MVIMPSTEnginePresenceSubService* vimpstengine_stub::GetPreseceSubService() - { - MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence); - if (subService) - { - //Get Presence SubService - MVIMPSTEnginePresenceSubService& presenceSubService = - MVIMPSTEnginePresenceSubService::Cast(*subService); - return &presenceSubService ; - } - return NULL; - } - /*---------------------------------------------------------- - * vimpstengine_stub::FetchBlockedListL - *-----------------------------------------------------------*/ - - void vimpstengine_stub::FetchBlockedListL() - { - - } - /*---------------------------------------------------------- - * vimpstengine_stub::RegisterBlockedListObserver - *-----------------------------------------------------------*/ - - void vimpstengine_stub::RegisterBlockedListObserver( - MVIMPSTEngineBlockedListFetchEventObserver* aOb) - { - - } - - HBufC* vimpstengine_stub::GetOwnUserIdFromCChOrStorageL() const - { - HBufC* temp = NULL; - return temp; - } - - void vimpstengine_stub::RetriveContextIfCChEnabledL() - { - - } - void vimpstengine_stub::SetOwnUserIdIfChangedL(const TDesC& aUserId ) - { - - } - - TBool vimpstengine_stub::IsUnInstalled() - { - return EFalse; - } - - -//end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpstenginepresencesubservice.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpstenginepresencesubservice.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,348 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -// INCLUDE FILES -#include "s_vimpstenginepresencesubservice.h" -//Presence Observer -//#include "mvimpstenginepresencesubserviceeventobserver.h" - -// CONTANTS -const TInt KUriMaxLength = 255; -_LIT( KListNameAllBuddy ,"buddylist" ); - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// CVIMPSTEnginePresenceSubService_Stub() -// --------------------------------------------------------------------------- -// -CVIMPSTEnginePresenceSubService_Stub::CVIMPSTEnginePresenceSubService_Stub( ) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::ConstructL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService_Stub::ConstructL() - { - - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::NewL() -// --------------------------------------------------------------------------- -// -CVIMPSTEnginePresenceSubService_Stub* -CVIMPSTEnginePresenceSubService_Stub::NewL( ) - { - CVIMPSTEnginePresenceSubService_Stub* self = NewLC(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::NewLC() -// --------------------------------------------------------------------------- -// -CVIMPSTEnginePresenceSubService_Stub* -CVIMPSTEnginePresenceSubService_Stub::NewLC( ) - { - CVIMPSTEnginePresenceSubService_Stub* self = - new (ELeave) CVIMPSTEnginePresenceSubService_Stub( ); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// ~CVIMPSTEnginePresenceSubService_Stub() -// --------------------------------------------------------------------------- -// -CVIMPSTEnginePresenceSubService_Stub::~CVIMPSTEnginePresenceSubService_Stub() - { - - } - - - void CVIMPSTEnginePresenceSubService_Stub::FetchPresenceOfSingleContactL(const TDesC& aContact) - { - - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// ServiceState() -// --------------------------------------------------------------------------- -// - -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEnginePresenceSubService_Stub::SubServiceState() const - { - return TVIMPSTEnums::ESVCERegistered; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// Type() -// --------------------------------------------------------------------------- -// - -TVIMPSTEnums::SubServiceType CVIMPSTEnginePresenceSubService_Stub::Type() const - { - return TVIMPSTEnums::EPresence; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// Enabled() -// --------------------------------------------------------------------------- -// - -TBool CVIMPSTEnginePresenceSubService_Stub::Enabled() - { - return ETrue; - } - - - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::SubscribePresenceOfSingleContactL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService_Stub::SubscribePresenceOfSingleContactL( const TDesC& /*aUriOfTheContact*/) - { - - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// UnsubscribePrecenseOfSingleContactL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService_Stub::UnSubscribePresenceOfSingleContactL( - const TDesC& /*aUriOfTheContact */) - { - - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::PublishOwnPresenceL -// -// --------------------------------------------------------- -TInt CVIMPSTEnginePresenceSubService_Stub::PublishOwnPresenceL(TVIMPSTEnums::TOnlineStatus /*aStatus*/, - const TDesC& /*aValue*/, - const TDesC& /*aFilename= KNullDesC*/, - const TDesC8& /*aMimetype = KNullDesC8*/, - TBool /*aIsAvatar = EFalse*/ ) - { - return KErrNone; - } - - -/// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::FetchPresenceFormCache -// -// --------------------------------------------------------- -TInt CVIMPSTEnginePresenceSubService_Stub::FetchPresenceFromCache() - { - - return KErrNone; - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::SubscribeToPresenceCacheL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService_Stub::SubscribeToPresenceCacheL(const TDesC& /*aUserId*/ ) - { - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::UnSubscribeToPresenceCacheL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService_Stub::UnSubscribeToPresenceCacheL(const TDesC& /*aWVID*/) - { - - } - - - - - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::UnSubscribeForAuthorizationL -// -// --------------------------------------------------------- -void CVIMPSTEnginePresenceSubService_Stub::UnSubscribeForAuthorizationL() - { - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::SubscribeForAuthorizationL -// -// --------------------------------------------------------- -void CVIMPSTEnginePresenceSubService_Stub::SubscribeForAuthorizationL() - { - } -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::SendPresenceGrantPresentityResponseL -// -// --------------------------------------------------------- -TInt CVIMPSTEnginePresenceSubService_Stub::SendPresenceGrantPresentityL( const TDesC& /*aContactId*/ , TBool /*aResponse*/ ) - { - return KErrNone; - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::IsChangeOwnStatusSupported -// -// --------------------------------------------------------- - -TBool CVIMPSTEnginePresenceSubService_Stub::IsChangeOwnStatusSupported() - { - //TODO:: get the feature supported from ximp and return - return ETrue; - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::IsStatusMsgSupported -// -// --------------------------------------------------------- -TBool CVIMPSTEnginePresenceSubService_Stub::IsStatusMsgSupported() - { - //TODO:: get the feature supported from ximp and return - return ETrue; - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::IsAvatarSupported -// -// --------------------------------------------------------- -TBool CVIMPSTEnginePresenceSubService_Stub::IsAvatarSupported() - { - return EFalse; - } - - // --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::SetAvatarSupported -// -// --------------------------------------------------------- -void CVIMPSTEnginePresenceSubService_Stub::SetAvatarSupported(TBool /*aSupported*/ ) - { - - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::RegisterPresenceEventObserver -// -// --------------------------------------------------------- -//TODO::Should be named as RegisterPresenceEventObserverL -void CVIMPSTEnginePresenceSubService_Stub::RegisterPresenceEventObserverL( - MVIMPSTEnginePresenceSubServiceEventObserver* /*aObserver*/) - { - - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::UnRegisterPresenceEventObserver -// -// --------------------------------------------------------- - -void CVIMPSTEnginePresenceSubService_Stub::UnRegisterPresenceEventObserver( - MVIMPSTEnginePresenceSubServiceEventObserver* /*aObserver*/) - { - - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::AddToBlockListL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEnginePresenceSubService_Stub::AddToBlockListL( const TDesC& aUriOfTheContact ) - { - TInt err = KErrNotFound; - _LIT(KAt, "@"); - TInt loc = aUriOfTheContact.Find(KAt()); - if( 0 == aUriOfTheContact.Length()) - return KErrNotFound; - - else if(KErrNotFound == loc ) - return KErrNotFound; - else - err = KErrNone; - return err; - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::GetBlockedList -// --------------------------------------------------------------------------- -// -RPointerArray* CVIMPSTEnginePresenceSubService_Stub::GetBlockedList() - { - RPointerArray *blockedlist = new (ELeave) RPointerArray; - - _LIT(KText,"blocked@presence"); - HBufC* buddyId = HBufC::NewL(32); - CleanupStack::PushL(buddyId); - *buddyId = KText; - blockedlist->Append(buddyId); - - CleanupStack::Pop(); - - return blockedlist; - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::FetchBlockedListFromServerL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService_Stub::FetchBlockedListFromServerL(MVIMPSTEngineBlockedListFetchEventObserver* aOb) - { - - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::RemoveFromBlockListL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEnginePresenceSubService_Stub::RemoveFromBlockListL( const TDesC& aUriOfTheContact ) - { - TInt err = KErrNotFound; - _LIT(KAt, "@"); - TInt loc = aUriOfTheContact.Find(KAt()); - if( 0 == aUriOfTheContact.Length()) - return KErrNotFound; - else if(KErrNotFound == loc ) - return KErrNotFound; - else - err = KErrNone; - return err; - } - void CVIMPSTEnginePresenceSubService_Stub::FetchPresenceOfSinleContactL(const TDesC& aUserId) - { - } - - void CVIMPSTEnginePresenceSubService_Stub::UpdatePresenceStateL() - { - - } - - void CVIMPSTEnginePresenceSubService_Stub::UnsubscribeListsL() - { - - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpstprocessarrayItem.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpstprocessarrayItem.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "s_vimpstprocessarrayItem.h" -#include "tvimpstenums.h" - - - - MVIMPSTProcessArrayItem* vimpstprocessarrayitem_stub::NewL(TDesC & aItemName) - { - MVIMPSTProcessArrayItem* item = new(ELeave) vimpstprocessarrayitem_stub(aItemName); - return item; - } - - vimpstprocessarrayitem_stub::vimpstprocessarrayitem_stub(TDesC & aItemName) - :iItemName(aItemName) - { - - } - - - - - - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - - - - /** - * gets the messages pending status of the contact item - * @return iSMsgPending: true if the contact has pending messages - * else false - */ - - - - TBool vimpstprocessarrayitem_stub::IsMsgPending() - { - return EFalse; - } - - void vimpstprocessarrayitem_stub::SetMsgPending(TBool aMsgPending) - { - - } - /** - * Returns the default type of the listbox item - * @return TEnumsPC::TItem: type of the listbox item as either EContactitem, EContactListItem etc - */ - TVIMPSTEnums::TItem vimpstprocessarrayitem_stub::Type() - { - return TVIMPSTEnums::EContactItem; - } - - /** - * Returns the name of the listbox item - * @return TPtrC: name of the listbox item to be displayed - */ - - /** - * Sets the name of the listbox item - * @param aName: Name of the listbox item to be set - * @return void - */ - //virtual void SetItemNameText(const TDesC& aName) = 0; - - /** - * Returns the array index of the listbox item on engine/storage side - * @return TInt: index of the listbox item on engine/storage side - */ - TInt vimpstprocessarrayitem_stub::GetItemIndex() - { - return 0; - } - - /** - * return the VPBK Contact Link - */ - MVPbkContactLink* vimpstprocessarrayitem_stub::ContactLink() - { - return NULL; - } - - - /** - * Sets the on engine/storage side index of the listbox item - * @param aIndex: index of the listbox item on engine/storage side - * @return void - */ - void vimpstprocessarrayitem_stub::SetItemIndex(TInt aIndex) - { - - } - - /** - * Returns the user id of the listbox item - * @return TPtrC: user id of the listbox item. - */ - TPtrC vimpstprocessarrayitem_stub::GetItemUserId() - { - TPtrC ptr; - return ptr; - } - /** - * Returns the avatar index of the listbox item - * @return TInt: avatar index of the listbox item. - */ - TInt vimpstprocessarrayitem_stub::AvatarIndex() - { - return 0; - } - - /** - * sets the avatar index of the listbox item - * @param aAvatarIndex: avatar index to be set - */ - void vimpstprocessarrayitem_stub::SetAvatarIndex(TInt aAvatarIndex ) - { - - } - - - - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststoragecontact.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststoragecontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - - -// INCLUDE FILES -#include "s_vimpststoragecontact.h" -//#include - #include "s_MVPbkContactLinkstub.h" - -// ============================ MEMBER FUNCTIONS =============================== - - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* vimpststoragecontact_stub::NewL() - { - MVIMPSTStorageContact* contact = new(ELeave)vimpststoragecontact_stub; - return contact; - } - -// Destructor -vimpststoragecontact_stub::~vimpststoragecontact_stub() - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::UserId -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& vimpststoragecontact_stub::UserId() const - { - return KDummy(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::UserId -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& vimpststoragecontact_stub::Name() const -{ -return KDummy(); -} -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::OnlineStatus -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TOnlineStatus vimpststoragecontact_stub::OnlineStatus() const -{ -TVIMPSTEnums::TOnlineStatus status = TVIMPSTEnums::EOffline; -return status; -} - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetOnlineStatus -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void vimpststoragecontact_stub::SetOnlineStatus( - TVIMPSTEnums::TOnlineStatus /*aOnlineStatus*/ ) - { - //iPresenceStatus = aOnlineStatus; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::StatusText -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& vimpststoragecontact_stub::StatusText() const - { - return KDummy(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetStatusTextL -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void vimpststoragecontact_stub::SetStatusTextL( const TDesC& /*aStatusText*/ ) - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetAvatarContentL -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void vimpststoragecontact_stub::SetAvatarContentL( const TDesC8& /*aAvatarContent*/, MVIMPSTStorageVPbkContactStore& /*aVPPkStoreHandler*/ ) - { - - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetUserIdL -// From MVIMPSTStorageExtendedStorageContact -// ----------------------------------------------------------------------------- -// -void vimpststoragecontact_stub::SetUserIdL( const TDesC& /*aUserId*/ ) - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetNameL -// From MVIMPSTStorageExtendedStorageContact -// ----------------------------------------------------------------------------- -// -void vimpststoragecontact_stub::SetNameL( const TDesC& /*aName*/ ) - { - - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageContact::ContactLink() -// --------------------------------------------------------------------------- -// -MVPbkContactLink* vimpststoragecontact_stub::ContactLink() const - { - MVPbkContactLink* link = CVPbkContactLinkStub::NewL(); - return link; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageContact::AvatarContent -// --------------------------------------------------------------------------- -// -const TDesC8& vimpststoragecontact_stub::AvatarContent() const - { - _LIT8(Kavatar,"avatar"); - return Kavatar(); - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetAvatarIndex() -// --------------------------------------------------------------------------- -// -void vimpststoragecontact_stub::SetAvatarIndex(TInt aIndex ) - { - iAvatarIndex = aIndex; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageContact::AvatarIndex -// --------------------------------------------------------------------------- -// -TInt vimpststoragecontact_stub::AvatarIndex() const - { - return 1; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststoragecontactlist.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststoragecontactlist.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -// INCLUDE FILES -#include "s_vimpststoragecontactlist.h" - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::ListId -// ----------------------------------------------------------------------------- -// -const TDesC& vimpststoragecontactlist_stub::ListId() const - { - return KNullDesC; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::DisplayName -// ----------------------------------------------------------------------------- -// -TPtrC vimpststoragecontactlist_stub::DisplayName() const - { - return NULL; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::AddStorageContactToCacheL -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::AddStorageContactToCacheL( MVIMPSTStorageContact* aContact, TInt& aIndex ) - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::RemoveContactFromCacheL -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::RemoveContactFromCacheL( const TDesC& aContactId, TInt& aIndex ) - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::RemoveContactFromCacheL -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::RemoveContactFromCacheL( const MVPbkContactLink& aContactLink, TInt& index ) - { - - } - // ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContact -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::ContactCount( TBool aSkipOfflineContacts, - TBool aSkipBlocekedContacts ) const - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContactIndex -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::FindContactIndex( const TDesC& aUserId, - TInt& aOrderedIndex ) const - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContactEntry -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::FindContactEntry( const MVIMPSTStorageContact* aContact ) const - { - - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::Sort -// ----------------------------------------------------------------------------- -// -void vimpststoragecontactlist_stub::Sort() - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::ResortContact -// ----------------------------------------------------------------------------- -// -void vimpststoragecontactlist_stub::ResortContact( MVIMPSTStorageContact* aContact ) - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindIndexOfContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::FindIndexOfContact( const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter ) const - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::Count -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::Count() const - { - return 1; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::OnlineCount -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::OnlineCount() const - { - - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::operator[] -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& vimpststoragecontactlist_stub::operator[]( TInt aIndex ) const - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::OnlineContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& vimpststoragecontactlist_stub::OnlineContact( TInt aIndex ) const - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FilteredContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& vimpststoragecontactlist_stub::FilteredContact( - TInt aIndex, TVIMPSTEnums::TFilterType aFilter ) const - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FilteredCount -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::FilteredCount( - TVIMPSTEnums::TFilterType aFilter ) const - { - return 1; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FilterAllowsContact -// ----------------------------------------------------------------------------- -// -TBool vimpststoragecontactlist_stub::FilterAllowsContact( const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter ) const - { - return ETrue; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContact -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* vimpststoragecontactlist_stub::FindContact( const TDesC& aContactId ) - { - //return NULL; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContactByContactLinkL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* vimpststoragecontactlist_stub::FindContactByContactLink( const MVPbkContactLink& aContactLink ) - { - //return NULL; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContactByLinkL -// ----------------------------------------------------------------------------- -// -TInt vimpststoragecontactlist_stub::FindContactByLinkL( const MVPbkContactLink& aContactLink, - TInt& aIndexOrderedArray ) const - { - return NULL; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststoragemanagerfactory.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststoragemanagerfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -// INCLUDE FILES -#include "cvimpststoragemanagerfactory.h" -#include "s_vimpststoragecontact.h" -#include "mvimpststoragecontact.h" -#include "s_vimpststorageserviceview.h" -#include "s_storageitemmodel.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::InitialiseLibraryL -// Factory method that initialises the vimpststorage library -// used by CVIMPSTViewIdFactory -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseLibraryL() - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::Release -// Factory method to release the resource owned by the vimpststorage library -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CVIMPSTStorageManagerFactory::Release() - { - return 1; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::InitialiseViewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseViewL( - TUint32 aServiceId, - const TDesC& aStoreName, - const TDesC& aServiceName) - { - - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::ContactListInterfaceL() -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTStorageServiceView* CVIMPSTStorageManagerFactory::ContactListInterfaceL(TUint32 aServiceId) - { - MVIMPSTStorageServiceView *contact = vimpstserviceview_stub::NewL(); - return contact ; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::ItemModelInterfaceL -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTStorageItemModel* CVIMPSTStorageManagerFactory::ItemModelInterfaceL( TUint32 aServiceId ) - { - //MVIMPSTStorageItemModel* model = vimpststorageitemlist_stub::NewL(); - return NULL; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststorageserviceview.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststorageserviceview.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -#include "s_vimpststorageserviceview.h" -#include "s_vimpststoragecontact.h" - -MVIMPSTStorageServiceView* vimpstserviceview_stub::NewL() - { - MVIMPSTStorageServiceView* ob = new(ELeave)vimpstserviceview_stub; - return ob; - } - -void vimpstserviceview_stub::AddObserverL( MVIMPSTStorageContactsObserver* aObserver ) - { - User::LeaveIfError( iContactObservers.Append( aObserver ) ); - } - -void vimpstserviceview_stub::RemoveObserver( MVIMPSTStorageContactsObserver* aObserver ) - { - iContactObservers.Remove( 0 ); - iContactObservers.Compress(); - } - - -MVIMPSTStorageContact* vimpstserviceview_stub::FindContactByUserId( const TDesC& aUserId ) - { - if(aUserId.Compare(_L("dummy@presence"))==0) - { - MVIMPSTStorageContact* contact = vimpststoragecontact_stub::NewL(); - return contact; - } - return NULL; - } - - -TInt vimpstserviceview_stub::ListCount() const -{ -return 1; -} - -MVIMPSTStorageContactList& vimpstserviceview_stub::ListAt( TInt aIndex ) const -{ -MVIMPSTStorageContactList *abc = NULL; - -return *abc; -} - - -MVIMPSTStorageContactList* vimpstserviceview_stub::FindContactList( const TDesC& aListId ) - { - return NULL; - } - -MVIMPSTStorageContactList* vimpstserviceview_stub::CreateContactListL( const TDesC& aContactListId, - const TDesC& aDisplayName ) - { - MVIMPSTStorageContactList *abc = NULL; - - return abc; - } - -void vimpstserviceview_stub::RemoveContactList( const TDesC& aContactListId ) - { - - } - - -TInt vimpstserviceview_stub::ContactCount(TBool aSkipOfflineContacts ) const -{ -return 0; -} - - - -MVIMPSTStorageContact* vimpstserviceview_stub::UpdatePresenceL(const TDesC& aContactId, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aStatusText, - const TDesC8& aAvatarData, - TBool aIsClearingAvatar ) - { - return NULL; - } - -MVIMPSTStorageContact* vimpstserviceview_stub::UpdateAvatarL(const TDesC& aContactId, - const TDesC8& aAvatarData ) - { - return NULL; - } - -MVIMPSTStorageContact* vimpstserviceview_stub::CreateNewContactL(const TDesC& aUserId, - const TDesC& aDisplayName, - TBool aIsInvitationItem , - TBool aInvitationAutoAccept) - { - MVIMPSTStorageContact* contact = NULL; - return contact; - } - -TInt vimpstserviceview_stub::CreateNewContactFromRetrivedIdL( TInt aIndexToUse ) - { - return 1; - } - -TInt vimpstserviceview_stub::DeleteNewContactFromRetrivedIdL( TInt aIndexToUse ) - { - return 0; - } - -TInt vimpstserviceview_stub::RemoveContactL( MVIMPSTStorageContact* aContact ) - { - return 0; - } - - -void vimpstserviceview_stub::CreateNewFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ) - { - - } - - -TBool vimpstserviceview_stub::IsLocalStore() const -{ -return ETrue; -} - - -TInt vimpstserviceview_stub::RetriveLinkXSPIdsL(const TDesC8& aContactPackLink ) - { - return 3; - } -const TDesC& vimpstserviceview_stub::GetRetrieveXSPIdL(TInt aIndex ) - { - if(aIndex ==0) - { - _LIT(KText1,"blocked@presence"); - return KText1(); - } - if(aIndex ==1) - { - _LIT(KText2,"dummy@presence"); - return KText2(); - } - if(aIndex ==2) - { - _LIT(KText3,"contact@presence"); - return KText3(); - } - - } - -MVIMPSTStorageContact* vimpstserviceview_stub::FindContactByLink(const MVPbkContactLink& aContactLink ) - { - return NULL; - } - - -void vimpstserviceview_stub::Sort( const TDesC& aContactListId) - { - - } - -MVIMPSTStorageContact& vimpstserviceview_stub::OwnContactL() - { - MVIMPSTStorageContact *abc = vimpststoragecontact_stub::NewL(); - - return *abc; - } - -void vimpstserviceview_stub::DeleteDatabaseL() - { - - } - -void vimpstserviceview_stub::SetOwnUserIdL(const TDesC& aUserId ) - { - - } - -void vimpstserviceview_stub::SetUnnamedTextL(HBufC* aUnnamedText ) - { - - } - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststorecontact.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/stub/s_vimpststorecontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: s_enginecontmgtextfeatures.cpp -* -*/ - -// INCLUDES -#include "s_vimpststorecontact.h" - -MVIMPSTStorageContact* vimpststorecontact_stub::NewL() - { - MVIMPSTStorageContact* contact = new(ELeave)vimpststorecontact_stub; - return contact; - } - - void vimpststorecontact_stub::SetNameL( const TDesC& aName ) - { - - } - - void vimpststorecontact_stub::SetAvatarContentL( const TDesC8& aAvatarContent , - MVIMPSTStorageVPbkContactStore& aVPPkStoreHandler) - { - - } - -const TDesC& vimpststorecontact_stub::Name()const - { - return KNullDesC(); - } - -TInt vimpststorecontact_stub::AvatarIndex() const - { - return 0; - } - -void vimpststorecontact_stub::SetAvatarIndex( TInt avatarIndex) - { - - } - -const TDesC8& vimpststorecontact_stub::AvatarContent() const - { - return KNullDesC8(); - } - -const TDesC& vimpststorecontact_stub::UserId() const - { - return KDummy(); - } - -TVIMPSTEnums::TOnlineStatus vimpststorecontact_stub::OnlineStatus() const - { - TVIMPSTEnums::TOnlineStatus status; - return status; - } - -void vimpststorecontact_stub::SetOnlineStatus( TVIMPSTEnums::TOnlineStatus aOnlineStatus ) - { - - } - -void vimpststorecontact_stub::SignalChanges() - { - - } - -void vimpststorecontact_stub::SignalAvatarChange() - { - - } - -void vimpststorecontact_stub::SetUserIdL( const TDesC& aUserId ) - { - - } - -const TDesC& vimpststorecontact_stub::StatusText() const - { - return KDummy(); - } - -void vimpststorecontact_stub::SetStatusTextL( const TDesC& aStatusText ) - { - - } - -MVPbkContactLink* vimpststorecontact_stub::ContactLink() const - { - return NULL; - } - -MVPbkStoreContact* vimpststorecontact_stub::VPbkStoreContact() const - { - return NULL; - } - -RPointerArray& vimpststorecontact_stub::ServiceDetails() - { - _LIT(KText1, "xyz"); - TBufC16<5> buf11(KText1); - HBufC* buf1; - TRAP_IGNORE(buf1 = buf11.AllocL()); - iServiceDetailArray.Append(buf1); - TInt count = iServiceDetailArray.Count(); - return iServiceDetailArray; - } - -const TDesC& vimpststorecontact_stub::ImppField() - { - return KDummy(); - } -void vimpststorecontact_stub::Commit(MVPbkContactObserver* aObserver /*= NULL*/, - MVIMPSTContactOperationCompleteObserver* aContactOperationObserver /*= NULL*/) - { - - } - -void vimpststorecontact_stub::ResetAvatarContent() - { - - } -void vimpststorecontact_stub::SetContactOperationObserver( MVIMPSTContactOperationCompleteObserver* - aContactOperationObserver ) - { - - } - -vimpststorecontact_stub::~vimpststorecontact_stub() - { - //buf1. - } - -HBufC* vimpststorecontact_stub::GetContactFieldDataLC( const TDesC& aDefaultDomain /*= KNullDesC */,TInt aFieldResId /*= R_VPBK_FIELD_TYPE_IMPP*/) - { - HBufC* retVal= NULL; - return retVal; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/vimpstcmdprocess_utest.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/vimpstcmdprocess_utest.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* 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: This file contains STIFUnit module implementation. -* -*/ - -/******************************************************************************/ -/* - * - * Test module configuration -*/ - -// Version -#define TEST_MODULE_VERSION_MAJOR 0 -#define TEST_MODULE_VERSION_MINOR 0 -#define TEST_MODULE_VERSION_BUILD 0 - -// Uncomment following defines, if you want to provide implementation -// of enlisted virtual methods of test module. -// Implementation part is located at the end of this file. -//#define STIFUNIT_OOMTESTQUERYL -//#define STIFUNIT_OOMTESTINITIALIZEL -//#define STIFUNIT_OOMHANDLEWARNINGL -//#define STIFUNIT_OOMTESTFINALIZEL -/******************************************************************************/ - - -/* - * Test module internals. Please do not edit them. -*/ - -// Includes -#include -#include "cvimpstcmdfactory.h" -#include "cvimpstprocessarray.h" -#include "cvimpstprocessfriendrequestitem.h" -#include "s_vimpstengin.h" -#include "s_vimpststoragecontact.h" -#include "s_vimpststoragecontactlist.h" -#include "s_vimpstcmdobserver.h" - -#include "s_vimpstprocessarrayItem.h" -#include "s_processarrayobserver.h" -#include "s_vimpststorageserviceview.h" -#include "s_storageitemmodel.h" -#include "s_mccaconnection.h" -#include "mvimpstcmd.h" -#include "tvimpstconsts.h" - -// Literals -_LIT( KUnitLogPath, "\\logs\\testframework\\vimpstcmdprocess_utest\\" ); -_LIT( KUnitLogFile, "vimpstcmdprocess_utest.txt" ); -_LIT( KLogStart, "vimpstcmdprocess_utest logging starts!" ); - -// Defines -#define STIF_UNIT_TEST_CASES "../src/vimpstcmdprocess_utestCases.cpp" -#define STIF_UNIT_MODULE_CLASS_NAME Cvimpstcmdprocess_utest -#define STIF_UNIT_MODULE_NAME _L("vimpstcmdprocess_utest.dll") - -// Include STIF unit generic file -#include - -/* - * User implementation of OOM virtual methods. - * Providing own implementation requires uncommenting defines at the - * beginnig of this file. -*/ -#ifdef STIFUNIT_OOMTESTQUERYL -TBool Cvimpstcmdprocess_utest::OOMTestQueryL( const TFileName& /*aTestCaseFile*/, - const TInt aCaseNumber, - TOOMFailureType& aFailureType, - TInt& aFirstMemFailure, - TInt& aLastMemFailure) - { - } -#undef STIFUNIT_OOMTESTQUERYL -#endif - -#ifdef STIFUNIT_OOMTESTINITIALIZEL -void Cvimpstcmdprocess_utest::OOMTestInitializeL( const TFileName& /*aTestCaseFile*/, - const TInt /*aCaseNumber*/ ) - { - } -#undef STIFUNIT_OOMTESTINITIALIZEL -#endif - -#ifdef STIFUNIT_OOMHANDLEWARNINGL -void Cvimpstcmdprocess_utest::OOMHandleWarningL( const TFileName& /*aTestCaseFile*/, - const TInt /*aCaseNumber*/, - TInt& /*aFailNextValue*/) - { - } -#undef STIFUNIT_OOMHANDLEWARNINGL -#endif - -#ifdef STIFUNIT_OOMTESTFINALIZEL -void Cvimpstcmdprocess_utest::OOMTestFinalizeL( const TFileName& /*aTestCaseFile*/, - const TInt /*aCaseNumber*/ ) - { - } -#undef STIFUNIT_OOMTESTFINALIZEL -#endif - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/vimpstcmdprocess_utestCases.cpp --- a/uiservicetab/vimpstcmdprocess/tsrc/vimpstcmdprocess_utest/src/vimpstcmdprocess_utestCases.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,740 +0,0 @@ -/* -* 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: This file contains STIFUnit implementation. -* -*/ - -/** - * STIF_UNIT_INCLUDE SECTION - put all #includes between STIF_UNIT_INCLUDE_SECTION - * and STIF_UNIT_INCLUDE_SECTION_END - */ -#ifdef STIF_UNIT_INCLUDE_SECTION - - -#endif //STIF_UNIT_INCLUDE_SECTION_END - -/** - * GLOBAL VARIABLES SECTION - */ -#ifdef TEST_VAR_DECLARATIONS - /** - * Example of variable common for some test cases - */ - -#endif -/** - * END OF GLOBAL VARIABLES SECTION - */ - - -/** - * TEST CASES SECTION - */ -#ifdef TEST_CASES -/** - * STIF_SETUP defines activities needed before every test case. - */ -STIF_SETUP -{ - /** Example of use of STIF_SETUP - a variable common for some test cases is initialized - */ - - -} - -/** - * STIF_TEARDOWN defines activities needed after every test case - */ -STIF_TEARDOWN -{ - /** Example of use of STIF_TEARDOWN - a variable common for some test cases is destroyed - */ - -} - -/** - * STIF_TESTDEFINE defines a test case - * - * Example test case - length of string is checked. - * The only argument of macro is a name of test case. - */ -STIF_TESTDEFINE(t_CreateCommand_login) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELoginService,&data) ; -//delete factory; -//factory = NULL; -TInt comm_sent = ELoginService; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_CreateCommand_logout) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELogoutService,&data) ; -TInt comm_sent = ELogoutService; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_CreateCommand_LaunchCCA) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TLaunchCCAData data; -data.iIndex = 1; -data.iConnection = MCCAConnectionStub::NewL(); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELaunchCCA,&data) ; -TInt comm_sent = ELaunchCCA; -TInt comm_recev = commd->CommandId(); -//commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_CreateCommand_AddContact) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EAddContact,&data) ; -TInt comm_sent = EAddContact; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_CreateCommand_DeleteContact) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EDeleteContact,&data) ; -delete factory; -factory = NULL; -TInt comm_sent = EDeleteContact; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_CreateCommand_ChangeOwnStatus) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TStatusAndStatusText status; -_LIT(KStatusMsg,"away"); -status.iStatusText.Copy(KStatusMsg); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnStatus,&status) ; -delete factory; -factory = NULL; -TInt comm_sent = EChangeOwnStatus; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_CreateCommand_ChangeOwnMessage) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); - -TStatusAndStatusText status; -_LIT(KStatusMsg,"away"); -status.iStatusText.Copy(KStatusMsg); - -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnMessage,&status) ; -delete factory; -factory = NULL; -TInt comm_sent = EChangeOwnMessage; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_CreateCommand_Search) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -RArray aKeyDataArray; - -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ESearch,&aKeyDataArray) ; -delete factory; -factory = NULL; -TInt comm_sent = ESearch; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_CreateCommand_FriendRejected) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -_LIT(KContactId,"contact"); -TBufC<10> buf (KContactId); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EFriendRejected, &buf) ; -delete factory; -factory = NULL; -TInt comm_sent = EFriendRejected; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_CreateCommand_ChangeOwnAvtar) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TAvatarData data; - -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnAvtar,&data) ; -delete factory; -factory = NULL; -TInt comm_sent = EChangeOwnAvtar; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_CreateCommand_CloseConversation) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -_LIT(KContactId,"contact"); -TBufC<10> buf(KContactId); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECloseConversation,&buf) ; -delete factory; -factory = NULL; -TInt comm_sent = ECloseConversation; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_CreateCommand_AddToPbk) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); - -vimpststoragecontact_stub store; - -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EAddToPbk,&store) ; -delete factory; -factory = NULL; -TInt comm_sent = EAddToPbk; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_CreateCommand_CancelLogin) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECancelLogin,&data) ; -delete factory; -factory = NULL; -TInt comm_sent = ECancelLogin; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_CreateCommand_ProcessAcceptedContactNew) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TVPbkSelectedData iSelectedData; - -_LIT8(KContactId,"contact"); -TPtrC8 buddy = KContactId(); -iSelectedData.iPackedLinks = buddy.AllocL(); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessAcceptedContactNew,&iSelectedData) ; -//delete factory; -//factory = NULL; -TInt comm_sent = ECmdProcessAcceptedContactNew; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} -STIF_TESTDEFINE(t_CreateCommand_ProcessSelectedContactNew) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TVPbkSelectedData iSelectedData; - -_LIT8(KContactId,"contact"); -TPtrC8 buddy = KContactId(); -iSelectedData.iPackedLinks = buddy.AllocL(); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessSelectedContactNew,&iSelectedData) ; -//delete factory; -//factory = NULL; -TInt comm_sent = ECmdProcessSelectedContactNew; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} -STIF_TESTDEFINE(t_CreateCommand_ProcessAcceptedContactExist) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TVPbkSelectedData iSelectedData; - -_LIT8(KContactId,"contact"); -TPtrC8 buddy = KContactId(); -iSelectedData.iPackedLinks = buddy.AllocL(); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessAcceptedContactExist,&iSelectedData) ; -//delete factory; -//factory = NULL; -TInt comm_sent = ECmdProcessAcceptedContactExist; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} -STIF_TESTDEFINE(t_CreateCommand_ProcessSelectedContactExist) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TVPbkSelectedData iSelectedData; - -_LIT8(KContactId,"contact"); -TPtrC8 buddy = KContactId(); -iSelectedData.iPackedLinks = buddy.AllocL(); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessSelectedContactExist,&iSelectedData) ; -//delete factory; -//factory = NULL; -TInt comm_sent = ECmdProcessSelectedContactExist; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -//============================ExecuteLD--------------------- - -STIF_TESTDEFINE(t_ExeCommand_login) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELoginService,&data) ; -TInt comm_sent = ELoginService; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_ExeCommand_logout) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELogoutService,&data) ; -TInt comm_sent = ELogoutService; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_ExeCommand_LaunchCCA) -{/* -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TLaunchCCAData data; -data.iIndex = 2; -//TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ELaunchCCA,&data) ; -TInt comm_sent = ELaunchCCA; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -//commd->iIndex = 0; -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev );*/ -} -STIF_TESTDEFINE(t_ExeCommand_AddContact) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EAddContact,&data) ; -TInt comm_sent = EAddContact; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_ExeCommand_DeleteContact) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EDeleteContact,&data) ; -delete factory; -factory = NULL; -TInt comm_sent = EDeleteContact; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_ExeCommand_ChangeOwnStatus) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TStatusAndStatusText status; -_LIT(KStatusMsg,"away"); -status.iStatusText.Copy(KStatusMsg); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnStatus,&status) ; -delete factory; -factory = NULL; -TInt comm_sent = EChangeOwnStatus; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_ExeCommand_ChangeOwnMessage) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); - -TStatusAndStatusText status; -_LIT(KStatusMsg,"away"); -status.iStatusText.Copy(KStatusMsg); - -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnMessage,&status) ; -delete factory; -factory = NULL; -TInt comm_sent = EChangeOwnMessage; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_ExeCommand_Search) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -RArray aKeyDataArray; - -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ESearch,&aKeyDataArray) ; -delete factory; -factory = NULL; -TInt comm_sent = ESearch; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_ExeCommand_FriendRejected) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -_LIT(KContactId,"contact"); -TBufC<10> buf (KContactId); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EFriendRejected, &buf) ; -delete factory; -factory = NULL; -TInt comm_sent = EFriendRejected; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_ExeCommand_ChangeOwnAvtar) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TAvatarData data; - -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EChangeOwnAvtar,&data) ; -delete factory; -factory = NULL; -TInt comm_sent = EChangeOwnAvtar; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_ExeCommand_CloseConversation) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -_LIT(KContactId,"contact"); -TBufC<10> buf(KContactId); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECloseConversation,&buf) ; -delete factory; -factory = NULL; -TInt comm_sent = ECloseConversation; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_ExeCommand_AddToPbk) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); - -vimpststoragecontact_stub store; - -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EAddToPbk,&store) ; -delete factory; -factory = NULL; -TInt comm_sent = EAddToPbk; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - - -STIF_TESTDEFINE(t_ExeCommand_CancelLogin) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TInt data = 1; -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECancelLogin,&data) ; -delete factory; -factory = NULL; -TInt comm_sent = ECancelLogin; -TInt comm_recev = commd->CommandId(); -vimpstcmdobserver_stub ob; -commd->AddObserver(ob); -commd->ExecuteLD(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -//Test case for Block/unblock... - -STIF_TESTDEFINE(t_CreateCommand_BlockContact) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -_LIT(KContactId,"contact"); -TBufC<10> buf (KContactId); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdBlockContact, &buf) ; -delete factory; -factory = NULL; -TInt comm_sent = ECmdBlockContact; -TInt comm_recev = commd->CommandId(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_CreateCommand_UnBlockContact) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -_LIT(KContactId,"contact"); -TBufC<10> buf (KContactId); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdUnBlockContact, &buf) ; -delete factory; -factory = NULL; -TInt comm_sent = ECmdUnBlockContact; -TInt comm_recev = commd->CommandId(); - -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_ExecuteCommand_BlockContact) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -_LIT(KContactId,"contact"); -TBufC<10> buf (KContactId); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdBlockContact, &buf) ; -delete factory; -factory = NULL; -vimpstcmdobserver_stub observer; -commd->AddObserver(observer); -TInt comm_sent = ECmdBlockContact; -TInt comm_recev = commd->CommandId(); -TRAPD(err,commd->ExecuteLD()); - -STIF_ASSERT_EQUALS(err, KErrNone ); -} - -STIF_TESTDEFINE(t_ExecuteCommand_UnBlockContact) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -_LIT(KContactId,"contact"); -TBufC<10> buf (KContactId); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdUnBlockContact, &buf) ; -delete factory; -factory = NULL; -vimpstcmdobserver_stub observer; -commd->AddObserver(observer); -TInt comm_sent = ECmdUnBlockContact; -TInt comm_recev = commd->CommandId(); -TRAPD(err,commd->ExecuteLD()); - -STIF_ASSERT_EQUALS(err, KErrNone); -} -STIF_TESTDEFINE(t_ExecuteCommand_FetchBlockContactList) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -_LIT(KContactId,"contact"); -TBufC<10> buf (KContactId); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(EFetchBlockedList) ; -delete factory; -factory = NULL; -vimpstcmdobserver_stub observer; -commd->AddObserver(observer); -TInt comm_sent = EFetchBlockedList; -TInt comm_recev = commd->CommandId(); -TRAPD(err,commd->ExecuteLD()); - -STIF_ASSERT_EQUALS(err, KErrNone); -} -STIF_TESTDEFINE(t_ExecuteCommand_ProcessAcceptedContactNew) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TVPbkSelectedData iSelectedData; - -_LIT8(KPackedlink,"packedlink"); -TPtrC8 link = KPackedlink(); -iSelectedData.iPackedLinks = link.AllocL(); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessAcceptedContactNew,&iSelectedData) ; -//delete factory; -//factory = NULL; -vimpstcmdobserver_stub observer; -commd->AddObserver(observer); -TInt comm_sent = ECmdProcessAcceptedContactNew; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_ExecuteCommand_ProcessSelectedContactNew) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TVPbkSelectedData iSelectedData; - -_LIT8(KPackedlink,"packedlink"); -TPtrC8 link = KPackedlink(); -iSelectedData.iPackedLinks = link.AllocL(); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessSelectedContactNew,&iSelectedData) ; -//delete factory; -//factory = NULL; -vimpstcmdobserver_stub observer; -commd->AddObserver(observer); -TInt comm_sent = ECmdProcessSelectedContactNew; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_ExecuteCommand_ProcessAcceptedContactExist) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TVPbkSelectedData iSelectedData; - -_LIT8(KPackedlink,"packedlink"); -TPtrC8 link = KPackedlink(); -iSelectedData.iPackedLinks = link.AllocL(); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessAcceptedContactExist,&iSelectedData) ; -//delete factory; -//factory = NULL; -vimpstcmdobserver_stub observer; -commd->AddObserver(observer); -TInt comm_sent = ECmdProcessAcceptedContactExist; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -STIF_TESTDEFINE(t_ExecuteCommand_ProcessSelectedContactExist) -{ -vimpstengine_stub engin; -CVIMPSTCmdFactory *factory = CVIMPSTCmdFactory::NewL(engin); -TVPbkSelectedData iSelectedData; - -_LIT8(KPackedlink,"packedlink"); -TPtrC8 link = KPackedlink(); -iSelectedData.iPackedLinks = link.AllocL(); -MVIMPSTCmd* commd = factory->CreateCommandForIdL(ECmdProcessSelectedContactExist,&iSelectedData) ; -//delete factory; -//factory = NULL; -vimpstcmdobserver_stub observer; -commd->AddObserver(observer); -TInt comm_sent = ECmdProcessSelectedContactExist; -TInt comm_recev = commd->CommandId(); -commd->ExecuteLD(); -STIF_ASSERT_EQUALS(comm_sent, comm_recev ); -} - -#endif -/** - * END OF TEST CASES SECTION - */ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailfields.rh --- a/uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailfields.rh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +0,0 @@ -/* -* Copyright (c) 2006-2007 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: Resource headers for project VIMPSTPresentation field -* ordering -* -*/ - - -#ifndef VIMPSTFIELDORDERING_RH -#define VIMPSTFIELDORDERING_RH - -// ------------------------------------------------------------------------- -// A structure for defining presentation order for field types. -// ------------------------------------------------------------------------- -// -STRUCT VIMPST_FIELDTYPE_PRESENTATION_ORDER - { - /// Field type resource id from VPbkEng.rsg - LONG fieldTypeResId; - /// The number that specifies the location of this field type - /// in contact presentation (defines the order of fields). - /// See appropriate language specific VIMPSTDefaultFieldOrdering.hrh, - /// VIMPSTChineseFieldOrdering.hrh or VIMPSTJapaneseFieldOrdering.hrh. - - BYTE orderingItem; - /// The number that specifies the location of this field type - /// in the UI when adding an new fieldtype to the contact. - /// See appropriate language specific VIMPSTDefaultFieldOrdering.hrh, - /// VIMPSTChineseFieldOrdering.hrh or VIMPSTJapaneseFieldOrdering.hrh. - - BYTE addItemOrdering; - } - -/** - * Phonebook vCard property. Loaded from resource to a CPbkVcardProperty C++ instance. - * @see CPbkVcardProperty - */ -STRUCT VIMPST_VCARD_PROPERTY - { - /// The property name as integer UID from ctndef.hrh - LONG name; - /// The parameters as integer UIDs from cntdef.hrh - STRUCT parameters[]; - } - -/** - * Phonebook constant field information resource structure. Loaded from resources into - * corresponding CPbkFieldInfo C++ instance. - * - * @see CPbkFieldInfo - */ -STRUCT VIMPST_FIELD - { - LONG fieldTypeResId; - /** - * Unique field id. - * @see TPbkFieldId - */ - BYTE Id; - - /** - * Maximum length of field (in characters) from Phonebook UI specification. - */ - WORD MaxLength; - - /** - * Phonebook Icon id of the field. - */ - BYTE IconId; - - /** - * Label text for Add item dialogs - */ - LTEXT DisplayLabel; - } - - -/** - * Array of PHONEBOOK_FIELDs. - * - * @see PHONEBOOK_FIELD - */ -STRUCT VIMPST_FIELD_ARRAY - { - /// Array items. - STRUCT items[]; - } - - -/** - * Array of VIMPST_STATUS. - * - * @see VIMPST_STATUS - */ -STRUCT VIMPST_STATUS - { - /** - * Unique field id. - * @see TPbkFieldId - */ - BYTE StatusId; - - /** - * Label text for Add item dialogs - */ - LTEXT TextLabel; - } - -STRUCT VIMPST_STATUS_ARRAY - { - /// Array items. - STRUCT stausItems[]; - } - -#endif // VIMPSTFIELDORDERING_RH diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailfields.rss --- a/uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailfields.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,226 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview contact editer field array - * -*/ - - -#include "vimpstdetailfields.rh" -#include "vimpstdetailsview.hrh" - -#include -#include - -/** - * Additional information to the default contact card template array - * r_cntui_new_field_defns in cntmodel.rss. - * IMPORTANT: this array is mapped 1-1 to the template array. The items - * must be in the same order as in the template array. - * - * @see cntmodel.rss - * @see VIMPST_FIELD - * @see CPbkFieldInfo - */ - - -RESOURCE VIMPST_FIELD_ARRAY r_vimpst_field_properties - { - items = - { - VIMPST_FIELD // status message - { - fieldTypeResId = R_VPBK_FIELD_TYPE_GENLABEL; - Id = EVIMPSTFieldIdStatusMsg; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = qtn_servdetail_lbl_statusmessage; - }, - VIMPST_FIELD // display Name - { - fieldTypeResId = R_VPBK_FIELD_TYPE_SECONDNAME; - Id = EVIMPSTFieldIdDisplayName; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = qtn_servdetail_lbl_nickname; - }, - VIMPST_FIELD // impp - { - fieldTypeResId = R_VPBK_FIELD_TYPE_IMPP; - Id = EVIMPSTFieldIdImpp; - MaxLength = 100; - IconId = EVIMPSTServiceIconService; - DisplayLabel = qtn_servdetail_lbl_userid; - }, - VIMPST_FIELD // Email Address - { - fieldTypeResId = R_VPBK_FIELD_TYPE_EMAILHOME; - Id = EVIMPSTFieldIdEmailAddress; - MaxLength = 100; - IconId = EVIMPSTServiceIconService; - DisplayLabel = ""; - }, - VIMPST_FIELD // Email Address - { - fieldTypeResId = R_VPBK_FIELD_TYPE_EMAILWORK; - Id = EVIMPSTFieldIdEmailWork; - MaxLength = 100; - IconId = EVIMPSTServiceIconService; - DisplayLabel = ""; - }, - VIMPST_FIELD // Email Address - { - fieldTypeResId = R_VPBK_FIELD_TYPE_EMAILGEN; - Id = EVIMPSTFieldIdEmailGen; - MaxLength = 100; - IconId = EVIMPSTServiceIconService; - DisplayLabel = ""; - }, - VIMPST_FIELD // - { - fieldTypeResId = R_VPBK_FIELD_TYPE_FIRSTNAME; - Id = EVIMPSTFieldIdFirstName; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = qtn_servdetail_lbl_firstname; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_LASTNAME; - Id = EVIMPSTFieldIdLastName; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = qtn_servdetail_lbl_lastname; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_MIDDLENAME; - Id = EVIMPSTFieldIdMiddleName; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = qtn_servdetail_lbl_middlename; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_WVADDRESS; - Id = EVIMPSTFieldIdWvAddress; - MaxLength = 100; - IconId = EVIMPSTServiceIconService; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_SIP; - Id = EVIMPSTFieldIdEmailSip; - MaxLength = 100; - IconId = EVIMPSTServiceIconService; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_VOIPHOME; - Id = EVIMPSTFieldIdVoipHome; - MaxLength = 100; - IconId = EVIMPSTServiceIconService; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_VOIPWORK; - Id = EVIMPSTFieldIdVoipWork; - MaxLength = 100; - IconId = EVIMPSTServiceIconService; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_VOIPGEN; - Id = EVIMPSTFieldIdVoipGen; - MaxLength = 100; - IconId = EVIMPSTServiceIconService; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_DEPARTMENT; - Id = EVIMPSTFieldIdDepartment; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = qtn_servdetail_lbl_organisation; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_ADDRCOUNTRYHOME; - Id = EVIMPSTFieldIdCountryHome; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_ADDRCOUNTRYGEN; - Id = EVIMPSTFieldIdCountryGen; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = qtn_servdetail_lbl_country; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_NOTE; - Id = EVIMPSTFieldIdAbout; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_URLGEN; - Id = EVIMPSTFieldIdHomepage; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_LANDPHONEHOME; - Id = EVIMPSTFieldIdHomePhone; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_MOBILEPHONEGEN; - Id = EVIMPSTFieldIdMobilePhone; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_LANDPHONEWORK; - Id = EVIMPSTFieldIdOfficePhone; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = ""; - }, - VIMPST_FIELD - { - fieldTypeResId = R_VPBK_FIELD_TYPE_ANNIVERSARY; - Id = EVIMPSTFieldIdBirthday; - MaxLength = 100; - IconId = EVIMPSTServiceIconEmpty; - DisplayLabel = ""; - } - }; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailsview.hrh --- a/uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailsview.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,200 +0,0 @@ -/* -* Copyright (c) 2008 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: hrh file collection of constants - * -*/ - - -#ifndef __VIMPSTDETAILSVIEW_HRH__ -#define __VIMPSTDETAILSVIEW_HRH__ - -/** do not change any of this , ccappdetailsviewplugin's enumerated command codes */ -enum TCCAppDetailsViewCmdIds - { - - ECCAppDetailsViewEditItemCmd = 1,// start value must not be 0 - ECCAppDetailsViewImageCmd, - ECCAppDetailsViewNumberCmd, - ECCAppDetailsViewAddressCmd, - ECCAppDetailsViewSendBusinessCardCmd, - ECCAppDetailsViewSetTopContactCmd, - ECCAppDetailsViewRemoveTopContactCmd, - ECCAppDetailsViewDeleteCmd, - ECCAppDetailsViewCopyCmd, - ECCAppDetailsViewCopyNumberCmd, - ECCAppDetailsViewCopyAddressCmd, - ECCAppDetailsViewCopyDetailCmd, - ECCAppDetailsViewAssignSpeedDialCmd, - ECCAppDetailsViewSetAsDefaultCmd, - ECCAppDetailsViewPrependCmd, - - // KAiwCmdAssign AIW service cmd used as Edit Options-menu item - // set AIW commands at last - ECCAppDetailsViewAiwBaseCmd = 1000 // leave this last - - }; - -/** vimpstdetailsview's enumerated command codes */ - -enum TVIMPSTDetailsViewCmdIds - { - EVIMPSTDetailsEditCmd = 1001,// start value must not be 0 - EVIMPSTDetailsViewImageCmd, - EVIMPSTDetailsCopyCmd, - EVIMPSTDetailsDeleteCmd, - // KAiwCmdAssign AIW service cmd used as Edit Options-menu item - // set AIW commands at last - EVIMPSTDetailsAiwBaseCmd = 2000 // leave this last - - }; - -// -#define KVIMPST_MAX_LENGTH 152 - -// CONSTANTS -/////////////////////////////////////////////////////////// -// Unique Phonebook field type ids -/////////////////////////////////////////////////////////// - -#define EPbkFieldIdNone 0x00 -#define EVIMPSTFieldIdThumbnailImage 0x01 -#define EVIMPSTFieldIdStatusMsg 0x02 -#define EVIMPSTFieldIdEmailAddress 0x03 -#define EVIMPSTFieldIdEmailWork 0x04 -#define EVIMPSTFieldIdEmailGen 0x05 -#define EVIMPSTFieldIdFirstName 0x06 -#define EVIMPSTFieldIdLastName 0x07 -#define EVIMPSTFieldIdMiddleName 0x08 -#define EVIMPSTFieldIdWvAddress 0x09 -#define EVIMPSTFieldIdEmailSip 0x10 -#define EVIMPSTFieldIdVoipHome 0x11 -#define EVIMPSTFieldIdVoipWork 0x12 -#define EVIMPSTFieldIdVoipGen 0x13 -#define EVIMPSTFieldIdDepartment 0x14 -#define EVIMPSTFieldIdCountryHome 0x15 -#define EVIMPSTFieldIdCountryGen 0x16 -#define EVIMPSTFieldIdImpp 0x17 -#define EVIMPSTFieldIdDisplayName 0x18 - -#define EVIMPSTFieldIdAbout 0x19 -#define EVIMPSTFieldIdHomepage 0x1A -#define EVIMPSTFieldIdHomePhone 0x1B -#define EVIMPSTFieldIdMobilePhone 0x1C -#define EVIMPSTFieldIdOfficePhone 0x1D -#define EVIMPSTFieldIdBirthday 0x1E - -/** - * The storage type of data in Versit.dll. - * Note that corresponding Uids exist in - * vuid.h. - */ -enum TVIMPSTVersitStorageType - { - EVIMPSTVersitPropertyNULL = 0, - EVIMPSTVersitPropertyHBufC, - EVIMPSTVersitPropertyBinary, - EVIMPSTVersitPropertyCDesCArray, - EVIMPSTVersitPropertyMultiDateTime, - EVIMPSTVersitPropertyDateTime, - EVIMPSTVersitPropertyInt - }; -/** - * Phonebook 2 field type ordering items. - */ -enum TVIMPSTOrderingItem - { - EVIMPSTIOrderingUndefined = -1, - EVIMPSTOrderingItemThumbnailImage = 1, - EVIMPSTOrderingItemDisplayName, - EVIMPSTOrderingItemStatusMsg, - EVIMPSTOrderingItemEmailAddressHome, - EVIMPSTOrderingItemEmailWork, - EVIMPSTOrderingItemEmailGen, - EVIMPSTOrderingItemFirstName, - EVIMPSTOrderingItemLastName, - EVIMPSTOrderingItemMiddleName, - EVIMPSTOrderingItemWvAddress, - EVIMPSTOrderingItemSip, - EVIMPSTOrderingItemVoipHome, - EVIMPSTOrderingItemVoipWork, - EVIMPSTOrderingItemVoipGen, - EVIMPSTOrderingItemDepartment, - EVIMPSTOrderingItemCountryHome, - EVIMPSTOrderingItemAddCountryGen, - EVIMPSTOrderingItemImpp - }; - -/** - * Phonebook 2 Add Item field ordering. - */ -enum TVIMPSTAddItemOrdering - { - // A value that is used for field types that can not be - // directly selected by the user. - EVIMPSTAddItemOrderUndefined = -1, - EVIMPSTAddItemOrderImage = 1, - EVIMPSTAddItemOrderDisplaName, - EVIMPSTAddItemOrderStatusMsg, - EVIMPSTAddItemOrderEmailHome, - EVIMPSTAddItemOrderEmailWork, - EVIMPSTAddItemOrderEmailGen, - EVIMPSTAddItemOrderFirstName, - EVIMPSTAddItemOrderLastName, - EVIMPSTAddItemOrderMiddleName, - EVIMPSTAddItemOrderWvAddress, - EVIMPSTAddItemOrderSip, - EVIMPSTAddItemOrderVoipHome, - EVIMPSTAddItemOrderVoipWork, - EVIMPSTAddItemOrderVoipGen, - EVIMPSTAddItemOrderDepartment, - EVIMPSTAddItemOrderCountryHome, - EVIMPSTAddItemOrderAddCountryGen, - EVIMPSTAddItemOrderImpp - }; - - -enum TVIMPSTIconIds - { - EVIMPSTServiceIconEmpty = -1, - EVIMPSTServiceIconOff, - EVIMPSTServiceIconOn, - EVIMPSTServiceIconAway, - EVIMPSTServiceIconBusy, - EVIMPSTServiceIconInvi, - EVIMPSTServiceIconService, - EVIMPSTServiceIconMsgNew, - EVIMPSTServiceIconAvatar, - EVIMPSTServiceIconFrdReq, - EVIMPSTServiceIconFrdReqSent, - EVIMPSTServiceIconFrdReqOff, - EVIMPSTServiceIconFrdReqSentOff, - EVIMPSTServiceIconBlocked, - EVIMPSTServiceIconOnMobile, - EVIMPSTServiceIconCallForward - }; - -enum TVIMPSTOnlineStatus - { - EVIMPSTUnknown = -1, /* unknown status */ - EVIMPSTOffline, /* Offline status */ - EVIMPSTOnline, /* Online status */ - EVIMPSTInvisible, /* Invisible status */ - EVIMPSTAway, /* Away status */ - EVIMPSTBusy, /* Busy status */ - EVIMPSTBlocked /* block status */ - }; - -#endif // __VIMPSTDETAILSVIEW_HRH__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailsviewplugin.rss --- a/uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailsviewplugin.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2008 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: ECom definitions for this plugin. - * -*/ - - -#include -#include "vimpstdetailsviewpluginuids.hrh" - -// --------------------------------------------------------------------------- -// the Info -// -// ECom definitions for this plugin -// --------------------------------------------------------------------------- -// -RESOURCE REGISTRY_INFO theInfo -{ - // UID for the DLL. See mmp files - dll_uid = KVIMPSTDetailsViewPluginDllUid; - - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = KCCAppViewFactoryInterfaceUID; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KVIMPSTDetailsViewPluginImplmentationUid; - version_no = 1; - display_name = "CCA details view plugin"; - default_data = ""; - opaque_data = "TABP=55\tCNT"; - - } - }; - } - }; -} - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailsviewpluginrsc.rss --- a/uiservicetab/vimpstdetailsviewplugin/data/vimpstdetailsviewpluginrsc.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* Copyright (c) 2008 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: Resource file for CCA Details view plugin - * -*/ - - -// RESOURCE IDENTIFIER -NAME IMSD // 4 letter ID , im service details - -// INCLUDES -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vimpstdetailsview.hrh" -#include - -// RESOURCE DEFINITIONS - -// --------------------------------------------------------------------------- -// RSS_SIGNATURE -// --------------------------------------------------------------------------- -// -RESOURCE RSS_SIGNATURE { } - - -// -------------------------------------------------------------------------- -// AVKON_VIEW -// Main view. -// -------------------------------------------------------------------------- -// -RESOURCE AVKON_VIEW r_vimpstdetailsview_mainview - { - menubar = r_vimpstdetailsview_menubar; - cba = R_AVKON_SOFTKEYS_OPTIONS_BACK__SELECT; - } - -// --------------------------------------------------------------------------- -// r_vimpstdetailsview_menubar - -// --------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_vimpstdetailsview_menubar - { - titles = - { - MENU_TITLE - { - menu_pane = r_vimpstdetailsview_menupane; - } - }; - } - -// --------------------------------------------------------------------------- -// r_vimpstdetailsview_menupane -// --------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_vimpstdetailsview_menupane - { - - // KAiwCmdAssign AIW service cmd used as Edit Options-menu item - // set AIW commands at last - items = - { - MENU_ITEM - { - command = EVIMPSTDetailsCopyCmd; - txt = qtn_servdetail_opt_copydetail; - }, - - MENU_ITEM - { - command = EVIMPSTDetailsDeleteCmd; - txt = qtn_servdetail_opt_delete; - }, - MENU_ITEM - { - command = KAiwCmdAssign; - txt = qtn_servdetail_opt_edit; - }, - - #ifdef __SERIES60_HELP - MENU_ITEM - { - command = EAknCmdHelp; - txt = qtn_options_help; - }, - #endif // __SERIES60_HELP - MENU_ITEM - { - command = EAknCmdExit; - txt = qtn_options_exit; - } - }; - } - -RESOURCE TBUF r_servdetail_backgroundtext_header { buf = qtn_servdetail_backgroundtext_header; } - -RESOURCE TBUF r_servdetail_statustext_offline { buf = qtn_servdetail_statustext_offline; } -RESOURCE TBUF r_servdetail_statustext_online { buf = qtn_servdetail_statustext_online; } -RESOURCE TBUF r_servdetail_statustext_dnd { buf = qtn_servdetail_statustext_dnd; } -RESOURCE TBUF r_servdetail_statustext_away { buf = qtn_servdetail_statustext_away; } -RESOURCE TBUF r_servdetail_statustext_busy { buf = qtn_servdetail_statustext_busy; } -RESOURCE TBUF r_servdetail_statustext_blocked { buf = qtn_servtab_default_statustext_blocked; } -RESOURCE TBUF r_servdetail_statustext_callforward { buf = qtn_servtab_default_statustext_callforward; } - -RESOURCE TBUF r_servdetail_statustext_Onthephone { buf = qtn_servdetail_statustext_onthephone; } -RESOURCE TBUF r_servdetail_statustext_Unknown { buf = qtn_servdetail_statustext_unknown; } -RESOURCE TBUF r_servdetail_unnamed { buf = qtn_servtab_unnamed; } -RESOURCE TBUF r_servdetail_statustext_Pending { buf = qtn_servtab_invitationsent; } - -// --------------------------------------------------------------------------- -// r_detailsview_aiw_service_interests -// --------------------------------------------------------------------------- -// -RESOURCE AIW_INTEREST r_vimpstdetailsview_aiw_service_interests -{ - items= - { - AIW_CRITERIA_ITEM - { - id = KAiwCmdAssign;// serviceCmd used here also as ID - serviceCmd = KAiwCmdAssign; - contentType = EGenericParamContactLinkArrayStr; - serviceClass = KAiwClassMenu;//not working with KAiwClassBase altough used as service cmd - maxProviders = 1; - } - // Add here other possible AIW service criterias.. - }; -} - -#include "vimpstdetailfields.rss" - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/group/bld.inf --- a/uiservicetab/vimpstdetailsviewplugin/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2007-2007 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: Build information file for project ccappdetailsviewplugin -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS - -PRJ_MMPFILES - -vimpstdetailsviewplugin.mmp - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/group/vimpstdetailsviewplugin.mmp --- a/uiservicetab/vimpstdetailsviewplugin/group/vimpstdetailsviewplugin.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2008 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: Project definition file for project ccappdetailsviewplugin -* -*/ - - -#include -#include -#include "../inc/vimpstdetailsviewpluginuids.hrh" - -TARGET vimpstdetailsviewplugin.dll -TARGETTYPE PLUGIN -UID 0x10009D8D KVIMPSTDetailsViewPluginDllUid - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -SOURCEPATH ../src -// plugin classes -SOURCE cvimpstdetailsviewfactory.cpp -SOURCE cvimpstdetailsviewpluginproxy.cpp -SOURCE cvimpstdetailsviewplugin.cpp -// handlers related classes -SOURCE cvimpstdetailsviewbrandhandler.cpp -SOURCE cvimpstdetailscontacthandler.cpp -SOURCE cvimpstdetailspresencehandler.cpp -SOURCE cvimpstdetailsviewmenuhandler.cpp -// control related classes -SOURCE cvimpstdetailsviewcontainer.cpp -SOURCE cvimpstdetailsviewlistboxmodel.cpp -SOURCE cvimpstdetailsheadercontrol.cpp -SOURCE cvimpstdetailsimagedecoder.cpp -SOURCE cvimpstfieldpropertyarray.cpp -SOURCE cvimpstfieldproperty.cpp - -USERINCLUDE ../inc -USERINCLUDE ../data -USERINCLUDE ../../inc -USERINCLUDE ../../vimpstui/rss -USERINCLUDE ../../../group -USERINCLUDE ../../vimpstutils/inc - -// For context sensitive help includes -USERINCLUDE ../../../imstutils/help/inc - -APP_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE /epoc32/include/ecom - - -// resources -START RESOURCE ../data/vimpstdetailsviewpluginrsc.rss -DEPENDS vpbkeng.rsg -HEADER -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - -START RESOURCE ../data/vimpstdetailsviewplugin.rss -TARGET vimpstdetailsviewplugin.rsc -TARGETPATH ECOM_RESOURCE_DIR -END - - -LIBRARY euser.lib -LIBRARY bafl.lib -LIBRARY ecom.lib -LIBRARY cmsclient.lib -LIBRARY fbscli.lib -LIBRARY estor.lib -LIBRARY avkon.lib // notewrapper -LIBRARY aknicon.lib -LIBRARY imageconversion.lib -LIBRARY efsrv.lib -LIBRARY aknskins.lib -LIBRARY eikcoctl.lib -LIBRARY commonengine.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY eikctl.lib -LIBRARY egul.lib -LIBRARY aknskinsrv.lib - -LIBRARY aknswallpaperutils.lib -LIBRARY aknlayout2scalable.lib -LIBRARY aknlayout2.lib -LIBRARY cdlengine.lib - -LIBRARY servicehandler.lib // aiw -LIBRARY vpbkeng.lib // -LIBRARY serviceprovidersettings.lib -LIBRARY bsclient.lib // branding server -LIBRARY ccapputil.lib // cca -LIBRARY cch.lib - -// new presence cache libraries -LIBRARY presencecacheclient2.lib -LIBRARY presencecacheutils.lib -LIBRARY vimpstutils.lib -//help library -LIBRARY hlplch.lib -LIBRARY bitmaptransforms.lib - -LIBRARY flogger.lib -LIBRARY edbms.lib - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailscontacthandler.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailscontacthandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,414 +0,0 @@ -/* -* Copyright (c) 2008 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: contact handler class implementaion to virtual phonebook observers - * -*/ - - -#ifndef CVIMPSTCONTACTHANDLER_H -#define CVIMPSTCONTACTHANDLER_H - -#include -#include -#include -#include - -#include -#include -#include -#include - -// forward declaration -class CVPbkContactManager; -class MVPbkContactLinkArray; -class MVPbkContactLink; -class MVPbkStoreContact; -class MVPbkContactOperationBase; -class MVPbkContactStoreList; -class MVIMPSTDetailsViewContactObserver; -class MCCAParameter; - -enum TStoreType - { - EStoreUnkwon = -1, - EStoreLocal, - EStoreServer - }; -/** - * contact handler class implementaion to virtual phoneboo observers - * @lib vimpstdetailsviewplugin.dll - * @since S60 v5.0 - */ -class CVIMPSTDetailsContactHandler : public CActive, - public MVPbkSingleContactOperationObserver, - public MVPbkContactFindObserver, - public MVPbkContactStoreListObserver - { - - public: - - /** - * Two-phased constructor. - * @param aParameter , reference to plugin parameter - * @param aObserver , reference to contact view class - * @param aServiceStoreUri , service store name - * @return instance of same class - * @since S60 v5.0 - * - */ - static CVIMPSTDetailsContactHandler* NewL( MCCAParameter& aParameter, - MVIMPSTDetailsViewContactObserver& aObserver, - const TDesC& aServiceStoreUri, - const TDesC& aServiceName, - TUint aserviceId); - - /** - * Destructor. - * @since S60 v5.0 - */ - ~CVIMPSTDetailsContactHandler(); - - /** - * set the specified link ,it take the ownership of links. - * @param aLinks , links to set - * @param aReadXspId , need to read xsp id from contacts.cdb or not - * @since S60 v5.0 - */ - void SetLinks( MVPbkContactLinkArray* aLinks,TBool aReadXspId ); - - /** - * @return XSPuserId. - * @since S60 v5.0 - */ - const TDesC& GetXSPUserId(); - - /** - * @return List of all open store. - * @since S60 v5.0 - */ - MVPbkContactStoreList& ContactStoresL(); - - /** - * @return store type - * @since S60 v5.0 - */ - TStoreType StoreType(); - - /** - * @return current iCurrentLink. - * @since S60 v5.0 - */ - MVPbkContactLinkArray* Links() const; - - /** - * cancel the ongoing request. - * @since S60 v5.0 - */ - void CancelOngoingRequest(); - - public: // From CActive - /** - * from CActive. - * @since S60 v5.0 - */ - void RunL(); - - /** - * from CActive. - * @since S60 v5.0 - */ - TInt RunError(TInt aError); - - /** - * from CActive. - * @since S60 v5.0 - */ - void DoCancel(); - - public: // From MVPbkSingleContactOperationObserver - - /** - * from MVPbkSingleContactOperationObserver. - * Called when the operation is completed. - * - * A client has the operation as a member and it can delete the operation - * instance in this function call. If the implementation of the store - * calls the function from the operation instance it must not handle - * any member data after calling it. - * - * @param aOperation The completed operation. - * @param aContact The contact returned by the operation. - * A client must take the ownership immediately. - * - * NOTE: - * If you use CleanupStack for MVPbkStoreContact - * Use MVPbkStoreContact::PushL or - * CleanupDeletePushL from e32base.h. - * (Do Not Use CleanupStack::PushL(TAny*) because - * then the virtual destructor of the M-class - * won't be called when the object is deleted). - * @since S60 v5.0 - */ - void VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact); - - /** - * from MVPbkSingleContactOperationObserver. - * Called if the operation fails. - * - * A client has the operation as a member and it can delete the operation - * instance in this function call. If the implementation of the store - * calls the function from the operation instance it must not handle - * any member data after calling it. - * - * @param aOperation The failed operation. - * @param aError An error code of the failure. - * @since S60 v5.0 - */ - void VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& aOperation, - TInt aError); - - public: // From MVPbkContactFindObserver - /** - * Called when find is complete. Caller takes ownership of the results - * In case of an error during find, the aResults may contain only - * partial results of the find - * - * @param aResults Array of contact links that matched the find - * Callee must take ownership of this object in - * the start of the function, ie. in case the - * function leaves the results must be destroyed. - * The find operation can be destroyed at the end - * of this callback. - */ - void FindCompleteL( MVPbkContactLinkArray* aResults ) ; - - /** - * Called in case the find fails for some reason. The find operation - * can be destroyed at the end of this callback. - * - * @param aError One of the system wide error codes. - * KErrNotReady if store is not ready (not open or unavailable) - */ - void FindFailed( TInt aError ) ; - - /* - * get the display name of the contact to show in the status pane - */ - - HBufC* GetDisplayNameLC(); - - private: // From MVPbkContactStoreListObserver - - /** - * from MVPbkContactStoreListObserver - * Called when the opening process is complete. - * - * Before this all stores have sent StoreReady or StoreUnavailable - * event. The client can not trust that all stores are available - * for use when this is called. - * @since S60 v5.0 - */ - void OpenComplete(); - - /** - * from MVPbkContactStoreListObserver - * Called when a contact store is ready to use. - * - * @param aContactStore The store that is ready. - * @since S60 v5.0 - */ - void StoreReady(MVPbkContactStore& aContactStore ); - - /** - * from MVPbkContactStoreListObserver - * Called when a contact store becomes unavailable. - * - * Client may inspect the reason of the unavailability and decide - * whether or not it will keep the store opened (ie. listen to - * the store events). - * - * @param aContactStore The store that became unavailable. - * @param aReason The reason why the store is unavailable. - * This is one of the system wide error codes. - * @since S60 v5.0 - */ - void StoreUnavailable(MVPbkContactStore& aContactStore, TInt aReason ); - - /** - * from MVPbkContactStoreListObserver - * Called when changes occur in the contact store. - * - * @see TVPbkContactStoreEvent - * @param aContactStore A store whose event it is. - * @param aStoreEvent The event that has occurred. - * @since S60 v5.0 - */ - void HandleStoreEventL(MVPbkContactStore& aContactStore, TVPbkContactStoreEvent aStoreEvent ); - - - private: - - /** - * default constructor - * @param aObserver , contact observer - * @since S60 v5.0 - */ - CVIMPSTDetailsContactHandler( MVIMPSTDetailsViewContactObserver& aObserver, TUint aserviceId ); - - /** - * provides two phase constrcution. - * @param aPluginParameter , plugin parameter - * @param aServiceStoreUri , service store name - * @since S60 v5.0 - */ - void ConstructL( MCCAParameter& aParameter, const TDesC& aServiceStoreUri, const TDesC& aServiceName ); - - /** - * helper method for issue pending request. - * @param aError , error if any - * @since S60 v5.0 - */ - void IssueRequest(TInt aError = KErrNone); - - /* API to be used for local store only - * to check whether the phonebook contact is a buddy the service installed - * @ param aCurrentLink of the phonebook contact - * return ETrue if the link is a buddy of that service - * @since S60 v5.0 - */ - TBool CheckWhetherValidLocalLinkL( - const MVPbkContactLink& aCurrentLink ); - - /* API to be used for local store service only - * to check whether the local %service_name%.db (which has contact identifiers) - * exsists already - */ - TBool DbExists(); - /* API to be used for local store only - * open's the local %service_name%.db file - */ - void OpenDbL(); - - /* API to be used for local store only - * close's the local %service_name%.db file - */ - void CloseDb(); - - /* API to be used for local store only - * search the identifier aIdentifier passed in the ColNo aColNo of the db file - * return ETrue if the identifier is found in the db col - * @since S60 v5.0 - */ - TBool SeekRowL( TDbColNo aColNo, TInt32& aIdentifier ); - - /* API to be used for local store only - * open db table - * @since S60 v5.0 - */ - void OpenTableL(); - - - private: // data - - /** - * Not own : Reference to details view plugin - */ - MVIMPSTDetailsViewContactObserver& iObserver; - - /** - * own :Reference to contact manager. - */ - CVPbkContactManager* iContactManager; - - /** - * owns : reference to link array - */ - MVPbkContactLinkArray* iLinks; - - /** - * not owns : reference to contact link which is owned by iLinks - */ - const MVPbkContactLink* iCurrentLink; - - /** - * owns : reference to operation base contact - */ - MVPbkContactOperationBase* iRetrieveOperation; - - /** - * owns : extracted user id from pbk xsp id - */ - HBufC* iXSPUserId; - - /** - * owns : if ETrue , xsp id need to read - */ - TBool iReadXspId; - - /** - * owns : list of open store - */ - MVPbkContactStoreList* iStoreList; - - /** - * owns : reference to active chedular - */ - CActiveSchedulerWait iWait; - - /** - * owns : service store uri - */ - HBufC* iServiceStoreUri; - - - /** - * Owned : Pointer to MVPbkStoreContact - */ - MVPbkStoreContact* iStoreContact; - - // owns : store type - TStoreType iStoreType; - - // owns, service name - HBufC* iServiceName; - - - //Ownns - DB Store - CPermanentFileStore* iFileStore; - - //File Stream - RFs iFs; - - //DataBase Object for Creating/Opening/Closing DB - RDbStoreDatabase iDb; - - // current column set - CDbColSet* iColset; // owned - - - RDbTable iTable; // current table - - // own , contact id converter to and from link - CVPbkContactIdConverter* iIdConverter; - - TUint iServiceId; - - }; - -#endif // CVIMPSTCONTACTHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsheadercontrol.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsheadercontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Implementation of the header part control(s) of the details view layout -* -*/ - - -#ifndef CVIMPSTDETAILSHEADERCONTROL_H -#define CVIMPSTDETAILSHEADERCONTROL_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CEikImage; -class CEikLabel; -class CVIMPSTDetailsViewBrandHandler; -class MVPbkStoreContact; -class MVPbkStoreContactField; -class CVIMPSTDetailsImageDecoder; -class MVIMPSTDetailsPresenceHandler; - -// CLASS DECLARATION -/** - * Class implementing the header part control of vimpstdetailsviewplugin - * - * @lib vimpstdetailsviewplugin.dll - * @since S60 v5.0 - */ - -class CVIMPSTDetailsHeaderControl : public CCoeControl - { -public: - // Construction & destruction - /** - * Two-phased constructor - * @param aBrandHandler, Reference to brand handler class - * @param aPresenceHandler , reference presence handler - * @return a instance of this class - * @since S60 v5.0 - */ - static CVIMPSTDetailsHeaderControl* NewL(CVIMPSTDetailsViewBrandHandler& aBrandHandler, - MVIMPSTDetailsPresenceHandler& aPresenceHandler ); - - /** - * Destructor. - * @since S60 v5.0 - */ - ~CVIMPSTDetailsHeaderControl(); - -public: // FROM CCoeControl - // Functions from base classes - /** - * From CCoeControl - * Component control handling (compound control) - * @since S60 v5.0 - */ - TInt CountComponentControls() const; - - /** - * From CCoeControl - * Component control handling (compound control) - * @since S60 v5.0 - */ - CCoeControl* ComponentControl(TInt aIndex) const; - - /** - * From CoeControl - * Called by framework when the view size is changed. - * @since S60 v5.0 - */ - void SizeChanged(); - - /** - * From CoeControl - * Overridden to set the container window for child controls - * @since S60 v5.0 - */ - void SetContainerWindowL(const CCoeControl& aContainer); - - /** - * Sets the bitmap shown in the header image - * Ownership is transferred - * - * @param aBmp The bitmap - * @param aMask The bitmap mask - * @since S60 v5.0 - */ - void SetBitmap(CFbsBitmap* aBmp, CFbsBitmap* aMask ); - - /** - * Clears the texts & the image - * @since S60 v5.0 - */ - void ClearL(); - -public: - - - /** - * create the presentation for given contact - * @param aContactStore the contact store - * @since S60 v5.0 - */ - void CreateHeaderPresentationL( MVPbkStoreContact& aContact ); - - /** - * Helper function for the leaving part of changing labels size - * @since S60 v5.0 - */ - void LabelsSizeChangedL(); - /** - * Helper function for changing avatar icon in the header - * @since S60 v5.0 - */ - void HeaderSizeChangedL(); - -private: - - /** - * Constructor for performing 1st stage construction - * @param aBrandHandler , reference brand handlere - * @param aPresenceHandler , reference presence handler - * @since S60 v5.0 - */ - CVIMPSTDetailsHeaderControl(CVIMPSTDetailsViewBrandHandler& aBrandHandler, - MVIMPSTDetailsPresenceHandler& aPresenceHandler ); - - /** - * Constructor for performing 2nd stage construction - * @since S60 v5.0 - */ - void ConstructL(); - - -private: // data member - - /** - * not Owned : The label controls - */ - CVIMPSTDetailsViewBrandHandler& iBrandHandler; - - /** - * Not owned : reference to presence handler - */ - MVIMPSTDetailsPresenceHandler& iPresenceHandler; - - - /** - * Owns : The image control - */ - CEikImage* iImage; - - /** - * Owns : The bitmap - */ - CFbsBitmap* iBitmap; - - /** - * Owns : The mask - */ - CFbsBitmap* iMask; - - /** - * Owns : The label controls - */ - RPointerArray iLabels; - - - - /** - * Owns : virtual pbk field - */ - MVPbkStoreContactField* iHeaderField; - - /** - * Owns : image decoder - */ - CVIMPSTDetailsImageDecoder* iImageDecoder; - - TSize iContactImageSize; - - - }; - -#endif // CVIMPSTDETAILSHEADERCONTROL_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsimagedecoder.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsimagedecoder.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2008 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: Utility class for asynchronously decoding the header thumbnail image - * -*/ - - -#ifndef CVIMPSTDETAILSIMAGEDECODER_H_ -#define CVIMPSTDETAILSIMAGEDECODER_H_ - -#include -#include - -class CVIMPSTDetailsHeaderControl; -class CImageDecoder; -class CFbsBitmap; -class CBitmapScaler; - -/** - * Utility class for asynchronously decoding the header thumbnail image - * - * @lib vimpstdetailsviewplugin.dll - * @since S60 v5.0 - */ -class CVIMPSTDetailsImageDecoder : public CActive - { -public: - /** - * Two-phased constructor - * - * @param aHeader The header control to which the bitmap is to be inserted after loading - * @param aBitmapData Descriptor containing the bitmap data stream - * @return a instance of same class - * @since S60 v5.0 - */ - static CVIMPSTDetailsImageDecoder* NewL(CVIMPSTDetailsHeaderControl& aHeader, const TDesC8& aBitmapData); - - /** - * Destructor - * @since S60 v5.0 - */ - ~CVIMPSTDetailsImageDecoder(); - - /** - * Starts the decoding process - * @since S60 v5.0 - * - */ - void StartL(TSize aBitmapSize); - - /** - * From CActive - * (see details from baseclass ) - * @since S60 v5.0 - */ - void RunL(); - - /** - * From CActive - * (see details from baseclass ) - * @since S60 v5.0 - */ - void DoCancel(); -private: - /** - * First-phase (C++) constructor - * @param aHeader The header control to which the bitmap is to be inserted after loading - * @since S60 v5.0 - */ - CVIMPSTDetailsImageDecoder(CVIMPSTDetailsHeaderControl& aHeader); - - /** - * Second phase constructor - * @since S60 v5.0 - * @param aBitmapData Descriptor containing the bitmap data stream - */ - void ConstructL(const TDesC8& aBitmapData); - /** - * Scales bitmap - * - */ - void ScaleBitmapL(); - - enum TCcaImageDecoderState - { - ECcaConvertThumbnailImage = 1, - ECcaScaleThumbnail, - }; - - /** - * Create bitmap - * - */ - void CreateBitmapL(); - private : // data - - - /** - * Not Owns : The header control to which the bitmap is to be inserted after loading - */ - CVIMPSTDetailsHeaderControl& iHeader; - - - /** - * Owns : The image decoder whose service is called to decode the image - */ - CImageDecoder* iImgDecoder; - - /** - * Owns : Handle to the file server session for loading the bitmap - */ - RFs iFs; - - /** - * The bitmap. - * Owned until decoding is complete, then ownersip is transferred to header control. - */ - CFbsBitmap* iBitmap; // owned until completion - - /** - * Owns : Copy of the bitmap data stream - */ - HBufC8* iBitmapData; - - /** - * The image scaler whose service is called to scale the image - * Own. - */ - CBitmapScaler* iBitmapScaler; - - TSize iBitmapSize; - - /** - * Decoder internal state - */ - TInt iDecoderState; - }; - -#endif /*CVIMPSTDETAILSIMAGEDECODER_H_*/ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailspresencehandler.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailspresencehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Implementation of the presence handler -* -*/ - - -#ifndef CVIMPSTDETAILSPRESENCEHANDLER_H -#define CVIMPSTDETAILSPRESENCEHANDLER_H - -// INCLUDES -#include - -#include // handling the presence cache events -#include // buddy info class -#include "tvimpstenums.h" -#include "mvimpstdetailspresencehandler.h" - -// FORWARD DECLARATIONS -class MVIMPSTDetailsPresenceObserver; -class MPresenceBuddyInfo2; -class MPresenceCacheReader2; -class MXIMPClient; -class MXIMPContext; - -// CLASS DECLARATION -/** - * Class implementing the header part control of vimpstdetailsviewplugin - * - * @lib vimpstdetailsviewplugin.dll - * @since S60 v5.0 - */ - -class CVIMPSTDetailsPresenceHandler :public CBase, - public MVIMPSTDetailsPresenceHandler, - public MPresenceCacheReadHandler2 - { -public: - // Construction & destruction - /** - * Two-phased constructor - * @param aServiceName, service data. - * @param aObserver, presence observer - * @param aPresenceSupported, presence supported or not - * @return instance of this class - * @since S60 v5.0 - */ - static CVIMPSTDetailsPresenceHandler* NewL( const TDesC& aServiceName, - MVIMPSTDetailsPresenceObserver& aObserver, - TBool aPresenceSupported ); - - /** - * Destructor. - * @since S60 v5.0 - */ - ~CVIMPSTDetailsPresenceHandler(); - - -public: // from MVIMPSTDetailsPresenceHandler - - /** - * from MVIMPSTDetailsPresenceHandler - * fetch presence from cache - * @since S60 v5.0 - */ - void SubscribePresenceL(const TDesC& aUserId ); - - /** - * from MVIMPSTDetailsPresenceHandler - * return the presence status - * @since S60 v5.0 - */ - TVIMPSTEnums::TOnlineStatus GetPresenceStatus(); - - - /** - * from MVIMPSTDetailsPresenceHandler - * @param aIndex , index of the control - * @return Label for control - * @since S60 v5.0 - */ - const TDesC& GetHeaderLabelDataL( TInt aIndex ); - - /** - * from MVIMPSTDetailsPresenceHandler - * @return the presence status message - * @since S60 v5.0 - */ - const TDesC& GetStatusMessageL(); - - /** - * function to get supported or not - * @since S60 v5.0 - * @return ETrue if supported - */ - TBool IsSupported() const ; - - -public: // prescachereadhandler - - /** - * Handler for AllBuddiesPresenceInService method of MPresenceCacheReader. - * - * @param aErrorCode - * @param aPresenceBuddyInfoList presence infos for all buddies requested. - * Ownership of elements to callee. Can be empty if not found. - */ - void HandlePresenceReadL(TInt aErrorCode, - RPointerArray& aPresenceBuddyInfoList) ; - - /** - * Handler for Buddy presence change notifications. - * - * @param aErrorCode - * @param aPresenceBuddyInfo presence info for buddy. - * Ownership to callee. Can be NULL if aErrorCode exist. - */ - void HandlePresenceNotificationL(TInt aErrorCode, - MPresenceBuddyInfo2* aPresenceBuddyInfo); - - -private: - - /** - * Constructor for performing 1st stage construction - * @param aObserver, presence observer - * @param aPresenceSupported, check for PresenceSupported or not - * @since S60 v5.0 - */ - CVIMPSTDetailsPresenceHandler(MVIMPSTDetailsPresenceObserver& aObserver, - TBool aPresenceSupported ); - - /** - * Constructor for performing 2nd stage construction - * @param aServiceName, service data. - * @since S60 v5.0 - */ - void ConstructL( const TDesC& aServiceName ); - - /** - - /** - * Converts the presence cache status to client supported presence status. - * - * @since 5.0 - * @param aAvailabilityEnum presence cache status value. - * @param aAvabilityText avability text,to support multiple presence states. - * @return TVIMPSTEnums::TOnlineStatus client presence status. - */ - void ConvertPresenceCacheEnums(MPresenceBuddyInfo2::TAvailabilityValues aAvailabilityEnum, TPtrC aAvabilityText); - - /** - * Helper function for the setting the status text and status - * @param aStatusMessage, status message . - * @since S60 v5.0 - */ - void ProcessStatusMesssageL(const TDesC& aStatusMessage ); - - - /** - * function to get the label text - * @since S60 v5.0 - * @return status text - */ - const TDesC& GetStatusTextL(); - - /** - * Converts the presence cache extension keys - * user for block and pending states to client supported presence status. - * - * @since 5.0 - * @param aPresenceBuddyInfo presence buddy info class. - */ - void GetKeyFieldsAndValuesL(MPresenceBuddyInfo2& aPresenceBuddyInfo); - - - -private: // data member - - // not owns: reference to presence observer - MVIMPSTDetailsPresenceObserver& iPresenceObserver; - // Owns : ximp client - MXIMPClient* iXIMClient ; - //Own : ximp context - MXIMPContext* iPresenceContext; - //owns : pointer to presence read interface - MPresenceCacheReader2* iPresenceCacheReader; - // owns, service name - HBufC* iServiceName; - // owns, user id - HBufC* iUserId; - - // owns, status message from server if any - HBufC* iStatusMessage; - - // owns, status text , online/offline etc - HBufC* iStatusText; - - // owns, status - TVIMPSTEnums::TOnlineStatus iStatus; - // owns, presence supported or not - TBool iPresenceSupported; - - }; - -#endif // CVIMPSTDETAILSPRESENCEHANDLER_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewbrandhandler.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewbrandhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,216 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview contact brand data - * -*/ - - - -#ifndef CVIMPSTDETAILSVIEWBRANDHANDLER_H -#define CVIMPSTDETAILSVIEWBRANDHANDLER_H - -// INCLUDES -#include -#include -#include -#include "spdefinitions.h" -//Forward Declarations -class CBSFactory; -class MBSAccess; -class CSPSettings; -// CLASS DECLARATION - -/** - * Brand handler implemenation class - * - * @lib vimpstdetailsviewplugin.dll - * @since 5.0 - */ -class CVIMPSTDetailsViewBrandHandler : public CBase - { - public: // Constructors and destructor - - - /** - * Two-phased constructor. - * @param aServiceId , service Id - * @return a pointer to this class - * @since s60 v5.0 - **/ - static CVIMPSTDetailsViewBrandHandler* NewL(TInt aServiceId); - - - /** - * Destructor. - * @since s60 v5.0 - **/ - virtual ~CVIMPSTDetailsViewBrandHandler(); - public: // New Functions - - /** - * Loads necessary icons for this decorator - * @return Icon array. Ownership is transferred. - * @since s60 v5.0 - **/ - CAknIconArray* LoadIconsLC( ); - - /** - * Loads necessary icons for this decorator - * @param aBitmap ,bitmap - * @param aMask , mask - * @param aBitmapId bitmap Id - * @param aMaskId : mask Id - * @since s60 v5.0 - **/ - void LoadBitMapLC(CFbsBitmap*& aBitmap, - CFbsBitmap*& aMask, - TInt aBitmapId, - TInt aMaskId ); - - /** - * read the service name from settings - * @param aServiceName , reference to service name - * @since s60 v5.0 - **/ - void GetServiceNameL( TDes& aServiceName ); - - /** - * read the service store name from settings - * @return aServiceStoreUri , reference to service store uri with cnt path - * @since s60 v5.0 - **/ - const TDesC& ServiceStoreUriL(); - - /** - * read if service supported from cch - * @return ETrue if service supported - * @since s60 v5.0 - **/ - TBool ServiceSupportedL( ); - - /** - * constructs branded icons for this decorator - * @param aId id of the bitmap to be fetchec from the Branding server. - * @return Icon. - * @since s60 v5.0 - **/ - CGulIcon* LoadBrandBitmapL( const TDesC8& aId ); - - private: - - - /** - * Loads brand icons for this decorator - * @return Icon array. Ownership is transferred. - * @since s60 v5.0 - **/ - CAknIconArray* LoadBrandIconsLC( ); - - - /** - * Loads default icons for this decorator - * @param aMbmFile Bitmap file - * @return Icon array. Ownership is transferred. - * @since s60 v5.0 - **/ - CAknIconArray* LoadDefaultIconsLC(const TDesC& aMbmFile ); - - - - /** - * constructs necessary icons for this decorator - * @param aBitmapId bitmapId - * @param aMaskId maskId - * @param aFullPath Bitmap path - * @return Icon. - * @since s60 v5.0 - **/ - CGulIcon* LoadDefaultBitmapL( TInt aBitmapId, - TInt aMaskId, - const TDesC& aFullPath ); - - - /** - * C++ default constructor. - * @param aContacts Pointer to contacts-API - * @since s60 v5.0 - */ - CVIMPSTDetailsViewBrandHandler(TInt aServiceId); - - /** - * By default Symbian OS constructor is private. - * @since s60 v5.0 - */ - void ConstructL(); - - /** - * Prepares branding access - * @return KErrNone if sucessfull, else the Error. - * @since S60 5.0 - */ - TInt PrepareBrandingAccess(); - - /** - * get the brand info from settings - * @return KErrNone if sucessfull, else the Error. - * @since S60 5.0 - */ - TInt GetBrandInfoL(TLanguage& aBrandLanguage, - TInt &aBrandVersion, TDes8& aBrandId); - /** - * get the brand version from settings - * @param aServiceId service id - * @param aBrand , Brand to get - * @param aPropertyName , property name - * @return KErrNone if sucessfull, else the Error. - * @since S60 5.0 - */ - void PropertyReadBrandL( TUint32 aServiceId ,TInt &aBrand, - TServicePropertyName aPropertyName ); - - private: // Data - - // Not own. Settings id of the service.. - const TDesC8& iAppId; - - // Not own. Settings id of the service.. - HBufC8* iBrandId; - - // Not own. Settings id of the service.. - TLanguage iLanguageId; - - //Owns, handle to brnadingfactory. - CBSFactory* iBrandingFactory; - - //Owns, handle to brandaccessor - MBSAccess* iBrandingAccess; - - //stores the default MBM path - TFileName iDefaultMbmPath; - - // owns : service id - TInt iServiceId; - - // owns : settings - CSPSettings* iSettings ; - - // owns : service store uri - HBufC* iServiceStoreUri; - - - }; - -#endif // CVIMPSTDETAILSVIEWBRANDHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewcontainer.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewcontainer.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,254 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview plugin control container - * -*/ - - -#ifndef CVIMPSTDETAILSVIEWCONTAINER_H -#define CVIMPSTDETAILSVIEWCONTAINER_H - -// INCLUDES -#include -#include -#include -#include "cvimpstdetailscontacthandler.h" - -// forward declaration -class CVIMPSTDetailsViewListBoxModel; -class CVIMPSTDetailsViewBrandHandler; -class CVIMPSTDetailsHeaderControl; -class MEikListBoxObserver; -class CAknsBasicBackgroundControlContext; -class RResourceFile; -class MVIMPSTDetailsPresenceHandler; -class MVPbkStoreContact; - -// CLASS DECLARATION - -/** - * Class implementing CCCAppViewPluginAknContainer interface from cca. This is - * this class is responsible for creating the control to show - * this creates the two control , one is header and another is list box - * - * @lib vimpstdetailsviewplugin.dll - * @since S60 v5.0 - */ - -class CVIMPSTDetailsViewContainer : public CCCAppViewPluginAknContainer, - public MEikListBoxObserver -{ -public: - - /** - * Constructor. This is called from plugin class NewContainerL. - * @param aPluginUid, plugin uid - * @param aBrandHandler, reference to brand handler - * @param aLaunchParameter, reference to presence handler - * @param aFocusedListIndex, field index to focus - */ - CVIMPSTDetailsViewContainer(const TUid& aPluginUid, - CVIMPSTDetailsViewBrandHandler& aBrandHandler , - MVIMPSTDetailsPresenceHandler& aPresenceHandler, - TInt aFocusedListIndex ); - - /** - * Destructor. - */ - virtual ~CVIMPSTDetailsViewContainer(); - -public: // from base class CCCAppViewPluginAknContainer - - /** - * From CCoeControl - * (see details from baseclass ) - * @param aRect, a rect layout - */ - void Draw( const TRect& aRect ) const; - - /** - * From CCoeControl - * (see details from baseclass ) - */ - virtual void SizeChanged(); - - - /** - * From CCoeControl - * (see details from baseclass ) - * @param aId, object type uid - */ - TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); - - /** - * From CCoeControl - * (see details from baseclass ) - * @param aDrawNow, reference to draNow class - */ - void FocusChanged( TDrawNow aDrawNow ); - - - /** - * From CCCAppViewPluginAknContainer. - * (see baseclass for details) - * @return control count - * @since S60 v5.0 - */ - TInt CountComponentControls() const; - - /** - * From CCCAppViewPluginAknContainer. - * (see baseclass for details) - * @param aIndex, index of control - * @return selected control - * @since S60 v5.0 - */ - CCoeControl* ComponentControl(TInt aIndex) const; - - /** - * From CCCAppViewPluginAknContainer. - * (see baseclass for details) - * @param aKeyEvent, a event - * @param aType, a event type - * @return key response - * @since S60 v5.0 - */ - TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); - - /** - * From CCoeControl - * (see details from baseclass ) - * @param aContext, a reference to help context - */ - void GetHelpContext(TCoeHelpContext& aContext) const; - - /** - * From MEikListBoxObserver - * (see details from baseclass ) - * @param aListBox, a pointer to list box - * @param aEventType, alist box event type - */ - void HandleListBoxEventL( CEikListBox *aListBox, TListBoxEvent aEventType ); - -public: - - /** - * Helper function to get listbox. - * - * @see CAknDoubleStyleListBox - * @since S60 5.0 - * @return reference to listbox object. - */ - CAknFormDoubleGraphicStyleListBox& ListBox() const; - - /** - * Helper function to get (temporary) listbox model. - * - * @see CVIMPSTDetailsViewListBoxModel - * @since S60 5.0 - * @return reference to listbox model object. - */ - CVIMPSTDetailsViewListBoxModel& ListBoxModel() const; - - /** - * called from plugin - * notification call back from presence handler about presence change - * @since s60 v5.0 - */ - void PresenceChangedL() ; - - /** - * contact retrived - * @param aContact, a contact fetched from store - */ - void CreatePresentationL( MVPbkStoreContact& aContact,TDesC& aServiceName,TStoreType aStoreType ) ; - - /** - * show no data in view - */ - void CreateEmptyPresentationL() ; - - /** - * create the title text based on service store typoe - * @param aStoreType, store type - * object is pushed on clean up stack if valid - * @return HBufC pointer , Ownership is given to caller - */ - HBufC* GetTitleTextLC( TStoreType aStoreType ); - -private: - - - // Called by ccapplication framework - void ConstructL(); - - /** - * See more details from CCoeControl. - * @param aType, resource type - */ - void HandleResourceChange(TInt aType); - - -private: // data - - /** - * not owns : Reference to plugin uid. - */ - const TUid& iPluginUid; - - /** - * not owns : Reference to barnd handler - */ - CVIMPSTDetailsViewBrandHandler& iBrandHandler; - - /** - * not Owns : reference to presence - */ - MVIMPSTDetailsPresenceHandler& iPresenceHandler; - - /** - * owns : pointer to the list box - */ - CAknFormDoubleGraphicStyleListBox* iListBox; - - /** - * owns : pointer to the list box model - */ - CVIMPSTDetailsViewListBoxModel* iListBoxModel; - - /** - * owns : Reference to plugin uid. - */ - CVIMPSTDetailsHeaderControl* iHeaderCtrl; - - /** - * owns : pointer to background context - */ - CAknsBasicBackgroundControlContext* iBackground; - - /** - * Owns : focus field index in the display list - */ - TInt iFocusedListIndex; - - /** - * owns : resource files - */ - RResourceFile iResourceFile; - - }; - -#endif // CVIMPSTDETAILSVIEWCONTAINER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewlistboxmodel.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewlistboxmodel.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview plugin control data model - * -*/ - - -#ifndef CVIMPSTDETAILSVIEWLISTBOXMODEL_H -#define CVIMPSTDETAILSVIEWLISTBOXMODEL_H - -#include -#include - -#include -#include -#include "tvimpstenums.h" -#include "mvimpstdetailspresencehandler.h" -#include "cvimpstdetailscontacthandler.h" -// forward declaration -class CEikListBox; -class MVPbkStoreContact; -class CVIMPSTFieldPropertyArray; -class CVIMPSTFieldProperty; -class MVIMPSTDetailsPresenceHandler; - -// constants declaraion -const TInt KCacheGranularity = 4; -const TInt KBufferSize = 256; -_LIT(KTabLit, "\t"); -_LIT(KSlash, "/"); -_LIT(KAt, "@"); -_LIT(KColon, ":"); -_LIT(KSpace," "); - -/** - * list box model class implemenation for list box items - * @lib vimpstdetailsviewplugin.dll - * @since S60 v5.0 - */ -class CVIMPSTDetailsViewListBoxModel : public CBase, - public MDesCArray - { - - public: - - /** - * Two-phased constructor. - * @param aListBox, reference to the list box - * @param aPresenceHandler, reference to presence handler - * @param aFieldBuffer, pointer to a stream buffer - * @return Pointer of CVIMPSTDetailsViewListBoxModel class - * @since s60 v5.0 - */ - static CVIMPSTDetailsViewListBoxModel* NewL( CEikListBox& aListBox, - MVIMPSTDetailsPresenceHandler& aPresenceHandler, - HBufC8* aFieldBuffer ); - /** - * Destructor. - * @since s60 v5.0 - */ - ~CVIMPSTDetailsViewListBoxModel(); - - - /** - * Get field index of focused list item - * @return focus field index. - * @since s60 v5.0 - */ - TInt FocusedFieldIndex(); - - /** - * set field index focused list item - * @param aIndex, field index. - * @since s60 v5.0 - */ - void SetFocusedListIndex(TInt aIndex); - - /** - * @return the focus field - * @since s60 v5.0 - */ - CVIMPSTFieldProperty& FocusField(); - - /** - * return the field array - * @since s60 v5.0 - */ - CVIMPSTFieldPropertyArray& FieldsArray(); - - - /** - * From MDesCArray - * (see details from header) - * - * @since S60 v5.0 - */ - TInt MdcaCount() const; - - - /** - * function for creating the presentation contact - * @param aContactStore the contact store - * @param aFocusFieldIndex focus field index - * @since S60 v5.0 - */ - void CreateListPresentationL( MVPbkStoreContact& aContact, - TInt aFocusFieldIndex,TDesC& aServiceName, TStoreType aStoreType); - - /** - * Helper function for adding contact field items to - * listbox data model. - * - * @since S60 v5.0 - */ - void AddFieldsDataL(); - - - /** - * set the empty text to list box - * @since S60 v5.0 - */ - void SetEmptyTextsToListboxL(); - - - /** - * helper removing domain part - * @param aId, id to use - * @param aListHiding,ETrue if hide domain part - * @since S60 v5.0 - */ - TPtrC DisplayId( const TDesC& aId, TBool aListHiding = EFalse ); - - - /** - * return the field count - * @since S60 v5.0 - */ - TInt FieldsCount(); - - - private: - - /** - * From MDesCArray - * (see details from header) - * @param aIndex, index of item - * @since S60 v5.0 - */ - TPtrC MdcaPoint(TInt aIndex) const; - - private: - - /** - * default constructor - * @param aListBox, reference to the list box - * @param aPresenceHandler, reference to presence handler - * @param aFieldBuffer, pointer to a stream buffer - * @since S60 v5.0 - */ - CVIMPSTDetailsViewListBoxModel( - CEikListBox& aListBox, - MVIMPSTDetailsPresenceHandler& aPresenceHandler, - HBufC8* aFieldBuffer ); - /** - * provide two phase construction - * @since S60 v5.0 - */ - void ConstructL(); - - - - private: - // data - - /** - * not owns : Reference to listbox. - */ - CEikListBox& iListBox; - - /** - * Not owned : reference to presence handler - */ - MVIMPSTDetailsPresenceHandler& iPresenceHandler; - - /** - * Owns : Pointer to listbox data. - */ - CDesCArray* iTextCache; - - /** - * Owns : Pointer to field array - */ - CVIMPSTFieldPropertyArray* iFieldArray; - - - /** - * Owns : Pointer to stream buffer - */ - HBufC8* iFieldBuffer; - - - }; - -#endif // CVIMPSTDETAILSVIEWLISTBOXMODEL_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewmenuhandler.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewmenuhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview plugin menu handler - * -*/ - - -#ifndef CVIMPSTDETAILSVIEWMENUHANDLER_H -#define CVIMPSTDETAILSVIEWMENUHANDLER_H - -#include -#include -#include "cvimpstdetailscontacthandler.h" - -class CVIMPSTDetailsViewPlugin; -class CAiwServiceHandler; -/** - * Class implementing vimpstdetailsviewplugin menu functionality - * - * @lib vimpstdetailsviewplugin.dll - * @since S60 v3.2 - */ - -class CVIMPSTDetailsViewMenuHandler : public CBase, public MAiwNotifyCallback - { - - public: - - /** - * Two-phased constructor. - * @param aPlugin, reference to CVIMPSTDetailsViewPlugin class - * @param aStoreType, store type to indicate wether server contact store or local store - * @return Pointer to this class - * @since S60 v5.0 - */ - - static CVIMPSTDetailsViewMenuHandler* NewL(CVIMPSTDetailsViewPlugin& aPlugin, - TStoreType aStoreType ); - - /** - * Destructor. - * @since S60 v5.0 - */ - ~CVIMPSTDetailsViewMenuHandler(); - - public: // from base class CCCAppViewPluginBase - - /** - * From CCCAppViewPluginBase - * (see details from header) - * @param aResourceId, a resource id - * @param aMenuPane, reference to menu pane - * @since S60 v5.0 - */ - void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); - - /** - * From CCCAppViewPluginBase - * (see details from header) - * @param aCommand, a command id to handle - * @since S60 v5.0 - */ - void HandleCommandL(TInt aCommand); - - private: - - - /** - * edit the selected field - * - * @since S60 v5.0 - */ - void DoEditCmdL(); - - /** - * delete the contact - * - * @since S60 v5.0 - */ - - void DoDeleteCmdL(); - - /** - * copy the clip board of selected field - * - * @since S60 v5.0 - */ - void DoCopyCmdL(); - - /** - * Prepares plugin for AIW-menu usage - * - * @since S60 v5.0 - */ - void PrepareAiwMenusL(); - - private: // constructors - - /** - * default constructor - * @param aPlugin, reference to CVIMPSTDetailsViewPlugin class - * @param aStoreType, store type to indicate wether server contact store or local store - * @since S60 v5.0 - */ - CVIMPSTDetailsViewMenuHandler(CVIMPSTDetailsViewPlugin& aPlugin, - TStoreType aStoreType); - - /** - * provide the two phase construction - * - * @since S60 v5.0 - */ - void ConstructL(); - - public: // From MAiwNotifyCallback - - /** - * call back method for aiwcommands. MAiwNotifyCallback - * @param aCmdId, id of the aiwcommand - * @param aEventId, event id of the aiw command - * @param EventParamList, callback data is passed - * @param aInParamList, aiw command params - * @since S60 v5.0 - */ - TInt HandleNotifyL( - TInt aCmdId, - TInt aEventId, - CAiwGenericParamList& aEventParamList, - const CAiwGenericParamList& aInParamList); - private: // data - - /** - * Not Owns : reference to class handling the view - */ - CVIMPSTDetailsViewPlugin& iPlugin; - - /** - * Pointer to AIW service handler - * Own. - */ - CAiwServiceHandler* iAiwServiceHandler; - - // owns : store type - TStoreType iStoreType; - }; - - #endif // CVIMPSTDETAILSVIEWMENUHANDLER_H - - // End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewplugin.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewplugin.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,275 +0,0 @@ -/* -* Copyright (c) 2008 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: View plugin base class of ECE's CCA-application - * -*/ - - -#ifndef CVIMPSTDETAILSVIEWPLUGIN_H -#define CVIMPSTDETAILSVIEWPLUGIN_H - -#include - -#include -#include "mvimpstdetailsviewcontactobserver.h" -#include "mvimpstdetailspresencehandler.h" - -// Forward declaration -class CVIMPSTDetailsViewMenuHandler; -class CVIMPSTDetailsViewBrandHandler; -class MVIMPSTDetailsPresenceObserver; -class MVIMPSTDetailsViewContactObserver; -class MVIMPSTDetailsPresenceHandler; -class CVIMPSTDetailsContactHandler; - -class MVPbkStoreContact; -class MCCAParameter; -class CAknIcon; - - -/** - * Class implementing CCCAppViewPluginBase interface. This is - * the main class and controlling the other classes of the plugin. - * - * @lib vimpstdetailsviewplugin.dll - * @since S60 v5.0 - */ - -class CVIMPSTDetailsViewPlugin : public CCCAppViewPluginBase, - public MVIMPSTDetailsPresenceObserver, - public MVIMPSTDetailsViewContactObserver - { - public: - - /** - * Two-phased constructor. - */ - static CVIMPSTDetailsViewPlugin* NewL(TInt aServiceId); - - /** - * Destructor. - */ - ~CVIMPSTDetailsViewPlugin(); - - private: - - // from base class CCCAppViewPluginBase - - /** - * From CCCAppViewPluginBase - * (see details from header) - * @param aPluginParameter, reference to plugin parameter - * @since S60 v5.0 - */ - void PreparePluginViewL(MCCAppPluginParameter& aPluginParameter); - - /** - * From CCCAppViewPluginBase - * (see details from header) - * - * Note: This will be removed. - * @since S60 v5.0 - */ - TUid ImplementationUid(); - - /** - * From CCCAppViewPluginBase - * (see details from header) - * @param aIconType, reference to icon type - * @param aBitmap, reference to bitmap pointer - * @param aBitmapMask, reference to mask pointer - * @since S60 v5.0 - */ - void ProvideBitmapLC(TCCAppIconType aIconType, CFbsBitmap*& aBitmap, - CFbsBitmap*& aBitmapMask); - - /** - * From CCCAppViewPluginBase - * NEW API - * @param aIconType, reference to icon type - * @param aIcon, reference to icon - */ - void ProvideBitmapL(TCCAppIconType aIconType, CAknIcon& aIcon); - - /** - * From CCCAppViewPluginBase - * (see details from header) - * create the container class - * @since S60 v5.0 - */ - void NewContainerL(); - - /** - * From CCCAppViewPluginBase - * (see details from header) - * @param aResourceId, a resource id - * @param aMenuPane, reference to menu pane - * @since S60 v5.0 - */ - void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane); - - /** - * From CCCAppViewPluginBase - * (see details from header) - * @param aCommand, a command id to handle - * @since S60 v5.0 - */ - void HandleCommandL(TInt aCommand); - - /** - * From CCCAppViewPluginBase - * (see details from header) - * @return the plugin uid - * @since S60 v5.0 - */ - TUid Id() const; - - /** - * From CCCAppViewPluginBase - * @param aPrevViewId, previous view id - * @param aCustomMessageId, a custom message id - * @param aCustomMessage, a custom message - */ - void DoActivateL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - /** - * From CCCAppViewPluginBase - */ - void DoDeactivate(); - - public: // new - - /** - * Helper function for get the reference - * to container data. - * - * @since S60 v5.0 - * return container - */ - inline const CCCAppViewPluginAknContainer& GetContainer() - { - return *iContainer; - } - /** - * Helper function for get contact handler - * - * @since S60 v5.0 - * return iContactHandler - */ - CVIMPSTDetailsContactHandler* GetContactHandler(); - - public : // from MVIMPSTDetailsPresenceObserver - - /** from MVIMPSTDetailsPresenceObserver - * notification call back from presence handler about presence change - * @since s60 v5.0 - */ - void HandlePresenceChangedL() ; - - public : // MVIMPSTDetailsViewContactObserver - - /** - * From MVIMPSTDetailsViewContactObserver - * call back from contact manager - * @param aContact, a contact fetched from store - */ - void HandleContactReadyL( MVPbkStoreContact& aContact ) ; - - /** - * From MVIMPSTDetailsViewContactObserver - * call back from contact manager - * @param aContact, a contact fetched from store - */ - void HandleContactUnavailableL() ; - - private: // new - - /** - * Helper function for reading and - * loading resources needed by plugin. - * - * @since S60 v5.0 - */ - void PrepareViewResourcesL(); - - /** - * default constructor - * @since S60 v5.0 - */ - CVIMPSTDetailsViewPlugin(TInt aServiceId); - - /** - * providing the two phase construction - * @since S60 v5.0 - */ - void ConstructL(); - - /** - * Helper function for reading - * contact data from passed link . - * @since S60 v5.0 - */ - void GetContactDataL(); - - - /** - * set title text - * @since S60 v5.0 - */ - void SetTitleL(); - - - private: // data - - /** - * owns : pointer to commlauncher's menuhandler - */ - CVIMPSTDetailsViewMenuHandler* iMenuHandler; - - /** - * not Owns : Pointer to launch parameter - */ - MCCAParameter* iLaunchParameter; - - /** - * Owns : focus field index in the display list - */ - TInt iFocusedListIndex; - - /** - * Owns : service id to use - */ - TInt iServiceId; - /** - * Owns : pointer to brand data handler - */ - CVIMPSTDetailsViewBrandHandler* iBrandHandler; - - /** - * owned : pointer to presence handler - */ - MVIMPSTDetailsPresenceHandler* iPresenceHandler; - - /** - * Owns : pointer to contact handling from virtual phonebook - */ - CVIMPSTDetailsContactHandler* iContactHandler; - - }; - -#endif // CVIMPSTDETAILSVIEWPLUGIN_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewpluginfactory.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewpluginfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* Copyright (c) 2008 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: View plugin base class of ECE's CCA-application - * -*/ -#ifndef CVIMPSTDETAILSVIEWPLUGINFACTORY_H_ -#define CVIMPSTDETAILSVIEWPLUGINFACTORY_H_ - -#include -#include - -/** - * Class implementing MCcaPluginFactory interface. - */ - -// High codescanner warning ignored. do not derive this class from CBase -// deriving this class from CBase will cause a crash. to be analysed -class CVIMPSTDetailsViewPluginFactory: public MCcaPluginFactory, - public CBase - - { -public: - - /** - * Create interface - */ - //static MCcaPluginFactory* NewL(); - static CVIMPSTDetailsViewPluginFactory* NewL(); - - /** - * From MCcaPluginFactory - */ - TInt TabViewCount(); - - /** - * From MCcaPluginFactory - */ - CCCAppViewPluginBase* CreateTabViewL( TInt aIndex ); - - /* - * destructor - */ - ~CVIMPSTDetailsViewPluginFactory(); - - -private: - - /* - * constructor - */ - CVIMPSTDetailsViewPluginFactory(); - - - /* - * 2- Phase constructor - */ - void ConstructL(); - - /** - * Helper function for reading the service id from sttings - * @since S60 v5.0 - */ - TInt ReadServiceIdL(); - -private: - /** - * Owns : service id to use - */ - RArray< TInt32 > iServiceIds; - TInt iServiceId; - }; - - - -#endif /* CVIMPSTDETAILSVIEWPLUGINFACTORY_H_ */ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstfieldproperty.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstfieldproperty.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* Copyright (c) 2008 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: a single field with property - * -*/ - - -#ifndef CVIMPSTFIELDPROPERTY_H -#define CVIMPSTFIELDPROPERTY_H - -// INCLUDE FILES -#include - -// FORWARD DECLARATIONS -class TResourceReader; -class MVPbkFieldTypeList; -class CVIMPSTFieldPropertyArray; -class MVPbkStoreContactField; -class MVPbkFieldType; -class MVPbkBaseContactField; - -//class MVPbkContactFieldData; -/** - * details view field property. - * Field property for a im details field type. - * Field property contains data for contact field presentation - * in the UI. - * @since s60 v5.0 - */ -class CVIMPSTFieldProperty : public CBase - { - friend class CVIMPSTFieldPropertyArray; - - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aFieldId field id - * @param aIconId icon id - * @param aMaxLength max lable length - * @param aDefaultLabel default label - * @return A new instance of this class. - * @since s60 v5.0 - */ - static CVIMPSTFieldProperty* NewLC(TInt aFieldId, TInt aIconId, TInt aMaxLength, const TDesC& aDefaultLabel ); - - /** - * Destructor. - * @since s60 v5.0 - */ - ~CVIMPSTFieldProperty(); - - public: // Interface - - - /** - * set the MVPbkStoreContactField - * @param aField, to set - * @since s60 v5.0 - */ - void SetStoredFieldL(MVPbkStoreContactField& aField ) ; - - public: // From MPbk2FieldProperty - - - /** - * @return icon id - * @since s60 v5.0 - */ - TInt IconId() ; - - /** - * @return default label if exist other wise field label - * @since s60 v5.0 - */ - const TDesC& DefaultLabelL() ; - - /** - * @return field id - * @since s60 v5.0 - */ - TInt FieldId() ; - - /** - * @return field data - * @since s60 v5.0 - */ - const TDesC& FieldDataL(); - - /** - * Set the field data - * @param aText, to set - * @since s60 v5.0 - */ - void SetFieldTextL(const TDesC& aText ); - - private: // Implementation - /** - * default constructor - * @param aFieldId field id - * @param aIconId icon id - * @param aMaxLength max lable length - * @param aDefaultLabel default label - * @since s60 v5.0 - */ - CVIMPSTFieldProperty(TInt aFieldId, TInt aIconId, TInt aMaxLength ); - - /** - * provide two phase contructions - * @param aReader Resource reader pointed to a - * VIMPST_FIELD_PROPERTY - * structure. - * @param aSupportedFieldTypeList List of supported field types. - * @since s60 v5.0 - */ - void ConstructL(const TDesC& aDefaultLabel); - - private: // Data - // owns : field id - TInt iFieldId; - /// Own: Index of an icon - TInt iIconId; // STRUCT iconId - // owns : max lable length - TInt iMaxLength; - // Own: Default label for the field - HBufC* iDefaultLabel; // LTEXT defaultLabel - // owns : virtual pbk field - MVPbkStoreContactField* iField; - /// Own: field data - HBufC* iFieldData; - - }; - -#endif // CVIMPSTFIELDPROPERTY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/cvimpstfieldpropertyarray.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/cvimpstfieldpropertyarray.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* Copyright (c) 2008 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: Field property array for service details view field types. - * -*/ - - -#ifndef CVIMPSTFIELDPROPERTYARRAY_H -#define CVIMPSTFIELDPROPERTYARRAY_H - -// INCLUDE FILES -#include -#include "cvimpstdetailscontacthandler.h" - -// FORWARD DECLARATIONS -class TResourceReader; -class MVPbkFieldTypeList; -class CVIMPSTFieldProperty; -class MVPbkStoreContact; -// CLASS DECLARATION - -/** - * Field property array for service details view field types. - * part of vimpstdetailsviewplugin.dll - * @since s60 v5.0 - */ -class CVIMPSTFieldPropertyArray : public CBase - { - public: // Construction and destruction - - /** - * Creates a new instance of this class. - * - * @param aSupportedFieldTypeList , A list of field types. - * If this is the master fieldtype - * list then all the properties - * are loaded, otherwise only those - * properties that have the field - * type in the list are loaded. - * @param aContact , store contact - * @param aReader, resource reader reference - * @aParam aPresenceSupported, check for presence supported or not - * @return A new instance of this class. - * @since s60 v5.0 - */ - static CVIMPSTFieldPropertyArray* NewL( - const MVPbkFieldTypeList& aSupportedFieldTypeList,MVPbkStoreContact& aContact, - TResourceReader& aReader , - TBool aPresenceSupported , - TDesC& aServiceName, TStoreType aStoreType); - - - /** - * Destructor. - * @since s60 v5.0 - */ - ~CVIMPSTFieldPropertyArray(); - - public: - - /** - * @return the field count. - * @since s60 v5.0 - */ - TInt Count() const; - - /** - * @param aIndex , index of field - * @return the field located at aIndex . - * @since s60 v5.0 - */ - CVIMPSTFieldProperty& At(TInt aIndex ) const; - - /** - * @param aFieldId , index of field - * @return the field find field by id - * @since s60 v5.0 - */ - CVIMPSTFieldProperty* GetFieldById( TInt aFieldId ) ; - - - private: // Implementation - - /** - * @param aFieldId , index of field - * @return the field find field by id - * @since s60 v5.0 - */ - CVIMPSTFieldPropertyArray(MVPbkStoreContact& aContact ); - - /** - * provide two phase contructions - * @param aSupportedFieldTypeList , A list of field types. - * If this is the master fieldtype - * list then all the properties - * are loaded, otherwise only those - * properties that have the field - * type in the list are loaded. - * @param aReader, resource reader reference - * @aParam aPresenceSupported, check for presence supported or not - * @since s60 v5.0 - */ - void ConstructL( - const MVPbkFieldTypeList& aSupportedFieldTypeList, - TResourceReader& aReader, - TBool aPresenceSupported, - TDesC& aServiceName, TStoreType aStoreType); - - /** - * helper function to read the feld from resource - * @param aSupportedFieldTypeList , A list of field types. - * If this is the master fieldtype - * list then all the properties - * are loaded, otherwise only those - * properties that have the field - * type in the list are loaded. - * @param aReader, resource reader reference - * @aParam aPresenceSupported, check for presence supported or not - * @since s60 v5.0 - */ - void ReadFieldPropertiesL( TResourceReader& aReader, - const MVPbkFieldTypeList& aSupportedFieldTypeList, - TBool aPresenceSupported, - TDesC& aServiceName, TStoreType aStoreType); - - private: // Data - /// Own: Field properties - RPointerArray iFieldProperties; - - // Not Owns : reference to StoreContact - MVPbkStoreContact& iContact; - - }; - -#endif // CVIMPSTFIELDPROPERTYARRAY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/mvimpstdetailspresencehandler.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/mvimpstdetailspresencehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2008 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: observer class for contact -* -*/ - - -#ifndef MVIMPSTDETAILSPRESENCEHANDLER_H -#define MVIMPSTDETAILSPRESENCEHANDLER_H - -#include "tvimpstenums.h" - -/** - * presence observer interface. - * @lib vimpstdetailsviewplugin.dll - * @since 5.0 - */ -class MVIMPSTDetailsPresenceObserver - { - public: // Interface - - /** - * notification call back from presence handler about presence change - * @since s60 v5.0 - */ - virtual void HandlePresenceChangedL() = 0 ; - - protected: // Disabled functions - /** - * virtual destructor. - * @since 5.0 - */ - virtual ~MVIMPSTDetailsPresenceObserver() - {} - }; - - -/** - * presence handlere interface. - * @lib vimpstdetailsviewplugin.dll - * @since 5.0 - */ -class MVIMPSTDetailsPresenceHandler - { - public: // Interface - - /** - * fetch presence from cache - * @since S60 v5.0 - */ - virtual void SubscribePresenceL(const TDesC& aUserId ) = 0 ; - - - /** - * return the presence status - * @since S60 v5.0 - */ - virtual TVIMPSTEnums::TOnlineStatus GetPresenceStatus() = 0 ; - - /** - * @param aIndex , index of the control - * @return Label for control - * @since S60 v5.0 - */ - virtual const TDesC& GetHeaderLabelDataL( TInt aIndex ) = 0 ; - - /** - * @return the presence status message - * @since S60 v5.0 - */ - virtual const TDesC& GetStatusMessageL() = 0; - - /** - * function to get supported or not - * @since S60 v5.0 - * @return ETrue if supported - */ - virtual TBool IsSupported() const = 0 ; - - public: // Disabled functions - /** - * virtual destructor. - */ - virtual ~MVIMPSTDetailsPresenceHandler() - {} - }; - - -#endif // MVIMPSTDETAILSPRESENCEHANDLER_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/mvimpstdetailsviewcontactobserver.h --- a/uiservicetab/vimpstdetailsviewplugin/inc/mvimpstdetailsviewcontactobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2008 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: observer class for contact retrieval -* -*/ - - -#ifndef MVIMPSTDETAILSVIEWCONTACTOBSERVER_H -#define MVIMPSTDETAILSVIEWCONTACTOBSERVER_H - -class MVPbkStoreContact; - -// CLASS DECLARATION - -/** - * contact observer interface. - * @lib vimpstdetailsviewplugin.dll - * @since 5.0 - */ -class MVIMPSTDetailsViewContactObserver - { - public: // Interface - - /** - * Notifies the contact observer that the contact is retrieved - * @param aContact contact which is retrieved - */ - virtual void HandleContactReadyL( MVPbkStoreContact& aContact ) = 0 ; - - /** - * call back from contact manager - * @param aContact, a contact fetched from store - */ - virtual void HandleContactUnavailableL() = 0 ; - - - protected: // Disabled functions - /** - * virtual destructor. - */ - virtual ~MVIMPSTDetailsViewContactObserver() - {} - }; - -#endif // MVIMPSTDETAILSVIEWCONTACTOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/inc/vimpstdetailsviewpluginuids.hrh --- a/uiservicetab/vimpstdetailsviewplugin/inc/vimpstdetailsviewpluginuids.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2008 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: UIDs for this plugin - * -*/ - - -#ifndef __VIMPSTDETAILSVIEWPLUGINUIDS_HRH__ -#define __VIMPSTDETAILSVIEWPLUGINUIDS_HRH__ - -/** UID of the CCA details view plugin dll */ -#define KVIMPSTDetailsViewPluginDllUid 0x200159F6 - -/** UID of the CCA details view plugin implementation */ -#define KVIMPSTDetailsViewPluginImplmentationUid 0x200159F7 - -/** TODO: GET THIS FROM HEADER? */ -#define KCCAppViewPluginBaseInterfaceUID 0x2000B1AB - -#define KCCAppViewFactoryInterfaceUID 0x20022FD0 -#endif // __VIMPSTDETAILSVIEWPLUGINUIDS_HRH__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailscontacthandler.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailscontacthandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,822 +0,0 @@ -/* -* Copyright (c) 2008 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: contact handler class implementaion to virtual phonebook observers - * -*/ - - -#include "cvimpstdetailscontacthandler.h" - -#include "mvimpstdetailsviewcontactobserver.h" -#include "cvimpstdetailsviewplugin.h" - -#include "tvimpstconsts.h" -#include "vimpstdetailsviewpluginuids.hrh" -#include - -// virtual phonebook -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// cca -#include -#include -#include -#include -// system include -#include -#include - - -#include "uiservicetabtracer.h" -#include "vimpstutils.h" - -// ======== LOCAL FUNCTIONS ======== - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsContactHandler* CVIMPSTDetailsContactHandler::NewL( MCCAParameter& aParameter , - MVIMPSTDetailsViewContactObserver& aObserver, - const TDesC& aServiceStoreUri, - const TDesC& aServiceName, - TUint aserviceId - ) - { - TRACER_AUTO; - CVIMPSTDetailsContactHandler* self = - new(ELeave) CVIMPSTDetailsContactHandler( aObserver, aserviceId ); - CleanupStack::PushL(self); - self->ConstructL( aParameter, aServiceStoreUri, aServiceName ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::~CVIMPSTDetailsContactHandler -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsContactHandler::~CVIMPSTDetailsContactHandler() - { - - TRACER_AUTO; - Cancel(); - if (iWait.IsStarted()) - { - iWait.AsyncStop(); - } - delete iLinks; - delete iRetrieveOperation; - delete iXSPUserId; - delete iStoreContact; - if (iStoreList) - { - - TRACE("calling store close"); - iStoreList->CloseAll(*this); - iStoreList = NULL; - } - TRACE("iStoreList deleted"); - delete iServiceStoreUri; - TRACE("iServiceStoreUri deleted"); - delete iContactManager; - TRACE("iContactManager deleted"); - delete iServiceName; - TRACE("iServiceName deleted"); - delete iIdConverter; - - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::CVIMPSTDetailsContactHandler -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsContactHandler::CVIMPSTDetailsContactHandler( - MVIMPSTDetailsViewContactObserver& aObserver,TUint aServiceId ) - : CActive(EPriorityStandard), - iObserver( aObserver ), - iStoreType( EStoreUnkwon ), - iServiceId (aServiceId ) - { - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::ConstructL( MCCAParameter& aParameter ,const TDesC& aServiceStoreUri,const TDesC& aServiceName ) - { - - TRACER_AUTO; - CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC(); - TUid launchUid = TUid::Null() ; - iServiceStoreUri = aServiceStoreUri.AllocL(); - iServiceName = aServiceName.AllocL(); - //find whether its a local store or xsp store - if ( iServiceStoreUri && VPbkContactStoreUris::DefaultCntDbUri().Compare( *iServiceStoreUri ) - != 0 ) - { - iStoreType = EStoreServer; // store has xsp store - } - else - { - iStoreType = EStoreLocal; // same as phonebook2 store name - } - launchUid = aParameter.LaunchedViewUid(); - //always load the default store plus the corresponding service store - uriArray->AppendL(TVPbkContactStoreUriPtr(VPbkContactStoreUris::DefaultCntDbUri())); - if( launchUid.iUid != (KVIMPSTDetailsViewPluginImplmentationUid + iServiceId) ) - { - // launched from other than service tab - // need to open service store - if ( iServiceStoreUri ) - { - TPtr serviceStoreNamePtr = iServiceStoreUri->Des(); - uriArray->AppendL( TVPbkContactStoreUriPtr( serviceStoreNamePtr ) ); - TRACE("ServiceStoreUriL() - storename3: %S", &serviceStoreNamePtr); - } - } - - HBufC& contactData = aParameter.ContactDataL(); - - HBufC8* buf = HBufC8::NewLC( contactData.Length() ); - buf->Des().Copy(contactData); - TPtrC8 bufDes( buf->Des() ); - - RDesReadStream readStream( bufDes ); - readStream.PushL(); - - const TInt versionNumber = readStream.ReadUint8L(); - - TInt uriCount = readStream.ReadUint16L(); - TRACE("ServiceStoreUriL() - uriCount = %d", uriCount); - // Read URIs - for ( TInt i = 0; i < uriCount; ++i ) - { - const TInt uriLength = readStream.ReadUint16L(); - HBufC* uriBuffer = HBufC::NewLC(uriLength); - TPtr uriPtr = uriBuffer->Des(); - readStream.ReadL( uriPtr, uriLength ); - if( uriPtr.Length() > 0 ) - { - uriArray->AppendL( TVPbkContactStoreUriPtr( uriPtr ) ); - TRACE("ServiceStoreUriL() - storename4: %S", &uriPtr); - } - CleanupStack::PopAndDestroy( uriBuffer ); - } - CleanupStack::PopAndDestroy(); // readStream - CleanupStack::PopAndDestroy(); // buf - - - iContactManager = CVPbkContactManager::NewL(*uriArray); - CleanupStack::PopAndDestroy(); // uriArray - - iStoreList = &iContactManager->ContactStoresL(); - iStoreList->OpenAllL(*this); - - if( !iWait.IsStarted() ) - { - iWait.Start(); - } - if(iStoreType == EStoreLocal) - { - const TDesC& contactdb = VPbkContactStoreUris::DefaultCntDbUri(); - MVPbkContactStore* contactStore = iStoreList->Find(TVPbkContactStoreUriPtr(contactdb)); - iIdConverter = CVPbkContactIdConverter::NewL(*contactStore); - } - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::GetDisplayNameLC -// --------------------------------------------------------------------------- -// -HBufC* CVIMPSTDetailsContactHandler::GetDisplayNameLC() - { - TRACER_AUTO; - HBufC* firstName = KNullDesC().AllocL(); - HBufC* lastName = KNullDesC().AllocL(); - HBufC* retValue = NULL; - if( iStoreContact ) - { - MVPbkStoreContactFieldCollection& fieldCollection = iStoreContact->Fields(); - TInt fieldCount = fieldCollection.FieldCount(); - for( TInt i=0; i< fieldCount; i++ ) - { - MVPbkStoreContactField& field = fieldCollection.FieldAt( i ); - const MVPbkFieldType* type = field.BestMatchingFieldType() ; - if( R_VPBK_FIELD_TYPE_FIRSTNAME == type->FieldTypeResId() ) - { - const MVPbkContactFieldData& fieldData = field.FieldData(); - if( fieldData.DataType() == EVPbkFieldStorageTypeText ) - { - delete firstName; - firstName = MVPbkContactFieldTextData::Cast(fieldData).Text().AllocL(); - break; - } - } - } - for( TInt i=0; i< fieldCount; i++ ) - { - MVPbkStoreContactField& field = fieldCollection.FieldAt( i ); - const MVPbkFieldType* type = field.BestMatchingFieldType() ; - if( R_VPBK_FIELD_TYPE_LASTNAME == type->FieldTypeResId() ) - { - const MVPbkContactFieldData& fieldData = field.FieldData(); - if( fieldData.DataType() == EVPbkFieldStorageTypeText ) - { - delete lastName; - lastName = MVPbkContactFieldTextData::Cast(fieldData).Text().AllocL(); - break; - } - } - } - TPtr ptrFirstName = firstName->Des(); - TPtr ptrLastName = lastName->Des(); - if(ptrFirstName.Length() || ptrLastName.Length()) - { - retValue = HBufC::NewLC(ptrFirstName.Length()+ ptrLastName.Length() + 1); - TPtr ptrRet = retValue->Des(); - ptrRet.Append(ptrFirstName); - if(ptrFirstName.Length()) - { - //append one space before appending lastname - ptrRet.Append(' '); - } - ptrRet.Append(ptrLastName); - } - else - { - retValue = VIMPSTUtils::LoadResourceL( R_SERVDETAIL_UNNAMED ); - CleanupStack::PushL(retValue); - } - } - delete firstName; - delete lastName; - return retValue; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler:: -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::SetLinks( - MVPbkContactLinkArray* aLinks, TBool aReadXspId ) - { - - TRACER_AUTO; - delete iLinks; - iLinks = NULL; - iLinks = aLinks; - TRACE("iLinks deleted"); - iCurrentLink = NULL; - - iReadXspId = aReadXspId; - if( iRetrieveOperation ) - { - delete iRetrieveOperation; - iRetrieveOperation = NULL; - TRACE("iRetrieveOperation deleted"); - } - TRACE("calling issue request"); - IssueRequest(); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::Links -// --------------------------------------------------------------------------- -// -MVPbkContactLinkArray* CVIMPSTDetailsContactHandler::Links() const - { - return iLinks; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::GetXSPUserId -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTDetailsContactHandler::GetXSPUserId() - { - if( iXSPUserId ) - { - return *iXSPUserId; - } - return KNullDesC; - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::ContactStoresL -// -------------------------------------------------------------------------- -// -MVPbkContactStoreList& CVIMPSTDetailsContactHandler::ContactStoresL() - { - return *iStoreList; - } -// -------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::StoreType -// -------------------------------------------------------------------------- -// -TStoreType CVIMPSTDetailsContactHandler::StoreType() - { - return iStoreType; - } - - // ------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::CancelOngoingRequest -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::CancelOngoingRequest() - { - TRACER_AUTO; - delete iRetrieveOperation; - iRetrieveOperation = NULL; - TRACE("iRetrieveOperation deleted"); - delete iXSPUserId; - iXSPUserId = NULL; - TRACE("iXSPUserId deleted"); - delete iStoreContact; - iStoreContact = NULL; - TRACE("iStoreContact deleted"); - delete iLinks; - iLinks = NULL; - - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::RunL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::RunL() - { - - TRACER_AUTO; - TInt index = 0; - if (iLinks && iCurrentLink ) - { - TRACE("next link"); - index = iLinks->Find(*iCurrentLink) + 1; - } - if ( iLinks && index < iLinks->Count() ) - { - TRACE("calling retrive"); - // will get called until the index become equal to count - iCurrentLink = &iLinks->At(index); - TRAPD( err, iRetrieveOperation = iContactManager->RetrieveContactL(*iCurrentLink, *this) ); - TRACE("retrive called err = %d", err); - } - else - { - TRACE("job finished"); - iCurrentLink = NULL; - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::RunError -// --------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsContactHandler::RunError(TInt aError) - { - return aError; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::DoCancel -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::DoCancel() - { - } - - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::VPbkSingleContactOperationComplete -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& /*aOperation*/, - MVPbkStoreContact* aContact) - { - TRACER_AUTO; - TBool isIssueReguest = ETrue; - - delete iRetrieveOperation; - iRetrieveOperation = NULL; - - delete iStoreContact; - iStoreContact = NULL; - iStoreContact = aContact; - - if( iStoreContact && iReadXspId ) - { - MVPbkStoreContactFieldCollection& fieldCollection = iStoreContact->Fields(); - - TInt fieldCount = fieldCollection.FieldCount(); - - for( TInt i=0; i< fieldCount; i++ ) - { - MVPbkStoreContactField& field = fieldCollection.FieldAt( i ); - const MVPbkFieldType* type = field.BestMatchingFieldType() ; - if( R_VPBK_FIELD_TYPE_IMPP == type->FieldTypeResId() ) - { - const MVPbkContactFieldData& fieldData = field.FieldData(); - if( fieldData.DataType() == EVPbkFieldStorageTypeUri ) - { - TPtrC scheme = MVPbkContactFieldUriData::Cast(fieldData).Scheme(); - if(iServiceName->Compare(scheme) == 0) - { - TRACE("EVPbkFieldStorageTypeUri called"); - const MVPbkContactFieldUriData& uri = MVPbkContactFieldUriData::Cast(fieldData); - HBufC* user = NULL; - delete iXSPUserId; - iXSPUserId = NULL; - // call back api is not leaving function - TRAP_IGNORE( user = uri.Uri().AllocL() ; - if( user ) - { - CleanupStack::PushL( user ); - TPtr userPtr( user->Des() ); - TInt index = userPtr.Find( KColon ); - if( index != KErrNotFound ) - { - TInt length = userPtr.Length(); - iXSPUserId = userPtr.Right( length - index - 1 ).AllocL() ; - } - CleanupStack::PopAndDestroy();// user - } - TRACE("EVPbkFieldStorageTypeUri end"); - ); - break; - } - } - } - } - if( iXSPUserId && iContactManager ) - { - - TRACE("search is called"); - // call back api is not leaving function - TRAP_IGNORE( iRetrieveOperation = iContactManager->FindL(*iXSPUserId, iContactManager->FieldTypes(),*this) ); - isIssueReguest = EFalse; - } - else - { - // call back api is not leaving function - TRAP_IGNORE( iObserver.HandleContactUnavailableL() ); - } - } - else if( iStoreContact ) - { - - TRACE("iStoreContact Valid"); - TBool validLink = ETrue; - if( iStoreType == EStoreLocal && iCurrentLink ) - { - //Local Store - // to check whether this contact has been added to the ServiceTab. with the help of db file - validLink = CheckWhetherValidLocalLinkL( *iCurrentLink); - } - if( validLink ) - { - - TRACE("HandleContactReadyL "); - TRAP_IGNORE( iObserver.HandleContactReadyL( *iStoreContact ) ); - } - else - { - - TRACE("No data "); - TRAP_IGNORE( iObserver.HandleContactUnavailableL() ); - } - } - if( isIssueReguest ) - { - IssueRequest(); - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::VPbkSingleContactOperationFailed -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aError*/) - { - - TRACER_AUTO; - delete iRetrieveOperation; - iRetrieveOperation = NULL; - - TInt index = 0; - if (iLinks && iCurrentLink) - { - index = iLinks->Find(*iCurrentLink) + 1; - - if ( index >= iLinks->Count() ) - { - - TRACE("calling HandleContactUnavailableL start "); - TRAP_IGNORE( iObserver.HandleContactUnavailableL() ); - - TRACE("calling HandleContactUnavailableL end"); - return; - } - } - IssueRequest(); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::FindCompleteL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::FindCompleteL( MVPbkContactLinkArray* aResults ) - { - - TRACER_AUTO; - CVPbkContactLinkArray* linkArray = NULL; - delete iRetrieveOperation; - iRetrieveOperation = NULL; - if( aResults && iServiceStoreUri ) - { - TInt linkCount = aResults->Count(); - for( TInt a=0; a< linkCount; a++ ) - { - const MVPbkContactLink& link = aResults->At( a ) ; - MVPbkContactStore& store = link.ContactStore(); - const MVPbkContactStoreProperties& storeProperty = store.StoreProperties(); - if( storeProperty.Uri().UriDes().Compare( *iServiceStoreUri ) == 0 ) - { - - TRACE("one result found "); - linkArray = CVPbkContactLinkArray::NewLC(); - MVPbkContactLink* clone = link.CloneLC(); - // take ownership clone - linkArray->AppendL(clone); - CleanupStack::Pop(2); // clone, linkArray - TRACE("come out of loop "); - break; - } - } - } - delete aResults; - aResults = NULL; - TRACE("aResults deleted "); - if( linkArray ) - { - // take ownership linkArray - SetLinks( linkArray, EFalse ); - } - else - { - iObserver.HandleContactUnavailableL(); - } - - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler:: -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::FindFailed( TInt /*aError*/ ) - { - TRACER_AUTO; - TRAP_IGNORE( iObserver.HandleContactUnavailableL() ); // takes ownership of contacts. - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler:: -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::IssueRequest(TInt aError) - { - if( !IsActive() ) - { - SetActive(); - TRequestStatus* status = &iStatus; - User::RequestComplete(status, aError); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::OpenComplete -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::OpenComplete() - { - - TRACER_AUTO; - if (iWait.IsStarted()) - { - iWait.AsyncStop(); - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::StoreReady -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::StoreReady(MVPbkContactStore& /*aContactStore*/ ) - { - - TRACER_AUTO; - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::StoreUnavailable -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::StoreUnavailable( - MVPbkContactStore& /*aContactStore*/, - TInt /*aReason*/) - { - - TRACER_AUTO; - if (iWait.IsStarted()) - { - iWait.AsyncStop(); - } - - } - -// ------------------------------------------------------------------------- -// CVIMPSTDetailsContactHandler::HandleStoreEventL -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::HandleStoreEventL( - MVPbkContactStore& /*aContactStore*/, - TVPbkContactStoreEvent /*aStoreEvent*/) - { - - } - -// ----------------------------------------------------------- -// CVIMPSTDetailsContactHandler::CheckWhetherValidLocalLink -// ----------------------------------------------------------- -// - -TBool CVIMPSTDetailsContactHandler::CheckWhetherValidLocalLinkL( - const MVPbkContactLink& aCurrentLink ) - { - TRACER_AUTO; - TBool validLocalLink = EFalse; - User::LeaveIfError( iFs.Connect() ); - // Open existing or create new database. - if ( DbExists() ) - { - OpenDbL(); - OpenTableL(); - // Get Column number for contact data size - iColset = iDb.ColSetL( KContactTable ); - TInt32 linkId = iIdConverter->LinkToIdentifier(aCurrentLink); - TDbColNo colNo = iColset->ColNo( KContactId ); - validLocalLink = SeekRowL( colNo, linkId ); - CloseDb(); - } - return validLocalLink; - } - -//******************* Database Operations *********************************// -// ----------------------------------------------------------- -// CVIMPSTDetailsContactHandler::DbExists -// ----------------------------------------------------------- -// -TBool CVIMPSTDetailsContactHandler::DbExists() - { - TRACER_AUTO; - TBuf<512> dbName; - RFile temp; - TBuf< KMaxPath > storagePath; - - dbName.Append( iServiceName->Des() ); - dbName.Append( KStorageExtn ); - - storagePath.Append( KDbPath ); - storagePath.Append( dbName ); - - TInt err( temp.Open( iFs, *(&storagePath), EFileShareReadersOrWriters|EFileRead ) ); - - TInt size( 0 ); - if ( err == KErrNone ) - { - temp.Size( size ); - } - - temp.Close(); - - if ( size == 0 ) - { - return EFalse; - } - - return ( err == KErrNone ); - } - - - -// ----------------------------------------------------------- -// CVIMPSTDetailsContactHandler::OpenDbL -// ----------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::OpenDbL() - { - TRACER_AUTO; - TBuf< KMaxPath > storagePath; - TBuf<512> dbName; - dbName.Append( iServiceName->Des() ); - dbName.Append( KStorageExtn ); - - storagePath.Append( KDbPath ); - storagePath.Append( dbName ); - - iFileStore = CPermanentFileStore::OpenL( iFs, storagePath, EFileShareReadersOrWriters|EFileWrite ); - iFileStore->SetTypeL( iFileStore->Layout() ); - iDb.OpenL( iFileStore, iFileStore->Root() ); - } - -// ----------------------------------------------------------- -// CVIMPSTDetailsContactHandler::CloseDb -// ----------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::CloseDb() - { - iTable.Close(); - delete iColset; - delete iFileStore; - iFileStore = NULL; - iDb.Close(); - iFs.Close(); - } - -// ---------------------------------------------------------- -// CVIMPSTDetailsContactHandler::SeekRowL -// ---------------------------------------------------------- -// -TBool CVIMPSTDetailsContactHandler::SeekRowL( TDbColNo aColNo, TInt32& aIdentifier ) - { - TRACER_AUTO; - TBool ret = EFalse; - iTable.BeginningL(); - while ( iTable.NextL() ) - { - iTable.GetL(); - if ( iTable.ColInt32( aColNo ) == aIdentifier ) - { - ret = ETrue; - break; - } - } - return ret; - } - -// ---------------------------------------------------------- -// CVIMPSTDetailsContactHandler::OpenTableL -// ---------------------------------------------------------- -// -void CVIMPSTDetailsContactHandler::OpenTableL() - { - TRACER_AUTO; - TInt err( iTable.Open( iDb, KContactTable ) ); - if ( err != KErrNone ) - { - iTable.Close(); - User::Leave( err ); - return; - } - return; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsheadercontrol.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsheadercontrol.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,386 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Implementation of the header part control(s) of the details view layout -* -*/ - - -#include "cvimpstdetailsheadercontrol.h" - -#include "cvimpstdetailsimagedecoder.h" -#include "mvimpstdetailspresencehandler.h" -#include "cvimpstdetailsviewbrandhandler.h" -#include -#include -#include -#include -#include -#include -#include //cdl -#include -#include - -// virtual phonebook -#include -#include -#include -#include -#include -#include - -#include "uiservicetabtracer.h" -// constants declaration -const TInt KLabelLineCount = 3; - -// Size of thumbnail images stored to contacts -#define KPbkPersonalImageSize TSize(80,96) - -// --------------------------------------------------------------------------- -// NewL, two-phase construction -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsHeaderControl* CVIMPSTDetailsHeaderControl::NewL(CVIMPSTDetailsViewBrandHandler& aBrandHandler, - MVIMPSTDetailsPresenceHandler& aPresenceHandler) - { - CVIMPSTDetailsHeaderControl* self= new (ELeave) CVIMPSTDetailsHeaderControl(aBrandHandler, aPresenceHandler ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// C++ (first phase) constructor -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsHeaderControl::CVIMPSTDetailsHeaderControl(CVIMPSTDetailsViewBrandHandler& aBrandHandler, - MVIMPSTDetailsPresenceHandler& aPresenceHandler) - : iBrandHandler( aBrandHandler), - iPresenceHandler( aPresenceHandler ) - { - // No implementation required - } - -// --------------------------------------------------------------------------- -// ConstructL, second phase constructor -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsHeaderControl::ConstructL() - { - TRACER_AUTO; - // Create the header image - iImage = new (ELeave) CEikImage(); - iImage->SetPictureOwnedExternally(ETrue); //EHLeftVCenter - iImage->SetAlignment(EHCenterVCenter); - // Create the header labels - for (TInt i=0; i < KLabelLineCount; i++) - { - CEikLabel* label = new(ELeave) CEikLabel; - CleanupStack::PushL(label); - label->SetTextL(KNullDesC()); - label->SetAlignment(EHLeftVCenter);// EHCenterVCenter, EHLeftVCenter - iLabels.AppendL(label); - CleanupStack::Pop(label); - } - iContactImageSize = KPbkPersonalImageSize; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsHeaderControl::~CVIMPSTDetailsHeaderControl() - { - iLabels.ResetAndDestroy(); - - if (iImageDecoder) - { - if (iImageDecoder->IsActive()) - { - iImageDecoder->Cancel(); - } - delete iImageDecoder; - iImageDecoder = NULL; - } - delete iHeaderField; - - if (iImage) - { - delete iImage; - iImage = NULL; - } - - if (iBitmap) - { - delete iBitmap; - iBitmap = NULL; - } - if (iMask) - { - delete iMask; - iMask = NULL; - } - } - - -// --------------------------------------------------------------------------- -// From CCoeControl, returns the number of child controls to the framework -// --------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsHeaderControl::CountComponentControls() const - { - // image control + Label Count - return 1 + iLabels.Count(); - } - -// --------------------------------------------------------------------------- -// From CCoeControl, returns the child controls to the framework by index -// --------------------------------------------------------------------------- -// -CCoeControl* CVIMPSTDetailsHeaderControl::ComponentControl(TInt aIndex) const - { - if (aIndex == 0) - { - return iImage; - } - else if (aIndex - 1 < iLabels.Count()) - { - return iLabels[aIndex-1]; - } - else - { - return NULL; - } - } - -// --------------------------------------------------------------------------- -// From CCoeControl, called when the control's size changes, handles portrait-landscape switch -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsHeaderControl::SizeChanged() - { - TInt isLandscape = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; - - AknLayoutUtils::LayoutImage( - iImage, Rect(), AknLayoutScalable_Apps::cl_header_pane_g1(isLandscape)); - - TPoint position = iImage->Position(); - TSize size = iImage->Size(); - - const TPoint newImagePosition = TPoint( position.iX/2, position.iY/2 ); - iImage->SetPosition( newImagePosition ); - - const TSize newImageSize = TSize( size.iWidth + 2*( position.iX - newImagePosition.iX ) , - size.iHeight + 2*( position.iY - newImagePosition.iY ) ); - - iImage->SetSize( newImageSize ); - - iContactImageSize = newImageSize; - - if ( iImageDecoder ) - { - // if bitmap was set resize it - if (iImageDecoder->IsActive()) - { - iImageDecoder->Cancel(); - } - TRAP_IGNORE( iImageDecoder->StartL( iContactImageSize ) ); - } - - TAknLayoutRect labelsRect; - labelsRect.LayoutRect(Rect(), AknLayoutScalable_Apps::cl_header_name_pane(isLandscape)); - - AknLayoutUtils::LayoutLabel(iLabels[0], labelsRect.Rect(), AknLayoutScalable_Apps::cl_header_name_pane_t1(2)); - AknLayoutUtils::LayoutLabel(iLabels[1], labelsRect.Rect(), AknLayoutScalable_Apps::cl_header_name_pane_t2(2)); - - AknLayoutUtils::LayoutLabel(iLabels[2], labelsRect.Rect(), AknLayoutScalable_Apps::cl_header_name_pane_t3(2)); - - TRAP_IGNORE(LabelsSizeChangedL()); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsHeaderControl::LabelsSizeChangedL() -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsHeaderControl::LabelsSizeChangedL() - { - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - TRgb color; - AknsUtils::GetCachedColor( skin, color, KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ); - - if (iLabels.Count() > 0) - { - for (TInt i=0; i < iLabels.Count(); i++) - { - iLabels[i]->SetTextL( iPresenceHandler.GetHeaderLabelDataL(i) ); - iLabels[i]->CropText(); - iLabels[i]->OverrideColorL( EColorLabelText, color ); - iLabels[i]->DrawDeferred(); - } - } - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsHeaderControl::HeaderSizeChangedL() -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsHeaderControl::HeaderSizeChangedL() - { - CFbsBitmap* bmp = NULL; - CFbsBitmap* bmpMask = NULL; - TVIMPSTEnums::TOnlineStatus onlineStatus = iPresenceHandler.GetPresenceStatus(); - if(TVIMPSTEnums::EPending == onlineStatus) - { - iBrandHandler.LoadBitMapLC(bmp, - bmpMask, - EMbmVimpstuiQgn_prop_service_friend_request_sent , - EMbmVimpstuiQgn_prop_service_friend_request_sent_mask ); - } - else if(TVIMPSTEnums::EBlocked == onlineStatus) - { - iBrandHandler.LoadBitMapLC(bmp, - bmpMask, - EMbmVimpstuiQgn_servtab_avatar_blocked , - EMbmVimpstuiQgn_servtab_avatar_blocked_mask ); - } - else - { - iBrandHandler.LoadBitMapLC(bmp, - bmpMask, - EMbmVimpstuiQgn_prop_service_default_avatar , - EMbmVimpstuiQgn_prop_service_default_avatar_mask ); - } - SetBitmap(bmp, bmpMask);//ownership transferred - CleanupStack::Pop(2); // bitmap,bmpMask - SizeChanged(); - - } -// --------------------------------------------------------------------------- -// From CCoeControl, overridden to set the container windows for the child -// controls of this control (labels and image) -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsHeaderControl::SetContainerWindowL(const CCoeControl& aContainer) - { - CCoeControl::SetContainerWindowL(aContainer); - iImage->SetContainerWindowL(aContainer); - for (TInt i=0; i < iLabels.Count(); i++) - { - iLabels[i]->SetContainerWindowL(aContainer); - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsHeaderControl :: SetBitmap -// Sets the bitmap shown in the header image -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsHeaderControl::SetBitmap(CFbsBitmap* aBmp, CFbsBitmap* aMask ) - { - if (iBitmap) - { - delete iBitmap; - iBitmap = NULL; - } - if (iMask) - { - delete iMask; - iMask = NULL; - } - iBitmap = aBmp; - iMask = aMask; - - iImage->SetPicture(aBmp, NULL); - iImage->DrawDeferred(); - - TRAP_IGNORE( LabelsSizeChangedL() ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsHeaderControl :: ClearL -// Clears the header texts & image to blank -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsHeaderControl::ClearL() - { - iImage->SetPicture(NULL, NULL); - if (iBitmap) - { - delete iBitmap; - iBitmap = NULL; - } - if (iMask) - { - delete iMask; - iMask = NULL; - } - for (TInt i = 0; i < iLabels.Count(); i++) - { - iLabels[i]->SetTextL(KNullDesC()); - } - - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsHeaderControl :: CreateHeaderPresentationL -// Clears the header texts & image to blank -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsHeaderControl::CreateHeaderPresentationL(MVPbkStoreContact& aContact ) - { - TRACER_AUTO; - if( iHeaderField ) - { - delete iHeaderField; - iHeaderField = NULL ; - } - - MVPbkStoreContactFieldCollection& fieldCollection = aContact.Fields(); - - TInt fieldCount = fieldCollection.FieldCount(); - - for( TInt i=0; i< fieldCount; i++ ) - { - MVPbkStoreContactField& field = fieldCollection.FieldAt( i ); - const MVPbkFieldType* type = field.BestMatchingFieldType() ; - if( R_VPBK_FIELD_TYPE_THUMBNAILPIC == type->FieldTypeResId() ) - { - iHeaderField = field.CloneLC(); - CleanupStack::Pop(); - break; - } - } - if( iHeaderField ) - { - // field available - const MVPbkContactFieldData& fieldData = iHeaderField->FieldData(); - if( fieldData.DataType() == EVPbkFieldStorageTypeBinary ) - { - TPtrC8 data = MVPbkContactFieldBinaryData::Cast(fieldData).BinaryData(); - if (iImageDecoder) - { - if (iImageDecoder->IsActive()) - { - iImageDecoder->Cancel(); - } - delete iImageDecoder; - iImageDecoder = NULL; - } - iImageDecoder = CVIMPSTDetailsImageDecoder::NewL(*this, data ); - iImageDecoder->StartL(iContactImageSize); - } - } - - } - -// end of file - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsimagedecoder.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsimagedecoder.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -/* -* Copyright (c) 2008 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: Utility class for asynchronously decoding the header thumbnail image - * -*/ - - -#include "cvimpstdetailsimagedecoder.h" - -#include "cvimpstdetailsheadercontrol.h" - -#include -#include -#include - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsImageDecoder::NewL -// Two-phase construction -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsImageDecoder* CVIMPSTDetailsImageDecoder::NewL(CVIMPSTDetailsHeaderControl& aHeader, const TDesC8& aBitmapData) - { - CVIMPSTDetailsImageDecoder* self = new (ELeave) CVIMPSTDetailsImageDecoder(aHeader); - CleanupStack::PushL(self); - self->ConstructL(aBitmapData); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsImageDecoder::CVIMPSTDetailsImageDecoder -// First phase (C++) constructor -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsImageDecoder::CVIMPSTDetailsImageDecoder(CVIMPSTDetailsHeaderControl& aHeader) : - CActive( CActive::EPriorityStandard ), iHeader(aHeader) - { - CActiveScheduler::Add(this); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsImageDecoder::ConstructL -// ConstructL, second phase constructor -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsImageDecoder::ConstructL(const TDesC8& aBitmapData) - { - iBitmapData = aBitmapData.AllocL(); - User::LeaveIfError( iFs.Connect() ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsImageDecoder::~CVIMPSTDetailsImageDecoder -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsImageDecoder::~CVIMPSTDetailsImageDecoder() - { - DoCancel(); - if (iImgDecoder) - { - delete iImgDecoder; - iImgDecoder = NULL; - } - if (iBitmap) - { - delete iBitmap; - iBitmap = NULL; - } - if (iBitmapData) - { - delete iBitmapData; - iBitmapData = NULL; - } - if (iBitmapScaler) - { - delete iBitmapScaler; - iBitmapScaler = NULL; - } - - iFs.Close(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsImageDecoder::Start -// Starts the decoding process -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsImageDecoder::StartL(TSize aBitmapSize) - { - iDecoderState = ECcaConvertThumbnailImage; - iBitmapSize = aBitmapSize; - CreateBitmapL(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsImageDecoder::RunL -// Called by the active object framework when the decoding (request) is -// completed. -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsImageDecoder::RunL() - { - User::LeaveIfError( iStatus.Int() ); - switch ( iDecoderState ) - { - case ECcaConvertThumbnailImage: - { - iDecoderState = ECcaScaleThumbnail; - ScaleBitmapL(); - break; - } - case ECcaScaleThumbnail: - { - // don't delete - // Ownership of the bitmap is transferred - iHeader.SetBitmap(iBitmap, NULL ); - iBitmap = NULL; - } - default: - break; - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsImageDecoder::DoCancel -// Called when the decoding (request) is cancelled for some reason. -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsImageDecoder::DoCancel() - { - iImgDecoder->Cancel(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsImageDecoder::ScaleBitmapL -// scaling it to fit to the screen -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsImageDecoder::ScaleBitmapL() - { - iBitmapScaler = CBitmapScaler::NewL(); - iBitmapScaler->Scale( &iStatus, *iBitmap, iBitmapSize ); - SetActive(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsImageDecoder::CreateBitmapL -// creates the bitmap -// --------------------------------------------------------------------------- -// - -void CVIMPSTDetailsImageDecoder::CreateBitmapL() - { - if ( iDecoderState == ECcaConvertThumbnailImage ) - { - iImgDecoder = CImageDecoder::DataNewL( iFs, *iBitmapData, CImageDecoder::EOptionAlwaysThread ); - } - if ( !iBitmap ) - { - TFrameInfo info = iImgDecoder->FrameInfo(); - iBitmap = new ( ELeave ) CFbsBitmap; - User::LeaveIfError( iBitmap->Create( info.iOverallSizeInPixels, info.iFrameDisplayMode )); - } - iStatus = KRequestPending; - iImgDecoder->Convert( &iStatus, *iBitmap ); - SetActive(); - } -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailspresencehandler.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailspresencehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,447 +0,0 @@ -/* -* Copyright (c) 2008-2008 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: Implementation of the presence handler -* -*/ - - -#include "cvimpstdetailspresencehandler.h" - -#include "tvimpstconsts.h" - -//presence cache header -#include // cache reader -#include - -// ximpfw -#include -#include -#include -#include -#include "uiservicetabtracer.h" - -// --------------------------------------------------------------------------- -// NewL, two-phase construction -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsPresenceHandler* CVIMPSTDetailsPresenceHandler::NewL(const TDesC& aServiceName , - MVIMPSTDetailsPresenceObserver& aObserver, - TBool aPresenceSupported ) - { - CVIMPSTDetailsPresenceHandler* self= new (ELeave) CVIMPSTDetailsPresenceHandler( aObserver, aPresenceSupported ); - CleanupStack::PushL(self); - self->ConstructL( aServiceName ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// C++ (first phase) constructor -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsPresenceHandler::CVIMPSTDetailsPresenceHandler(MVIMPSTDetailsPresenceObserver& aObserver, - TBool aPresenceSupported) - : iPresenceObserver( aObserver ), - iStatus( TVIMPSTEnums::EOffline ), - iPresenceSupported( aPresenceSupported ) - { - // No implementation required - } - -// --------------------------------------------------------------------------- -// ConstructL, second phase constructor -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsPresenceHandler::ConstructL(const TDesC& aServiceName ) - { - TRACER_AUTO; - iServiceName = aServiceName.AllocL(); - - - iXIMClient = MXIMPClient::NewClientL(); - //Create new sink to receive ximp context events - iPresenceContext = iXIMClient->NewPresenceContextLC(); - CleanupStack::Pop(); // iPresenceContext - - //initialize the presence cache. - iPresenceCacheReader = MPresenceCacheReader2::CreateReaderL(); - iPresenceCacheReader->SetObserverForSubscribedNotifications(this); - iUserId = NULL; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsPresenceHandler::~CVIMPSTDetailsPresenceHandler() - { - delete iStatusMessage; - delete iUserId; - delete iStatusText; - delete iServiceName; - delete iPresenceCacheReader; - delete iPresenceContext; - delete iXIMClient; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::SubscribePresenceL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsPresenceHandler::SubscribePresenceL(const TDesC& aUserId ) - { - TRACER_AUTO; - if( iUserId ) - { - delete iUserId; - iUserId = NULL; - } - iUserId = aUserId.AllocL(); - iStatus = TVIMPSTEnums::EOffline; - if( !iPresenceSupported ) - { - return; - } - HBufC* name = HBufC::NewLC( aUserId.Length() + iServiceName->Length() + KColon().Length() ); - TPtr namePtr( name->Des() ); - namePtr.Zero(); - - // append the service name followed by user id ,seperated by colon - namePtr.Append(*iServiceName); - namePtr.Append(KColon); - namePtr.Append(aUserId); - - iPresenceCacheReader->SubscribePresenceBuddyChangeL(namePtr); - MPresenceBuddyInfo2* presenceBuddyInfo = iPresenceCacheReader->PresenceInfoLC(namePtr); - - if ( presenceBuddyInfo ) - { - TPtrC buddyXSPId = presenceBuddyInfo->BuddyId(); // read the buddyID : returns in XSP format - TPtrC buddyId = buddyXSPId.Right( buddyXSPId.Length() - iServiceName->Length() - KColon().Length()); - // read the availability /presence state enum value - MPresenceBuddyInfo2::TAvailabilityValues availabilityEnum = presenceBuddyInfo->Availability(); - TPtrC avablityText = presenceBuddyInfo->AvailabilityText(); - ConvertPresenceCacheEnums( availabilityEnum ,avablityText ); // convert the presence cache enum value to service tab enum - if(TVIMPSTEnums::EUnknown == iStatus) - { - //get the blocked and pending state - GetKeyFieldsAndValuesL(*presenceBuddyInfo); - } - TPtrC statusMsg = presenceBuddyInfo->StatusMessage(); // read the status message - ProcessStatusMesssageL( statusMsg ); - CleanupStack::PopAndDestroy(); // presenceBuddyInfo - } - CleanupStack::PopAndDestroy(); // name - } - - - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::HandlePresenceReadL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsPresenceHandler::HandlePresenceReadL(TInt /*aErrorCode*/, - RPointerArray& /*aPresenceBuddyInfoList*/) - { - //Not required as we are not subcribing to all buddies presence - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::HandlePresenceNotificationL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsPresenceHandler::HandlePresenceNotificationL(TInt /*aErrorCode*/, - MPresenceBuddyInfo2* aPresenceBuddyInfo) - { - TRACER_AUTO; - if ( aPresenceBuddyInfo ) - { - CleanupDeletePushL( aPresenceBuddyInfo ); - TPtrC buddyXSPId = aPresenceBuddyInfo->BuddyId(); // read the buddyID : returns in XSP format - TPtrC buddyId = buddyXSPId.Right( buddyXSPId.Length() - iServiceName->Length() - KColon().Length()); - // read the availability /presence state enum value - MPresenceBuddyInfo2::TAvailabilityValues availabilityEnum = aPresenceBuddyInfo->Availability(); - TPtrC avablityText = aPresenceBuddyInfo->AvailabilityText(); - // convert the presence cache enum value to service tab enum - ConvertPresenceCacheEnums( availabilityEnum ,avablityText ); - - // its either blocked or pending stats, hence get the corrrect state - if(TVIMPSTEnums::EUnknown == iStatus) - { - //get the blocked and pending state - GetKeyFieldsAndValuesL(*aPresenceBuddyInfo); - } - - TPtrC statusMsg = aPresenceBuddyInfo->StatusMessage(); // read the status message - ProcessStatusMesssageL( statusMsg ); - CleanupStack::PopAndDestroy(); // aPresenceBuddyInfo - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::ConvertPresenceCacheEnums -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsPresenceHandler::ConvertPresenceCacheEnums(MPresenceBuddyInfo2::TAvailabilityValues aAvailabilityEnum, TPtrC aAvabilityText) - { - // convert the presence cache enums to UI enumvalues - // by default if the enum doesnot match then its TVIMPSTEnums::UnKnown - switch( aAvailabilityEnum ) - { - case MPresenceBuddyInfo2::EBusy: - { - if(0==aAvabilityText.Compare(KAwayState)) - { - iStatus = TVIMPSTEnums::EAway; - } - else if(0==aAvabilityText.Compare(KOnPhoneState)) - { - iStatus = TVIMPSTEnums::EOnPhone; - } - else if(0==aAvabilityText.Compare(KDndState)) - { - iStatus = TVIMPSTEnums::EDoNotDisturb; - } - else - { - iStatus = TVIMPSTEnums::EBusy; - } - break; - } - case MPresenceBuddyInfo2::EAvailable: - { - iStatus = TVIMPSTEnums::EOnline; - break; - } - case MPresenceBuddyInfo2::ENotAvailable: - { - iStatus = TVIMPSTEnums::EOffline; - break; - } - case MPresenceBuddyInfo2::EUnknownAvailability: - { - iStatus = TVIMPSTEnums::EUnknown; - if(0==aAvabilityText.Compare(KInvisibleState)) - { - iStatus = TVIMPSTEnums::EInvisible; - } - - break; - } - default: - { - iStatus = TVIMPSTEnums::EOffline; - break; - } - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::ProcessStatusMesssageL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsPresenceHandler::ProcessStatusMesssageL(const TDesC& aStatusMessage ) - { - TRACER_AUTO; - if( iStatusMessage ) - { - delete iStatusMessage ; - iStatusMessage = NULL; - } - if( aStatusMessage.Length() > 0 ) - { - // MAx length of KStatusMsgMaxLength is allocated - // if status message is longer than KStatusMsgMaxLength - iStatusMessage = aStatusMessage.Left( KStatusMsgMaxLength ).AllocL(); - } - iPresenceObserver.HandlePresenceChangedL(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::GetPresenceStatus -// -------------------------------------------------------------------------- -// -TVIMPSTEnums::TOnlineStatus CVIMPSTDetailsPresenceHandler::GetPresenceStatus() - { - if(!iUserId) - { - return TVIMPSTEnums::EUnknown; - } - return iStatus; - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::GetHeaderLabelDataL -// -------------------------------------------------------------------------- -// -const TDesC& CVIMPSTDetailsPresenceHandler::GetHeaderLabelDataL( TInt aIndex ) - { - TRACER_AUTO; - if( aIndex == 0 && iServiceName ) // first label data - { - return *iServiceName; - } - else if( aIndex == 2 && iPresenceSupported ) // second label data - { - return GetStatusTextL(); - } - return KNullDesC; // return empty string for index 1 (label 2) for line in between the service name and presence - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::GetStatusMessageL -// -------------------------------------------------------------------------- -// -const TDesC& CVIMPSTDetailsPresenceHandler::GetStatusMessageL() - { - TRACER_AUTO; - if( iStatusMessage && iStatusMessage->Length() ) - { - return *iStatusMessage; - } - return GetStatusTextL(); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::IsSupported -// -------------------------------------------------------------------------- -// -TBool CVIMPSTDetailsPresenceHandler::IsSupported() const - { - return iPresenceSupported; - } - // -------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::GetStatusTextL -// -------------------------------------------------------------------------- -// -const TDesC& CVIMPSTDetailsPresenceHandler::GetStatusTextL() - { - TRACER_AUTO; - TInt resourceId = R_SERVDETAIL_STATUSTEXT_OFFLINE; - - switch( iStatus ) - { - case TVIMPSTEnums::EOffline: - { - resourceId = R_SERVDETAIL_STATUSTEXT_OFFLINE; - break; - } - case TVIMPSTEnums::EBusy: - { - resourceId = R_SERVDETAIL_STATUSTEXT_BUSY; - break; - } - case TVIMPSTEnums::EOnline: - { - resourceId = R_SERVDETAIL_STATUSTEXT_ONLINE; - break; - } - case TVIMPSTEnums::EInvisible: - { - resourceId = R_SERVDETAIL_STATUSTEXT_DND; - break; - } - case TVIMPSTEnums::EOnPhone: - { - resourceId = R_SERVDETAIL_STATUSTEXT_ONTHEPHONE; - break; - } - case TVIMPSTEnums::EDoNotDisturb: - { - resourceId = R_SERVDETAIL_STATUSTEXT_DND; - break; - } - case TVIMPSTEnums::EAway: - { - resourceId = R_SERVDETAIL_STATUSTEXT_AWAY; - break; - } - case TVIMPSTEnums::EBlocked: - { - resourceId = R_SERVDETAIL_STATUSTEXT_BLOCKED; - break; - } - case TVIMPSTEnums::EPending: - { - resourceId = R_SERVDETAIL_STATUSTEXT_PENDING; - break; - } - case TVIMPSTEnums::ECallForward: - { - resourceId = R_SERVDETAIL_STATUSTEXT_CALLFORWARD; - break; - } - case TVIMPSTEnums::EUnknown: - case TVIMPSTEnums::EServiceOut: - default: - { - break; - } - } - if( iStatusText ) - { - delete iStatusText; - iStatusText = NULL; - } - - if( CCoeEnv::Static() && TVIMPSTEnums::EServiceOut != iStatus - && TVIMPSTEnums::EUnknown != iStatus ) - { - iStatusText = StringLoader::LoadL( resourceId ); - } - if( iStatusText ) - { - return *iStatusText; - } - return KNullDesC; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsPresenceHandler::GetKeyFieldsAndValuesL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsPresenceHandler::GetKeyFieldsAndValuesL(MPresenceBuddyInfo2& aPresenceBuddyInfo) - { - TRACER_AUTO; - // At any point of time fro remote and blocked contact only one of the keys - // KPendingRequestExtensionValue/KBlockedExtensionValue will be assigned, and not both the keys. - TPtrC8 value = aPresenceBuddyInfo.GetAnyField( KExtensionKey() ) ; - if(value.Compare( KPendingRequestExtensionValue ) == 0) - { - iStatus = TVIMPSTEnums::EPending; - } - else if(value.Compare( KBlockedExtensionValue ) == 0) - { - iStatus = TVIMPSTEnums::EBlocked; - } - else if(value.Compare( KServiceExtensionValue ) == 0) - { - iStatus = TVIMPSTEnums::EServiceOut; - } - else if(value.Compare( KCallForwardExtensionValue ) == 0) - { - iStatus = TVIMPSTEnums::ECallForward; - } - else - { - iStatus = TVIMPSTEnums::EOffline; - } - } - -// end of file - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewbrandhandler.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewbrandhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,476 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview contact brand data - * -*/ - - -// INCLUDE FILES -#include "cvimpstdetailsviewbrandhandler.h" - -#include "vimpstdetailsview.hrh" -#include "vimpstui.h" -#include "conversations.h" -#include "tvimpstconsts.h" -#include -#include -// branding server -#include -#include -#include -// system includes -#include -// settings -#include -#include -#include - -#include - - -#include "uiservicetabtracer.h" - -_LIT8(KAppIdForBrand,"xsp"); -_LIT8(KDefaultBrandIdForBrand,"xsp"); - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::CVIMPSTDetailsViewBrandHandler() -// --------------------------------------------------------------------------- -// Two-phased constructor. -CVIMPSTDetailsViewBrandHandler* CVIMPSTDetailsViewBrandHandler::NewL(TInt aServiceId ) - { - CVIMPSTDetailsViewBrandHandler* self = new (ELeave) CVIMPSTDetailsViewBrandHandler( aServiceId); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::~CVIMPSTDetailsViewBrandHandler() -// --------------------------------------------------------------------------- -// Destructor -CVIMPSTDetailsViewBrandHandler::~CVIMPSTDetailsViewBrandHandler() - { - if(iBrandingAccess) - { - iBrandingAccess->Close(); - } - delete iBrandingFactory; - iBrandingFactory = NULL; - delete iBrandId; - delete iSettings; - delete iServiceStoreUri; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::CVIMPSTDetailsViewBrandHandler() -// --------------------------------------------------------------------------- -// C++ default constructor can NOT contain any code, that -// might leave. -// -CVIMPSTDetailsViewBrandHandler::CVIMPSTDetailsViewBrandHandler(TInt aServiceId) : - iAppId(KAppIdForBrand), - iServiceId( aServiceId) - { - iBrandingAccess = NULL; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::ConstructL() -// --------------------------------------------------------------------------- -// Symbian OS default constructor can leave. -void CVIMPSTDetailsViewBrandHandler::ConstructL() - { - TRACER_AUTO; - iBrandId = HBufC8::NewL( KVIMPSTUISPSMaxPropertyLength ); - TPtr8 brandIdPtr( iBrandId->Des() ); - - TInt version = 1 ; // default - - iSettings = CSPSettings::NewL(); - - // ELangInternationalEnglish is selected as Default Brand Language Id. - iLanguageId = ELangInternationalEnglish; - - GetBrandInfoL(iLanguageId, version, brandIdPtr); - - iBrandingFactory = CBSFactory::NewL( KDefaultBrandIdForBrand, iAppId ); - - - //Get the default MBM path - Dll::FileName(iDefaultMbmPath); //get the location of the dll - - TDriveName drive( TParsePtrC( iDefaultMbmPath ).Drive( ) ); // solve drive - - // leave to stack, LC method - HBufC* resourceFilePath = HBufC::NewLC( KMaxResourcePathLength ); - TPtr ptr( resourceFilePath->Des() ); - ptr.Append( KDefaultIconFile() ); // without drive - ptr.Insert( 0, drive ); // insert drive - - // NearestLanguageFile takes only TFileName - iDefaultMbmPath.Zero(); - iDefaultMbmPath.Append( *resourceFilePath ); - - CleanupStack::PopAndDestroy();//resourceFilePath - - // Leaves if no brand for service, therefore trap - PrepareBrandingAccess(); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::PrepareBrandingAccess() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsViewBrandHandler::PrepareBrandingAccess() - { - - TRAPD(err, iBrandingAccess = iBrandingFactory->CreateAccessL( *iBrandId, iLanguageId )); - - return err; - } - - -// --------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::LoadIconsLC -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTDetailsViewBrandHandler::LoadIconsLC( ) - { - //Fetching bitmaps from the server. - if( !iBrandingAccess ) - { - if( KErrNone != PrepareBrandingAccess() ) - //brand was not found so load the default data - { - return LoadDefaultIconsLC(iDefaultMbmPath); - } - } - //brand data is available - return LoadBrandIconsLC(); - } - -// --------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::LoadBitMapL -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTDetailsViewBrandHandler::LoadBitMapLC(CFbsBitmap*& aBitmap, - CFbsBitmap*& aMask, - TInt aBitmapId, - TInt aMaskId ) - { - if( !iBrandingAccess ) - { - if( KErrNone != PrepareBrandingAccess() ) - //brand was not found so load the default data - { - AknIconUtils::CreateIconLC( aBitmap,aMask, iDefaultMbmPath, aBitmapId, aMaskId ); - return; - } - } - //brand data is available - CGulIcon* icon = NULL; - icon = LoadBrandBitmapL( KEMbmConversationsQgnpropservicedefaultavatar ); - aBitmap = icon->Bitmap(); - aMask = icon->Mask(); - // this is remove the memory leak - icon->SetBitmapsOwnedExternally( ETrue ); - delete icon ; - CleanupStack::PushL( aBitmap ); - CleanupStack::PushL( aMask ); - } - -// --------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::LoadBrandIconsLC -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTDetailsViewBrandHandler::LoadBrandIconsLC( ) - { - // array granularity is 12, because 12 icons are added to array - CAknIconArray* icons = new( ELeave )CAknIconArray( 12); - CleanupStack::PushL( icons ); - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendoff) );//0 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendon) );//1 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendaway ) );//2 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendbusy ) );//3 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendinvisible ) );//4 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimimsg ) );//5 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimimsgnew ) );//6 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropservicedefaultavatar ) );//7 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropservicefriendrequestreceived ) );//8 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropservicefriendrequestsent ) );//9 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropserviceofffriendrequestreceived ) );//10 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropserviceofffriendrequestsent ) );//11 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimuserblocked ) );//12 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendonmobile ) );//13 - - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimusercallforward ) );//14 - - return icons; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::LoadBrandBitmapL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CGulIcon* CVIMPSTDetailsViewBrandHandler::LoadBrandBitmapL( const TDesC8& aId ) - { - - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - //Fetching bitmaps from the server. - if(!iBrandingAccess) - { - PrepareBrandingAccess(); - } - iBrandingAccess->GetBitmapL( aId, bitmap, mask ); - CleanupStack::PushL( bitmap ); - CleanupStack::PushL( mask ); - // bitmap, mask ownership passed to gulIcon - CGulIcon* icon = CGulIcon::NewL(bitmap, mask); - icon->SetBitmapsOwnedExternally( EFalse ); - CleanupStack::Pop(2); // bitmap, mask - return icon; - } - - -// --------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::LoadDefaultIconsLC -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTDetailsViewBrandHandler::LoadDefaultIconsLC( const TDesC& aMbmFile) - { - // array granularity is 5 - CAknIconArray* icons = new( ELeave )CAknIconArray( 5); - CleanupStack::PushL( icons ); - - icons->AppendL( LoadDefaultBitmapL( // 0 - EMbmVimpstuiQgn_prop_im_friend_off, - EMbmVimpstuiQgn_prop_im_friend_off_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 1 - EMbmVimpstuiQgn_prop_im_friend_on, - EMbmVimpstuiQgn_prop_im_friend_on_mask, - aMbmFile ) ); - - icons->AppendL( LoadDefaultBitmapL( // 2 - EMbmVimpstuiQgn_prop_im_friend_away, - EMbmVimpstuiQgn_prop_im_friend_away_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 3 - EMbmVimpstuiQgn_prop_im_friend_busy, - EMbmVimpstuiQgn_prop_im_friend_busy_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 4 - EMbmVimpstuiQgn_prop_im_friend_invisible, - EMbmVimpstuiQgn_prop_im_friend_invisible_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 5 - EMbmVimpstuiQgn_prop_im_imsg, - EMbmVimpstuiQgn_prop_im_imsg_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 6 - EMbmVimpstuiQgn_prop_im_imsg_new, - EMbmVimpstuiQgn_prop_im_imsg_new_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 7 - EMbmVimpstuiQgn_prop_service_default_avatar, - EMbmVimpstuiQgn_prop_service_default_avatar_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 8 - EMbmVimpstuiQgn_prop_service_friend_request_received, - EMbmVimpstuiQgn_prop_service_friend_request_received_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 9 - EMbmVimpstuiQgn_prop_service_friend_request_sent, - EMbmVimpstuiQgn_prop_service_friend_request_sent_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 10 - EMbmVimpstuiQgn_prop_service_off_friend_request_received, - EMbmVimpstuiQgn_prop_service_off_friend_request_received_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 11 - EMbmVimpstuiQgn_prop_service_off_friend_request_sent, - EMbmVimpstuiQgn_prop_service_off_friend_request_sent_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 12 - EMbmVimpstuiQgn_servtab_avatar_blocked, - EMbmVimpstuiQgn_servtab_avatar_blocked_mask, - aMbmFile ) ); //12 - - icons->AppendL( LoadDefaultBitmapL( // 13 - EMbmVimpstuiQgn_prop_im_friend_on_mobile, - EMbmVimpstuiQgn_prop_im_friend_on_mobile_mask, - aMbmFile ) ); - - return icons; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::LoadDefaultBitmapL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CGulIcon* CVIMPSTDetailsViewBrandHandler::LoadDefaultBitmapL( TInt aBitmapId, TInt aMaskId, - const TDesC& aFullPath ) - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - AknIconUtils::CreateIconLC( bitmap,mask, aFullPath,aBitmapId,aMaskId ); - // bitmap, mask ownership passed to gulIcon - CGulIcon* gulIcon = CGulIcon::NewL( bitmap, mask ); - CleanupStack::Pop( 2 ); // bitmap, mask - return gulIcon; - } - - // --------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::PropertyBrandVersionL() -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewBrandHandler::PropertyReadBrandL( TUint32 aServiceId ,TInt &aBrand, TServicePropertyName aPropertyName ) - { - TRACER_AUTO; - CSPProperty* property = CSPProperty::NewLC(); - iSettings->FindPropertyL( aServiceId, - aPropertyName, - *property ); - if ( property ) - { - property->GetValue( aBrand ); - } - CleanupStack::PopAndDestroy( property ); - - } - -// --------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::GetBrandInfo -// -// --------------------------------------------------------- -TInt CVIMPSTDetailsViewBrandHandler::GetBrandInfoL(TLanguage& aBrandLanguage, - TInt &aBrandVersion, TDes8& aBrandId) - - { - - CSPProperty* property = CSPProperty::NewLC(); - iSettings->FindPropertyL( iServiceId, - EPropertyBrandId, - *property ); - if ( property ) - { - HBufC* brandId = HBufC::NewLC( KVIMPSTUISPSMaxPropertyLength ); - TPtr brandIdPtr( brandId->Des() ); - property->GetValue( brandIdPtr ); - aBrandId.Copy(brandIdPtr); - CleanupStack::PopAndDestroy( brandId ); - } - CleanupStack::PopAndDestroy( property ); - - TInt language = ELangInternationalEnglish; - PropertyReadBrandL( iServiceId, language , EPropertyBrandLanguage ); - aBrandLanguage = ( TLanguage) language; - - PropertyReadBrandL( iServiceId, aBrandVersion , EPropertyBrandVersion) ; - - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::GetServiceNameL() -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewBrandHandler::GetServiceNameL( TDes& aServiceName ) - { - TRACER_AUTO; - CSPEntry* entry = CSPEntry::NewLC(); - TRAPD( err, iSettings->FindEntryL( iServiceId, *entry ) ); - if ( !err ) - { - aServiceName = entry->GetServiceName(); - } - CleanupStack::PopAndDestroy( entry ); - } - - // --------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::ServiceStoreUriL() -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTDetailsViewBrandHandler::ServiceStoreUriL() - { - TRACER_AUTO; - if( !iServiceStoreUri ) - { - iServiceStoreUri = HBufC::NewL( KVIMPST_MAX_LENGTH ); - TPtr serviceStorePtr( iServiceStoreUri->Des() ); - - CSPProperty* property = CSPProperty::NewLC(); - iSettings->FindPropertyL( iServiceId, - EPropertyContactStoreId, - *property ); - - property->GetValue( serviceStorePtr ); - CleanupStack::PopAndDestroy( property ); - } - return *iServiceStoreUri; - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewBrandHandler::ServiceSupportedL( ) -// --------------------------------------------------------------------------- -// -TBool CVIMPSTDetailsViewBrandHandler::ServiceSupportedL( ) - { - TRACER_AUTO; - TBool ret = EFalse; - CCch* cchClient = CCch::NewLC(); - if (cchClient) - { - CCchService* service = cchClient->GetService( iServiceId ); - TCchServiceStatus status; - status.SetState(ECCHUninitialized); - TInt err = service->GetStatus( TCCHSubserviceType(ECCHPresenceSub), status ); - if (KErrNone == err) - { - ret = ETrue; - } - CleanupStack::PopAndDestroy(); // cchClient - } - return ret; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewcontainer.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewcontainer.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,413 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview plugin control container - * -*/ - - -// INCLUDE FILES -#include "cvimpstdetailsviewcontainer.h" - -#include "cvimpstdetailsheadercontrol.h" -#include "cvimpstdetailsviewlistboxmodel.h" -#include "cvimpstdetailsviewbrandhandler.h" -#include "mvimpstdetailspresencehandler.h" -#include "cvimpstfieldpropertyarray.h" -#include "cvimpstfieldproperty.h" -#include "vimpstdetailsview.hrh" -#include - -// System includes -#include -#include -#include -#include -#include -// virtual phonebook -#include - -#include "vimpstextentionuiuid.h" -#include "meco.hlp.hrh" - -_LIT(KVIMPSTDetailsViewDllResFileName, "\\resource\\vimpstdetailsviewpluginrsc.rsc" ); - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::ConstructL() - { - // Create the listbox - RFs& fsSession( CCoeEnv::Static()->FsSession() ); - TFileName fileName( KVIMPSTDetailsViewDllResFileName ); - BaflUtils::NearestLanguageFile( fsSession , fileName); - - iResourceFile.OpenL(fsSession, fileName); - iResourceFile.ConfirmSignatureL(); - - // Create the header - iHeaderCtrl = CVIMPSTDetailsHeaderControl::NewL( iBrandHandler, iPresenceHandler ); - iHeaderCtrl->SetContainerWindowL( *this ); - - // Get the skin background for the view - iBackground = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMain, TRect( 0, 0, 0, 0 ), EFalse ); - - - iListBox = new(ELeave) CAknFormDoubleGraphicStyleListBox; - - iListBox->ConstructL(this, EAknListBoxLoopScrolling); - iListBox->View()->SetListEmptyTextL(KNullDesC); - iListBox->SetContainerWindowL(*this); - iListBox->CreateScrollBarFrameL(ETrue); - iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, - CEikScrollBarFrame::EAuto); - iListBox->SetMopParent(this); - - iListBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue ); - - CAknIconArray* iconArray = iBrandHandler.LoadIconsLC(); - // Set icon array - iListBox->ItemDrawer()->ColumnData()->SetIconArray(iconArray); - CleanupStack::Pop(); // iconArray - - // Read field property resource strucutre array - HBufC8* fieldBuffer = iResourceFile.AllocReadLC( R_VIMPST_FIELD_PROPERTIES ) ; - // reader ownership to model - iListBoxModel = CVIMPSTDetailsViewListBoxModel::NewL(*iListBox, iPresenceHandler, fieldBuffer); - CleanupStack::Pop(); // fieldBuffer - iListBox->Model()->SetItemTextArray(iListBoxModel); - iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); - - //Set listbox observer - iListBox->SetListBoxObserver( this ); - iListBox->ActivateL(); - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::CVIMPSTDetailsViewContainer() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTDetailsViewContainer::CVIMPSTDetailsViewContainer(const TUid& aPluginUid, - CVIMPSTDetailsViewBrandHandler& aBrandHandler, - MVIMPSTDetailsPresenceHandler& aPresenceHandler, - TInt aFocusedListIndex ) - : - iPluginUid(aPluginUid), - iBrandHandler( aBrandHandler ), - iPresenceHandler( aPresenceHandler ), - iFocusedListIndex( aFocusedListIndex ) - { - //No implementation needed. - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::~CVIMPSTDetailsViewContainer() -// Destructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTDetailsViewContainer::~CVIMPSTDetailsViewContainer() - { - delete iBackground; - delete iListBoxModel; - delete iListBox; - delete iHeaderCtrl; - iResourceFile.Close(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::Draw() -// ----------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::Draw(const TRect& /*aRect*/) const - { - // Draw the background using skin - if ( iBackground ) - { - AknsDrawUtils::Background( - AknsUtils::SkinInstance(), iBackground, this, SystemGc(), Rect() ); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::CountComponentControls -// -------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsViewContainer::CountComponentControls() const - { - // two control has been used , one header control and another list box - return 2; - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::ComponentControl -// -------------------------------------------------------------------------- -// -CCoeControl* CVIMPSTDetailsViewContainer::ComponentControl(TInt aIndex) const - { - switch ( aIndex ) - { - case 0: - return iHeaderCtrl; - case 1: - return iListBox; - default: - return NULL; - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::MopSupplyObject() -// ----------------------------------------------------------------------------- -// -TTypeUid::Ptr CVIMPSTDetailsViewContainer::MopSupplyObject(TTypeUid aId) - { - // For skinning - if ( iBackground && aId.iUid == MAknsControlContext::ETypeId ) - { - return MAknsControlContext::SupplyMopObject( aId, iBackground ); - } - return CCoeControl::MopSupplyObject( aId ); - } - - // ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::FocusChanged() -// ----------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::FocusChanged( TDrawNow aDrawNow ) - { - // For enabling animated hilight (if in skin supports it) - CCoeControl::FocusChanged( aDrawNow ); - if( iListBox ) - { - iListBox->SetFocus( IsFocused(), aDrawNow ); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::ListBox -// -------------------------------------------------------------------------- -// -CAknFormDoubleGraphicStyleListBox& CVIMPSTDetailsViewContainer::ListBox() const - { - return *iListBox; - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::ListBoxModel -// -------------------------------------------------------------------------- -// -CVIMPSTDetailsViewListBoxModel& CVIMPSTDetailsViewContainer::ListBoxModel() const - { - return *iListBoxModel; - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::OfferKeyEventL -// -------------------------------------------------------------------------- -// -TKeyResponse CVIMPSTDetailsViewContainer::OfferKeyEventL( - const TKeyEvent& aKeyEvent, TEventCode aType) - { - //Temporary solution for handling key events. - TKeyResponse result = EKeyWasNotConsumed; - - switch (aKeyEvent.iCode) - { - case EKeyLeftArrow: - case EKeyRightArrow: - return result; - } - - result = iListBox->OfferKeyEventL(aKeyEvent, aType); - - /* FIX for KBAA-7R3AXC bug */ - if (result == EKeyWasNotConsumed && IsFocused()) - { - // Ignore Send Key up and down events to prevent Dialer appearance - // on top of cca application. - if ((aType == EEventKeyDown || aType == EEventKeyUp) - && aKeyEvent.iScanCode == EStdKeyYes) - { - result = EKeyWasConsumed; - } - } - - return result; - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::SizeChanged -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::SizeChanged() - { - TRect drawRect( Rect() ); - - // Listbox and header - if (!Layout_Meta_Data::IsLandscapeOrientation()) - {// Portrait - AknLayoutUtils::LayoutControl( - iListBox, drawRect, AknLayoutScalable_Apps::cl_listscroll_pane(0)); - TRect listRect = iListBox->Rect(); - listRect.iTl.iX = Rect().iTl.iX; - listRect.iBr.iX = Rect().iBr.iX; - iListBox->SetRect(listRect); - TAknLayoutRect headerRect; - headerRect.LayoutRect(Rect(), AknLayoutScalable_Apps::cl_header_pane(0)); - iHeaderCtrl->SetRect(headerRect.Rect()); - } - else - {// Landscape - AknLayoutUtils::LayoutControl( - iListBox, drawRect, AknLayoutScalable_Apps::cl_listscroll_pane(1)); - TRect listRect = iListBox->Rect(); - listRect.iBr.iX = Rect().iBr.iX; - iListBox->SetRect(listRect); - TAknLayoutRect headerRect; - headerRect.LayoutRect(Rect(), AknLayoutScalable_Apps::cl_header_pane(1)); - iHeaderCtrl->SetRect(headerRect.Rect()); - } - // Background skin - if ( iBackground ) - { - iBackground->SetRect( drawRect ); - } - - DrawNow(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::HandleResourceChange -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::HandleResourceChange(TInt aType) - { - CCCAppViewPluginAknContainer::HandleResourceChange(aType); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::GetHelpContext -// ----------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::GetHelpContext(TCoeHelpContext& aContext ) const - { - TUid KHelpUid = { KHELPUID }; - aContext.iMajor = KHelpUid; - aContext.iContext = KSERVTAB_HLP_CONTACT_DETAILS; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::HandleListBoxEventL() -// ----------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::HandleListBoxEventL( - CEikListBox* /*aListBox*/, TListBoxEvent /*aEventType*/ ) - { - // Handle pointer events - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::PresenceChangedL -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::PresenceChangedL() - { - iListBox->HandleItemRemovalL(); - iListBoxModel->AddFieldsDataL(); - iHeaderCtrl->LabelsSizeChangedL(); - iHeaderCtrl->HeaderSizeChangedL(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::GetTitleTextL -// -------------------------------------------------------------------------- -// -HBufC* CVIMPSTDetailsViewContainer::GetTitleTextLC( TStoreType aStoreType ) - { - TInt count = 0; - HBufC* titleText = NULL; - - if( iListBoxModel ) - { - count = iListBoxModel->FieldsCount(); - } - if( aStoreType == EStoreLocal && count >0 ) - { - CVIMPSTFieldPropertyArray& fieldArry = iListBoxModel->FieldsArray(); - - CVIMPSTFieldProperty* field = fieldArry.GetFieldById( EVIMPSTFieldIdFirstName ); - TPtrC firstName = field ? field->FieldDataL() : KNullDesC; - - field = fieldArry.GetFieldById( EVIMPSTFieldIdLastName ); - TPtrC lastName = field ? field->FieldDataL() : KNullDesC; - if( firstName.Length() || lastName.Length() ) - { - titleText = HBufC::NewLC( firstName.Length() + lastName.Length() +1 ); // pushed on clean up stack - if( titleText) - { - TPtr titleTextPtr( titleText->Des() ); - titleTextPtr.Append(firstName); - titleTextPtr.Append(KSpace); - titleTextPtr.Append(lastName); - } - } - } - else if( count >0) - { - CVIMPSTFieldPropertyArray& fieldArry = iListBoxModel->FieldsArray(); - CVIMPSTFieldProperty* field = fieldArry.GetFieldById( EVIMPSTFieldIdImpp ); - TPtrC title = field ? field->FieldDataL() : KNullDesC; - titleText = iListBoxModel->DisplayId( title ).AllocLC(); // pushed on clean up stack - } - return titleText; - } -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::CreatePresentationL -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::CreatePresentationL(MVPbkStoreContact& aContact,TDesC& aServiceName, TStoreType aStoreType ) - { - iListBoxModel->CreateListPresentationL( aContact, - iFocusedListIndex, - aServiceName, aStoreType); - - iHeaderCtrl->CreateHeaderPresentationL( aContact ); - iHeaderCtrl->HeaderSizeChangedL(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewContainer::CreateEmptyPresentationL -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewContainer::CreateEmptyPresentationL() - { - if( !iListBoxModel->MdcaCount() ) - { - iListBoxModel->SetEmptyTextsToListboxL(); - iHeaderCtrl->ClearL(); // clear the header data - } - } -// End of File - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewfactory.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview plugin control container - * -*/ -// settings - -#include -#include -#include -#include -#include - -#include "cvimpstdetailsviewpluginfactory.h" -#include "cvimpstdetailsviewplugin.h" - -#include "uiservicetabtracer.h" -// meco service uid -#define KMECOIMPLEMENTATIONUID 0x20012423 -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPluginFactory::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewPluginFactory* CVIMPSTDetailsViewPluginFactory::NewL() - { - CVIMPSTDetailsViewPluginFactory* self = new ( ELeave ) CVIMPSTDetailsViewPluginFactory(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop();//self, do not pass the parameter to pop since this is an M Class.. - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPluginFactory::CVIMPSTDetailsViewPluginFactory -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewPluginFactory::CVIMPSTDetailsViewPluginFactory(): - iServiceId( 0 ) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPluginFactory::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPluginFactory::ConstructL() - { - TRACER_AUTO; - - RProperty::Define(KMeCoPropertyUid, KMeCoXSPDetailsServiceIdKey, RProperty::EInt, - ECapabilityReadUserData ,ECapabilityWriteUserData); - - ReadServiceIdL(); - if(iServiceIds.Count() == 0) - { - User::Leave(KErrArgument); - } - - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPluginFactory::~CVIMPSTDetailsViewPluginFactory -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewPluginFactory::~CVIMPSTDetailsViewPluginFactory() - { - iServiceIds.Reset(); - iServiceIds.Close(); - RProperty::Set(KMeCoPropertyUid, KMeCoXSPDetailsServiceIdKey, 0 ); //reset to zero - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPluginFactory::TabViewCount -// --------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsViewPluginFactory::TabViewCount() - { - TRACER_AUTO; - // read the service id from RProperty - RProperty::Get(KMeCoPropertyUid, KMeCoXSPDetailsServiceIdKey, iServiceId ); - TInt returnVal = 0; - if( iServiceId <= 0 ) - { - TRACE("iservice <=0"); - return iServiceIds.Count(); - } - else - { - TRACE("iservice > 0"); - iServiceIds.Reset(); - iServiceIds.Append( iServiceId ); - returnVal = 1; - } - return returnVal; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPluginFactory::CreateTabViewL -// --------------------------------------------------------------------------- -// -CCCAppViewPluginBase* CVIMPSTDetailsViewPluginFactory::CreateTabViewL( TInt aIndex ) - { - TRACER_AUTO; - - TRACE("aIndex = %d", aIndex); - CCCAppViewPluginBase* viewPluginBase = NULL; - if( aIndex < iServiceIds.Count() && aIndex >= 0 ) - { - TRACE("creating view aIndex = %d", aIndex); - viewPluginBase = CVIMPSTDetailsViewPlugin::NewL( iServiceIds[aIndex]); - TRACE("view created"); - } - else - { - User::Leave(KErrArgument); - } - - return viewPluginBase; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPluginFactory::ReadServiceIdL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsViewPluginFactory::ReadServiceIdL() - { - TRACER_AUTO; - CSPSettings* settings = CSPSettings::NewLC(); - iServiceIds.Reset(); - ///////////////////////Get Service Id//////////////// - RArray services; - CleanupClosePushL( services ); - settings->FindServiceIdsL( services ); - const TInt serviceCount = services.Count(); - for ( TInt i( 0 ); i < serviceCount; i++ ) - { - TInt refContactUid = KErrNotFound; - CSPProperty* property = CSPProperty::NewLC(); - settings->FindPropertyL( services[i],EPropertyContactViewPluginId,*property ); - if ( property ) - { - property->GetValue( refContactUid ); - } - CleanupStack::PopAndDestroy( property ); - if ( (TUid::Uid( refContactUid ) == TUid::Uid( KMECOIMPLEMENTATIONUID )) - || (TUid::Uid( refContactUid ) == TUid::Uid( 0x20007B6D ) ) - || (TUid::Uid( refContactUid ) == TUid::Uid( 0x2002B334 ))) - { - iServiceIds.Append( services[i] ); - } - } - CleanupStack::PopAndDestroy( &services ); - CleanupStack::PopAndDestroy( settings ); - return iServiceIds.Count(); - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewlistboxmodel.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewlistboxmodel.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,348 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview plugin control data model - * -*/ - - -#include "cvimpstdetailsviewlistboxmodel.h" - -#include "cvimpstfieldproperty.h" -#include "cvimpstfieldpropertyarray.h" -#include "vimpstdetailsview.hrh" -#include "tvimpstenums.h" -#include -// virtual phonebook -#include -#include -#include -#include -// system includes -#include -#include -#include -#include -#include -#include -#include - -// ======== LOCAL FUNCTIONS ======== - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewListBoxModel* CVIMPSTDetailsViewListBoxModel::NewL( - CEikListBox& aListBox, - MVIMPSTDetailsPresenceHandler& aPresenceHandler, - HBufC8* aFieldBuffer) - { - CVIMPSTDetailsViewListBoxModel* self = - new(ELeave) CVIMPSTDetailsViewListBoxModel(aListBox, aPresenceHandler, - aFieldBuffer ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::~CVIMPSTDetailsViewListBoxModel -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewListBoxModel::~CVIMPSTDetailsViewListBoxModel() - { - delete iFieldArray; - delete iTextCache; - delete iFieldBuffer; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::CVIMPSTDetailsViewListBoxModel -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewListBoxModel::CVIMPSTDetailsViewListBoxModel( - CEikListBox& aListBox, - MVIMPSTDetailsPresenceHandler& aPresenceHandler, - HBufC8* aFieldBuffer ) - : iListBox(aListBox), - iPresenceHandler( aPresenceHandler ) - { - // owns - iFieldBuffer = aFieldBuffer ; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewListBoxModel::ConstructL() - { - iTextCache = new(ELeave) CDesCArrayFlat(KCacheGranularity); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel:: -// --------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsViewListBoxModel::FocusedFieldIndex() - { - return iListBox.CurrentItemIndex(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel:: -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewListBoxModel::SetFocusedListIndex(TInt aIndex) - { - if( !iFieldArray ) - { - return; - } - TInt count = iFieldArray->Count(); - if ( aIndex < 0 || aIndex >= count ) - { - aIndex = 0; - } - if( count ) - { - iListBox.SetCurrentItemIndexAndDraw(aIndex); - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel:: -// --------------------------------------------------------------------------- -// - CVIMPSTFieldProperty& CVIMPSTDetailsViewListBoxModel::FocusField() - { - return ( iFieldArray->At( FocusedFieldIndex() ) ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::FieldsArray -// --------------------------------------------------------------------------- -// - CVIMPSTFieldPropertyArray& CVIMPSTDetailsViewListBoxModel::FieldsArray() - { - return *iFieldArray; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::FieldsCount -// --------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsViewListBoxModel::FieldsCount() - { - if( !iFieldArray ) - { - return 0; - } - return iFieldArray->Count(); - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::CreateListPresentationL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewListBoxModel::CreateListPresentationL( MVPbkStoreContact& aContact, - TInt aFocusFieldIndex,TDesC& aServiceName, TStoreType aStoreType ) - { - const MVPbkContactStoreProperties& storeProperties = aContact.ParentStore().StoreProperties(); - const MVPbkFieldTypeList& supportedFieldTypes = storeProperties.SupportedFields(); - - if( iFieldBuffer ) - { - TResourceReader reader; - HBufC8* buf = iFieldBuffer->AllocL(); - CleanupStack::PushL( buf ); - reader.SetBuffer( buf ); - iFieldArray = CVIMPSTFieldPropertyArray::NewL( supportedFieldTypes, - aContact, - reader , - iPresenceHandler.IsSupported(), - aServiceName, - aStoreType); - CleanupStack::PopAndDestroy( buf ); - } - - AddFieldsDataL(); - if( iTextCache->Count() ) - { - CVIMPSTFieldProperty* field = iFieldArray->GetFieldById( EVIMPSTFieldIdImpp ); - if( field ) - { - iPresenceHandler.SubscribePresenceL( field->FieldDataL() ); - } - SetFocusedListIndex( aFocusFieldIndex ); - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::SetEmptyTextsToListboxL() -// See header for details. -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewListBoxModel::SetEmptyTextsToListboxL() - { - // update the empty string now to avoid flickering - HBufC* string = StringLoader::LoadLC( R_SERVDETAIL_BACKGROUNDTEXT_HEADER ); - if( string ) - { - iListBox.View()->SetListEmptyTextL( *string ); - CleanupStack::PopAndDestroy( string ); - iListBox.DrawNow(); - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::MdcaCount -// --------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsViewListBoxModel::MdcaCount() const - { - return iTextCache->Count(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::MdcaPoint -// --------------------------------------------------------------------------- -// -TPtrC CVIMPSTDetailsViewListBoxModel::MdcaPoint(TInt aIndex) const - { - return iTextCache->MdcaPoint(aIndex); - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::AddFieldsDataL -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewListBoxModel::AddFieldsDataL( ) - { - iTextCache->Reset(); - - TInt fieldCount = iFieldArray->Count(); - - for (TInt i = 0; i < fieldCount; i++) - { - TBuf buffer; - buffer.Zero(); - - CVIMPSTFieldProperty& field = iFieldArray->At(i); - TInt iconId = field.IconId(); - if( field.FieldId() == EVIMPSTFieldIdStatusMsg ) - { - TVIMPSTEnums::TOnlineStatus status = iPresenceHandler.GetPresenceStatus(); - switch( status ) - { - case TVIMPSTEnums::EOnline: - { - iconId = static_cast(EVIMPSTServiceIconOn); - break; - } - case TVIMPSTEnums::EInvisible: - { - iconId = static_cast(EVIMPSTServiceIconInvi); - break; - } - case TVIMPSTEnums::EAway: - { - iconId = static_cast(EVIMPSTServiceIconAway); - break; - } - case TVIMPSTEnums::EBusy: - case TVIMPSTEnums::EDoNotDisturb: - { - iconId = static_cast(EVIMPSTServiceIconBusy); - break; - } - case TVIMPSTEnums::EOnPhone: - { - iconId = static_cast(EVIMPSTServiceIconOnMobile); - break; - } - case TVIMPSTEnums::EOffline: - { - iconId = static_cast(EVIMPSTServiceIconOff); - break; - } - case TVIMPSTEnums::ECallForward: - { - iconId = static_cast(EVIMPSTServiceIconCallForward); - break; - } - case TVIMPSTEnums::EPending: - case TVIMPSTEnums::EBlocked: - case TVIMPSTEnums::EUnknown: - case TVIMPSTEnums::EServiceOut: - default: - { - iconId = static_cast(EVIMPSTServiceIconEmpty); - break; - } - } - field.SetFieldTextL( iPresenceHandler.GetStatusMessageL() ) ; - } - - if( iconId == static_cast(EVIMPSTServiceIconEmpty ) ) - { - buffer.Append(KTabLit); //0 - } - else - { - buffer.AppendNum(iconId); //0 - buffer.Append(KTabLit); - } - - TPtrC labelPtr = field.DefaultLabelL(); - buffer.Append( labelPtr ); - buffer.Append(KTabLit); - TPtrC fieldText = field.FieldDataL(); - buffer.Append( fieldText ); - iTextCache->AppendL(buffer); - buffer.Zero(); - } - iListBox.HandleItemAdditionL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTDetailsViewListBoxModel::DisplayId -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTDetailsViewListBoxModel::DisplayId( const TDesC& aId, TBool aListHiding ) - { - TPtrC ret( aId ); - // locate ":" for userid, groupid. - // locate "/" for list id. - TInt pos = aId.FindC( aListHiding ? KSlash : KColon ); - - if ( ( pos != KErrNotFound) && ( pos != aId.Length()-1) ) - { - // contains the special character, and it is not the last char - // remove everything before the special char (including the char) - ret.Set( aId.Mid( pos + 1 ) ); - } - // remove also the domain part - TInt domainPos = ret.FindC( KAt ); - if ( ( domainPos != KErrNotFound ) && ( domainPos != 0 ) ) - { - ret.Set( ret.Mid( 0, domainPos ) ); - } - return ret; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewmenuhandler.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewmenuhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,368 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of detailsview plugin menu handler -* -*/ - - -#include "cvimpstdetailsviewmenuhandler.h" - -#include "cvimpstdetailsviewlistboxmodel.h" -#include "cvimpstdetailsviewcontainer.h" -#include "cvimpstdetailsviewplugin.h" -#include "cvimpstdetailscontacthandler.h" -#include "vimpstdetailsview.hrh" -#include -#include -#include -#include -#include - -using namespace AiwContactAssign; -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewMenuHandler* CVIMPSTDetailsViewMenuHandler::NewL( - CVIMPSTDetailsViewPlugin& aPlugin, - TStoreType aStoreType ) - { - CVIMPSTDetailsViewMenuHandler* self = new(ELeave) CVIMPSTDetailsViewMenuHandler( aPlugin,aStoreType ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::~CVIMPSTDetailsViewMenuHandler -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewMenuHandler::~CVIMPSTDetailsViewMenuHandler() - { - delete iAiwServiceHandler; - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::CVIMPSTDetailsViewMenuHandler() -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewMenuHandler::CVIMPSTDetailsViewMenuHandler( - CVIMPSTDetailsViewPlugin& aPlugin, - TStoreType aStoreType) : - iPlugin(aPlugin), - iStoreType( aStoreType ) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewMenuHandler::ConstructL() - { - PrepareAiwMenusL(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::DynInitMenuPaneL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewMenuHandler::DynInitMenuPaneL(TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - if (iAiwServiceHandler) - { - if ( iAiwServiceHandler->HandleSubmenuL(*aMenuPane)) - { - return; - } - } - switch (aResourceId) - { - case R_VIMPSTDETAILSVIEW_MENUPANE: - { - TInt pos = 0; - if ( iAiwServiceHandler ) - { - if ( iAiwServiceHandler->IsAiwMenu(aResourceId)) - { - iAiwServiceHandler->InitializeMenuPaneL( *aMenuPane, - aResourceId, ECCAppDetailsViewAiwBaseCmd, - iAiwServiceHandler->InParamListL() ); - } - } - if ( aMenuPane->MenuItemExists(ECCAppDetailsViewSetTopContactCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewSetTopContactCmd, ETrue ); - } - if( aMenuPane->MenuItemExists(ECCAppDetailsViewRemoveTopContactCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewRemoveTopContactCmd, ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewNumberCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewNumberCmd,ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewAddressCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewAddressCmd,ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewCopyNumberCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewCopyNumberCmd, ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewCopyAddressCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewCopyAddressCmd, ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewImageCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewImageCmd, ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewSendBusinessCardCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewSendBusinessCardCmd, ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewCopyCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewCopyCmd, ETrue ); - } - // Dims the edit option in service details view. - if(aMenuPane->MenuItemExists(KAiwCmdAssign, pos)) - { - aMenuPane->SetItemDimmed(KAiwCmdAssign,ETrue ); - } - - if (aMenuPane->MenuItemExists(EVIMPSTDetailsCopyCmd, pos)) - { - aMenuPane->SetItemDimmed(EVIMPSTDetailsCopyCmd, ETrue ); - } - if (aMenuPane->MenuItemExists(EVIMPSTDetailsDeleteCmd, pos)) - { - aMenuPane->SetItemDimmed(EVIMPSTDetailsDeleteCmd, ETrue ); - } - - - const CVIMPSTDetailsViewContainer& container = - static_cast( iPlugin.GetContainer() ); - - TInt count = container.ListBoxModel().MdcaCount(); - if( !count ) - { - // no items hide options - if (aMenuPane->MenuItemExists(EVIMPSTDetailsEditCmd, pos)) - { - aMenuPane->SetItemDimmed(EVIMPSTDetailsEditCmd, ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewDeleteCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewDeleteCmd, ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewCopyDetailCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewCopyDetailCmd,ETrue ); - } - if (aMenuPane->MenuItemExists(ECCAppDetailsViewEditItemCmd, pos) ) - { - aMenuPane->SetItemDimmed(ECCAppDetailsViewEditItemCmd,ETrue ); - } - } - break; - } - default: - break; - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::HandleNotifyL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTDetailsViewMenuHandler::HandleNotifyL( - TInt aCmdId, - TInt aEventId, - CAiwGenericParamList& aEventParamList, - const CAiwGenericParamList& /*aInParamList*/) - { - TInt result = KErrNone; - - if (aCmdId == KAiwCmdAssign) - { - if (aEventId == KAiwEventCompleted) - { - TInt index = 0; - const TAiwGenericParam* param = aEventParamList.FindFirst(index, - EGenericParamContactLinkArray); - if (param) - { - TPtrC8 contactLinks = param->Value().AsData(); - CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC( - contactLinks, iPlugin.GetContactHandler()->ContactStoresL()); - if(links) - { - iPlugin.GetContactHandler()->SetLinks(links, EFalse); - } - CleanupStack::Pop(links); - } - - const TAiwGenericParam* indexparam = aEventParamList.FindFirst(index, - EGenericParamContactItem); - if (indexparam) - { - const CVIMPSTDetailsViewContainer& container = - static_cast(iPlugin.GetContainer()); - TInt index = indexparam->Value().AsTInt32(); - container.ListBoxModel().SetFocusedListIndex(index); - } - result = ETrue; - } - else if (aEventId == KAiwEventCanceled) - { - //if cancelled - result = ETrue; - } - else if (aEventId == KAiwEventQueryExit) - { - //issue command to cancel the previous request. - iAiwServiceHandler->ExecuteServiceCmdL( - KAiwCmdAssign, - iAiwServiceHandler->InParamListL(), - iAiwServiceHandler->OutParamListL(), - KAiwOptCancel, - this); - result = ETrue; - } - } - - return result; - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::HandleCommandL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewMenuHandler::HandleCommandL(TInt aCommand) - { - // TODO : dependency on cca , they are not deleting the menu items Then check if command is normal application command - switch (aCommand) - { - case KAiwCmdAssign:// AIW service cmd for Editing - { - if(iAiwServiceHandler && (iStoreType == EStoreLocal)) - { - DoEditCmdL(); - } - break; - } - case EVIMPSTDetailsEditCmd: - case ECCAppDetailsViewEditItemCmd: - { - //TODO: in case of server store nick names has to be supported - break; - } - case EVIMPSTDetailsDeleteCmd: - case ECCAppDetailsViewDeleteCmd: - { - DoDeleteCmdL(); - break; - } - case EVIMPSTDetailsCopyCmd: - case ECCAppDetailsViewCopyDetailCmd: - { - DoCopyCmdL(); - break; - } - default: - break; - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::DoEditCmdL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewMenuHandler::DoEditCmdL() - { - const CVIMPSTDetailsViewContainer& container = - static_cast(iPlugin.GetContainer()); - - - CAiwGenericParamList& inParamList = iAiwServiceHandler->InParamListL(); - - inParamList.AppendL(TAiwGenericParam( - EGenericParamContactAssignData, - TAiwVariant(TAiwSingleContactAssignDataV1Pckg( - TAiwSingleContactAssignDataV1().SetFlags(EskipInfoNotes))))); - - HBufC8* packedLinks = iPlugin.GetContactHandler()->Links()->PackLC(); - - inParamList.AppendL(TAiwGenericParam(EGenericParamContactLinkArray, - TAiwVariant( *packedLinks))); - - TInt focusIndex = container.ListBoxModel().FocusedFieldIndex(); - - // TODO: use int instead of buf. - TBuf<8> focusIndexBuf; - focusIndexBuf.Num(focusIndex); - const TAiwVariant focusIndexVariant(focusIndexBuf); - - inParamList.AppendL(TAiwGenericParam(EGenericParamContactItem, focusIndexVariant)); - - iAiwServiceHandler->ExecuteServiceCmdL( - KAiwCmdAssign, - inParamList, - iAiwServiceHandler->OutParamListL(), - NULL, - this); - - CleanupStack::PopAndDestroy(packedLinks); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::DoDeleteCmdL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewMenuHandler::DoDeleteCmdL() - { - CAknInformationNote* informationNote = new(ELeave) CAknInformationNote; - informationNote->ExecuteLD(_L("Delete not supported yet")); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::DoCopyCmdL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewMenuHandler::DoCopyCmdL() - { - CAknInformationNote* informationNote = new(ELeave) CAknInformationNote; - informationNote->ExecuteLD(_L("Copy not supported yet")); - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewMenuHandler::PrepareAiwMenusL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewMenuHandler::PrepareAiwMenusL() - { - // Initialisation of AIW Servicehandler cannot be in - // ConstructL, since the menus of plugin are given - // later via ProvideApplicationResourcesL(..) - iAiwServiceHandler = CAiwServiceHandler::NewL(); - iAiwServiceHandler->AttachL( - R_VIMPSTDETAILSVIEW_AIW_SERVICE_INTERESTS); - - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewplugin.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewplugin.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,447 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of details view plugin -* -*/ - - -#include "cvimpstdetailsviewplugin.h" - -#include "cvimpstdetailsviewcontainer.h" -#include "cvimpstdetailsviewlistboxmodel.h" -#include "cvimpstdetailsviewmenuhandler.h" -#include "vimpstdetailsviewpluginuids.hrh" -#include "cvimpstdetailsviewbrandhandler.h" -#include "cvimpstdetailscontacthandler.h" - -#include "vimpstdetailsview.hrh" -#include -#include -#include -#include "cvimpstdetailspresencehandler.h" - -#include - -#include -#include -#include -#include -#include -#include -// cca -#include -#include -#include - -// settings -#include -#include -#include - -// Virtual Phonebook -#include - -#include "uiservicetabtracer.h" -// meco service uid -#define KMECOIMPLEMENTATIONUID 0x20012423 -_LIT(KVIMPSTDetailsViewDllResFileName, "\\resource\\vimpstdetailsviewpluginrsc.rsc"); -_LIT8( KEMbmConversationsQgnDefaultImage, "default_brand_image"); - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewPlugin* CVIMPSTDetailsViewPlugin::NewL(TInt aServiceId) - { - CVIMPSTDetailsViewPlugin* self = new(ELeave) CVIMPSTDetailsViewPlugin(aServiceId); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::~CVIMPSTDetailsViewPlugin -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewPlugin::~CVIMPSTDetailsViewPlugin() - { - TRACER_AUTO; - delete iMenuHandler; - TRACE("iMenuHandler deleted"); - delete iBrandHandler; - TRACE("iBrandHandler deleted"); - delete iPresenceHandler; - TRACE("iPresenceHandler deleted"); - delete iContactHandler; - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::CVIMPSTDetailsViewPlugin() -// --------------------------------------------------------------------------- -// -CVIMPSTDetailsViewPlugin::CVIMPSTDetailsViewPlugin(TInt aServiceId) : iFocusedListIndex(0), -iServiceId (aServiceId) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::ConstructL() - { - iBrandHandler = CVIMPSTDetailsViewBrandHandler::NewL( iServiceId ); - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::PreparePluginViewL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::PreparePluginViewL( - MCCAppPluginParameter& aPluginParameter) - { - // check parameter version - TRACER_AUTO; - if (aPluginParameter.Version() != 1) - { - User::Leave(KErrNotSupported); - } - - if (aPluginParameter.CCAppLaunchParameter().ContactDataFlag() == - MCCAParameter::EContactLink) - { - iLaunchParameter = &aPluginParameter.CCAppLaunchParameter(); - } - - PrepareViewResourcesL(); - - HBufC* serviceName = HBufC::NewLC( KVIMPST_MAX_LENGTH ); - TPtr serviceNamePtr = serviceName->Des() ; - iBrandHandler->GetServiceNameL( serviceNamePtr ); - //initialize the presence cache. - iPresenceHandler = CVIMPSTDetailsPresenceHandler::NewL( serviceNamePtr,*this, - iBrandHandler->ServiceSupportedL() ); - - iContactHandler = CVIMPSTDetailsContactHandler::NewL( *iLaunchParameter , - *this, - iBrandHandler->ServiceStoreUriL(), - serviceNamePtr, - iServiceId); - - TRACE("iContactHandler created"); - CleanupStack::PopAndDestroy(); // serviceName - - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::ImplementationUid -// --------------------------------------------------------------------------- -// -TUid CVIMPSTDetailsViewPlugin::ImplementationUid() - { - return TUid::Uid(KVIMPSTDetailsViewPluginImplmentationUid ); - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::ProvideBitmapLC -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::ProvideBitmapLC( - TCCAppIconType aIconType, CFbsBitmap*& aBitmap, CFbsBitmap*& aBitmapMask) - { - if (ECCAppTabIcon == aIconType) - { - CFbsBitmap* bmp = NULL; - CFbsBitmap* bmpMask = NULL; - - // Create icon array - iBrandHandler->LoadBitMapLC( - bmp, - bmpMask, - EMbmConversationsQgn_prop_im_imsg, - EMbmConversationsQgn_prop_im_imsg_mask - ); - - aBitmap = bmp; - aBitmapMask = bmpMask; - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::ProvideBitmapL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::ProvideBitmapL( - TCCAppIconType aIconType, CAknIcon& aIcon) - - { - TRACER_AUTO; - if (ECCAppTabIcon == aIconType) - { - CFbsBitmap* bmp = NULL; - CFbsBitmap* bmpMask = NULL; - CGulIcon* tabIcon = iBrandHandler->LoadBrandBitmapL(KEMbmConversationsQgnDefaultImage); - if(tabIcon) - { - bmp = tabIcon->Bitmap(); - bmpMask = tabIcon->Mask(); - aIcon.SetBitmap(bmp); // ownership transfer to aIcon - aIcon.SetMask(bmpMask); // ownership transfer to aIcon - // this is remove the memory leak - tabIcon->SetBitmapsOwnedExternally( ETrue ); - delete tabIcon ; - } - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::NewContainerL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::NewContainerL() - { - if( iBrandHandler && iLaunchParameter ) - { - iContainer = new (ELeave) CVIMPSTDetailsViewContainer( Id(), - *iBrandHandler, - *iPresenceHandler, - iFocusedListIndex ); - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::DynInitMenuPaneL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::DynInitMenuPaneL(TInt aResourceId, - CEikMenuPane* aMenuPane) - { - if (!iMenuHandler) - { - iMenuHandler = CVIMPSTDetailsViewMenuHandler::NewL(*this, - iContactHandler->StoreType() ); - } - iMenuHandler->DynInitMenuPaneL(aResourceId, aMenuPane); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::HandleCommandL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::HandleCommandL(TInt aCommand) - { - // CCApp handles the "Exit"- and "Back"-commands, - // rest to menuhandler - CCCAppViewPluginAknView::HandleCommandL(aCommand); - - iMenuHandler->HandleCommandL(aCommand); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::Id -// --------------------------------------------------------------------------- -// -TUid CVIMPSTDetailsViewPlugin::Id() const - { - return TUid::Uid(KVIMPSTDetailsViewPluginImplmentationUid + iServiceId); - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::PrepareViewResourcesL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::PrepareViewResourcesL() - { - // Ignore codescanner warning generated here : " Leaving function called before BaseConstructL " - TRACER_AUTO; - TFileName fileName(KVIMPSTDetailsViewDllResFileName); - BaflUtils::NearestLanguageFile(iCoeEnv->FsSession(), fileName); - iResourceLoader.OpenL(fileName); - BaseConstructL(R_VIMPSTDETAILSVIEW_MAINVIEW); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::DoActivateL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::DoActivateL( - const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage) - { - TRACER_AUTO; - CCCAppViewPluginAknView::DoActivateL(aPrevViewId, aCustomMessageId, - aCustomMessage); - TRACE("calling GetContactData"); - GetContactDataL(); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::DoDeactivate -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::DoDeactivate() - { - TRACER_AUTO; - if( iContactHandler ) - { - iContactHandler->CancelOngoingRequest(); - } - TRACE("ongoing request canceled"); - if (iContainer) - { - iFocusedListIndex = static_cast - (iContainer)->ListBoxModel().FocusedFieldIndex(); - } - TRACE("calling base class Deactivate"); - CCCAppViewPluginAknView::DoDeactivate(); - // not woned by this class - iContainer = NULL; - - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::GetContactDataL -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::GetContactDataL() - { - - TRACER_AUTO; - if (iLaunchParameter && iContactHandler ) - { - // todo: pass launchparameter to listbox model? - HBufC& contactData = iLaunchParameter->ContactDataL(); - - HBufC8* buf = HBufC8::NewLC(contactData.Length()); - buf->Des().Copy(contactData); - TPtrC8 bufDes(buf->Des()); - - CVPbkContactLinkArray* links = CVPbkContactLinkArray::NewLC( bufDes, iContactHandler->ContactStoresL() ); - CleanupStack::Pop(links); - TRACE("links created"); - CleanupStack::PopAndDestroy(buf); - TRACE("buffer destroyed"); - TUid launchUid = iLaunchParameter->LaunchedViewUid(); - if( launchUid.iUid != (KVIMPSTDetailsViewPluginImplmentationUid+iServiceId) && iContactHandler->StoreType() == EStoreServer ) - { - TRACE("service store set link called from pbk"); - // launch from other than service tab - // ETrue, read xsp id from pbk store and search in service store and show - // incase of xsp store , need to find the details from xsp store - iContactHandler->SetLinks( links , ETrue ); - } - else - { - TRACE("set linkcalled from service tab/CV"); - iContactHandler->SetLinks( links , EFalse ); - //make sure this is set to null after view is changed - // cannot be set it to null in dodeactivate call. as ilaunchparameter is not - //owned by us. might get destryoed by cca - iLaunchParameter->SetLaunchedViewUid(TUid::Null()); - } - } - - } -// --------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::SetTitleL -// --------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::SetTitleL() - { - TRACER_AUTO; - HBufC* title = NULL; - - if( iContainer && iContactHandler ) - { - title = static_cast - (iContainer)->GetTitleTextLC( iContactHandler->StoreType() ); - } - if( !title ) - { - if(iContactHandler) - { - title = iContactHandler->GetDisplayNameLC(); - } - } - // Forward the SetTitleL-call to base-class - if( title ) - { - CCCAppViewPluginAknView::SetTitleL( *title ); - CleanupStack::PopAndDestroy(); // title - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::HandlePresenceChangedL -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::HandlePresenceChangedL() - { - if( iContainer ) - { - static_cast - (iContainer)->PresenceChangedL(); - } - - } -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::HandleContactReadyL -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::HandleContactReadyL( MVPbkStoreContact& aContact ) - { - TRACER_AUTO; - if( iContainer ) - { - // read the service name for servic eid - iServiceId - // pass to CreatePresentation - HBufC* serviceName = HBufC::NewLC( KVIMPST_MAX_LENGTH ); - TPtr serviceNamePtr = serviceName->Des() ; - iBrandHandler->GetServiceNameL( serviceNamePtr ); - - static_cast - (iContainer)->CreatePresentationL( aContact ,*serviceName, iContactHandler->StoreType() ); - // delete service name - CleanupStack::PopAndDestroy();//serviceName - } - SetTitleL(); // call only after presentation is created - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::HandleContactUnavailableL -// -------------------------------------------------------------------------- -// -void CVIMPSTDetailsViewPlugin::HandleContactUnavailableL() - { - if( iContainer ) - { - static_cast - (iContainer)->CreateEmptyPresentationL(); - } - SetTitleL(); // call only after presentation is created - } - -// -------------------------------------------------------------------------- -// CVIMPSTDetailsViewPlugin::GetContactHandler -// -------------------------------------------------------------------------- -// -CVIMPSTDetailsContactHandler* CVIMPSTDetailsViewPlugin::GetContactHandler() - { - return iContactHandler; - } -// End of File - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewpluginproxy.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstdetailsviewpluginproxy.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2008 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: View plugin base class of ECE's CCA-application - * -*/ - - -#include -#include - -#include "cvimpstdetailsviewpluginfactory.h" -#include "vimpstdetailsviewpluginuids.hrh" - -const TImplementationProxy ImplementationTable[] = -{ - IMPLEMENTATION_PROXY_ENTRY(KVIMPSTDetailsViewPluginImplmentationUid, - CVIMPSTDetailsViewPluginFactory::NewL) -}; - -// --------------------------------------------------------------------------- -// ImplementationGroupProxy -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy( - TInt& aTableCount) -{ - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; -} - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstfieldproperty.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstfieldproperty.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,211 +0,0 @@ -/* -* Copyright (c) 2008 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: a single field with type - * -*/ - - -#include "cvimpstfieldproperty.h" - -#include "cvimpstfieldpropertyarray.h" -// From Virtual Phonebook -#include -#include -#include "vimpstdetailsview.hrh" -#include -#include -#include -#include -#include -// System includes -#include -#include "uiservicetabtracer.h" - -_LIT(KColon,":"); -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::CVIMPSTFieldProperty -// -------------------------------------------------------------------------- -// -CVIMPSTFieldProperty::CVIMPSTFieldProperty( TInt aFieldId, TInt aIconId, TInt aMaxLength ) - :iFieldId( aFieldId ), - iIconId( aIconId ), - iMaxLength( aMaxLength) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::~CVIMPSTFieldProperty -// -------------------------------------------------------------------------- -// -CVIMPSTFieldProperty::~CVIMPSTFieldProperty() - { - delete iDefaultLabel; - delete iFieldData; - delete iField; - } - -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::ConstructL -// -------------------------------------------------------------------------- -// -inline void CVIMPSTFieldProperty::ConstructL(const TDesC& aDefaultLabel) - { - if( aDefaultLabel.Length() ) - { - iDefaultLabel = aDefaultLabel.AllocL(); - } - } -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::NewLC -// -------------------------------------------------------------------------- -// -CVIMPSTFieldProperty* CVIMPSTFieldProperty::NewLC - ( TInt aFieldId, TInt aIconId, TInt aMaxLength, const TDesC& aDefaultLabel ) - { - CVIMPSTFieldProperty* self = new( ELeave ) CVIMPSTFieldProperty( aFieldId, aIconId, aMaxLength); - CleanupStack::PushL( self ); - self->ConstructL(aDefaultLabel); - return self; - } - -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::IconId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTFieldProperty::IconId() - { - return iIconId; - } - -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::FieldId -// -------------------------------------------------------------------------- -// -TInt CVIMPSTFieldProperty::FieldId() - { - if( iFieldId == EVIMPSTFieldIdImpp || - iFieldId == EVIMPSTFieldIdEmailAddress|| - iFieldId == EVIMPSTFieldIdEmailGen ) - { - // these fields are map to one field - return EVIMPSTFieldIdImpp; - } - return iFieldId; - } -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::DefaultLabelL -// -------------------------------------------------------------------------- -// -const TDesC& CVIMPSTFieldProperty::DefaultLabelL() - { - if( iField && !iDefaultLabel ) - { - iDefaultLabel = iField->FieldLabel().Left( iMaxLength ).AllocL(); - } - - if( iDefaultLabel ) - { - return *iDefaultLabel; - } - - return KNullDesC(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::SetFieldTextL -// -------------------------------------------------------------------------- -// -void CVIMPSTFieldProperty::SetFieldTextL(const TDesC& aText ) - { - if( iFieldData ) - { - delete iFieldData; - iFieldData = NULL; - } - iFieldData = aText.AllocL(); - } -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::SetStoredFieldL -// -------------------------------------------------------------------------- -// -void CVIMPSTFieldProperty::SetStoredFieldL(MVPbkStoreContactField& aField ) - { - iField = aField.CloneLC(); - CleanupStack::Pop(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTFieldProperty::FieldDataL -// -------------------------------------------------------------------------- -// -const TDesC& CVIMPSTFieldProperty::FieldDataL() - { - TRACER_AUTO; - if( iField && !iFieldData ) - { - const MVPbkContactFieldData& fieldData = iField->FieldData(); - switch( fieldData.DataType() ) - { - case EVPbkFieldStorageTypeText: - { - TPtrC text = MVPbkContactFieldTextData::Cast( fieldData ).Text(); - iFieldData = text.AllocL(); - break; - } - case EVPbkFieldStorageTypeUri: - { - const MVPbkContactFieldUriData& uri = MVPbkContactFieldUriData::Cast(fieldData); - - HBufC* user = uri.Uri().AllocLC(); - TPtr userPtr( user->Des() ); - TInt index = userPtr.Find( KColon ); - if( index != KErrNotFound ) - { - TInt length = userPtr.Length(); - iFieldData = userPtr.Right( length - index - 1 ).AllocL(); - CleanupStack::PopAndDestroy(); //user - } - else - { - CleanupStack::Pop();// user - iFieldData = user; - } - - break; - } - case EVPbkFieldStorageTypeDateTime: - { - const MVPbkContactFieldDateTimeData& dateData = - MVPbkContactFieldDateTimeData::Cast( fieldData ); - TTime date = dateData.DateTime(); - _LIT( KDateFormat, "%D%M%Y%/0%1%/1%2%/2%3%/3" ); - const TInt KDateLength( 12 ); - HBufC* dateStr = HBufC::NewLC( KDateLength ); - TPtr datePtr( dateStr->Des() ); - date.FormatL( datePtr, KDateFormat, TLocale() ); - CleanupStack::Pop( dateStr ); - iFieldData = dateStr; - break; - } - default : - { - break; - } - } - } - return iFieldData ? *iFieldData : KNullDesC(); - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstdetailsviewplugin/src/cvimpstfieldpropertyarray.cpp --- a/uiservicetab/vimpstdetailsviewplugin/src/cvimpstfieldpropertyarray.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* Copyright (c) 2008 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: a single field with type - * -*/ - - -#include "cvimpstfieldpropertyarray.h" - -#include "cvimpstfieldproperty.h" -#include "vimpstdetailsview.hrh" - -// Virtual Phonebook -#include -#include -#include -#include -// System includes -#include -#include "uiservicetabtracer.h" -_LIT(KColon,":"); - -// --------------------------------------------------------------------------- -// CVIMPSTFieldPropertyArray::CVIMPSTFieldPropertyArray -// --------------------------------------------------------------------------- -// -inline CVIMPSTFieldPropertyArray::CVIMPSTFieldPropertyArray(MVPbkStoreContact& aContact ): - iContact( aContact ) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTFieldPropertyArray::ConstructL -// --------------------------------------------------------------------------- -// -inline void CVIMPSTFieldPropertyArray::ConstructL( - const MVPbkFieldTypeList& aSupportedFieldTypeList,TResourceReader& aReader, - TBool aPresenceSupported, - TDesC& aServiceName, TStoreType aStoreType) - { - ReadFieldPropertiesL( aReader, aSupportedFieldTypeList, aPresenceSupported , aServiceName, aStoreType); - } - -// --------------------------------------------------------------------------- -// CVIMPSTFieldPropertyArray::NewL -// --------------------------------------------------------------------------- -// - CVIMPSTFieldPropertyArray* CVIMPSTFieldPropertyArray::NewL - (const MVPbkFieldTypeList& aSupportedFieldTypeList, MVPbkStoreContact& aContact, - TResourceReader& aReader, - TBool aPresenceSupported, - TDesC& aServiceName, TStoreType aStoreType ) - { - CVIMPSTFieldPropertyArray* self = new(ELeave) CVIMPSTFieldPropertyArray( aContact ); - CleanupStack::PushL(self); - self->ConstructL( aSupportedFieldTypeList ,aReader, aPresenceSupported, aServiceName, aStoreType); - CleanupStack::Pop(self); - return self; - } -// --------------------------------------------------------------------------- -// CVIMPSTFieldPropertyArray::~CVIMPSTFieldPropertyArray -// --------------------------------------------------------------------------- -// -CVIMPSTFieldPropertyArray::~CVIMPSTFieldPropertyArray() - { - iFieldProperties.ResetAndDestroy(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTFieldPropertyArray::Count -// --------------------------------------------------------------------------- -// -TInt CVIMPSTFieldPropertyArray::Count() const - { - return iFieldProperties.Count(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTFieldPropertyArray::At -// --------------------------------------------------------------------------- -// - CVIMPSTFieldProperty& CVIMPSTFieldPropertyArray::At - (TInt aIndex) const - { - return *iFieldProperties[aIndex]; - } - -// --------------------------------------------------------------------------- -// CVIMPSTFieldPropertyArray::GetFieldById -// --------------------------------------------------------------------------- -// - CVIMPSTFieldProperty* CVIMPSTFieldPropertyArray::GetFieldById( TInt aFieldId ) - { - CVIMPSTFieldProperty* retField = NULL; - - TInt count = Count(); - - for( TInt i=0; i< count; i++ ) - { - CVIMPSTFieldProperty* field = iFieldProperties[i]; - if( field && field->FieldId() == aFieldId ) - { - retField = field; - break; - } - } - return retField; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTFieldPropertyArray::ReadFieldPropertiesL -// --------------------------------------------------------------------------- -// - void CVIMPSTFieldPropertyArray::ReadFieldPropertiesL( - TResourceReader& aReader, - const MVPbkFieldTypeList& aSupportedFieldTypeList, - TBool aPresenceSupported, - TDesC& aServiceName, TStoreType aStoreType) - { - TRACER_AUTO; - // aSupportedFieldTypeList is a list of the supported field type of the used store - const TInt count = aReader.ReadInt16(); - - for (TInt i = 0; i < count; ++i) - { - // do not change the order of reading from aReader - const TInt fieldTypeResId = aReader.ReadInt32(); - TInt fieldId = aReader.ReadInt8(); - TInt maxLength = aReader.ReadInt16(); - TInt iconId = aReader.ReadInt8(); - HBufC* defaultLabel = aReader.ReadHBufCL(); - if( !defaultLabel ) - { - defaultLabel = KNullDesC().AllocL(); - } - CleanupStack::PushL(defaultLabel); - const MVPbkFieldType* fieldType = aSupportedFieldTypeList.Find( fieldTypeResId ); - - if( fieldId == EVIMPSTFieldIdStatusMsg && aPresenceSupported ) // currently not supported - { - CVIMPSTFieldProperty* property = CVIMPSTFieldProperty::NewLC( fieldId, iconId, maxLength, *defaultLabel ); - iFieldProperties.AppendL( property ); - CleanupStack::Pop(property);// property - } - else if( fieldType ) - { - MVPbkStoreContactFieldCollection& fieldCollection = iContact.Fields(); - TInt fieldCount = fieldCollection.FieldCount(); - for( TInt i=0; i< fieldCount; i++ ) - { - MVPbkStoreContactField& field = fieldCollection.FieldAt( i ); - const MVPbkFieldType* type = field.BestMatchingFieldType() ; - if( fieldType == type ) - { - if( fieldId == EVIMPSTFieldIdImpp ) - { - const MVPbkContactFieldData& fieldData = field.FieldData(); - const MVPbkContactFieldUriData& uri = MVPbkContactFieldUriData::Cast(fieldData); - TPtrC xspId = uri.Uri(); - TInt index = xspId.Find( KColon ); - if( index>0 ) - { - TPtrC servicename = xspId.Left(index); - if( servicename.Compare(aServiceName) == 0) - { - CVIMPSTFieldProperty* property = CVIMPSTFieldProperty::NewLC( fieldId, iconId, maxLength, *defaultLabel ); - property->SetStoredFieldL( field ); - iFieldProperties.AppendL( property ); - CleanupStack::Pop(property); //property - } - } - } - else if( fieldId == EVIMPSTFieldIdDisplayName || - fieldId == EVIMPSTFieldIdFirstName || - fieldId == EVIMPSTFieldIdLastName ) - { - CVIMPSTFieldProperty* property = CVIMPSTFieldProperty::NewLC( fieldId, iconId, maxLength, *defaultLabel ); - property->SetStoredFieldL( field ); - iFieldProperties.AppendL( property ); - CleanupStack::Pop(property); //property - } - else if( aStoreType == EStoreServer ) //append all fields to details view if it is server store - { - CVIMPSTFieldProperty* property = CVIMPSTFieldProperty::NewLC( fieldId, iconId, maxLength, *defaultLabel ); - property->SetStoredFieldL( field ); - iFieldProperties.AppendL( property ); - CleanupStack::Pop(property); //property - } - } - } - } - CleanupStack::PopAndDestroy(defaultLabel); - } - - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/bwins/vimpstengineu.def --- a/uiservicetab/vimpstengine/bwins/vimpstengineu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -EXPORTS - ?Cast@MVIMPSTEngineContactMgmtExtention@@SAAAV1@AAVMVIMPSTEngineExtentionFeatures@@@Z @ 1 NONAME ; class MVIMPSTEngineContactMgmtExtention & MVIMPSTEngineContactMgmtExtention::Cast(class MVIMPSTEngineExtentionFeatures &) - ?Cast@MVIMPSTEngineIMSubService@@SAABV1@ABVMVIMPSTEngineSubService@@@Z @ 2 NONAME ; class MVIMPSTEngineIMSubService const & MVIMPSTEngineIMSubService::Cast(class MVIMPSTEngineSubService const &) - ?Cast@MVIMPSTEngineIMSubService@@SAAAV1@AAVMVIMPSTEngineSubService@@@Z @ 3 NONAME ; class MVIMPSTEngineIMSubService & MVIMPSTEngineIMSubService::Cast(class MVIMPSTEngineSubService &) - ?Cast@MVIMPSTEngineSearchMgrExtention@@SAABV1@ABVMVIMPSTEngineExtentionFeatures@@@Z @ 4 NONAME ; class MVIMPSTEngineSearchMgrExtention const & MVIMPSTEngineSearchMgrExtention::Cast(class MVIMPSTEngineExtentionFeatures const &) - ?Cast@MVIMPSTEngineSearchMgrExtention@@SAAAV1@AAVMVIMPSTEngineExtentionFeatures@@@Z @ 5 NONAME ; class MVIMPSTEngineSearchMgrExtention & MVIMPSTEngineSearchMgrExtention::Cast(class MVIMPSTEngineExtentionFeatures &) - ?Release@CVIMPSTEngineFactory@@SAXXZ @ 6 NONAME ; void CVIMPSTEngineFactory::Release(void) - ?InstanceL@CVIMPSTEngineFactory@@SAPAVMVIMPSTEngineFactory@@XZ @ 7 NONAME ; class MVIMPSTEngineFactory * CVIMPSTEngineFactory::InstanceL(void) - ?Cast@MVIMPSTEnginePresenceSubService@@SAABV1@ABVMVIMPSTEngineSubService@@@Z @ 8 NONAME ; class MVIMPSTEnginePresenceSubService const & MVIMPSTEnginePresenceSubService::Cast(class MVIMPSTEngineSubService const &) - ?Cast@MVIMPSTEngineContactMgmtExtention@@SAABV1@ABVMVIMPSTEngineExtentionFeatures@@@Z @ 9 NONAME ; class MVIMPSTEngineContactMgmtExtention const & MVIMPSTEngineContactMgmtExtention::Cast(class MVIMPSTEngineExtentionFeatures const &) - ?Cast@MVIMPSTEnginePresenceSubService@@SAAAV1@AAVMVIMPSTEngineSubService@@@Z @ 10 NONAME ; class MVIMPSTEnginePresenceSubService & MVIMPSTEnginePresenceSubService::Cast(class MVIMPSTEngineSubService &) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/eabi/vimpstengineu.def --- a/uiservicetab/vimpstengine/eabi/vimpstengineu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -EXPORTS - _ZN20CVIMPSTEngineFactory7ReleaseEv @ 1 NONAME - _ZN20CVIMPSTEngineFactory9InstanceLEv @ 2 NONAME - _ZN25MVIMPSTEngineIMSubService4CastER23MVIMPSTEngineSubService @ 3 NONAME - _ZN25MVIMPSTEngineIMSubService4CastERK23MVIMPSTEngineSubService @ 4 NONAME - _ZN31MVIMPSTEnginePresenceSubService4CastER23MVIMPSTEngineSubService @ 5 NONAME - _ZN31MVIMPSTEnginePresenceSubService4CastERK23MVIMPSTEngineSubService @ 6 NONAME - _ZN31MVIMPSTEngineSearchMgrExtention4CastER30MVIMPSTEngineExtentionFeatures @ 7 NONAME - _ZN31MVIMPSTEngineSearchMgrExtention4CastERK30MVIMPSTEngineExtentionFeatures @ 8 NONAME - _ZN33MVIMPSTEngineContactMgmtExtention4CastER30MVIMPSTEngineExtentionFeatures @ 9 NONAME - _ZN33MVIMPSTEngineContactMgmtExtention4CastERK30MVIMPSTEngineExtentionFeatures @ 10 NONAME - _ZTI20CVIMPSTEngineFactory @ 11 NONAME ; ## - _ZTV20CVIMPSTEngineFactory @ 12 NONAME ; ## - _ZTI23CVIMPSTEngineCVListener @ 13 NONAME - _ZTV23CVIMPSTEngineCVListener @ 14 NONAME - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/group/bld.inf --- a/uiservicetab/vimpstengine/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2008 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: Build information file for VIMPSTEngine -* -*/ - - -PRJ_PLATFORMS - -DEFAULT - - - -PRJ_MMPFILES - -vimpstengine.mmp - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/group/vimpstengine.mmp --- a/uiservicetab/vimpstengine/group/vimpstengine.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpstengine.dll project definition file. -* -*/ - -// To get the APP_LAYER_SYSTEMINCLUDE-definition -#include -#include -#include "../../inc/vimpstbuilddefinitions.h" - -CAPABILITY CAP_GENERAL_DLL - -TARGET vimpstengine.dll -TARGETTYPE dll -UID 0x100039CE 0x20012421 - -VENDORID VID_DEFAULT - -VERSION 10.0 - -//used to allow binary compression by making use of BYTEPAIR algorithm -PAGED - -SOURCEPATH ../src - -// factory class to hold all manager ie.ximp,voip,vpbk etc. -SOURCE cvimpstenginefactory.cpp -SOURCE cvimpstenginesessioncntxtobserver.cpp -SOURCE cvimpstenginerequest.cpp -SOURCE cvimpstenginerequestmapper.cpp -SOURCE cvimpstengineservicetablefetcher.cpp -SOURCE cvimpstenginecchhandler.cpp -SOURCE cvimpstengine.cpp -SOURCE cvimpstengineimsubservice.cpp -SOURCE cvimpstenginevoipsubservice.cpp -SOURCE cvimpstenginesearchmgrextention.cpp -SOURCE cvimpstenginecontactmgmtextention.cpp -SOURCE cvimpstenginepresencesubservice.cpp -SOURCE vimpstenginecasts.cpp -SOURCE cvimpstblockedlistmanager.cpp -SOURCE cvimpstenginecvlistener.cpp - -USERINCLUDE ../group -USERINCLUDE ../inc -USERINCLUDE ../src - -USERINCLUDE ../../vimpststorage/inc -USERINCLUDE ../../vimpststorage/src -USERINCLUDE ../../inc - - -USERINCLUDE ../../vimpstutils/inc -USERINCLUDE ../../../group -USERINCLUDE ../../../inc - - - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY efsrv.lib -LIBRARY apengine.lib //AP engine -LIBRARY estor.lib - -LIBRARY platformenv.lib //pathinfo -LIBRARY sysutil.lib // For disk space checking -LIBRARY ecom.lib - -// dependency to ximp framework -LIBRARY ximpdatamodel.lib - -// dependency to contactstore -LIBRARY vimpststorage.lib - -LIBRARY diskspacereserver.lib -LIBRARY featmgr.lib - -//presence cache libraries -LIBRARY presencecacheclient2.lib -LIBRARY presencecacheutils.lib -LIBRARY vimpstutils.lib -LIBRARY vimpstsettings.lib - -LIBRARY cch.lib -LIBRARY servicehandler.lib -LIBRARY serviceprovidersettings.lib -LIBRARY ws32.lib -LIBRARY apgrfx.lib -LIBRARY apparc.lib -LIBRARY bafl.lib - -//imcacheclient -LIBRARY imcacheclient.lib -//For contact details -LIBRARY vpbkeng.lib - -//#ifdef CHAT_ENABLE_DEBUG_PRINT -LIBRARY flogger.lib -//#endif - -// end of file - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstblockedlistmanager.h --- a/uiservicetab/vimpstengine/inc/cvimpstblockedlistmanager.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2008 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: manages the locally maintained blocked list -* -*/ -#ifndef __CVIMPSTBLOCKEDLISTMANAGER_H -#define __CVIMPSTBLOCKEDLISTMANAGER_H - -// INCLUDES -#include - -// CLASS DECLARATION -/** - * List & presence implementation. - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTBlockedListManager ) - { - //for testcases - friend class T_VimpstEnginePresenceSubService; - - public: // Two-phased constructors and destructor - - /** - * Two-phased constructor. - */ - static CVIMPSTBlockedListManager* NewL(); - - - /** - * Two-phased constructor. - */ - static CVIMPSTBlockedListManager* NewLC(); - - /** - * C++ Destructor. - */ - virtual ~CVIMPSTBlockedListManager(); - - /** - *Add aContact to Blocked list. - *@param aContact : contact to be added to blocked list. - */ - void AddToBlockedListL(const TDesC& aContact); - - /** - *Remove aContact to Blocked list. - *@param aContact : contact to be Removed to blocked list. - */ - void RemoveFromBlockListL(const TDesC& aContact); - - - /** - *Add aContact to Blocked list. - *@return: list of blocked contacts. - */ - RPointerArray* BlockedList(); - - /** - * Reset the blocked list to empty, and free memory of all contact in blocked list. - */ - void ResetL(); - - private: - - //private constructor - CVIMPSTBlockedListManager(); - - void ConstructL(); - - private: - RPointerArray iBlockedList; - - }; - -#endif //__CVIMPSTBLOCKEDLISTMANAGER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstengine.h --- a/uiservicetab/vimpstengine/inc/cvimpstengine.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,429 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that capsulates single service data members -* -*/ - -#ifndef __CVIMPSTENGINE_H -#define __CVIMPSTENGINE_H - -// INCLUDES -#include - -#include "tvimpstenums.h" - -//base -#include "mvimpstengine.h" -#include "mvimpststoragecontactsobserver.h" -#include "mvimpstenginecchuieventobserver.h" -#include "mvimpstengineserviceconnectioneventobserver.h" -// FORWARD DECLARATIONS -class CVIMPSTEngineServiceTableFetcher; -class MVIMPSTServiceListManager; -class MVIMPSTStorageServiceView; -class MVIMPSTEngineSubService; -class CVIMPSTEngineCchHandler; -class MVIMPSTEngineSearchExtentionEventObserver; -class CVIMPSTEngineSessionCntxtObserver; -class MVIMPSTStorageContactsObserver; -class MVIMPSTEngineCchUiEventObserver; - -//CLASS DECLARATION -/** - * engine class for a Single Service - * @lib vimpstengine.dll - * @since 5.0 - */ - - -NONSHARABLE_CLASS( CVIMPSTEngine ) : public CBase, - public MVIMPSTEngine, - public MVIMPSTEngineServiceConnectionEventObserver, - public MVIMPSTStorageContactsObserver, - public MVIMPSTEngineCchUiEventObserver - - - - { - //for test cases. - friend class T_VimpstEngine; - - public: // Two-phased constructors and destructor - - /** - * NewLC two phase constructor. - * @param aServiceId - Service Id - * @param aTableFetcher - ServiceTable Fetcher - * return @ptr a new instance of this class - */ - static CVIMPSTEngine* NewLC( - TUint32 aServiceId, - CVIMPSTEngineServiceTableFetcher& aTableFetcher ); - - - /** - * NewL two phase constructor. - * @param aServiceId - Service Id - * @param aTableFetcher - ServiceTable Fetcher - * return @ptr a new instance of this class - */ - static CVIMPSTEngine* NewL( - TUint32 aServiceId, - CVIMPSTEngineServiceTableFetcher& aTableFetcher ); - - /** - * C++ default destructor - */ - virtual ~CVIMPSTEngine(); - - - public: //From MVIMPSTEngine - - - /** - * See MVIMPSTEngine - * - */ - TUint32 ServiceId() const ; - - - /** - * See MVIMPSTEngine - * - */ - TVIMPSTEnums::TVIMPSTRegistrationState ServiceState() const ; - - - /** - * See MVIMPSTEngine - * - */ - TInt GetBrandInfoL(TLanguage& aBrandLanguage, - TInt& aBrandVersion, TDes8& aBrandId) const ; - - - - /** - * See MVIMPSTEngine - * - */ - TBool IsSubServiceSupportedL(TVIMPSTEnums::SubServiceType aType) const ; - - - /** - * See MVIMPSTEngine - * - */ - TBool IsSubServiceEnabled(TVIMPSTEnums::SubServiceType aType) const ; - - /** - * See MVIMPSTEngine - * - */ - void ContactStoreIdL( - TDes& aContactStoreId ) const ; - - /* - * See MVIMPSTEngine - */ - TBool IsUnInstalled( ); - - /** - * See MVIMPSTEngine - * - */ - const TDesC& ServiceName() const ; - - - /** - * See MVIMPSTEngine - * - */ - void RegisterServiceSessionObserverL - (MVIMPSTEngineServiceStateEventObserver* aObserver) ; - - /** - * See MVIMPSTEngine - * - */ - void UnRegisterServiceSessionObserver - (MVIMPSTEngineServiceStateEventObserver* aObserver) ; - - - /** - * See MVIMPSTEngine - * - */ - void IntializeStorageL() ; - - /** - * See MVIMPSTEngine - * - */ - void UnIntializeStorage() ; - - - /** - * See MVIMPSTEngine - * - */ - MVIMPSTEngineSubService* SubService(TVIMPSTEnums::SubServiceType aType) const; - - - /** - * See MVIMPSTEngine - * - */ - MVIMPSTEngineExtentionFeatures* ExtentionFeatures(TVIMPSTEnums::ExtentionType aType) const ; - - - - /** - * See MVIMPSTEngine - * - */ - HBufC* GetOwnUserIdFromCChOrStorageL() const ; - - - /** - * See MVIMPSTEngine - * - */ - TInt Login(); - - /** - * See MVIMPSTEngine - * - */ - void LogoutL(); - - /** - * See MVIMPSTEngine - * - */ - void DefaultDomainNameL( TDes& aDefaultDomainName ) const; - - /** - * See MVIMPSTEngine - * - */ - TInt ChangeConnectionL(); - /** - * See MVIMPSTEngine - * - * @return True if password is present in the settings else returns false - * - */ - TBool IsPasswordAvailableL(); - - /** - * See MVIMPSTEngine - * - */ - TBool IsBlockSupportedL(); - - /** - * See MVIMPSTEngine - * - */ - void DeleteDataBaseL(); - - /** - * See MVIMPSTEngine - * - */ - MVIMPSTEnginePresenceSubService* GetPreseceSubService(); - - /** - * See MVIMPSTEngine - * - */ - void FetchBlockedListL(); - - /** - * See MVIMPSTEngine - * - */ - void RegisterBlockedListObserver( - MVIMPSTEngineBlockedListFetchEventObserver* aOb); - - - /** - * See MVIMPSTEngine - * - */ - void SetOwnUserIdIfChangedL(const TDesC& aUserId ) ; - - - /** - * See MVIMPSTEngine - * - */ - void RetriveContextIfCChEnabledL() ; - - private: // From MVIMPSTEngineServiceConnectionEventObserver - /** - * See MVIMPSTEngineServiceConnectionEventObserver - */ - void HandleServceConnectionEventL(); - - private: - /** - * Returns a SubService is Supported or not - * Components intertested in knowing whether a SubService is Supported or not can use this API - * @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h - * @return TBool, ETrue if the SubService is Supported in this Service, else returns EFalse - */ - TBool IsSubServiceSupportedInternal(TVIMPSTEnums::SubServiceType aType) const ; - - public: - /** - * Called when all the contacts are fetched from the virtual store. - * - * @since s60 5.0 - */ - void HandleContactFetchedL(); - - public: // From MVIMPSTStorageContactsObserver - - - /** - * HandleChange: To handle the Chnage event from the MCAStoredContactsObserver - * @see MCAStoredContactsObserver - * @param aList: reference to the list at which a change has occured - * @param aContact: reference to the contact at which a change has occured - * @param aEventType: TVIMPSTEnums::TCAObserverEventType,type of change event that has occured - * @param aUserIdChanged, ETrue if userid has changed, else EFalse. - * @return void - */ - void HandleStorageChangeL( TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType, - MVIMPSTStorageContactList* aList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ); - - - //From MVIMPSTEngineCchUiEventObserver - /** - * Handles the change connection event from CCHUI - *@ return void - */ - void HandleChangeConnectionEventL(); - - - - private: - - /** - * symbian second phase constructor - * @param aServiceId service id - */ - void ConstructL( TUint32 aServiceId ); - - /** - * C++ constructor. - */ - CVIMPSTEngine( TUint32 aServiceId, - CVIMPSTEngineServiceTableFetcher& aTableFetcher ); - - - /** - * Parses and finds the Cumulative Service State of all Subservices - * @return TVIMPSTRegistrationState - */ - TVIMPSTEnums::TVIMPSTRegistrationState ParseGetServiceState(); - - /** - * Adds Extention Feature - * @param aFeature - Feature to be added - */ - void AddExtentionFeaturesL(MVIMPSTEngineExtentionFeatures* aFeature) ; - - - /** - * Removes Extention Feature - * @param aFeature - Feature to be Removed - */ - void RemoveExtentionFeatures(TVIMPSTEnums::ExtentionType aType) ; - - - /** - * Creates a list of known extention features - * - */ - void CreateExtentionFeaturesL(); - - /** - * Sets the supported extension feature - */ - void SetExtentionFeaturesSupportedL(); - - /** - * ReSets the Support for all extension feature - */ - void ReSetExtentionFeaturesSupportedL(); - - - - - private : - - //Service Id - TUint32 iServiceId; - - //Settings Id - TUint32 iSettingsId; - - //doesnt own reference to servicetable entry - CVIMPSTEngineServiceTableFetcher& iTableFetcher; - - //owns - service name - HBufC* iServiceName; - - //Owns, ximpfw session context observer. - CVIMPSTEngineSessionCntxtObserver* iSessionCntxtObserver ; - - //does not own reference to the contact list interface - MVIMPSTStorageServiceView* iContactInterface; - - //owns pointer to subservice - RPointerArray iSubService; - - // Own, cch handler for this service - CVIMPSTEngineCchHandler* iCchHandler; - - //owns pointer to subservice - RPointerArray iExtentionFeatures; - - // Doesnt Own, array of observers. - RPointerArray iObserverArray; - - //Owns Pointer to the ServiceState Listener - - //Cumulative Service State of all SubServices Belonging to this Service - TVIMPSTEnums::TVIMPSTRegistrationState iState; - - //block list observer to notify the blocked list has been fetched. - MVIMPSTEngineBlockedListFetchEventObserver* iBlockListObs; - - // UnInstall Flag; Set to true during engine construction - // if engine fails to find ximp object implementation - TBool iUnInstall; - - }; - -#endif //__CVIMPSTENGINE_H - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginecchhandler.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginecchhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,221 +0,0 @@ -/* -* Copyright (c) 2008 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: Class handling the use of Cch -* -*/ - - -#ifndef C_CVIMPSTENGINECCHHANDLER_H -#define C_CVIMPSTENGINECCHHANDLER_H - -// INCLUDES -#include -#include -#include -#include "mvimpstenginecchhandlerobserver.h" -#include "tvimpstenums.h" -#include "mvimpstenginecchuieventobserver.h" - -#include "cvimpstsettingsstore.h" -/** - * structure. - */ -struct TObserverStructure - { - MVIMPSTEngineCchHandlerObserver* iObserver; /* observer */ - TCCHSubserviceType iSubserviceType; /* subservice type(IM/VOIP/PRESENCE */ - }; - -// CLASS DECLARATION -/** - * CCH handler - * This class implements the handling of CCH - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineCchHandler ) : public CBase, - public MCchServiceStatusObserver, - public MCchUiObserver - - { - //for test cases. - friend class T_VimpstEngineCchHandler; - public: - - /** - * Two-phased constructor. - * @param aServiceId, service id to monitor - * @return a new instace of this class - */ - static CVIMPSTEngineCchHandler* NewL(TUint aServiceId, MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver); - - /** - * Two-phased constructor. - * @param aServiceId, service id to monitor - * @return a new instace of this class - * - */ - static CVIMPSTEngineCchHandler* NewLC(TUint aServiceId,MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver ); - - /** - * Standard C++ destructor - */ - ~CVIMPSTEngineCchHandler(); - - /** - * Shuts down connection to CCH. - * - * @since S60 5.0 - * @return None - */ - void ShutdownCch(); - - /** - * Gets service state - * - * @since S60 5.0 - * @param aServiceId service id - * @param aSubServiceType subservice typ(IM/VOIP/PRESENCE) - * @param aCCHState state of the cch. - * @return TInt Standard Symbian error code - */ - TInt GetServiceState(TUint aServiceId, - TInt aSubServiceType, - TCCHSubserviceState& aCCHState - ); - - /** - * Enables service - * @since S60 5.0 - * @return TInt, error code - */ - TInt EnableService(); - - /** - * Disables service - * @since S60 5.0 - * @return None - */ - TInt DisableService(); - - - /** - * Register for CCH Events - * @param aObserver - * @param aSubServiceType type of subservice - */ - void RegisterCchObserverL(MVIMPSTEngineCchHandlerObserver* aObserver, - TCCHSubserviceType aSubServiceType ); - - /** - * UnRegister for CCH Events - * @param aSubServiceType - type of subservice - */ - void UnRegisterCchObserver( TCCHSubserviceType aSubServiceType ); - - - /** - * Returns the connection parameters - * @param aSubServiceType type of subservice - * @return own data - Ownership Transferred to the caller - */ - HBufC* GetConParametersL( - TCchConnectionParameter aConnParam ); - - /** - * Set cch connection parameter - * - * @since S60 v5.0 - * @param aServiceId service id - * @param aConnParam cch connection parameter - * @param aConnParamValue connection parameter value - * @return Error code. - */ - TInt SetConnectionParameter( - TCchConnectionParameter aConnParam, - const TDesC& aConnParamValue ); - - - /** - * Change Connection - * Shows CCHUI dialog for changing the Network Connection for this service - * ECchUiDialogTypeChangeConnection - * @return Error Code - */ - TInt ChangeConnectionL(); - - /** - * For getting cchui api. - * - * @return reference to cchui api. - */ - MCchUi& CchUiApi() const; - - /** - * For checking whether password available in settings or not - * @param aConnection Param value - * @Return true if password is present in the settings else returns false - */ - TBool IsPasswordAvailable( TCchConnectionParameter aConnParam ); - public: // methods from MCchServiceObserver - - /** - * @see MCchServiceObserver - */ - void ServiceStatusChanged( - TInt aServiceId, - const TCCHSubserviceType aType, - const TCchServiceStatus& aServiceStatus ); - - - // methods from MCchUiObserver - /** - * @see MCchUiObserver - */ - - void ConnectivityDialogsCompletedL( - TInt aServiceId, - MCchUiObserver::TCchUiOperationResult aOperationResult ); - - - private: // Implementation - - /** - * Standard C++ constructor - * @param aServiceId service id. - */ - CVIMPSTEngineCchHandler(TUint aServiceId, MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - private: // Data - - // does not own array of observers. - RArray iObserverStructure; - MVIMPSTSettingsStore* iSettingsStore; - // Own CCH Client - CCch* iCchClient; - - // service id - TUint iServiceId; - MVIMPSTEngineCchUiEventObserver& iCchUiEventObserver; - }; - -#endif // C_CVIMPSTENGINECCHHANDLER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginecontactmgmtextention.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginecontactmgmtextention.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/* -* Copyright (c) 2008 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: Implements the Contact Management Extention Feature -* -*/ - -#ifndef __CVIMPSTENGINECONTACTMGMTEXTENTION_H -#define __CVIMPSTENGINECONTACTMGMTEXTENTION_H - -// INCLUDES -#include - -#include "mvimpstenginecontactmgmtextention.h" -#include "tvimpstenums.h" -#include "mvimpstenginesessioncntxtobserver.h" - -// FORWARD DECLARATIONS -class CVIMPSTEngineRequestMapper; -class MPresentityGroups; -class MXIMPContext; -class MXIMPIdentity; - -// CLASS DECLARATION -/** - * This Class implements the Contact Management Extention Feature - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineContactMgmtExtention ) : public CBase, - public MVIMPSTEngineContactMgmtExtention, - public MVIMPSTEngineSessionCntxtObserver - - { - //for test cases - friend class T_VIMPSTEngineContactMgmtExtention; - - public: // Two-phased constructors and destructor - - /** - * Two-phased constructor. - * @param aPresContext: presence context - * @param aPresGroup - Presentity Group - * @param aRequestMapper: Request Mapper for XIMP Events - */ - - static CVIMPSTEngineContactMgmtExtention* NewL( - MXIMPContext& aPresenceCtx, - MPresentityGroups& aPresGroup, - CVIMPSTEngineRequestMapper& aRequestMapper); - /** - * Two-phased constructor. - * @param aPresContext: presence context - * @param aPresGroup - Presentity Group - * @param aRequestMapper: Request Mapper for XIMP Events - */ - static CVIMPSTEngineContactMgmtExtention* NewLC( - MXIMPContext& aPresenceCtx, - MPresentityGroups& aPresGroup, - CVIMPSTEngineRequestMapper& aRequestMapper); - - /** - * C++ Destructor. - */ - virtual ~CVIMPSTEngineContactMgmtExtention(); - - - private: - - /** - * default constructor - * @param aPresContext: presence context - * @param aPresGroup - Presentity Group - * @param aRequestMapper: event observer to get the notifications of the events. - */ - CVIMPSTEngineContactMgmtExtention( - MXIMPContext& aPresenceCtx, - MPresentityGroups& aPresGroup, - CVIMPSTEngineRequestMapper& aRequestMapper); - - - /** - * CreateIdentityLC - * create the identity for given param - * @ aparam aListId, to create - * @ return pointer to MPrFwIdentity - */ - MXIMPIdentity* CreateIdentityLC(const TDesC& aListId) ; - - - public: // See MVIMPSTEngineContactMgmtExtention - - /** - * See MVIMPSTEngineContactMgmtExtention - */ - TInt AddServerContactL(const TDesC& aContactList, - const TDesC& aUserId,const TDesC& aNickname, - TBool aWaitToComplete = ETrue ) ; - - - /** - * See MVIMPSTEngineContactMgmtExtention - */ - TInt DeleteServerContactL( const TDesC& aContactListId, const TDesC& aUserId ) ; - - - private: - /** - * See MVIMPSTEngineSessionCntxtObserver - */ - void HandleSessionContextEventL( const MXIMPContext& aContext, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation = EVIMPSTXimpOperationNoOperation); - - public: // From MVIMPSTEngineExtentionFeatures - - /** - * See MVIMPSTEngineExtentionFeatures - */ - TVIMPSTEnums::FeatureSupport IsSupported() const; - - - /** - * See MVIMPSTEngineExtentionFeatures - */ - TVIMPSTEnums::ExtentionType Type() const; - - /** - * See MVIMPSTEngineExtentionFeatures - */ - void SetSupported(TVIMPSTEnums::FeatureSupport aSupported) ; - - - private: - - // not own - MXIMPContext& iPresenceCtx; - - // not deletable - MPresentityGroups& iPresGroup; - - - //doesnt own - CVIMPSTEngineRequestMapper& iRequestMapper; - - //Whether the extention Feature Supported or not - TVIMPSTEnums::FeatureSupport iSupported; - - //Result code from waited request - TInt iReqResult; - - }; - -#endif //__CVIMPSTENGINECONTACTMGMTEXTENTION_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginecvlistener.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginecvlistener.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2008-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: active object class for interacting with conversation view -* -*/ - -#ifndef CIMCVAPPLOGINEVENTLISTENER_H_ -#define CIMCVAPPLOGINEVENTLISTENER_H_ - -#include -#include -#include -#include -#include "cimcvkeys.h" - -class CVIMPSTEngineServiceTableFetcher; - -_LIT(KDelimiter, ":"); -/** - * constant to define the size of the contact link - */ -#define KMaxPackedContactLinkLength 300 -/** - * constant to define the size of the contact link - */ -#define KMaxServiceIdLength 3 -#define KMaxSerIdXspIdLen 512 - -class CVIMPSTEngineCVListener : public CActive - { -public : - // Constructor - /** - * Creates a new CVIMPSTEngineCVListener. - * @param aServiceTableFetcher, service table handler - * @return New instance of this class - */ - static CVIMPSTEngineCVListener* NewL( - CVIMPSTEngineServiceTableFetcher& aServiceTableFetcher ); - - /** - * Standard C++ destructor. - */ - ~CVIMPSTEngineCVListener(); - -private : // From CActive - - /** - * RunL - */ - void RunL(); - - /** - * DoCancel - */ - void DoCancel(); - - /** - * RunError. - */ - TInt RunError( TInt aError); - -private: // Implementation - /** - * Standard C++ constructor - * @param aServiceTableFetcher, reference to service table handler - */ - CVIMPSTEngineCVListener( - CVIMPSTEngineServiceTableFetcher& aServiceTableFetcher ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - -private : - - // owns , property to use - RProperty iProperty; - - // Not own, handle to service table - CVIMPSTEngineServiceTableFetcher& iServiceTableFetcher; - - }; - -#endif /*CIMCVAPPLOGINEVENTLISTENER_H_*/ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginefactory.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginefactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +0,0 @@ -/* -* Copyright (c) 2008 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: implements the factory for creating engine -* -*/ - -#ifndef __CVIMPSTENGINEFACTORY_H -#define __CVIMPSTENGINEFACTORY_H - -// INCLUDES -#include -#include "mvimpstenginefactory.h" -#include - - -// FORWARD DECLARATIONS -class CVIMPSTEngineServiceTableFetcher; -class MVIMPSTEngine; -class CSPNotifyChange; -class CVIMPSTEngineCVListener; - -// CLASS DECLARATION -/** - * Factory to create engine. - * This class implements the factory for creating engine - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ - -class CVIMPSTEngineFactory : public CBase, - public MVIMPSTEngineFactory, - public MSPNotifyChangeObserver - { - public: // Two-phased constructors and destructor - - /** - * @returns a single instance of MVIMPSTEngineFactory - */ - IMPORT_C static MVIMPSTEngineFactory* InstanceL(); - - /** - * Release - * dont call delete - */ - IMPORT_C static void Release(); - - /** - * c++ default destructor - * dont call delete - */ - virtual ~CVIMPSTEngineFactory(); - - /** - * return the engine instance for aServiceId. - */ - MVIMPSTEngine* GetEngine( TServiceId aServiceId ); - - private: - - /** - * NewLC two phase constructor. - * dont call delete call close - */ - static CVIMPSTEngineFactory* NewLC(); - - /** - * Second phase construction - * ConstructL - */ - void ConstructL(); - - /** - * C++ constructor. - */ - CVIMPSTEngineFactory(); - - - public: //From MVIMPSTEngineFactory - /* - * @ See MVIMPSTEngineFactory - */ - void GetServiceEnginePtr(RPointerArray& serviceIdArray) const; - - /* - * @ See MVIMPSTEngineFactory - */ - TInt FindService( TUint aServiceId ) const; - - - private: // From MSPNotifyChangeObserver - - /** - * From MSPNotifyChangeObserver - * Callback when service has changed - * - * @since S60 5.0 - * @param aServiceId changed service - * @return None - */ - void HandleNotifyChange( TServiceId aServiceId ); - - /** - * From MSPNotifyChangeObserver - * Callback when service error occures - * - * @since S60 5.0 - * @param aError error code - * @return None - */ - void HandleError( TInt aError ); - - /** - * increament the reference count of engine - * - * @since S60 5.0 - */ - - void IncreamentRefereneCount(); - /** - * decreament the reference count of engine - * @return the number of ref count - * @since S60 5.0 - */ - - - TInt DecreamentRefereneCount(); - - private : - - //owned pointer to service table entry - CVIMPSTEngineServiceTableFetcher* iServiceTableFetcher; - - //owns array of services - RPointerArray iServiceItems; - - // Own: service observer - CSPNotifyChange* iSpNotifyChange; - - // owns : reference count - TInt iReferenceCount; - // owns, lister to rproperty defined by imcvengine. - CVIMPSTEngineCVListener* iCVlistener; - - }; - -#endif //__CVIMPSTENGINEFACTORY_H - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstengineimservicestate.h --- a/uiservicetab/vimpstengine/inc/cvimpstengineimservicestate.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,278 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that capsulates single service -* -*/ - - -#ifndef C_CVIMPSTENGINEIMSERVICESTATE_H -#define C_CVIMPSTENGINEIMSERVICESTATE_H - -// INCLUDES -#include -#include -#include "tvimpstenums.h" - -#include "mvimpstcchhandlerobserver.h" - -// FORWARD DECLARATINS -class CVIMPSTEngineServiceTableFetcher; - -class MXIMPContext; -class CVIMPSTEngineSessionCntxtObserver; -class MVIMPSTServiceSessionObserver; -class CXmppSettingsApi; -class MPresenceFeatures; -class CVIMPSTEngineCchHandler; -class CVIMPSTServiceStateListener; -class MVIMPSTEngineFetchCompleteObserver; - -// CLASS DECLARATION - -/** - * - * This class represents IM sub service - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineImServiceState ) : public CBase, - public MVIMPSTEngineCchHandlerObserver - { - public: // Constructor and destructor - - /** - * Two-phased constructor. - * - * @param aServiceId, service id - * @param aPresenceContext, presence context - * @param aEventObserver, presence context observer - * @param aTableFetcher, service table fetcher object - * @param aXmppParameters, accessor to settings api - * @param aSettingId, settings id - * @param aCchHandler, reference to cchhandler - * @param aObserver,fetch complete observer - * @return ptr to CVIMPSTEngineServiceState - */ - static CVIMPSTEngineImServiceState* NewL( TUint aServiceId, - MXIMPContext& aPresenceContext, - CVIMPSTEngineSessionCntxtObserver& aEventObserver, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - CXmppSettingsApi& aXmppParameters, - TUint aSettingId, - CVIMPSTEngineCchHandler& aCchHandler, - MVIMPSTEngineFetchCompleteObserver& aObserver ); - - /** - * Two-phased constructor. - * - * @param aServiceId, service id - * @param aPresenceContext, presence context - * @param aEventObserver, presence context observer - * @param aTableFetcher, service table fetcher object - * @param aXmppParameters, accessor to settings api - * @param aSettingId, settings id - * @param aCchHandler, reference to cchhandler - * @param aObserver,fetch complete observer - * @return ptr to CVIMPSTEngineServiceState - */ - static CVIMPSTEngineImServiceState* NewLC( TUint aServiceId, - MXIMPContext& aPresenceContext, - CVIMPSTEngineSessionCntxtObserver& aEventObserver, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - CXmppSettingsApi& aXmppParameters, - TUint aSettingId, - CVIMPSTEngineCchHandler& aCchHandler, - MVIMPSTEngineFetchCompleteObserver& aObserver ); - - /** - * Standard C++ destructor - */ - ~CVIMPSTEngineImServiceState(); - - private: // From MVIMPSTEngineCchHandlerObserver - - /** - * From MVIMPSTEngineCchHandlerObserver - * Observer callback for CCH event - * - * @param aServiceId, service id - * @param aState, service state - * @param aServiceError, error - * @since S60 5.0 - */ - void CchEventOccuredL( - TUint aServiceId, - TCCHSubserviceState aState, - TInt aServiceError ); - - /** - * Resolves IM service state for given service id. - * - * @since S60 3.2 - * @param aServiceId, service id - * @param aCchErr, service error is stored here - * @return TVIMPSTRegistrationState, - * service state to use - */ - TVIMPSTEnums::TVIMPSTRegistrationState ResolveImServiceState( - TUint aServiceId, TInt& aCchErr ) ; - public: - /** - * Returns service ID - * - * @return TUint32 - */ - - TUint32 ServiceId(); - - /** - * Sets service state. - * - * @since S60 5.0 - * @param aNewState, service state to set - */ - void SetServiceState( - TVIMPSTEnums::TVIMPSTRegistrationState aNewState ); - - /** - * does unbinding of the context - */ - TInt UnBindL() ; - - /** - * binds the context. - */ - TInt BindL( TUid aProtocolImpUid, - TInt32 aIapId ) ; - - - /** - * returns the state of the this service - * @return TVIMPSTRegistrationState. - */ - TVIMPSTEnums::TVIMPSTRegistrationState ServiceState(); - - /** - * cotacts updation completed - */ - void ContactsUpdateCompletedL(); - - public: - /** - * Register Session Observer - * @param aObserver observer to be registered - */ - void RegisterServiceSessionObserver - (MVIMPSTServiceSessionObserver* aObserver); - - /** - * UnRegisters Session Observer - * @param aObserver observer to be unregistered. - */ - void UnRegisterServiceSessionObserver - (MVIMPSTServiceSessionObserver* aObserver); - - - - private: - - /** - * Handles cch error events. - * - * @since S60 5.0 - * @param aServiceError, service error code - */ - void DoHandleCchErrorL( TInt aServiceError ); - - /** - * NotifyObserver of the change in Service State - * @param aServiceError service error - */ - void NotifyObserversL(TInt aServiceError); - - - private: // Implementation - - /** - * Standard C++ constructor - * @param aServiceId, service id - * @param aPresenceContext, presence context - * @param aEventObserver, presence context observer - * @param aTableFetcher, service table fetcher object - * @param aXmppParameters, accessor to settings api - * @param aSettingId, settings id - * @param aCchHandler, reference to cchhandler - */ - CVIMPSTEngineImServiceState( TUint aServiceId, - MXIMPContext& aPresenceContext, - CVIMPSTEngineSessionCntxtObserver& aEventObserver, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - CXmppSettingsApi& aXmppParameters, - TUint aSettingId, - CVIMPSTEngineCchHandler& aCchHandler); - - /** - * Performs the 2nd phase of construction. - * @param aObserver,fetch complete observer - */ - void ConstructL( MVIMPSTEngineFetchCompleteObserver& aObserver ); - - private: // Data - - // Service id of this service - TUint32 iServiceId; - - - // Stores services current state - TVIMPSTEnums::TVIMPSTRegistrationState iServiceState; - - //doen not own reference to presence context - MXIMPContext& iPresenceContext; - - //does not own reference to context observer - CVIMPSTEngineSessionCntxtObserver& iEventObserver; - - //Ref to the service table getter functions - CVIMPSTEngineServiceTableFetcher& iTableFetcher; - - // reference to cenrep api. - CXmppSettingsApi& iXmppParameters; - - //settings id - TUint iSettingId; - - // owned pointer to presence plugin - MPresenceFeatures* iPresFeatures; - - //Doesn't Own - RPointerArray iObservers; - - // will be ETrue if Logged in to the service - TBool iLoggedIn; - - //handler to the CCh, doesnt own - CVIMPSTEngineCchHandler& iCchHandler; - - // owns : state change lsitener - CVIMPSTServiceStateListener* iStateListener; - - //says whether a bind operation was initiated from here - TBool iBindOperationInitiated; - - }; - -#endif // C_CVIMPSTENGINEIMSERVICESTATE_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstengineimsubservice.h --- a/uiservicetab/vimpstengine/inc/cvimpstengineimsubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,254 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that capsulates im sub service data members -* -*/ - -#ifndef __CVIMPSTENGINEIMSUBSERVICE_H -#define __CVIMPSTENGINEIMSUBSERVICE_H - -// INCLUDES -#include -#include "tvimpstenums.h" - -//base -#include -#include "mvimpstenginecchhandlerobserver.h" -#include "mvimpstenginesubservice.h" -#include "mvimpstengineimsubservice.h" - - -// FORWARD DECLARATIONS -class CVIMPSTEngineServiceTableFetcher; -class CIMCacheFactory; -class MIMCacheAccessor; -class MVIMPSTEngineIMSubServiceEventObserver; -class CVIMPSTEngineCchHandler; -class MVIMPSTEngineServiceConnectionEventObserver; - - - -//CLASS DECLARATION - -/** - * class handling im sub service - * @lib vimpstengine.lib - * @since S60 5.0 - */ - -NONSHARABLE_CLASS( CVIMPSTEngineIMSubService ) : public CBase, - // public MVIMPSTEngineSubService, - public MVIMPSTEngineIMSubService, - public MIMCacheEventHandler, - public MVIMPSTEngineCchHandlerObserver - { - //for testcases - friend class T_VimpstEngineImSubService; - - public: // Two-phased constructors and destructor - - /** - * NewLC two phase constructor. - * @param aServiceId - Service Id - * @param aCchHandler - reference to cchhandler - * @param aTableFetcher - Handler to SPSettings - * @param aServiceStateListener - Handler to the ServiceStateListener - * return @ptr to CVIMPSTEngineIMSubService - */ - static CVIMPSTEngineIMSubService* NewLC( TUint aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver ); - - - /** - * NewL two phase constructor. - * @param aServiceId - Service Id - * @param aCchHandler - reference to cchhandler - * @param aTableFetcher - Handler to SPSettings - * @param aServiceStateListener - Handler to the ServiceStateListener - * return @ptr to CVIMPSTEngineIMSubService - */ - static CVIMPSTEngineIMSubService* NewL( TUint aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver); - - /** - * C++ default destructor - */ - virtual ~CVIMPSTEngineIMSubService(); - - - public: //From MVIMPSTEngineSubService - - /** - * @see MVIMPSTEngineSubService - */ - TVIMPSTEnums::TVIMPSTRegistrationState SubServiceState() const; - - /** - * @see MVIMPSTEngineSubService - */ - TVIMPSTEnums::SubServiceType Type() const; - - - - public: //From MVIMPSTIMSubService - - /** - * @see MVIMPSTIMSubService - */ - void RegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver); - - /** - * @see MVIMPSTIMSubService - */ - void UnRegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver); - - /** - * @see MVIMPSTIMSubService - */ - TInt GetUnreadCountL(const TDesC& aSender); - - - /** - * @see MVIMPSTIMSubService - */ - TBool IsConversationExistL(const TDesC& aRecipientId) const ; - - /** - * @see MVIMPSTIMSubService - */ - void CloseConversationL( const TDesC& aContactId ); - - /** - * @see MVIMPSTIMSubService - */ - - RArray GetOpenChatListL(); - - - - public: // From MIMCacheEventHandler - - /** - * @see MIMCacheEventHandler - */ - void HandleIMCacheEventL(TIMCacheEventType aEventType, TAny* aChatMessage = NULL ); - - - private: //From MVIMPSTEngineCchHandlerObserver - - /** - * See MVIMPSTEngineCchHandlerObserver - */ - void CchEventOccuredL( - TUint aServiceId, - TCCHSubserviceState aState, - TInt aServiceError ); - - - private: - - /** - * Symbian second phase constructor - */ - void ConstructL(); - - /** - * C++ default constructor. - * @param aServiceId - Service Id - * @param aCchHandler - reference to cchhandler - * @param aTableFetcher - Handler to SPSettings - * @param aServiceStateListener - Handler to the ServiceStateListener - */ - CVIMPSTEngineIMSubService( TUint aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver ); - - - /** - * Resolves the CCH service state to Service Tab understandable state - * @param aServiceId - Service Id - * @param aCchErr - returns the last CCH Error - * @return TVIMPSTRegistrationState the Registration State - */ - TVIMPSTEnums::TVIMPSTRegistrationState ResolveServiceStateL( TCCHSubserviceState aState, - TInt aServiceError ); - - /** - * Handler for the CCH Errors - * @param aServiceError - */ - void DoHandleCchErrorL( TInt aServiceError ); - - /** - * Create IM Cache Accessor - * - */ - void CreateIMCacheAccessorL(); - - /** - * Release IM Cache Accessor - * - */ - void ReleaseIMCacheAccessor(); - - /** - * Notify the list of Observers registered for the IM Event - * @param aBuddyId, Buddy Id for which the Event is received - */ - void NotifyObserversL(TVIMPSTEnums::TIMEventType aEventType ,const TDesC& aBuddyId ); - - - private : - - // Service Id - TUint iServiceId; - - //doesnot own. - CVIMPSTEngineCchHandler& iCchHandler; - - //doesnt own - handler to the SP Settings - CVIMPSTEngineServiceTableFetcher& iTableFetcher; - - //Doesnt Own - Handler to the ServiceStateListener - MVIMPSTEngineServiceConnectionEventObserver& iObserver; - - // Stores the Type of SubService - TVIMPSTEnums::SubServiceType iType; - - // owned, access to accesss/update interface - // call realease of factory - CIMCacheFactory* iIMCacheFactory; - - // owned, access/update to imcache - // call realease of factory - MIMCacheAccessor* iIMCacheAccessor; - - //Doesnt Own - RPointerArray iChatObserver; - - // Stores sub services current state - TVIMPSTEnums::TVIMPSTRegistrationState iServiceState; - - }; - -#endif //__CVIMPSTENGINEIMSUBSERVICE_H - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginepresencesubservice.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginepresencesubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,582 +0,0 @@ -/* -* Copyright (c) 2008 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: Class handling connection to precense framework -* -*/ - - -#ifndef CVIMPSTENGINEPRESENCESUBSERVICE_H -#define CVIMPSTENGINEPRESENCESUBSERVICE_H - -// INCLUDES -#include -#include // handling the presence cache events -#include // buddy info class -#include //Presence info test - -#include "mvimpstenginesubservice.h" -#include "mvimpstenginepresencesubservice.h" -#include "mvimpstenginecchhandlerobserver.h" -#include "mvimpstenginesessioncntxtobserver.h" -#include "tvimpstenums.h" -#include "cvimpstengineimagehandler.h" -//FORWARD DECLARATIONS -class CVIMPSTEngineServiceTableFetcher; -class CVIMPSTEngineCchHandler; -class CVIMPSTEngineSessionCntxtObserver; -class MPresenceCacheReader2; -class CIMCacheFactory; -class MIMCacheUpdater; -class MPresentityGroupContentEvent; -class CVIMPSTBlockedListManager; -class MVIMPSTEngineServiceConnectionEventObserver; - -// CLASS DECLARATION -/** - * Presence sub service - * This class implements the presence subservice - * The problem in VOIP case would be that this "sip" must be hardcoded. Can this be avoided - * - * - * The Presence Information can be fetched either thro PresenceCache or - * thro XIMP's MPresentityPresenceEvent. So somehow we should be able to differentiate - * which service uses PresenceCache or XIMP's MPresentityPresenceEvent during the creation of this object - * One of the proposal could be is to use the CCH, if it could provide us this information or SP Settings - * - * All the Block/Friend Request/Presence information of a contact should be passed - * to the VIMPSTStorage which will update the list on the UI. - * - */ - - -NONSHARABLE_CLASS( CVIMPSTEnginePresenceSubService ): public CBase, - public MVIMPSTEnginePresenceSubService, - public MPresenceCacheReadHandler2, - public MVIMPSTEngineCchHandlerObserver, - public MVIMPSTEngineSessionCntxtObserver - { - //for testcases - friend class T_VimpstEnginePresenceSubService; - - public: - - /** - * Two-phased constructor. - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - static CVIMPSTEnginePresenceSubService* NewL( TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - CVIMPSTEngineSessionCntxtObserver& aXimpEventObserver, - MVIMPSTEngineServiceConnectionEventObserver& aObserver); - - /** - * Two-phased constructor. - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - static CVIMPSTEnginePresenceSubService* NewLC(TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - CVIMPSTEngineSessionCntxtObserver& aXimpEventObserver, - MVIMPSTEngineServiceConnectionEventObserver& aObserver); - - /** - * Standard C++ destructor - */ - ~CVIMPSTEnginePresenceSubService(); - - public: //From MVIMPSTSubService - - /** - * @return TVIMPSTRegistrationState Service State of this service - */ - TVIMPSTEnums::TVIMPSTRegistrationState SubServiceState() const; - - - TVIMPSTEnums::SubServiceType Type() const; - - - /** - * @see MVIMPSTSubService - */ - TBool Enabled(); - - /** - * Set the blocked list manager. - @param aBlockedListMgr blocked list instance pointer. - */ - void SetBlockedListManager(CVIMPSTBlockedListManager* aBlockedListMgr); - - //Reset the blocked list to zero blocked contact - void ResetBlockedListManagerL(); - public: //From MVIMPSTEnginePresenceSubService - - /** - * @see MVIMPSTEnginePresenceSubService - */ - void RegisterPresenceEventObserverL( - MVIMPSTEnginePresenceSubServiceEventObserver* aObserver); - - /** - * @see MVIMPSTEnginePresenceSubService - */ - void UnRegisterPresenceEventObserver( - MVIMPSTEnginePresenceSubServiceEventObserver* aObserver); - - /** - * Subsribes presence of a single contact - * Can be done for the contacts who are already subscribed(Required atleast in XMPP Case) - * This function can be used on FriendRequests also wherein it performs 2 operation - * 1. Accepts the invitation if Friend Request is Pending(GrantPresenceForPresentityL) - * 2. Subscribes for the presence either to PresenceCache - * or XIMP (MPresentityPresenceEvent) - * - * - * @since S60 5.0 - * @param aUriOfTheContact, Presence URI to be subscribed - */ - void SubscribePresenceOfSingleContactL( const TDesC& aUriOfTheContact ); - - - /** - * Unsubsribes presence of a single contact - * Used for those contact whose presence has been subscribed - * Can be used for Friend Requests also - * 1. Denies the invitation for the contact (WithdrawPresenceGrantFromPresentityL) - * 2. Sends a unsubscribe to PresenceCache - * or XIMP (UnsubscribePresentityPresenceL) - * - * @since S60 5.0 - * @param aUriOfTheContact, Presence URI to be subscribed - */ - void UnSubscribePresenceOfSingleContactL( const TDesC& aUriOfTheContact ); - - /** - * Fetches presence from presencecache. - * - * @since 5.0 - **/ - TInt FetchPresenceFromCache(); - - /** - * Unsubscribes ximp group contents. - * - * Buddy list and authorization lists are always unsubscibed. - * Block list is unsubscribed if it is supported. - * - * @since S60 5.0 - * @param None - * @leave Standard Symbian error codes. - * @return None - */ - void UnsubscribeListsL(); - - /** - * Requests the XIMPFw to subscribe for presence - * grant request list subscription. - */ - void SubscribeForAuthorizationL(); - - /** - * sends PresenceGrantForPresentity response to server - * @param aContactId, id of the requesting party.. - * @param aResponse , Etrue if accpeted else rejected. - * @return TInt error if any - */ - TInt SendPresenceGrantPresentityL( const TDesC& aContactId , TBool aResponse ); - - /** - * IsChangeOwnStatusSupported by the protocol - * - * @since S60 5.0 - * @return TBool ETrue if supported else EFalse. - */ - TBool IsChangeOwnStatusSupported() ; - - /** - * IsStatusMsgSupported by the protocol - * - * @since S60 5.0 - * @return TBool ETrue if supported else EFalse. - */ - TBool IsStatusMsgSupported(); - - /** - * IsAvatarSupported by the protocol - * - * @since S60 5.0 - * @return TBool ETrue if supported else EFalse. - */ - TBool IsAvatarSupported() ; - - /** - * SetAvatarSupported by the protocol - * - * @since S60 5.0 - * @param aSupported, TBool ETrue if supported else EFalse. - */ - void SetAvatarSupported(TBool aSupported ) ; - - - /** - * PublishOwnPresenceL - * to update the ownstatus to server. - * and publishes the own status. - * - * @param aStatus ,status to be updated to the server. - * @param aValue , text for the status message - * @param aFilename , avatar file name - * @param aMimetype , a mime type - * @param aIsAvatar , a avatar field included - * @return TInt error if any - */ - TInt PublishOwnPresenceL(TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aValue, - const TDesC& aFilename = KNullDesC, - const TDesC8& aMimetype = KNullDesC8, - TBool aIsAvatar = EFalse ); - - - /** - * Removes URI from block list - * - * @since S60 5.0 - * @param aUriOfTheContact, URI to be removed - * @return error. - */ - TInt RemoveFromBlockListL( const TDesC& aUriOfTheContact ); - - /** - * Adds URI to block list - * - * @since S60 5.0 - * @param aContactId, URI to be added - * @return error. - */ - TInt AddToBlockListL( const TDesC& aContactId ); - - /** - * Get list of blocked contact. - */ - RPointerArray* GetBlockedList(); - - /** - * fetch blocked list from server to get the freshed blocked list. - */ - void FetchBlockedListFromServerL(MVIMPSTEngineBlockedListFetchEventObserver* aOb); - - /** - * function called from the engine once contact fetching completes - */ - void UpdatePresenceStateL(); - - /** - * Fetches the presence of singlecontact form presence cache - * @param aContact, user id of the ocntact who's presence - * needs to eb fetched. - */ - void FetchPresenceOfSingleContactL(const TDesC& aContact); - - - - private: // prescachereadhandler - - /** - * Handler for AllBuddiesPresenceInService method of MPresenceCacheReader. - * - * @param aErrorCode - * @param aPresenceBuddyInfoList presence infos for all buddies requested. - * Ownership of elements to callee. Can be empty if not found. - */ - void HandlePresenceReadL(TInt aErrorCode, - RPointerArray& aPresenceBuddyInfoList) ; - - /** - * Handler for Buddy presence change notifications. - * - * @param aErrorCode - * @param aPresenceBuddyInfo presence info for buddy. - * Ownership to callee. Can be NULL if aErrorCode exist. - */ - void HandlePresenceNotificationL(TInt aErrorCode, - MPresenceBuddyInfo2* aPresenceBuddyInfo); - - - private: // From MVIMPSTEngineCchHandlerObserver - - /** - * From MVIMPSTEngineCchHandlerObserver - * Observer callback for CCH event - * - * @param aServiceId, service id - * @param aState, service state - * @param aServiceError, error - * @since S60 5.0 - */ - void CchEventOccuredL( - TUint aServiceId, - TCCHSubserviceState aState, - TInt aServiceError ); - /** - * Handles any error that occured during login. - - * @since S60 5.0 - * @param aServiceError, error - */ - void DoHandleCchErrorL( TInt aServiceError ); - - public: - /** - * Observer Event for forwarding the ximp events. - * @param aContext - ximpfw context - * @param aEvent - ximpfw event - */ - void HandleSessionContextEventL( const MXIMPContext& aContext, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation = EVIMPSTXimpOperationNoOperation); - - private: - - /** - * Resolves service state for given service id. - * - * @since S60 5.0 - * @param aState, state of the subservice - * @param aServiceError, service error is stored here - * @return TVIMPSTRegistrationState, - * service state to use - */ - TVIMPSTEnums::TVIMPSTRegistrationState ResolveServiceStateL( TCCHSubserviceState aState, - TInt aServiceError ); - - /** - * Gets a list of all presence subscribtions - * - * @since S60 5.0 - */ - void RetrieveSubscribedListL(); - - /** - * Handles presentity group context events. - * - * @since S60 5.0 - * @param aContext, presence context - * @param aEvent, presence event - */ - void DoHandlePresentityGroupContentEventL( - const MXIMPContext& aContext, - const MXIMPBase& aEvent ); - - /** - * Handles presentity grant request list events. - * - * @since S60 5.0 - * @param aContext, presence context - * @param aEvent, presence event - */ - void DoHandlePresenceGrantRequestListEventL( - const MXIMPContext& aContext, - const MXIMPBase& aEvent ); - - /** - * Handles presentity block list events. - * - * @since S60 5.0 - * @param aContext, presence context - * @param aEvent, presence event - */ - void DoHandlePresenceBlockListEventL( - const MXIMPContext& aContext, - const MXIMPBase& aEvent ); - - /** - * Handles completed ximp event. - * - * @since S60 5.0 - * @param aType, completed event. - * @param aCompleteCode, error code of complete - * @param aEvent, MXIMBase for the clients to use information - */ - void HandleXimpRequestCompleteL( TXimpOperation aType, - TInt aCompleteCode, - const MXIMPBase& aEvent); - - /** - * Handles completed list/bind/unbind events. - * - * @since S60 5.0 - * @param aType, completed event. - * @param aCompleteCode, error code of complete - * @param aEvent, MXIMBase for the clients to use information - */ - void HandleListEventCompleteL(TXimpOperation aType, - TInt aCompleteCode, - const MXIMPBase& aEvent ); - /** - * ConvertPresenceStatus - * @param aStatus presence status to be converted - * @return TAvailabilityValues - */ - NPresenceInfo::TAvailabilityValues ConvertPresenceStatus(TVIMPSTEnums::TOnlineStatus aStatus); - - - /** - * Stores all the contact into virtual store - * need to chec how thi has to be handled for sip:as - * sip does not fetch the contacts from the server. - * - * @since 5.0 - * @param aListEvent list containing all the group members. - */ - void StoreToVirtualStoreL( const MPresentityGroupContentEvent& aListEvent ); - - - - /** - * Converts the presence cache status to client supported presence status. - * - * @since 5.0 - * @param aAvailabilityEnum presence cache status value. - * @param aAvabilityText avability text, To support Multiple presence states. - * @return TVIMPSTEnums::TOnlineStatus client presence status. - */ - TVIMPSTEnums::TOnlineStatus ConvertPresenceCacheEnums(MPresenceBuddyInfo2::TAvailabilityValues aAvailabilityEnum,TPtrC aAvabilityText); - /** - * Initiates downloading of block list - * @since 5.0 - */ - void RetrieveBlockListL(); - - /** - * Converts the presence cache extension keys - * user for block and pending states to client supported presence status. - * - * @since 5.0 - * @param aPresenceBuddyInfo presence buddy info class. - * @param TVIMPSTEnums::TOnlineStatus client presence status. - */ - void GetKeyFieldsAndValuesL(MPresenceBuddyInfo2& aPresenceBuddyInfo,TVIMPSTEnums::TOnlineStatus &aStatus); - - /** - * Handler for Buddy presence change notifications. - * - * @param aPresenceBuddyInfo presence info for buddy. - */ - void DoHandlePresenceNotificationL(MPresenceBuddyInfo2& aPresenceBuddyInfo); - - - private: // Implementation - - /** - * Standard C++ constructor - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - CVIMPSTEnginePresenceSubService( TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - CVIMPSTEngineSessionCntxtObserver& aXimpEventObserver, - MVIMPSTEngineServiceConnectionEventObserver& aObserver ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - private: // Data - - // Service identifier - TUint32 iServiceId; - - //Ref to the CCH Handler - //thro this interface Presence sub service listens to the - //ECCHPrsenceSub connectivity events. - CVIMPSTEngineCchHandler& iCchHandler; - - //doesnt own, reference to settings table. - CVIMPSTEngineServiceTableFetcher& iSettingsTableFetcher; - - //doesnot own, reference to ximpeventobserver. - CVIMPSTEngineSessionCntxtObserver& iXimpEventObserver; - - //does not own, reference to servicestatelistener. - MVIMPSTEngineServiceConnectionEventObserver& iObserver; - - - //owns - MPresenceCacheReader2* iPresenceCacheReader; - - //Owns, service name - HBufC* iServiceName; - - - // Stores services current state - TVIMPSTEnums::TVIMPSTRegistrationState iServiceState; - - TBool iChangeStatusSupported; - - TBool iChangeStatusMsgSupported; - - // ETrue if supported - TBool iAvatarSupported; - - //Doesnt Own - MVIMPSTEnginePresenceSubServiceEventObserver* iSubServiceObserver; - - // Etrue if clearing avatar in progress - TBool iIsClearingAvatar; - - //stores the default MBM path - TFileName iDefaultMbmPath; - - //Blocked list manager instance pointer. - CVIMPSTBlockedListManager* iBlockedListMgr; - - //Not owned;Notify that blocked list has been fetched. - MVIMPSTEngineBlockedListFetchEventObserver* iBlockedListObserver; - - //flag indicate if request for fetching blocked list is pending. - TBool iBlockListFetchReqPending; - - //flag indicates pending Logout request - TBool iLogoutRequest; - // owns : ETrue if fetching is ongoing - TBool iIsFetchingContact; - - TBool iAutoAccept; - - // owns, tells weather it is subscribe to authorization list or not. - TBool iSubscribeToAuthList; - - }; - -#endif //CVIMPSTENGINEPRESENCESUBSERVICE_H - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginerequest.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginerequest.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2008 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: implements the request handler for ximp fw. -* -*/ - - - -#ifndef _CVIMPSTENGINEREQUEST_H__ -#define _CVIMPSTENGINEREQUEST_H__ - -// include files -#include -#include -#include "tvimpstenums.h" - -/** - * This class implements the request handler for ximp fw. - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTEngineRequest) :public CBase - { - - public: // Two-phased constructors and destructor - - /** - * Two-phased constructor. - * @param aRequestId request id - * @param aRequestType - Enum defined in tvimpstenums.h - */ - static CVIMPSTEngineRequest* NewL(TXIMPRequestId& aRequestId, - TXimpOperation aRequestType ); - - - /** - * Two-phased constructor. - * @param aRequestId request id - */ - static CVIMPSTEngineRequest* NewLC(TXIMPRequestId& aRequestId, - TXimpOperation aRequestType); - - /** - * ~CVIMPSTEngineRequest - */ - virtual ~CVIMPSTEngineRequest(); - - /** - * StartWait - */ - void StartWait(); - - /** - * StopWait method - */ - void StopWait(); - - /** - * GetRequestId - * @return TXIMPRequestId the request id - */ - const TXIMPRequestId& GetRequestId() const; - - /** - * IsWaitStarted method from context obsrver - * check weather wait is started or not - * @return TBool ETrue if wait is started, else EFalse. - */ - TBool IsWaitStarted() ; - - /** - * Set the Type of Request - * @param aType, a request type - Enum defined in tvimpstenums.h - */ - void SetRequestType(TXimpOperation aType) ; - - - /** - * Get the Type of Request - * @return request type - Enum defined in tvimpstenums.h - */ - TXimpOperation RequestType() const; - - private: - - - /** - * CVIMPSTEngineRequest - * @ param aRequestId ,request id - * @ param aType, request type. - */ - CVIMPSTEngineRequest(TXIMPRequestId& aRequestId, - TXimpOperation aRequestType); - - private: - // own request id - TXIMPRequestId iRequestId; - - // own active sheduler - CActiveSchedulerWait iWait; - - //request type - TXimpOperation iReqType ; - -}; - -#endif //_CVIMPSTENGINEREQUEST_H__ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginerequestmapper.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginerequestmapper.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* Copyright (c) 2008 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: implements the request mapper -* -*/ - -// INCLUDE FILES - -#ifndef CVIMPSTENGINEREQUESTMAPPER_H__ -#define CVIMPSTENGINEREQUESTMAPPER_H__ - -#include -#include -#include "tvimpstenums.h" - -// farword declaration -class CVIMPSTEngineRequest; - -/** - * This class implements the request mapper - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS(CVIMPSTEngineRequestMapper) :public CBase - { - - public: // Two-phased constructors and destructor - - - /** - * Two-phased constructor. - */ - static CVIMPSTEngineRequestMapper* NewL(); - - - /** - * Two-phased constructor. - */ - static CVIMPSTEngineRequestMapper* NewLC(); - - /** - * destructor - */ - virtual ~CVIMPSTEngineRequestMapper(); - - /** - * CreateRequestL - * create request and start wait if required - * @param aRequestId for request - * @param aIsWait, wait or not - * @param aType - Request Type defined in tvimpstenums.h - * @return pointer to created CVIMPSTEngineRequest - */ - CVIMPSTEngineRequest* CreateRequestL(TXIMPRequestId& aRequestId, - TBool aIsWait, - TXimpOperation aType) ; - - - /** - * FindRequestId - * find the request id - * @param aRequestId to find - * @return the object of found CVIMPSTEngineRequest. If request not found - * this return value contains NULL. The ownership is not transferred to the caller - */ - CVIMPSTEngineRequest* FindRequestId(const TXIMPRequestId& aRequestId ) ; - - /** - * RemoveRequestId - * Removes the object identified by aRequestId from request array and deletes the handle. - * Client must call this method every time XIMP operation has finished. - * If matching object is not found, this function does nothing. - * @param aRequestId, id to be matched to request handles. - * @return None - */ - void RemoveRequestId(const TXIMPRequestId& aRequestId) ; - - private: - - /** - * constructor - */ - CVIMPSTEngineRequestMapper(); - - private: - // own , array of CVIMPSTEngineRequest - RPointerArray< CVIMPSTEngineRequest > iRequestArray; - -}; - -#endif //CVIMPSTENGINEREQUESTMAPPER_H__ -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginesearchmgrextention.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginesearchmgrextention.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of Search Feature -* -*/ - -#ifndef __CVIMPSTENGINESEARCHMGREXTENTION_H -#define __CVIMPSTENGINESEARCHMGREXTENTION_H - -// INCLUDES -#include - -#include "mvimpstenginesearchmgrextention.h" -#include "mvimpstenginesessioncntxtobserver.h" -#include "tvimpstenums.h" -#include - -// FORWARD DECLARATIONS -class CVIMPSTEngineRequestMapper; -class MXIMPContext; -class MSearchFeature; -class MSearch; -class MSearchKeysEvent; - - -// CLASS DECLARATION -/** - * search implementation. - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineSearchMgrExtention ) : public CBase, - public MVIMPSTEngineSearchMgrExtention, - public MVIMPSTEngineSessionCntxtObserver - - { - - - public: // Two-phased constructors and destructor - - /** - * Two-phased constructor. - * @param aPresContext: presence context - * @param aRequestMapper: Request Mapper for XIMP Events - * @return CVIMPSTEngineSearchMgrExtention* a new instance of this class - */ - - static CVIMPSTEngineSearchMgrExtention* NewL( MXIMPContext& aPresenceCtx, - CVIMPSTEngineRequestMapper& aRequestMapper - ); - /** - * Two-phased constructor. - * @param aPresContext: presence context - * @param aRequestMapper: Request Mapper for XIMP Events - * @return CVIMPSTEngineSearchMgrExtention* a new instance of this class - */ - static CVIMPSTEngineSearchMgrExtention* NewLC( MXIMPContext& aPresenceCtx, - CVIMPSTEngineRequestMapper& aRequestMapper); - - /** - * C++ Destructor. - */ - virtual ~CVIMPSTEngineSearchMgrExtention(); - - - private: - - /** - * default constructor - * @param aPresContext: presence context - * @param aRequestMapper: Request Mapper for XIMP Events - */ - CVIMPSTEngineSearchMgrExtention( MXIMPContext& aPresenceCtx, - CVIMPSTEngineRequestMapper& aRequestMapper ); - - /** - * second phase ConstructL - */ - void ConstructL(); - - /** - * convert the client search keys to ximpfw search keys - * @parma aKey client's search key - * @return the ximpfw search key - */ - TSearchKey ConverttoTSearchKey(TVIMPSTEnums::TVIMPSTSearchKey aKey) ; - - /** - * ConverttoTVIMPSTSearchKey - * @param aKey: ximpfw key to be conversted - */ - TVIMPSTEnums::TVIMPSTSearchKey ConverttoTVIMPSTSearchKey( TSearchKey aKey); - - /** - * ProcessSearchKeysEventL - * @param aSearchKeysEvent: ximpfw KeysEvent to be process - */ - void ProcessSearchKeysEventL(const MSearchKeysEvent* aSearchKeysEvent); - - public: // New methods MVIMPSTEngineSearchMgrExtention - - /** - * RegisterSearchObserver registers the observer for search notifications - * @param: aObserver to be registered. - */ - void RegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver); - - /** - * UnRegisterSearchObserver registers the observer for search notifications - * @param: aObserver to be registered. - */ - void UnRegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver); - - /** - * SearchContactsL - Used to search for contacts - * @param aKeyDataArray ,array of all search key and entered data - * return TInt error if any - */ - TInt SearchContactsL(RArray& aKeyDataArray ) ; - /** - * SubscribeForSearchKeysL - * subscribe for search keys - * @return TInt error if any - */ - TInt SubscribeForSearchKeysL() ; - - - public: - - /** - * See MVIMPSTEngineExtentionFeatures - */ - TVIMPSTEnums::FeatureSupport IsSupported() const; - - - /** - * See MVIMPSTEngineExtentionFeatures - */ - TVIMPSTEnums::ExtentionType Type() const; - - /** - * See MVIMPSTEngineExtentionFeatures - */ - void SetSupported(TVIMPSTEnums::FeatureSupport aSupported) ; - - - public: - /** - * See MVIMPSTEngineSessionCntxtObserver - */ - void HandleSessionContextEventL( const MXIMPContext& aContext, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation = EVIMPSTXimpOperationNoOperation); - - private: - - // not own - MXIMPContext& iPresenceCtx; - - //doesnt own - CVIMPSTEngineRequestMapper& iRequestMapper; - - //owns , search suppoted or not - TVIMPSTEnums::FeatureSupport iSearchSupported; - - //owned, search feature ximp interface - MSearchFeature* iSearchFeature; - - //doesnt own - MSearch* iSearch; - - // indicate that already called - TBool iAlreadySubscibed; - - //not owned - RPointerArray iSearchObservers; - - //Stores the XIMP request ErrCode - TInt iReqResult; - - }; - -#endif //__CVIMPSTENGINESEARCHMGREXTENTION_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstengineservicetablefetcher.h --- a/uiservicetab/vimpstengine/inc/cvimpstengineservicetablefetcher.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,263 +0,0 @@ -/* -* Copyright (c) 2008 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: Class handling Service Provider Settings -* -*/ - - -#ifndef C_VIMPUSTENGINESERVICETABLEFETCHER_H -#define C_VIMPUSTENGINESERVICETABLEFETCHER_H - -// INCLUDES -#include -#include -#include "tvimpstenums.h" -#include -#include "cvimpstengine.h" - - -// FORWARD DECLARATIONS -class CSPSettings; -class CVIMPSTEngineServiceState; -class MVIMPSTEngine; -// CLASS DECLARATION - -/** - * - * This class implements the use of Service Provider Settings - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineServiceTableFetcher ) : public CBase - - { - //for testcases. - friend class T_VIMPSTEngineServiceTableFetcher; - - public: // Constructor and destructor - - /** - * Two-phased constructor. - * - * @return Ptr to CVIMPSTEngineServiceTableFetcher - */ - static CVIMPSTEngineServiceTableFetcher* NewL(); // from the service ui factory class implemented from xsp factory - - /** - * Two-phased constructor. - * - * @return Ptr to CVIMPSTEngineServiceTableFetcher - */ - static CVIMPSTEngineServiceTableFetcher* NewLC(); - - /** - * Standard C++ destructor - */ - ~CVIMPSTEngineServiceTableFetcher(); - - /** - * Gets Service Ids to array - * - * @since S60 5.0 - * @param aServiceIds array for service ids - * @return None - */ - void GetMasterServiceIdsL( - RArray& aServiceIds ); - - - /** - * Gets brand id - * - * @since S60 5.0 - * @param aServiceId service id - * @param aBrandId brand id - * @return None - */ - void GetBrandIdL( TUint32 aServiceId, TDes8& aBrandId ); - - - /** - * Returns property brand version - * - * @since S60 5.0 - * @param aServiceId, service id - * @return TInt, brand version - */ - TInt PropertyBrandVersionL( - TUint32 aServiceId ); - - /** - * Returns property brand language. - * - * @since S60 5.0 - * @param aServiceId, service id - * @return TLanguage, brand language - */ - TLanguage PropertyBrandLanguageL( - TUint32 aServiceId ); - - - - /** - * Gets contact store id by service id - * - * @since S60 5.0 - * @param aServiceId, service id - * @param aContactStoreId, service store id is copied to this parameter - * caller should allocate memory for this parameter - * @return None - */ - void GetContactStoreIdL( - TUint32 aServiceId, TDes& aContactStoreId ); - - /** - * Gets the name of the service - * - * @since S60 5.0 - * @param aServiceId, service id - * @param aServiceName, service name is copied to this parameter - * caller should allocate memory for this parameter - * @return None - */ - void GetServiceNameL( - TUint32 aServiceId, TDes& aServiceName ); - - - /** - * Finds a given property and returns the - * - * @since S60 5.0 - * @param aServiceId, service id - * @param TServicePropertyName, Property Name defined in SPSettings - * @return error - KErrNone if Property is found, else appropriate error - */ - TInt FindPropertyL( TUint32 aServiceId, - TServicePropertyName aPropertyName ); - - /** - * Returns ximp adapter uid. - * - * @since S60 5.0 - * @param aServiceId, service id - * @return TInt, uid of XIMP Adaptation - */ - TInt XimpAdapterUidL( TUint32 aServiceId ); - - /** - * Returns presence authorization request status - * ( auto accept or always ask) ie. how to handle - * incoming presence authorization requests. - * - * @since S60 5.0 - * @param aServiceId service id - * @return TVIMPSTPresenceRequestStatus, presence request status - */ - TVIMPSTEnums::TVIMPSTPresenceRequestStatus - PresenceRequestStatusL( TUint32 aServiceId ); - - - /** - * Handles notify change from SPS - * - * @since S60 5.0 - * @param aServiceId, service id - * @param aNewService - New Service (Not shown in the Tab) - * @param aEngine - engine instance for aServiceId. - * @return None - */ - void DoHandleNotifyChangeL( TServiceId aServiceId, TBool aNewService ,MVIMPSTEngine* aEngine); - - - /** - * Gets deafault Domain Name by service id - * - * @since S60 5.0 - * @param aServiceId, service id - * @param aDefaultDomainName, domain name is copied to this parameter - * caller should allocate memory for this parameter - * @return None - */ - void GetDefaultDomainNameL( TUint32 aServiceId, TDes& aDefaultDomainName ); - - - private: // Implementation - - /** - * Standard C++ constructor - */ - CVIMPSTEngineServiceTableFetcher(); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - /** - * Returns contact view uid for service identified by - * aServiceId. - * - * @since S60 5.0 - * @param aServiceId, service identifier - * @return Tuint32, contact view uid as int - */ - TUint32 ContactViewUidL( TUint32 aServiceId ); - - - /** - * Compresses view ids in sps. Gets all voip services - * and writes view to each one of them starting from - * base id. - * - * @since S60 5.0 - * @param aServiceId, service identifier - * @return TBool, ETrue if aServiceId was new service - */ - TBool CompressViewIdsL( TServiceId aServiceId = 0 ); - - /** - * Writes view id to service table - * - * @since S60 5.0 - * @param aServiceId service id - * @param aViewId view id - * @return None - */ - void WriteTabViewIdToServiceTableL( - TUint32 aServiceId, TUint aViewId ); - - /** - * Kills phonebook - * - * @since S60 5.0 - * @return None - */ - void ShutDownPhonebookL(); - - - private: // Data - - // Own: service provider settings - CSPSettings* iSettings; - - //bool flag keep track of if data base need to be deleted. - TBool iDeleteDataBase; - - - }; - -#endif // C_VIMPUICONTACTSEXTENSIONSPSHANDLER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginesessioncntxtobserver.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginesessioncntxtobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,316 +0,0 @@ -/* -* Copyright (c) 2008 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: ximp context observer -* -*/ - - -#ifndef CVIMPSTENGINESESSIONCNTXTOBSERVER_H_ -#define CVIMPSTENGINESESSIONCNTXTOBSERVER_H_ - - -// INCLUDES -#include - -#include "tvimpstenums.h" - -#include -#include - -class MVIMPSTServiceListObserver; -class CVIMPSTEngineRequestMapper; -class MXIMPContext; -class MVIMPSTEngineSearchExtentionEventObserver; -class MPresenceGrantRequestListEvent; -class MSearchKeysEvent; -class MPresenceFeatures; -class MXIMPClient; -class MVIMPSTEngineSessionCntxtObserver; -class MPresenceAuthorization; -class MPresenceWatching; -class MPresentityGroups; -class MPresencePublishing; -class MPresenceObjectFactory; - -// CLASS DESCRIPTION - -/** - * ximp context observer - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineSessionCntxtObserver ) : public CBase, - public MXIMPContextObserver - - - { - //for testcases. - friend class T_VimpstEngineSessionCntxtObserver; - friend class T_VimpstEnginePresenceSubService; - - public: - - /** - * Two-phased constructor. - * @param aSettingsId: settings id. - * @param aAdapterUid: Uid of the ximpfw adaptation. - * @return CVIMPSTEngineSessionCntxtObserver new instance of this class - */ - static CVIMPSTEngineSessionCntxtObserver* - CVIMPSTEngineSessionCntxtObserver::NewL(TUint32 aServiceId); - /** - * Two-phased constructor. - * @param aSettingsId: settings id. - * @param aAdapterUid: Uid of the ximpfw adaptation. - * @return CVIMPSTEngineSessionCntxtObserver new instance of this class - */ - static CVIMPSTEngineSessionCntxtObserver* - CVIMPSTEngineSessionCntxtObserver::NewLC(TUint32 aServiceId); - - - /** - * C++ default destructor. - * ~CVIMPSTEngineSessionCntxtObserver - */ - ~CVIMPSTEngineSessionCntxtObserver(); - - /** - * GetCompletedReqResult - * @return TInt the result code - */ - TInt GetCompletedReqResult() const; - - /** - * GetRequestMapper - * @return CVIMPSTEngineRequestMapper pointer to RequestMapper - */ - CVIMPSTEngineRequestMapper* GetRequestMapper() const; - - /** - * Presence bind - * - * @since S60 5.0 - * @param aProtocolUid - uid of the ximpfw adaptation. - * @return TInt, error if any. - */ - TInt ServerBindL(TUid aProtocolUid); - - /** - * Presence unbind - * - * @since S60 5.0 - * @param aDoUnsubscribe, do unsubscribe before unbind. - * Unsubscribe can not be done if unbind is triggered by - * lost network. - * @return TInt, error if any. - */ - TInt ServerUnBindL( TBool aDoUnsubscribe ); - - /** - * Returns pointer to XIMP presence authorization interface. - * This method must be used to get access. - * If feature is not supported by current - * presence adapter, leaves with KErrNotSupported. - * - * @since S60 3.2 - * @return MPresenceAuthorization reference - */ - MPresenceAuthorization& XimpAuthorizationL(); - - /** - * Returns pointer to XIMP presence watching interface. - * This method must be used to get access. - * If feature is not supported by current - * presence adapter, leaves with KErrNotSupported. - * - * @since S60 3.2 - * @return MPresenceWatching reference - */ - MPresenceWatching& XimpPresenceWatchingL(); - - /** - * Returns pointer to XIMP presence presentity groups interface. - * This method must be used to get access. - * If feature is not supported by current - * presence adapter, leaves with KErrNotSupported. - * - * @since S60 3.2 - * @return MPresentityGroups reference - */ - MPresentityGroups& XimpPresentityGroupsL(); - - /** - * Returns pointer to XIMP presence publishing interface. - * This method must be used to get access. - * If feature is not supported by current - * presence adapter, leaves with KErrNotSupported. - * - * @since S60 3.2 - * @return MPresentityGroups reference - */ - MPresencePublishing& XimpPresencePublishingL(); - - /** - * Gets reference to object factory interface. - * - * Returned object factory interface is used - * to instantiate presence objects. - * - * @return Object factory interface. - * No ownership is returned caller. - */ - MPresenceObjectFactory& PresenceObjectFactoryL() const ; - - MPresenceFeatures& PresenceFeaturesL() const; - - /** - * Gets reference to Presencecontext. - * - * Returned Presencecontext interface is used - * to instantiate object factory. - * - * @since 5.0 - * @return Object factory interface. - * No ownership is returned caller. - */ - MXIMPContext& XimpPresenceContextL(); - - /** - * Register observer from getting notified of ximp events. - * - * @since 5.0 - * @param aObserver observer to be called when ximp events are received. - * Unregister is done by session context when the presence context gets - * unbinded. The Requester must register each time when XIMP Context gets Binded. - * Otherwise he will not get the event - */ - void RegisterObserver(MVIMPSTEngineSessionCntxtObserver* aObserver); - - /** - * get the supproted features form the ximp adaptation - * - * @since 5.0 - * @return MDesC8Array array of supported features. - */ - TInt GetSupportedFeatures(); - - - /** - * get the supproted features form the ximp adaptation - * - * @since 5.0 - * @return MDesC8Array array of supported features. - */ - TVIMPSTEnums::TVIMPSTBindStatus ContextBindStatus(); - - private: - - /** - * Unregister observer from getting notified of ximp events. - * - * @since 5.0 - * @param aObserver observer to be called when ximp events are received. - */ - void UnRegisterObserver(MVIMPSTEngineSessionCntxtObserver* aObserver); - - /** - * HandleximpContextEvent method from context obsrver - * ximp framework - * @param aContext - * @param aEvent, event - */ - - void HandlePresenceContextEvent( const MXIMPContext& aContext, - const MXIMPBase& aEvent ); - - /** - * Handles presence callbacks - * - * @since S60 3.2 - * @param aContext, context - * @param aEvent, event - * @return void - */ - void DoHandlePresenceContextEventL( - const MXIMPContext& aContext, - const MXIMPBase& aEvent ); - - /** - * Resolves and allocates presense uri from ximp operation. - * - * @since S60 5.0 - * @param aEvent, used to get the ximpidentity. - * @return HBufC, presence uri from operation. Ownsership passed. - */ - HBufC* UriFromXimpOperationLC(const MXIMPBase& aEvent ); - private: - - /** - *second phase constructor - */ - void ConstructL(); - - /** - * CVIMPSTEngineSessionCntxtObserver - * @param aSettingsId: settings id. - * @param aAdapterUid: Uid of the ximpfw adaptation. - */ - CVIMPSTEngineSessionCntxtObserver(TUint32 aServiceId); - - /** - * Identifies the Features supported by the Adaptation - * and stores the information in iFeatureSupported - */ - void IdentifySupportedFeaturesL(); - - - private: //Data - // not own - TUint32 iServiceId; - - //Result code from waited request - TInt iReqResult; - - // Current presence bind status - TVIMPSTEnums::TVIMPSTBindStatus iBindStatus; - - //OWN: request mapper to mapp each request - CVIMPSTEngineRequestMapper* iRequestMapper; - - // own , client for presence framework - MXIMPClient* iClient; - - // own ,presence context to prsence framework - MXIMPContext* iPresenceCtx; - - // owned pointer to presence plugin - MPresenceFeatures* iFeatures; - - //Stores the XIMPFw EventTypes Subscribed for - RArray< TInt32 > iAcceptedEventTypes; - - // Own, array of observers. - RPointerArray iObserverArray; - - //Stores the XIMP Features Supported - TInt iFeatureSupported; - - - }; - - - -#endif //CVIMPSTENGINESESSIONCNTXTOBSERVER_H_ - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/cvimpstenginevoipsubservice.h --- a/uiservicetab/vimpstengine/inc/cvimpstenginevoipsubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that capsulates the API's for a VOIP SubService -* -*/ - -#ifndef __CVIMPSTENGINEVOIPSUBSERVICE_H -#define __CVIMPSTENGINEVOIPSUBSERVICE_H - -// INCLUDES -#include - -//base -#include "mvimpstenginesubservice.h" -#include "mvimpstenginecchhandlerobserver.h" - -//FORWARD DELARATION -class CVIMPSTEngineCchHandler; -class CVIMPSTEngineServiceTableFetcher; -class MVIMPSTEngineServiceConnectionEventObserver; - -// CLASS DECLARATION - -/** - * class handling voip subservice. - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineVOIPSubService) : - public CBase, - public MVIMPSTEngineSubService, - public MVIMPSTEngineCchHandlerObserver - - { - // for testcases. - friend class T_VimpstEngineVoipSubService; - - public: // Two-phased constructors and destructor - - /** - * NewLC two phase constructor. - * @param aServiceId - Service Id - * @param aCchHandler - reference to cchhandler - * @param aTableFetcher - Handler to SPSettings - * @param aServiceStateListener - Handler to the ServiceStateListener - * return @ptr to CVIMPSTVoipSUbService - */ - static CVIMPSTEngineVOIPSubService* NewLC(TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver); - - - - /** - * NewL two phase constructor. - * @param aServiceId - Service Id - * @param aCchHandler - reference to cchhandler - * @param aTableFetcher - Handler to SPSettings - * @param aServiceStateListener - Handler to the ServiceStateListener - * return @ptr to CVIMPSTVoipSUbService - */ - static CVIMPSTEngineVOIPSubService* NewL(TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver); - - /** - * C++ destructor - */ - virtual ~CVIMPSTEngineVOIPSubService(); - - public: //From MVIMPSTEngineSubService - - /** - * @see MVIMPSTEngineSubService - */ - TVIMPSTEnums::TVIMPSTRegistrationState SubServiceState() const; - - - /** - * @see MVIMPSTEngineSubService - */ - TVIMPSTEnums::SubServiceType Type() const; - - - private: // From MVIMPSTEngineCchHandlerObserver - - /** - * From MVIMPSTEngineCchHandlerObserver - * Observer callback for CCH event - * - * @param aServiceId, service id - * @param aState, service state - * @param aServiceError, error - * @since S60 5.0 - */ - void CchEventOccuredL( - TUint aServiceId, - TCCHSubserviceState aState, - TInt aServiceError ); - - - private: - - /** - * Symbian second pahse constructor - * dont call delete call close - */ - void ConstructL(); - - /** - * C++ default constructor. - * @param aServiceId - Service Id - * @param aCchHandler - reference to cchhandler - * @param aTableFetcher - Handler to SPSettings - * @param aServiceStateListener - Handler to the ServiceStateListener - */ - CVIMPSTEngineVOIPSubService( TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver ); - - private: - - /** - * Handler for the CCH Errors - * @param aServiceError - */ - void DoHandleCchErrorL( TInt aServiceError ) ; - - - /** - * Resolves the CCH service state to Service Tab understandable state - * @param aServiceId - Service Id - * @param aCchErr - returns the last CCH Error - * @return TVIMPSTRegistrationState the Registration State - */ - TVIMPSTEnums::TVIMPSTRegistrationState ResolveServiceState( - TCCHSubserviceState aState, - TInt aServiceError) ; - - private : - - //Service Id - TUint32 iServiceId; - - //Doesnt Own - Handler for CCH Activities - CVIMPSTEngineCchHandler& iCchHandler; - - //doesnt own - Handler to SPSettings Table - CVIMPSTEngineServiceTableFetcher& iTableFetcher; - - // Stores voip sub services current state - TVIMPSTEnums::TVIMPSTRegistrationState iServiceState; - - //SubService Type - TVIMPSTEnums::SubServiceType iType; - - //Doesnt Own - Handler to the Service State Listener - MVIMPSTEngineServiceConnectionEventObserver& iObserver; - - }; - -#endif //__CVIMPSTENGINEVOIPSUBSERVICE_H - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstengine.h --- a/uiservicetab/vimpstengine/inc/mvimpstengine.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,274 +0,0 @@ -/* -* Copyright (c) 2008 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: M-Class that capsulates single service API's -* -*/ - - -#ifndef MVIMPSTENGINE_H -#define MVIMPSTENGINE_H - -// INCLUDES -#include -#include "tvimpstenums.h" - - -//FORWARD DECLARATION -class MVIMPSTEngineSearchMgrExtention; -class MVIMPSTEngineServiceStateEventObserver; -class MVIMPSTEngineSubService; -class MVIMPSTEngineExtentionFeatures; -class MVIMPSTEnginePresenceSubService; -class MVIMPSTEngineBlockedListFetchEventObserver; - -//CLASS DECLARATION -/** - * - * This class list the M-Class for Engine API's - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -//Class declaration -class MVIMPSTEngine - { - - public: - - /** - * Gets the Service Id - * @return TUint32 Service Id - */ - virtual TUint32 ServiceId() const = 0 ; - - - /** - * Returns the Service State - Cumulative Service State of the SubServices - * @return TVIMPSTRegistrationState, current service state. - */ - virtual TVIMPSTEnums::TVIMPSTRegistrationState ServiceState() const = 0; - - - /** - * Gets the Brand Information for the current service - * @param aBrandLanguage - Holds the BrandLanguage - * @param aBrandVersion - Holds the Version to be used - * @param aBrandId - Holds the brandId - * caller should allocate memory for all params and send the same to this API - * The result will be available in the InParams otself. - * @return TInt Error code - */ - virtual TInt GetBrandInfoL(TLanguage& aBrandLanguage, - TInt& aBrandVersion, TDes8& aBrandId) const = 0; - - - - /** - * Returns a SubService is Supported or not - * Components intertested in knowing whether a SubService is Supported or not can use this API - * @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h - * @return TBool, ETrue if the SubService is Supported in this Service, else returns EFalse - */ - virtual TBool IsSubServiceSupportedL(TVIMPSTEnums::SubServiceType aType) const = 0; - - - /** - * Returns TBool whether a SubService is Enabled or not - * Components intertested in knowing whether a SubService is Enabled or not can use this API - * @param aType - Type of the SubService TVIMPSTEnums::SubServiceType - Defined in tvimpstenums.h - * @return TBool, ETrue if the SubService is Enabled in this Service, else returns EFalse - */ - virtual TBool IsSubServiceEnabled(TVIMPSTEnums::SubServiceType aType) const = 0; - - /** - * Gets the StoreName for given service - * @param aContactStoreId, Virtual store id. - * The caller of the this function has to assign required memory for aContactStoreId - * aContactStoreId will be filled with the Virtual Store Id by this API - */ - virtual void ContactStoreIdL( - TDes& aContactStoreId ) const = 0; - - /** - * returns the Service Name - * @return TDesC&, reference to service name. Ownership is not transferred. - */ - virtual const TDesC& ServiceName() const = 0; - - /** - * Register Session Observer. - * @aObserver, observer ot be registered. - */ - virtual void RegisterServiceSessionObserverL - (MVIMPSTEngineServiceStateEventObserver* aObserver) = 0; - - /** - * UnRegisters Session Observer - * @aObserver, observer ot be Unregistered. - */ - virtual void UnRegisterServiceSessionObserver - (MVIMPSTEngineServiceStateEventObserver* aObserver) = 0; - - - /** - * intialize storage - */ - virtual void IntializeStorageL() = 0; - - /** - * unintialize storage - */ - virtual void UnIntializeStorage() = 0; - - - /** - * Get the Ptr to the SubService given the Type of the SubService - * This API returns a Generalised SubService Class MVIMPSTEngineSubService - * Ownership of the SubService is not Transferred to the Caller - * The Caller can use this (MVIMPSTEngineSubService*) ptr to typecast to appropriate SubService Interface - * Usage : MVIMPSTEngineIMSubService* imSubService = - * dynamic_cast - * (iEngine.SubService(TVIMPSTEnums::EIM)); - * - * if(imSubService) - * { - * imSubService->CloseConversationL( iContactId ); - * } - * @param aType - SubService Type (TVIMPSTEnums::SubServiceType) defined in tvimpstenums.h - * @return - Ptr to the SubService - Value can even be NULL - */ - virtual MVIMPSTEngineSubService* SubService(TVIMPSTEnums::SubServiceType aType) const= 0; - - - /** - * Get the Ptr to the ExtentionFeatures given the Type of the Extention Features - * This API returns a Generalised ExtentionFeatures Class MVIMPSTEngineExtentionFeatures - * Ownership of the ExtentionFeatures is not Transferred to the Caller - * The Caller can use this (MVIMPSTEngineExtentionFeatures*) ptr to typecast to appropriate SubService Interface - * Usage : MVIMPSTEngineSearchMgrExtention* searchMgr = - * dynamic_cast - * (iEngine.ExtentionFeatures(TVIMPSTEnums::ESearch)); - * - * - * if (searchMgr) - * { - * iError = searchMgr->SearchContactsL( iKeyDataArray ); - * } - * @param aType - Extention Feature Type (TVIMPSTEnums::ExtentionType) defined in tvimpstenums.h - * @return - Ptr to the ExtentionFeatures - Value can even be NULL - */ - virtual MVIMPSTEngineExtentionFeatures* ExtentionFeatures(TVIMPSTEnums::ExtentionType aType) const = 0; - - /** - * gets the UserName for the Service - * @return HBufC* - Ownership is transferred to the caller - * This API allocates memory for the UserName and transfers the Ownership to the Caller - */ - virtual HBufC* GetOwnUserIdFromCChOrStorageL() const = 0; - - - /** - * API used to login to the Service - */ - virtual TInt Login() = 0; - - /** - * API used to Logout to the Service - */ - virtual void LogoutL() = 0; - /** - * - * @return True if password is present in the settings else returns false - * - */ - virtual TBool IsPasswordAvailableL() = 0; - - /** - * Gets the default domain name for given service - * @param aDefaultDomainName, Domain Name. - * The caller of the this function has to assign required memory for aDefaultDomainName - * aDefaultDomainName will be filled with the deafault domain name by this API - */ - virtual void DefaultDomainNameL( TDes& aDefaultDomainName ) const = 0; - - - /** - * Change Connection - * Shows CCHUI dialog for changing the Network Connection for this service - * ECchUiDialogTypeChangeConnection - * @return Error Code - */ - virtual TInt ChangeConnectionL() = 0; - - /** - * IsBlockSupportedL - * @returns ETrue if block/unblock is supported - * else EFalse - */ - virtual TBool IsBlockSupportedL() = 0; - - /** - * Inform storage that data base need to be deleted. - */ - virtual void DeleteDataBaseL() = 0; - - /** - * used for returning MVIMPSTEnginePresenceSubService pointer. - * @return MVIMPSTEnginePresenceSubService istance pointer - */ - virtual MVIMPSTEnginePresenceSubService* GetPreseceSubService() = 0; - - /** - *Fetch the blocked list from server.. - */ - virtual void FetchBlockedListL() = 0; - - - - /** - * See MVIMPSTEngine - * - */ - virtual void RetriveContextIfCChEnabledL() = 0 ; - - - /** - * set function - * - */ - virtual void SetOwnUserIdIfChangedL(const TDesC& aUserId ) = 0 ; - - /** - *@param aOb,pointer of MVIMPSTEngineBlockedListFetchEventObserver, - * Notify that fetch of blocked list has been completed.. - */ - virtual void RegisterBlockedListObserver( - MVIMPSTEngineBlockedListFetchEventObserver* aOb) = 0; - - /* - * Returns whether ximp implementation was uninstalled - */ - virtual TBool IsUnInstalled()=0; - /** - * Destructor - */ - virtual ~MVIMPSTEngine() - {} - - - }; - -#endif //MVIMPSTENGINE_H - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstengineblockedlistfetcheventobserver.h --- a/uiservicetab/vimpstengine/inc/mvimpstengineblockedlistfetcheventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2008 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 : observer class for handling notifications of fetching blocked list. -* -*/ - -#ifndef _MVIMPSTENGINEBLOCKEDLISTFETCHEVENTOBSERVER_H -#define _MVIMPSTENGINEBLOCKEDLISTFETCHEVENTOBSERVER_H - -// INCLUDES -#include -#include -#include "tvimpstenums.h" - -// CLASS DECLARATION - -/** - * MVIMPSTEngineSearchExtentionEventObserver declaration. - * @since S60 5.0 - */ -class MVIMPSTEngineBlockedListFetchEventObserver - { - - public: // New functions - - /** - * Observer Event for fetching blocked. - * Notify that blocked list fetch has been completed. - */ - virtual void HandleBlockedListFetchCompleteL() = 0; - - /** - * virtual destructor - */ - virtual ~MVIMPSTEngineBlockedListFetchEventObserver() - { - - } - - }; - -#endif // _MVIMPSTENGINEBLOCKEDLISTFETCHEVENTOBSERVER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginecchhandlerobserver.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginecchhandlerobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2008 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: CCH Handler Observer -* -*/ - - -#ifndef __MVIMPSTENGINECCHHANDLEROBSERVER_H -#define __MVIMPSTENGINECCHHANDLEROBSERVER_H - -// INCLUDES -#include -#include - -// CLASS DECLARATION - -/** - * CCH Handler Observer - * This class defines CCH observing methods - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -class MVIMPSTEngineCchHandlerObserver - { - public: - - /** - * Informs observers that cch event has occured. - * - * @since S60 5.0 - * @param aServiceId, service id related to event - * @param aState, service state - * @param aServiceError, service error - * @return None - */ - virtual void CchEventOccuredL( - TUint aServiceId, - TCCHSubserviceState aState, - TInt aServiceError ) = 0; - }; - -#endif // __MVIMPSTENGINECCHHANDLEROBSERVER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginecchuieventobserver.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginecchuieventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* -* Copyright (c) 2008 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: CCHUI Event Handler -* -*/ - -#ifndef MVIMPSTENGINECCHUIEVENTOBSERVER_H_ -#define MVIMPSTENGINECCHUIEVENTOBSERVER_H_ - -// CLASS DECLARATION - -/** - * MVIMPSTEngineChangeConnectionEventObserver declaration. - * @since S60 5.0 - */ -class MVIMPSTEngineCchUiEventObserver - { - -public: - /** - * Handles the change connection event from CCHUI - *@ return void - */ - virtual void HandleChangeConnectionEventL() = 0; - - }; - - -#endif /* MVIMPSTENGINECCHUIEVENTOBSERVER_H_ */ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginecontactmgmtextention.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginecontactmgmtextention.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +0,0 @@ -/* -* Copyright (c) 2008 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: Handles the Contact Management Operations -* Part of : IMUiserviceTab / vimpstengine -* -*/ - -#ifndef __MVIMPSTENGINECONTACTMGMTEXTENTION_H -#define __MVIMPSTENGINECONTACTMGMTEXTENTION_H - -// INCLUDES -#include -#include "mvimpstengineextentionfeatures.h" - -// CLASS DECLARATION -/** - * Contact Management Implementation - * @lib vimpstengine.lib - * @since S60 5.0 - */ -class MVIMPSTEngineContactMgmtExtention :public MVIMPSTEngineExtentionFeatures - - { - - public: // New methods MVIMPSTEngineContactMgmtExtention - - /** - * Casts MVIMPSTEngineContactMgmtExtention to this interface. - * - * @precond aExtentionFeature.Type() == TVIMPSTEnums::EServerContactManagement - * Panic(EPanicTypeMismatch) - * is raised if the precondition does not hold. - * @param aExtentionFeature Base Class . - * @return Casted inteface for the Contact Mgmt Feature - */ - IMPORT_C static MVIMPSTEngineContactMgmtExtention& Cast( - MVIMPSTEngineExtentionFeatures& aExtentionFeature); - - - /** - * Casts constMVIMPSTEngineContactMgmtExtention to this interface. - * - * @precond aExtentionFeature.Type() == TVIMPSTEnums::EServerContactManagement - * Panic(EPanicTypeMismatch) - * is raised if the precondition does not hold. - * @param aExtentionFeature Base Class . - * @return Casted inteface for the Contact Mgmt Feature - */ - IMPORT_C static const MVIMPSTEngineContactMgmtExtention& Cast( - const MVIMPSTEngineExtentionFeatures& aExtentionFeature); - - /** - * AddServerContactL - * to add the contact to Server thro XIMP - * @param aContactListID ,in to be added - * @param aUserId , to add. - * @param aNickname to added. - * @ return TInt error if any - */ - virtual TInt AddServerContactL(const TDesC& aContactList, - const TDesC& aUserId,const TDesC& aNickname, - TBool aWaitToComplete = ETrue ) = 0; - - - /** - * DeleteServerContactL - * to delete the given contact from server thro XIMP - * @param aContactListID ,from to delete. - * @param aUserId , to delete. - * @return TInt error if any - */ - virtual TInt DeleteServerContactL( const TDesC& aContactListId, - const TDesC& aUserId ) = 0; - - - }; - -#endif //__MVIMPSTENGINECONTACTMGMTEXTENTION_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstengineextentionfeatures.h --- a/uiservicetab/vimpstengine/inc/mvimpstengineextentionfeatures.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2008 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: M-Class that capsulates Extention Features Supported by Services -* -*/ - - -#ifndef MVIMPSTENGINEEXTENTIONFEATURES_H -#define MVIMPSTENGINEEXTENTIONFEATURES_H - -// INCLUDES -#include -#include "tvimpstenums.h" - - -//CLASS DECLARATION -/** - * - * This class list the M-Class for Extention Features required - * to be supported in any Services - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ - -//Class declaration -class MVIMPSTEngineExtentionFeatures - { - - public: - - /** - * IsSupported - * @return TVIMPSTEnums::FeatureSupport defined in tvimpstenums.h - */ - virtual TVIMPSTEnums::FeatureSupport IsSupported() const = 0; - - /** - * SetSupported - * @param TVIMPSTEnums::FeatureSupport defined in tvimpstenums.h - */ - virtual void SetSupported(TVIMPSTEnums::FeatureSupport aSupported )= 0; - - - /** - * Type of the Extention Feature - * @return TVIMPSTEnums::ExtentionType defined in tvimpstenums.h - */ - - virtual TVIMPSTEnums::ExtentionType Type() const = 0; - - /** - * Destructor - */ - virtual ~MVIMPSTEngineExtentionFeatures() - {} - - }; - -#endif //MVIMPSTENGINEEXTENTIONFEATURES_H - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginefactory.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginefactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2008 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: factory class for Engine component -* -*/ - - -#ifndef MVIMPSTENGINEFACTORY_H -#define MVIMPSTENGINEFACTORY_H -#include - -//FORWARD DECLARATION -class MVIMPSTEngine; - -//CLASS DECLARATION -/** - * - * This class list the M-Class for Engine factory - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -class MVIMPSTEngineFactory - { - - public: - - /* - * Fills the RPointerArray passed as a Param - * with engine items for each service - * The Owenership of the ptr is not transferred to the caller - * @param - RPointerArray which upon completion of this function - * will hold the pointers to each engine instance created for - * different services - */ - virtual void GetServiceEnginePtr( - RPointerArray& serviceIdArray) const = 0; - /** - * FindService finds if a given serviceid is installed. - * @param aServiceId service id - * @return TInt index of the service else retunr KErrNotFOund. - **/ - virtual TInt FindService( - TUint aServiceId ) const = 0; - - - /** - * ~CVIMPSTEngineFactory - * dont call delete - */ - virtual ~MVIMPSTEngineFactory() - { - - } - - }; - -#endif //MVIMPSTENGINEFACTORY_H \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstengineimsubservice.h --- a/uiservicetab/vimpstengine/inc/mvimpstengineimsubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2008 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: M-Class that capsulates IM sub service API's -* -*/ - - -#ifndef MVIMPSTENGINEIMSUBSERVICE_H -#define MVIMPSTENGINEIMSUBSERVICE_H - -// INCLUDES -#include -#include "tvimpstenums.h" -#include "mvimpstenginesubservice.h" -#include - -//FORWARD DECLARATION -class MVIMPSTEngineIMSubServiceEventObserver; - -//CLASS DECLARATION -/** - * - * This class list the M-Class for IM subservices - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -//Class declaration -class MVIMPSTEngineIMSubService: public MVIMPSTEngineSubService - { - - public: - - /** - * Casts MVIMPSTEngineIMSubService to this interface. - * - * @precond aSubService.Type() == TVIMPSTEnums::EIM - * Panic(EPanicTypeMismatch) - * is raised if the precondition does not hold. - * @param aSubService Base Class . - * @return Casted inteface for the IM SubService - */ - IMPORT_C static MVIMPSTEngineIMSubService& Cast( - MVIMPSTEngineSubService& aSubService); - - - /** - * Casts constMVIMPSTEngineIMSubService to this interface. - * - * @precond aSubService.Type() == TVIMPSTEnums::EIM - * Panic(EPanicTypeMismatch) - * is raised if the precondition does not hold. - * @param aSubService Base Class . - * @return Casted inteface for the IM SubService - */ - IMPORT_C static const MVIMPSTEngineIMSubService& Cast( - const MVIMPSTEngineSubService& aSubService); - - - /** - * RegisterChatObserver - * The observers that have implemented MVIMPSTEngineIMSubServiceEventObserver can use this API - * to register themselves to receive IM SubService (Conversation) related events - * @param aObserver - Object that implements the observer class MVIMPSTEngineIMSubServiceEventObserver that - * needs to be added. - */ - virtual void RegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver) = 0; - - /** - * UnRegisterChatObserver - * The observers that have implemented MVIMPSTEngineIMSubServiceEventObserver can use this API - * to unregister themselves from IM SubService (Conversation) related events - * @param aObserver - Object that implements the observer class MVIMPSTEngineIMSubServiceEventObserver that - * needs to be removed. - */ - virtual void UnRegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver) = 0; - - /** - * GetUnreadCountL - * API used to retreive the Unread Msg Count for a Buddy - * @param aBuddyId, id of the conversation party. - */ - virtual TInt GetUnreadCountL(const TDesC& aBuddyId) = 0; - - - /** - * check if already conversation opened - * @param aBuddyId, the selected user id with whom conversation is started - * @return TBool ETrue if already exist else EFlase. - */ - virtual TBool IsConversationExistL(const TDesC& aBuddyId) const = 0; - - /** - * Closes conversation with the selected user - * @param aBuddyId, id of the conversation party. - */ - virtual void CloseConversationL( const TDesC& aBuddyId ) = 0; - - /** - * get all conversation with the selected service id - * @param aBuddyId, id of the conversation party. - */ - - virtual RArray GetOpenChatListL() = 0 ; - - /** - * Destructor - */ - virtual ~MVIMPSTEngineIMSubService() - {} - - }; - -#endif //MVIMPSTENGINEIMSUBSERVICE_H - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstengineimsubserviceeventobserver.h --- a/uiservicetab/vimpstengine/inc/mvimpstengineimsubserviceeventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2008 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: Conversations observer interface -* -*/ - - - -#ifndef _MVIMPSTENGINEIMSUBSERVICEEVENTOBSERVER_H -#define _MVIMPSTENGINEIMSUBSERVICEEVENTOBSERVER_H - -#include "tvimpstenums.h" - -/** - * Chat observer. - * This class is responsible for handling received message events. - * and reactive authorizations events and pass those to ui. - * @lib vimpstengine.dll - * @since 5.0 - */ -class MVIMPSTEngineIMSubServiceEventObserver -{ - - public: - - /** - * Observer Event for new messages - * @param aSender sender of the message. - */ - virtual void HandleChatMessageEventL(TVIMPSTEnums::TIMEventType aEventType ,const TDesC& aSender) = 0; - -}; - -#endif //_MVIMPSTENGINEIMSUBSERVICEEVENTOBSERVER_H \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginepresencesubservice.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginepresencesubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,262 +0,0 @@ -/* -* Copyright (c) 2008 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: M-Class that capsulates presence sub service API's -* -*/ - - -#ifndef MVIMPSTENGINEPRESENCESUBSERVICE_H -#define MVIMPSTENGINEPRESENCESUBSERVICE_H - -// INCLUDES -#include -#include "tvimpstenums.h" -#include "mvimpstenginesubservice.h" - - -//FORWARD DECLARATION -class MVIMPSTEnginePresenceSubServiceEventObserver; -class MVIMPSTEngineBlockedListFetchEventObserver; -//CLASS DECLARATION -/** - * - * This class list the M-Class for subservices - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -//Class declaration -class MVIMPSTEnginePresenceSubService: public MVIMPSTEngineSubService - { - - public: - - /** - * Casts MVIMPSTEnginePresenceSubService to this interface. - * - * @precond aSubService.Type() == TVIMPSTEnums::EPresence - * Panic(EPanicTypeMismatch) - * is raised if the precondition does not hold. - * @param aSubService Base Class . - * @return Casted inteface for the Presence SubService - */ - IMPORT_C static MVIMPSTEnginePresenceSubService& Cast( - MVIMPSTEngineSubService& aSubService); - - - /** - * Casts constMVIMPSTEnginePresenceSubService to this interface. - * - * @precond aSubService.Type() == TVIMPSTEnums::EPresence - * Panic(EPanicTypeMismatch) - * is raised if the precondition does not hold. - * @param aSubService Base Class . - * @return Casted inteface for the Presence SubService - */ - IMPORT_C static const MVIMPSTEnginePresenceSubService& Cast( - const MVIMPSTEngineSubService& aSubService); - - - /** - * RegisterPresenceEventObserver - * The observers that have implemented MVIMPSTEnginePresenceSubServiceEventObserver can use this API - * to register themselves to receive Presence SubService related events - * @param aObserver - Object that implements the observer class - * MVIMPSTEnginePresenceSubServiceEventObserver that needs to be added. - */ - virtual void RegisterPresenceEventObserverL( - MVIMPSTEnginePresenceSubServiceEventObserver* aObserver) = 0; - - /** - * UnRegisterChatObserver - * The observers that have implemented MVIMPSTEnginePresenceSubServiceEventObserver can use this API - * to unregister themselves from Presence SubService related events - * @param aObserver - Object that implements the observer class - * MVIMPSTEnginePresenceSubServiceEventObserver that needs to be removed. - */ - virtual void UnRegisterPresenceEventObserver( - MVIMPSTEnginePresenceSubServiceEventObserver* aObserver) = 0; - - /** - * Subsribes presence of a single contact - * Can be done for the contacts who are already subscribed(Required atleast in XMPP Case) - * This function can be used on FriendRequests also wherein it performs 2 operation - * 1. Accepts the invitation if Friend Request is Pending(GrantPresenceForPresentityL) - * 2. Subscribes for the presence either to PresenceCache - * or XIMP (MPresentityPresenceEvent) - * - * - * @since S60 5.0 - * @param aUriOfTheContact, Presence URI to be subscribed - */ - virtual void SubscribePresenceOfSingleContactL( const TDesC& aUriOfTheContact ) = 0; - - /** - * Unsubsribes presence of a single contact - * Used for those contact whose presence has been subscribed - * Can be used for Friend Requests also - * 1. Denies the invitation for the contact (WithdrawPresenceGrantFromPresentityL) - * 2. Sends a unsubscribe to PresenceCache - * or XIMP (UnsubscribePresentityPresenceL) - * - * @since S60 5.0 - * @param aUriOfTheContact, Presence URI to be subscribed - */ - virtual void UnSubscribePresenceOfSingleContactL( const TDesC& aUriOfTheContact ) = 0; - /** - * Fetches presence from presencecache. - * This is called by the service tab whenever it comes up, - * so that it has uptodate presence information of the contacts - * that are present in the service tab. - * - * @since S60 5.0 - **/ - virtual TInt FetchPresenceFromCache() = 0; - - - /** - * Requests the XIMPFw to subscribe for presence - * grant request list subscription. - */ - virtual void SubscribeForAuthorizationL() = 0; - - /** - * sends PresenceGrantForPresentity response to server - * - * @since S60 5.0 - * @param aContactId, id of the requesting party.. - * @param aResponse , Etrue if accpeted else rejected. - * @return TInt error if any - * - */ - virtual TInt SendPresenceGrantPresentityL( const TDesC& aContactId , TBool aResponse ) = 0; - - /** - * IsChangeOwnStatusSupported by the protocol - * - * @since S60 5.0 - * @return TBool ETrue if supported else EFalse. - */ - virtual TBool IsChangeOwnStatusSupported() = 0; - - /** - * IsStatusMsgSupported by the protocol - * - * @since S60 5.0 - * @return TBool ETrue if supported else EFalse. - */ - virtual TBool IsStatusMsgSupported() = 0; - - /** - * IsAvatarSupported by the protocol - * - * @since S60 5.0 - * @return TBool ETrue if supported else EFalse. - */ - virtual TBool IsAvatarSupported() = 0; - - /** - * SetAvatarSupported by the protocol - * - * @since S60 5.0 - * @param aSupported, TBool ETrue if supported else EFalse. - */ - virtual void SetAvatarSupported(TBool aSupported ) = 0; - - /** - * PublishOwnPresenceL - * to update the ownstatus to server. - * and publishes the own status. - * - * @param aStatus ,status to be updated to the server. - * @param aValue , text for the status message - * @param aFilename , avatar file name - * @param aMimetype , a mime type - * @param aIsAvatar , a avatar field included - * @return TInt error if any - */ - virtual TInt PublishOwnPresenceL(TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aValue, - const TDesC& aFilename = KNullDesC, - const TDesC8& aMimetype = KNullDesC8, - TBool aIsAvatar = EFalse ) = 0 ; - - /** - * Removes URI from block list - * - * @since S60 5.0 - * @param aUriOfTheContact, URI to be removed - * @return error. - */ - virtual TInt RemoveFromBlockListL( const TDesC& aUriOfTheContact ) = 0; - - /** - * Adds URI to block list - * - * @since S60 5.0 - * @param aContactId, URI to be added - * @return error. - */ - virtual TInt AddToBlockListL( const TDesC& aContactId ) = 0; - - /** - * Returns the blocked list. - * it returns the blocked list that it maintains locally in engine. - * @since S60 5.0 - * @return blocked list. - */ - virtual RPointerArray* GetBlockedList() = 0; - - /** - * fetch blocked list from server to get the freshed blocked list. - *@param aOb,pointer of MVIMPSTEngineBlockedListFetchEventObserver, - * Notify that fetch of blocked list has been completed.. - */ - virtual void FetchBlockedListFromServerL(MVIMPSTEngineBlockedListFetchEventObserver* aOb) = 0; - - /** - * function call from the engine on the completion of contact fetch operation - */ - virtual void UpdatePresenceStateL() = 0; - - /** - * Fetches the presence of singlecontact form presence cache - * @param aContact, user id of the ocntact who's presence - * needs to eb fetched. - */ - virtual void FetchPresenceOfSingleContactL(const TDesC& aContact) = 0; - - /** - * Unsubscribes ximp group contents. - * - * Buddy list and authorization lists are always unsubscibed. - * Block list is unsubscribed if it is supported. - * - * @since S60 5.0 - * @param None - * @leave Standard Symbian error codes. - * @return None - */ - virtual void UnsubscribeListsL() = 0; - /** - * virtual Destructor - */ - virtual ~MVIMPSTEnginePresenceSubService() - {} - - }; - -#endif //MVIMPSTENGINEPRESENCESUBSERVICE_H - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginepresencesubserviceeventobserver.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginepresencesubserviceeventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2008 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: Presence observer interface -* -*/ - - - -#ifndef _MVIMPSTENGINEPRESENCESUBSERVICEEVENTOBSERVER_H -#define _MVIMPSTENGINEPRESENCESUBSERVICEEVENTOBSERVER_H - -#include "tvimpstenums.h" - -/** - * Chat observer. - * This class is responsible for handling Presence events. - * @lib vimpstengine.dll - * @since 5.0 - */ -class MVIMPSTEnginePresenceSubServiceEventObserver - { - public: - - /** - * Observer Event for new add request - * @parma aRequester requester for add request. - */ - virtual void HandleAddRequestEventL(TVIMPSTEnums::TOperationType aType, const TDesC& aRequesterId, - const TDesC& aRequestorDisplayName ) = 0; - - - }; - -#endif //_MVIMPSTENGINEPRESENCESUBSERVICEEVENTOBSERVER_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginesearchextentioneventobserver.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginesearchextentioneventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2008 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: observer class for handling notifications of Search -* -*/ - - -#ifndef _MVIMPSTENGINESEARCHEXTENTIONEVENTOBSERVER_H -#define _MVIMPSTENGINESEARCHEXTENTIONEVENTOBSERVER_H - -// INCLUDES -#include -#include -#include "tvimpstenums.h" - -// CLASS DECLARATION - -/** - * MVIMPSTEngineSearchExtentionEventObserver declaration. - * @since S60 5.0 - */ -class MVIMPSTEngineSearchExtentionEventObserver - { - - public: // New functions - - /** - * Observer Event for search results - * @param aSerachData - search results for a particular contact - */ - virtual void HandleSearchResultL(RArray aSerachData) = 0; - - /** - * Observer Event for search complete. - * @param aError error if any - */ - virtual void HandleSearchFinishedL(TInt aError) = 0 ; - - - /** - * @see MVIMPSTEngineSearchExtentionEventObserver - * @param aEnumKeysArray , array of enums key - * @param aLebelKeysArray, array of key labels - */ - virtual void HandleSearchKeysEventL( RArray& aEnumKeysArray, RPointerArray& aLebelKeysArray ) = 0 ; - - - /** - * virtual destructor - */ - virtual ~MVIMPSTEngineSearchExtentionEventObserver() - { - - } - - }; - -#endif // _MVIMPSTENGINESEARCHEXTENTIONEVENTOBSERVER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginesearchmgrextention.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginesearchmgrextention.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2008 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: UI control context implementation. -* -*/ - -#ifndef __MVIMPSTENGINESEARCHMGREXTENTION_H -#define __MVIMPSTENGINESEARCHMGREXTENTION_H - -#include "tvimpstenums.h" -#include "mvimpstengineextentionfeatures.h" -// CLASS DECLARATION -class MVIMPSTEngineSearchExtentionEventObserver; - -/** - * Interface for search manager. - * - * @lib vimpstengine.dll - * @since 5.0 - */ -class MVIMPSTEngineSearchMgrExtention: public MVIMPSTEngineExtentionFeatures - { - public: - - /** - * Casts MVIMPSTEngineSearchMgrExtention to this interface. - * - * @precond aExtentionFeature.Type() == TVIMPSTEnums::ESearch - * Panic(EPanicTypeMismatch) - * is raised if the precondition does not hold. - * @param aExtentionFeature Base Class . - * @return Casted inteface for the Search Feature - */ - IMPORT_C static MVIMPSTEngineSearchMgrExtention& Cast( - MVIMPSTEngineExtentionFeatures& aExtentionFeature); - - - /** - * Casts constMVIMPSTEngineSearchMgrExtention to this interface. - * - * @precond aExtentionFeature.Type() == TVIMPSTEnums::ESearch - * Panic(EPanicTypeMismatch) - * is raised if the precondition does not hold. - * @param aExtentionFeature Base Class . - * @return Casted inteface for the Search Feature - */ - IMPORT_C static const MVIMPSTEngineSearchMgrExtention& Cast( - const MVIMPSTEngineExtentionFeatures& aExtentionFeature); - - /** - * RegisterSearchObserver registers the observer for search notifications - * @param: aObserver to be registered. - */ - virtual void RegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver) = 0; - - /** - * UnRegisterSearchObserver registers the observer for search notifications - * @param: aObserver to be registered. - */ - virtual void UnRegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver ) = 0; - - /** - * SearchContactsL - * search a given string from server - * @param aKeyDataArray to be search - * @return TInt. error if any - */ - virtual TInt SearchContactsL( RArray& aKeyDataArray ) = 0; - - /** - * SubscribeForSearchKeysL - * subscribe for search keys - * @return TInt error if any - */ - virtual TInt SubscribeForSearchKeysL() = 0 ; - - - public: - - /** - * Destructor. - */ - virtual ~MVIMPSTEngineSearchMgrExtention() {}; - - }; - -#endif //__MVIMPSTENGINESEARCHMGREXTENTION_H -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstengineserviceconnectioneventobserver.h --- a/uiservicetab/vimpstengine/inc/mvimpstengineserviceconnectioneventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "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: MVIMPSTENGINESERVICECONNECTIONEVENTOBSERVER.h -* -*/ - - - -#ifndef _MVIMPSTENGINESERVICECONNECTIONEVENTOBSERVER_H -#define _MVIMPSTENGINESERVICECONNECTIONEVENTOBSERVER_H - -class MVIMPSTEngineServiceConnectionEventObserver - { - - public: - - /** - * Observer interface for Listening to the Service Connectivity - * events - */ - virtual void HandleServceConnectionEventL() = 0; - - /** - * virtual destructor. - */ - virtual ~MVIMPSTEngineServiceConnectionEventObserver() - {} - - }; - -#endif //_MVIMPSTENGINESERVICECONNECTIONEVENTOBSERVER_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstengineservicestateeventobserver.h --- a/uiservicetab/vimpstengine/inc/mvimpstengineservicestateeventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact data container observer interface -* -*/ - - - -#ifndef _MVIMPSTENGINESERVICESTATEEVENTOBSERVER_H -#define _MVIMPSTENGINESERVICESTATEEVENTOBSERVER_H - -#include "tvimpstenums.h" - - -// CLASS DECLARATION - -/** - * Interface for observing connection events. - * - * @lib vimpstengine.dll - * @since 5.0 - */ - -class MVIMPSTEngineServiceStateEventObserver -{ - - public: - - /** - * Observer Event for Service State changes - * @param aState - Indicates the service state - * @param aServiceError, error if any. - */ - virtual void HandleServiceEventL - ( TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt aServiceError) = 0; - - -}; - -#endif //_MVIMPSTENGINESERVICESTATEEVENTOBSERVER_H \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginesessioncntxtobserver.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginesessioncntxtobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact data container observer interface -* -*/ - - - -#ifndef _MVIMPSTENGINESESSIONCNTXTOBSERVER_H -#define _MVIMPSTENGINESESSIONCNTXTOBSERVER_H - -#include "tvimpstenums.h" - -class MXIMPContext; -class MXIMPBase; - -// CLASS DECLARATION - -/** - * Interface for forwarding the ximpfw events. - * - * @lib vimpstengine.dll - * @since 5.0 - */ - -class MVIMPSTEngineSessionCntxtObserver -{ - - public: - - /** - * Observer Event for forwarding the ximp events. - * @param aContext - ximpfw context - * @param aEvent - ximpfw event - * @param aXimpOperation - XIMPOeration defined in tvimpstenums.h - */ - virtual void HandleSessionContextEventL( const MXIMPContext& aContext, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation = EVIMPSTXimpOperationNoOperation - ) = 0; - - -}; - -#endif //_MVIMPSTENGINESESSIONCNTXTOBSERVER_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/inc/mvimpstenginesubservice.h --- a/uiservicetab/vimpstengine/inc/mvimpstenginesubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2008 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: M-Class that capsulates sub service API's -* -*/ - - -#ifndef MVIMPSTENGINESUBSERVICE_H -#define MVIMPSTENGINESUBSERVICE_H - -// INCLUDES -#include -#include "tvimpstenums.h" - - -//FORWARD DECLARATION - -//CLASS DECLARATION -/** - * - * This class list the M-Class for subservices - * - * @lib vimpstengine.lib - * @since S60 5.0 - */ -//Class declaration -class MVIMPSTEngineSubService - { - - public: - - /** - * SubServiceState - * This API is used to get the service state of the SubServices - * @return TVIMPSTRegistrationState Service State of this service - */ - virtual TVIMPSTEnums::TVIMPSTRegistrationState SubServiceState() const = 0; - - - /** - * Type - * This API is used to get the Type of the SubServices - * @return the type of subservice - TVIMPSTEnums::SubServiceType - */ - virtual TVIMPSTEnums::SubServiceType Type() const = 0; - - - /** - * Destructor - */ - virtual ~MVIMPSTEngineSubService() - {} - - }; - -#endif //MVIMPSTENGINESUBSERVICE_H - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstblockedlistmanager.cpp --- a/uiservicetab/vimpstengine/src/cvimpstblockedlistmanager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* -* Copyright (c) 2008 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: manages the locally maintained blocked list -* -*/ -// INCLUDE FILES -#include "cvimpstblockedlistmanager.h" -#include "uiservicetabtracer.h" - - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTServiceListManager::NewL -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTBlockedListManager* CVIMPSTBlockedListManager::NewL() - { - TRACER_AUTO; - CVIMPSTBlockedListManager* self = - CVIMPSTBlockedListManager::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTBlockedListManager::NewLC -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTBlockedListManager* CVIMPSTBlockedListManager::NewLC() - { - TRACER_AUTO; - CVIMPSTBlockedListManager* self = new (ELeave) CVIMPSTBlockedListManager; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTBlockedListManager::ConstructL -// --------------------------------------------------------- -void CVIMPSTBlockedListManager::ConstructL() - { - TRACER_AUTO; - - } - -// --------------------------------------------------------- -// CVIMPSTBlockedListManager::CVIMPSTBlockedListManager -// --------------------------------------------------------- -CVIMPSTBlockedListManager::CVIMPSTBlockedListManager() - { - - } - -// --------------------------------------------------------- -// CVIMPSTBlockedListManager::~CVIMPSTBlockedListManager -// --------------------------------------------------------- -CVIMPSTBlockedListManager::~CVIMPSTBlockedListManager() - { - iBlockedList.ResetAndDestroy(); - iBlockedList.Close(); - } - -// --------------------------------------------------------- -// CVIMPSTBlockedListManager::AddToBlockedListL -// --------------------------------------------------------- -void CVIMPSTBlockedListManager::AddToBlockedListL(const TDesC& aContact) - { - HBufC* contact = aContact.AllocL(); - iBlockedList.Append(contact);//owner ship tranfered. - } - -// --------------------------------------------------------- -// CVIMPSTBlockedListManager::AddToBlockedList -// --------------------------------------------------------- -void CVIMPSTBlockedListManager::RemoveFromBlockListL(const TDesC& aContact) - { - TRACER_AUTO; - for(TInt i=0; iDes())) - { - HBufC* unblocked = iBlockedList[i]; - iBlockedList.Remove(i); - delete unblocked ; - } - } - } - - -// --------------------------------------------------------- -// CVIMPSTBlockedListManager::BlockedList -// --------------------------------------------------------- -RPointerArray* CVIMPSTBlockedListManager::BlockedList() - { - return &iBlockedList; - } - -// --------------------------------------------------------- -// CVIMPSTBlockedListManager::ResetL -// --------------------------------------------------------- -void CVIMPSTBlockedListManager::ResetL() - { - iBlockedList.ResetAndDestroy(); - } - - - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstengine.cpp --- a/uiservicetab/vimpstengine/src/cvimpstengine.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1445 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that capsulates single service data members -* -*/ - - -// INCLUDES -#include "cvimpstengine.h" - -#include "cvimpstengineservicetablefetcher.h" -#include -#include -#include -#include -#include - -#include "tvimpstconsts.h" -#include "cvimpstenginevoipsubservice.h" -#include "cvimpstengineimsubservice.h" -#include "cvimpstenginepresencesubservice.h" -#include "cvimpstenginecchhandler.h" -//storage -#include "cvimpststoragemanagerfactory.h" -#include "cvimpstenginesessioncntxtobserver.h" -#include "mvimpststorageserviceview.h" -#include "mvimpststoragevpbkstorehandler.h" - -#include "tvimpstenums.h" - -#include "mvimpstengineextentionfeatures.h" -#include "mvimpstengineservicestateeventobserver.h" - -//extention features -#include "cvimpstenginesearchmgrextention.h" -#include "cvimpstenginecontactmgmtextention.h" -#include "cvimpstblockedlistmanager.h" - -#include "mvimpststoragecontactlist.h" -#include - -#include "uiservicetabtracer.h" - -// Constants -_LIT( KListNameAllBuddy ,"buddylist" ); - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngine::NewL -// -// --------------------------------------------------------- -CVIMPSTEngine* CVIMPSTEngine::NewL( - TUint32 aServiceId, - CVIMPSTEngineServiceTableFetcher& aTableFetcher ) - { - TRACER_AUTO; - TRACE("ServiceId: %d", aServiceId); - - - CVIMPSTEngine* self = CVIMPSTEngine::NewLC( aServiceId, - aTableFetcher ); - CleanupStack::Pop( self ); - - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::NewLC -// -// --------------------------------------------------------- - -CVIMPSTEngine* CVIMPSTEngine::NewLC( - TUint32 aServiceId, - CVIMPSTEngineServiceTableFetcher& aTableFetcher ) - { - TRACER_AUTO; - TRACE( "ServiceId: %d", aServiceId ); - - CVIMPSTEngine* self = new (ELeave) CVIMPSTEngine( - aServiceId, - aTableFetcher ); - CleanupStack::PushL( self ); - self->ConstructL( aServiceId ); - - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngine::~CVIMPSTEngine -// -// --------------------------------------------------------- - -CVIMPSTEngine::~CVIMPSTEngine() - { - TRACER_AUTO; - - iObserverArray.Reset(); - iObserverArray.Close(); - - iSubService.ResetAndDestroy(); - iSubService.Close(); - // Delete this after sub services, those might use it in destructor! - delete iSessionCntxtObserver; - delete iServiceName; - - iExtentionFeatures.ResetAndDestroy(); - iExtentionFeatures.Close(); - - delete iCchHandler; - iCchHandler = NULL; - - - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::ConstructL -// -// --------------------------------------------------------- - -void CVIMPSTEngine::ConstructL( TUint32 aServiceId ) - { - TRACER_AUTO; - TRACE( "ServiceId: %d", aServiceId ); - - iServiceName = HBufC::NewL( KVIMPSTUISPSMaxPropertyLength ); - - // construct the service state by passing the array of subservices. - iCchHandler = CVIMPSTEngineCchHandler::NewL(iServiceId,*this); - - //construct eventobserver only if there are any adaptations. - TInt ximpAdapterUid = iTableFetcher.XimpAdapterUidL(aServiceId); - - - TBool requireXimp = EFalse; - TBool presenceSupported = IsSubServiceSupportedInternal(TVIMPSTEnums::EPresence); - TBool imSupported = IsSubServiceSupportedInternal(TVIMPSTEnums::EIM); - - requireXimp |= presenceSupported; - requireXimp |= imSupported; - - TPtr serviceIdPtr(iServiceName->Des()); - iTableFetcher.GetServiceNameL(aServiceId, serviceIdPtr); - - //if either of Presence/IM Subservice supported then we need - //to bind to XIMP context. - if ( KErrNotFound != ximpAdapterUid && requireXimp ) - { - TRAPD( err, (iSessionCntxtObserver = CVIMPSTEngineSessionCntxtObserver::NewL(aServiceId))); - TRACE( "1st Creating session context observer: %d", err ); - if (KErrNotFound == err) - { - TRACE( "Ximp impl not found. Calling Logout" ); - iUnInstall = ETrue; - LogoutL(); - TRACE( "Logout Called on account of uninstall" ); - return; - } - } - - // iterate the service array - for ( TInt index = TVIMPSTEnums::EVoip; index < TVIMPSTEnums::ELast ; index++ ) - { - //create the subservice - switch(index) - { - case TVIMPSTEnums::EVoip: - { - if(IsSubServiceSupportedInternal(TVIMPSTEnums::EVoip)) - { - CVIMPSTEngineVOIPSubService* item = - CVIMPSTEngineVOIPSubService::NewL(aServiceId, *iCchHandler, - iTableFetcher, *this); - iSubService.Append(item); - } - break; - } - case TVIMPSTEnums::EPresence: - { - if(presenceSupported) - { - if (iSessionCntxtObserver) - { - CVIMPSTEnginePresenceSubService* item = CVIMPSTEnginePresenceSubService::NewL( - aServiceId,*iCchHandler,iTableFetcher, - *iSessionCntxtObserver,*this - ); - iSubService.Append(item); - iSessionCntxtObserver->RegisterObserver(item); - } - } - break; - } - case TVIMPSTEnums::EIM: - { - if(imSupported) - { - CVIMPSTEngineIMSubService* item = - CVIMPSTEngineIMSubService::NewL(aServiceId, *iCchHandler, - iTableFetcher,*this); - iSubService.Append(item); - } - break; - } - default: - { - break; - } - - } - } - - //Create the required extention mgrs - CreateExtentionFeaturesL(); - iState = ParseGetServiceState(); - //if cch is already logged in, and the callback's servicestatuschanged() stopped - RetriveContextIfCChEnabledL(); - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::CVIMPSTEngine -// -// --------------------------------------------------------- - -CVIMPSTEngine::CVIMPSTEngine( TUint32 aServiceId, - CVIMPSTEngineServiceTableFetcher& aTableFetcher ) : -iServiceId(aServiceId), -iTableFetcher(aTableFetcher) - { - iUnInstall = EFalse; - } - -// --------------------------------------------------------- -// CVIMPSTEngine::RetriveContextIfCChEnabledL -// -// --------------------------------------------------------- -void CVIMPSTEngine::RetriveContextIfCChEnabledL() - { - TRACER_AUTO; - if ( (iSessionCntxtObserver) && - (TVIMPSTEnums::ESVCEUpdatingContacts == iState || TVIMPSTEnums::ESVCERegistered == iState ) - && ( TVIMPSTEnums::EVIMPSTBindNotDone == iSessionCntxtObserver->ContextBindStatus() ) ) - { - TInt ximpAdapterUid = iTableFetcher.XimpAdapterUidL(iServiceId); - TInt err = iSessionCntxtObserver->ServerBindL(TUid::Uid( ximpAdapterUid )); - if(KErrNone != err) - { - //should never reache here; - iCchHandler->DisableService(); - User::LeaveIfError(err); - } - SetExtentionFeaturesSupportedL(); - } - - } - -// --------------------------------------------------------- -// CVIMPSTEngine::LoginL -// -// --------------------------------------------------------- -TInt CVIMPSTEngine::Login() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - - TInt error = KErrNotFound; - if(iCchHandler) - { - TRACE( "EnableService Called"); - error = iCchHandler->EnableService(); - } - - TRACE( "error: %d", error ); - - return error; - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::Logout -// -// --------------------------------------------------------- -void CVIMPSTEngine::LogoutL() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - - if(iCchHandler) - { - MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence); - if (subService) - { - //Get Presence SubService - MVIMPSTEnginePresenceSubService& presenceSubService = - MVIMPSTEnginePresenceSubService::Cast(*subService); - if (TVIMPSTEnums::ESVCERegistered == subService->SubServiceState() || - TVIMPSTEnums::ESVCEUpdatingContacts == subService->SubServiceState() ) - { - // Unsubscribe all lists here to get whole list contents when doing a new bind. - // Trap here to avoid unbind not being done if list operations should leave - TRAP_IGNORE( presenceSubService.UnsubscribeListsL() ); - } - } - //if either of Presence/IM Subservice supported then we need - //to unbind to XIMP context. - if( iSessionCntxtObserver ) - { - TRACE( "ServerUnBindL Called"); - iSessionCntxtObserver->ServerUnBindL(ETrue); - } - TRACE(" DisableService Called"); - iCchHandler->DisableService(); - } - - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::ServiceId -// -// --------------------------------------------------------- -TUint32 CVIMPSTEngine::ServiceId() const - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - return iServiceId; - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::ServiceName -// -// --------------------------------------------------------- -const TDesC& CVIMPSTEngine::ServiceName() const - { - TRACER_AUTO; - TPtr serviceNamePtr = iServiceName->Des(); - TRACE( "ServiceName: '%S'", &serviceNamePtr ); - return *iServiceName; - } - -// --------------------------------------------------------- -// CVIMPSTEngine::ServiceState -// -// --------------------------------------------------------- -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEngine::ServiceState() const - { - TRACER_AUTO; - TRACE( "ServiceState: %d", iState ); - return iState; - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::GetBrandInfo -// -// --------------------------------------------------------- -TInt CVIMPSTEngine::GetBrandInfoL(TLanguage& aBrandLanguage, - TInt &aBrandVersion, TDes8& aBrandId) const - - { - TRACER_AUTO; - TRACE("ServiceId: %d", iServiceId ); - - iTableFetcher.GetBrandIdL(iServiceId, aBrandId); - aBrandLanguage = iTableFetcher.PropertyBrandLanguageL(iServiceId); - aBrandVersion = iTableFetcher.PropertyBrandVersionL(iServiceId); - return KErrNone; - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::IsSubServiceSupportedL -// -// --------------------------------------------------------- -TBool CVIMPSTEngine::IsSubServiceSupportedL(TVIMPSTEnums::SubServiceType aType) const - { - TRACER_AUTO; - TRACE("ServiceId: %d", iServiceId); - TRACE("SubServiceType: %d", aType); - - TBool support = EFalse; - - MVIMPSTEngineSubService* subService = SubService(aType); - if (subService) - { - support = ETrue; - } - - TRACE( "support: %d", support ); - return support; - - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::IsSubServiceEnabled -// -// --------------------------------------------------------- -TBool CVIMPSTEngine::IsSubServiceEnabled(TVIMPSTEnums::SubServiceType aType) const - { - - - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - TRACE( "SubServiceType: %d", aType ); - - MVIMPSTEngineSubService* subService = SubService(aType); - TBool enabled = EFalse; - - if (subService) - { - if ( TVIMPSTEnums::ESVCERegistered == subService->SubServiceState() ) - { - enabled = ETrue; - } - } - TRACE( "enabled: %d", enabled ); - return enabled; - } - -// --------------------------------------------------------- -// CVIMPSTEngine::GetContactStoreIdL -// -// --------------------------------------------------------- -void CVIMPSTEngine::ContactStoreIdL (TDes& aContactStoreId ) const - { - TRACER_AUTO; - TRACE("ServiceId: %d", iServiceId ); - iTableFetcher.GetContactStoreIdL(iServiceId, aContactStoreId); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngine::RegisterServiceSessionObserver() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngine::RegisterServiceSessionObserverL - (MVIMPSTEngineServiceStateEventObserver* aObserver) - { - TRACER_AUTO; - __ASSERT_ALWAYS(aObserver,User::Leave(KErrArgument)); - TInt index = iObserverArray.Find(aObserver); - if( index == KErrNotFound ) - { - iObserverArray.Append( aObserver ); - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngine::UnRegisterServiceSessionObserver() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngine::UnRegisterServiceSessionObserver - (MVIMPSTEngineServiceStateEventObserver* aObserver) - { - - TRACER_AUTO; - if(aObserver) - { - TInt index = iObserverArray.Find(aObserver); - if( index >=0 ) - { - iObserverArray.Remove( index ); - iObserverArray.Compress(); - } - } - - } -// --------------------------------------------------------- -// CVIMPSTEngine::IntializeStorage -// -// --------------------------------------------------------- -void CVIMPSTEngine::IntializeStorageL() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - iContactInterface = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - if(iContactInterface) - { - iContactInterface->AddObserverL( this ); - MVIMPSTSettingsStore* store = CVIMPSTSettingsStore::NewLC(); - RBuf lastUserName; - lastUserName.CreateL( KPropertyMaxLength ); - CleanupClosePushL( lastUserName ); - store->GetL( iServiceId, EServiceLastUserName, lastUserName ); - if( lastUserName.Length() == 0 ) - { - HBufC* userId = GetOwnUserIdFromCChOrStorageL(); - CleanupStack::PushL( userId ); - store->SetL(iServiceId, EServiceLastUserName,*userId); - iContactInterface->SetOwnUserIdL(*userId ); - CleanupStack::PopAndDestroy(); //userId - } - else - { - iContactInterface->SetOwnUserIdL(lastUserName ); - } - CleanupStack::PopAndDestroy(&lastUserName); //lastUserName - CleanupStack::PopAndDestroy(); //store - } - - } -// --------------------------------------------------------- -// CVIMPSTEngine::UnIntializeStorage -// -// --------------------------------------------------------- -void CVIMPSTEngine::UnIntializeStorage() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - if(iContactInterface) - { - iContactInterface->RemoveObserver( this ); - } - - } - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::SetOwnUserIdIfChangedL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVIMPSTEngine::SetOwnUserIdIfChangedL(const TDesC& aUserId) - { - - TRACER_AUTO; - MVIMPSTSettingsStore* store = CVIMPSTSettingsStore::NewLC(); - RBuf lastUserName; - lastUserName.CreateL( KPropertyMaxLength ); - CleanupClosePushL( lastUserName ); - store->GetL( iServiceId, EServiceLastUserName, lastUserName ); - //first time when cenrep is not set with any value. set current as lastusername - if( lastUserName.Compare( aUserId ) != 0 ) - { - store->SetL(iServiceId, EServiceLastUserName,aUserId); - iContactInterface->SetOwnUserIdL(aUserId ); - } - CleanupStack::PopAndDestroy(&lastUserName); //lastUserName - CleanupStack::PopAndDestroy(); //store - - } - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::GetOwnUserIdFromCChOrStorageL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -HBufC* CVIMPSTEngine::GetOwnUserIdFromCChOrStorageL() const - { - - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - HBufC* buffer = NULL; - if(iCchHandler) - { - // Set userid - buffer = iCchHandler->GetConParametersL(ECchUsername); - CleanupStack::PushL( buffer ); - } - if (!buffer) - { - buffer = KNullDesC().AllocLC(); - } - CleanupStack::Pop();//buffer - return buffer; - } - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::SubService -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MVIMPSTEngineSubService* CVIMPSTEngine::SubService(TVIMPSTEnums::SubServiceType aType) const - { - TRACER_AUTO; - TRACE("ServiceId: %d", iServiceId ); - TRACE( "SubServiceType: %d", aType ); - TInt subServiceCount = iSubService.Count(); - MVIMPSTEngineSubService* subService = NULL; - - // iterate the service array - for ( TInt index = 0; index < subServiceCount ; index++ ) - { - - if (aType == iSubService[index]->Type()) - { - subService = iSubService[index]; - TRACE("SubService Found"); - break; - } - } - - - - return subService; - } - - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::ExtentionFeatures -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -MVIMPSTEngineExtentionFeatures* CVIMPSTEngine::ExtentionFeatures(TVIMPSTEnums::ExtentionType aType) const - { - TRACER_AUTO; - TRACE("ServiceId: %d", iServiceId); - TRACE("ExtentionType: %d", aType); - TInt fetaureCount = iExtentionFeatures.Count(); - MVIMPSTEngineExtentionFeatures* feature = NULL; - - // iterate the service array - for ( TInt index = 0; index < fetaureCount ; index++ ) - { - - if (aType == iExtentionFeatures[index]->Type()) - { - feature = iExtentionFeatures[index]; - TRACE("ExtentionFeatures Found"); - break; - } - } - - - return feature; - } - - - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::AddExtentionFeaturesL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVIMPSTEngine::AddExtentionFeaturesL(MVIMPSTEngineExtentionFeatures* aFeature) - { - __ASSERT_ALWAYS(aFeature,User::Leave(KErrArgument)); - - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - if (aFeature) - { - TRACE( "ExtentionType: %d", aFeature->Type() ); - iExtentionFeatures.Append(aFeature); - TRACE( "Append Done" ); - } - - - - } - - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::RemoveExtentionFeatures -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVIMPSTEngine::RemoveExtentionFeatures(TVIMPSTEnums::ExtentionType aType) - { - TRACER_AUTO; - - TRACE( "ServiceId: %d", iServiceId ); - TInt fetaureCount = iExtentionFeatures.Count(); - - // iterate the service array - for ( TInt index = 0; index < fetaureCount ; index++ ) - { - - if (aType == iExtentionFeatures[index]->Type()) - { - TRACE( "ExtentionType: %d", aType ); - iExtentionFeatures.Remove(index); - iExtentionFeatures.Compress(); - TRACE( "Remove Done" ); - break; - } - } - - - - } - - - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::HandleServceConnectionEventL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVIMPSTEngine::HandleServceConnectionEventL() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - - TVIMPSTEnums::TVIMPSTRegistrationState previousState = iState; - iState = ParseGetServiceState(); - - if(TVIMPSTEnums::ESVCENotRegistered == iState) - { - CVIMPSTEnginePresenceSubService* presSubService = - dynamic_cast - (SubService(TVIMPSTEnums::EPresence)); - if(presSubService) - { - presSubService->ResetBlockedListManagerL(); - } - } - TRACE( "PreviousState: %d, CurrentState:%d", previousState, iState ); - //Only send observer notifications if there is any change in the Service State - //Otherwise not required - if (previousState != iState) - { - //Presence Service needs to Register for the XIMP Events once when - //the context gets binded - //Get Presence SubService - CVIMPSTEnginePresenceSubService* presSubService = - dynamic_cast(SubService(TVIMPSTEnums::EPresence)); - // in case of roaming(moving from one network to another) - // servicetab goes from registered to connecting state, hence the unbind is done here. - if ( presSubService && TVIMPSTEnums::ESVCERegistered == previousState && - TVIMPSTEnums::ESVCENetworkConnecting == iState ) - { - TRACE( "UnsubscribeLists" ); - - TRAPD( err, presSubService->UnsubscribeListsL() ); - - TRACE( "UnsubscribeLists -err: %d" , err ); - - if ( iSessionCntxtObserver ) - { - iSessionCntxtObserver->ServerUnBindL( ETrue ); - } - } - TInt count = iObserverArray.Count(); - for (TInt index=0; indexHandleServiceEventL(iState, KErrNone); - } - TInt ximpAdapterUid = iTableFetcher.XimpAdapterUidL(iServiceId); - if ( (iSessionCntxtObserver) && (KErrNotFound != ximpAdapterUid ) ) - { - - if ( ( TVIMPSTEnums::ESVCEUpdatingContacts == iState || - TVIMPSTEnums::ESVCERegistered == iState ) && - TVIMPSTEnums::EVIMPSTBindNotDone == iSessionCntxtObserver->ContextBindStatus() ) - { - TInt error = iSessionCntxtObserver->ServerBindL(TUid::Uid( ximpAdapterUid )); - if(KErrNone != error) - { - //should never reache here; - iCchHandler->DisableService(); - User::LeaveIfError(error); - } - SetExtentionFeaturesSupportedL(); - } - else if (TVIMPSTEnums::ESVCENotRegistered == iState ) - { - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - if( storage ) - { - MVIMPSTStorageContact& ownContact = storage->OwnContactL(); - TPtrC ownUserId = ownContact.UserId(); - if( ownUserId.Length() && presSubService ) - { - presSubService->UnSubscribePresenceOfSingleContactL( ownUserId ); - } - MVIMPSTStorageContactList* list = storage->FindContactList(KIMContactListId) ; - if ( list ) - { - TInt count = list->Count(); - for(TInt i = 0;i < count; i++) - { - MVIMPSTStorageContact* contact = &(list->operator[](i)); - if(contact) - { - if(presSubService) - { - if( contact->UserId().Length() ) - { - TRAP_IGNORE( presSubService->UnSubscribePresenceOfSingleContactL( contact->UserId() ) ); - } - if(!(contact->UserId().Length())) // if no XspId - { - contact->SetOnlineStatus(TVIMPSTEnums::EUnknown); - } - else if(TVIMPSTEnums::EPending != contact->OnlineStatus()) - { - contact->SetOnlineStatus(TVIMPSTEnums::EOffline); - }// end of if - }// end of for - } // end of if(contact) - }// end of for - storage->Sort(KIMContactListId); - // Inform service state changes to UI service tab - // and further to update the buddy list after sort. - TInt obsvrArrayCount = iObserverArray.Count(); - for (TInt index=0; indexHandleServiceEventL(iState, KErrNone); - } - } - } - ReSetExtentionFeaturesSupportedL(); - } //end of else if - }// end of isessioncontextobserver and ximpadapteruid. - }// end of if(previousstate != iState) - - } - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::ParseGetServiceState -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEngine::ParseGetServiceState() - { - TRACER_AUTO; - TInt subServiceCount = iSubService.Count(); - TInt serviceState = 0; - - //Find the cumulative of the ServiceStates of all subservices - // iterate the service array - for ( TInt index = 0; index < subServiceCount ; index++ ) - { - serviceState |= iSubService[index]->SubServiceState(); - } - - //ServiceState - TVIMPSTEnums::TVIMPSTRegistrationState state = TVIMPSTEnums::ESVCENotRegistered; - - //The logic below is that, if any one subservice not enabled for us the service is not enabled - //So to do this we assign priority for each service state - //Connecting gets the High Priority, when copmared to Waiting for Connection, - //Disconnecting, Registered, UnRegistered. - //By this way the Sevice Tab will be more usable and atleast we can perform operations - //related to the the logged in subservice - //its upto the connection handlers to do the job properly, whether to provide connectivity to all - //sub services or not.. - - //Start parsing and decide the state of the ServiceTab - if ( serviceState & TVIMPSTEnums::ESVCENetworkConnecting ) - { - //Connecting - state = TVIMPSTEnums::ESVCENetworkConnecting; - } - else if ( serviceState & TVIMPSTEnums::ESVCEWaitingForNetwork ) - { - //Waiting for Connection - state = TVIMPSTEnums::ESVCEWaitingForNetwork; - } - else if ( serviceState & TVIMPSTEnums::ESVCEUpdatingContacts ) - { - //Waiting for Connection - state = TVIMPSTEnums::ESVCEUpdatingContacts; - } - else if ( serviceState & TVIMPSTEnums::ESVCENetworkDisConnecting ) - { - //disconnecting - state = TVIMPSTEnums::ESVCENetworkDisConnecting; - } - else if ( serviceState & TVIMPSTEnums::ESVCERegistered ) - { - //Enabled - state = TVIMPSTEnums::ESVCERegistered; - } - - return state; - } - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::HandleContactFetchedL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVIMPSTEngine::HandleContactFetchedL() - { - - TRACER_AUTO; - - if (TVIMPSTEnums::ESVCERegistered == iState || - TVIMPSTEnums::ESVCEUpdatingContacts == iState ) - { - MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence); - if (subService) - { - //Get Presence SubService - MVIMPSTEnginePresenceSubService& presenceSubService = - MVIMPSTEnginePresenceSubService::Cast(*subService); - - if (TVIMPSTEnums::ESVCERegistered == subService->SubServiceState() || - TVIMPSTEnums::ESVCEUpdatingContacts == subService->SubServiceState() ) - { - presenceSubService.FetchPresenceFromCache(); - } - presenceSubService.UpdatePresenceStateL(); - } - // this is added here as for xmpp subscribeforsearchkeys needs to be done only - // after the contactts are fetched from the server, - // SetExtensionFeaturesSupported is moved to immediately after login. - // as for sip case it would never come to this line if there are not contacts in it. - MVIMPSTEngineExtentionFeatures* feature = ExtentionFeatures( - TVIMPSTEnums::ESearch); - if (feature) - { - MVIMPSTEngineSearchMgrExtention& searchFeature = - MVIMPSTEngineSearchMgrExtention::Cast(*feature); - //subscribe for search keys, since this is a server feature - if(TVIMPSTEnums::ESupportUnKnown == searchFeature.IsSupported()) - { - searchFeature.SubscribeForSearchKeysL(); - } - } - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTEngine::HandleStorageChangeL -// -------------------------------------------------------------------------- -// -void CVIMPSTEngine::HandleStorageChangeL( TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType, - MVIMPSTStorageContactList* /*aList*/, - MVIMPSTStorageContact* aContact, - TInt /*aContactIndex*/ ) - { - - TRACER_AUTO; - TRACE(" iState = %d", iState); - if (TVIMPSTEnums::ESVCERegistered == iState || TVIMPSTEnums::ESVCEUpdatingContacts == iState ) - { - TRACE( "Inside IF"); - TRACE( "aEventType : %d", aEventType); - switch( aEventType ) - { - case TVIMPSTEnums::EStorageContactReadComplete: - case TVIMPSTEnums::EStorageContactFetchComplete: - { - TRACE( "aEventType EStorageContactFetchComplete"); - MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence); - if( subService ) - { - - TRACE( "Inside IF subService"); - MVIMPSTEnginePresenceSubService& presenceSubService = MVIMPSTEnginePresenceSubService::Cast(*subService); - - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - if( storage ) - { - MVIMPSTStorageContact& ownContact = storage->OwnContactL(); - TPtrC ownUserId = ownContact.UserId(); - if( ownUserId.Length() ) - { - presenceSubService.SubscribePresenceOfSingleContactL( ownUserId ); - } - - TRACE( "inside if storage"); - MVIMPSTStorageContactList* list = storage->FindContactList(KIMContactListId) ; - if ( list ) - { - - TRACE( "inside if list"); - TInt count = list->Count(); - TRACE( "inside count = %d", count); - for(TInt i = 0;i < count; i++) - { - MVIMPSTStorageContact* contact = &(list->operator[](i)); - if(contact) - { - if( contact->UserId().Length() ) - { - TPtrC userId = contact->UserId(); - TRACE("inside userId = %S", &userId); - presenceSubService.SubscribePresenceOfSingleContactL( contact->UserId() ); - } - } // end of if(contact) - }// end of for - } - } - - } - HandleContactFetchedL(); - - break; - } - case TVIMPSTEnums::EStorageEventOwnUserChanged: - case TVIMPSTEnums::EStorageEventContactAddition: - case TVIMPSTEnums::EStorageContactSynchronizing: - case TVIMPSTEnums::EStorageContactReading: - case TVIMPSTEnums::EStorageContactFetchExistInStore: - { - TRACE( "aEventType : %d", aEventType); - MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence); - if( subService && aContact && - aContact->UserId().Length() && - TVIMPSTEnums::ESVCERegistered == iState ) - { - MVIMPSTEnginePresenceSubService& presenceSubService = MVIMPSTEnginePresenceSubService::Cast(*subService); - presenceSubService.SubscribePresenceOfSingleContactL( aContact->UserId() ); - presenceSubService.FetchPresenceOfSingleContactL(aContact->UserId()); - } - break; - } - case TVIMPSTEnums::EStorageEventUserIdPreChange: - case TVIMPSTEnums::EStorageEventDeleteFromPbk: - { - - TRACE("EStorageEventUserIdPreChange/EStorageEventDeleteFromPbk"); - if( aContact && aContact->UserId().Length() ) - { - TPtrC userId = aContact->UserId(); - MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence); - // incase of delete from phonebook delete from server and close conversation if exist - // mostly applicable for local store cases - if( subService ) - { - MVIMPSTEnginePresenceSubService& presenceSubService = MVIMPSTEnginePresenceSubService::Cast(*subService); - presenceSubService.UnSubscribePresenceOfSingleContactL( userId ) ; - } - MVIMPSTEngineExtentionFeatures* feature = ExtentionFeatures(TVIMPSTEnums::EContactManagement); - if (feature ) - { - MVIMPSTEngineContactMgmtExtention& contactMgr = MVIMPSTEngineContactMgmtExtention::Cast(*feature); - contactMgr.DeleteServerContactL(KNullDesC,userId) ; - } - MVIMPSTEngineSubService* imService = SubService(TVIMPSTEnums::EIM) ; - if(imService) - { - MVIMPSTEngineIMSubService& imSubService = MVIMPSTEngineIMSubService::Cast (*imService); - imSubService.CloseConversationL( userId ); - } - } - break; - } - case TVIMPSTEnums::EStorageEventUserIdPostChange: - { - - TRACE("EStorageEventUserIdPostChange"); - if( aContact && aContact->UserId().Length() ) - { - TPtrC userId = aContact->UserId(); - // incase of delete from phonebook delete from server and close conversation if exist - // mostly applicable for local store cases - MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence); - if( subService ) - { - MVIMPSTEnginePresenceSubService& presenceSubService = MVIMPSTEnginePresenceSubService::Cast(*subService); - presenceSubService.SubscribePresenceOfSingleContactL( userId ); - } - MVIMPSTEngineExtentionFeatures* feature = ExtentionFeatures(TVIMPSTEnums::EContactManagement); - if (feature ) - { - MVIMPSTEngineContactMgmtExtention& contactMgr = MVIMPSTEngineContactMgmtExtention::Cast(*feature); - contactMgr.AddServerContactL(KListNameAllBuddy,userId, aContact->Name(), EFalse ); - } - } - break; - } - default: - { - break; - } - } - } - } - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::CreateExtentionFeaturesL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVIMPSTEngine::CreateExtentionFeaturesL() - { - TRACER_AUTO; - if (!iSessionCntxtObserver) - { - return; - } - - //create all the features - //first find whether we have the extention already created - //in the extention manager list - - //first find whether we have the extention already created - //in the extention manager list - MVIMPSTEngineExtentionFeatures* contactMgtFeature = ExtentionFeatures( - TVIMPSTEnums::EContactManagement); - - if (!contactMgtFeature) - { - CVIMPSTEngineContactMgmtExtention* contactItem = - CVIMPSTEngineContactMgmtExtention::NewL( - iSessionCntxtObserver->XimpPresenceContextL(), - iSessionCntxtObserver->XimpPresentityGroupsL(), - *iSessionCntxtObserver->GetRequestMapper()); - - AddExtentionFeaturesL(contactItem); - //Unregister is done by session context when the presence context gets - //unbinded - iSessionCntxtObserver->RegisterObserver(contactItem); - } - - - //first find whether we have the extention already created - //in the extention manager list - MVIMPSTEngineExtentionFeatures* searchFeature = ExtentionFeatures( - TVIMPSTEnums::ESearch); - if (!searchFeature) - { - CVIMPSTEngineSearchMgrExtention* searchitem = - CVIMPSTEngineSearchMgrExtention::NewL( - iSessionCntxtObserver->XimpPresenceContextL(), - *iSessionCntxtObserver->GetRequestMapper()); - - AddExtentionFeaturesL(searchitem); - - //Unregister is done by session context when the presence context gets - //unbinded - iSessionCntxtObserver->RegisterObserver(searchitem); - } - - } - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::SetExtentionFeaturesSupportedL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVIMPSTEngine::SetExtentionFeaturesSupportedL() - { - TRACER_AUTO; - if (!iSessionCntxtObserver) - { - return; - } - - //We would have got the supported features - //iterate and create the required extentionmgr - TInt supportedFeatures = iSessionCntxtObserver->GetSupportedFeatures(); - - if ( !(EVIMPSTFeatureSearch & supportedFeatures) ) - { - //first find whether we have the extention already created - //in the extention manager list - MVIMPSTEngineExtentionFeatures* feature = ExtentionFeatures( - TVIMPSTEnums::ESearch); - if (feature) - { - MVIMPSTEngineSearchMgrExtention& searchFeature = - MVIMPSTEngineSearchMgrExtention::Cast(*feature); - searchFeature.SetSupported(TVIMPSTEnums::ENotSupported); - //subscribe for search keys is done once the contacts are fetched from the server. - //check HandleContactFetchCOmpletedL(). - } - } - - if (( EVIMPSTFeatureAddContact & supportedFeatures ) || - ( EVIMPSTFeatureDeleteContact & supportedFeatures )) - { - //first find whether we have the extention already created - //in the extention manager list - MVIMPSTEngineExtentionFeatures* feature = ExtentionFeatures( - TVIMPSTEnums::EContactManagement); - if (feature) - { - MVIMPSTEngineContactMgmtExtention& contactMgmtFeature = - CVIMPSTEngineContactMgmtExtention::Cast(*feature); - contactMgmtFeature.SetSupported(TVIMPSTEnums::ESupported); - } - - } - - if ( EVIMPSTFeatureAvatar & supportedFeatures ) - { - //first find whether we have the extention already created - //in the extention manager list - MVIMPSTEngineSubService* subService = SubService( - TVIMPSTEnums::EPresence); - if (subService) - { - MVIMPSTEnginePresenceSubService& avatarFeature = - CVIMPSTEnginePresenceSubService::Cast(*subService); - avatarFeature.SetAvatarSupported(ETrue); - } - } - } - - -//----------------------------------------------------------------------------- -// CVIMPSTEngine::ReSetExtentionFeaturesSupportedL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVIMPSTEngine::ReSetExtentionFeaturesSupportedL() - { - TRACER_AUTO; - //first find whether we have the extention already created - //in the extention manager list - MVIMPSTEngineExtentionFeatures* feature = ExtentionFeatures( - TVIMPSTEnums::ESearch); - if (feature) - { - MVIMPSTEngineSearchMgrExtention& searchFeature = - MVIMPSTEngineSearchMgrExtention::Cast(*feature); - searchFeature.SetSupported(TVIMPSTEnums::ESupportUnKnown); - } - - //first find whether we have the extention already created - //in the extention manager list - MVIMPSTEngineExtentionFeatures* feature1 = ExtentionFeatures( - TVIMPSTEnums::EContactManagement); - if (feature1) - { - MVIMPSTEngineContactMgmtExtention& contactMgmtFeature = - CVIMPSTEngineContactMgmtExtention::Cast(*feature1); - contactMgmtFeature.SetSupported(TVIMPSTEnums::ESupportUnKnown); - } - - //first find whether we have the extention already created - //in the extention manager list - MVIMPSTEngineSubService* subService = SubService( - TVIMPSTEnums::EPresence ); - if (subService) - { - MVIMPSTEnginePresenceSubService& avatarFeature = - CVIMPSTEnginePresenceSubService::Cast(*subService); - avatarFeature.SetAvatarSupported(EFalse); - } - - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::DefaultDomainNameL -// -// --------------------------------------------------------- -void CVIMPSTEngine::DefaultDomainNameL( TDes& aDefaultDomainName ) const - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - iTableFetcher.GetDefaultDomainNameL(iServiceId, aDefaultDomainName); - - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::IsSubServiceSupportedInternal -// -// --------------------------------------------------------- -TBool CVIMPSTEngine::IsSubServiceSupportedInternal(TVIMPSTEnums::SubServiceType aType) const - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - TRACE( "SubServiceType: %d", aType ); - TInt err = KErrNotFound; - TBool support = EFalse; - TCCHSubserviceState aCCHState(ECCHUninitialized); - - switch(aType) - { - case TVIMPSTEnums::EVoip: - { - err = iCchHandler->GetServiceState(iServiceId, ECCHVoIPSub, aCCHState); - break; - } - case TVIMPSTEnums::EPresence: - { - err = iCchHandler->GetServiceState(iServiceId, ECCHPresenceSub, aCCHState); - break; - } - case TVIMPSTEnums::EIM: - { - err = iCchHandler->GetServiceState(iServiceId, ECCHIMSub, aCCHState); - break; - } - default: - { - break; - } - - } - - if (KErrNone == err) - { - support = ETrue; - } - - - TRACE("support: %d", support ); - return support; - } - - -// --------------------------------------------------------- -// CVIMPSTEngine::ChangeConnectionL -// -// --------------------------------------------------------- -TInt CVIMPSTEngine::ChangeConnectionL() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - TInt error = KErrNotFound; - if(iCchHandler) - { - - TRACE( "ChangeConnectionL() Called" ); - error = iCchHandler->ChangeConnectionL(); - } - - - TRACE("error: %d", error ); - - return error; - } - -// --------------------------------------------------------- -// CVIMPSTEngine::IsBlockSupportedL -// -// --------------------------------------------------------- - -TBool CVIMPSTEngine::IsBlockSupportedL() - { - TRACER_AUTO; - TBool isBlockSupported = EFalse; - //We would have got the supported features - if(iSessionCntxtObserver && (TVIMPSTEnums::ESVCERegistered == ParseGetServiceState())) - { - TInt supportedFeatures = iSessionCntxtObserver->GetSupportedFeatures(); - if ( (EVIMPSTFeatureBlock & supportedFeatures) && (EVIMPSTFeatureUnBlock & supportedFeatures) ) - { - isBlockSupported = ETrue; - } - } - return isBlockSupported; - } - -// --------------------------------------------------------- -// CVIMPSTEngine::IsPasswordAvailable -// returns True if password is present in the settings else returns false -// --------------------------------------------------------- -TBool CVIMPSTEngine::IsPasswordAvailableL() - { - TRACER_AUTO; - - return(iCchHandler->IsPasswordAvailable(ECchPasswordSet)); - } - -// --------------------------------------------------------- -// CVIMPSTEngine::DeleteDataBase -// --------------------------------------------------------- -void CVIMPSTEngine::DeleteDataBaseL() - { - TRACER_AUTO; - MVIMPSTStorageServiceView* storage = - CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - if( storage ) - { - //delete cdb file. - storage->DeleteDatabaseL(); - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::GetPreseceSubService -// --------------------------------------------------------------------------- -// -MVIMPSTEnginePresenceSubService* CVIMPSTEngine::GetPreseceSubService() - { - TRACER_AUTO; - MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence); - if (subService) - { - //Get Presence SubService - MVIMPSTEnginePresenceSubService& presenceSubService = - MVIMPSTEnginePresenceSubService::Cast(*subService); - return &presenceSubService ; - } - return NULL; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngine::FetchBlockedList -// --------------------------------------------------------------------------- -// -void CVIMPSTEngine::FetchBlockedListL() - { - MVIMPSTEnginePresenceSubService* subService = GetPreseceSubService(); - if( subService ) - { - //fetch the blocked list from server - subService->FetchBlockedListFromServerL(iBlockListObs); - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngine::RegisterBlockedListObserver -// --------------------------------------------------------------------------- -// -void CVIMPSTEngine::RegisterBlockedListObserver( - MVIMPSTEngineBlockedListFetchEventObserver* aOb) - { - iBlockListObs = aOb; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngine::HandleChangeConnectionEventL -// --------------------------------------------------------------------------- -// -void CVIMPSTEngine::HandleChangeConnectionEventL() - { - TRACER_AUTO; - MVIMPSTEngineSubService* subService = SubService(TVIMPSTEnums::EPresence); - if (subService) - { - //Get Presence SubService - MVIMPSTEnginePresenceSubService& presenceSubService = - MVIMPSTEnginePresenceSubService::Cast(*subService); - if (TVIMPSTEnums::ESVCERegistered == subService->SubServiceState() || - TVIMPSTEnums::ESVCEUpdatingContacts == subService->SubServiceState() ) - { - // Unsubscribe all lists here to get whole list contents when doing a new bind. - // Trap here to avoid unbind not being done if list operations should leave - TRAP_IGNORE( presenceSubService.UnsubscribeListsL() ); - } - } - - if( iSessionCntxtObserver ) - { - iSessionCntxtObserver->ServerUnBindL(ETrue); - } - } - -// ------------------------------------------------------- -// CVIMPSTEngine :: IsUnInstalled -// For Description see MVIMPSTEngine -// ------------------------------------------------------- -// -TBool CVIMPSTEngine::IsUnInstalled( ) - { - return iUnInstall; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginecchhandler.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginecchhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,512 +0,0 @@ -/* -* Copyright (c) 2008 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: Class handling the use of Cch - All CCH Events go thro this class -* -*/ - - - -// INCLUDE FILES -#include -#include -#include - -#include "cvimpstenginecchhandler.h" -#include "tvimpstconsts.h" - -#include "f32file.h" -#include "uiservicetabtracer.h" - -// CONSTANTS - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::CVIMPSTEngineCchHandler -// --------------------------------------------------------------------------- -// -CVIMPSTEngineCchHandler::CVIMPSTEngineCchHandler(TUint aServiceId, MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver) -: iServiceId(aServiceId),iCchUiEventObserver(aCchUiEventObserver) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineCchHandler::ConstructL( ) - { - TRACER_AUTO; - - // Create service selection here - iCchClient = CCch::NewL(); - TRACE("CCch::NewL"); - iSettingsStore = CVIMPSTSettingsStore::NewL(); - TRACE("CVIMPSTSettingsStore::NewL"); - - if (iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - TRACE("CCch::GetService"); - - if( service ) - { - service->SetObserver( *this ); - TRACE("CCchService::SetObserver"); - } - } - - //Configure CCHUI notes - MCchUi& cchUiApi = iCchClient->CchUiApi(); - TRACE("CCch::CchUiApi"); - - // Set observer to listen cchui events for change connection. - cchUiApi.AddObserverL( *this ); // parameter is MCchUiObserver - TRACE("MCchUi::CchUiApi"); - - // Configure CCHUI API to show all notes/dialogs except connecting note. - // Also configure that only VoIP and IM subservices are allowed (notes are - // shown only for those). - RArray allowedNotes; - TRACE("MCchUiObserver::TCchUiDialogType"); - RArray allowedSubServices; - TRACE("TCCHSubserviceType"); - CleanupClosePushL( allowedNotes ); - TRACE("allowedNotes"); - CleanupClosePushL( allowedSubServices ); - TRACE("allowedSubServices"); - - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeUsernamePasswordFailed ); - TRACE("ECchUiDialogTypeUsernamePasswordFailed"); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeAuthenticationFailed ); - TRACE("ECchUiDialogTypeAuthenticationFailed"); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionDefined ); - TRACE("ECchUiDialogTypeNoConnectionDefined"); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeNoConnectionAvailable ); - TRACE("ECchUiDialogTypeNoConnectionAvailable"); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeConfirmChangeConnection ); - TRACE("ECchUiDialogTypeConfirmChangeConnection"); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeChangeConnection ); - TRACE("ECchUiDialogTypeChangeConnection"); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeDefectiveSettings ); - TRACE("ECchUiDialogTypeDefectiveSettings"); - allowedNotes.AppendL( MCchUiObserver::ECchUiDialogTypeErrorInConnection ); - TRACE("ECchUiDialogTypeErrorInConnection"); - - allowedSubServices.AppendL( ECCHUnknown ); - TRACE("ECCHUnknown"); - allowedSubServices.AppendL( ECCHVoIPSub ); - TRACE("ECCHVoIPSub"); - allowedSubServices.AppendL( ECCHIMSub ); - TRACE("ECCHIMSub"); - allowedSubServices.AppendL( ECCHPresenceSub ); - TRACE("ECCHPresenceSub"); - - cchUiApi.ConfigureVisualizationL( - allowedNotes, allowedSubServices ); - TRACE("ConfigureVisualizationL"); - - CleanupStack::PopAndDestroy( &allowedSubServices ); - TRACE("allowedSubServices::pop"); - CleanupStack::PopAndDestroy( &allowedNotes ); - TRACE("allowedNotes::pop"); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTEngineCchHandler* CVIMPSTEngineCchHandler::NewL(TUint aServiceId, - MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver ) - { - TRACER_AUTO; - TRACE("ServiceId: %d", aServiceId ); - - CVIMPSTEngineCchHandler* self = NewLC(aServiceId, aCchUiEventObserver ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::NewLC -// --------------------------------------------------------------------------- -// -CVIMPSTEngineCchHandler* CVIMPSTEngineCchHandler::NewLC(TUint aServiceId ,MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver) - { - TRACER_AUTO; - CVIMPSTEngineCchHandler* self = - new (ELeave) CVIMPSTEngineCchHandler(aServiceId, aCchUiEventObserver); - - TRACE("ServiceId: %d", aServiceId ); - CleanupStack::PushL(self); - self->ConstructL( ); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::~CVIMPSTEngineCchHandler -// --------------------------------------------------------------------------- -// -CVIMPSTEngineCchHandler::~CVIMPSTEngineCchHandler() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - if(iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - service->RemoveObserver(); - } - } - delete iCchClient; - delete iSettingsStore; - iObserverStructure.Reset(); - iObserverStructure.Close(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::ShutdownCch -// --------------------------------------------------------------------------- -// -//TODO: not used any where.. need to be removed. -void CVIMPSTEngineCchHandler::ShutdownCch() - { - TRACER_AUTO; - TRACE("ServiceId: %d", iServiceId ); - if ( iCchClient ) - { - delete iCchClient; - iCchClient = NULL; - } - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::GetServiceState -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineCchHandler::GetServiceState(TUint aServiceId, - TInt aSubServiceType, - TCCHSubserviceState& aCCHState - ) - { - TRACER_AUTO; - - TRACE( "ServiceId: %d, SubServiceType:%d", aServiceId, aSubServiceType ); - TInt err = KErrNotFound; - if ( iCchClient ) - { - CCchService* service = iCchClient->GetService( aServiceId ); - TCchServiceStatus status; - status.SetState(ECCHUninitialized); - - if( service ) - { - // Get status from the client - err = service->GetStatus( TCCHSubserviceType(aSubServiceType), status ); - if (KErrNone == err) - { - aCCHState = status.State(); - } - } - } - TRACE( "aCCHState: (%d)", aCCHState ); - - return err; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::EnableService -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineCchHandler::EnableService() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - TInt error = KErrNotFound; - if ( iCchClient ) - { - iCchClient->SetConnectivityDialogsAllowed( ETrue ); - - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - TRACE( "CCHClient->Enable" ); - error = service->Enable( ECCHUnknown ); - } - } - - TRACE( " stat: (%d)", error ); - - - return error; - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::DisableService -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineCchHandler::DisableService() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - TInt error = KErrNotFound; - - if(iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - TRACE( "CCHClient->Disable" ); - error = service->Disable( ECCHUnknown ); - } - } - - TRACE( "stat: (%d)", error ); - - - return error; - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::ServiceStatusChanged -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineCchHandler::ServiceStatusChanged( - TInt aServiceId, - const TCCHSubserviceType aType, - const TCchServiceStatus& aServiceStatus ) - { - TRACER_AUTO; - - // Disable the service only if the login to one of the subservices fails - // 1.ECCHVoIPSub - // 2.ECCHPresenceSub - // 3.ECCHIMSub - if( aServiceStatus.Error() == KCCHErrorLoginFailed && - (ECCHVoIPSub == aType || - ECCHPresenceSub == aType || - ECCHIMSub == aType)) - { - DisableService(); - } - - if((aServiceStatus.Error() == KCCHErrorAuthenticationFailed )||(aServiceStatus.Error() == KCCHErrorLoginFailed)) - { - TInt loginfailed = 0; - TRAP_IGNORE( iSettingsStore->SetL(iServiceId ,EServiceSuccessfullLogin ,loginfailed) ); - } - TInt count = iObserverStructure.Count(); - for(TInt i = 0; i< count; i++) - { - if(aType == iObserverStructure[i].iSubserviceType ) - { - TRAP_IGNORE(iObserverStructure[i].iObserver->CchEventOccuredL( - aServiceId, - aServiceStatus.State(), - aServiceStatus.Error() )); - } - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::RegisterCchObserverL -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineCchHandler::RegisterCchObserverL(MVIMPSTEngineCchHandlerObserver* aObserver, - TCCHSubserviceType aSubServiceType ) - { - TRACER_AUTO; - if(aObserver) - { - TObserverStructure obsstruct; - obsstruct.iObserver = aObserver; - obsstruct.iSubserviceType = aSubServiceType; - iObserverStructure.Append(obsstruct); - } - - } -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::UnRegisterCchObserver -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineCchHandler::UnRegisterCchObserver(TCCHSubserviceType aSubServiceType ) - { - TRACER_AUTO; - TInt count = iObserverStructure.Count(); - for(TInt i = 0; i < count; i++) - { - if(aSubServiceType == iObserverStructure[i].iSubserviceType) - { - iObserverStructure[i].iObserver = NULL; - iObserverStructure.Remove(i); - iObserverStructure.Compress(); - break; - } - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::GetConParametersL -// --------------------------------------------------------------------------- -// -HBufC* CVIMPSTEngineCchHandler::GetConParametersL( - TCchConnectionParameter aConnParam ) - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - TRACE( "TCchConnectionParameter aConnParam: (%d)", aConnParam ); - HBufC* temp = NULL; - TInt error = KErrNotFound; - if(iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - RBuf buffer; - CleanupClosePushL( buffer ); - buffer.CreateL(KVIMPSTUISPSMaxPropertyLength); - - TRACE( "CCHClient->GetConnectionParameter" ); - error = service->GetConnectionParameter(ECCHUnknown,aConnParam,buffer); - User::LeaveIfError( error); - - //extract only the user id in case - // Check for prefix and remove if found - TInt prefixLocation = buffer.Locate( ':' ); - if ( KErrNotFound != prefixLocation && ECchUsername == aConnParam ) - { - TRACE( "Prefix found -> remove"); - temp = buffer.Mid(prefixLocation+1 ).AllocL(); // ownership transferred - } - else - { - TRACE("No Prefix found"); - temp = buffer.AllocL(); // ownership transferred - } - TRACE( "Return Value: Error: %d ", error ); - CleanupStack::PopAndDestroy( &buffer ); - } - } - return temp; - } - - -// --------------------------------------------------------------------------- -// Set cch connection parameter. -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineCchHandler::SetConnectionParameter( - TCchConnectionParameter aConnParam, - const TDesC& aConnParamValue ) - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - TRACE( "TCchConnectionParameter aConnParam: (%d)", aConnParam ); - TInt error = KErrNotFound; - if(iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - TRACE( "CCHClient->SetConnectionParameter"); - if (service) - { - error = service->SetConnectionParameter( - ECCHUnknown, aConnParam, aConnParamValue ); - } - } - TRACE( "error: %d", error ); - return error; - } - - - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::ChangeConnectionL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineCchHandler::ChangeConnectionL() - { - TRACER_AUTO; - TRACE( "ServiceId: %d", iServiceId ); - - TInt err = KErrNone; - if (iCchClient) - { - MCchUi& cchUiApi = iCchClient->CchUiApi(); - TRAP(err, cchUiApi.ShowDialogL(iServiceId, - MCchUiObserver::ECchUiDialogTypeChangeConnection);); - } - - return err; - } - - -// --------------------------------------------------------------------------- -// CchUiApi -// --------------------------------------------------------------------------- -// -MCchUi& CVIMPSTEngineCchHandler::CchUiApi() const - { - return iCchClient->CchUiApi(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::IsPasswordAvailableL -// To check whether password available in settings or not -// Returns true if password is present in the settings else returns false -// --------------------------------------------------------------------------- -// -TBool CVIMPSTEngineCchHandler::IsPasswordAvailable(TCchConnectionParameter aConnParam ) - { - TRACER_AUTO; - TRACE( "TCchConnectionParameter aConnParam: (%d)", aConnParam ); - TInt passwordSet = EFalse; - if(iCchClient) - { - CCchService* service = iCchClient->GetService( iServiceId ); - if( service ) - { - TRACE( "CCHClient->GetConnectionParameter"); - service->GetConnectionParameter( ECCHUnknown,aConnParam,passwordSet ); - } - } - return passwordSet; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineCchHandler::ConnectivityDialogsCompletedL -// --------------------------------------------------------------------------- -// - -void CVIMPSTEngineCchHandler::ConnectivityDialogsCompletedL( - TInt aServiceId, MCchUiObserver::TCchUiOperationResult aOperationResult ) - { - TRACER_AUTO; - if((iServiceId == aServiceId)&&(aOperationResult == ECchUiClientOperationResultConnectionChanged)) - { - iCchUiEventObserver.HandleChangeConnectionEventL(); - } - } - -// End of file - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginecontactmgmtextention.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginecontactmgmtextention.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,316 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for CVIMPSTEngineContactMgmtExtention -* -*/ - -// INCLUDE FILES -#include "cvimpstenginecontactmgmtextention.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "cvimpstenginerequestmapper.h" -#include "cvimpstenginerequest.h" -#include "tvimpstenums.h" - - -#include "vimpstallerrors.h" -#include "tvimpstconsts.h" - -#include "uiservicetabtracer.h" - -// Constants -_LIT( KListNameAllBuddy ,"buddylist" ); - - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::NewL -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTEngineContactMgmtExtention* CVIMPSTEngineContactMgmtExtention::NewL( - MXIMPContext& aPresenceCtx, - MPresentityGroups& aPresGroup, - CVIMPSTEngineRequestMapper& aRequestMapper) - { - TRACER_AUTO; - CVIMPSTEngineContactMgmtExtention* self = - CVIMPSTEngineContactMgmtExtention::NewLC( aPresenceCtx, - aPresGroup, - aRequestMapper - ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::NewLC -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTEngineContactMgmtExtention* CVIMPSTEngineContactMgmtExtention::NewLC( - MXIMPContext& aPresenceCtx, - MPresentityGroups& aPresGroup, - CVIMPSTEngineRequestMapper& aRequestMapper) - { - TRACER_AUTO; - CVIMPSTEngineContactMgmtExtention* self = new (ELeave) - CVIMPSTEngineContactMgmtExtention(aPresenceCtx, aPresGroup,aRequestMapper); - CleanupStack::PushL( self ); - - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::CVIMPSTEngineContactMgmtExtention -// --------------------------------------------------------- -CVIMPSTEngineContactMgmtExtention::CVIMPSTEngineContactMgmtExtention( - MXIMPContext& aPresenceCtx, - MPresentityGroups& aPresGroup, - CVIMPSTEngineRequestMapper& aRequestMapper) - : - iPresenceCtx(aPresenceCtx), - iPresGroup(aPresGroup), - iRequestMapper(aRequestMapper), - iSupported(TVIMPSTEnums::ESupportUnKnown) - { - - } - -// --------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::~CVIMPSTEngineContactMgmtExtention -// --------------------------------------------------------- -CVIMPSTEngineContactMgmtExtention::~CVIMPSTEngineContactMgmtExtention() - { - TRACER_AUTO; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::IsSupported() -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::FeatureSupport CVIMPSTEngineContactMgmtExtention::IsSupported() const - { - return iSupported; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::Type() -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::ExtentionType CVIMPSTEngineContactMgmtExtention::Type() const - { - return TVIMPSTEnums::EContactManagement; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::DeleteServerContactL -// --------------------------------------------------------- -TInt CVIMPSTEngineContactMgmtExtention::DeleteServerContactL( const TDesC& aContactListId, - const TDesC& aUserId ) - { - TRACER_AUTO; - TRACE( "DeleteServerContactL aContactListId = %s",&aContactListId ); - // err is initialized to KErrNone, b'coz if adaptation or presence is not supported then, - // the request should not be sent to the server, this is a hack as the voip - // writes the adaptation uid into settings even if presence is not supported. - // bug has to be raised to voip. - - TInt err = KErrNone; - - if (iSupported == TVIMPSTEnums::ESupported) - { - //if there is no contact list id, contact is added to default contact list - // here its "buddylist" - HBufC* listId = HBufC::NewLC(KPropertyMaxLength); // onto cleanup stack - TPtr listIdPtr = listId->Des(); - if(0 == aContactListId.Length()) - { - listIdPtr.Copy(KListNameAllBuddy); - } - else - { - listIdPtr.Copy(aContactListId) ; - } - MXIMPIdentity* listIdentity = CreateIdentityLC( listIdPtr ) ; - MXIMPIdentity* userIdentity = CreateIdentityLC( aUserId ) ; - - //not sure whether we can pass NULL for listIdentity / userIdentity - //lets leave it to the adaptation. - //so ignoring the NULL for listIdentity, userIdentity - TXIMPRequestId reqId = iPresGroup.RemovePresentityGroupMemberL( - *listIdentity, *userIdentity ); - - iRequestMapper.CreateRequestL(reqId, ETrue, EVIMPSTXimpOperationDeleteContact);// waite here - - // codescanner warning can be ignored as MXIMPIdentity doesn't allow to pass pointer - // to PopAnddestroy function. It gives panic - CleanupStack::PopAndDestroy(); //userIdentity - CleanupStack::PopAndDestroy(); //listIdentity - - CleanupStack::PopAndDestroy(); // listId; - - err = iReqResult; - } - return err; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::AddServerContactL -// --------------------------------------------------------- -TInt CVIMPSTEngineContactMgmtExtention::AddServerContactL(const TDesC& aContactList, - const TDesC& aUserId, - const TDesC& aNickname , - TBool aWaitToComplete /*= ETrue*/ ) - { - - TRACER_AUTO; - - // err is initialized to KErrNone, b'coz if adaptation or presence is not supported then, - // the request should not be sent to the server, this is a hack as the voip - // writes the adaptation uid into settings even if presence is not supported. - // bug has to be raised to voip. - TInt err = KErrNone; - - if (iSupported == TVIMPSTEnums::ESupported) - { - //if there is no contact list id, contact is added to default contact list - // here its "buddylist" - HBufC* listId = HBufC::NewLC(KPropertyMaxLength); // onto cleanup stack - TPtr listIdPtr = listId->Des(); - if(0 == aContactList.Length()) - { - listIdPtr.Copy(KListNameAllBuddy); - } - else - { - listIdPtr.Copy(aContactList) ; - } - - HBufC* userId = HBufC::NewLC(KPropertyMaxLength); // onto cleanup stack - TPtr userIdPtr = userId->Des(); - - //domain name is checked on the ui and command process side. - userIdPtr.Zero(); - userIdPtr.Append( aUserId ); - - // create identity - MXIMPIdentity* listIdentity = CreateIdentityLC( listIdPtr ) ; - MXIMPIdentity* userIdentity = CreateIdentityLC( userIdPtr ) ; // onto cleanup stack - - //not sure whether we can pass NULL for listIdentity / userIdentity - //lets leave it to the adaptation. - //so ignoring the NULL for listIdentity, userIdentity - TXIMPRequestId reqId = iPresGroup.AddPresentityGroupMemberL(*listIdentity, - *userIdentity, - aNickname) ; - - iRequestMapper.CreateRequestL(reqId, aWaitToComplete, EVIMPSTXimpOperationAddContact ); - - // codescanner warning can be ignored as MXIMPIdentity doesn't allow to pass pointer - // to PopAnddestroy function. It gives panic - CleanupStack::PopAndDestroy(); //userIdentity - CleanupStack::PopAndDestroy(); //listIdentity - - CleanupStack::PopAndDestroy(); //userId - CleanupStack::PopAndDestroy(); // listId - - err = iReqResult; - } - - return err; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::CreateIdentityLC -// --------------------------------------------------------- -MXIMPIdentity* CVIMPSTEngineContactMgmtExtention::CreateIdentityLC(const TDesC& aListId) - { - TRACER_AUTO; - - MXIMPObjectFactory& objFactory = iPresenceCtx.ObjectFactory(); - MXIMPIdentity* newIdentity = objFactory.NewIdentityLC(); - //no need to check for null as NewIdentityLC does not return null, - // if failed ot allocate memory it will leave with KErrNoMemory - newIdentity->SetIdentityL( aListId) ; - return newIdentity; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::HandleSessionContextEventL -// --------------------------------------------------------- -void CVIMPSTEngineContactMgmtExtention::HandleSessionContextEventL(const MXIMPContext& /*aContext*/, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation /*= EVIMPSTXimpOperationNoOperation*/ ) - { - - TRACER_AUTO; - - switch( aEvent.GetInterfaceId() ) - { - case MXIMPRequestCompleteEvent::KInterfaceId: - { - TRACE( "InsideCallbackswitch::MXIMPRequestCompleteEvent"); - if ( (EVIMPSTXimpOperationAddContact == aXimpOperation) - || (EVIMPSTXimpOperationDeleteContact == aXimpOperation) ) - { - const MXIMPRequestCompleteEvent* event = - TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - - iReqResult = event->CompletionResult().ResultCode(); - const TXIMPRequestId& reqId = event->RequestId(); - // Note:FindRequestId does not pass the ownership. hanece req - // should not be deleted. - CVIMPSTEngineRequest *req = iRequestMapper.FindRequestId( reqId ); - - if ( req ) - { - req->StopWait() ; - iRequestMapper.RemoveRequestId(reqId); - } - } - break; - } - - default: - { - break; - } - } - } - -//---------------------------------------------------------------------------- -// CVIMPSTEngineContactMgmtExtention::SetSupported() -// ----------------------------------------------------------------------------- -// -void CVIMPSTEngineContactMgmtExtention::SetSupported(TVIMPSTEnums::FeatureSupport aSupported) - { - iSupported = aSupported; - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginecvlistener.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginecvlistener.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* Copyright (c) 2008-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: active object class for interacting with conversation view -* -*/ - -// INCLUDE FILES - -#include "cvimpstenginecvlistener.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" -#include "mvimpststoragecontact.h" -#include "cvimpstengineservicetablefetcher.h" -#include "uiservicetabtracer.h" - -//system includes -#include -#include - -// ================= MEMBER FUNCTIONS ======================= - -// -------------------------------------------------------------------------- -// CVIMPSTEngineCVListener::CVIMPSTEngineCVListener -// -------------------------------------------------------------------------- -// -CVIMPSTEngineCVListener::CVIMPSTEngineCVListener( - CVIMPSTEngineServiceTableFetcher& aServiceTableFetcher ): - CActive( CActive::EPriorityStandard ), - iServiceTableFetcher( aServiceTableFetcher ) - { - CActiveScheduler::Add( this ); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTEngineCVListener::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTEngineCVListener::ConstructL() - { - TRACER_AUTO; - - // subscribing for the property published by conversation view. - // attach the properties. - User::LeaveIfError( iProperty.Attach(KConvViewUID,KXspIdServiceIDKey ) ); - //start listening property published by CV (to get Contact link and Display name.). - iProperty.Subscribe( iStatus ); - SetActive(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTEngineCVListener::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTEngineCVListener* CVIMPSTEngineCVListener::NewL( - CVIMPSTEngineServiceTableFetcher& aServiceTableFetcher ) - { - CVIMPSTEngineCVListener* self = new(ELeave) CVIMPSTEngineCVListener( aServiceTableFetcher ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } -// --------------------------------------------------------- -// CVIMPSTEngineCVListener::~CVIMPSTEngineCVListener() -// C++ Destructor -// --------------------------------------------------------- -// -CVIMPSTEngineCVListener::~CVIMPSTEngineCVListener() - { - Cancel(); - iProperty.Close(); - } -// --------------------------------------------------------- -// CVIMPSTEngineCVListener::RunL() -// --------------------------------------------------------- -// -void CVIMPSTEngineCVListener::RunL() - { - TRACER_AUTO; - // resubscribe before processing new value to prevent missing updates - //TBuf serId_usrId; - HBufC16* serId_usrId = HBufC16::NewLC(KMaxSerIdXspIdLen); - if ( serId_usrId ) - { - TPtr serId_usrIdPtr(serId_usrId->Des()); - iProperty.Get(KConvViewUID,KXspIdServiceIDKey,serId_usrIdPtr); - } - // parse the service id and userid form the buf and get the - // contactlink and first name and publish it. - TInt posOfDelimiter = serId_usrId->Find(KDelimiter); - if(KErrNotFound != posOfDelimiter ) - { - TInt serviceId = KErrNotFound; - TBuf servIdBuf; - TPtrC ptr(serId_usrId->Left(posOfDelimiter)); - servIdBuf = ptr; - TLex16 lex(servIdBuf); - lex.Val(serviceId); - - // Check if this service id belongs to us. If there is customized - // service with own service tab, we MUST not handle this callback. - RArray supportedServices; - CleanupClosePushL( supportedServices ); - iServiceTableFetcher.GetMasterServiceIdsL( supportedServices ); - TInt ourService = supportedServices.Find( serviceId ); - if( KErrNotFound != ourService ) - { - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL((TUint32)serviceId); - __ASSERT_ALWAYS( storage, User::Leave( KErrGeneral )); - TPtrC useridPtr = serId_usrId->Right(serId_usrId->Length() - (posOfDelimiter+ 1) ); - MVIMPSTStorageContact* contact = storage->FindContactByUserId(useridPtr); - if(contact) - { - TBuf8 link; - link = contact->ContactLink()->PackLC()->Des(); - - CleanupStack::PopAndDestroy(); //pop and destroy the hbufc8* - - TInt length = KMaxServiceIdLength + useridPtr.Length() + link.Length() - + contact->Name().Length() + (KDelimiter().Length() * 3); - TPtrC fullname = contact->Name(); - HBufC* dispName = NULL; - posOfDelimiter = fullname.Find(KDelimiter); - TInt displayIndex = fullname.Length() - (posOfDelimiter+ 1); - if(KErrNotFound != posOfDelimiter && (displayIndex > 0)) - { - dispName = fullname.Right( displayIndex ).AllocLC() ; - } - else - { - dispName= fullname.AllocLC(); - } - HBufC16* contactLink = HBufC16::NewLC(link.Length()); - TPtr16 ptr = contactLink->Des(); - ptr.Copy(link); - HBufC* userDetails = HBufC::NewLC(length); - TPtr userDetailsPtr = userDetails->Des(); - - userDetailsPtr.Zero(); - userDetailsPtr.AppendNum(serviceId); - userDetailsPtr.Append(KDelimiter()); - userDetailsPtr.Append(useridPtr); - userDetailsPtr.Append(KDelimiter()); - userDetailsPtr.Append(*dispName); - userDetailsPtr.Append(KDelimiter()); - userDetailsPtr.Append( *contactLink ); - - TRACE( " publishing = %S",&(*userDetails)); - - iProperty.Set(KConvViewUID,KContactLinkDisplayNameKey,*userDetails); - CleanupStack::PopAndDestroy(3);//userDetails,contactLink,dispName - - } - // contact not found - else - { - TRACE( "publishing null display name"); - iProperty.Set(KConvViewUID,KContactLinkDisplayNameKey,KNullDesC()); - } - } - CleanupStack::PopAndDestroy( &supportedServices ); - } - - if(serId_usrId) - { - CleanupStack::PopAndDestroy( serId_usrId ); - } - iProperty.Subscribe( iStatus ); - SetActive(); - } - -// --------------------------------------------------------- -// CVIMPSTEngineCVListener::RunL() -// --------------------------------------------------------- -// -void CVIMPSTEngineCVListener::DoCancel() - { - TRACER_AUTO; - iProperty.Cancel(); - } - -// --------------------------------------------------------- -// CIMCVEngineStorageListener::StopListening() -// --------------------------------------------------------- -// -TInt CVIMPSTEngineCVListener::RunError( TInt aError ) - { - TRACER_AUTO; - if ( KErrCancel != aError ) - { - iProperty.Subscribe( iStatus ); - SetActive(); - } - return KErrNone; - } -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginefactory.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginefactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,273 +0,0 @@ -/* -* Copyright (c) 2008 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: factory class for Engine component -* -*/ - -// INCLUDE FILES -#include "cvimpstenginefactory.h" - -#include -#include -#include -#include - -#include "cvimpstengineservicetablefetcher.h" -#include "cvimpstengine.h" -#include "cvimpststoragemanagerfactory.h" - -#include -#include - -#include "uiservicetabtracer.h" -#include "cvimpstenginecvlistener.h" - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::InstanceL -// Create an instance of the ximp manager -// behaving as singleton object already created then return same instance. -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTEngineFactory* CVIMPSTEngineFactory::InstanceL() - { - TRACER_AUTO; - CVIMPSTEngineFactory* singleton; - singleton = static_cast (Dll::Tls()); - if( !singleton ) - { - singleton = CVIMPSTEngineFactory::NewLC(); - User::LeaveIfError( Dll::SetTls( static_cast (singleton ) )); - CleanupStack::Pop(singleton); - } - singleton->IncreamentRefereneCount(); - - return (MVIMPSTEngineFactory*)singleton; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::Release -// Release the singelton -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTEngineFactory::Release() - { - TRACER_AUTO; - CVIMPSTEngineFactory* singleton; - singleton = static_cast(Dll::Tls()); - if( singleton && !singleton->DecreamentRefereneCount()) - { - delete singleton; - Dll::SetTls( NULL ) ; - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::NewLC -// Object creation using two phase construction -// ----------------------------------------------------------------------------- -// -CVIMPSTEngineFactory* CVIMPSTEngineFactory::NewLC() - { - CVIMPSTEngineFactory* self = new (ELeave) CVIMPSTEngineFactory(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::ConstructL -// Symbian OS default constructor can leave. -// ----------------------------------------------------------------------------- -// -void CVIMPSTEngineFactory::ConstructL() - { - TRACER_AUTO; - CVIMPSTStorageManagerFactory::InitialiseLibraryL(); - - //only 1 instance of iServiceTableFetcher shared between services - iServiceTableFetcher = CVIMPSTEngineServiceTableFetcher::NewL(); - - RArray serviceIdArray; - CleanupClosePushL( serviceIdArray ); - //Get the available services - iServiceTableFetcher->GetMasterServiceIdsL(serviceIdArray); - - // iterate the service array - for ( TInt index = 0; index < serviceIdArray.Count() ; index++ ) - { - //create seperate engine instance for each service - //and provide the same to the UI - CVIMPSTEngine* item = - CVIMPSTEngine::NewL(serviceIdArray[ index ], - *iServiceTableFetcher); - - iServiceItems.Append(item); - } - - CleanupStack::PopAndDestroy(); //serviceIdArray - - //register for service table notifications - RArray serviceIds; - CleanupClosePushL( serviceIds ); - - iSpNotifyChange = CSPNotifyChange::NewL( *this ); - iSpNotifyChange->NotifyChangeL( serviceIds ); - CleanupStack::PopAndDestroy( &serviceIds ) ; - iCVlistener = CVIMPSTEngineCVListener::NewL( *iServiceTableFetcher ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::IncreamentRefereneCount -// Object creation using two phase construction -// ----------------------------------------------------------------------------- -// -void CVIMPSTEngineFactory::IncreamentRefereneCount() - { - iReferenceCount++; - } -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::DecreamentRefereneCount -// Object creation using two phase construction -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTEngineFactory::DecreamentRefereneCount() - { - iReferenceCount--; - return iReferenceCount; - } -// --------------------------------------------------------- -// CVIMPSTEngineFactory::CVIMPSTEngineFactory -// --------------------------------------------------------- -CVIMPSTEngineFactory::CVIMPSTEngineFactory() - { - - } - -// --------------------------------------------------------- -// CVIMPSTEngineFactory::~CVIMPSTEngineFactory -// --------------------------------------------------------- -CVIMPSTEngineFactory::~CVIMPSTEngineFactory() - { - CVIMPSTStorageManagerFactory::Release(); - - delete iSpNotifyChange; - iSpNotifyChange = NULL; - - delete iServiceTableFetcher; - - //delete all the create engine instances - iServiceItems.ResetAndDestroy(); - iServiceItems.Close(); - delete iCVlistener; - iCVlistener = NULL; - } - -// --------------------------------------------------------- -// CVIMPSTEngineFactory::GetServiceEnginePtr -// --------------------------------------------------------- -void CVIMPSTEngineFactory::GetServiceEnginePtr - (RPointerArray& serviceIdArray) const - { - TRACER_AUTO; - TInt count = iServiceItems.Count() ; - - // iterate the service array - for ( TInt index = 0; index < count ; index++ ) - { - //append the engines created for each service - serviceIdArray.Append(iServiceItems[index]); - } - - } - -// --------------------------------------------------------- -// CVIMPSTEngineFactory::GetServiceEnginePtr -// --------------------------------------------------------- - -TInt CVIMPSTEngineFactory::FindService( - TUint aServiceId ) const - { - TRACER_AUTO; - TInt count = iServiceItems.Count() ; - TInt ret = KErrNotFound; - // iterate the service array - for ( TInt index = 0; index < count ; index++ ) - { - //append the engines created for each service - if(iServiceItems[index]->ServiceId() == aServiceId) - { - ret = index; - break; - } - - } - return ret; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineFactory::HandleNotifyChange() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineFactory::HandleNotifyChange( - TServiceId aServiceId ) - { - TRACER_AUTO; - TRACE( "serviceid: %d", aServiceId ); - - TBool newService = EFalse; - - if ( KErrNotFound == FindService(aServiceId) ) - { - newService = ETrue; - } - - TRAP_IGNORE( iServiceTableFetcher->DoHandleNotifyChangeL( aServiceId, newService, GetEngine(aServiceId) ) ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineFactory::HandleError() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineFactory::HandleError( TInt /*aError*/ ) - { - TRACER_AUTO; - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineFactory::GetEngine() -// --------------------------------------------------------------------------- -// -MVIMPSTEngine* CVIMPSTEngineFactory::GetEngine( TServiceId aServiceId ) - { - TRACER_AUTO; - TInt count = iServiceItems.Count(); - MVIMPSTEngine* engine = NULL; - for(int i=0 ; iServiceId() == aServiceId) - { - engine = iServiceItems[i]; - } - } - return engine; - } - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstengineimsubservice.cpp --- a/uiservicetab/vimpstengine/src/cvimpstengineimsubservice.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,630 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that capsulates single service data members -* -*/ - - -// INCLUDES -#include "cvimpstengineimsubservice.h" - -#include "cvimpstenginecchhandler.h" -#include "cvimpstengineservicetablefetcher.h" -#include "mvimpstengineimsubserviceeventobserver.h" -#include "mvimpstengineserviceconnectioneventobserver.h" - -#include -#include -#include -#include -#include - -#include "tvimpstconsts.h" - -// imcache related headers -#include "cimcachefactory.h" -#include "mimcacheaccessor.h" - -#include "uiservicetabtracer.h" - -//system includes -#include - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngineIMSubService::NewL -// -// --------------------------------------------------------- -CVIMPSTEngineIMSubService* CVIMPSTEngineIMSubService::NewL( - TUint aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver - ) - { - TRACER_AUTO; - TRACE( "ServiceId: %d", aServiceId ); - - CVIMPSTEngineIMSubService* self = CVIMPSTEngineIMSubService::NewLC( - aServiceId, - aCchHandler, - aTableFetcher, - aObserver ); - CleanupStack::Pop( self ); - - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineIMSubService::NewLC -// -// --------------------------------------------------------- - -CVIMPSTEngineIMSubService* CVIMPSTEngineIMSubService::NewLC( - TUint aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver - ) - { - TRACER_AUTO; - TRACE( "ServiceId: %d", aServiceId ); - - CVIMPSTEngineIMSubService* self = new (ELeave) CVIMPSTEngineIMSubService(aServiceId, - aCchHandler, aTableFetcher, - aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineIMSubService::~CVIMPSTEngineIMSubService -// -// --------------------------------------------------------- - -CVIMPSTEngineIMSubService::~CVIMPSTEngineIMSubService() - { - TRACER_AUTO; - - iChatObserver.Reset(); - iChatObserver.Close(); - - iCchHandler.UnRegisterCchObserver(ECCHIMSub); - - ReleaseIMCacheAccessor(); - - } - - -// --------------------------------------------------------- -// CVIMPSTEngineIMSubService::ConstructL -// -// --------------------------------------------------------- - -void CVIMPSTEngineIMSubService::ConstructL() - { - - TRACER_AUTO; - TCCHSubserviceState serviceState = ECCHUninitialized; - TInt error = iCchHandler.GetServiceState( - iServiceId, ECCHIMSub, serviceState ); - - iServiceState = ResolveServiceStateL(serviceState, error); - - iCchHandler.RegisterCchObserverL(this,ECCHIMSub); - - TRACE( "ResolveServiceStateL returned ServiceState: %d", iServiceState ); - - - } - - -// --------------------------------------------------------- -// CVIMPSTEngineIMSubService::CVIMPSTEngine -// -// --------------------------------------------------------- - -CVIMPSTEngineIMSubService::CVIMPSTEngineIMSubService( TUint aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver) : - iServiceId(aServiceId), - iCchHandler(aCchHandler), - iTableFetcher(aTableFetcher), - iObserver(aObserver), - iType (TVIMPSTEnums::EIM) - { - } - - - - - -// --------------------------------------------------------- -// CVIMPSTEngineIMSubService::RegisterChatObserver -// -// --------------------------------------------------------- - -void CVIMPSTEngineIMSubService::RegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver) - { - TRACER_AUTO; - if (aObserver) - { - TInt index = iChatObserver.Find(aObserver); - if( index == KErrNotFound ) - { - iChatObserver.Append( aObserver ); - } - } - - } - -// --------------------------------------------------------- -// CVIMPSTEngineIMSubService::UnRegisterChatObserver -// -// --------------------------------------------------------- - -void CVIMPSTEngineIMSubService::UnRegisterChatObserver(MVIMPSTEngineIMSubServiceEventObserver* aObserver) - { - TRACER_AUTO; - - if (aObserver) - { - - TInt index = iChatObserver.Find(aObserver); - - if( index >=0 ) - { - iChatObserver.Remove( index ); - iChatObserver.Compress(); - } - - - } - - } -//----------------------------------------------------------------------------- -//----------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::HandleIMCacheEventL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- - -void CVIMPSTEngineIMSubService::HandleIMCacheEventL(TIMCacheEventType aEventType, TAny* aChatMessage ) - { - TRACER_AUTO; - TRACE( "TIMCacheEventType: %d", aEventType ); - - switch( aEventType ) - { - case EIMCacheUnreadMessage : - { - if (!aChatMessage) - { - return; - } - SIMCacheMessageData* chatData = static_cast( aChatMessage ) ; - // check that buddy id exists - if ( chatData->iBuddyId ) - { - TPtrC buddyId = chatData->iBuddyId->Des(); - TRACE( "EIMCacheUnreadMessage for %S", &buddyId ); - NotifyObserversL(TVIMPSTEnums::EIMUnreadMessage,buddyId); - } - break; - } - case EIMCacheUnreadChange : - { - TRACE( "EIMCacheUnreadChange"); - if (!aChatMessage) - { - return; - } - SIMCacheChatItem* chatItem = static_cast( aChatMessage ) ; - if( iServiceId != chatItem->iServiceId ) - { - return; - } - TPtrC buddyId = chatItem->iBuddyId->Des(); - TRACE( "EIMCacheChatClosed for %S", &buddyId ); - NotifyObserversL(TVIMPSTEnums::EIMUnreadChange, buddyId ); // ETrue for Closed conversation - break; - } - case EIMCacheChatStarted : - { - if (!aChatMessage) - { - return; - } - SIMCacheChatItem* chatItem = static_cast( aChatMessage ) ; - if( iServiceId != chatItem->iServiceId ) - { - return; - } - TPtrC buddyId = chatItem->iBuddyId->Des(); - TRACE("EIMCacheChatClosed for %S", &buddyId ); - NotifyObserversL(TVIMPSTEnums::EIMChatStarted, buddyId ); // ETrue for Closed conversation - break; - } - case EIMCacheChatClosed: - { - if (!aChatMessage) - { - return; - } - SIMCacheChatItem* chatItem = static_cast( aChatMessage ) ; - if( iServiceId != chatItem->iServiceId ) - { - return; - } - TPtrC buddyId = chatItem->iBuddyId->Des(); - TRACE( "EIMCacheChatClosed for %S", &buddyId ); - NotifyObserversL(TVIMPSTEnums::EIMChatClosed, buddyId ); - break; - } - case EIMCacheAllChatClosed: - { - NotifyObserversL(TVIMPSTEnums::EIMAllChatClosed, KNullDesC ); - break; - } - case EIMCacheRequestCompleted: - { - NotifyObserversL(TVIMPSTEnums::EIMRequestCompleted, KNullDesC ); - break; - } - default: - { - break; - } - } - - - } - -//----------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::GetUnreadCountL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CVIMPSTEngineIMSubService::GetUnreadCountL(const TDesC& aBuddyId ) - { - TRACER_AUTO; - TRACE( " ServiceId: %d BuddyId: %S", iServiceId, &aBuddyId ); - - TInt count = 0; - if( iIMCacheAccessor ) - { - count = iIMCacheAccessor->GetUnreadMessageCountL(aBuddyId); - TRACE( "iIMCacheAccessor returns with %d", count ); - } - - return count; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineIMSubService::SubServiceState -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEngineIMSubService::SubServiceState() const - { - TRACER_AUTO; - TRACE( "ServiceId: %d ServiceState: %d",iServiceId, iServiceState ); - return iServiceState; - } - - - -//----------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::IsConversationExistL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TBool CVIMPSTEngineIMSubService::IsConversationExistL(const TDesC& aBuddyId) const - { - TRACER_AUTO; - TRACE( "Buddy Id : %S", &aBuddyId ); - - TInt exist = EFalse; - - if( iIMCacheAccessor ) - { - exist = iIMCacheAccessor->IsConversationExistL( aBuddyId ); - TRACE( "iIMCacheAccessor returns with %d", exist ); - } - - TRACE( "Exist: %d", exist ); - return exist; - } - -//----------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::CloseConversationL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVIMPSTEngineIMSubService::CloseConversationL( const TDesC& aContactId ) - { - TRACER_AUTO; - TRACE( "Buddy Id : %S", &aContactId ); - - if( IsConversationExistL(aContactId) ) - { - TRACE( "iIMCacheAccessor CloseConversationL to be called" ); - iIMCacheAccessor->CloseConversationL( aContactId ); - TRACE( "iIMCacheAccessor CloseConversationL Done" ); - } - - } -//----------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::GetOpenChatListL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -RArray CVIMPSTEngineIMSubService::GetOpenChatListL() - { - TRACER_AUTO; - RArray item; - if(iIMCacheAccessor) - { - item = iIMCacheAccessor->GetChatListL( iServiceId ); - } - return item; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::ResolveServiceStateL -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEngineIMSubService::ResolveServiceStateL( - TCCHSubserviceState aState, - TInt aServiceError ) - { - TRACER_AUTO; - - TVIMPSTEnums::TVIMPSTRegistrationState state = TVIMPSTEnums::ESVCENotRegistered; - - - TRACE( "iServiceId: %d, ServiceState: %d", iServiceId, aState ); - - TBool handleServiceStates = ETrue; - if ( aServiceError && ECCHDisabled != aState ) - { - //Only if the Service supports ALR, the state can goto WaitingForNetwork - //Still API from CCH is required to know whether ALR is supported or not - if ( (KCCHErrorInvalidSettings != aServiceError) && (ECCHConnecting == aState) ) - { - TRACE("ESVCEWaitingForNetwork" ); - handleServiceStates = EFalse; - state = TVIMPSTEnums::ESVCEWaitingForNetwork; - } - } - - if ( handleServiceStates ) - { - switch ( aState ) - { - case ECCHEnabled: - { - TRACE( "ESVCERegistered" ); - CreateIMCacheAccessorL(); - state = TVIMPSTEnums::ESVCERegistered; - } - break; - - case ECCHDisconnecting: - { - TRACE( "ESVCENetworkDisConnecting" ); - state = TVIMPSTEnums::ESVCENetworkDisConnecting; - } - break; - - case ECCHUninitialized: - case ECCHDisabled: - { - TRACE( "ESVCENotRegistered" ); - ReleaseIMCacheAccessor(); - state = TVIMPSTEnums::ESVCENotRegistered; - } - break; - - case ECCHConnecting: - { - TRACE( "ESVCENetworkConnecting" ); - state = TVIMPSTEnums::ESVCENetworkConnecting; - } - break; - - default: - break; - } - } - - - return state; - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::Type -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::SubServiceType CVIMPSTEngineIMSubService::Type() const - { - TRACER_AUTO; - TRACE("SubServiceType() Type : %d", iType ); - TRACE("CVIMPSTEngineIMSubService: [0x%x]", this ); - return iType; - } - - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::CchEventOccuredL -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineIMSubService::CchEventOccuredL( - TUint /*aServiceId*/, - TCCHSubserviceState aState, - TInt aServiceError ) - { - TRACER_AUTO; - TRACE( "TCCHSubserviceState : %d, ServiceErr: %d", aState, aServiceError ); - - if ( aServiceError && ECCHDisabled != aState ) - { - //we might even end up in waiting for connection state for all - //those service which are ALR enabled - //So better check here if you get any CCH errors - iServiceState = ResolveServiceStateL( aState, aServiceError ); - iObserver.HandleServceConnectionEventL(); - DoHandleCchErrorL( aServiceError ); - } - else - { - iServiceState = ResolveServiceStateL( aState, aServiceError ); - iObserver.HandleServceConnectionEventL(); - } - - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::DoHandleCchErrorL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineIMSubService::DoHandleCchErrorL( - TInt aServiceError ) - { - TRACER_AUTO; - TRACE( "ServiceErr: %d", aServiceError ); - - switch ( aServiceError ) - { - case KCCHErrorNetworkLost: - case KCCHErrorBandwidthInsufficient: - case KCCHErrorInvalidIap: - { - //Should be fwded to CCHUI to show the appropriate Notes - //TBD - } - break; - - case KCCHErrorAuthenticationFailed: - { - //Should be fwded to CCHUI to show the appropriate Notes - //TBD - } - break; - - case KCCHErrorLoginFailed: - case KCCHErrorServiceNotResponding: - { - //Should be fwded to CCHUI to show the appropriate Notes - //TBD - } - break; - - case KCCHErrorInvalidSettings: - { - //Should be fwded to CCHUI to show the appropriate Notes - //TBD - } - break; - - case KCCHErrorAccessPointNotDefined: - { - //Should be fwded to CCHUI to show the appropriate Notes - //TBD - } - break; - - default: - { - //Should be fwded to CCHUI to show the appropriate Notes - //TBD - } - break; - } - - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::CreateIMCacheAccessorL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineIMSubService::CreateIMCacheAccessorL() - { - TRACER_AUTO; - if (!iIMCacheFactory) - { - HBufC* ownData = iCchHandler.GetConParametersL(ECchUsername);// - CleanupStack::PushL(ownData); - TPtr ownDataPtr = ownData->Des(); - TRACE( "ServiceErr: %S",&ownDataPtr ); - // im cache factory - iIMCacheFactory = CIMCacheFactory::InstanceL(); - - // im cache update interface - if (!iIMCacheAccessor) - { - iIMCacheAccessor = iIMCacheFactory->CreateAccessorL(iServiceId, *ownData ); - - iIMCacheAccessor->RegisterObserverL(*this); - } - - CleanupStack::PopAndDestroy(ownData); - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::ReleaseIMCacheAccessor() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineIMSubService::ReleaseIMCacheAccessor() - { - TRACER_AUTO; - - if( iIMCacheAccessor ) - { - iIMCacheAccessor->UnRegisterObserver(*this); - } - - if( iIMCacheFactory ) - { - CIMCacheFactory::Release(); - iIMCacheAccessor = NULL; - iIMCacheFactory = NULL; - } - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineIMSubService::NotifyObserversL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineIMSubService::NotifyObserversL( TVIMPSTEnums::TIMEventType aEventType ,const TDesC& aBuddyId ) - { - TRACER_AUTO; - TInt count = iChatObserver.Count(); - for (TInt index=0; indexHandleChatMessageEventL(aEventType ,aBuddyId ); - } - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginepresencesubservice.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginepresencesubservice.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1692 +0,0 @@ -/* -* Copyright (c) 2007 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: Handles the use of Precense Framework - * -*/ - - -// INCLUDE FILES -/*#include */ -#include -#include -#include -#include //for MXIMPIdentity -#include -#include //for MximpPresenceWatching -#include //Presence info test -#include -#include -#include -#include -#include // Grant request list -#include -#include -#include -#include -#include - - -#include -#include //info filtter -#include //MximpPresenceInfoField -#include //MximpPresenceInfoFieldCollection -#include //MximpPresenceInfoFieldValueText -#include -#include // MximpPersonPresenceInfo -#include //MximpPresencePublishing -#include //ximp errors -#include -//presence cache headers -#include // cache reader - - -#include "cvimpstenginepresencesubservice.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststoragecontact.h" -#include "mvimpststoragecontactlist.h" -#include "cvimpstenginerequestmapper.h" -#include "cvimpstenginecchhandler.h" -#include "mvimpststorageserviceview.h" -#include "tvimpstconsts.h" -#include "cvimpstengineservicetablefetcher.h" -#include "cvimpstenginecchhandler.h" -#include "cvimpstenginesessioncntxtobserver.h" -#include "vimpstutilsnotemapper.h" -#include "vimpstallerrors.h" -#include "cvimpstenginerequest.h" -#include "cvimpstblockedlistmanager.h" -#include "mvimpstengineblockedlistfetcheventobserver.h" - -#include -#include - -//Presence Observer -#include "mvimpstenginepresencesubserviceeventobserver.h" -#include "uiservicetabtracer.h" -#include "vimpstcustomcleanupapi.h" //For customized cleanup function -#include "mvimpstengineserviceconnectioneventobserver.h" - -// CONTANTS -const TInt KUriMaxLength = 255; -_LIT( KListNameAllBuddy ,"buddylist" ); -const TInt KCollationLevel = 1; - -// Compares alphabetically using MVIMPSTStorageContact::Identification and -// TDesC::CompareC -TInt CompareAlphabetically( const TPtrC& aFirst, - const TPtrC& aSecond ) - { - return aFirst.CompareC( aSecond, KCollationLevel, NULL ); - } - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService:: -// CVIMPSTEnginePresenceSubService() -// --------------------------------------------------------------------------- -// -CVIMPSTEnginePresenceSubService::CVIMPSTEnginePresenceSubService( TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - CVIMPSTEngineSessionCntxtObserver& aXimpEventObserver, - MVIMPSTEngineServiceConnectionEventObserver& aObserver ) -:iServiceId( aServiceId ), -iCchHandler(aCchHandler), -iSettingsTableFetcher(aTableFetcher), -iXimpEventObserver(aXimpEventObserver), - iObserver(aObserver), - iChangeStatusSupported ( ETrue ), - iChangeStatusMsgSupported( ETrue ), - iAvatarSupported( EFalse ), - iIsClearingAvatar(EFalse) - { - TRACER_AUTO; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::ConstructL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::ConstructL() - { - TRACER_AUTO; - - iCchHandler.RegisterCchObserverL(this,ECCHPresenceSub); - - TCCHSubserviceState serviceState = ECCHUninitialized; - TInt error = iCchHandler.GetServiceState( - iServiceId, ECCHPresenceSub, serviceState ); - - iServiceState = ResolveServiceStateL(serviceState, error); - //initialize the presence cache. - iPresenceCacheReader = MPresenceCacheReader2::CreateReaderL(); - - iPresenceCacheReader->SetObserverForSubscribedNotifications(this); - iServiceName = HBufC::NewL( KVIMPSTUISPSMaxPropertyLength ); - TPtr serviceNamePtr( iServiceName->Des() ); - iSettingsTableFetcher.GetServiceNameL(iServiceId, serviceNamePtr); - iBlockedListMgr = CVIMPSTBlockedListManager::NewL(); - iBlockListFetchReqPending = EFalse; //req of fetching blocked list has been completed. - - iLogoutRequest = EFalse; - iSubscribeToAuthList = EFalse; - iAutoAccept = EFalse; - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::NewL() -// --------------------------------------------------------------------------- -// -CVIMPSTEnginePresenceSubService* -CVIMPSTEnginePresenceSubService::NewL( TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - CVIMPSTEngineSessionCntxtObserver& aXimpEventObserver, - MVIMPSTEngineServiceConnectionEventObserver& aObserver ) - { - TRACER_AUTO; - CVIMPSTEnginePresenceSubService* self = NewLC( aServiceId,aCchHandler, aTableFetcher, - aXimpEventObserver,aObserver ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::NewLC() -// --------------------------------------------------------------------------- -// -CVIMPSTEnginePresenceSubService* -CVIMPSTEnginePresenceSubService::NewLC( TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - CVIMPSTEngineSessionCntxtObserver& aXimpEventObserver, - MVIMPSTEngineServiceConnectionEventObserver& aObserver ) - { - TRACER_AUTO; - CVIMPSTEnginePresenceSubService* self = - new (ELeave) CVIMPSTEnginePresenceSubService( aServiceId,aCchHandler, aTableFetcher, aXimpEventObserver,aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService:: -// ~CVIMPSTEnginePresenceSubService() -// --------------------------------------------------------------------------- -// -CVIMPSTEnginePresenceSubService::~CVIMPSTEnginePresenceSubService() - { - TRACER_AUTO; - - iCchHandler.UnRegisterCchObserver(ECCHPresenceSub); - - delete iServiceName; - delete iPresenceCacheReader ; - - delete iBlockedListMgr; - iBlockedListMgr = NULL; - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService:: -// ServiceState() -// --------------------------------------------------------------------------- -// - -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEnginePresenceSubService::SubServiceState() const - { - TRACER_AUTO; - return iServiceState; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService:: -// Type() -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::SubServiceType CVIMPSTEnginePresenceSubService::Type() const - { - TRACER_AUTO; - TRACE( "CVIMPSTEnginePresenceSubService: [0x%x]", this ); - return TVIMPSTEnums::EPresence; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService:: -// Enabled() -// --------------------------------------------------------------------------- -// - -TBool CVIMPSTEnginePresenceSubService::Enabled() - { - TRACER_AUTO; - TBool ret = EFalse; - if( TVIMPSTEnums::ESVCERegistered == iServiceState) - { - ret = ETrue; - } - return ret; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::RetrieveSubscribedListL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::RetrieveSubscribedListL() - { - TRACER_AUTO; - - //Create group id - TBuf buffer( KListNameAllBuddy ); - MXIMPIdentity* groupList = iXimpEventObserver.XimpPresenceContextL().ObjectFactory().NewIdentityLC(); - __ASSERT_ALWAYS( groupList , User::Leave( KErrNoMemory ) ); - groupList->SetIdentityL( buffer ); - iIsFetchingContact = ETrue; - //Subscribe buddy list - // do get subscribe list")); - TXIMPRequestId operationId = TXIMPRequestId::Null(); - operationId = iXimpEventObserver.XimpPresentityGroupsL().SubscribePresentityGroupContentL( - *groupList ); - CVIMPSTEngineRequestMapper* requestMapper =iXimpEventObserver.GetRequestMapper(); - requestMapper->CreateRequestL(operationId,EFalse,EVIMPSTXimpOperationGetSubscribedList); - CleanupStack::PopAndDestroy(); // groupList - // list retrieving ok. Waiting for list.; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::SubscribePresenceOfSingleContactL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::SubscribePresenceOfSingleContactL( const TDesC& aUriOfTheContact) - { - TRACER_AUTO; - __ASSERT_ALWAYS( aUriOfTheContact.Length(), User::Leave( KErrArgument ) ); - //if anything is there with colon eg sip:user@presence1. strip the part before : - TInt len = aUriOfTheContact.Find(_L(":")); - TPtrC buddyId = aUriOfTheContact.Right( aUriOfTheContact.Length() - len - KColon().Length()); - HBufC* name = HBufC::NewLC( KPropertyMaxLength ); - TPtr namePtr( name->Des() ); - namePtr.Zero(); - - // append the service name followed by user id ,seperated by colon - namePtr.Append(*iServiceName); - namePtr.Append(KColon); - namePtr.Append(buddyId); - - TRACE("SubscribeToPresenceCacheL: %S", &namePtr ); - iPresenceCacheReader->SubscribePresenceBuddyChangeL(*name); - CleanupStack::PopAndDestroy(name); // name - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService:: -// UnsubscribePrecenseOfSingleContactL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::UnSubscribePresenceOfSingleContactL( - const TDesC& aUriOfTheContact ) - { - TRACER_AUTO; - HBufC* name = HBufC::NewLC( KPropertyMaxLength ); - TPtr namePtr( name->Des() ); - namePtr.Zero(); - // append the service name followed by user id ,seperated by colon - namePtr.Append(*iServiceName); - namePtr.Append(KColon); - namePtr.Append(aUriOfTheContact); - - TRACE( "UnSubscribeToPresenceCacheL: %S", &namePtr); - iPresenceCacheReader->UnSubscribePresenceBuddyChangeL(*name); - CleanupStack::PopAndDestroy(name); // name - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService:: -// DoHandlePresentityGroupContentEventL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService:: -DoHandlePresentityGroupContentEventL( - const MXIMPContext& /*aContext*/, - const MXIMPBase& aEvent ) - { - TRACER_AUTO; - - const MPresentityGroupContentEvent& event = - *TXIMPGetInterface< const MPresentityGroupContentEvent >::From( - aEvent, - MXIMPBase::EPanicIfUnknown ); - //this needs to be checked if server contacts is supported only then update to - //store else don't. - TInt supportedFeatures = iXimpEventObserver.GetSupportedFeatures(); - if(EVIMPSTFeatureFetch & supportedFeatures) - { - TRACE(" -> storing into respective service store" ); - StoreToVirtualStoreL( event ); - } - //this is to ensure the presence for the local sotre contacts is not lost. - TRACE( "new member count: %d" , event.NewMembersCount() ); - TRACE( " current member count: %d" , event.CurrentMembersCount() ); - TRACE( "disappeared member count: %d" , event.DisappearedMembersCount() ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService:: -// DoHandlePresenceGrantRequestListEventL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService:: -DoHandlePresenceGrantRequestListEventL( - const MXIMPContext& /*aContext*/, - const MXIMPBase& aEvent ) - { - TRACER_AUTO; - TVIMPSTEnums::TVIMPSTPresenceRequestStatus autoAccept = iSettingsTableFetcher.PresenceRequestStatusL(iServiceId); - if(autoAccept == TVIMPSTEnums::ESVCEPresenceRequestStatusAutoAccept) - { - iAutoAccept = ETrue; - } - else - { - iAutoAccept = EFalse; - } - - const MPresenceGrantRequestListEvent& event = - *TXIMPGetInterface::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - - TRACE("new watcher count: %d" , event.NewRequestsCount() ); - TRACE("current watcher count: %d" , event.CurrentRequestsCount() ); - HBufC* identbuf(NULL); - HBufC* displayName(NULL); - TInt newcount = event.NewRequestsCount(); - TInt currentcount = event.CurrentRequestsCount(); - if(newcount) - { - TRACE( " newcount =%d" , newcount ); - TRACE( "iServiceState =%d" , iServiceState ); - - for(TInt i=0; iDes(); - TRACE( "identity: %S" , &identbufPtr ); - if(identbuf->Length()) - { - TRACE( " pass to command process" ); - if( iAutoAccept && - TVIMPSTEnums::ESVCERegistered == iServiceState) - { - TInt error = SendPresenceGrantPresentityL( identbufPtr, ETrue ); - } - else if( iSubServiceObserver ) - { - TRACE( " informed observer." ); - iSubServiceObserver->HandleAddRequestEventL( TVIMPSTEnums::EAddItem , *identbuf, *displayName); - } - TRACE( " pass to command process" ); - } - CleanupStack::PopAndDestroy( displayName ); - CleanupStack::PopAndDestroy( identbuf ); - } - } - else if(currentcount) - { - const MPresenceGrantRequestInfo& reqInfo = event.CurrentRequest(0 );// its always a new request - identbuf = reqInfo.RequestorId().Identity().AllocLC(); - displayName = reqInfo.RequestorDisplayName().AllocLC(); - TPtr identbufPtr = identbuf->Des(); - TRACE( "identity: %S" , &identbufPtr ); - if(identbuf->Length()) - { - TRACE( " pass to command process" ); - if( iAutoAccept) - { - TInt error = SendPresenceGrantPresentityL( identbufPtr, ETrue ); - } - else if( iSubServiceObserver ) - { - TRACE( " informed observer."); - iSubServiceObserver->HandleAddRequestEventL(TVIMPSTEnums::EAddItem ,*identbuf, *displayName); - } - TRACE( "pass to command process" ); - } - CleanupStack::PopAndDestroy( displayName ); - CleanupStack::PopAndDestroy ( identbuf ); - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::ResolveServiceStateL -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEnginePresenceSubService::ResolveServiceStateL( - TCCHSubserviceState aState, - TInt aServiceError ) - { - - TRACER_AUTO; - - TVIMPSTEnums::TVIMPSTRegistrationState state = TVIMPSTEnums::ESVCENotRegistered; - - - TRACE( " iServiceId: %d, ServiceState: %d", iServiceId, aState ); - - TBool handleServiceStates = ETrue; - if ( aServiceError && ECCHDisabled != aState ) - { - //Only if the Service supports ALR, the state can goto WaitingForNetwork - //Still API from CCH is required to know whether ALR is supported or not - //Not sure whether the below is right - have mailed to Markus for MoreInfo on this state - if ( (KCCHErrorInvalidSettings != aServiceError) && (ECCHConnecting == aState) ) - { - TRACE( " ESVCEWaitingForNetwork"); - handleServiceStates = EFalse; - //state = TVIMPSTEnums::ESVCEWaitingForNetwork; - state = TVIMPSTEnums::ESVCENotRegistered; - } - } - - if ( handleServiceStates ) - { - switch ( aState ) - { - case ECCHEnabled: - { - TRACE( "ESVCERegistered" ); - state = TVIMPSTEnums::ESVCEUpdatingContacts; - break; - } - case ECCHDisconnecting: - { - TRACE( " ESVCERegistered" ); - state = TVIMPSTEnums::ESVCENetworkDisConnecting; - } - break; - - case ECCHUninitialized: - case ECCHDisabled: - { - TRACE( "ESVCENotRegistered"); - state = TVIMPSTEnums::ESVCENotRegistered; - } - break; - - case ECCHConnecting: - { - TRACE( " ESVCENoNetworkConnecting"); - state = TVIMPSTEnums::ESVCENetworkConnecting; - } - break; - - default: - break; - } - } - - - return state; - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::CchEventOccuredL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::CchEventOccuredL( - TUint /*aServiceId*/, - TCCHSubserviceState aState, - TInt aServiceError ) - { - - TRACER_AUTO; - - TRACE("TCCHSubserviceState : %d, ServiceErr: %d", aState, aServiceError ); - - if ( aServiceError && ECCHDisabled != aState ) - { - //we might even end up in waiting for connection state for all - //those service which are ALR enabled - //So better check here if you get any CCH errors= - iServiceState = ResolveServiceStateL( aState, aServiceError ); - iObserver.HandleServceConnectionEventL(); - DoHandleCchErrorL( aServiceError ); - } - else - { - TVIMPSTEnums::TVIMPSTRegistrationState currentState = - ResolveServiceStateL( aState, aServiceError ); - - if ( TVIMPSTEnums::ESVCERegistered == iServiceState - && TVIMPSTEnums::ESVCEUpdatingContacts == currentState ) - { - //dont do anything - //updating contacts is a special case - //Once updating contacts, we fetch the groups and once this is done - //we end up changing the state to registered - //but CCH might send the same callback twice - //to handle this situation we add a check here - //because we might have already moved from Updatin to Registered state - } - else - { - iServiceState = ResolveServiceStateL( aState, aServiceError ); - iObserver.HandleServceConnectionEventL(); } - } - - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::DoHandleCchErrorL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::DoHandleCchErrorL( - TInt aServiceError ) - { - - TRACER_AUTO; - TRACE( "ServiceErr: %d", aServiceError ); - - if ( aServiceError ) - { - //unsubscribe can only be done, when bind is already done - if(TVIMPSTEnums::EVIMPSTBindDone ==iXimpEventObserver.ContextBindStatus()) - { - TRACE( "unscribe and unbind"); - TRAP_IGNORE( UnsubscribeListsL() ); - iXimpEventObserver.ServerUnBindL( ETrue ); - } - } - - - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::PublishOwnPresenceL -// -// --------------------------------------------------------- -TInt CVIMPSTEnginePresenceSubService::PublishOwnPresenceL(TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aValue, - const TDesC& aFilename /*= KNullDesC*/, - const TDesC8& aMimetype /*= KNullDesC8*/, - TBool aIsAvatar /*= EFalse*/ ) - { - TRACER_AUTO; - // Take handles to object factory and publish interface - MPresencePublishing& publisher = iXimpEventObserver.XimpPresencePublishingL(); - - //Fill presence doc with presence components and attributes - MPresenceInfo* myPresence = iXimpEventObserver.PresenceObjectFactoryL().NewPresenceInfoLC();//1 - MPersonPresenceInfo *personPresence = iXimpEventObserver.PresenceObjectFactoryL().NewPersonPresenceInfoLC();//2 - MPresenceInfoFieldCollection& attributeFields = personPresence->Fields(); - - MPresenceInfoField* infoField = NULL; - TRACE( "aIsAvatar: %d", aIsAvatar ); - // avatar field set || clear - if ( aIsAvatar ) - { - TRACE( " PublishOwnPresenceL adding avatar field"); - - infoField = iXimpEventObserver.PresenceObjectFactoryL().NewInfoFieldLC(); - MPresenceInfoFieldValueBinary* avatarField = iXimpEventObserver.PresenceObjectFactoryL().NewBinaryInfoFieldLC(); - TRACE( " PublishOwnPresenceL processing image data"); - CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL(); - CleanupStack::PushL(imageHandler); - // get the avatar content from the image processor - // returns image content if the processing succesful - - HBufC8* avatarContent = imageHandler->ProcessImageFromFileL( aFilename , aMimetype); - TRACE( " PublishOwnPresenceL processing image data completed "); - if ( avatarContent ) - { - TRACE( "PublishOwnPresenceL valid image data found "); - CleanupStack::PushL(avatarContent); - // set a new avatar - avatarField->SetBinaryValueL(*avatarContent); - avatarField->SetMimeTypeL(aMimetype); - CleanupStack::PopAndDestroy(); // avatarContent - } - else - { - TRACE("PublishOwnPresenceL NULL image data found "); - // clear the avatar - avatarField->SetBinaryValueL(KNullDesC8); - iIsClearingAvatar = ETrue; //set iIsClearingAvatar to ETrue - } - CleanupStack::PopAndDestroy(imageHandler); // imageHandler - - //Fill presence doc with presence components and attributes - infoField->SetFieldTypeL( NPresenceInfo::NFieldType::KAvatar ); - // for clear avatar mimetye is KNUllDesc so set for all the cases - infoField->SetFieldValue( avatarField ); // avatarField ownership transfered - CleanupStack::Pop(); // avatarField - attributeFields.AddOrReplaceFieldL(infoField ); // infofield ownership transfered - CleanupStack::Pop(); // infoField - infoField = NULL; - TRACE( "adding avatar field completed "); - } - - // availabilty field - infoField = iXimpEventObserver.PresenceObjectFactoryL().NewInfoFieldLC();//3 - //based on the state conver it to ximpfw status. - NPresenceInfo::TAvailabilityValues availablity = ConvertPresenceStatus( aStatus ); - // "availability" attribute - MPresenceInfoFieldValueEnum* availabilityField = iXimpEventObserver.PresenceObjectFactoryL().NewEnumInfoFieldLC();//4 - availabilityField->SetValueL( availablity ); - infoField->SetFieldTypeL( NPresenceInfo::NFieldType::KAvailabilityEnum ); - infoField->SetFieldValue( availabilityField ); - CleanupStack::Pop(); // availabilityField - attributeFields.AddOrReplaceFieldL(infoField ); - CleanupStack::Pop(); // infoField - - //status text field - infoField = iXimpEventObserver.PresenceObjectFactoryL().NewInfoFieldLC();//7 - MPresenceInfoFieldValueText* statustextField = iXimpEventObserver.PresenceObjectFactoryL().NewTextInfoFieldLC();//8 - //ownership is transfered to statustextField - HBufC* statusText = aValue.AllocLC(); - //ownership is not transferred - statustextField->SetTextValueL( *statusText); // some status text - CleanupStack::PopAndDestroy();//statusText - infoField->SetFieldTypeL( NPresenceInfo::NFieldType::KStatusMessage ); - infoField->SetFieldValue( statustextField ); - CleanupStack::Pop(); // statustextField - attributeFields.AddOrReplaceFieldL( infoField ); - CleanupStack::Pop(); // infoField - - - myPresence->SetPersonPresenceL(personPresence); - CleanupStack::Pop(); // personPresence - - TXIMPRequestId reqId; - reqId = publisher.PublishOwnPresenceL( *myPresence ); - // wait completion - // not own - CVIMPSTEngineRequestMapper* mapper = iXimpEventObserver.GetRequestMapper(); - mapper->CreateRequestL(reqId, ETrue,EVIMPSTXimpOperationPublisOwnPresence);// waite here - TInt error = iXimpEventObserver.GetCompletedReqResult(); // get the result error - CleanupStack::PopAndDestroy(1); // myPresence - - return error; - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::UpdateStatusToServerL -// -// --------------------------------------------------------- -NPresenceInfo::TAvailabilityValues CVIMPSTEnginePresenceSubService::ConvertPresenceStatus(TVIMPSTEnums::TOnlineStatus aStatus) - { - TRACER_AUTO; - NPresenceInfo::TAvailabilityValues availablity; - switch(aStatus) - { - case TVIMPSTEnums::EOffline: - { - availablity = NPresenceInfo::ENotAvailable; - break; - } - case TVIMPSTEnums::EOnline: - { - availablity = NPresenceInfo::EAvailable; - break; - } - case TVIMPSTEnums::EInvisible: - { - availablity = NPresenceInfo::EHidden; - break; - } - case TVIMPSTEnums::EAway: - { - availablity = NPresenceInfo::EAway; - break; - } - case TVIMPSTEnums::EBusy: - { - availablity = NPresenceInfo::EBusy; - break; - } - case TVIMPSTEnums::EOnPhone: - { - availablity = NPresenceInfo::EOnPhone; - break; - } - case TVIMPSTEnums::EDoNotDisturb: - { - availablity = NPresenceInfo::EDoNotDisturb; - break; - } - default: - { - availablity = NPresenceInfo::ENotAvailable; - break; - } - } - return availablity; - } -/// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::FetchPresenceFromCache -// -// --------------------------------------------------------- -TInt CVIMPSTEnginePresenceSubService::FetchPresenceFromCache() - { - //TODO::Figure out how to get the service name. - // passed the service id to see the member count - TInt error( KErrArgument ); - TRACER_AUTO; - if( iServiceName ) - { - TPtr serviceNamePtr = iServiceName->Des(); - TRACE( "CVIMPSTEnginePresenceSubService::FetchPresenceFormCache() - %S", &serviceNamePtr ); - // passed the service to register for notification - error = iPresenceCacheReader->AllBuddiesPresenceInService(*iServiceName, this ); - } - return error; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::HandlePresenceReadL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::HandlePresenceReadL(TInt /*aErrorCode*/, - RPointerArray& aPresenceBuddyInfoList) - { - TRACER_AUTO; - // we have the ownership of aPresenceBuddyInfoList : Push it to customize cleanupstack - // aPresenceBuddyInfoList is collection of owned object and each object need to be deleted - CustomCleanupResetAndDestroyPushL(aPresenceBuddyInfoList); - MVIMPSTStorageServiceView* storage = - CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - TInt buddyCount = aPresenceBuddyInfoList.Count(); - TRACE( "count: %d" , buddyCount ); - for ( TInt i =0 ; i < buddyCount ; ++i) - { - TRACE( " buddy index: %d" , i ); - MPresenceBuddyInfo2* buddyinfo = aPresenceBuddyInfoList[i]; - // read the buddyID : returns in XSP format - TPtrC buddyXSPId = buddyinfo->BuddyId(); - TRACE( "Status Message: %s" , &buddyXSPId ); - TPtrC buddyId = buddyXSPId.Right( buddyXSPId.Length() - iServiceName->Length() - KColon().Length()); - // read the availability /presence state enum value - MPresenceBuddyInfo2::TAvailabilityValues availabilityEnum = buddyinfo->Availability(); - TRACE( "Availability ENUM value: %d" , availabilityEnum ); - TPtrC avablityText = buddyinfo->AvailabilityText(); - // convert the presence cache enum value to service tab enum - TVIMPSTEnums::TOnlineStatus status = ConvertPresenceCacheEnums( availabilityEnum , avablityText); - // get the GetAnyFiled(which has only pending and blocked states.) - if(TVIMPSTEnums::EUnKnown == status) - { - GetKeyFieldsAndValuesL(*buddyinfo,status); - } - // read the status message - TPtrC statusMsg = buddyinfo->StatusMessage(); - TRACE("Status Message: %s" , &statusMsg ); - TPtrC8 avatarContent = buddyinfo->Avatar(); - HBufC8* avatarScaledData = NULL; - if ( avatarContent.Length() ) - { - TRACE( "avatarContent Content available" ); - CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL(); - CleanupStack::PushL(imageHandler); - TRACE( "imageHandler created " ); - avatarScaledData = imageHandler->ProcessImageFromDataL( avatarContent , KNullDesC8() ); - TRACE( "ProcessImageFromDataL returned " ); - CleanupStack::PopAndDestroy();//imageHandler - } - if( avatarScaledData && avatarScaledData->Length() ) - { - CleanupStack::PushL(avatarScaledData); - storage->UpdatePresenceL(buddyId,status,statusMsg, *avatarScaledData ); - CleanupStack::PopAndDestroy();//avatarScaledData - } - else - { - storage->UpdatePresenceL(buddyId, status, statusMsg, KNullDesC8 ); - } - } - aPresenceBuddyInfoList.ResetAndDestroy(); - - CleanupStack::PopAndDestroy(); // aPresenceBuddyInfoList - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::HandlePresenceNotificationL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::HandlePresenceNotificationL(TInt /*aErrorCode*/, - MPresenceBuddyInfo2* aPresenceBuddyInfo) - { - TRACER_AUTO; - - if ( aPresenceBuddyInfo ) - { - CleanupDeletePushL( aPresenceBuddyInfo ); - DoHandlePresenceNotificationL(*aPresenceBuddyInfo); - CleanupStack::PopAndDestroy(1); // aPresenceBuddyInfo - - } - } - - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::SubscribeForAuthorizationL -// -// --------------------------------------------------------- -void CVIMPSTEnginePresenceSubService::SubscribeForAuthorizationL() - { - TRACER_AUTO; - TXIMPRequestId req; - MPresenceAuthorization& authorization = iXimpEventObserver.XimpAuthorizationL(); - req = authorization.SubscribePresenceGrantRequestListL(); - // mapper is not own - CVIMPSTEngineRequestMapper* mapper = iXimpEventObserver.GetRequestMapper(); - mapper->CreateRequestL(req, EFalse,EVIMPSTXimpOperationSubcribeGrantRequestList); - - iSubscribeToAuthList = ETrue; - } -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::SendPresenceGrantPresentityResponseL -// -// --------------------------------------------------------- -TInt CVIMPSTEnginePresenceSubService::SendPresenceGrantPresentityL( const TDesC& aContactId , TBool aResponse ) - { - TRACER_AUTO; - __ASSERT_ALWAYS( aContactId.Length(), User::Leave( KErrArgument ) ); - - // return the response to the server. - MPresenceAuthorization& authorization = iXimpEventObserver.XimpAuthorizationL(); - // mapper is not own - CVIMPSTEngineRequestMapper* mapper = iXimpEventObserver.GetRequestMapper(); - - MXIMPIdentity* contactIdentity = iXimpEventObserver.XimpPresenceContextL().ObjectFactory().NewIdentityLC(); - __ASSERT_ALWAYS( contactIdentity , User::Leave( KErrNoMemory ) ); - contactIdentity->SetIdentityL( aContactId ) ; - TXIMPRequestId req; - //accepted the request. - if(aResponse) - { - MPresenceInfoFilter* infoFilt = iXimpEventObserver.PresenceObjectFactoryL().NewPresenceInfoFilterLC(); - if( infoFilt ) - { - infoFilt->AcceptPersonFilterL( NPresenceInfo::NFieldType::KAcceptAll ); - req = authorization.GrantPresenceForPresentityL(*contactIdentity ,*infoFilt ); - CleanupStack::PopAndDestroy(); //infoFilt - } - } - else// rejected the request. - { - req = authorization.WithdrawPresenceGrantFromPresentityL(*contactIdentity); - } - if( iSubServiceObserver && !iAutoAccept ) - { - iSubServiceObserver->HandleAddRequestEventL(TVIMPSTEnums::ERemoveItem ,aContactId, KNullDesC() ); - } - mapper->CreateRequestL(req, !iAutoAccept, EVIMPSTXimpOperationGrantPresenceForPresentity ); - - TInt error = iXimpEventObserver.GetCompletedReqResult(); // get the result error - if( ( ( error == KPREQUESTERRSUCCESSFUL) || ( error == KErrNone ) || iAutoAccept) ) - { - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId) ; - if(storage && ( !storage->IsLocalStore() || iAutoAccept ) && aResponse ) - { - TRACE( " server store" ); - storage->CreateNewContactL( aContactId,KNullDesC, ETrue, iAutoAccept ); // ETrue is for invitation item - } - } - CleanupStack::PopAndDestroy(); //contactIdentity - return error; - } -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::HandleSessionContextEventL -// --------------------------------------------------------- -void CVIMPSTEnginePresenceSubService::HandleSessionContextEventL(const MXIMPContext& aContext, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation /*= EVIMPSTXimpOperationNoOperation*/ ) - { - TRACER_AUTO; - TInt32 eventId = aEvent.GetInterfaceId(); - - switch( aEvent.GetInterfaceId() ) - { - case MXIMPRequestCompleteEvent::KInterfaceId: - { - TRACE( "MXIMPRequestCompleteEvent"); - //temp fix TBD - //Only use the operations that u r intertest in - if ( aXimpOperation <= EVIMPSTXimpOperationUnsubscribe ) - { - - const MXIMPRequestCompleteEvent* event = - TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - TRAP_IGNORE( HandleXimpRequestCompleteL( - aXimpOperation, - event->CompletionResult().ResultCode(), - aEvent ) ); - } - TRACE( "HandlePresenceContextEvent"); - - break; - } - case MXIMPContextStateEvent::KInterfaceId: - { - TRACE( "InsideCallbackswitch::MXIMPContextStateEvent"); - TRACE("InsideCallback::MXIMPContextStateEvent"); - break; - } - case MPresentityGroupContentEvent::KInterfaceId: - { - TRACE( "MPresentityGroupContentEvent"); - DoHandlePresentityGroupContentEventL( aContext, aEvent ); - TRACE( "MPresentityGroupContentEvent"); - break; - } - case MPresenceGrantRequestListEvent::KInterfaceId: - { - TRACE( "MPresenceGrantRequestListEvent"); - DoHandlePresenceGrantRequestListEventL( aContext, aEvent ); - TRACE( "MPresenceGrantRequestListEvent"); - break; - } - case MPresenceBlockListEvent::KInterfaceId: - { - TRACE( "MPresenceBlockListEvent"); - DoHandlePresenceBlockListEventL( aContext, aEvent ); - TRACE( "MPresenceBlockListEvent"); - - break; - } - - default: - { - break; - } - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::HandleListEventCompleteL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::HandleListEventCompleteL(TXimpOperation aType, - TInt aCompleteCode, - const MXIMPBase& /*aEvent*/) - { - TRACER_AUTO; - - switch ( aType ) - { - case EVIMPSTXimpOperationBind: - { - if(iLogoutRequest) - { - //since logout is requested, no need to Subscribe and Retrieve list - break; - } - if ( KErrNone == aCompleteCode ) - { - SubscribeForAuthorizationL(); - // get the list. - RetrieveSubscribedListL(); - - } - break; - - } - case EVIMPSTXimpOperationGetSubscribedList: - { - if(iLogoutRequest) - { - //Since logout is requested need not to retrive block list - break; - } - // check if blocking is supported then get the blocked list and - // subscribe those to persence cache. - TInt supportedFeatures = iXimpEventObserver.GetSupportedFeatures(); - if ( (EVIMPSTFeatureBlock & supportedFeatures) && (EVIMPSTFeatureUnBlock & supportedFeatures) ) - { - RetrieveBlockListL(); - } - break; - } - case EVIMPSTXimpOperationUnBind: - { - //Logout request completed - iLogoutRequest = EFalse; - break; - } - default: - break; - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::HandleXimpRequestCompleteL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::HandleXimpRequestCompleteL(TXimpOperation aType, - TInt aCompleteCode,const MXIMPBase& aEvent ) - { - TRACER_AUTO; - switch ( aType ) - { - case EVIMPSTXimpOperationBind: - case EVIMPSTXimpOperationGetSubscribedList: - case EVIMPSTXimpOperationGetBlockList: - //case TVIMPSTEnums::ESVCEXimpOperationGetWatcherList: - case EVIMPSTXimpOperationUnBind: - { - HandleListEventCompleteL( aType, aCompleteCode,aEvent ); - break; - } - case EVIMPSTXimpOperationWithdrawPresenceGrant: - { - break; - } - case EVIMPSTXimpOperationBlockPresenceForPresentity: - case EVIMPSTXimpOperationCancelPresenceBlockFromPresentity: - default: - { - break; - } - } - - - } -// ----------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::StoreToVirtualStoreL -// ----------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::StoreToVirtualStoreL( - const MPresentityGroupContentEvent& aListEvent ) - { - TRACER_AUTO; - TRACE( " count = %d",aListEvent.CurrentMembersCount() ); - TRACE("NewMembersCount count = %d",aListEvent.NewMembersCount() ); - TRACE( "UpdatedMembersCount count = %d",aListEvent.UpdatedMembersCount() ); - MVIMPSTStorageServiceView* storage = - CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId) ; - TLinearOrder< TPtrC > linearOrder (*CompareAlphabetically ); - if (storage) - { - //currMembrCount will be 0 when you login to the service - if( iIsFetchingContact) - { - // there are contacts process each - TPtrC listName = aListEvent.GroupId().Identity() ; - RArray firstNameList; - CleanupClosePushL( firstNameList ); - RArray serviceField; - CleanupClosePushL( serviceField ); - - firstNameList.Reset(); - serviceField.Reset(); - // number of contact in this list - TInt currentMembrcount = aListEvent.CurrentMembersCount(); - TRACE( "currentMembrcount count = %d",currentMembrcount ); - // Handle first current items - for(TInt j = 0; j < currentMembrcount ;j++ ) - { - const MPresentityGroupMemberInfo& memberInfo = - aListEvent.CurrentMember( j ) ; - const MXIMPIdentity& memberIdentity = memberInfo.GroupMemberId() ; - TPtrC userId = memberIdentity.Identity(); - TPtrC displayeName = memberInfo.GroupMemberDisplayName(); - serviceField.AppendL(userId ); - firstNameList.AppendL(displayeName ); - } - - // number of contact in this list - TInt newMembrcount = aListEvent.NewMembersCount() ; - TRACE("newMembrcount count = %d",newMembrcount ); - for(TInt i = 0; i < newMembrcount ;i++ ) - { - const MPresentityGroupMemberInfo& memberInfo = - aListEvent.NewMember( i ) ; - const MXIMPIdentity& memberIdentity = memberInfo.GroupMemberId() ; - TPtrC userId = memberIdentity.Identity(); - TPtrC displayeName = memberInfo.GroupMemberDisplayName(); - TInt error = serviceField.InsertInOrder(userId,linearOrder); - if(KErrAlreadyExists != error) - { - firstNameList.Append(displayeName); - } - } - TRACE( " calling CreateNewFetchContactsL" ); - TRACE( " serviceField count %d",serviceField.Count()); - TRACE( " firstNameList count %d",firstNameList.Count()); - - // If count in both arrays does not match, storage side can panic - __ASSERT_ALWAYS( firstNameList.Count() == serviceField.Count(), User::Leave( KErrCorrupt)); - storage->CreateNewFetchContactsL(firstNameList, serviceField); - iIsFetchingContact = EFalse; - - CleanupStack::PopAndDestroy( &serviceField ); - CleanupStack::PopAndDestroy( &firstNameList ); - } - //in case of delayed fetch contact and add contact - else - { - // number of contact in this list - TInt currentMembrcount = aListEvent.CurrentMembersCount() ; - for(TInt i = 0; i < currentMembrcount ; i++ ) - { - const MPresentityGroupMemberInfo& memberInfo = - aListEvent.CurrentMember( i ) ; - const MXIMPIdentity& memberIdentity = memberInfo.GroupMemberId() ; - RDebug::Print( _L("CVIMPSTEnginePresenceSubService: newMember %S"), &memberIdentity.Identity() ); - if ( !storage->FindContactByUserId( memberIdentity.Identity() ) ) - { - storage->CreateNewContactL( memberIdentity.Identity(), - memberInfo.GroupMemberDisplayName(), ETrue, ETrue ); - } - } - // number of contact in this list - TInt newMembrcount = aListEvent.NewMembersCount() ; - // there are contacts process each - TPtrC listName = aListEvent.GroupId().Identity() ; - for(TInt i = 0; i < newMembrcount ;i++ ) - { - const MPresentityGroupMemberInfo& memberInfo = - aListEvent.NewMember( i ) ; - const MXIMPIdentity& memberIdentity = memberInfo.GroupMemberId() ; - TPtrC userId = memberIdentity.Identity(); - TPtrC displayeName = memberInfo.GroupMemberDisplayName(); - TRACE( " newMember %S", &userId ); - storage->CreateNewContactL(userId,displayeName,ETrue,ETrue); - } - TInt removedMembrcount = aListEvent.DisappearedMembersCount() ; - for(TInt i = 0; i < removedMembrcount ;i++ ) - { - const MPresentityGroupMemberInfo& memberInfo = - aListEvent.DisappearedMember( i ) ; - const MXIMPIdentity& memberIdentity = memberInfo.GroupMemberId() ; - TPtrC userId = memberIdentity.Identity(); - TRACE( "deleteMember %S", &userId ); - MVIMPSTStorageContact* contactExist = storage->FindContactByUserId(userId); - if(contactExist) - { - storage->RemoveContactL(contactExist); - } - } - } - - } - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::IsChangeOwnStatusSupported -// -// --------------------------------------------------------- - -TBool CVIMPSTEnginePresenceSubService::IsChangeOwnStatusSupported() - { - //TODO:: get the feature supported from ximp and return - return iChangeStatusSupported; - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::IsStatusMsgSupported -// -// --------------------------------------------------------- -TBool CVIMPSTEnginePresenceSubService::IsStatusMsgSupported() - { - //TODO:: get the feature supported from ximp and return - return iChangeStatusMsgSupported; - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::IsAvatarSupported -// -// --------------------------------------------------------- -TBool CVIMPSTEnginePresenceSubService::IsAvatarSupported() - { - return iAvatarSupported; - } - - // --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::SetAvatarSupported -// -// --------------------------------------------------------- -void CVIMPSTEnginePresenceSubService::SetAvatarSupported(TBool aSupported ) - { - iAvatarSupported = aSupported; - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::ConvertXimpToClientPresenceStatus -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::TOnlineStatus CVIMPSTEnginePresenceSubService::ConvertPresenceCacheEnums(MPresenceBuddyInfo2::TAvailabilityValues aAvailabilityEnum,TPtrC aAvabilityText) - { - TRACER_AUTO; - // convert the presence cache enums to UI enumvalues - // by default if the enum doesnot match then its TVIMPSTEnums::UnKnown - TVIMPSTEnums::TOnlineStatus status; - switch( aAvailabilityEnum ) - { - case MPresenceBuddyInfo2::EBusy: - { - status = TVIMPSTEnums::EBusy; - if(0==aAvabilityText.Compare(KAwayState)) - { - status = TVIMPSTEnums::EAway; - } - if(0==aAvabilityText.Compare(KOnPhoneState)) - { - status = TVIMPSTEnums::EOnPhone; - } - if(0==aAvabilityText.Compare(KDndState)) - { - status = TVIMPSTEnums::EDoNotDisturb; - } - break; - } - case MPresenceBuddyInfo2::EAvailable: - { - status = TVIMPSTEnums::EOnline; - break; - } - case MPresenceBuddyInfo2::ENotAvailable: - { - status = TVIMPSTEnums::EOffline; - break; - } - case MPresenceBuddyInfo2::EUnknownAvailability: - { - status = TVIMPSTEnums::EUnknown; - if(0==aAvabilityText.Compare(KInvisibleState)) - { - status = TVIMPSTEnums::EInvisible; - } - - break; - } - default: - { - status = TVIMPSTEnums::EUnknown; - break; - } - } - return status; - } - - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::RegisterPresenceEventObserver -// -// --------------------------------------------------------- -//TODO::Should be named as RegisterPresenceEventObserverL -void CVIMPSTEnginePresenceSubService::RegisterPresenceEventObserverL( - MVIMPSTEnginePresenceSubServiceEventObserver* aObserver) - { - TRACER_AUTO; - __ASSERT_ALWAYS( aObserver, User::Leave( KErrArgument )); - iSubServiceObserver = aObserver; - } - -// --------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::UnRegisterPresenceEventObserver -// -// --------------------------------------------------------- - -void CVIMPSTEnginePresenceSubService::UnRegisterPresenceEventObserver( - MVIMPSTEnginePresenceSubServiceEventObserver* /*aObserver*/) - { - TRACER_AUTO; - iSubServiceObserver = NULL; - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::RetrieveBlockListL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::RetrieveBlockListL() - { - TRACER_AUTO; - - //Subscribe block list - // do get block list")); - TXIMPRequestId operationId = TXIMPRequestId::Null(); - operationId = iXimpEventObserver.XimpAuthorizationL().SubscribePresenceBlockListL(); - CVIMPSTEngineRequestMapper* requestMapper =iXimpEventObserver.GetRequestMapper(); - requestMapper->CreateRequestL(operationId,EFalse,EVIMPSTXimpOperationGetBlockList); - // list retrieving ok. Waiting for list.; - } -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::DoHandlePresenceNotificationL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::DoHandlePresenceNotificationL(MPresenceBuddyInfo2& aPresenceBuddyInfo) - { - TRACER_AUTO; - MVIMPSTStorageServiceView* storage = - CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - TPtrC ownUserId = storage->OwnContactL().UserId(); - // read the buddyID : returns in XSP format - TPtrC buddyXSPId = aPresenceBuddyInfo.BuddyId(); - TPtrC buddyId = buddyXSPId.Right( buddyXSPId.Length() - iServiceName->Length() - KColon().Length()); - TRACE( " buddyId : %s" , &buddyId ); - // read the availability /presence state enum value - MPresenceBuddyInfo2::TAvailabilityValues availabilityEnum = aPresenceBuddyInfo.Availability(); - TRACE( "Availability ENUM value: %d" , availabilityEnum ); - TPtrC avablityText = aPresenceBuddyInfo.AvailabilityText(); - // convert the presence cache enum value to service tab enum - TVIMPSTEnums::TOnlineStatus status = ConvertPresenceCacheEnums( availabilityEnum, avablityText); - //TRACE( T_LIT("CVIMPSTEnginePresenceSubService::DoHandlePresenceNotificationL - status: %d" ), status ); - //check if its pending or blocked contact. - if(TVIMPSTEnums::EUnKnown == status) - { - GetKeyFieldsAndValuesL(aPresenceBuddyInfo,status); - //TRACE( T_LIT("DoHandlePresenceNotificationL after GetKeyFieldsAndValuesL- status: %d" ), status ); - } - TRACE( " status: %d" , status ); - // Read the status message - TPtrC statusMsg = aPresenceBuddyInfo.StatusMessage(); - TRACE("Status Message: %s" , &statusMsg ); - TPtrC8 avatarContent = aPresenceBuddyInfo.Avatar(); - - //////////////////////////////////////////////////////////////// - HBufC8* avatarScaledData = NULL; - if ( avatarContent.Length() ) - { - TRACE( "avatarContent Content available" ); - CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL(); - CleanupStack::PushL(imageHandler); - TRACE( "imageHandler created " ); - avatarScaledData = imageHandler->ProcessImageFromDataL( avatarContent , KNullDesC8() ); - TRACE( " ProcessImageFromDataL returned " ); - CleanupStack::PopAndDestroy();//imageHandler - } - if( avatarScaledData && avatarScaledData->Length()) - { - CleanupStack::PushL(avatarScaledData); - storage->UpdatePresenceL(buddyId,status,statusMsg, *avatarScaledData ); - CleanupStack::PopAndDestroy();//avatarScaledData - } - else if( iIsClearingAvatar ) //clear own avatar - { - storage->UpdatePresenceL(buddyId, status, statusMsg, KNullDesC8, ETrue ); - iIsClearingAvatar = EFalse; - } - else - { - storage->UpdatePresenceL(buddyId, status, statusMsg, KNullDesC8 ); - } - } -// --------------- ------------------------------------------------------------ -// CVIMPSTEnginePresenceSubService:: -// DoHandlePresentityGroupContentEventL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::DoHandlePresenceBlockListEventL( - const MXIMPContext& /*aContext*/, - const MXIMPBase& aEvent ) - { - TRACER_AUTO; - const MPresenceBlockListEvent& event = - *TXIMPGetInterface< const MPresenceBlockListEvent >::From( - aEvent, - MXIMPBase::EPanicIfUnknown ); - // if the feature is supported then we need to add this contact into virtual store. - // that logic needs to be implemented. - // inform ui about the state change from updatingcontacts to registered. - if(TVIMPSTEnums::ESVCEUpdatingContacts == iServiceState ) - { - TRACE( " -> DoHandlePresentityGroupContentEventL:state is ESVCEUpdatingContacts" ); - } - - TRACE( " new member count: %d" , event.NewBlocksCount()); - - TInt subscriptionCount = event.NewBlocksCount(); - - TRACE(" subscriptionCount: %d", subscriptionCount ); - - TRACE( " handling buddy list" ); - HBufC* subsbuf(NULL); - for( TInt i =0; i < subscriptionCount; i++ ) - { - const MPresenceBlockInfo& blockedEntitys = event.NewBlock(i); - const MXIMPIdentity& ident = blockedEntitys.BlockedEntityId(); - subsbuf = ident.Identity().AllocLC(); - TPtr subsbufPtr = subsbuf->Des(); - TRACE( " -> identity: %S", &subsbufPtr ); - - TRACE(" -> subscribe to cache" ); - SubscribePresenceOfSingleContactL(*subsbuf); - iBlockedListMgr->AddToBlockedListL(*subsbuf); - CleanupStack::PopAndDestroy( subsbuf ); - } - TInt disappearedCount = event.DisappearedBlocksCount(); - - for( TInt j =0; j < disappearedCount; j++ ) - { - const MPresenceBlockInfo& blockedEntitys = event.DisappearedBlock( j ); - const MXIMPIdentity& ident = blockedEntitys.BlockedEntityId(); - subsbuf = ident.Identity().AllocLC(); - TPtr subsbufPtr = subsbuf->Des(); - TRACE( " identity: %S", &subsbufPtr ); - - iBlockedListMgr->RemoveFromBlockListL( *subsbuf ); - - CleanupStack::PopAndDestroy( subsbuf ); - } - - if(iBlockedListObserver) - { - iBlockedListObserver->HandleBlockedListFetchCompleteL(); - iBlockListFetchReqPending = EFalse; - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::AddToBlockListL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEnginePresenceSubService::AddToBlockListL( const TDesC& aContactId ) - { - TRACER_AUTO; - if(TVIMPSTEnums::ESVCERegistered != iServiceState) - return KErrNotSupported; - //if aContactId is zero. - if( 0 == aContactId.Length()) - return KErrArgument; - - TRACE( " aContactId: %s" , &aContactId); - TRACE( " perform block operation" ); - - MXIMPIdentity* identity = iXimpEventObserver.XimpPresenceContextL().ObjectFactory().NewIdentityLC(); - - identity->SetIdentityL( aContactId ); - - TXIMPRequestId reqId = iXimpEventObserver.XimpAuthorizationL().BlockPresenceForPresentityL(*identity ); - CVIMPSTEngineRequestMapper* mapper = iXimpEventObserver.GetRequestMapper(); - mapper->CreateRequestL(reqId, ETrue,EVIMPSTXimpOperationBlockPresenceForPresentity);// waite here - TInt error = iXimpEventObserver.GetCompletedReqResult(); // get the result error - //Contact will be added to blocked list manager, - //Delete avatar of contact - if(KErrNone == error && IsAvatarSupported()) - { - MVIMPSTStorageServiceView* storage = - CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - storage->UpdateAvatarL(aContactId,KNullDesC8); - } - //when pres. cache call will come. - CleanupStack::PopAndDestroy(); // identity - return error; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::RemoveFromBlockListL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEnginePresenceSubService::RemoveFromBlockListL( const TDesC& aUriOfTheContact ) - { - TRACER_AUTO; - if(TVIMPSTEnums::ESVCERegistered != iServiceState) - return KErrNotSupported; - //if aUriOfTheCOntact is zero. - if( 0 == aUriOfTheContact.Length()) - return KErrNotFound; - - TRACE(" -> aUriOfTheContact: %s" , &aUriOfTheContact); - TRACE( " -> perform unblock operation" ); - - MXIMPIdentity* identity = iXimpEventObserver.XimpPresenceContextL().ObjectFactory().NewIdentityLC(); - identity->SetIdentityL( aUriOfTheContact ); - - TXIMPRequestId reqId = iXimpEventObserver.XimpAuthorizationL().CancelPresenceBlockFromPresentityL(*identity ); - CVIMPSTEngineRequestMapper* mapper = iXimpEventObserver.GetRequestMapper(); - mapper->CreateRequestL(reqId, ETrue,EVIMPSTXimpOperationCancelPresenceBlockFromPresentity);// waite here - TInt error = iXimpEventObserver.GetCompletedReqResult(); // get the result error - //if blocked contact is unblocked, then remove it from - //locally maintained blocked list.. - if(KErrNone == error) - { - iBlockedListMgr->RemoveFromBlockListL(aUriOfTheContact); - } - CleanupStack::PopAndDestroy( 1 ); // identity - - return error; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::GetBlockedList -// --------------------------------------------------------------------------- -// -RPointerArray* CVIMPSTEnginePresenceSubService::GetBlockedList() - { - if(iBlockedListMgr) - { - return iBlockedListMgr->BlockedList(); - } - return NULL; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::GetBlockedList -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::ResetBlockedListManagerL() - { - iBlockedListMgr->ResetL(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::FetchBlockedListFromServer -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::FetchBlockedListFromServerL(MVIMPSTEngineBlockedListFetchEventObserver* aOb) - { - TRACER_AUTO; - if(EFalse == iBlockListFetchReqPending) - { - //set the observer to give call back; Fetch from server is completed. - iBlockedListObserver = aOb; - - //unsubscribe blocked list. - TXIMPRequestId operationId = TXIMPRequestId::Null(); - operationId = iXimpEventObserver.XimpAuthorizationL().UnsubscribePresenceBlockListL(); - CVIMPSTEngineRequestMapper* requestMapper =iXimpEventObserver.GetRequestMapper(); - requestMapper->CreateRequestL(operationId,ETrue,EVIMPSTXimpOperationGetBlockList); - - iBlockListFetchReqPending = ETrue; - //subscribe again to get fresh blocked list from server. - RetrieveBlockListL(); - } - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::GetKeyFieldsAndValuesL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::GetKeyFieldsAndValuesL(MPresenceBuddyInfo2& aPresenceBuddyInfo,TVIMPSTEnums::TOnlineStatus &aStatus) - { - TRACER_AUTO; - TPtrC8 value = aPresenceBuddyInfo.GetAnyField( KExtensionKey()); - // At any point of time fro remote and blocked contact only one of the keys - // KPendingRequestExtensionValue/KBlockedExtensionValue will be assigned, and not both the keys. - if(value.Compare( KPendingRequestExtensionValue ) == 0) - { - aStatus = TVIMPSTEnums::EPending; - } - else if(value.CompareF( KBlockedExtensionValue ) == 0) - { - aStatus = TVIMPSTEnums::EBlocked; - } - else if(value.CompareF( KServiceExtensionValue ) == 0) - { - aStatus = TVIMPSTEnums::EServiceOut; - } - else if(value.CompareF( KCallForwardExtensionValue ) == 0) - { - aStatus = TVIMPSTEnums::ECallForward; - } - else - { - aStatus = TVIMPSTEnums::EOffline; - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::UpdatePresenceStateL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::UpdatePresenceStateL() - { - TRACER_AUTO; - //inform ui about the state change from updatingcontacts to registered. - iServiceState = TVIMPSTEnums::ESVCERegistered; - iObserver.HandleServceConnectionEventL(); - - TRACE( " -> HandleContactFetchedL:state is ESVCERegistered" ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::FetchPresenceOfSingleContactL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::FetchPresenceOfSingleContactL(const TDesC& aContact) - { - TRACER_AUTO; - if(aContact.Length() && iServiceName->Length()) - { - HBufC* name = HBufC::NewLC( iServiceName->Length() + KColon().Length() + aContact.Length() ); // 1. on to cleanup stack - TPtr namePtr( name->Des() ); - namePtr.Zero(); - // append the service name followed by user id ,seperated by colon - namePtr.Append(*iServiceName); - namePtr.Append(KColon); - namePtr.Append(aContact); - TRACE( " namePtr = %S", &namePtr); - MPresenceBuddyInfo2* presenceBuddyInfo = iPresenceCacheReader->PresenceInfoLC(namePtr); // 2. on to cleanupstack - if ( presenceBuddyInfo ) - { - TRACE("presenceBuddyInfo"); - DoHandlePresenceNotificationL(*presenceBuddyInfo); - CleanupStack::PopAndDestroy(); // presenceBuddyInfo - TRACE("presenceBuddyInfo end"); - } - CleanupStack::PopAndDestroy(name); // name - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService::UnsubscribeListsL -// --------------------------------------------------------------------------- -// -void CVIMPSTEnginePresenceSubService::UnsubscribeListsL() - { - TRACER_AUTO; - - // It is assumed here that buddy list and authorization list has been always - // subscribed if bind has been done. Caller of this function must check - // that session has been bound before calling this. - TBuf buddyGroupBuffer( KFriendList ); - MXIMPIdentity* buddyGroupList = iXimpEventObserver.XimpPresenceContextL().ObjectFactory().NewIdentityLC(); - __ASSERT_ALWAYS( buddyGroupList , User::Leave( KErrNoMemory ) ); - buddyGroupList->SetIdentityL( buddyGroupBuffer ); - iXimpEventObserver.XimpPresentityGroupsL().UnsubscribePresentityGroupContentL( - *buddyGroupList ); - CleanupStack::PopAndDestroy(); // buddyGroupList - - // Auth list - if(iSubscribeToAuthList) - { - TRACE("unsubscribe auth list"); - iSubscribeToAuthList = EFalse; - iXimpEventObserver.XimpAuthorizationL().UnsubscribePresenceGrantRequestListL(); - } - - // block list - TRACE( "check if block is supported"); - TInt supportedFeatures = iXimpEventObserver.GetSupportedFeatures(); - if ( (EVIMPSTFeatureBlock & supportedFeatures) && (EVIMPSTFeatureUnBlock & supportedFeatures) ) - { - TRACE( "unsubscribe block list"); - iXimpEventObserver.XimpAuthorizationL().UnsubscribePresenceBlockListL(); - } - - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginerequest.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginerequest.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/* -* Copyright (c) 2008 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: REquest for VIMPSTEngine -* -*/ - -// INCLUDE FILES -#include "cvimpstenginerequest.h" - -#include "uiservicetabtracer.h" - -#include - -// --------------------------------------------------------- -// CVIMPSTEngineRequest::NewL -// --------------------------------------------------------- - -CVIMPSTEngineRequest* CVIMPSTEngineRequest::NewL(TXIMPRequestId& aRequestId, - TXimpOperation aType) - { - TRACER_AUTO; - CVIMPSTEngineRequest* self = CVIMPSTEngineRequest::NewLC(aRequestId,aType); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequest::NewLC -// --------------------------------------------------------- -CVIMPSTEngineRequest* CVIMPSTEngineRequest::NewLC(TXIMPRequestId& aRequestId, - TXimpOperation aType ) - { - TRACER_AUTO; - CVIMPSTEngineRequest* self = new (ELeave) CVIMPSTEngineRequest(aRequestId,aType); - CleanupStack::PushL( self ); - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineRequest::~CVIMPSTEngineRequest -// -// --------------------------------------------------------- -CVIMPSTEngineRequest::~CVIMPSTEngineRequest() - { - if(iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - - } - - - -// --------------------------------------------------------- -// CVIMPSTEngineRequest::CVIMPSTEngineRequest -// -// --------------------------------------------------------- -CVIMPSTEngineRequest::CVIMPSTEngineRequest(TXIMPRequestId& aRequestId, - TXimpOperation aType) -:iRequestId(aRequestId), -iReqType(aType) - { - - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequest::StartWait -// -// --------------------------------------------------------- -void CVIMPSTEngineRequest::StartWait() - { - if( ! iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // CActiveSchedulerWait. - iWait.Start(); - } - - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequest::StopWait -// -// --------------------------------------------------------- -void CVIMPSTEngineRequest::StopWait() - { - if(iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequest::GetRequestId -// -// --------------------------------------------------------- -const TXIMPRequestId& CVIMPSTEngineRequest::GetRequestId() const - { - return iRequestId ; - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequest::IsWaitStarted -// -// --------------------------------------------------------- -TBool CVIMPSTEngineRequest::IsWaitStarted() - { - return iWait.IsStarted() ; - } -// --------------------------------------------------------- -// CVIMPSTEngineRequest::SetRequestType -// -// --------------------------------------------------------- -void CVIMPSTEngineRequest::SetRequestType(TXimpOperation aType) - { - iReqType = aType ; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineRequest::RequestType -// -// --------------------------------------------------------- -TXimpOperation CVIMPSTEngineRequest::RequestType() const - { - return iReqType ; - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginerequestmapper.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginerequestmapper.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* -* Copyright (c) 2008 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: Request mapper for VIMSTEngine -* -*/ - -// INCLUDE FILES - -#include "cvimpstenginerequestmapper.h" - -#include "cvimpstenginerequest.h" - -#include "uiservicetabtracer.h" - -// --------------------------------------------------------- -// CVIMPSTEngineRequestMapper::two phase constructor -// -// --------------------------------------------------------- -CVIMPSTEngineRequestMapper* CVIMPSTEngineRequestMapper:: NewL() - { - CVIMPSTEngineRequestMapper* self = CVIMPSTEngineRequestMapper::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequestMapper::NewLC -// -// --------------------------------------------------------- -CVIMPSTEngineRequestMapper* CVIMPSTEngineRequestMapper::NewLC() - { - CVIMPSTEngineRequestMapper* self = new (ELeave) CVIMPSTEngineRequestMapper(); - CleanupStack::PushL( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequestMapper::~CVIMPSTEngineRequestMapper -// -// --------------------------------------------------------- -CVIMPSTEngineRequestMapper::~CVIMPSTEngineRequestMapper() - { - iRequestArray.ResetAndDestroy(); - } - - -// --------------------------------------------------------- -// CVIMPSTEngineRequestMapper::CVIMPSTEngineRequestMapper -// -// --------------------------------------------------------- -CVIMPSTEngineRequestMapper::CVIMPSTEngineRequestMapper() - { - - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequestMapper::CreateRequestL -// -// --------------------------------------------------------- -CVIMPSTEngineRequest* CVIMPSTEngineRequestMapper::CreateRequestL - (TXIMPRequestId& aRequestId, - TBool aIsWait, TXimpOperation aType) - { - TRACER_AUTO; - CVIMPSTEngineRequest* req = CVIMPSTEngineRequest::NewL(aRequestId,aType ); - CleanupStack::PushL(req); - TInt status( iRequestArray.Append( req ) ); - User::LeaveIfError( status ); - - if(aIsWait) - { - req->StartWait(); - } - - - CleanupStack::Pop(req); - return req; - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequestMapper::FindRequestId -// -// --------------------------------------------------------- -CVIMPSTEngineRequest* CVIMPSTEngineRequestMapper::FindRequestId(const TXIMPRequestId& aRequestId ) - { - TRACER_AUTO; - TInt count = iRequestArray.Count() ; - TXIMPRequestId reqId ; - CVIMPSTEngineRequest *req = NULL; - for (TInt i=0; i < count; i++) - { - req = iRequestArray[i] ; - - reqId = req->GetRequestId() ; - - if( aRequestId == reqId ) - { - break ; - } - } - return req ; - } - -// --------------------------------------------------------- -// CVIMPSTEngineRequestMapper::RemoveRequestId -// -// --------------------------------------------------------- -void CVIMPSTEngineRequestMapper::RemoveRequestId(const TXIMPRequestId& aRequestId ) - { - TRACER_AUTO; - TInt count = iRequestArray.Count() ; - for (TInt i=0; i < count; i++) - { - if( iRequestArray[i]->GetRequestId() == aRequestId) - { - delete iRequestArray[i]; - iRequestArray[i] = NULL; - iRequestArray.Remove( i ); - iRequestArray.Compress(); - break ; - } - } - } - - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginesearchmgrextention.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginesearchmgrextention.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,615 +0,0 @@ -/* -* Copyright (c) 2008 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: Search manager extension for CVIMPSTEngine -* -*/ - -// INCLUDE FILES -#include "cvimpstenginesearchmgrextention.h" - -#include -#include -#include -#include -#include -#include -#include - - -#include "cvimpstenginerequestmapper.h" -#include "cvimpstenginerequest.h" - -#include "vimpstallerrors.h" -#include "tvimpstconsts.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "mvimpstenginesearchextentioneventobserver.h" -#include "uiservicetabtracer.h" - - - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::NewL -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTEngineSearchMgrExtention* CVIMPSTEngineSearchMgrExtention::NewL( - MXIMPContext& aPresenceCtx, - CVIMPSTEngineRequestMapper& aRequestMapper) - { - TRACER_AUTO; - CVIMPSTEngineSearchMgrExtention* self = - CVIMPSTEngineSearchMgrExtention::NewLC( - aPresenceCtx, - aRequestMapper - ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::NewLC -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTEngineSearchMgrExtention* CVIMPSTEngineSearchMgrExtention::NewLC( - MXIMPContext& aPresenceCtx, - CVIMPSTEngineRequestMapper& aRequestMapper) - { - TRACER_AUTO; - CVIMPSTEngineSearchMgrExtention* self = new (ELeave) - CVIMPSTEngineSearchMgrExtention(aPresenceCtx, aRequestMapper); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::ConstructL -// --------------------------------------------------------- -void CVIMPSTEngineSearchMgrExtention::ConstructL() - { - TRACER_AUTO; - - // ximp search plugin - iSearchFeature = MSearchFeature::NewL(&iPresenceCtx); - - iSearch = &iSearchFeature->Search(); - - iAlreadySubscibed = EFalse; - - - } - -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::CVIMPSTEngineSearchMgrExtention -// --------------------------------------------------------- -CVIMPSTEngineSearchMgrExtention::CVIMPSTEngineSearchMgrExtention( MXIMPContext& aPresenceCtx, - CVIMPSTEngineRequestMapper& aRequestMapper) - :iPresenceCtx(aPresenceCtx), - iRequestMapper(aRequestMapper), - iSearchSupported(TVIMPSTEnums::ESupportUnKnown) - { - - } - -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::~CVIMPSTEngineSearchMgrExtention -// --------------------------------------------------------- -CVIMPSTEngineSearchMgrExtention::~CVIMPSTEngineSearchMgrExtention() - { - TRACER_AUTO; - - iSearchObservers.Reset(); - delete iSearchFeature; - iSearchFeature = NULL; - - } - - -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::SearchContactsL -// --------------------------------------------------------- -TInt CVIMPSTEngineSearchMgrExtention::SearchContactsL( RArray& aKeyDataArray ) - { - TRACER_AUTO; - - TInt err = KErrNotSupported; - if (iSearchSupported == TVIMPSTEnums::ESupported) - { - - TInt keydataCount = aKeyDataArray.Count(); - - MXIMPObjectFactory& objFactory = iPresenceCtx.ObjectFactory(); - MSearchObjectFactory& searchObjFact= iSearchFeature->SearchObjectFactory(); - - MXIMPIdentity* searchId = objFactory.NewIdentityLC(); - searchId->SetIdentityL(_L("SEARCH")); - - RPointerArray< MSearchElement > searchList; - CleanupClosePushL( searchList ); - - for( TInt i = 0; iSetIdentityL( data.iSearchKeyData ); - - MSearchElement* srchElement = searchObjFact.NewSearchElementLC(); - if( data.iSearchKey != TVIMPSTEnums::EVIMPSTSearchKeyUknown ) - { - srchElement->SetRequestL( *searchKeyId, ConverttoTSearchKey( data.iSearchKey ) ); - } - else - { - MXIMPIdentity* searchLabel = objFactory.NewIdentityLC(); - searchLabel->SetIdentityL( data.iSearchLabel ); - srchElement->SetRequestL( *searchKeyId, *searchLabel ); - CleanupStack::PopAndDestroy ();//searchLabel - } - searchList.Append(srchElement); - - CleanupStack::Pop();//srchElement - CleanupStack::PopAndDestroy();//searchKeyId - - } - - - TXIMPRequestId reqId = iSearch->SearchL(*searchId,searchList,KMaxSearchLimit ); - - iRequestMapper.CreateRequestL(reqId, ETrue,EVIMPSTXimpOperationSearchContact);// waite here - - CleanupStack::Pop() ; // searchList - searchList.ResetAndDestroy();// searchList - CleanupStack::PopAndDestroy ();//searchId - - err = iReqResult; - } - - return err; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::SubscribeForSearchKeysL() -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTEngineSearchMgrExtention::SubscribeForSearchKeysL() - { - TRACER_AUTO; - TRACE( "iSearchSupported: %d" , iSearchSupported ); - TRACE( "iAlreadySubscibed: %d" , iAlreadySubscibed ); - - if ( (iSearchSupported == TVIMPSTEnums::ENotSupported) || iAlreadySubscibed ) - { - TRACE("inside if " ); - return KErrNone; - } - - if( iSearch ) - { - TRACE("inside if(iSearch) " ); - - iAlreadySubscibed = ETrue; - - TXIMPRequestId reqId = iSearch->GetSearchKeysL(); - TRACE( "iSearch->GetSearchKeysL() " ); - - iRequestMapper.CreateRequestL(reqId, ETrue ,EVIMPSTXimpOperationSubscribeSearchKeys);// waite here - } - - if( ( iReqResult != KPREQUESTERRSUCCESSFUL ) && ( iReqResult != KErrNone ) ) - { - iSearchSupported = TVIMPSTEnums::ENotSupported; - } - else - { - iSearchSupported = TVIMPSTEnums::ESupported; - } - - return iReqResult;; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::IsSupported() -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::FeatureSupport CVIMPSTEngineSearchMgrExtention::IsSupported() const - { - return iSearchSupported; - } - -// ------------------------------------------------------------------------ -// CVIMPSTEngineSearchMgrExtention::ConverttoTSearchKey -// -// ------------------------------------------------------------------------ -TSearchKey CVIMPSTEngineSearchMgrExtention::ConverttoTSearchKey(TVIMPSTEnums::TVIMPSTSearchKey aKey) - { - TRACER_AUTO; - - TSearchKey ret = EUserFirstName; - switch( aKey ) - { - case TVIMPSTEnums::EVIMPSTFirstName : - { - ret = EUserFirstName; - break; - } - case TVIMPSTEnums::EVIMPSTMiddleName : - { - ret = EUserMiddleName ; - break; - } - case TVIMPSTEnums::EVIMPSTLastName : - { - ret = EUserLastName; - break; - } - case TVIMPSTEnums::EVIMPSTFullName : - { - ret = EUserFullName; - break; - } - case TVIMPSTEnums::EVIMPSTCountry : - { - ret = EUserCountry; - break; - } - case TVIMPSTEnums::EVIMPSTCity : - { - ret = EUserCity; - break; - } - case TVIMPSTEnums::EVIMPSTEmailAddress : - { - ret = EUserEmailAddress; - break; - } - case TVIMPSTEnums::EVIMPSTUser : - { - ret = EUser; - break; - } - case TVIMPSTEnums::EVIMPSTOrganisation : - { - ret = EOrganisation; - break; - } - - case TVIMPSTEnums::EVIMPSTNickName : - { - ret = EUserNickName; - break; - } - case TVIMPSTEnums::EVIMPSTState : - { - ret = EState; - break; - } - case TVIMPSTEnums::EVIMPSTOrganisationUnit : - { - ret = EOrganisationUnit; - break; - } - case TVIMPSTEnums::EVIMPSTBirthday : - { - ret = EBirthday; - break; - } - - default: - { - ret = EUserFirstName ; - } - - } - - return ret; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::Type() -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::ExtentionType CVIMPSTEngineSearchMgrExtention::Type() const - { - return TVIMPSTEnums::ESearch; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::RegisterObserver -// -// --------------------------------------------------------- -void CVIMPSTEngineSearchMgrExtention::RegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver) - { - TRACER_AUTO; - - TInt index = iSearchObservers.Find(aObserver); - if( index == KErrNotFound ) - { - iSearchObservers.Append( aObserver ); - } - - } - -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::UnRegisterObserver -// -// --------------------------------------------------------- -void CVIMPSTEngineSearchMgrExtention::UnRegisterObserver(MVIMPSTEngineSearchExtentionEventObserver* aObserver) - { - TRACER_AUTO; - - TInt index = iSearchObservers.Find(aObserver); - - if( index >=0 ) - { - iSearchObservers.Remove( index ); - iSearchObservers.Compress(); - } - - } - - - -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::HandleSessionContextEventL -// --------------------------------------------------------- -void CVIMPSTEngineSearchMgrExtention::HandleSessionContextEventL(const MXIMPContext& /*aContext*/, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation/* = EVIMPSTXimpOperationNoOperation*/ ) - { - TRACER_AUTO; - - switch( aEvent.GetInterfaceId() ) - { - - case MXIMPRequestCompleteEvent::KInterfaceId: - { - TRACE("InsideCallbackswitch::MXIMPRequestCompleteEvent"); - if ( (EVIMPSTXimpOperationSearchContact == aXimpOperation) - || (EVIMPSTXimpOperationSubscribeSearchKeys == aXimpOperation) ) - { - const MXIMPRequestCompleteEvent* event = - TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - - iReqResult = event->CompletionResult().ResultCode(); - const TXIMPRequestId& reqId = event->RequestId(); - // Note:FindRequestId does not pass the ownership. hanece req - // should not be deleted. - CVIMPSTEngineRequest *req = iRequestMapper.FindRequestId( reqId ); - - if ( req ) - { - req->StopWait() ; - iRequestMapper.RemoveRequestId(reqId); - } - } - break; - } - - case MSearchEvent::KInterfaceId: - { - const MSearchEvent* srchEvent = - TXIMPGetInterface< const MSearchEvent >::From - (aEvent, MXIMPBase::EPanicIfUnknown); - TInt count= srchEvent->SearchResultCount(); - const MXIMPIdentity& identity= srchEvent->SearchId(); - TPtrC id=srchEvent->SearchId().Identity(); - RArray resultsArray; - for(TInt i=0;iSearchResult(i); - - TVIMPSTSearchData data = - { - info.GetFieldInfo(EFirstName), - info.GetFieldInfo(ELastName), - info.GetFieldInfo(EEmailAddress) - }; - TRAP_IGNORE( resultsArray.AppendL( data ) ); - } - - //should be done in reuqest complete event for search with erro handling - //also first request complete will be received and then search result event - - for(TInt i=0; i< iSearchObservers.Count(); i++ ) - { - TRAP_IGNORE( iSearchObservers[i]->HandleSearchResultL(resultsArray) ); - TRAP_IGNORE( iSearchObservers[i]->HandleSearchFinishedL( KErrNone ) ); - } - - resultsArray.Close(); // close the array - break; - } - case MSearchKeysEvent::KInterfaceId: - { - const MSearchKeysEvent* searchEvent = - TXIMPGetInterface< const MSearchKeysEvent >::From ( aEvent, - MXIMPBase::EPanicIfUnknown ); - TRAP_IGNORE( ProcessSearchKeysEventL( searchEvent ) ); - break; - } - default: - { - break; - } - } - } - - -// --------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::ProcessSearchKeysEventL -// -// --------------------------------------------------------- -void CVIMPSTEngineSearchMgrExtention::ProcessSearchKeysEventL(const MSearchKeysEvent* aSearchKeysEvent) - { - TRACER_AUTO; - - TInt searchKeysCount = aSearchKeysEvent->InfoCount(); - - RArray enumKeyArray; - RPointerArray labelKeyArray; - - CleanupClosePushL( enumKeyArray ); - CleanupClosePushL( labelKeyArray ); - - HBufC* keyLabelText = NULL; - for( TInt i = 0; i < searchKeysCount; i++ ) - { - const MSearchKeyInfo& searchKeyInfo = aSearchKeysEvent->SearchKeyInfo ( i ); - switch( searchKeyInfo.Type() ) - { - case EKey: - { - //change to proper type once done at ximp side - TSearchKey keyValue = searchKeyInfo.Key(); - TVIMPSTEnums::TVIMPSTSearchKey key = ConverttoTVIMPSTSearchKey(keyValue); - enumKeyArray.Append(key); - break; - } - case ELabel: - { - keyLabelText = searchKeyInfo.Label().AllocL(); - - labelKeyArray.Append(keyLabelText); - break; - } - - } - } - - for(TInt i=0; i< iSearchObservers.Count(); i++ ) - { - iSearchObservers[i]->HandleSearchKeysEventL(enumKeyArray, labelKeyArray ); - } - - labelKeyArray.ResetAndDestroy(); - CleanupStack::PopAndDestroy(2); //enumKeyArray, labelKeyArray - - } - -// ------------------------------------------------------------------------ -// CVIMPSTEngineSearchMgrExtention::ConverttoTVIMPSTSearchKey -// -// ------------------------------------------------------------------------ -TVIMPSTEnums::TVIMPSTSearchKey CVIMPSTEngineSearchMgrExtention::ConverttoTVIMPSTSearchKey( TSearchKey aKey) - { - TRACER_AUTO; - - TVIMPSTEnums::TVIMPSTSearchKey retKey = TVIMPSTEnums::EVIMPSTFirstName ; - switch( aKey ) - { - case EUserFirstName: - { - retKey = TVIMPSTEnums::EVIMPSTFirstName; - break; - } - case EUserMiddleName: - { - retKey = TVIMPSTEnums::EVIMPSTMiddleName; - break; - } - case EUserLastName: - { - retKey = TVIMPSTEnums::EVIMPSTLastName; - break; - } - case EUserFullName: - { - retKey = TVIMPSTEnums::EVIMPSTFullName; - break; - } - case EUserCountry: - { - retKey = TVIMPSTEnums::EVIMPSTCountry; - break; - } - case EUserCity: - { - retKey = TVIMPSTEnums::EVIMPSTCity; - break; - } - case EUserEmailAddress: - { - retKey = TVIMPSTEnums::EVIMPSTEmailAddress; - break; - } - case EUser: - { - retKey = TVIMPSTEnums::EVIMPSTUser; - break; - } - case EOrganisation: - { - retKey = TVIMPSTEnums::EVIMPSTOrganisation; - break; - } - - case EUserNickName : - { - retKey = TVIMPSTEnums::EVIMPSTNickName; - break; - } - case EState : - { - retKey = TVIMPSTEnums::EVIMPSTState ; - break; - } - case EOrganisationUnit : - { - retKey = TVIMPSTEnums::EVIMPSTOrganisationUnit; - break; - } - case EBirthday: - { - retKey = TVIMPSTEnums::EVIMPSTBirthday; - break; - } - - default: - { - retKey = TVIMPSTEnums::EVIMPSTFirstName; - } - - } - - return retKey; - } -//---------------------------------------------------------------------------- -// CVIMPSTEngineSearchMgrExtention::SetSupported() -// ----------------------------------------------------------------------------- -// -void CVIMPSTEngineSearchMgrExtention::SetSupported(TVIMPSTEnums::FeatureSupport aSupported) - { - TRACER_AUTO; - if ( aSupported == TVIMPSTEnums::ESupportUnKnown) - { - // at the logout time this flag has to be set to EFalse - iAlreadySubscibed = EFalse; - } - iSearchSupported = aSupported; - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstengineservicetablefetcher.cpp --- a/uiservicetab/vimpstengine/src/cvimpstengineservicetablefetcher.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,609 +0,0 @@ -/* -* Copyright (c) 2008 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: Handles the use of Service Provider Settings API -* -*/ - - -// INCLUDE FILES -#include -#include -#include - - -// Phonebook shutter -#include -#include -#include -#include -#include - -#include "cvimpstengineservicetablefetcher.h" -#include "cvimpstenginecchhandler.h" - -#include "vimpstextentionuiuid.h" -#include "tvimpstconsts.h" -#include "mvimpstenginefactory.h" -#include "cvimpstenginefactory.h" -#include "mvimpststorageserviceview.h" -#include "cvimpststoragemanagerfactory.h" -#include "uiservicetabtracer.h" - - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::CVIMPSTEngineServiceTableFetcher() -// --------------------------------------------------------------------------- -// -CVIMPSTEngineServiceTableFetcher::CVIMPSTEngineServiceTableFetcher() - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::ConstructL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineServiceTableFetcher::ConstructL() - { - TRACER_AUTO; - iSettings = CSPSettings::NewL(); - CompressViewIdsL(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::NewL() -// --------------------------------------------------------------------------- -// -CVIMPSTEngineServiceTableFetcher* - CVIMPSTEngineServiceTableFetcher::NewL( ) - { - TRACER_AUTO; - - CVIMPSTEngineServiceTableFetcher* self = NewLC(); - CleanupStack::Pop(self); - - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::NewLC() -// --------------------------------------------------------------------------- -// -CVIMPSTEngineServiceTableFetcher* - CVIMPSTEngineServiceTableFetcher::NewLC() - { - TRACER_AUTO; - - CVIMPSTEngineServiceTableFetcher* self = - new (ELeave) CVIMPSTEngineServiceTableFetcher( ); - CleanupStack::PushL(self); - self->ConstructL(); - - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher:: -// ~CVIMPSTEngineServiceTableFetcher() -// --------------------------------------------------------------------------- -// -CVIMPSTEngineServiceTableFetcher::~CVIMPSTEngineServiceTableFetcher() - { - TRACER_AUTO; - - - delete iSettings; - iSettings = NULL; - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::GetMasterServiceIdsL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineServiceTableFetcher::GetMasterServiceIdsL( - RArray& aServiceIds ) - { - TRACER_AUTO; - - RArray services; - CleanupClosePushL( services ); - iSettings->FindServiceIdsL( services ); - - const TInt serviceCount = services.Count(); - for ( TInt i( 0 ); i < serviceCount; i++ ) - { - TUint32 refContactUid = ContactViewUidL( services[i] ); - - if ( TUid::Uid( refContactUid ) == - TUid::Uid( KIMCONTACTSEXTNIMPLEMENTATIONUID ) - || TUid::Uid( refContactUid ) == - TUid::Uid( 0x20007B6D ) ) - { - TRACE( " found serviceid: (%d)", services[ i ] ); - - aServiceIds.Append( services[ i ] ); - - TRACE("service append ok" ); - - } - } - CleanupStack::PopAndDestroy( &services ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::GetContactStoreIdL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineServiceTableFetcher::GetContactStoreIdL( - TUint32 aServiceId, TDes& aContactStoreId ) - { - TRACER_AUTO; - - TRACE( "ServiceId: %d", aServiceId ); - - CSPProperty* property = CSPProperty::NewLC(); - TInt err = iSettings->FindPropertyL( aServiceId, - EPropertyContactStoreId, - *property ); - if (KErrNone == err) - { - err = property->GetValue( aContactStoreId ); - - } - - CleanupStack::PopAndDestroy( property ); - - TRACE( "StoreId: %S", &aContactStoreId ); - - - } - - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::GetBrandIdL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineServiceTableFetcher::GetBrandIdL( - TUint32 aServiceId, TDes8& aBrandId ) - { - TRACER_AUTO; - - TRACE( "ServiceId: %d", aServiceId ); - - HBufC* ret = HBufC::NewLC( KVIMPSTUISPSMaxPropertyLength ); - TPtr retPtr( ret->Des() ); - - CSPProperty* property = CSPProperty::NewLC(); - TInt err = iSettings->FindPropertyL( aServiceId, - EPropertyBrandId, - *property ); - if ( KErrNone == err ) - { - err = property->GetValue( retPtr ); - if ( KErrNone == err ) - { - aBrandId.Copy( retPtr ); - } - } - CleanupStack::PopAndDestroy( property ); - CleanupStack::PopAndDestroy( ret ); - - TRACE( "BrandId: %S", &aBrandId ); - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::FindPropertyL() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineServiceTableFetcher::FindPropertyL( TUint32 aServiceId, - TServicePropertyName aPropertyName ) - { - TRACER_AUTO; - - TRACE( "ServiceId: %d Property: %d", aServiceId, aPropertyName ); - - CSPProperty* property = CSPProperty::NewLC(); - TInt result = iSettings->FindPropertyL( aServiceId, - aPropertyName, - *property ); - CleanupStack::PopAndDestroy( property ); - - TRACE(" Result: %d", result ); - - - return result; - } - - - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::PropertyBrandVersionL() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineServiceTableFetcher::PropertyBrandVersionL( - TUint32 aServiceId ) - { - TRACER_AUTO; - - TRACE( "ServiceId: %d", aServiceId ); - - TInt brandVersion = KErrNotFound; // default value - CSPProperty* property = CSPProperty::NewLC(); - TInt err = iSettings->FindPropertyL( aServiceId, - EPropertyBrandVersion, - *property ); - if ( KErrNone == err ) - { - err = property->GetValue( brandVersion ); - } - - CleanupStack::PopAndDestroy( property ); - - TRACE( "version: %d", brandVersion ); - - return brandVersion; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::PropertyBrandLanguageL() -// --------------------------------------------------------------------------- -// -TLanguage CVIMPSTEngineServiceTableFetcher::PropertyBrandLanguageL( - TUint32 aServiceId ) - { - TRACER_AUTO; - - TRACE( " ServiceId: %d", aServiceId ); - - // ELangInternationalEnglish is selected as Default Brand Language Id. - TInt brandLanguage = ELangInternationalEnglish; - CSPProperty* property = CSPProperty::NewLC(); - TInt err = iSettings->FindPropertyL( aServiceId, - EPropertyBrandLanguage, - *property ); - if ( KErrNone == err ) - { - err = property->GetValue( brandLanguage ); - } - CleanupStack::PopAndDestroy( property ); - - TRACE( "brandLanguage: (%d) ", brandLanguage ); - - - return ((TLanguage) (brandLanguage) ); - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::ContactViewUidL() -// --------------------------------------------------------------------------- -// -TUint32 CVIMPSTEngineServiceTableFetcher::ContactViewUidL( - TUint32 aServiceId ) - { - TRACER_AUTO; - - TRACE( "ServiceId: %d", aServiceId ); - - TInt contactViewUid = KErrNotFound; - CSPProperty* property = CSPProperty::NewLC(); - TInt err = iSettings->FindPropertyL( aServiceId, - EPropertyContactViewPluginId, - *property ); - if ( KErrNone == err ) - { - property->GetValue( contactViewUid ); - } - CleanupStack::PopAndDestroy( property ); - - TRACE( "ContactViewUid: %d", contactViewUid ); - - - return contactViewUid; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::GetServiceNameL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineServiceTableFetcher::GetServiceNameL( - TUint32 aServiceId, TDes& aServiceName ) - { - TRACER_AUTO; - - TRACE( "ServiceId: %d", aServiceId ); - - CSPEntry* entry = CSPEntry::NewLC(); - TInt err = iSettings->FindEntryL( aServiceId, *entry ) ; - if ( !err ) - { - aServiceName = entry->GetServiceName(); - } - - CleanupStack::PopAndDestroy( entry ); - - TRACE("ServiceName: %S", &aServiceName ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::DoHandleNotifyChangeL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineServiceTableFetcher::DoHandleNotifyChangeL( - TServiceId aServiceId, TBool aNewService, MVIMPSTEngine* aEngine ) - { - TRACER_AUTO; - TRACE( "ServiceId:%d", aServiceId ); - TBool serviceFound( EFalse ); - if(!aNewService) - { - RArray serviceIdArray; - CleanupClosePushL( serviceIdArray ); - RArray services; - CleanupClosePushL( services ); - GetMasterServiceIdsL(serviceIdArray); - iSettings->FindServiceIdsL(services ); - const TInt serviceCount = services.Count(); - for ( TInt index = 0 ; index < serviceCount ; index++ ) - { - if ( services[index] == aServiceId ) - { - TRACE( "Service (%d) found", aServiceId ); - serviceFound = ETrue; - } - } - CleanupStack::PopAndDestroy( &services ); - CleanupStack::PopAndDestroy( &serviceIdArray ); - } - if ( aNewService || !serviceFound ) // new service or MECO service not found - { - // check if any other services other then MECO exists before - // shutting down the phonebook. there can be services which does't use - // MECO UI ( example OVI - does't use MECO UI it uses own UI ) - // check with the property EPropertyContactViewPluginId in the service - // this will the meco UID in case of MECO Service. - //this is a temperory hack as phonebook doesnot refresh once we delete or add any service - //once phonebook gives a permanant fix ,remove the below code - if(( TUid::Uid(ContactViewUidL( aServiceId )) == TUid::Uid( KIMCONTACTSEXTNIMPLEMENTATIONUID )) || aEngine ) - { // only MecoServicetabs shutdown phonebook. - TRACE( "removing service" ); //or while deleting service from settings - CompressViewIdsL(); //check whether engine exists,which is true for only MecoServicetabs. - if(aEngine) - { - aEngine->DeleteDataBaseL(); - } - ShutDownPhonebookL(); - } - TRACE( "service removed" ); - } - - } -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::CompressViewIdsL() -// --------------------------------------------------------------------------- -// -TBool CVIMPSTEngineServiceTableFetcher::CompressViewIdsL( - TServiceId aServiceId ) - { - TRACER_AUTO; - TRACE(" ServiceId: %d", aServiceId ); - - TBool ret = EFalse; - // Compress view id's in service table - RArray services; - CleanupClosePushL( services ); - iSettings->FindServiceIdsL( services ); - TUint32 serviceId = 0; - const TInt serviceCount = services.Count(); - for ( TInt i( 0 ); i < serviceCount; i++ ) - { - serviceId = services[i]; - TUint32 refContactUid = ContactViewUidL( serviceId ); - if ( TUid::Uid( refContactUid ) == - TUid::Uid( KIMCONTACTSEXTNIMPLEMENTATIONUID ) ) - { - - TRACE( " -> compressing view ids, service: %d", serviceId ); - TRACE( " -> compressing view ids, view id: (%d)", ( KVIMPSTTabbedViewIdBase+ serviceId ) ); - - WriteTabViewIdToServiceTableL( services[ i ], ( KVIMPSTTabbedViewIdBase + serviceId ) ); - - ret = ETrue; - } - } - CleanupStack::PopAndDestroy( &services ); - - TRACE( "CompressViewIdsL returns: (%d)", ret ); - - return ret; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::WriteTabViewIdToServiceTableL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineServiceTableFetcher::WriteTabViewIdToServiceTableL( - TUint32 aServiceId, TUint aViewId ) - { - TRACER_AUTO; - - TRACE( "aServiceId: %d, aViewId: %d ",aServiceId, aViewId ); - - // Write specific view id to service table - // No need to check for error beacuse - // we need to add/update the property - - - CSPProperty* property = CSPProperty::NewLC(); - iSettings->FindPropertyL( aServiceId, - EPropertyContactViewId, - *property ); - - TRACE( " OK"); - - TInt err = property->SetName( EPropertyContactViewId ); - - TRACE( " ERR1=%d", err ); - - TInt err2 = property->SetValue( aViewId ); - - if ( !err && !err2 ) - { - iSettings->AddOrUpdatePropertyL( aServiceId, *property ); - } - - TRACE(" ERR2=%d", err2 ); - - - CleanupStack::PopAndDestroy( property ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::ShutDownPhonebookL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineServiceTableFetcher::ShutDownPhonebookL() - { - TRACER_AUTO; - - // Kills phonebook if running - RWsSession ws; - User::LeaveIfError( ws.Connect() ); - CleanupClosePushL( ws ); - TApaTaskList list( ws ); - TUid uid = { KPbk2UID3 }; - TApaTask task( list.FindApp( uid ) ); - if ( task.Exists() ) - { - task.EndTask(); - } - CleanupStack::PopAndDestroy( &ws ); // ws - - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::XimpAdapterUidL() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineServiceTableFetcher::XimpAdapterUidL( - TUint32 aServiceId ) - { - TRACER_AUTO; - - TRACE( "ServiceId: %d", aServiceId ); - - TInt ret = KErrNotFound; - CSPProperty* property = CSPProperty::NewLC(); - - TInt err = iSettings->FindPropertyL( aServiceId, - EPropertyPCSPluginId, - *property ); - if (KErrNone == err) - { - property->GetValue( ret ); - } - - CleanupStack::PopAndDestroy( property ); - - - TRACE( "XimpAdapterUid: %d ",ret ); - - return ret; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::PresenceRequestStatusL() -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::TVIMPSTPresenceRequestStatus -CVIMPSTEngineServiceTableFetcher::PresenceRequestStatusL( - TUint32 aServiceId ) - { - TRACER_AUTO; - - TRACE( " ServiceId: %d", aServiceId ); - - TVIMPSTEnums::TVIMPSTPresenceRequestStatus ret = - TVIMPSTEnums::ESVCEPresenceRequestStatusUnKnown; - - CSPProperty* property = CSPProperty::NewLC(); - - TInt err = iSettings->FindPropertyL( aServiceId, - ESubPropertyPresenceRequestPreference, - *property ); - if ( KErrNone == err ) - { - TOnOff value = EOff; - err = property->GetValue( value ); - if ( !err ) - { - if ( EOn == value ) - { - ret = TVIMPSTEnums::ESVCEPresenceRequestStatusAutoAccept; - } - else - { - ret = TVIMPSTEnums::ESVCEPresenceRequestStatusAlwaysAsk; - } - } - } - - CleanupStack::PopAndDestroy( property ); - - TRACE("PresenceRequestStatus: %d ", ret ); - - return ret; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineServiceTableFetcher::GetDefaultDomainNameL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineServiceTableFetcher::GetDefaultDomainNameL( - TUint32 aServiceId, TDes& aDefaultDomainName ) - { - TRACER_AUTO; - - - TRACE( "ServiceId: %d", aServiceId ); - - CSPProperty* property = CSPProperty::NewLC(); - TInt err = iSettings->FindPropertyL( aServiceId, - ESubPropertyPresenceAddrScheme, - *property ); - if (KErrNone == err) - { - property->GetValue( aDefaultDomainName ); - } - - CleanupStack::PopAndDestroy( property ); - - TRACE( " StoreId: %S", &aDefaultDomainName ); - - - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginesessioncntxtobserver.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginesessioncntxtobserver.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,665 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for CVIMPSTEngineSessionCntxtObserver -* -*/ - - -#include "cvimpstenginesessioncntxtobserver.h" - - - -#include "tvimpstenums.h" -#include "cvimpstenginerequestmapper.h" -#include "cvimpstenginerequest.h" -#include "mvimpstenginesearchextentioneventobserver.h" -#include "mvimpstenginesessioncntxtobserver.h" -//ximpfw -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "uiservicetabtracer.h" - -//xmppsettings -#include "xmppparams.h" -#include "xmppservicesettingsapi.h" - - -// ============================ MEMBER FUNCTIONS ============================== - -// --------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::NewL -// two phase construction -// --------------------------------------------------------- -CVIMPSTEngineSessionCntxtObserver* CVIMPSTEngineSessionCntxtObserver::NewL( TUint32 aServiceId ) - { - TRACER_AUTO; - CVIMPSTEngineSessionCntxtObserver* self = - CVIMPSTEngineSessionCntxtObserver::NewLC( aServiceId); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::NewLC -// two phase construction -// --------------------------------------------------------- -CVIMPSTEngineSessionCntxtObserver* CVIMPSTEngineSessionCntxtObserver::NewLC(TUint32 aServiceId) - { - TRACER_AUTO; - CVIMPSTEngineSessionCntxtObserver* self = new - (ELeave) CVIMPSTEngineSessionCntxtObserver( aServiceId); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::ConstructL -// two phase construction -// --------------------------------------------------------- -void CVIMPSTEngineSessionCntxtObserver::ConstructL() - { - TRACER_AUTO; - iRequestMapper = CVIMPSTEngineRequestMapper::NewL(); - iReqResult = KErrNone; - iClient = MXIMPClient::NewClientL(); - //Create new sink to receive ximp context events - iPresenceCtx = iClient->NewPresenceContextLC(); - // ignore code scanner warning, it gives panic - CleanupStack::Pop();// because of LC method - - iFeatures = MPresenceFeatures::NewL(iPresenceCtx); - - //Stores the XIMPFw EventTypes Subscribed for - iAcceptedEventTypes.Reset(); - iAcceptedEventTypes.AppendL( MXIMPRequestCompleteEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MXIMPContextStateEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MPresentityGroupContentEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MPresenceGrantRequestListEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MSearchEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MSearchKeysEvent::KInterfaceId ); - iAcceptedEventTypes.AppendL( MPresenceBlockListEvent::KInterfaceId ); - - TArray< TInt32 > eventFilterArray = iAcceptedEventTypes.Array(); - - // register this to prsence context - iPresenceCtx->RegisterObserverL( *this, &eventFilterArray ); - - } - -// --------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::~CVIMPSTEngineSessionCntxtObserver -// destructor -// --------------------------------------------------------- -CVIMPSTEngineSessionCntxtObserver::~CVIMPSTEngineSessionCntxtObserver() - { - TRACER_AUTO; - iObserverArray.Reset(); - iObserverArray.Close(); - - iAcceptedEventTypes.Reset(); - iAcceptedEventTypes.Close(); - delete iFeatures; - - if(iPresenceCtx) - { - iPresenceCtx->UnregisterObserver( *this ); - delete iPresenceCtx; - } - - delete iClient; - delete iRequestMapper; - } - -// --------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::CVIMPSTEngineSessionCntxtObserver -// --------------------------------------------------------- -CVIMPSTEngineSessionCntxtObserver::CVIMPSTEngineSessionCntxtObserver(TUint32 aServiceId) -:iServiceId(aServiceId), - iBindStatus( TVIMPSTEnums::EVIMPSTBindNotDone ) - { - } - -// =========================================================================== -// FROM MPRFWximpCONTEXTOBSERVER -// =========================================================================== -// -// --------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::HandlePresenceContextEvent -// --------------------------------------------------------- -void CVIMPSTEngineSessionCntxtObserver::HandlePresenceContextEvent( - const MXIMPContext& aContext, - const MXIMPBase& aEvent ) - { - TRACER_AUTO; - TRAP_IGNORE(DoHandlePresenceContextEventL( aContext, aEvent )); - } - - -// --------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::GetCompletedReqResult -// -// --------------------------------------------------------- -TInt CVIMPSTEngineSessionCntxtObserver::GetCompletedReqResult() const - { - return iReqResult; - } - -// --------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::CVIMPSTEngineSessionCntxtObserver -// -// --------------------------------------------------------- -CVIMPSTEngineRequestMapper* CVIMPSTEngineSessionCntxtObserver:: - GetRequestMapper() const - { - return iRequestMapper; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::ContextBindStatus -// -// --------------------------------------------------------- -TVIMPSTEnums::TVIMPSTBindStatus CVIMPSTEngineSessionCntxtObserver::ContextBindStatus() - { - return iBindStatus; - } -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::ServerBindL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineSessionCntxtObserver::ServerBindL(TUid aProtocolUid) - { - TRACER_AUTO; - TInt err = KErrNotFound; - //Bind context to desired presence service - if ( TVIMPSTEnums::EVIMPSTBindDone != iBindStatus ) - { - TXIMPRequestId operationId = TXIMPRequestId::Null(); - TRAP( err, operationId = iPresenceCtx->BindToL( - aProtocolUid, iServiceId ) ); - if ( err ) - { - // XIMP queues all operations except bind operation. If there is - // unbind operation pending in ximp side, bind call will leave - // with KErrAlreadyExists. Client side is not ideal place to - // handle this type of logic so to work around this problem, this - // case is flagged here. When unbind completes, rebind is done. - // If unbind is called between these operations, flag is set - // ESVCEPresenceBindNotDone to avoid bind if service was disabled - TRACE( "err: %d", err); - iBindStatus = TVIMPSTEnums::EVIMPSTBindFailureMode; - } - else - { - //create the requestmapper for the corresponidng reuqest id. - iRequestMapper->CreateRequestL(operationId,ETrue,EVIMPSTXimpOperationBind); - iBindStatus = TVIMPSTEnums::EVIMPSTBindDone; - iFeatureSupported = EVIMPSTFeatureUnknown; - TRAP(err,IdentifySupportedFeaturesL()); - } - } - else - { - err = KErrNone; - } - return err; - } -// --------------------------------------------------------------------------- -// CVIMPSTEngineVoIPPrecenseHandler::ServerUnBindL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineSessionCntxtObserver::ServerUnBindL( - TBool aDoUnsubscribe ) - { - TRACER_AUTO; - TInt err = KErrNotFound; - if ( TVIMPSTEnums::EVIMPSTBindDone == iBindStatus ) - { - if ( aDoUnsubscribe ) - { - iBindStatus = TVIMPSTEnums::EVIMPSTUnBinding; - } - - TRACE( " do unbind"); - TXIMPRequestId operationId = TXIMPRequestId::Null(); - TRAP( err, operationId = iPresenceCtx->UnbindL()); - iBindStatus = TVIMPSTEnums::EVIMPSTUnBindWaiting; - iRequestMapper->CreateRequestL(operationId,EFalse,EVIMPSTXimpOperationUnBind) ; - iBindStatus = TVIMPSTEnums::EVIMPSTBindNotDone; - iFeatureSupported = EVIMPSTFeatureUnknown; - } - else if ( TVIMPSTEnums::EVIMPSTBindFailureMode == iBindStatus ) - { - // Disable flag here. If service is really disabled, we must not - // rebind when unbind completes. - iBindStatus = TVIMPSTEnums::EVIMPSTBindNotDone; - } - return err; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::UriFromXimpOperationLC -// --------------------------------------------------------------------------- -// -HBufC* CVIMPSTEngineSessionCntxtObserver::UriFromXimpOperationLC(const MXIMPBase& aEvent ) - { - TRACER_AUTO; - const MPresentityPresenceEvent& event = - *TXIMPGetInterface< const MPresentityPresenceEvent >::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - HBufC* retValue = NULL; - retValue = event.PresentityId().Identity().AllocLC(); - if(!retValue) - { - retValue = KNullDesC().AllocLC(); - } - return retValue; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::DoHandlePresenceContextEventL -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineSessionCntxtObserver::DoHandlePresenceContextEventL( - const MXIMPContext& aContext, - const MXIMPBase& aEvent ) - { - TRACER_AUTO; - const TInt32 eventId = aEvent.GetInterfaceId(); - - switch( aEvent.GetInterfaceId() ) - { - case MXIMPRequestCompleteEvent::KInterfaceId: - { - - TRACE( "InsideCallbackswitch::MXIMPRequestCompleteEvent start"); - const MXIMPRequestCompleteEvent* event = - TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - - iReqResult = event->CompletionResult().ResultCode(); - const TXIMPRequestId& reqId = event->RequestId(); - // Note:FindRequestId does not pass the ownership. hanece req - // should not be deleted. - CVIMPSTEngineRequest *req = iRequestMapper->FindRequestId( reqId ); - - if ( req ) - { - TXimpOperation operation = req->RequestType(); - - //contact mgmt & search will remove their own requests - //presence subservice should also do the same - //untill then use the below if check - //TBD - if ( (operation>EVIMPSTXimpOperationNoOperation)&& - (operation<=EVIMPSTXimpOperationUnsubscribe) ) - { - req->StopWait() ; - iRequestMapper->RemoveRequestId(reqId); - } - - TInt count = iObserverArray.Count(); - - for(TInt i = 0; i < count; i++) - { - iObserverArray[i]->HandleSessionContextEventL(aContext, - aEvent, - operation); - } - } - TRACE("InsideCallbackswitch::MXIMPRequestCompleteEvent end"); - break; - } - - case MXIMPContextStateEvent::KInterfaceId: - { - TRACE( "InsideCallbackswitch::MXIMPContextStateEvent"); - break; - } - case MPresentityPresenceEvent::KInterfaceId: - { - TRACE( "InsideCallbackswitch::::MPresentityPresenceEvent start"); - TInt count = iObserverArray.Count(); - for(TInt i = 0; i < count; i++) - { - iObserverArray[i]->HandleSessionContextEventL(aContext,aEvent); - } - TRACE( "InsideCallbackswitch::::MPresentityPresenceEvent end"); - break; - } - case MPresentityGroupContentEvent::KInterfaceId: - { - TRACE( "InsideCallbackswitch::::MPresentityGroupContentEvent start"); - TInt count = iObserverArray.Count(); - for(TInt i = 0; i < count; i++) - { - iObserverArray[i]->HandleSessionContextEventL(aContext,aEvent); - } - TRACE( "InsideCallbackswitch::::MPresentityGroupContentEvent end"); - break; - } - case MPresenceGrantRequestListEvent::KInterfaceId: - { - TRACE("InsideCallbackswitch::::MPresenceGrantRequestListEvent start"); - TInt count = iObserverArray.Count(); - for(TInt i = 0; i < count; i++) - { - iObserverArray[i]->HandleSessionContextEventL(aContext,aEvent); - } - TRACE( "InsideCallbackswitch::::MPresenceGrantRequestListEvent end"); - break; - } - - case MSearchEvent::KInterfaceId: - { - TRACE( "InsideCallbackswitch::::MSearchEvent start"); - - TInt count = iObserverArray.Count(); - for(TInt i = 0; i < count; i++) - { - iObserverArray[i]->HandleSessionContextEventL(aContext,aEvent); - } - TRACE( "InsideCallbackswitch::::MSearchEvent end"); - - break; - } - case MSearchKeysEvent::KInterfaceId: - { - TRACE( "InsideCallbackswitch::::MSearchKeysEvent start"); - TInt count = iObserverArray.Count(); - for(TInt i = 0; i < count; i++) - { - iObserverArray[i]->HandleSessionContextEventL(aContext,aEvent); - } - TRACE( "InsideCallbackswitch::::MSearchKeysEvent end"); - - break; - } - case MPresenceBlockListEvent::KInterfaceId: - { - TRACE( "InsideCallbackswitch::::MPresenceBlockListEvent start"); - TInt count = iObserverArray.Count(); - for(TInt i = 0; i < count; i++) - { - iObserverArray[i]->HandleSessionContextEventL(aContext,aEvent); - } - TRACE( "InsideCallbackswitch::::MPresenceBlockListEvent end"); - break; - } - - default: - { - break; - } - } - } -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::XimpAuthorizationL -// --------------------------------------------------------------------------- -// -MPresenceAuthorization& -CVIMPSTEngineSessionCntxtObserver::XimpAuthorizationL() - { - TRACER_AUTO; - __ASSERT_ALWAYS( iFeatures, User::Leave( KErrNotSupported )); - __ASSERT_ALWAYS( &iFeatures->PresenceAuthorization(), - User::Leave( KErrNotSupported )); - return iFeatures->PresenceAuthorization(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::XimpPresenceWatchingL -// --------------------------------------------------------------------------- -// -MPresenceWatching& -CVIMPSTEngineSessionCntxtObserver::XimpPresenceWatchingL() - { - __ASSERT_ALWAYS( iFeatures, User::Leave( KErrNotSupported )); - __ASSERT_ALWAYS( &iFeatures->PresenceWatching(), - User::Leave( KErrNotSupported )); - return iFeatures->PresenceWatching(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::XimpPresentityGroupsL -// --------------------------------------------------------------------------- -// -MPresentityGroups& -CVIMPSTEngineSessionCntxtObserver::XimpPresentityGroupsL() - { - __ASSERT_ALWAYS( iFeatures, User::Leave( KErrNotSupported )); - __ASSERT_ALWAYS( &iFeatures->PresentityGroups(), - User::Leave( KErrNotSupported )); - return iFeatures->PresentityGroups(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::XimpPresencePublishingL -// --------------------------------------------------------------------------- -// -MPresencePublishing& -CVIMPSTEngineSessionCntxtObserver::XimpPresencePublishingL() - { - __ASSERT_ALWAYS( iFeatures, User::Leave( KErrNotSupported )); - __ASSERT_ALWAYS( &iFeatures->PresencePublishing(), - User::Leave( KErrNotSupported )); - return iFeatures->PresencePublishing(); - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::XimpPresenceContext -// --------------------------------------------------------------------------- -// -MXIMPContext& -CVIMPSTEngineSessionCntxtObserver::XimpPresenceContextL() - { - __ASSERT_ALWAYS( iPresenceCtx, User::Leave( KErrNotFound )); - return *iPresenceCtx; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::PresenceObjectFactory -// --------------------------------------------------------------------------- -// -MPresenceObjectFactory& CVIMPSTEngineSessionCntxtObserver::PresenceObjectFactoryL() const - { - __ASSERT_ALWAYS( iFeatures, User::Leave( KErrNotFound )); - return iFeatures->PresenceObjectFactory(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::PresenceFeaturesL -// --------------------------------------------------------------------------- -// -MPresenceFeatures& CVIMPSTEngineSessionCntxtObserver::PresenceFeaturesL() const - { - __ASSERT_ALWAYS( iFeatures, User::Leave( KErrNotFound )); - return *iFeatures; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::RegisterObserver -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineSessionCntxtObserver::RegisterObserver(MVIMPSTEngineSessionCntxtObserver* aObserver) - { - TRACER_AUTO; - if (aObserver) - { - - TInt index = iObserverArray.Find(aObserver); - if( index == KErrNotFound ) - { - iObserverArray.Append( aObserver ); - } - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::UnRegisterObserver -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineSessionCntxtObserver::UnRegisterObserver(MVIMPSTEngineSessionCntxtObserver* aObserver) - { - TRACER_AUTO; - if (aObserver) - { - TInt index = iObserverArray.Find(aObserver); - - if( index >=0 ) - { - iObserverArray.Remove( index ); - iObserverArray.Compress(); - } - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::IdentifySupportedFeaturesL -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineSessionCntxtObserver::IdentifySupportedFeaturesL() - { - TRACER_AUTO; - using namespace NXIMPFeature::Presence; - using namespace NXIMPFeature::InstantMessage; - using namespace NXIMPFeature::Search; - using namespace NXIMPFeature::PresentityGroups; - - MXIMPFeatureInfo* ximpCtxFeats = iPresenceCtx->GetContextFeaturesLC(); - //get the supproted features from ximpfw adaptation. - if( ximpCtxFeats ) - { - CleanupStack::Pop() ; //iXimpctxFeat - - const MDesC8Array& supportedFeatures = ximpCtxFeats->FeatureIds(); - - TInt count = supportedFeatures.MdcaCount(); - - for(TInt index = 0; index < count; index++) - { - TPtrC8 feature = supportedFeatures.MdcaPoint(index); - - if ( !(iFeatureSupported & EVIMPSTFeaturePublish) && !(KPublish().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeaturePublish; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureFetch) && !(KFetch().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureFetch; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureSubscribe) && !(KSubscribe().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureSubscribe; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureUnsubscribe) && !(KUnsubscribe().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureUnsubscribe; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureAddContact) && !(KAddContact().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureAddContact; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureDeleteContact) && !(KDeleteContact().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureDeleteContact; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureBlock) && !(KBlock().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureBlock; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureUnBlock) && !(KUnBlock().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureUnBlock; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureAvatar) && !(KAvatar().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureAvatar; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureCreateGroup) && !(KCreate().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureCreateGroup; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureDeleteGroup) && !(KDelete().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureDeleteGroup; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureInstantMessage) && !(KInstantMessage().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureInstantMessage; - - } - else if ( !(iFeatureSupported & EVIMPSTFeatureSearch) && !(KSearch().Compare(feature)) ) - { - iFeatureSupported = iFeatureSupported | EVIMPSTFeatureSearch; - - } - - } - - delete ximpCtxFeats; - } - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineSessionCntxtObserver::GetSupportedFeatures -// --------------------------------------------------------------------------- -// -TInt CVIMPSTEngineSessionCntxtObserver::GetSupportedFeatures() - { - return iFeatureSupported; - } - -// end of file - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/cvimpstenginevoipsubservice.cpp --- a/uiservicetab/vimpstengine/src/cvimpstenginevoipsubservice.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,292 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that capsulates single service data members -* -*/ - - -// INCLUDES -#include "cvimpstenginevoipsubservice.h" - -#include "cvimpstenginecchhandler.h" -#include "tvimpstconsts.h" -#include "cvimpstengineservicetablefetcher.h" -#include "mvimpstengineserviceconnectioneventobserver.h" -//debug -#include "uiservicetabtracer.h" - - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::NewL -// -// --------------------------------------------------------- -CVIMPSTEngineVOIPSubService* CVIMPSTEngineVOIPSubService::NewL( TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver - ) - { - TRACER_AUTO; - TRACE( "aServiceId: %d", aServiceId); - - CVIMPSTEngineVOIPSubService* self = CVIMPSTEngineVOIPSubService::NewLC(aServiceId,aCchHandler, - aTableFetcher, aObserver); - CleanupStack::Pop( self ); - - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::NewLC -// -// --------------------------------------------------------- - -CVIMPSTEngineVOIPSubService* CVIMPSTEngineVOIPSubService::NewLC( TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver ) - { - TRACER_AUTO; - TRACE( "aServiceId: %d", aServiceId); - - CVIMPSTEngineVOIPSubService* self = new (ELeave) CVIMPSTEngineVOIPSubService( - aServiceId,aCchHandler,aTableFetcher, - aObserver ); - CleanupStack::PushL( self ); - self->ConstructL( ); - - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::~CVIMPSTEngineVOIPSubService -// -// --------------------------------------------------------- - -CVIMPSTEngineVOIPSubService::~CVIMPSTEngineVOIPSubService() - { - TRACER_AUTO; - - iCchHandler.UnRegisterCchObserver(ECCHVoIPSub); - - } - - -// --------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::ConstructL -// -// --------------------------------------------------------- - -void CVIMPSTEngineVOIPSubService::ConstructL( ) - { - TRACER_AUTO; - - TCCHSubserviceState serviceState = ECCHUninitialized; - TInt error = iCchHandler.GetServiceState( - iServiceId, ECCHVoIPSub, serviceState ); - - iServiceState = ResolveServiceState(serviceState, error); - - iCchHandler.RegisterCchObserverL(this,ECCHVoIPSub); - - TRACE( "ResolveServiceState returned ServiceState: %d", iServiceState ); - - - } - - -// --------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::CVIMPSTEngineVOIPSubService -// -// --------------------------------------------------------- - -CVIMPSTEngineVOIPSubService::CVIMPSTEngineVOIPSubService( TUint32 aServiceId, - CVIMPSTEngineCchHandler& aCchHandler, - CVIMPSTEngineServiceTableFetcher& aTableFetcher, - MVIMPSTEngineServiceConnectionEventObserver& aObserver) : -iServiceId(aServiceId), -iCchHandler(aCchHandler), -iTableFetcher(aTableFetcher), -iType (TVIMPSTEnums::EVoip), -iObserver(aObserver) - { - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::CchEventOccuredL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineVOIPSubService::CchEventOccuredL( TUint /*aServiceId*/, - TCCHSubserviceState aState, TInt aServiceError ) - { - TRACER_AUTO; - TRACE( " TCCHSubserviceState : %d, ServiceErr: %d",aState, aServiceError ); - - if ( aServiceError && ECCHDisabled != aState ) - { - //we might even end up in waiting for connection state for all - //those service which are ALR enabled - //So better check here if you get any CCH errors - iServiceState = ResolveServiceState( aState, aServiceError ); - iObserver.HandleServceConnectionEventL(); - DoHandleCchErrorL( aServiceError ); - } - else - { - iServiceState = ResolveServiceState( aState, aServiceError ); - iObserver.HandleServceConnectionEventL(); - } - - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::DoHandleCchErrorL() -// --------------------------------------------------------------------------- -// -void CVIMPSTEngineVOIPSubService::DoHandleCchErrorL( - TInt aServiceError ) - { - TRACER_AUTO; - TRACE(" ServiceErr: %d", aServiceError ); - - /* - MCchUi& cchUi = iCchHandler.CchUiApi(); - - switch ( aServiceError ) - { - - case KCCHErrorNetworkLost: - { - cchUi.ShowDialogL( iServiceId, MCchUiObserver::ECchUiDialogTypeNoConnectionAvailable ); - break; - } - - default: - { - break; - } - - } - */ - - - } - - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::ResolveServiceState -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEngineVOIPSubService::ResolveServiceState( - TCCHSubserviceState aState, - TInt aServiceError ) - { - TRACER_AUTO; - - TVIMPSTEnums::TVIMPSTRegistrationState state = TVIMPSTEnums::ESVCENotRegistered; - - TRACE( " iServiceId: %d, ServiceState: %d", iServiceId, aState ); - - TBool handleServiceStates = ETrue; - if ( aServiceError && ECCHDisabled != aState ) - { - //Only if the Service supports ALR, the state can goto WaitingForNetwork - //Still API from CCH is required to know whether ALR is supported or not - if ( (KCCHErrorInvalidSettings != aServiceError) && (ECCHConnecting == aState) ) - { - TRACE( "ESVCEWaitingForNetwork" ); - handleServiceStates = EFalse; - state = TVIMPSTEnums::ESVCEWaitingForNetwork; - } - } - - if ( handleServiceStates ) - { - switch ( aState ) - { - case ECCHEnabled: - { - TRACE( " ESVCERegistered" ); - state = TVIMPSTEnums::ESVCERegistered; - } - break; - - case ECCHDisconnecting: - { - TRACE( " ESVCENetworkDisConnecting"); - state = TVIMPSTEnums::ESVCENetworkDisConnecting; - } - break; - - case ECCHUninitialized: - case ECCHDisabled: - { - TRACE( " ESVCENotRegistered" ); - state = TVIMPSTEnums::ESVCENotRegistered; - } - break; - - case ECCHConnecting: - { - TRACE(" ESVCENetworkConnecting" ); - state = TVIMPSTEnums::ESVCENetworkConnecting; - } - break; - - default: - break; - } - } - - - return state; - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::SubServiceState -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTEngineVOIPSubService::SubServiceState() const - { - TRACER_AUTO; - TRACE( " ServiceId: %d ServiceState: %d",iServiceId, iServiceState ); - return iServiceState; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTEngineVOIPSubService::Type -// --------------------------------------------------------------------------- -// -TVIMPSTEnums::SubServiceType CVIMPSTEngineVOIPSubService::Type() const - { - TRACER_AUTO; - TRACE( "Type: %d", iType ); - TRACE( " [0x%x]", this ); - return iType; - } - - - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/src/vimpstenginecasts.cpp --- a/uiservicetab/vimpstengine/src/vimpstenginecasts.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* Copyright (c) 2008 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: Provides the Casr Functions -* -*/ - - -// INCLUDES -#include "mvimpstengineimsubservice.h" -#include "mvimpstenginepresencesubservice.h" -#include "mvimpstenginecontactmgmtextention.h" - -#include "mvimpstenginesearchmgrextention.h" - -enum TPanicCode - { - EPanicTypeMismatch = 1 - }; -#ifdef _DEBUG -void Panic( TPanicCode aPanic ) - { - _LIT( KPanicCat, "VIMPSTEngine::Cast" ); - User::Panic( KPanicCat, aPanic ); - } -#else -void Panic( TPanicCode /*aPanic*/ ) - { - - } -#endif // _DEBUG - - -EXPORT_C MVIMPSTEngineIMSubService& MVIMPSTEngineIMSubService::Cast - (MVIMPSTEngineSubService& aSubService) - { - __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EIM, - Panic(EPanicTypeMismatch) ); - return static_cast(aSubService); - } - -EXPORT_C const MVIMPSTEngineIMSubService& MVIMPSTEngineIMSubService::Cast - (const MVIMPSTEngineSubService& aSubService) - { - __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EIM, - Panic(EPanicTypeMismatch) ); - return static_cast(aSubService); - } - - -EXPORT_C MVIMPSTEnginePresenceSubService& MVIMPSTEnginePresenceSubService::Cast - (MVIMPSTEngineSubService& aSubService) - { - __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EPresence, - Panic(EPanicTypeMismatch) ); - return static_cast(aSubService); - } - -EXPORT_C const MVIMPSTEnginePresenceSubService& MVIMPSTEnginePresenceSubService::Cast - (const MVIMPSTEngineSubService& aSubService) - { - __ASSERT_ALWAYS( aSubService.Type() == TVIMPSTEnums::EPresence, - Panic(EPanicTypeMismatch) ); - return static_cast(aSubService); - } - -EXPORT_C MVIMPSTEngineContactMgmtExtention& MVIMPSTEngineContactMgmtExtention::Cast - (MVIMPSTEngineExtentionFeatures& aExtentionFeature) - { - __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EContactManagement, - Panic(EPanicTypeMismatch) ); - return static_cast(aExtentionFeature); - } - -EXPORT_C const MVIMPSTEngineContactMgmtExtention& MVIMPSTEngineContactMgmtExtention::Cast - (const MVIMPSTEngineExtentionFeatures& aExtentionFeature) - { - __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::EContactManagement, - Panic(EPanicTypeMismatch) ); - return static_cast(aExtentionFeature); - } - -EXPORT_C MVIMPSTEngineSearchMgrExtention& MVIMPSTEngineSearchMgrExtention::Cast - (MVIMPSTEngineExtentionFeatures& aExtentionFeature) - { - __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::ESearch, - Panic(EPanicTypeMismatch) ); - return static_cast(aExtentionFeature); - } - -EXPORT_C const MVIMPSTEngineSearchMgrExtention& MVIMPSTEngineSearchMgrExtention::Cast - (const MVIMPSTEngineExtentionFeatures& aExtentionFeature) - { - __ASSERT_ALWAYS( aExtentionFeature.Type() == TVIMPSTEnums::ESearch, - Panic(EPanicTypeMismatch) ); - return static_cast(aExtentionFeature); - } - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/group/bld.inf --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -/* -* 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: bld.inf -* -*/ -PRJ_PLATFORMS -DEFAULT - -PRJ_TESTMMPFILES -vimpstengine_ut.mmp - -GNUMAKEFILE test_mover.make - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/group/test_mover.make --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/group/test_mover.make Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -FINAL : - echo Copying test DLL to z\sys\bin - copy %epocroot%epoc32\release\winscw\udeb\vimpstengine_ut.dll %epocroot%epoc32\release\winscw\UDEB\z\sys\bin /y - -MAKMAKE FREEZE LIB CLEANLIB RESOURCE RELEASABLES CLEAN BLD SAVESPACE : diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/group/vimpstengine_ut.mmp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/group/vimpstengine_ut.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* 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: vimpstengine_ut.mmp -* -*/ -#include -#include - - -#define KMyUniqueUid3 0x01070006 -#define KEUnitTestDllUid2 0x1000af5a - -TARGET vimpstengine_ut.dll -TARGETTYPE dll -UID KEUnitTestDllUid2 KMyUniqueUid3 - -EPOCALLOWDLLDATA - - -CAPABILITY ALL -TCB -VENDORID VID_DEFAULT - -SOURCEPATH ./../src -SOURCE dllmain.cpp -SOURCE t_vimpstenginevoipsubservice.cpp -SOURCE t_vimpstengineimsubservice.cpp -SOURCE t_vimpstenginecchhandler.cpp -SOURCE t_vimpstengine.cpp -SOURCE t_vimpstengineservicetablefetcher.cpp -SOURCE t_vimpstenginesessioncntxtobserver.cpp -//SOURCE t_vimpstenginesubservicestatelistener.cpp -SOURCE t_vimpstenginerequest.cpp -SOURCE t_vimpstenginerequestmapper.cpp -SOURCE t_vimpstenginecontactmgmtextention.cpp -SOURCE t_vimpstenginepresencesubservice.cpp -//SOURCE t_vimpstenginesearchmgrextention.cpp - -SOURCEPATH ./../src/stubs -SOURCE s_cch.cpp -SOURCE s_spsettings.cpp -SOURCE s_spentry.cpp -SOURCE s_spproperty.cpp -SOURCE s_wssession.cpp -SOURCE s_rproperty.cpp -SOURCE s_user.cpp -SOURCE s_cactive.cpp -SOURCE s_imcache.cpp -SOURCE s_ximprequestcompleteevent.cpp -SOURCE s_ximpclient.cpp -SOURCE s_ximpcontext.cpp -SOURCE s_presentitygroups.cpp -SOURCE s_presencefeatures.cpp -SOURCE s_ximpidentity.cpp -SOURCE s_ximpobjectfactory.cpp -SOURCE s_ximppresensitypresenceevent.cpp -SOURCE s_ximpcontextstateevent.cpp -SOURCE s_ximppresensitygroupcontentevent.cpp -SOURCE s_ximppresencegrantrequestlistevent.cpp -SOURCE s_ximpsearchevent.cpp -SOURCE s_ximpsearchkeysevent.cpp -SOURCE s_ximppresenceauthorization.cpp - -SOURCE s_presencewatching.cpp -SOURCE s_presenceobjectfactory.cpp -SOURCE s_presencebuddyinfo2.cpp -SOURCE s_presencecachereader2.cpp // new stub for presence cache -SOURCE s_presencebuddyinfolist.cpp -SOURCE s_presencegrantrequestinfo.cpp -SOURCE s_presenceinfo.cpp -SOURCE s_presenceinfofield.cpp -SOURCE s_presenceinfofieldcollection.cpp -SOURCE s_presenceinfofieldvalueenum.cpp -SOURCE s_presenceinfofieldvaluetext.cpp -SOURCE s_presencepersoninfo.cpp -SOURCE s_presencepublishing.cpp -SOURCE s_servicepresenceinfo.cpp -SOURCE s_presenceblockinfo.cpp -// storage -SOURCE s_vimpststoragecontactlist.cpp -SOURCE s_vimpststoragecontact.cpp -SOURCE s_vimpstengineaimagehandler.cpp -SOURCE s_vimpstsettingsstore.cpp -SOURCE s_vimpstsettingsstoreimp.cpp -//SOURCE s_CVIMPSTEngineSessionCntxtObserver.cpp -SOURCE s_vimpststorageserviceview.cpp - -SOURCEPATH ./../../../../vimpstengine/src -SOURCE cvimpstengineimsubservice.cpp -SOURCE cvimpstenginevoipsubservice.cpp -SOURCE cvimpstenginesessioncntxtobserver.cpp -SOURCE cvimpstenginecchhandler.cpp -SOURCE cvimpstengine.cpp -SOURCE cvimpstengineservicetablefetcher.cpp -//SOURCE cvimpstenginesubservicestatelistener.cpp -SOURCE cvimpstenginerequest.cpp -SOURCE cvimpstenginerequestmapper.cpp -SOURCE cvimpstenginecontactmgmtextention.cpp -SOURCE cvimpstenginesearchmgrextention.cpp -SOURCE cvimpstenginepresencesubservice.cpp -SOURCE vimpstenginecasts.cpp -SOURCE cvimpstblockedlistmanager.cpp - - - -APP_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/Digia/EUnit -SYSTEMINCLUDE /epoc32/include/ecom - -USERINCLUDE ./../src/stubs -USERINCLUDE ./../inc -USERINCLUDE ./../../../../vimpstengine/inc -USERINCLUDE ./../../../../vimpststorage/inc -USERINCLUDE ./../../../../vimpstutils/inc -USERINCLUDE ./../../../../inc -USERINCLUDE ./../../../../../inc - -USERINCLUDE ./../../../../../imstutils/imconnectionprovider/inc - -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY EUnit.lib -LIBRARY flogger.lib -LIBRARY bafl.lib -LIBRARY cch.lib -LIBRARY cntmodel.lib - -//end of file - - - - - -SOURCEPATH ../src/stubs -SOURCE s_vimpststoragemanagerfactory.cpp diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstengine.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstengine.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* 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: t_vimpstengine.h -* -*/ -#ifndef _T_VimpstEngine_H_ -#define _T_VimpstEngine_H_ - -// EXTERNAL INCLUDES -#include - -#include "mvimpstengineservicestateeventobserver.h" - -//Forward declarations -class CVIMPSTEngine; -class CVIMPSTEngineServiceTableFetcher; - -class T_VimpstEngine : public CEUnitTestSuiteClass, public MVIMPSTEngineServiceStateEventObserver - { - public: - - static T_VimpstEngine* NewLC(); - ~T_VimpstEngine(); - - private: - - void ConstructL(); - void SetupL(); - void Teardown(); - - // From observers - void HandleServiceEventL( - TVIMPSTEnums::TVIMPSTRegistrationState aState, - TInt aServiceError); - - // Help methods - TInt CreateSpEntryL( TInt aServiceId ); - - // Test methods - void T_NewLL(); - void T_LoginL(); - void T_LogoutL(); - void T_ServiceIdL(); - void T_ServiceNameL(); - void T_ServiceStateL(); - void T_GetBrandInfoLL(); - void T_IsSubServiceSupportedLL(); - void T_IsSubServiceEnabledL(); - void T_ContactStoreIdLL(); - void T_RegisterServiceSessionObserverLL(); - void T_UnRegisterServiceSessionObserverLL(); - void T_IntializeStorageLL(); - void T_UnIntializeStorageLL(); - //void T_SetUserNameL(); - //void T_SetPasswordL(); - // void T_UserNameLL(); - // void T_PasswordLL(); - void T_SubServiceL(); - void T_ExtentionFeaturesL(); - void T_AddExtentionFeaturesLL(); - void T_RemoveExtentionFeaturesL(); - void T_HandleServceConnectionEventLL(); - void T_ParseGetServiceStateL(); - void T_HandleContactFetchedLL(); - // void T_HandleContactAddedLL(); - // void T_HandleContactDeletedLL(); - void T_CreateExtentionFeaturesLL(); - void T_SetPassword(); - void T_EmptySetPassword(); - // void T_SetUserNameL(); - // void T_EmptySetUserNameL(); - // void T_WithDomainNameSetUserNameL(); - void T_BlockNotSupported(); - void T_BlockSupported(); - void T_FetchBlockedListL(); - void T_RegisterBlockedListObserver(); - - private: - - T_VimpstEngine() {}; - - private: - CVIMPSTEngine* iEngine; - CVIMPSTEngineServiceTableFetcher* iServiceTableFetcher; - - TInt iTestServiceId; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_VimpstEngine_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginecchhandler.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginecchhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* 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: t_vimpstenginecchhandler.h -* -*/ -#ifndef _T_VimpstEngineCchHandler_H_ -#define _T_VimpstEngineCchHandler_H_ - -// EXTERNAL INCLUDES -#include - -#include "mvimpstenginecchhandlerobserver.h" -#include "mvimpstenginecchuieventobserver.h" -//Forward declarations -class CVIMPSTEngineCchHandler; - -class T_VimpstEngineCchHandler : public CEUnitTestSuiteClass, - public MVIMPSTEngineCchHandlerObserver - { - public: - - static T_VimpstEngineCchHandler* NewLC(); - ~T_VimpstEngineCchHandler(); - - private: - - void ConstructL(); - void SetupL(); - void SetupL1(); - void Teardown(); - - void TestConstructionL(); - void TestGetServiceStateServiceNotFoundL(); - void TestGetServiceStateServiceFoundL(); - - - void TestEnableServiceServiceFoundL() ; - void TestEnableServiceServiceNotFoundL(); - - // void ValidateServiceServiceNotFoundL(); - - // void ValidateServiceAllSubserviceAvailableL(); - - // void ValidateServiceAnyOneSubserviceAvailableL(); - - void GetConParametersServiceNotFoundL(); - void GetConParametersServiceFoundL(); - void GetConParametersLeavesServiceFoundL(); - - void SetConParametersServiceNotFoundL(); - void SetConParametersServiceFoundL(); - void SetConParametersLeavesServiceFoundL(); - - void TestDisableServiceServiceFoundL() ; - void TestDisableServiceServiceNotFoundL(); - - void ShutdownCch(); - - void CheckObservingForPresenceSubServiceL(); - void CheckObservingWithoutRegisteringL(); - void RegisterObserverWithNull(); - void CheckNoObservingForPrsenceSubServiceL(); - - private: //From MVIMPSTEngineCchHandlerObserver - void CchEventOccuredL( - TUint aServiceId, - TCCHSubserviceState aState, - TInt aServiceError ) ; - private: - - T_VimpstEngineCchHandler() {}; - - private: - CVIMPSTEngineCchHandler* iCChHandler; - MVIMPSTEngineCchUiEventObserver* iCchUiEventObserver; - - TBool iCallingEnable; - - TBool iGotObserverEvent; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_CSCPUtility_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginecontactmgmtextention.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginecontactmgmtextention.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* 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: t_vimpstenginecontactmgmtextention.h -* -*/ -#ifndef _T_VIMPSTEngineContactMgmtExtention_H_ -#define _T_VIMPSTEngineContactMgmtExtention_H_ - -// EXTERNAL INCLUDES -#include - - -#include "cvimpstenginecontactmgmtextention.h" - -//Forward declarations -class CVIMPSTEngineContactMgmtExtention; -class MXIMPClient; -class MXIMPContext; -class MPresenceFeatures; -class CVIMPSTEngineRequestMapper; - -class T_VIMPSTEngineContactMgmtExtention : public CEUnitTestSuiteClass - { - public: - - static T_VIMPSTEngineContactMgmtExtention* NewLC(); - ~T_VIMPSTEngineContactMgmtExtention(); - - private: - - void ConstructL(); - void SetupL(); - void Teardown(); - - void TestConstructionL(); - void TestCreateIdentityNormalL(); - - - void TestAddServerContactSuccessValidDataL(); - void TestAddServerContactSuccessWithDataLengthZeroL(); - - void TestAddServerContactErrorValidDataL(); - - void TestIsSupported(); - void TestType(); - - void TestDeleteServerContactSuccessValidDataL(); - void TestDeleteServerContactSuccessWithDataLengthZeroL(); - - void TestDeleteServerContactErrorValidDataL(); - - void TestHandleSessionContextEventOperationDeleteL(); - void TestHandleSessionContextEventOperationAddL(); - - void TestHandleSessionContextEventOperationDeleteErrNoneL(); - void TestHandleSessionContextEventOperationAddErrNoneL(); - void TestHandleSessionContextEventOperationDeleteNotSupportedL(); - void TestHandleSessionContextEventOperationAddNotSupportedL(); - void TestHandleSessionContextEventOperationNotValidOperationL(); - - - private: - - T_VIMPSTEngineContactMgmtExtention() {}; - - - private: - CVIMPSTEngineContactMgmtExtention* iContactManager; - - MXIMPClient* iClient; - //Create new sink to receive ximp context events - MXIMPContext* iPresenceCtx; - - MPresenceFeatures* iFeatures; - - MPresentityGroups* iGroups; - - CVIMPSTEngineRequestMapper* iRequestMapper; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_CSCPUtility_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstengineimsubservice.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstengineimsubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/* -* 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: t_vimpstengineimsubservice.h -* -*/ -#ifndef _T_VimpstEngineImSubService_H_ -#define _T_VimpstEngineImSubService_H_ - -// EXTERNAL INCLUDES -#include -#include "mvimpstengineserviceconnectioneventobserver.h" -#include "mvimpstengineimsubserviceeventobserver.h" // MVIMPSTEngineIMSubServiceEventObserver -#include "mvimpstenginecchuieventobserver.h" - -class CVIMPSTEngineIMSubService; -class CVIMPSTEngineCchHandler; -class CVIMPSTEngineServiceTableFetcher; -class T_VimpstEngineImSubService : - public CEUnitTestSuiteClass, - public MVIMPSTEngineServiceConnectionEventObserver, - public MVIMPSTEngineIMSubServiceEventObserver - { - public: - - static T_VimpstEngineImSubService* NewLC(); - ~T_VimpstEngineImSubService(); - - public: // From observer interface - - // From MVIMPSTEngineServiceConnectionEventObserver - void HandleServceConnectionEventL( ); - - // From MVIMPSTEngineIMSubServiceEventObserver - void HandleChatMessageEventL(TVIMPSTEnums::TIMEventType aEventType ,const TDesC& aSender); - - private: - - void ConstructL(); - void SetupL(); - void Teardown(); - - // Help methods - TInt CreateSpEntryL( TInt aServiceId ); - - // Test methods - void T_NewLL(); - void T_RegisterChatObserverL(); - void T_UnRegisterChatObserverL(); - void T_HandleIMCacheEventLL(); - void T_GetUnreadCountL(); - void T_SubServiceStateL(); - void T_IsConversationExistLL(); - void T_ResolveServiceStateLL(); - void T_TypeL(); - void T_CchEventOccuredLL(); - void T_DoHandleCchErrorLL(); - void T_CreateIMCacheAccessorLL(); - void T_ReleaseIMCacheAccessorL(); - void T_IsConversationDoesntExistLL(); - - void T_CloseConversationExisitingConversationLL(); - void T_CloseConversationNonExisitingConversationLL(); - - - void T_IsConversationExistNoIMCacheAccessorL(); - void T_CloseConversationNoIMCacheAccessorL(); - void T_GetUnreadCountNoIMCacheAccessorL(); - - void T_RegisterNULLChatObserverL(); - void T_UnRegisterNULLChatObserverL(); - - - void T_RegisterChatObserverTwiceL(); - void T_UnRegisterChatObserverTwiceL(); - - void T_HandleIMCacheEventWithRegisteredObserverL(); - - - private: - - T_VimpstEngineImSubService() {}; - - private: - - CVIMPSTEngineCchHandler* iCchHandler; - CVIMPSTEngineServiceTableFetcher* iServiceTableFetcher; - CVIMPSTEngineIMSubService* iImSubService; - MVIMPSTEngineCchUiEventObserver* iCchUiEventObserver; - - TInt iTestServiceId; - - TBool iChatMsgReceived; - TBool iAddRequestReceived; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_VimpstEngineImSubService_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginepresencesubservice.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginepresencesubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* 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: t_vimpstenginepresencesubservice.h -* -*/ -#ifndef _T_VimpstEnginePresenceSubService_H_ -#define _T_VimpstEnginePresenceSubService_H_ - -// EXTERNAL INCLUDES -#include -#include "mvimpstengineserviceconnectioneventobserver.h" -#include "cvimpstenginesessioncntxtobserver.h" // MVIMPSTEngineSessionCntxtObserver -#include "mvimpstenginecchuieventobserver.h" -class CustomCleanupResetAndDestroy; -class CVIMPSTEnginePresenceSubService; -class CVIMPSTEngineServiceTableFetcher; -class CVIMPSTEngineCchHandler; -class CVIMPSTEngineSessionCntxtObserver; -class MVIMPSTEngineSessionCntxtObserver; -class MPresenceCacheReader2; -class CIMCacheFactory; -class MIMCacheUpdater; -class CContactIdArray; -class CContactDatabase; -class MPresentityGroupContentEvent; -class CVIMPSTEngineSubServiceStateListener; -class CustomCleanupResetAndDestroy; - -class T_VimpstEnginePresenceSubService : - public CEUnitTestSuiteClass, - public MVIMPSTEngineServiceConnectionEventObserver - { - public: - - static T_VimpstEnginePresenceSubService* NewLC(); - ~T_VimpstEnginePresenceSubService(); - - public: // From observer interface - - // From MVIMPSTEngineServiceConnectionEventObserver - void HandleServceConnectionEventL(); - - private: - - void ConstructL(); - void SetupL(); - void Teardown(); - - // Help methods - TInt CreateSpEntryL( TInt aServiceId ); - - // Test methods - void T_NewLL(); - void T_SubServiceStateL(); - void T_TypeL(); - void T_Enabled(); - void T_RetrieveSubscribedListLL(); - void T_SubscribePresenceOfSingleContactL(); - void T_UnSubscribePresenceOfSingleContactLL(); - void T_DoHandlePresentityPresenceEventLL(); - void T_DoHandlePresentityGroupContentEventLL(); - void T_DoHandlePresenceGrantRequestListEventLL(); - void T_FormatPresenceUriLCL(); - void T_ResolveServiceStateLL(); - void T_CchEventOccuredLL(); - void T_DoHandleCchErrorLL(); - void T_PublishOwnPresenceLL(); - void T_ConvertPresenceStatus(); - // void T_FetchPresenceFormCacheL(); - void T_HandlePresenceReadLL(); - // void T_SubscribeToPresenceCacheLL(); - void T_HandlePresenceNotificationLL(); - void T_UnSubscribeForAuthorizationLL(); - void T_SubscribeForAuthorizationLL(); - void T_SendPresenceGrantPresentityLL(); - void T_HandleSessionContextEventLL(); - void T_HandleListEventCompleteLL(); - void T_HandleXimpRequestCompleteLL(); - void T_StoreToVirtualStoreLL(); - void T_IsChangeOwnStatusSupportedL() ; - void T_IsStatusMsgSupportedL(); - void T_SubscribePresenceForAllLL(); - void T_UnSubscribePresenceForAllLL(); - void T_ConvertXimpToClientPresenceStatusL(); - // void T_RegisterPresenceEventObserverL(); - void T_UnRegisterPresenceEventObserverL(); - void T_DoHandlePresenceBlockListEventL(); - void T_AddToBlockListL(); - void T_AddToBlockListL_NoUserid(); - void T_AddToBlockListL_NoDomainNameL(); - void T_RemoveFromBlockListL(); - void T_RemoveFromBlockList_NoUseridL(); - void T_RemoveFromBlockList_NoDomainNameL(); - void T_RemoveFromBlockListMgr(); - void T_GetKeyFiledsAndValuesStatusPendingL(); - void T_GetKeyFiledsAndValuesStatusUnknownL(); - void T_GetKeyFiledsAndValuesStatusBlockedL(); - void T_FetchBlockedListFromServer(); - private: - - T_VimpstEnginePresenceSubService() {}; - - private: - - CVIMPSTEngineCchHandler* iCchHandler; - CVIMPSTEngineServiceTableFetcher* iServiceTableFetcher; - MVIMPSTEngineCchUiEventObserver* iCchUiEventObserver; - CVIMPSTEngineSessionCntxtObserver* iSessionCntxtObserver; - CVIMPSTEnginePresenceSubService* iPresenceSubService; - - TInt iTestServiceId; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_CSCPUtility_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginerequest.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginerequest.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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: t_vimpstenginerequest.h -* -*/ -#ifndef _T_VIMPSTEngineRequest_H_ -#define _T_VIMPSTEngineRequest_H_ - -// EXTERNAL INCLUDES -#include - - -#include "cvimpstenginerequest.h" - -//Forward declarations -class CVIMPSTEngineRequest; - -class T_VIMPSTEngineRequest : public CEUnitTestSuiteClass - { - public: - - static T_VIMPSTEngineRequest* NewLC(); - ~T_VIMPSTEngineRequest(); - - private: - - void ConstructL(); - void SetupL(); - void Teardown(); - - void TestAllFunctionsL(); - - private: - - T_VIMPSTEngineRequest() {}; - - - private: - CVIMPSTEngineRequest* iRequest; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_CSCPUtility_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginerequestmapper.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginerequestmapper.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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: t_vimpstenginerequestmapper.h -* -*/ -#ifndef _T_VIMPSTEngineRequestMapper_H_ -#define _T_VIMPSTEngineRequestMapper_H_ - -// EXTERNAL INCLUDES -#include - - -#include "cvimpstenginerequestmapper.h" - -//Forward declarations -class CVIMPSTEngineRequestMapper; - -class T_VIMPSTEngineRequestMapper : public CEUnitTestSuiteClass - { - public: - - static T_VIMPSTEngineRequestMapper* NewLC(); - ~T_VIMPSTEngineRequestMapper(); - - private: - - void ConstructL(); - void SetupL(); - void Teardown(); - - void TestAllFunctionsL(); - - private: - - T_VIMPSTEngineRequestMapper() {}; - - - private: - CVIMPSTEngineRequestMapper* iRequestMapper; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_CSCPUtility_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginesearchmgrextention.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginesearchmgrextention.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* 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: t_vimpstenginesearchmgrextention.h -* -*/ -#ifndef _T_VIMPSTEngineSearchMgrExtention_H_ -#define _T_VIMPSTEngineSearchMgrExtention_H_ - -// EXTERNAL INCLUDES -#include - -#include "mvimpstenginesearchextentioneventobserver.h" -#include "cvimpstenginesearchmgrextention.h" - -//Forward declarations -class CVIMPSTEngineSearchMgrExtention; -class MXIMPClient; -class MXIMPContext; -class MPresenceFeatures; -class CVIMPSTEngineRequestMapper; - - -class T_VIMPSTEngineSearchMgrExtention : public CEUnitTestSuiteClass, - public MVIMPSTEngineSearchExtentionEventObserver - { - public: - - static T_VIMPSTEngineSearchMgrExtention* NewLC(); - virtual ~T_VIMPSTEngineSearchMgrExtention(); - public: - - // From MVIMPSTEngineSearchExtentionEventObserver - void HandleSearchResultL(RArray aSerachData); - void HandleSearchFinishedL(TInt aError); - void HandleSearchKeysEventL( RArray& aEnumKeysArray, RPointerArray& aLebelKeysArray ); - - private: - - void ConstructL(); - void SetupL(); - void Teardown(); - - /* - * To be tested: - * - SearchContactsL - * - SubscribeForSearchKeysL - * - IsSupported - * - Type - * - HandleSessionContextEventL - */ - - void TestSearchContactsL(); - void TestSubscribeForSearchKeysL(); - void TestIsSupported(); - void TestType(); - void TestHandleSessionContextEventL(); - - void TestAllFunctionsL(); - - - private: - - T_VIMPSTEngineSearchMgrExtention() {}; - - - private: - CVIMPSTEngineSearchMgrExtention* iSearcMgrExtention; - - MXIMPClient* iClient; - //Create new sink to receive ximp context events - MXIMPContext* iPresenceCtx; - - MPresenceFeatures* iFeatures; - - CVIMPSTEngineRequestMapper* iRequestMapper; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_CSCPUtility_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstengineservicetablefetcher.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstengineservicetablefetcher.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* 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: t_vimpstengineservicetablefetcher.h -* -*/ -#ifndef _T_VIMPSTEngineServiceTableFetcher_H_ -#define _T_VIMPSTEngineServiceTableFetcher_H_ - -// EXTERNAL INCLUDES -#include - -#include - -//Forward declarations -class CVIMPSTEngineServiceTableFetcher; -class CSPProperty; -class CSPEntry; -class CSPSettings; - -class T_VIMPSTEngineServiceTableFetcher : public CEUnitTestSuiteClass - { - public: - - static T_VIMPSTEngineServiceTableFetcher* NewLC(); - ~T_VIMPSTEngineServiceTableFetcher(); - - private: - - void ConstructL(); - void SetupL(); - void Setup1L(); - void Teardown(); - - void TestConstructionL(); - void TestConstructionWithValidServicesL(); - void TestConstructionWithInValidServicesL(); - - void GetMasterServiceIdsNoServicesL(); - - void CreateSpEntryL( TInt aServiceId, - TServicePropertyName aName, - TInt aValue ); - - void CreateSpEntry1L( TInt aServiceId, - TServicePropertyName aName, - const TDesC& aValue ); - - void CreateSpEntry1L( TInt aServiceId, - TServicePropertyName aName, - TOnOff aValue ); - - void GetMasterServiceIdsServicesMatchContactViewUidValidServiceL(); - void GetMasterServiceIdsServicesMatchContactViewUidInValidServiceL(); - void GetMasterServiceIdsServicesNoMatchContactViewUidL(); - - void GetContactStoreIdPropertyNotFoundL(); - void GetContactStoreIdPropertyFoundL(); - void GetContactStoreIdPropertyFoundWithContactUriDomainL(); - - - void GetBrandIdLPropertyNotFoundL(); - void GetBrandIdLPropertyFoundL(); - - void FindPropertyNotFoundL(); - void FindPropertyFoundL(); - - - void PropertyBrandVersionNotFoundL(); - void PropertyBrandVersionFoundL(); - void PropertyBrandLanguageNotFoundL(); - void PropertyBrandLanguageFoundL(); - void GetServiceNameNotFoundL(); - void GetServiceNameFoundL(); - - void XimpAdapterUidNotFoundL(); - void XimpAdapterUidFoundL(); - - void PresenceRequestStatusNotFoundL(); - void PresenceRequestStatusFoundWithEOffL(); - void PresenceRequestStatusFoundWithEOnL(); - - void ShutDownPhonebookL(); - - void DoHandleNotifyChangeL_withOutNewServiceL(); - void DoHandleNotifyChangeL_withNewServiceL(); - - private: - - T_VIMPSTEngineServiceTableFetcher() {}; - - private: - CVIMPSTEngineServiceTableFetcher* iServiceTableFetcher; - - // Own: service provider settings - CSPSettings* iSpSettings; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_CSCPUtility_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginesessioncntxtobserver.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginesessioncntxtobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* 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: t_vimpstenginesessioncntxtobserver.h -* -*/ -#ifndef _T_VimpstEngineSessionCntxtObserver_H_ -#define _T_VimpstEngineSessionCntxtObserver_H_ - -// EXTERNAL INCLUDES -#include - - -//Forward declarations -class CVIMPSTEngineSessionCntxtObserver; - -class T_VimpstEngineSessionCntxtObserver : public CEUnitTestSuiteClass - { - public: - - static T_VimpstEngineSessionCntxtObserver* NewLC(); - ~T_VimpstEngineSessionCntxtObserver(); - - private: - - void Setup1L(); - void ConstructL(); - void Setup2L(); - void Teardown(); - - TInt CreateSpEntryL( TInt aServiceId ); - void T_NewLL(); - void T_HandlePresenceContextEventL(); - - - void T_GetCompletedReqResultL(); - - - void T_GetRequestMapperL(); - - - void T_ServerBindL(); - - - void T_ServerUnBindL(); - - - void T_UriFromXimpOperationLCL(); - - void T_DoHandlePresenceContextEventLL(); - - void T_XimpAuthorizationLL(); - - void T_XimpPresenceWatchingLL(); - - void T_XimpPresentityGroupsLL(); - - void T_XimpPresencePublishingLL(); - - void T_XimpPresenceContextL(); - - void T_PresenceObjectFactoryL(); - - - void T_RegisterObserverL(); - - - void T_UnRegisterObserverL(); - void T_IdentifySupportedFeaturesL(); - void T_GetSupportedFeaturesL(); - - - - - - private: - - T_VimpstEngineSessionCntxtObserver() {}; - - - private: - - CVIMPSTEngineSessionCntxtObserver* iSessionCntxtObserver; - - TInt iTestServiceId; - - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_CSCPUtility_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginevoipsubservice.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/inc/t_vimpstenginevoipsubservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* 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: t_vimpstenginevoipsubservice.h -* -*/ -#ifndef _T_VimpstEngineVoipSubService_H_ -#define _T_VimpstEngineVoipSubService_H_ - -// EXTERNAL INCLUDES -#include -#include "mvimpstenginecchuieventobserver.h" -#include "mvimpstengineserviceconnectioneventobserver.h" - -class CVIMPSTEngineVOIPSubService; -class CVIMPSTEngineCchHandler; -class CVIMPSTEngineServiceTableFetcher; -//class CVIMPSTEngineCchUiEventObserver; - -class T_VimpstEngineVoipSubService : - public CEUnitTestSuiteClass, - public MVIMPSTEngineServiceConnectionEventObserver - { - public: - - static T_VimpstEngineVoipSubService* NewLC(); - ~T_VimpstEngineVoipSubService(); - - public: // From observer interface - - // From MVIMPSTEngineServiceConnectionEventObserver - void HandleServceConnectionEventL(); - private: - - void ConstructL(); - void SetupL(); - void Teardown(); - - // Help methods - TInt CreateSpEntryL( TInt aServiceId ); - - // Test methods - void T_NewLL(); - void T_CchEventOccuredLL(); - void T_DoHandleCchErrorLL(); - void T_ResolveServiceStateL(); - void T_SubServiceStateL(); - void T_TypeL(); - - private: - - T_VimpstEngineVoipSubService() {}; - - private: - - CVIMPSTEngineCchHandler* iCchHandler; - MVIMPSTEngineCchUiEventObserver* iCchUiEventObserver; - CVIMPSTEngineServiceTableFetcher* iServiceTableFetcher; - CVIMPSTEngineVOIPSubService* iVoIPSubService; - - TInt iTestServiceId; - - EUNIT_DECLARE_TEST_TABLE; - }; - -#endif // _T_CSCPUtility_H_ - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/dllmain.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/dllmain.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* dllmain.cpp 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: dllmain.cpp -* -*/ -#include - -#include "t_vimpstengine.h" -#include "t_vimpstenginevoipsubservice.h" -#include "t_vimpstengineimsubservice.h" -#include "t_vimpstenginecchhandler.h" -#include "t_vimpstengineservicetablefetcher.h" -#include "t_vimpstenginesessioncntxtobserver.h" -#include "t_vimpstenginerequest.h" -#include "t_vimpstenginerequestmapper.h" -#include "t_vimpstenginecontactmgmtextention.h" -#include "t_vimpstenginesearchmgrextention.h" -#include "t_vimpstenginepresencesubservice.h" - -EXPORT_C MEUnitTest* CreateTestSuiteL() - { - CEUnitTestSuite* suite = CEUnitTestSuite::NewLC( _L("vimpstengine_ut") ); - - suite->AddL( T_VimpstEngine::NewLC() ); - CleanupStack::Pop(); - - suite->AddL( T_VimpstEngineVoipSubService::NewLC() ); - CleanupStack::Pop(); - - suite->AddL( T_VimpstEngineImSubService::NewLC() ); - CleanupStack::Pop(); - - suite->AddL ( T_VimpstEngineCchHandler::NewLC() ); - CleanupStack::Pop(); - - suite->AddL ( T_VIMPSTEngineServiceTableFetcher::NewLC() ); - CleanupStack::Pop(); - - suite->AddL ( T_VIMPSTEngineRequest::NewLC() ); - CleanupStack::Pop(); - - suite->AddL ( T_VIMPSTEngineRequestMapper::NewLC() ); - CleanupStack::Pop(); - - suite->AddL ( T_VIMPSTEngineContactMgmtExtention::NewLC() ); - CleanupStack::Pop(); - - suite->AddL ( T_VimpstEngineSessionCntxtObserver::NewLC() ); - CleanupStack::Pop(); - - /*suite->AddL ( T_VIMPSTEngineSearchMgrExtention::NewLC() ); - CleanupStack::Pop();*/ - - suite->AddL ( T_VimpstEnginePresenceSubService::NewLC() ); - CleanupStack::Pop(); - - CleanupStack::Pop( suite ); - - return suite; - } - -#ifndef EKA2 -GLDEF_C TInt E32Dll(TDllReason) - { - return KErrNone; - } -#endif - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_CVIMPSTEngineSessionCntxtObserver.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_CVIMPSTEngineSessionCntxtObserver.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2007 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: Handles the use of Precense Framework - * -*/ - - -// INCLUDE FILES -#include "s_CVIMPSTEngineSessionCntxtObserver.h" -//Presence Observer -//#include "mvimpstenginepresencesubserviceeventobserver.h" - -// CONTANTS - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub:: -// CVIMPSTEnginePresenceSubService_Stub() -// --------------------------------------------------------------------------- -// -CVIMPSTEngineSessionCntxtObserver_Stub* CVIMPSTEngineSessionCntxtObserver_Stub::NewL(TUint32 aServiceId) - { - CVIMPSTEngineSessionCntxtObserver_Stub* self = NewLC(aServiceId); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTEnginePresenceSubService_Stub::ConstructL() -// --------------------------------------------------------------------------- -// - CVIMPSTEngineSessionCntxtObserver_Stub* CVIMPSTEngineSessionCntxtObserver_Stub::NewLC(TUint32 aServiceId) - { - CVIMPSTEngineSessionCntxtObserver_Stub* self = - new (ELeave) CVIMPSTEngineSessionCntxtObserver_Stub( ); - CleanupStack::PushL(self); - // self->ConstructL(); - return self; - - } - - CVIMPSTEngineSessionCntxtObserver_Stub::~CVIMPSTEngineSessionCntxtObserver_Stub() - { - - - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_CVIMPSTEngineSessionCntxtObserver.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_CVIMPSTEngineSessionCntxtObserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2008 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: Class handling connection to precense framework -* -*/ - - -#ifndef s_CVIMPSTEngineSessionCntxtObserver_H -#define s_CVIMPSTEngineSessionCntxtObserver_H - -// INCLUDES -#include - - - - - - - - -NONSHARABLE_CLASS( CVIMPSTEngineSessionCntxtObserver_Stub ): public CBase - - - - { - public: - - /** - * Two-phased constructor. - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - static CVIMPSTEngineSessionCntxtObserver_Stub* NewL( TUint32 aServiceId ); - - /** - * Two-phased constructor. - * - * @since s60 5.0 - * @param aServiceId, service id - * @param aCchHandler, reference to cchhandler. - * @param aTableFetcher, reference to settingstable. - * @param aXimpEventObserver, reference to ximpevent observer. - * @param aServiceStateListener, reference to servicestatelistener. - */ - static CVIMPSTEngineSessionCntxtObserver_Stub* NewLC(TUint32 aServiceId ); - - /** - * Standard C++ destructor - */ - ~CVIMPSTEngineSessionCntxtObserver_Stub(); - - - - private: // Data - - // Service identifier - TUint32 iServiceId; - - - }; - -#endif //s_CVIMPSTEngineSessionCntxtObserver_H - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_cactive.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_cactive.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* 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: s_cactive.cpp -* -*/ -#include - -CActiveScheduler::TLoopOwner gTLoop ; - -TBool gSetActive = EFalse; -/* - IMPORT_C ~CActive(); - IMPORT_C void Deque(); - IMPORT_C void SetPriority(TInt aPriority); - inline TBool IsAdded() const; - inline TInt Priority() const; - IMPORT_C virtual TInt RunError(TInt aError); - IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); -*/ - -void CActive::Cancel() - { - iStatus.iFlags = 0; - } - -CActive::CActive(TInt /*aPriority*/) - { - } - -void CActive::SetActive() - { - iStatus.iFlags = TRequestStatus::EActive; - } - -CActive::~CActive() - { - } - -void CActive::Deque() - { - } - -void CActive::SetPriority(TInt /*aPriority*/) - { - } - -TInt CActive::RunError(TInt /*aError*/) - { - return KErrNone; - } - -TInt CActive::Extension_(TUint /*aExtensionId*/, TAny*& /*a0*/, TAny* /*a1*/) - { - return KErrNone; - } - -void CActiveScheduler::Add(CActive* /*aActive*/) - { - } - - -void CPeriodic::Start(TTimeIntervalMicroSeconds32 /*aDelay*/, - TTimeIntervalMicroSeconds32 /*anInterval*/, - TCallBack /*aCallBack*/) - { - } - - -CActiveSchedulerWait::CActiveSchedulerWait() - { - } -CActiveSchedulerWait::~CActiveSchedulerWait() - { - } - -void CActiveSchedulerWait::Start() - { - CActiveScheduler::TLoopOwner temp = NULL; - iLoop = temp; //assign some local variable with junk value - } - -void CActiveSchedulerWait::AsyncStop() - { - iLoop = NULL; - } - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_cch.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_cch.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,300 +0,0 @@ -/* -* s_cch.cpp : 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: s_cch.cpp -* -*/ -// EXTERNAL INCLUDES -#include -#include - -#include "s_cch.h" - -MyCchService* myService = NULL; -TBool createService = EFalse; -TBool tryAllSubserviceAvailable = EFalse; -TBool tryVoipSubServiceAvailable = EFalse; -TBool tryPresenceSubServiceAvailable = EFalse; -TBool tryIMSubServiceAvailable = EFalse; -TBool tryConnParamLeaveWithNotSupported = EFalse; -TBool tryConnParamWithSuccess = EFalse; -TBool sendObserverEvent = EFalse; -TBool getUserName = EFalse; -TBool getPassword = EFalse; -TBool tryParamTomatchOwnId =EFalse; -TBool tryConnParamWithFailure = EFalse; - - - -/*************** Stubs ****************/ -CCchService* CCch::GetService( TInt /*aServiceId*/ ) - { - if( createService && !myService ) - { - myService = new ( ELeave ) MyCchService(); - return myService; - } - - return myService; - } - - -/************* End of Stubs ************/ - - - -TInt MyCchService::Enable( TCCHSubserviceType aType ) - { - - if (sendObserverEvent) - { - if (iObserver) - { - TCchServiceStatus aStatus; - - aStatus.SetState(ECCHEnabled); - aStatus.SetError(KErrNone); - - if (tryPresenceSubServiceAvailable) - { - iObserver->ServiceStatusChanged( 10, ECCHPresenceSub, aStatus ); - } - else - { - iObserver->ServiceStatusChanged( 10, aType, aStatus ); - } - } - } - - return KErrNone; - } - -/** - * Launches service disable. See MCchServiceObserver for status changes. - * - * @param aType Type of service - * @return Symbian error - */ - TInt MyCchService::Disable( TCCHSubserviceType /*aType*/ ){ return KErrNone; } - -/** - * Returns the current service state - * - * @param aType Type of service - * @param aStatus Status of the service, return value - * @return Symbian error code - */ - TInt MyCchService::GetStatus( TCCHSubserviceType aType, - TCchServiceStatus& aStatus ) const - - { - - if ( (ECCHVoIPSub == aType) && (tryVoipSubServiceAvailable || tryAllSubserviceAvailable) ) - { - aStatus.SetState(ECCHUninitialized); - aStatus.SetError(KErrNone); - return KErrNone; - } - - else if ( (ECCHPresenceSub == aType) && (tryPresenceSubServiceAvailable || tryAllSubserviceAvailable) ) - { - aStatus.SetState(ECCHUninitialized); - aStatus.SetError(KErrNone); - return KErrNone; - } - - else if ( (ECCHIMSub == aType) && (tryIMSubServiceAvailable || tryAllSubserviceAvailable) ) - { - aStatus.SetState(ECCHUninitialized); - aStatus.SetError(KErrNone); - return KErrNone; - } - - return KErrNotFound ; - - } - -/** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt MyCchService::GetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, TInt& /*aValue*/ ) const{ return KErrNone;} - -/** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt MyCchService::GetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, RBuf& aValue ) const - - { - if (tryConnParamLeaveWithNotSupported) - { - return KErrNotSupported; - } - - if (tryConnParamWithSuccess) - { - aValue.Copy(KTestUserName); - } - if (tryParamTomatchOwnId) - { - aValue.Copy(KOwnUserNameMatch); - } - if ( getUserName ) - { - aValue.Copy(KTestUserName); - } - if ( getPassword ) - { - aValue.Copy(KTestPassword); - } - if(tryConnParamWithFailure) - { - return KErrNotFound; - } - - return KErrNone; - } - -/** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt MyCchService::SetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, TInt /*aValue*/ ) - - { - return KErrNone; - } - -/** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt MyCchService::SetConnectionParameter( TCCHSubserviceType /*aType*/, - TCchConnectionParameter /*aParameter*/, const TDesC& /*aValue*/ ) - { - if (tryConnParamLeaveWithNotSupported) - { - return KErrNotSupported; - } - - return KErrNone; - } - -/** - * Reserves the service for exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt MyCchService::Reserve( TCCHSubserviceType /*aType*/ ){ return KErrNone; } - -/** - * Frees the service of exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt MyCchService::Free( TCCHSubserviceType /*aType*/ ){ return KErrNone; } - -/** - * Is the service reserved - * - * @param aType Type of service - * @param aReserved True if the service is reserved - * @return Symbian error code - */ - TInt MyCchService::IsReserved( TCCHSubserviceType /*aType*/, TBool& /*aReserved*/ ) const{ return KErrNone; } - -/** - * Returns the service id - * - * @return The id of the service - */ - TInt MyCchService::ServiceId() const{ return KErrNone; } - -/** - * @deprecated Do not use this anymore, change to AddObserver! - * - * Adds observer for listening service events - * - * @param aObserver Event observing class - */ - void MyCchService::SetObserver( MCchServiceStatusObserver& aObserver ) - { - iObserver = &aObserver; - } - -/** - * @deprecated Do not use this anymore, change to - * RemoveObserver method with paramater - * - * Removes the observer of service events - */ - void MyCchService::RemoveObserver( ) - { - iObserver = NULL; - } - - -/** - * Adds observer for listening service events - * - * @param aObserver Event observing class - * @return KErrAlreadyExist Observer already added - * KErrNone Observer was added - */ - TInt MyCchService::AddObserver( MCchServiceStatusObserver& /*aObserver*/ ){ return KErrNone; } - -/** - * Removes the observer of service events - * - * @param aObserver Event observing class - * @return KErrNotFound Observer was not found - * KErrNone Observer was removed - */ - TInt MyCchService::RemoveObserver( MCchServiceStatusObserver& /*aObserver*/ ){ return KErrNone; } - -/** - * Checks if the type is supported - * - * @param aType Type of service - * @param aSupported True if the service type is supported - * @return Symbian error code - */ - TInt MyCchService::IsSupported( TCCHSubserviceType /*aType*/, TBool& /*aSupported*/ ) const{ return KErrNone; } - - - //end of file - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_cch.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_cch.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,280 +0,0 @@ -/* -* s_cch.h :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: s_cch.h -* -*/ - -#ifndef MyCchServiceH -#define MyCchServiceH - -// EXTERNAL INCLUDES -#include -#include - - -_LIT(KTestUserName, "hi123"); -_LIT(KOwnUserNameMatch,"gizmo:Sharath"); // dont change this value -_LIT(KTestPassword, "password"); -_LIT(KTestDescription, "error"); - -class MyCCch : public CCch - { - -public: - - /** - * Two-phased constructor. - */ - static CCch* NewL(); - - /** - * Two-phased constructor. - */ - static CCch* NewLC(); - - /** - * Destructor. - */ - // ~CCch(); - - /** - * Returns one service - * - * @param aId Service id - * @return Service or NULL if not found. Ownership is not transferred. - */ - // CCchService* GetService( TInt aId ); - - /** - * Returns service ids of all configured services - * - * @param aIds Array of TInt to be filled with ids - * @return Symbian error code - */ - // TInt GetServiceIds( RArray& aIds ) const; - - /** - * Returns services fulfilling the search criteria - * - * @param aType Service type - * @param aServices Array of CCchService to be filled - * @return Symbian error code - */ - // TInt GetServices( TCCHSubserviceType aType, - // RPointerArray& aServices ); - - /** - * Returns ETrue if connectivity dialogs are allowed in service enabling. - * - * @return ETrue if connectivity dialogs are allowed in service enabling - */ - // TBool ConnectivityDialogsAllowed() const; - - /** - * For allowing/disallowing connectivity dialogs showing in - * service enabling. - * - * @param aConnectivityDialogsAllowed Boolean to set connectivity dialogs - * allowed/disallowed - */ - //void SetConnectivityDialogsAllowed( - //TBool aConnectivityDialogsAllowed ); - - /** - * For getting cchui api. - * - * @return reference to cchui api. - */ - // MCchUi& CchUiApi() const; - - - - /** - * The constructor - */ - // void CCch(); - - - - /** - * By default Symbian 2nd phase constructor is private. - */ - // void ConstructL(); - -private: // data - - /** - * Cch client implementation - * Own. - */ - //CCchImpl* iImplementation; - -#ifdef _DEBUG - // friend class UT_CchUi; -#endif - }; - -class MyCchService : public CCchService - { - TInt Enable( TCCHSubserviceType aType ); - - /** - * Launches service disable. See MCchServiceObserver for status changes. - * - * @param aType Type of service - * @return Symbian error - */ - TInt Disable( TCCHSubserviceType aType ); - - /** - * Returns the current service state - * - * @param aType Type of service - * @param aStatus Status of the service, return value - * @return Symbian error code - */ - TInt GetStatus( TCCHSubserviceType aType, - TCchServiceStatus& aStatus ) const ; - - /** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt GetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, TInt& aValue ) const; - - /** - * Returns the connection parameters - * - * @param aType Type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt GetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, RBuf& aValue ) const; - - /** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt SetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, TInt aValue ); - - /** - * Sets the connection parameters - * - * @param aType The type of service - * @param aParameter Connection parameter of the service - * @param aValue Value of the parameter - * @return Symbian error code - */ - TInt SetConnectionParameter( TCCHSubserviceType aType, - TCchConnectionParameter aParameter, const TDesC& aValue ); - - /** - * Reserves the service for exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt Reserve( TCCHSubserviceType aType ); - - /** - * Frees the service of exclusive usage - * - * @param aType Type of service - * @return Symbian error code - */ - TInt Free( TCCHSubserviceType aType ); - - /** - * Is the service reserved - * - * @param aType Type of service - * @param aReserved True if the service is reserved - * @return Symbian error code - */ - TInt IsReserved( TCCHSubserviceType aType, TBool& aReserved ) const; - - /** - * Returns the service id - * - * @return The id of the service - */ - TInt ServiceId() const; - - /** - * @deprecated Do not use this anymore, change to AddObserver! - * - * Adds observer for listening service events - * - * @param aObserver Event observing class - */ - void SetObserver( MCchServiceStatusObserver& aObserver ); - - /** - * @deprecated Do not use this anymore, change to - * RemoveObserver method with paramater - * - * Removes the observer of service events - */ - void RemoveObserver( ); - - /** - * Adds observer for listening service events - * - * @param aObserver Event observing class - * @return KErrAlreadyExist Observer already added - * KErrNone Observer was added - */ - TInt AddObserver( MCchServiceStatusObserver& aObserver ); - - /** - * Removes the observer of service events - * - * @param aObserver Event observing class - * @return KErrNotFound Observer was not found - * KErrNone Observer was removed - */ - TInt RemoveObserver( MCchServiceStatusObserver& aObserver ); - - /** - * Checks if the type is supported - * - * @param aType Type of service - * @param aSupported True if the service type is supported - * @return Symbian error code - */ - TInt IsSupported( TCCHSubserviceType aType, TBool& aSupported ) const; - - private: - MCchServiceStatusObserver* iObserver; - - }; - - -#endif //MyCchService - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_imcache.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_imcache.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,218 +0,0 @@ -/* -* s_imcache.cpp : 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:s_imcache.cpp -* -*/ -// imcache related headers -#include "cimcachefactory.h" -#include "mimcacheaccessor.h" -#include "mimcacheupdater.h" - -TBool gConversationExist = EFalse; -TBool gConversationUnreadCount = EFalse; - -class MyMIMCacheAccessor : public MIMCacheAccessor - { - public: - - /** - * Register to observer conversation data updates - * @param aObserver the observer interface - */ - void RegisterObserverL( MIMCacheEventHandler& /*aObserver*/ ) {} - - /** - * Unregister a conversation data update observer - * @param aObserver the observer interface - */ - void UnRegisterObserver( MIMCacheEventHandler& /*aObserver*/ ) {} - - /** - * to get the unread message count from server - * @param aOwnUserId , logged in user id - * @return number of unread msg count - */ - TInt GetUnreadMessageCountL( const TDesC& /*aBuddyId*/ ) - { - if (gConversationUnreadCount) - { - return 1; - } - - return 0; - } - - /** - * to get the all unread message count from server - * @param , aOwnUserId logged in user id - * @return number of all unread msg count - */ - TInt GetAllUnreadMessageCountL() { return KErrNone; } - - /** - * check if already conversation opened - * @param aServiceId, serviceid to use - * @param aOwnUserId, own user id - * @param aRecipientId, the selected user id with whom conversation is started - * @return ETrue if already exist else EFlase. - */ - TBool IsConversationExistL( const TDesC& /*aBuddyId*/ ) - { - if (gConversationExist) - { - return ETrue; - } - - return EFalse; - } - RArray GetChatListL( const TInt aServiceId ){} - /** - * closes conversation and commit operation - * @param aServiceId service id. - * @param aOwnId own user id. - * @param aRecipientId recipient's user id. - */ - void CloseConversationL( const TDesC& /*aBuddyId*/ ) {} - - /** - * to get the friend request count from server - * @param , aOwnUserId logged in user id - * @return number of all request - */ - TInt GetFriendRequestCountL( ) { return KErrNone; } - - - /** - * Remove friend request from cahce and commit operation - * @param aServiceId service id. - * @param aOwnId own user id. - * @param aRequesterId ,requester user id. - */ - void RemoveFriendRequestL( const TDesC& /*aBuddyId*/ ) {} - - - /** - * Destructor - */ - ~MyMIMCacheAccessor() {}; - - MyMIMCacheAccessor() {}; - }; - -class MyMIMCacheUpdater : public MIMCacheUpdater - { - public: - - void RegisterObserverL( MIMCacheEventHandler& /*aObserver*/ ) {} - - void UnRegisterObserver( MIMCacheEventHandler& /*aObserver*/ ) {} - - void StartNewConversationL(const TDesC& /*aBuddyId*/ ) {}; - - void AppendReceiveMessageL(const TDesC& /*aBuddyId*/, - const TDesC& /*aText*/ ){}; - - void AppendSendMessageL(const TDesC& /*aText*/ ){}; - - void AppendMessageL(const TDesC& /*aBuddyId*/, const TDesC& /*aText*/){}; - - void CloseConversationL( const TDesC& /*aBuddyId*/ ){}; - - TInt DeactivateConversationL() - { - return KErrNone; - } - - void AppendAddRequestL( const TDesC& /*aBuddyId*/, - TInt /*aServiceId*/ ){}; - - RArray GetChatListL( const TInt& /*aServiceId*/ ) - { - RArray array; - return array; - } - - ~MyMIMCacheUpdater() {}; - - MyMIMCacheUpdater() {}; - }; - -CIMCacheFactory* gIMCacheFactory = NULL; -MyMIMCacheAccessor* gMyMIMCacheAccessor = NULL; -MyMIMCacheUpdater* gMyMIMCacheUpdater = NULL; - -CIMCacheFactory* CIMCacheFactory::InstanceL() - { - if (!gIMCacheFactory) - { - gIMCacheFactory = new ( ELeave ) CIMCacheFactory(); - } - return gIMCacheFactory; - } - -void CIMCacheFactory::Release() - { - - delete gMyMIMCacheAccessor; - gMyMIMCacheAccessor = NULL; - - delete gMyMIMCacheUpdater; - gMyMIMCacheUpdater = NULL; - - delete gIMCacheFactory; - gIMCacheFactory = NULL; - - - } - -MIMCacheAccessor* CIMCacheFactory::CreateAccessorL(TInt /*aServiceId*/, - const TDesC& /*aUserId*/ ) - { - if (!gMyMIMCacheAccessor) - { - gMyMIMCacheAccessor = new (ELeave) MyMIMCacheAccessor(); - } - return gMyMIMCacheAccessor; - } - - -CIMCacheFactory::~CIMCacheFactory() - { - - } - -CIMCacheFactory::CIMCacheFactory() - { - - } - -void CIMCacheFactory::ConstructL() - { - - } - -MIMCacheUpdater* CIMCacheFactory::CreateUpdaterL(TInt /*aServiceId*/, - const TDesC& /*aUserId*/ , - TBool /*aRegistrationNeeded*/ ) - { - if (!gMyMIMCacheUpdater) - { - // gMyMIMCacheUpdater = new (ELeave) MyMIMCacheUpdater(); - } - return gMyMIMCacheUpdater; - } - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_mcchuiobserver.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_mcchuiobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* s_mcchuiobserver.h :Copyright (c) 2008-2008 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: Observer definition for CCH UI clients -* -*/ - -#ifndef M_CCHUIOBSERVER_H -#define M_CCHUIOBSERVER_H - -/** - * CCH UI Observer declaration class. - * - * This class defines observer implementation for the CCH UI - * clients. Every client must derive this class in order to - * be able to use services provided by CCH UI and to be able - * to receive observer callbacks. - * @code - * inherit in header: - * class CMyClass : public CBase, public MCchUiObserver - * @endcode - * - * @lib cchui.lib - * @since S60 5.0 - */ -class MCchUiObserver - { -public: - - /** Defines dialog types available through this API */ - enum TCchUiDialogType - { - ECchUiDialogTypeNotSet, - // For connecting note showing - ECchUiDialogTypeConnecting, - // For disconnecting note showing - ECchUiDialogTypeDisconnecting, - // For showing info note about invalid username/password. - // Will also automatically show username/password query after - // showing info note. - ECchUiDialogTypeUsernamePasswordFailed, - // For showing username/password query. - ECchUiDialogTypeAuthenticationFailed, - // For showing no connections defined query. When user inputs - // username/password and accepts query, CCHUI will save them - // and also will re-enable service. - ECchUiDialogTypeNoConnectionDefined, - // For showing no connections available query. When user selects - // new access point, CCHUI adds it to service´s SNAP and re-enables - // service automatically. - ECchUiDialogTypeNoConnectionAvailable, - // For showing confirmation query to change connection. - // Will show automatically also change connection query if - // confirmation query accepted by user. - ECchUiDialogTypeConfirmChangeConnection, - // For showing change connection query. When user selects - // new access point, CCHUI add it to service´s SNAP and re-enables - // service. CCHUI will also delete old access point from service´s - // SNAP if access point is not used by other service(s). - ECchUiDialogTypeChangeConnection, - // For showing defective settings info note. - ECchUiDialogTypeDefectiveSettings, - // For showing error in connection info note. - // Will show automatically also confirm change connection query - // and confirmation query is accepted by user, change connection - // query is showed also. - ECchUiDialogTypeErrorInConnection - }; - - /** Defines operation results ie. indicates what have been done. - Client can implement handling based on these on callback. */ - enum TCchUiOperationResult - { - // Operation result not set - ECchUiClientOperationResultNotSet, - // User has cancelled query. - ECchUiClientOperationResultUserCancelled, - // Failure that prevents enabling service has happened. - ECchUiClientOperationResultGeneralFailure, - // CCHUI has added new access point to service´s SNAP. - ECchUiClientOperationResultAccessPointAdded, - // CCHUI has added new access point to service´s SNAP. - // CCHUI has also removed previously used access point from - // service´s SNAP if it was not used by other service(s). - ECchUiClientOperationResultConnectionChanged, - // CCHUI has saved new username/password for service - ECchUiClientOperationResultCredentialsChanged - }; - - /** - * Gets called when cchui has finished showing connectivity dialogs - * and possible connectivity related operations based on user - * actions in those dialogs. - * - * @since S60 5.0 - * @param aServiceId Service id. - * @param aServiceState Service state after cchui operations. - * @param aOperationResult Contains last cchui operation. - * @return None - */ - virtual void ConnectivityDialogsCompletedL( - TInt aServiceId, - TCchUiOperationResult aOperationResult ) = 0; - }; - -#endif // M_CCHUIOBSERVER_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_mvimpststoragecontacts_bkup.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_mvimpststoragecontacts_bkup.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -/* -* 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: -* -*/ - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceblockinfo.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceblockinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* 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: Interface for presence block info object. -* -*/ - -#include "s_presenceblockinfo.h" -#include "s_ximpidentity.h" - -extern MyMXIMPIdentityStub gMXIMPIdentity; // already defined in MPresentityPresenceEventStub - -// ============================ MEMBER FUNCTIONS ============================= -// --------------------------------------------------------------------------- -// From MPresenceBlockInfo class. -// CPresenceBlockInfoImp::BlockedEntityId() -// --------------------------------------------------------------------------- -// -const MXIMPIdentity& MPresenceBlockInfoStub::BlockedEntityId() const - { - return gMXIMPIdentity; ; - } - - -// --------------------------------------------------------------------------- -// From MPresenceBlockInfo class. -// MPresenceBlockInfoStub::BlockedEntityDisplayName() -// --------------------------------------------------------------------------- -// -const TDesC16& MPresenceBlockInfoStub::BlockedEntityDisplayName() const - { - return KNullDesC(); - } - - -// --------------------------------------------------------------------------- -// From MPresenceBlockInfo class. -// MPresenceBlockInfoStub::SetBlockedEntityIdL() -// --------------------------------------------------------------------------- -// -void MPresenceBlockInfoStub::SetBlockedEntityIdL( - MXIMPIdentity* /*aIdentity*/ ) - { - /*CXIMPIdentityImp* identityImp = - TXIMPGetImpClassOrPanic< CXIMPIdentityImp>::From( *aIdentity ); - - delete iIdentity; - iIdentity = identityImp; */ - } - - -// --------------------------------------------------------------------------- -// From MPresenceBlockInfo class. -// MPresenceBlockInfoStub::SetBlockedEntityDisplayNameL() -// --------------------------------------------------------------------------- -// -void MPresenceBlockInfoStub::SetBlockedEntityDisplayNameL( - const TDesC16& /*aDisplayName*/ ) - { - /*HBufC16* displayNameBuf = aDisplayName.AllocL(); - iDisplayName.Close(); - iDisplayName.Assign( displayNameBuf );*/ - } - - -const TAny* MPresenceBlockInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceBlockInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceBlockInfoStub::GetInterfaceId() const - { - return 0; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceblockinfo.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceblockinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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: Interface for presence block info object. -* -*/ -#ifndef MXIMPFWPRESENCEBLOCKINFOSTUB_H -#define MXIMPFWPRESENCEBLOCKINFOSTUB_H - -#include - - - -/** - * Interface for presence block info object. - * - * Presence block info object presents single - * presence block entry in the presence block list. - * Presence block info object holds the identity - * and display name information for the presence - * block entry. - * - * @ingroup presencedatamodelapi - * @since S60 v3.2 - */ -class MPresenceBlockInfoStub :public MPresenceBlockInfo - { - -public: - - /** - * Returns identity of the blocked entity. - * - * @return The identity of the blocked entity. - */ - const MXIMPIdentity& BlockedEntityId() const; - - - - /** - * Returns displayname of the blocked entity. - * - * @return The displayname of the blocked entity. - */ - const TDesC16& BlockedEntityDisplayName() const; - - - - /** - * Sets identity of the blocked entity. - * - * @param [in] aIdentity - * Identity of the blocked entity. - * Ownership of the argument is transfered to - * callee, if method succeeds without a leave. - * - * @leave KErrNoMemory if failed to allocate memory. - * @leave KErrArgument if NULL argument were provided. - */ - void SetBlockedEntityIdL( - MXIMPIdentity* aIdentity ); - - - /** - * Sets displayname of the blocked entity. - * - * @param [in] aDisplayName - * New display name value. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - void SetBlockedEntityDisplayNameL( - const TDesC16& aDisplayName ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - - -#endif // MXIMPFWPRESENCEBLOCKINFOSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfo.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* s_presencebuddyinfo.cpp 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:s_presencebuddyinfo.cpp -* -*/ - -#include "s_presencebuddyinfo.h" -#include "s_presenceinfo.h" - - - -MPresenceBuddyInfoStub* MPresenceBuddyInfoStub::NewStubL() - { - return new ( ELeave ) MPresenceBuddyInfoStub(); - } - - TInt MPresenceBuddyInfoStub::Set( - MXIMPIdentity* /*aIdentity*/, - MPresenceInfo* /*aPresenceInfo*/) - { - return KErrNone; - } - -TInt MPresenceBuddyInfoStub::SetPresenceInfo(MPresenceInfo* /*aPresenceInfo*/) - { - return KErrNone; - } - -TInt MPresenceBuddyInfoStub::SetBuddyId(MXIMPIdentity* /*aIdentity*/) - { - return KErrNone; - } - -TInt MPresenceBuddyInfoStub::SetPersonPresenceL( - MPersonPresenceInfo* /*aPersonPresenceInfo*/) - { - return KErrNone; - } - -const MPresenceInfo* MPresenceBuddyInfoStub::PresenceInfo() const - { - if ( !gMPresenceInfoStub ) - { - gMPresenceInfoStub = new ( ELeave ) MPresenceInfoStub(); - } - - return gMPresenceInfoStub; - } - -const MXIMPIdentity* MPresenceBuddyInfoStub::BuddyId() const - { - MXIMPIdentity* identity = NULL; - return identity; - } - -TBool MPresenceBuddyInfoStub::EqualsIdentity( - const MPresenceBuddyInfo* /*aOtherInstance*/ ) const - { - return ETrue; - } - -const TAny* MPresenceBuddyInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceBuddyInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceBuddyInfoStub::GetInterfaceId() const - { - return 0; - } - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfo.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* s_presencebuddyinfo.h :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: s_presencebuddyinfo.h -* -*/ -#ifndef MXIMPFWBUDDYPRESENCEINFOSTUB_H -#define MXIMPFWBUDDYPRESENCEINFOSTUB_H - -#include - -class MPresenceBuddyInfoStub : public MPresenceBuddyInfo - { - public: - static MPresenceBuddyInfoStub* NewStubL(); - - TInt Set( MXIMPIdentity* aIdentity, - MPresenceInfo* aPresenceInfo); - TInt SetPresenceInfo(MPresenceInfo* aPresenceInfo); - TInt SetBuddyId(MXIMPIdentity* aIdentity); - TInt SetPersonPresenceL(MPersonPresenceInfo* aPersonPresenceInfo); - const MPresenceInfo* PresenceInfo() const; - const MXIMPIdentity* BuddyId() const; - TBool EqualsIdentity(const MPresenceBuddyInfo* aOtherInstance ) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif //MXIMPFWBUDDYPRESENCEINFOSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfo2.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfo2.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* s_presencebuddyinfo2.cpp : 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: s_presencebuddyinfo2.cpp -* -*/ -#include "s_presencebuddyinfo2.h" -#include - -#define KAvailability _L("online"); -#define KMsg _L("hello"); -#define KBuddyId _L("gizmo:Sharath"); -#define KAvatar _L8("gshhshshhshshhsjskssiisisisisiisks"); - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ - MPresenceBuddyInfo2Stub* MPresenceBuddyInfo2Stub:: NewStubL() - { - - return new(ELeave) MPresenceBuddyInfo2Stub; - } - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::BuddyId -//------------------------------------------------------------ -TPtrC MPresenceBuddyInfo2Stub::BuddyId( ) const - { - return KBuddyId; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::Availability -//------------------------------------------------------------ -MPresenceBuddyInfo2::TAvailabilityValues MPresenceBuddyInfo2Stub::Availability( ) - { - return EUnknownAvailability; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::AvailabilityText -//------------------------------------------------------------ -TPtrC MPresenceBuddyInfo2Stub::AvailabilityText( ) - { - return KAvailability; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::Avatar -//------------------------------------------------------------ -TPtrC8 MPresenceBuddyInfo2Stub::Avatar( ) - { - return KAvatar; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -TPtrC MPresenceBuddyInfo2Stub::StatusMessage( ) - { - return KMsg; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::SetIdentityL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetIdentityL( const TDesC& /*aBuddyId*/ ) - { - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::SetAvailabilityL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetAvailabilityL( - MPresenceBuddyInfo2::TAvailabilityValues /*aAvailability*/, - const TDesC& /*aAvailabilityText*/ ) - { - - } - - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::SetAvatarL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetAvatarL( const TDesC8& /*aAvatar*/ ) - { - - } - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetStatusMessageL( - const TDesC& /*aStatusMessage*/ ) - { - - } - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::SetAnyFieldL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::SetAnyFieldL( - const TDesC16& aKey, - const TDesC8& aValue ) - { - HBufC8* valueBuffer = aValue.AllocLC(); - HBufC* keyBuffer = aKey.AllocLC(); - - TInt insertPos = iIds.Find(0); - if ( insertPos < 0 ) - { - insertPos = iIds.Count(); - iIds.Append( keyBuffer ); - iValues.Append( valueBuffer ); - } - else - { - iIds[insertPos] = keyBuffer; - iValues[insertPos] = valueBuffer; - } - CleanupStack::Pop( keyBuffer ); - CleanupStack::Pop( valueBuffer ); - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -TPtrC8 MPresenceBuddyInfo2Stub::GetAnyField( - const TDesC16& aKey ) - { - HBufC* key = aKey.AllocLC(); - HBufC8* val = NULL; - TInt count = iIds.Count(); - for(TInt i = 0; i < count; i++) - { - if(iIds[i]->Des().Compare(KExtensionKey) == 0) - { - val = iValues[i]; - break; - } - } - CleanupStack::PopAndDestroy(key); - // since there is no destructor for this test class, the member variable are destroyed here. - // as they are not needed any further, if these member variables are required further then appropriate destructor - // should be added. - // iIds.ResetAndDestroy(); - // iIds.Close(); - // iValues.ResetAndDestroy(); - // iValues.Close(); - return val ? val->Des() : TPtrC8(); - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::GetFieldKeysL( - CDesCArrayFlat& aKeys ) - { - aKeys.Reset(); - aKeys.AppendL(KExtensionKey ); - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::RemoveField(const TDesC& /*aKey*/ ) - { - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -TBool MPresenceBuddyInfo2Stub::EqualsIdentity( - const MPresenceBuddyInfo2& /*aOtherInstance*/ ) const - { - return ETrue; - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::ExternalizeL( RWriteStream& /*aStream*/ ) const -{ - -} -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::NewStubL -//------------------------------------------------------------ -void MPresenceBuddyInfo2Stub::InternalizeL( RReadStream& /*aStream*/ ) - { - - } - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfo2.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfo2.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* s_presencebuddyinfo2.h :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: s_presencebuddyinfo2.h -* -*/ -#ifndef MPRESENCEBUDDYINFO2STUB_H -#define MPRESENCEBUDDYINFO2STUB_H - -#include - -class MPresenceBuddyInfo2Stub : public MPresenceBuddyInfo2, - public CBase - { -public: - static MPresenceBuddyInfo2Stub* NewStubL(); - - void SetIdentityL( const TDesC& aBuddyId ); - - TPtrC BuddyId( ) const ; - - void SetAvailabilityL( - TAvailabilityValues aAvailability, - const TDesC& aAvailabilityText ) ; - - TAvailabilityValues Availability( ) ; - - TPtrC AvailabilityText( ); - - - void SetAvatarL( const TDesC8& aAvatar ) ; - - TPtrC8 Avatar( ) ; - - void SetStatusMessageL( - const TDesC& aStatusMessage ) ; - - TPtrC StatusMessage( ) ; - - void SetAnyFieldL( - const TDesC16& aKey, - const TDesC8& aValue ) ; - - TPtrC8 GetAnyField( - const TDesC16& aKey ); - - void GetFieldKeysL( - CDesCArrayFlat& aKeys ) ; - - void RemoveField(const TDesC& aKey ); - - TBool EqualsIdentity( - const MPresenceBuddyInfo2& aOtherInstance ) const ; - - void ExternalizeL( RWriteStream& aStream ) const ; - - void InternalizeL( RReadStream& aStream ) ; - ~MPresenceBuddyInfo2Stub() - { - iIds.ResetAndDestroy(); - iIds.Close(); - iValues.ResetAndDestroy(); - iValues.Close(); - } - -private: - RPointerArray iIds; - RPointerArray iValues; - }; - - - -#endif //MPRESENCEBUDDYINFO2STUB_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfolist.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfolist.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* s_presencebuddyinfolist.cpp 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:s_presencebuddyinfolist.cpp -* -*/ -#include "s_presencebuddyinfolist.h" - - -MPresenceBuddyInfoListStub* MPresenceBuddyInfoListStub::NewStubL() - { - return new ( ELeave ) MPresenceBuddyInfoListStub(); - } - - -RPointerArray& MPresenceBuddyInfoListStub::GetObjectCollection() - { - //RPointerArray array; - return iBuddyInfo ; // *gPresenceArry; - } - -TPtrC MPresenceBuddyInfoListStub::ServiceName() const - { - TPtrC ptr; - return ptr; - } - -TInt MPresenceBuddyInfoListStub::Count() const - { - return iBuddyInfo.Count(); - } - -TInt MPresenceBuddyInfoListStub::AddOrReplace( - MPresenceBuddyInfo* aBuddyPresenceInfo) - { - iBuddyInfo.Append( aBuddyPresenceInfo ); - return KErrNone; - } - -TInt MPresenceBuddyInfoListStub::FindAndRemove( - const MXIMPIdentity& /*aIdentity*/) - { - return KErrNone; - } - -MPresenceBuddyInfo* MPresenceBuddyInfoListStub::FindAndGet( - const MXIMPIdentity& /*aIdentity*/) const - { - MPresenceBuddyInfo* info = NULL; - return info; - } - - -const TAny* MPresenceBuddyInfoListStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceBuddyInfoListStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceBuddyInfoListStub::GetInterfaceId() const - { - return 0; - } - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfolist.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencebuddyinfolist.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -/* -* s_presencebuddyinfolist.h : 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: s_presencebuddyinfolist.h -* -*/ -#ifndef MXIMPFWBUDDYPRESENCEINFOLISTSTUB_H -#define MXIMPFWBUDDYPRESENCEINFOLISTSTUB_H - -#include -#include - -class MPresenceBuddyInfoListStub : public MPresenceBuddyInfoList - { - public: - static MPresenceBuddyInfoListStub* NewStubL(); - - RPointerArray& GetObjectCollection(); - TPtrC ServiceName() const; - TInt Count() const; - TInt AddOrReplace(MPresenceBuddyInfo* aBuddyPresenceInfo); - TInt FindAndRemove(const MXIMPIdentity& aIdentity); - MPresenceBuddyInfo* FindAndGet(const MXIMPIdentity& aIdentity) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - ~MPresenceBuddyInfoListStub() - { - iBuddyInfo.ResetAndDestroy(); - } - - private : - - RPointerArray iBuddyInfo; - }; - - - -#endif //MXIMPFWBUDDYPRESENCEINFOLISTSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencecachereader2.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencecachereader2.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* s_presencecachereader2.cpp :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: s_presencecachereader2.cpp -* -*/ -#include "s_presencecachereader2.h" - -TInt gAllBuddiesPresenceInServiceError = KErrNone; - -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::CreateReaderL -//------------------------------------------------------------ -MPresenceCacheReader2* MPresenceCacheReader2:: CreateReaderL() - { - return new(ELeave) MPresenceCacheReader2Stub; - } - -//------------------------------------------------------------ -// MPresenceCacheReader2Stub::BuddyCountInAllServices -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::BuddyCountInAllServices() - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::BuddyCountInService -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub:: BuddyCountInService(const TDesC& /*aServiceName*/) - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::ServicesCount -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::ServicesCount() - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::NewStubL -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::CancelRead() - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::SetIdentityL -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::AllBuddiesPresenceInService(const TDesC& /*aServiceName*/, - MPresenceCacheReadHandler2* /*aHandler*/) - { - return gAllBuddiesPresenceInServiceError; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::SetAvailabilityL -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::SetObserverForSubscribedNotifications( - MPresenceCacheReadHandler2* /*aHandler*/) - { - return 0; - } - - -//------------------------------------------------------------ -// MPresenceCacheReader2::SubscribePresenceBuddyChangeL -//------------------------------------------------------------ -TInt MPresenceCacheReader2Stub::SubscribePresenceBuddyChangeL(const TDesC& /*aIdentity*/) - { - return 0; - } -//------------------------------------------------------------ -// MPresenceCacheReader2::UnSubscribePresenceBuddyChangeL -//------------------------------------------------------------ - -void MPresenceCacheReader2Stub::UnSubscribePresenceBuddyChangeL(const TDesC& /*aIdentity*/) - { - - } -//------------------------------------------------------------ -// MPresenceBuddyInfo2Stub::BuddyId -//------------------------------------------------------------ - - MPresenceBuddyInfo2* MPresenceCacheReader2Stub::PresenceInfoLC(const TDesC& /*aIdentity*/) - { - MPresenceBuddyInfo2* info =NULL; - return info; - } \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencecachereader2.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencecachereader2.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* s_presencecachereader2.h :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: s_presencecachereader2.h -* -*/ -#ifndef MPRESENCECACHEREADER2STUB_H -#define MPRESENCECACHEREADER2STUB_H - -#include - -class MPresenceCacheReader2Stub : public MPresenceCacheReader2 - { - -public: //Sub interfaces for presence cache reader, Synchonous methods - - MPresenceBuddyInfo2* PresenceInfoLC(const TDesC& aIdentity); - - TInt BuddyCountInAllServices() ; - - TInt BuddyCountInService(const TDesC& aServiceName) ; - - TInt ServicesCount(); - - TInt CancelRead() ; - -public: //Sub interfaces for presence cache reader, Asynchronous methods - TInt AllBuddiesPresenceInService(const TDesC& aServiceName, - MPresenceCacheReadHandler2* aHandler); - -public: //Sub interfaces for presence cache reader, Asynchronous methods - - TInt SetObserverForSubscribedNotifications( - MPresenceCacheReadHandler2* aHandler) ; - - - TInt SubscribePresenceBuddyChangeL(const TDesC& aIdentity); - - void UnSubscribePresenceBuddyChangeL(const TDesC& aIdentity) ; - }; - - - -#endif //MPRESENCECACHEREADER2STUB_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencefeatures.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencefeatures.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,167 +0,0 @@ -/* -* s_presencefeatures.cpp Copyright (c) 2006, 2007 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: Interface for presence context. -* -*/ - -#include "s_presencefeatures.h" -#include "s_presentitygroups.h" -#include "s_ximppresenceauthorization.h" -#include "s_presencepublishing.h" -#include "s_presenceobjectfactory.h" -#include "s_presencewatching.h" - -MPresenceAuthorizationStub gPresenceAuthorizationStub; -MPresencePublishingStub gMPresenceFeaturesStubPublishing; -MPresenceObjectFactoryStub gMPresenceFeaturesStubObjectFactory; -MPresenceWatchingStub gMPresenceFeaturesStubPresenceWatching; - -/** - * Factory method to instantiate MPresenceFeatures. - * - * Factory method to instantiate platform default - * MXIMPClient implementation through the ECom. - * If the default presence framework isn't supported - * in the platform, leaves with errorcode signalled - * from ECom. - * - * @return The new presence client object. Object - * ownership is returned to caller. - */ -MPresenceFeatures* MyMPresenceFeatureStub::NewStubL( MXIMPContext* /*aContext*/ ) - { - - MyMPresenceFeatureStub* ret = new (ELeave) MyMPresenceFeatureStub(); - CleanupStack::PushL(ret); - ret->ContructL(); - CleanupStack::Pop(); - return ret; - } - -void MyMPresenceFeatureStub::ContructL() - { - iGroups = new (ELeave) MyPresentityGroupsStub(); - } - -/** - * Public destructor. - * Objects can be deleted through this interface. - */ -MyMPresenceFeatureStub::~MyMPresenceFeatureStub() - { - delete iGroups; - }; - - -/** - * Default constructor to zero initialize - * the iEcomDtorID member. - */ -MyMPresenceFeatureStub::MyMPresenceFeatureStub() - { - - } - - -/** - * Gets reference to object factory interface. - * - * Returned object factory interface is used - * to instantiate presence objects. - * - * @return Object factory interface. - * No ownership is returned caller. - */ -MPresenceObjectFactory& MyMPresenceFeatureStub::PresenceObjectFactory() const - { -// MPresenceObjectFactory* ret = NULL; -// return *ret; - return gMPresenceFeaturesStubObjectFactory; - }; - - -/** - * Gets reference to presence watching interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ -MPresenceWatching& MyMPresenceFeatureStub::PresenceWatching() const - { - //MPresenceWatching* ret = NULL; - //return *ret; - return gMPresenceFeaturesStubPresenceWatching; - }; - - - -/** - * Gets reference to presence publishing interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ -MPresencePublishing& MyMPresenceFeatureStub::PresencePublishing() const - { -// MPresencePublishing* ret = NULL; -// return *ret; - return gMPresenceFeaturesStubPublishing; - }; - - - -/** - * Gets reference to presentity groups interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ -MPresentityGroups& MyMPresenceFeatureStub::PresentityGroups() const - { - return *iGroups; - }; - - -/** - * Gets reference to presence authorization interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ -MPresenceAuthorization& MyMPresenceFeatureStub::PresenceAuthorization() const - { - return gPresenceAuthorizationStub; - }; - - -const TAny* MyMPresenceFeatureStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MyMPresenceFeatureStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MyMPresenceFeatureStub::GetInterfaceId() const - { - return 0; - } - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencefeatures.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencefeatures.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for presence context. -* -*/ -#ifndef MyMPresenceFeatureStub_H -#define MyMPresenceFeatureStub_H - -#include -#include -#include - -#include - -class MyPresentityGroupsStub; - -/** - * Interface for presence features. - * This interface is implemented by the XIMP Framework Presence Feature plug-in. - * - * MPresenceFeatures is root interface for accessing - * and updating presence data to remote presence service. - * XIMP FW client binds MXIMPContext interface - * to desired remote presence service and creates - * MPresenceFeatures interface to access the XIMP FW presence related - * methods to publish and access presence data. - * - * Following sub interfaces can be accessed from - * from MPresenceFeatures: - * - MPresenceObjectFactory - * - MPresenceWatching - * - MPresencePublishing - * - MPresentityGroups - * - MPresenceAuthorization - * - * All Presence events (context state, presence data, - * request completion etc. ones) are delivered through - * MPresenceContextObserver interface. - * - * @ingroup ximppresmanagementapi - * @since S60 v3.2 - */ -class MyMPresenceFeatureStub : public CBase, public MPresenceFeatures - { - -public: - - /** - * Factory method to instantiate MPresenceFeatures. - * - * Factory method to instantiate platform default - * MXIMPClient implementation through the ECom. - * If the default presence framework isn't supported - * in the platform, leaves with errorcode signalled - * from ECom. - * - * @return The new presence client object. Object - * ownership is returned to caller. - */ - static MPresenceFeatures* NewStubL( MXIMPContext* aContext ); - - /** - * Public destructor. - * Objects can be deleted through this interface. - */ - ~MyMPresenceFeatureStub(); - -protected: - - /** - * Default constructor to zero initialize - * the iEcomDtorID member. - */ - MyMPresenceFeatureStub(); - -private: - - void ContructL(); - -public: //Sub interfaces for presence context - - - /** - * Gets reference to object factory interface. - * - * Returned object factory interface is used - * to instantiate presence objects. - * - * @return Object factory interface. - * No ownership is returned caller. - */ - MPresenceObjectFactory& PresenceObjectFactory() const ; - - - /** - * Gets reference to presence watching interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ - MPresenceWatching& PresenceWatching() const ; - - - - /** - * Gets reference to presence publishing interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ - MPresencePublishing& PresencePublishing() const ; - - - - /** - * Gets reference to presentity groups interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ - MPresentityGroups& PresentityGroups() const ; - - - /** - * Gets reference to presence authorization interface. - * - * @return Requested interface. - * No ownership is returned caller. - */ - MPresenceAuthorization& PresenceAuthorization() const ; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - - private: - MyPresentityGroupsStub* iGroups; - - }; - - - - -#endif // MyMPresenceFeatureStub_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencegrantrequestinfo.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencegrantrequestinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* s_presencegrantrequestinfo.cpp 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: s_presencegrantrequestinfo.cpp -* -*/ - -#include "s_presencegrantrequestinfo.h" -#include "s_ximpidentity.h" - -extern MyMXIMPIdentityStub gMXIMPIdentity; // already defined in MPresentityPresenceEventStub - - -MPresenceGrantRequestInfo* MPresenceGrantRequestInfoStub::NewL() - { - MPresenceGrantRequestInfo* self = new (ELeave) MPresenceGrantRequestInfoStub; - return self; - } -const MXIMPIdentity& MPresenceGrantRequestInfoStub::RequestorId() const - { - gMXIMPIdentity.SetIdentityL(_L("identity")); - return gMXIMPIdentity; - } - -const TDesC16& MPresenceGrantRequestInfoStub::RequestorDisplayName() const - { - return KNullDesC(); - } - -void MPresenceGrantRequestInfoStub::SetRequestorIdL( MXIMPIdentity* /*aIdentity*/ ) - { - } - -void MPresenceGrantRequestInfoStub::SetRequestorDisplayNameL( const TDesC16& /*aDisplayName*/ ) - { - } - -const TAny* MPresenceGrantRequestInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - -TAny* MPresenceGrantRequestInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceGrantRequestInfoStub::GetInterfaceId() const - { - return 0; - } - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencegrantrequestinfo.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencegrantrequestinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* s_presencegrantrequestinfo.h :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: s_presencegrantrequestinfo.h -* -*/ -#ifndef MPRESENCEGRANTREQUESTINFOSTUB -#define MPRESENCEGRANTREQUESTINFOSTUB - -#include - -/** - * Interface for presence grant request info object. - * - * Presence grant request info object presents single - * presence grant request entry in the presence - * grant request list. Presence grant request info - * object holds the identity and display name information - * for the presence grant request. - * - * @ingroup presencedatamodelapi - * @since S60 v3.2 - */ -class MPresenceGrantRequestInfoStub : public MPresenceGrantRequestInfo - { -public: - static MPresenceGrantRequestInfo* NewL(); - const MXIMPIdentity& RequestorId() const; - - const TDesC16& RequestorDisplayName() const; - - void SetRequestorIdL( MXIMPIdentity* aIdentity ); - - void SetRequestorDisplayNameL( const TDesC16& aDisplayName ); - - const TAny* GetInterface( TInt32 aInterfaceId, TIfGetOps aOps ) const; - - TAny* GetInterface( TInt32 aInterfaceId, TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - -#endif diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfo.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/* -* s_presenceinfo.cpp :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: s_presenceinfo.cpp -* -*/ -#include "s_presenceinfo.h" -#include "s_presencepersoninfo.h" - -MPersonPresenceInfoStub gMPersonPresenceInfo; -TBool gPersonPresenceInfoAvailable = EFalse; - -const MPersonPresenceInfo* MPresenceInfoStub::PersonPresence() const - { - if ( gPersonPresenceInfoAvailable ) - { - return &gMPersonPresenceInfo; - } - MPersonPresenceInfo* info = NULL; - return info; - } -MPersonPresenceInfo* MPresenceInfoStub::PersonPresence() - { - MPersonPresenceInfo* info = NULL; - return info; - } - -void MPresenceInfoStub::SetPersonPresenceL( MPersonPresenceInfo* /*aPersonPresence*/ ) - { - } - -TInt MPresenceInfoStub::ServicePresenceCount() const - { - return 0; - } - -const MServicePresenceInfo& MPresenceInfoStub::ServicePresenceAt( TInt /*aIndex*/ ) const - { - MServicePresenceInfo* info = NULL; - return *info; - } - -void MPresenceInfoStub::LookupServicePresenceByServiceType( - MServicePresenceInfo*& /*aServicePresence*/, - const TDesC8& /*aMatch*/ ) const - { - } - -void MPresenceInfoStub::AddServicePresenceL( MServicePresenceInfo* /*aServicePresence*/ ) - { - } - -TInt MPresenceInfoStub::DevicePresenceCount() const - { - return 0; - } - -const MDevicePresenceInfo& MPresenceInfoStub::DevicePresenceAt( TInt /*aIndex*/ ) const - { - MDevicePresenceInfo* info = NULL; - return *info; - } - -void MPresenceInfoStub::AddDevicePresenceL( MDevicePresenceInfo* /*aDevicePresence*/ ) - { - } - -const TAny* MPresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoStub::GetInterfaceId() const - { - return 0; - } - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfo.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* s_presenceinfo.h :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: s_presenceinfo.h -* -*/ -#ifndef MPRESENCEINFOSTUB -#define MPRESENCEINFOSTUB - -#include - -/** - * Interface for presence info object. - * - * - * @todo Interface might be extended with new methods. - * - * @ingroup presencedatamodelapi - * @since S60 v3.2 - */ -class MPresenceInfoStub : public MPresenceInfo - { -public: - - const MPersonPresenceInfo* PersonPresence() const; - MPersonPresenceInfo* PersonPresence(); - - void SetPersonPresenceL( MPersonPresenceInfo* aPersonPresence ); - - TInt ServicePresenceCount() const; - - const MServicePresenceInfo& ServicePresenceAt( TInt aIndex ) const; - - void LookupServicePresenceByServiceType( - MServicePresenceInfo*& aServicePresence, - const TDesC8& aMatch ) const; - - void AddServicePresenceL( MServicePresenceInfo* aServicePresence ); - - TInt DevicePresenceCount() const; - - const MDevicePresenceInfo& DevicePresenceAt( TInt aIndex ) const; - - void AddDevicePresenceL( MDevicePresenceInfo* aDevicePresence ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - -#endif diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofield.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofield.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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 : s_presenceinfofield.cpp -* -*/ -#include "s_presenceinfofield.h" - -const TDesC8& MPresenceInfoFieldStub::FieldType() const - { - return KNullDesC8; - } - -void MPresenceInfoFieldStub::SetFieldTypeL( const TDesC8& /*aFieldType*/ ) - { - } - -const MXIMPBase& MPresenceInfoFieldStub::FieldValue() const - { - MXIMPBase* base = NULL; - return *base; - } - -MXIMPBase& MPresenceInfoFieldStub::FieldValue() - { - MXIMPBase* base = NULL; - return *base; - } - -void MPresenceInfoFieldStub::SetFieldValue( MXIMPBase* /*aFieldValue*/ ) - { - } - -const TAny* MPresenceInfoFieldStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoFieldStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoFieldStub::GetInterfaceId() const - { - return 0; - } - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofield.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofield.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* 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: s_presenceinfofield.h -* -*/ -#ifndef MXIMPFWPRESENCEINFOFIELDSTUB_H -#define MXIMPFWPRESENCEINFOFIELDSTUB_H - -#include - -class MPresenceInfoFieldStub : public MPresenceInfoField - { - const TDesC8& FieldType() const; - - void SetFieldTypeL( const TDesC8& aFieldType ); - - const MXIMPBase& FieldValue() const; - - MXIMPBase& FieldValue(); - - void SetFieldValue( MXIMPBase* aFieldValue ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif //MXIMPFWPRESENCEINFOFIELD_H - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldcollection.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldcollection.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* 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: s_presenceinfofieldcollection.cpp -* -*/ -#include "s_presenceinfofieldcollection.h" - -TInt MPresenceInfoFieldCollectionStub::FieldCount() const - { - return KErrNone; - } - -const MPresenceInfoField& MPresenceInfoFieldCollectionStub::FieldAt( TInt /*aIndex*/ ) const - { - MPresenceInfoField* field = NULL; - return *field; - } - -void MPresenceInfoFieldCollectionStub::LookupFieldByFieldType( - MPresenceInfoField*& /*aPresenceInfoField*/, - const TDesC8& /*aMatch*/ ) const - { - } - -TInt MPresenceInfoFieldCollectionStub::DeleteFieldByFieldType(const TDesC8& /*aMatch*/ ) - { - return KErrNone; - } - - -void MPresenceInfoFieldCollectionStub::AddOrReplaceFieldL( MPresenceInfoField* /*aPresenceInfoField*/ ) - { - } - -const TAny* MPresenceInfoFieldCollectionStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoFieldCollectionStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoFieldCollectionStub::GetInterfaceId() const - { - return 0; - } - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldcollection.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldcollection.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* 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: s_presenceinfofieldcollection.h -* -*/ -#ifndef MXIMPFWPRESENCEINFOFIELDCOLLECTIONSTUB_H -#define MXIMPFWPRESENCEINFOFIELDCOLLECTIONSTUB_H - -#include - -class MPresenceInfoFieldCollectionStub : public MPresenceInfoFieldCollection - { - TInt FieldCount() const; - - const MPresenceInfoField& FieldAt( TInt aIndex ) const; - - void LookupFieldByFieldType( MPresenceInfoField*& aPresenceInfoField, - const TDesC8& aMatch ) const; - - virtual TInt DeleteFieldByFieldType(const TDesC8& aMatch ); - - void AddOrReplaceFieldL( MPresenceInfoField* aPresenceInfoField ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif //MXIMPFWPRESENCEINFOFIELDCOLLECTION_H - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldvalueenum.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldvalueenum.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +0,0 @@ -/* -* 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: s_presenceinfofieldvalueenum.cpp -* -*/ -#include "s_presenceinfofieldvalueenum.h" - -TInt MPresenceInfoFieldValueEnumStub::MinValue() const - { - return 0; - } - -TInt MPresenceInfoFieldValueEnumStub::MaxValue() const - { - return 0; - } - -TInt MPresenceInfoFieldValueEnumStub::Value() const - { - return 0; - } - -void MPresenceInfoFieldValueEnumStub::SetValueL( TInt /*aValue*/ ) - { - } - -void MPresenceInfoFieldValueEnumStub::SetLimits( TInt /*aMin*/, TInt /*aMax*/ ) - { - } - -const TAny* MPresenceInfoFieldValueEnumStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoFieldValueEnumStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoFieldValueEnumStub::GetInterfaceId() const - { - return 0; - } - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldvalueenum.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldvalueenum.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* 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: s_presenceinfofieldvalueenum.h -* -*/ -#ifndef MXIMPFWPRESENCEINFOFIELDVALUEENUMSTUB_H -#define MXIMPFWPRESENCEINFOFIELDVALUEENUMSTUB_H - -#include - -class MPresenceInfoFieldValueEnumStub : public MPresenceInfoFieldValueEnum - { - TInt MinValue() const; - - TInt MaxValue() const; - - TInt Value() const; - - void SetValueL( TInt aValue ); - - void SetLimits( TInt aMin, TInt aMax ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - -#endif //MXIMPFWPRESENCEINFOFIELDVALUEENUM_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldvaluetext.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldvaluetext.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* 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: s_presenceinfofieldvaluetext.cpp -* -*/ - -#include "s_presenceinfofieldvaluetext.h" - -TInt MPresenceInfoFieldValueTextStub::MaxLength() const - { - return 0; - } - -TPtrC MPresenceInfoFieldValueTextStub::TextValue() const - { - return KNullDesC(); - } - -void MPresenceInfoFieldValueTextStub::SetTextValueL( const TDesC& /*aValue*/ ) - { - } - -const TAny* MPresenceInfoFieldValueTextStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceInfoFieldValueTextStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceInfoFieldValueTextStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldvaluetext.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceinfofieldvaluetext.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* 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: s_presenceinfofieldvaluetext.h -* -*/ -#ifndef MXIMPFWPRESENCEINFOFIELDVALUETEXTSTUB_H -#define MXIMPFWPRESENCEINFOFIELDVALUETEXTSTUB_H - -#include - -class MPresenceInfoFieldValueTextStub : public MPresenceInfoFieldValueText - { - TInt MaxLength() const; - - TPtrC TextValue() const; - - void SetTextValueL( const TDesC& aValue ); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - - -#endif //MXIMPFWPRESENCEINFOFIELDVALUETEXT_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceobjectfactory.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceobjectfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -/* -* 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: s_presenceobjectfactory.cpp -* -*/ -#include "s_presenceobjectfactory.h" -#include "s_servicepresenceinfo.h" -#include "s_presenceinfofield.h" -#include "s_presenceinfofieldvalueenum.h" -#include "s_presencepersoninfo.h" -#include "s_presenceinfofieldvaluetext.h" -#include "s_presenceinfo.h" - -MPresenceInfoStub* gMPresenceInfoStub = NULL; -MServicePresenceInfoStub gMPresenceObjectFactoryStubServicePresenceInfo; -MPresenceInfoFieldStub gMPresenceObjectFactoryStubPresenceInfoField; -MPresenceInfoFieldValueEnumStub gMPresenceObjectFactoryStubPresenceInfoFieldValueEnum; -MPersonPresenceInfoStub gMPresenceObjectFactoryStubPersonPresenceInfo; -MPresenceInfoFieldValueTextStub gMPresenceObjectFactoryStubPresenceInfoFieldValueText; - -MPresentityGroupInfo* MPresenceObjectFactoryStub::NewPresentityGroupInfoLC() - { - return NULL; - } - -MPresentityGroupMemberInfo* MPresenceObjectFactoryStub::NewPresentityGroupMemberInfoLC() - { - return NULL; - } - -MPresenceWatcherInfo* MPresenceObjectFactoryStub::NewPresenceWatcherInfoLC() - { - return NULL; - } - -MPresenceGrantRequestInfo* MPresenceObjectFactoryStub::NewPresenceGrantRequestInfoLC() - { - return NULL; - } - -MPresenceInfo* MPresenceObjectFactoryStub::NewPresenceInfoLC() - { - if ( !gMPresenceInfoStub ) - { - gMPresenceInfoStub = new ( ELeave )MPresenceInfoStub(); - } - - CleanupStack::PushL( gMPresenceInfoStub ); - return gMPresenceInfoStub; - } - -MPresenceInfoFilter* MPresenceObjectFactoryStub::NewPresenceInfoFilterLC() - { - return NULL; - } - -MPersonPresenceInfo* MPresenceObjectFactoryStub::NewPersonPresenceInfoLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubPersonPresenceInfo ); - return &gMPresenceObjectFactoryStubPersonPresenceInfo; - } - -MServicePresenceInfo* MPresenceObjectFactoryStub::NewServicePresenceInfoLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubServicePresenceInfo ); - return &gMPresenceObjectFactoryStubServicePresenceInfo; - } - -MDevicePresenceInfo* MPresenceObjectFactoryStub::NewDevicePresenceInfoLC() - { - return NULL; - } - -MPresenceInfoField* MPresenceObjectFactoryStub::NewInfoFieldLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubPresenceInfoField ); - return &gMPresenceObjectFactoryStubPresenceInfoField; - } - -MPresenceInfoFieldValueEnum* MPresenceObjectFactoryStub::NewEnumInfoFieldLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubPresenceInfoFieldValueEnum ); - return &gMPresenceObjectFactoryStubPresenceInfoFieldValueEnum; - } - -MPresenceInfoFieldValueText* MPresenceObjectFactoryStub::NewTextInfoFieldLC() - { - CleanupStack::PushL( &gMPresenceObjectFactoryStubPresenceInfoFieldValueText ); - return &gMPresenceObjectFactoryStubPresenceInfoFieldValueText; - } - -MPresenceInfoFieldValueBinary* MPresenceObjectFactoryStub::NewBinaryInfoFieldLC() - { - return NULL; - } - -MPresenceBlockInfo* MPresenceObjectFactoryStub::NewPresenceBlockInfoLC() - { - return NULL; - } - -const TAny* MPresenceObjectFactoryStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceObjectFactoryStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceObjectFactoryStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceobjectfactory.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presenceobjectfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* -* 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: s_presenceobjectfactory.h -* -*/ -#ifndef MPRESENCEOBJECTFACTORYSTUB_H -#define MPRESENCEOBJECTFACTORYSTUB_H - -#include - -class MPresenceObjectFactoryStub : public MPresenceObjectFactory - { -public: - - MPresentityGroupInfo* NewPresentityGroupInfoLC(); - - MPresentityGroupMemberInfo* NewPresentityGroupMemberInfoLC(); - - MPresenceWatcherInfo* NewPresenceWatcherInfoLC(); - - MPresenceGrantRequestInfo* NewPresenceGrantRequestInfoLC(); - - MPresenceInfo* NewPresenceInfoLC(); - - MPresenceInfoFilter* NewPresenceInfoFilterLC(); - - MPersonPresenceInfo* NewPersonPresenceInfoLC(); - - MServicePresenceInfo* NewServicePresenceInfoLC(); - - MDevicePresenceInfo* NewDevicePresenceInfoLC(); - - MPresenceInfoField* NewInfoFieldLC(); - - MPresenceInfoFieldValueEnum* NewEnumInfoFieldLC(); - - MPresenceInfoFieldValueText* NewTextInfoFieldLC(); - - MPresenceInfoFieldValueBinary* NewBinaryInfoFieldLC(); - - MPresenceBlockInfo* NewPresenceBlockInfoLC(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - -#endif // MPRESENCEOBJECTFACTORY_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencepersoninfo.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencepersoninfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* 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: s_presencepersoninfo.cpp -* -*/ - -#include "s_presencepersoninfo.h" -#include "s_presenceinfofieldcollection.h" - -MPresenceInfoFieldCollectionStub gMPersonPresenceInfoStubCollection; - -const MPresenceInfoFieldCollection& MPersonPresenceInfoStub::Fields() const - { - return gMPersonPresenceInfoStubCollection; - } - -MPresenceInfoFieldCollection& MPersonPresenceInfoStub::Fields() - { - return gMPersonPresenceInfoStubCollection; - } - -const TAny* MPersonPresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPersonPresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPersonPresenceInfoStub::GetInterfaceId() const - { - return 0; - } - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencepersoninfo.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencepersoninfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* 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: s_presencepersoninfo.h -* -*/ -#ifndef MXIMPFWPERSONPRESENCEINFOSTUB_H -#define MXIMPFWPERSONPRESENCEINFOSTUB_H - -#include - -class MPersonPresenceInfoStub : public MPersonPresenceInfo - { - const MPresenceInfoFieldCollection& Fields() const; - - MPresenceInfoFieldCollection& Fields(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif //MXIMPFWPERSONPRESENCEINFO_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencepublishing.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencepublishing.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* 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: s_presencepublishing.cpp -* -*/ -#include "s_presencepublishing.h" - -TXIMPRequestId gMPresencePublishingStubId; -TInt gPublishOwnPresenceLeaves = KErrNone; - -TXIMPRequestId MPresencePublishingStub::SubscribeOwnPresenceL( const MPresenceInfoFilter& /*aPif*/ ) - { - return gMPresencePublishingStubId; - } - -TXIMPRequestId MPresencePublishingStub::UnsubscribeOwnPresenceL() - { - return gMPresencePublishingStubId; - } - -TXIMPRequestId MPresencePublishingStub::PublishOwnPresenceL( const MPresenceInfo& /*aPresence*/ ) - { - User::LeaveIfError( gPublishOwnPresenceLeaves ); - - return gMPresencePublishingStubId; - } - -TXIMPRequestId MPresencePublishingStub::SubscribePresenceWatcherListL() - { - return gMPresencePublishingStubId; - } - -TXIMPRequestId MPresencePublishingStub::UnsubscribePresenceWatcherListL() - { - return gMPresencePublishingStubId; - } - -const TAny* MPresencePublishingStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresencePublishingStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresencePublishingStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencepublishing.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencepublishing.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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: s_presencepublishing.h -* -*/ -#ifndef MXIMPFWPRESENCEPUBLISHINGSTUB_H -#define MXIMPFWPRESENCEPUBLISHINGSTUB_H - -#include - -class MPresencePublishingStub : public MPresencePublishing - { - TXIMPRequestId SubscribeOwnPresenceL( const MPresenceInfoFilter& aPif ); - - TXIMPRequestId UnsubscribeOwnPresenceL(); - - TXIMPRequestId PublishOwnPresenceL( const MPresenceInfo& aPresence ); - - TXIMPRequestId SubscribePresenceWatcherListL(); - - TXIMPRequestId UnsubscribePresenceWatcherListL(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENCEPUBLISHING_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencesubserviceeventobserver.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencesubserviceeventobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/* -* 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: s_presencesubserviceeventobserver.h -* -*/ -#include "mvimpstenginepresencesubserviceeventobserver.h" -#include - -class MyPresenceSubServiceEventObserverStub : public MVIMPSTEnginePresenceSubServiceEventObserver, - public CBase - { - public : - - static MyPresenceSubServiceEventObserverStub* MyPresenceSubServiceEventObserverStub::NewL() - { - MyPresenceSubServiceEventObserverStub* self = new (ELeave) MyPresenceSubServiceEventObserverStub(); - return self; - } - - MyPresenceSubServiceEventObserverStub::~MyPresenceSubServiceEventObserverStub() - { - - } - - public: - /** - * observer to handle own presence change notifications - * - * @since s60 5.0 - * @param aStatus current status. - * @param aStatusText status text to be shown. - */ - void HandleOwnPresenceChangeEventL(TVIMPSTEnums::TOnlineStatus /*aStatus*/, const TDesC& /*aStatusText*/ ) - { - - } - - - void HandleAddRequestEventL(TVIMPSTEnums::TOperationType aType,const TDesC& /*aRequester*/ ,const TDesC& aRequestorDisplayName) - { - - } - }; - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencewatching.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencewatching.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* 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: s_presencewatching.cpp -* -*/ -#include "s_presencewatching.h" - - -TXIMPRequestId MPresenceWatchingStub::SubscribePresentityPresenceL( - const MXIMPIdentity& /*aPresentityId*/, - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MPresenceWatchingStub::UnsubscribePresentityPresenceL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MPresenceWatchingStub::SubscribePresentityGroupMembersPresenceL( - const MXIMPIdentity& /*aGroupId*/, - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MPresenceWatchingStub::UnsubscribePresentityGroupMembersPresenceL( - const MXIMPIdentity& /*aGroupId*/ ) - { - TXIMPRequestId id; - return id; - } - -const TAny* MPresenceWatchingStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MPresenceWatchingStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceWatchingStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencewatching.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presencewatching.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* 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: s_presencewatching.h -* -*/ -#ifndef MXIMPFWPRESENCEWATCHINGSTUB_H -#define MXIMPFWPRESENCEWATCHINGSTUB_H - -#include - -class MPresenceWatchingStub : public MPresenceWatching - { - TXIMPRequestId SubscribePresentityPresenceL( - const MXIMPIdentity& aPresentityId, - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId UnsubscribePresentityPresenceL( - const MXIMPIdentity& aPresentityId ); - - TXIMPRequestId SubscribePresentityGroupMembersPresenceL( - const MXIMPIdentity& aGroupId, - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId UnsubscribePresentityGroupMembersPresenceL( - const MXIMPIdentity& aGroupId ); - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENCEWATCHINGSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presentitygroups.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presentitygroups.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,256 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Presentity group handling interface for clients use. -* -*/ - -#include "s_presentitygroups.h" - -/** - * Protected destructor. - * Object instancies can't be deleted via this interface. - */ -MyPresentityGroupsStub::~MyPresentityGroupsStub() {} - -//MyPresentityGroupsStub::MyPresentityGroupsStub {} - -/** - * Subscribes presentity group list notifications. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::SubscribePresentityGroupListL() - { - TXIMPRequestId id; - return id; - } - - - -/** - * Unsubscribes presentity group list notifications. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::UnsubscribePresentityGroupListL() - { - TXIMPRequestId id; - return id; - } - - - -/** - * Creates presentity group. - * - * Note: Remote service may alter given presentity group ID and - * display name. Altered ID and display names are signalled back - * to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aDisplayName - * Presentity group display name. - * - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::CreatePresentityGroupL( - const MXIMPIdentity& /*aGroupId*/, - const TDesC16& /*aDisplayName*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Deletes presentity group. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::DeletePresentityGroupL( - const MXIMPIdentity& /*aGroupId*/ ) - { - TXIMPRequestId id; - return id; - } - - - -/** - * Updates presentity group display name. - * - * Note: Remote service may alter given presentity group display name. - * Altered display name is signalled back to client through - * MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aDisplayName - * New display name for the presentity group. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::UpdatePresentityGroupDisplayNameL( - const MXIMPIdentity& /*aGroupId*/, - const TDesC16& /*aDisplayName*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Subscribes presentity group content notifications. - * - * @param [in] aGroupId - * Identification for presentity group for which - * to subscribe content notifications. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::SubscribePresentityGroupContentL( - const MXIMPIdentity& /*aGroupId*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Unsubscribes presentity group content notifications. - * - * @param [in] aGroupId - * Identification for presentity group for which - * content notification subscription to terminate. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::UnsubscribePresentityGroupContentL( - const MXIMPIdentity& /*aGroupId*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Requests the protocol to add new member to - * identified presentity group. - * - * - * Note: Remote service may alter given member and - * display name. Altered ID and display names - * are signalled back to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification of the presentity group where to - * add new member. - * - * @param [in] aMemberId - * Identification of the new member. - * - * @param [in] aMemberDisplayName - * Display name for the added member. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::AddPresentityGroupMemberL( - const MXIMPIdentity& /*aGroupId*/, - const MXIMPIdentity& /*aMemberId*/, - const TDesC16& /*aMemberDisplayName*/ ) - { - TXIMPRequestId id; - return id; - } - - -/** - * Requests the XIMPFw to remove member from - * identified presentity group. - * - * @param [in] aGroupId - * Identification of the presentity group from - * where to remove member. - * - * @param [in] aMemberId - * Identification of the member to remove. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::RemovePresentityGroupMemberL( - const MXIMPIdentity& /*aGroupId*/, - const MXIMPIdentity& /*aMemberId*/ ) - { - TXIMPRequestId id; - return id; - } - - - -/** - * Requests the XIMPFw to update presentity group - * member display name. - * - * Note: Remote service may alter given presentity group member - * display name. Altered display name is signalled back - * to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aMemberId - * Identification of the member which display - * name to update. - * - * @param [in] aMemberDisplayName - * New display name for the member. - * - * @return The request ID identifying the issued request. - */ -TXIMPRequestId MyPresentityGroupsStub::UpdatePresentityGroupMemberDisplayNameL( - const MXIMPIdentity& /*aGroupId*/, - const MXIMPIdentity& /*aMemberId*/, - const TDesC16& /*aMemberDisplayName*/ ) - { - TXIMPRequestId id; - return id; - } - - - -const TAny* MyPresentityGroupsStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MyPresentityGroupsStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MyPresentityGroupsStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presentitygroups.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_presentitygroups.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Presentity group handling interface for clients use. -* -*/ -#ifndef MyPresentityGroupsStub_H -#define MyPresentityGroupsStub_H - -#include -#include -#include - -class MXIMPIdentity; - - -/** - * Presentity group handling interface for clients use. - * Interface is implemented by the XIMP Framework. - * - * MPresentityGroups provides services for - * XIMP Framework clients to manage presentity groups - * and presentity group members. It provides also services - * to subscribe notifications from presentity group list changes - * and from individual presentity group changes. - * - * Client can retrieve MPresentityGroups interface from - * MXIMPContext interface. - * - * @ingroup ximppresmanagementapi - * @since S60 v3.2 - */ -class MyPresentityGroupsStub : public MPresentityGroups, public CBase - { - -public: - /** - * Protected destructor. - * Object instancies can't be deleted via this interface. - */ - ~MyPresentityGroupsStub(); - - - /** - * Subscribes presentity group list notifications. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId SubscribePresentityGroupListL() ; - - - - /** - * Unsubscribes presentity group list notifications. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId UnsubscribePresentityGroupListL() ; - - - - /** - * Creates presentity group. - * - * Note: Remote service may alter given presentity group ID and - * display name. Altered ID and display names are signalled back - * to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aDisplayName - * Presentity group display name. - * - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId CreatePresentityGroupL( - const MXIMPIdentity& aGroupId, - const TDesC16& aDisplayName ) ; - - - /** - * Deletes presentity group. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId DeletePresentityGroupL( - const MXIMPIdentity& aGroupId ) ; - - - - /** - * Updates presentity group display name. - * - * Note: Remote service may alter given presentity group display name. - * Altered display name is signalled back to client through - * MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aDisplayName - * New display name for the presentity group. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId UpdatePresentityGroupDisplayNameL( - const MXIMPIdentity& aGroupId, - const TDesC16& aDisplayName ) ; - - - -public: //Prototypes for presentity group member management requests - - - /** - * Subscribes presentity group content notifications. - * - * @param [in] aGroupId - * Identification for presentity group for which - * to subscribe content notifications. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId SubscribePresentityGroupContentL( - const MXIMPIdentity& aGroupId ) ; - - - /** - * Unsubscribes presentity group content notifications. - * - * @param [in] aGroupId - * Identification for presentity group for which - * content notification subscription to terminate. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId UnsubscribePresentityGroupContentL( - const MXIMPIdentity& aGroupId ) ; - - - /** - * Requests the protocol to add new member to - * identified presentity group. - * - * - * Note: Remote service may alter given member and - * display name. Altered ID and display names - * are signalled back to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification of the presentity group where to - * add new member. - * - * @param [in] aMemberId - * Identification of the new member. - * - * @param [in] aMemberDisplayName - * Display name for the added member. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId AddPresentityGroupMemberL( - const MXIMPIdentity& aGroupId, - const MXIMPIdentity& aMemberId, - const TDesC16& aMemberDisplayName ) ; - - - /** - * Requests the XIMPFw to remove member from - * identified presentity group. - * - * @param [in] aGroupId - * Identification of the presentity group from - * where to remove member. - * - * @param [in] aMemberId - * Identification of the member to remove. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId RemovePresentityGroupMemberL( - const MXIMPIdentity& aGroupId, - const MXIMPIdentity& aMemberId ) ; - - - - /** - * Requests the XIMPFw to update presentity group - * member display name. - * - * Note: Remote service may alter given presentity group member - * display name. Altered display name is signalled back - * to client through MXIMPRequestCompleteEvent. - * - * @param [in] aGroupId - * Identification for presentity group. - * - * @param [in] aMemberId - * Identification of the member which display - * name to update. - * - * @param [in] aMemberDisplayName - * New display name for the member. - * - * @return The request ID identifying the issued request. - */ - TXIMPRequestId UpdatePresentityGroupMemberDisplayNameL( - const MXIMPIdentity& aGroupId, - const MXIMPIdentity& aMemberId, - const TDesC16& aMemberDisplayName ) ; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - - - -#endif // MyPresentityGroupsStub_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_rproperty.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_rproperty.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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: s_rproperty.cpp -* -*/ -#include -#include - - -TInt gKey = KErrNotFound; -TInt gValue = KErrNotFound; -TRequestStatus gRequest = 0; -/* - IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, TInt aPreallocate=0); - IMPORT_C static TInt Define(TUid aCategory, TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); - IMPORT_C static TInt Define(TUint aKey, TInt aAttr, const TSecurityPolicy& aReadPolicy, const TSecurityPolicy& aWritePolicy, TInt aPreallocated=0); - IMPORT_C static TInt Delete(TUid aCategory, TUint aKey); - IMPORT_C static TInt Delete(TUint aKey); - IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C static TInt Get(TUid aCategory, TUint aKey, TDes16& aValue); -#endif - IMPORT_C static TInt Set(TUid aCategory, TUint aKey, TInt aValue); - IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C static TInt Set(TUid aCategory, TUint aKey, const TDesC16& aValue); -#endif - - IMPORT_C void Cancel(); - - IMPORT_C TInt Get(TInt& aValue); - IMPORT_C TInt Get(TDes8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C TInt Get(TDes16& aValue); -#endif - IMPORT_C TInt Set(TInt aValue); - IMPORT_C TInt Set(const TDesC8& aValue); -#ifndef __KERNEL_MODE__ - IMPORT_C TInt Set(const TDesC16& aValue); -*/ - -TInt RProperty::Attach(TUid /*aCategory*/, TUint /*aKey*/, TOwnerType /*aType*/ ) - { - return KErrNone; - } - -TInt RProperty::Set(TUid /*aCategory*/, TUint aKey, TInt aValue) - { - gKey = aKey; - gValue = aValue; - - return KErrNone; - } - -TInt RProperty::Get( TInt& aValue ) - { - aValue = gValue; - - return KErrNone; - } - -TInt RProperty::Get(TUid /*aCategory*/, TUint aKey, TInt& aValue) - { - if( aKey == gKey ) - { - aValue = gValue; - return KErrNone; - } - - return KErrNotFound; - } - -void RProperty::Subscribe(TRequestStatus& /*aRequest*/) - { - } - -void RProperty::Cancel() - { - } - -TInt RProperty::Define(TUid /*aCategory*/, TUint /*aKey*/, TInt /*aAttr*/, TInt /*aPreallocate=0*/) - { - return KErrNone; - } - -void RHandleBase::Close() -{ - -} - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_servicepresenceinfo.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_servicepresenceinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* 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: s_servicepresenceinfo.cpp -* -*/ -#include "s_servicepresenceinfo.h" -#include "s_presenceinfofieldcollection.h" - -MPresenceInfoFieldCollectionStub gMPresenceInfoFieldCollection; - -const TPtrC8 MServicePresenceInfoStub::ServiceType() const - { - return KNullDesC8(); - } - -void MServicePresenceInfoStub::SetServiceTypeL( const TDesC8& /*aServiceType*/ ) - { - } - -const MPresenceInfoFieldCollection& MServicePresenceInfoStub::Fields() const - { - MPresenceInfoFieldCollection* collection = NULL; - return *collection; - } - -MPresenceInfoFieldCollection& MServicePresenceInfoStub::Fields() - { - return gMPresenceInfoFieldCollection; - } - -const TAny* MServicePresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MServicePresenceInfoStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MServicePresenceInfoStub::GetInterfaceId() const - { - return 0; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_servicepresenceinfo.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_servicepresenceinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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: s_servicepresenceinfo.h -* -*/ -#ifndef MXIMPFWSERVICEPRESENCEINFOSTUB_H -#define MXIMPFWSERVICEPRESENCEINFOSTUB_H - -#include - -class MServicePresenceInfoStub : public MServicePresenceInfo - { - const TPtrC8 ServiceType() const; - - void SetServiceTypeL( const TDesC8& aServiceType ); - - const MPresenceInfoFieldCollection& Fields() const; - - MPresenceInfoFieldCollection& Fields(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - -#endif //MXIMPFWSERVICEPRESENCEINFO_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_spentry.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_spentry.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* -* 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: s_spentry.cpp -* -*/ -#include -#include - - -CSPEntry* CSPEntry::NewL() - { - CSPEntry* self = CSPEntry::NewLC(); - CleanupStack::Pop(self); - return self; - } - -CSPEntry* CSPEntry::NewLC() - { - CSPEntry* self = new ( ELeave) CSPEntry; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -CSPEntry::~CSPEntry() - { - iServiceName.Close(); - iPropertyArray.ResetAndDestroy(); - iPropertyArray.Close(); - } - -TServiceId CSPEntry::GetServiceId() const - { - return iServiceId; - } - -void CSPEntry::SetServiceId( TServiceId aServiceId ) - { - iServiceId = aServiceId; - } - -const TDesC16& CSPEntry::GetServiceName() const - { - return iServiceName; - } - -TInt CSPEntry::SetServiceName( const TDesC16& aServiceName ) - { - - iServiceName.Copy(aServiceName); - return KErrNone; - } - -TInt CSPEntry::AddPropertyL( const CSPProperty& aProperty ) - { - CSPProperty* property = CSPProperty::NewL(); - CleanupStack::PushL( property ); - - property->CopyL( aProperty ); - - TInt err = iPropertyArray.Append( property ); - if( err == KErrNoMemory ) - { - User::Leave( KErrNoMemory ); - } - - CleanupStack::Pop( property ); - - return KErrNone; - } - - -TInt CSPEntry::UpdateProperty( TServicePropertyName /*aPropertyName*/, TInt /*aValue*/ ) - { - return KErrNone; - } - - -TInt CSPEntry::UpdateProperty( TServicePropertyName /*aPropertyName*/, const TDesC& /*aValue*/ ) - { - return KErrNone; - } - -TInt CSPEntry::UpdateProperty( TServicePropertyName /*aPropertyName*/, TOnOff /*aValue*/ ) - { - return KErrNone; - } - -TInt CSPEntry::GetProperty( const CSPProperty*& aProperty, - TServicePropertyName aPropertyName ) const - { - TInt count = iPropertyArray.Count(); - for( TInt i=0; iGetName() == aPropertyName ) - { - aProperty = iPropertyArray[ i ]; - return KErrNone; - } - } - - return KErrNotFound; - } - -TInt CSPEntry::GetProperty( const CSPProperty*& /*aProperty*/, - TInt /*aIndex*/ ) const - { - return KErrNone; - } - -TInt CSPEntry::DeleteProperty( TInt /*aIndex*/ ) - { - return KErrNone; - } - -TInt CSPEntry::DeleteProperty( TServicePropertyName /*aProperty*/ ) - { - return KErrNone; - } - -const RPropertyArray& CSPEntry::GetAllProperties() const - { - return iPropertyArray; - } - -TInt CSPEntry::PropertyCount() const - { - return KErrNone; - } - -CSPEntry::CSPEntry() - { - } - -void CSPEntry::ConstructL() - { - iServiceName.CreateL(500); - } - -TInt CSPEntry::SearchProperty( TServicePropertyName /*aProperty*/ ) const - { - return KErrNone; - } - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_spproperty.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_spproperty.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,316 +0,0 @@ -/* -* 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: s_spproperty.cpp -* -*/ -#include - -TServicePropertyName gPropertyName = EPropertyUnknown; -TInt gContactViewPluginId = 0; -HBufC* gPropertyContactStoreId = 0; -HBufC* gPropertyBrandId = 0; -TBool gPropertyInvalid = EFalse; -TInt gPropertyBrandLanguage = 0; -TInt gPropertyBrandVersion = 0; -TInt gPropertyXIMP = 0; -TOnOff gPropertyPresenceRequestPreference = EOff; -TInt gContactViewId = 0; - -TOnOff gPropertyVoIPEnabled = EOff; -TInt gPropertyPresenceSettingsId = 0; -TInt gPropertyIMSettingsId = 0; -TInt gPropertyPCSPluginId = 0; - -CSPProperty* CSPProperty::NewL() - { - return new ( ELeave ) CSPProperty; - } - - -CSPProperty* CSPProperty::NewLC() - { - - CSPProperty* self = new ( ELeave ) CSPProperty; - CleanupStack::PushL( self ); - return self; - } - -CSPProperty::~CSPProperty(){} - - -TServicePropertyName CSPProperty::GetName() const - { - return iPropertyName; - } - - -TInt CSPProperty::SetName( TServicePropertyName aPropertyname ) - { - iPropertyName = aPropertyname; - return KErrNone; - } - - -TSPItemType CSPProperty::GetPropertyType() const - { - TSPItemType type = EItemTypeNotDefined; - return type; - } - - -TInt CSPProperty::SetPropertyType( TSPItemType /*aPropertyType*/ ){ return KErrNone; } - - -TPropertyDataType CSPProperty::GetDataType() const - { - TPropertyDataType type = EDataTypeNotSet; - return type; - } - - -void CSPProperty::SetDataType( TPropertyDataType /*aDataType*/ ){} - - -TInt CSPProperty::GetValue( TInt& aValue ) const - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - - if( GetName() == EPropertyContactViewPluginId ) - { - aValue = gContactViewPluginId; - } - else if( GetName() == EPropertyBrandLanguage ) - { - aValue = gPropertyBrandLanguage; - } - else if( GetName() == EPropertyBrandVersion ) - { - aValue = gPropertyBrandVersion; - } - else if( GetName() == EPropertyPCSPluginId ) - { - aValue = gPropertyXIMP; - } - else if( GetName() == EPropertyContactViewId ) - { - aValue = gContactViewId; - } - else if( GetName() == ESubPropertyPresenceSettingsId ) - { - aValue = gPropertyPresenceSettingsId; - } - else if( GetName() == ESubPropertyIMSettingsId ) - { - aValue = gPropertyIMSettingsId; - } - else if( GetName() == EPropertyPCSPluginId ) - { - aValue = gPropertyPCSPluginId; - } - - return KErrNone; - } - -TInt CSPProperty::SetValue( TInt aValue ) - { - if( GetName() == EPropertyContactViewPluginId ) - { - gContactViewPluginId = aValue; - } - else if( GetName() == EPropertyBrandLanguage ) - { - gPropertyBrandLanguage = aValue; - } - else if( GetName() == EPropertyBrandVersion ) - { - gPropertyBrandVersion = aValue; - } - else if( GetName() == EPropertyPCSPluginId ) - { - gPropertyXIMP = aValue; - } - else if( GetName() == EPropertyContactViewId ) - { - gContactViewId = aValue ; - } - else if( GetName() == ESubPropertyPresenceSettingsId ) - { - gPropertyPresenceSettingsId = aValue ; - } - else if( GetName() == ESubPropertyIMSettingsId ) - { - gPropertyIMSettingsId = aValue ; - } - else if( GetName() == EPropertyPCSPluginId ) - { - gPropertyPCSPluginId = aValue ; - } - - - return KErrNone; - } - - -TInt CSPProperty::GetValue( TDes& aValue ) const - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - if( GetName() == EPropertyContactStoreId ) - { - if (gPropertyContactStoreId) - { - aValue.Copy(*gPropertyContactStoreId); - } - } - else if( GetName() == EPropertyBrandId ) - { - if (gPropertyBrandId) - { - aValue.Copy(*gPropertyBrandId); - } - } - - return KErrNone; - } - -TInt CSPProperty::SetValue( const TDesC& aValue ) - { - if( GetName() == EPropertyContactStoreId ) - { - - if (gPropertyContactStoreId) - { - delete gPropertyContactStoreId; - gPropertyContactStoreId = NULL; - } - - gPropertyContactStoreId = aValue.Alloc(); - } - else if( GetName() == EPropertyBrandId ) - { - if (gPropertyBrandId) - { - delete gPropertyBrandId; - gPropertyBrandId = NULL; - } - gPropertyBrandId = aValue.Alloc(); - } - - return KErrNone; - } - -TInt CSPProperty::GetValue( TOnOff& aValue ) const - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - - if( GetName() == ESubPropertyPresenceRequestPreference ) - { - aValue = gPropertyPresenceRequestPreference; - } - else if( GetName() == ESubPropertyVoIPEnabled ) - { - aValue = gPropertyVoIPEnabled; - } - - return KErrNone; - } - - -TInt CSPProperty::SetValue( TOnOff aValue ) - { - if( gPropertyInvalid ) - { - return KErrNotFound; - } - - if( GetName() == ESubPropertyPresenceRequestPreference ) - { - gPropertyPresenceRequestPreference = aValue; - } - else if( GetName() == ESubPropertyVoIPEnabled ) - { - gPropertyVoIPEnabled = aValue; - } - - return KErrNone; - } - - -TInt CSPProperty::SetValueNoDataTypeCheck( const TDesC& /*aValue*/ ){ return KErrNone; } - - -TPropertyDataType CSPProperty::DataType( TServicePropertyName /*aProperty*/ ) - { - TPropertyDataType type = EDataTypeNotSet; - return type; - } - - -TSPItemType CSPProperty::PropertyType( TServicePropertyName /*aProperty*/ ) - { - TSPItemType type = EItemTypeNotDefined; - return type; - } - - -void CSPProperty::CopyL( const CSPProperty& aSource ) - { - iPropertyName = aSource.GetName(); - - if( GetName() == EPropertyContactStoreId ) - { - HBufC* value = HBufC::NewLC(500); - TPtr valuePtr = value->Des(); - aSource.GetValue(valuePtr); - SetValue( valuePtr ); - - CleanupStack::PopAndDestroy(value); - } - else if( GetName() == EPropertyBrandId ) - { - HBufC* value = HBufC::NewLC(500); - TPtr valuePtr = value->Des(); - aSource.GetValue(valuePtr); - SetValue( valuePtr ); - - CleanupStack::PopAndDestroy(value); - } - else if( GetName() == EPropertyContactViewPluginId ) - { - TInt value = 0; - aSource.GetValue( value ); - SetValue( value ); - } - - } - - -TBool CSPProperty::CSPProperty::operator==( - const CSPProperty& /*aProperty*/ ) const{ return ETrue; } - -CSPProperty::CSPProperty(){} - -void CSPProperty::ConstructL(){} - - -TInt SetDefaultValue( TServicePropertyName /*aProperty*/ ){ return KErrNone; } - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_spsettings.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_spsettings.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,241 +0,0 @@ -/* -* 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: s_spsettings.cpp -* -*/ -#include -#include -#include - -RArray< TServiceId > gServiceIds; -RPointerArray< CSPEntry > gEntries; - - -CSPSettings* myCSPSettings = NULL; - - -extern TServicePropertyName gPropertyName; -extern TInt gContactViewPluginId; -extern HBufC* gPropertyContactStoreId; -extern HBufC* gPropertyBrandId; -extern TBool gPropertyInvalid; -extern TInt gPropertyBrandLanguage; -extern TInt gPropertyBrandVersion; -extern TInt gPropertyXIMP; -extern TOnOff gPropertyPresenceRequestPreference; -extern TInt gContactViewId; - -CSPSettings* CSPSettings::NewL() - { - if (!myCSPSettings) - { - myCSPSettings = new ( ELeave ) CSPSettings; - } - return myCSPSettings; - } - -CSPSettings* CSPSettings::NewLC() - { - CSPSettings* settings = CSPSettings::NewL(); - CleanupStack::PushL( settings ); - return settings; - } - -CSPSettings::~CSPSettings() - { - gServiceIds.Close(); - - gEntries.ResetAndDestroy(); - gEntries.Close(); - delete gPropertyContactStoreId; - delete gPropertyBrandId; - - - myCSPSettings = NULL; - gPropertyName = EPropertyUnknown; - gContactViewPluginId = 0; - gPropertyContactStoreId = 0; - gPropertyBrandId = 0; - gPropertyInvalid = EFalse; - gPropertyBrandLanguage = 0; - gPropertyBrandVersion = 0; - gPropertyXIMP = 0; - gPropertyPresenceRequestPreference = EOff; - gContactViewId = 0; - } - -void CopyEntry( const CSPEntry& aOriginal, CSPEntry& aTarget ) - { - aTarget.SetServiceId( aOriginal.GetServiceId() ); - aTarget.SetServiceName( aOriginal.GetServiceName() ); - RPropertyArray array = aOriginal.GetAllProperties(); - for( TInt i = 0; i < array.Count(); i++ ) - { - TRAP_IGNORE( aTarget.AddPropertyL( *array[i] ) ); - } - } - -TInt CSPSettings::AddEntryL( CSPEntry& aEntry ) - { - TInt err = gServiceIds.Append( aEntry.GetServiceId() ); - if( err ) - { - User::Leave( err ); - } - - CSPEntry* entry = CSPEntry::NewLC(); - CopyEntry( aEntry, *entry ); - // If property counts difference from each other, - // alloc failure has happened in CopyEntry - if( aEntry.GetAllProperties().Count() != - entry->GetAllProperties().Count() ) - { - User::Leave( KErrNoMemory ); - } - - err = gEntries.Append( entry ); - if( err ) - { - User::Leave( err ); - } - CleanupStack::Pop( entry ); - return KErrNone; - } - -TInt CSPSettings::FindEntryL( TServiceId aServiceId, CSPEntry& aEntry ) - { - for( TInt i=0; iGetAllProperties().Count() ) - { - User::Leave( KErrNoMemory ); - } - - return KErrNone; - } - } - - return KErrNotFound; - } - - -TInt CSPSettings::UpdateEntryL( const CSPEntry& aEntry ) - { - for( TInt i=0; iSetServiceName( aEntry.GetServiceName() ); - RPropertyArray propOrig = gEntries[i]->GetAllProperties(); - RPropertyArray propNew = aEntry.GetAllProperties(); - TBool found = EFalse; - for( TInt j = 0; j < propNew.Count(); j++ ) - { - for( TInt k = 0; k < propOrig.Count() && !found; k++ ) - { - if( propNew[j] == propOrig[k] ) - { - found = ETrue; - } - } - if( !found ) - { - gEntries[i]->AddPropertyL( *propNew[j] ); - } - found = EFalse; - } - return KErrNone; - } - } - - return KErrNotFound; - } - -TInt CSPSettings::FindPropertyL( TServiceId aServiceId, - TServicePropertyName aPropertyName, - CSPProperty& aProperty ) - { - for( TInt i=0; iGetProperty( property, - aPropertyName ); - - if (KErrNone == err) - { - aProperty.CopyL(*property); - return KErrNone; - } - } - } - - return KErrNotFound; - } - - -TInt CSPSettings::FindServiceIdsL( RIdArray& aServiceIds ) - { - if( gServiceIds.Count() == 0 ) - { - return KErrNotFound; - } - - for( TInt i=0; i - -void User::WaitForRequest(TRequestStatus& /*aStatus*/) - { - } - -void User::After(TTimeIntervalMicroSeconds32 /*aInterval*/) - { - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstengineaimagehandler.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstengineaimagehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2008 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: s_vimpstengineaimagehandler.cpp -* -*/ -// INCLUDE FILES -#include "s_vimpstengineaimagehandler.h" - - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::NewL -// Two-phased constructor. -// --------------------------------------------------------- -EXPORT_C CVIMPSTEngineImageHandler* CVIMPSTEngineImageHandler::NewL() - { - CVIMPSTEngineImageHandler* self = - CVIMPSTEngineImageHandler::NewLC( ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::NewLC -// Two-phased constructor. -// --------------------------------------------------------- -EXPORT_C CVIMPSTEngineImageHandler* CVIMPSTEngineImageHandler::NewLC( ) - { - CVIMPSTEngineImageHandler* self = new (ELeave) - CVIMPSTEngineImageHandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::CVIMPSTEngineImageHandler -// --------------------------------------------------------- -CVIMPSTEngineImageHandler::CVIMPSTEngineImageHandler() - { - - } -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::ConstructL -// --------------------------------------------------------- -void CVIMPSTEngineImageHandler::ConstructL() - { - } -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::~CVIMPSTEngineImageHandler -// --------------------------------------------------------- -CVIMPSTEngineImageHandler::~CVIMPSTEngineImageHandler() - { - } - -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::HandleProcessingCompleteL -// -// ------------------------------------------------------------------------ -void CVIMPSTEngineImageHandler::HandleProcessingCompleteL( TInt /*aStatus*/ ) - { - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::ProcessImageFromFileL -// -// ------------------------------------------------------------------------ -EXPORT_C HBufC8* CVIMPSTEngineImageHandler::ProcessImageFromFileL(const TDesC& /*aFilename*/ , - const TDesC8& /*aMimetype*/) - { - HBufC8* temp = NULL; - return temp; - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::ProcessImageFromDataL -// -// ------------------------------------------------------------------------ -EXPORT_C HBufC8* CVIMPSTEngineImageHandler::ProcessImageFromDataL( const TDesC8& /*aImageData */, const TDesC8& /*aMimeType*/) - { - HBufC8* temp = NULL; - return temp; - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstengineaimagehandler.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstengineaimagehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -/* -* Copyright (c) 2008 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: s_vimpstengineaimagehandler.h -* -*/ -#ifndef __CVIMPSTENGINEIMAGEHANDLER_H -#define __CVIMPSTENGINEIMAGEHANDLER_H - -// INCLUDES -#include - -#include "mvimpstimageprocessobserver.h" - -// FORWARD DECLARATIONS -class CVimpstImageProcessor; -class CFbsBitmap; - -// CLASS DECLARATION -/** - * This Class is wrapper over the CVimpstImageProcessor implements the processing of image - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineImageHandler ) : public CBase, - public MCAImageProcessObserver - - { - - - public: // Two-phased constructors and destructor - - /** - * Two-phased constructor. - */ - - IMPORT_C static CVIMPSTEngineImageHandler* NewL(); - /** - * Two-phased constructor. - */ - IMPORT_C static CVIMPSTEngineImageHandler* NewLC(); - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - /** - * C++ Destructor. - */ - virtual ~CVIMPSTEngineImageHandler(); - - - private: - - /** - * default constructor - */ - CVIMPSTEngineImageHandler(); - - - - public: - /** - * process the image from file name - * @return processed image content - */ - IMPORT_C HBufC8* ProcessImageFromFileL(const TDesC& aFilename , - const TDesC8& aMimetype); - /** - * process the image from image data - * @return processed image content - */ - IMPORT_C HBufC8* ProcessImageFromDataL( const TDesC8& aImageData , const TDesC8& aMimeType); - /** - * Get Bitmap - * @return bitmap - */ - IMPORT_C CFbsBitmap& Bitmap(); - public: // from MCAImageProcessObserver - - /** - * See MCAImageProcessObserver - */ - void HandleProcessingCompleteL( TInt aStatus ); - - - private: - - - //Result code from waited request - TInt iReqResult; - - // Owns content - HBufC8* iContent; - - // Owns imageporcessor - CVimpstImageProcessor* iProcessor; - - // own active sheduler - CActiveSchedulerWait iWait; - - }; - -#endif //__CVIMPSTENGINEIMAGEHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstengineavatarextention.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstengineavatarextention.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,269 +0,0 @@ -/* -* Copyright (c) 2008 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: s_vimpstengineavatarextention.cpp -* -*/ -// INCLUDE FILES -#include "cvimpstengineavatarextention.h" - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "cvimpstenginerequestmapper.h" -#include "cvimpstenginerequest.h" -#include "vimpstdebugprint.h" -#include "tvimpstenums.h" - - -#include "vimpstallerrors.h" -#include "tvimpstconsts.h" - -#include "cvimpstsettingsstore.h" // settings store in cenrep used for own avatar data -#include "imconnectionproviderconsts.h" - -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::NewL -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTEngineAvatarExtention* CVIMPSTEngineAvatarExtention::NewL( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper) - { - CHAT_DP_FUNC_ENTER("CVIMPSTEngineAvatarExtention::NewL"); - CVIMPSTEngineAvatarExtention* self = - CVIMPSTEngineAvatarExtention::NewLC( aServiceId, aFeatures, - aRequestMapper - ); - CleanupStack::Pop( self ); - CHAT_DP_FUNC_DONE("CVIMPSTEngineAvatarExtention::NewL"); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::NewLC -// Two-phased constructor. -// --------------------------------------------------------- -CVIMPSTEngineAvatarExtention* CVIMPSTEngineAvatarExtention::NewLC( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper) - { - CHAT_DP_FUNC_ENTER("CVIMPSTEngineAvatarExtention::NewLC"); - CVIMPSTEngineAvatarExtention* self = new (ELeave) - CVIMPSTEngineAvatarExtention(aServiceId, aFeatures,aRequestMapper); - CleanupStack::PushL( self ); - - CHAT_DP_FUNC_DONE("CVIMPSTEngineAvatarExtention::NewLC"); - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::CVIMPSTEngineAvatarExtention -// --------------------------------------------------------- -CVIMPSTEngineAvatarExtention::CVIMPSTEngineAvatarExtention( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper) - : - iServiceId(aServiceId), - iFeatures(aFeatures), - iRequestMapper(aRequestMapper), - iSupported(TVIMPSTEnums::ESupportUnKnown) - { - - } - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::~CVIMPSTEngineAvatarExtention -// --------------------------------------------------------- -CVIMPSTEngineAvatarExtention::~CVIMPSTEngineAvatarExtention() - { - CHAT_DP_FUNC_ENTER("CVIMPSTEngineAvatarExtention::~CVIMPSTEngineAvatarExtention"); - - CHAT_DP_FUNC_DONE("CVIMPSTEngineAvatarExtention::~CVIMPSTEngineAvatarExtention"); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::IsSupported() -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::FeatureSupport CVIMPSTEngineAvatarExtention::IsSupported() const - { - return iSupported; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::Type() -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::ExtentionType CVIMPSTEngineAvatarExtention::Type() const - { - return TVIMPSTEnums::EAvatar; - } - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::UpdateAvtarToServerL -// -// --------------------------------------------------------- -TInt CVIMPSTEngineAvatarExtention::UpdateAvtarToServerL(const TDesC& aFilename, const TDesC8& aMimetype) - { - TInt error = KErrNone; - HBufC8* avatarContent = NULL; - if ( aFilename.Length()) - { - CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL(); - CleanupStack::PushL(imageHandler); - // get the avatar content from the image processor - // returns image content if the processing succesful - avatarContent = imageHandler->ProcessImageFromFileL( aFilename , aMimetype); - if ( !avatarContent ) - { - // some problem in the image processing , so set as general error - error = KErrGeneral; - } - CleanupStack::PopAndDestroy(imageHandler); // imageHandler - } - // if there is no error in processing or to set default avatar - if( ! error) - { - MPresencePublishing& publisher = iFeatures.PresencePublishing(); - MPresenceInfo* myPresence = iFeatures.PresenceObjectFactory().NewPresenceInfoLC();//1 - MPersonPresenceInfo *PersonPresence = iFeatures.PresenceObjectFactory().NewPersonPresenceInfoLC();//2 - MPresenceInfoFieldCollection& attributeFields = PersonPresence->Fields(); - MPresenceInfoField* infoField = iFeatures.PresenceObjectFactory().NewInfoFieldLC();//3 - MPresenceInfoFieldValueBinary* avatarField = iFeatures.PresenceObjectFactory().NewBinaryInfoFieldLC();//4 - // "avatar" attribute - - if(avatarContent) - { - avatarField->SetBinaryValueL(*avatarContent); - } - else - { - // this is to clear the avatar - avatarField->SetBinaryValueL(KNullDesC8); - } - // Take handles to object factory and publish interface - - CleanupStack::Pop(); // (4)avatarField, pop before passing the ownership to infofiled - - //Fill presence doc with presence components and attributes - infoField->SetFieldTypeL( NPresenceInfo::NFieldType::KAvatar ); - // for clear avatar mimetye is KNUllDesc so set for all the cases - avatarField->SetMimeTypeL(aMimetype); - infoField->SetFieldValue( avatarField ); - CleanupStack::Pop(); // (3)infoField ownership is passed to attributeFields - - attributeFields.AddOrReplaceFieldL(infoField );// - CleanupStack::Pop(); // (2)PersonPresence, as ownership is transfered to mypresence - - myPresence->SetPersonPresenceL(PersonPresence); - TXIMPRequestId reqId = publisher.PublishOwnPresenceL( *myPresence ); - // wait completion - iRequestMapper.CreateRequestL(reqId, ETrue, EVIMPSTXimpOperationSetAvatar ); - if( !iReqResult ) - { - // singleton object owned by tabbedview : dont delete - MVIMPSTSettingsStore* store = CVIMPSTSettingsStoreFactory ::NewL(); - if(avatarContent) - { - error = store->SetL(iServiceId ,EServiceAvatar ,*avatarContent); - } - else - { - error = store->SetL(iServiceId ,EServiceAvatar ,KNullDesC8); - } - } - else - { - error = iReqResult; - } - - CleanupStack::Pop(); // (1) myPresence - - delete avatarContent; - avatarContent = NULL; - } - // return the error - return error; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::HandleSessionContextEventL -// --------------------------------------------------------- -void CVIMPSTEngineAvatarExtention::HandleSessionContextEventL(const MXIMPContext& /*aContext*/, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation /*= EVIMPSTXimpOperationNoOperation*/ ) - { - - CHAT_DP_FUNC_ENTER("CVIMPSTEngineAvatarExtention::HandleSessionContextEventL"); - - switch( aEvent.GetInterfaceId() ) - { - case MXIMPRequestCompleteEvent::KInterfaceId: - { - CHAT_DP_FUNC_ENTER("InsideCallbackswitch::MXIMPRequestCompleteEvent"); - if (EVIMPSTXimpOperationSetAvatar == aXimpOperation) - { - const MXIMPRequestCompleteEvent* event = - TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( - aEvent, MXIMPBase::EPanicIfUnknown ); - - iReqResult = event->CompletionResult().ResultCode(); - const TXIMPRequestId& reqId = event->RequestId(); - CVIMPSTEngineRequest *req = iRequestMapper.FindRequestId( reqId ); - - if ( req ) - { - req->StopWait() ; - iRequestMapper.RemoveRequestId(reqId); - delete req; - } - } - break; - } - - default: - { - break; - } - } - CHAT_DP_FUNC_DONE("CVIMPSTEngineAvatarExtention::HandleSessionContextEventL"); - } - -//---------------------------------------------------------------------------- -// CVIMPSTEngineAvatarExtention::SetSupported() -// ----------------------------------------------------------------------------- -// -void CVIMPSTEngineAvatarExtention::SetSupported(TVIMPSTEnums::FeatureSupport aSupported) - { - iSupported = aSupported; - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstengineavatarextention.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstengineavatarextention.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* Copyright (c) 2008 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: s_vimpstengineavatarextention.h -* -*/ -#ifndef __CVIMPSTENGINEAVATAREXTENTION_H -#define __CVIMPSTENGINEAVATAREXTENTION_H - -// INCLUDES -#include - -#include "mvimpstengineavatarextention.h" -#include "TVIMPSTEnums.h" -#include "mvimpstenginesessioncntxtobserver.h" -#include "cvimpstengineimagehandler.h" - - -// FORWARD DECLARATIONS -class CVIMPSTEngineRequestMapper; -class MPresenceFeatures; -class MXIMPContext; -class MXIMPIdentity; - - - -// CLASS DECLARATION -/** - * This Class implements the Contact Management Extention Feature - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineAvatarExtention ) : public CBase, - public MVIMPSTEngineAvatarExtention, - public MVIMPSTEngineSessionCntxtObserver - - { - - - public: // Two-phased constructors and destructor - - /** - * Two-phased constructor. - * @param aFeatures - Presentity Group - * @param aRequestMapper: Request Mapper for XIMP Events - */ - - static CVIMPSTEngineAvatarExtention* NewL( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper); - /** - * Two-phased constructor. - * @param aFeatures - Presentity Group - * @param aRequestMapper: Request Mapper for XIMP Events - */ - static CVIMPSTEngineAvatarExtention* NewLC( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper); - - /** - * C++ Destructor. - */ - virtual ~CVIMPSTEngineAvatarExtention(); - - - private: - - /** - * default constructor - * @param aFeatures - Presentity Group - * @param aRequestMapper: event observer to get the notifications of the events. - */ - CVIMPSTEngineAvatarExtention( - TInt aServiceId, - MPresenceFeatures& aFeatures, - CVIMPSTEngineRequestMapper& aRequestMapper); - - - - public: // See MVIMPSTEngineAvatarExtention - - /** - * See MVIMPSTEngineAvatarExtention - */ - TInt UpdateAvtarToServerL(const TDesC& aFilename , - const TDesC8& aMimetype); - - - private: - /** - * See MVIMPSTEngineSessionCntxtObserver - */ - void HandleSessionContextEventL( const MXIMPContext& aContext, - const MXIMPBase& aEvent, - TXimpOperation aXimpOperation = EVIMPSTXimpOperationNoOperation); - - public: // From MVIMPSTEngineExtentionFeatures - - /** - * See MVIMPSTEngineExtentionFeatures - */ - TVIMPSTEnums::FeatureSupport IsSupported() const; - - - /** - * See MVIMPSTEngineExtentionFeatures - */ - TVIMPSTEnums::ExtentionType Type() const; - - /** - * See MVIMPSTEngineExtentionFeatures - */ - void SetSupported(TVIMPSTEnums::FeatureSupport aSupported) ; - - - private: - // serivice id - TInt iServiceId; - - // not own - MPresenceFeatures& iFeatures; - - //doesnt own - CVIMPSTEngineRequestMapper& iRequestMapper; - - //Whether the extention Feature Supported or not - TVIMPSTEnums::FeatureSupport iSupported; - - //Result code from waited request - TInt iReqResult; - - }; - -#endif //__CVIMPSTENGINEAVATAREXTENTION_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstore.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstore.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions and repository transactions. -* -*/ - -// INCLUDES -#include -#include "s_vimpstsettingsstoreimp.h" - -/** - * vimpst settings API class - * - * Main class of managing vimpst settings - * - * @code example code of how to get/set a value to the setting item in cenrep - * MVIMPSTSettingsStore* obj = CVIMPSTUiSettingsStoreFactory::NewL(); - * TInt value = 1; - * TInt err = obj->Set(serviceId, ETOUDlgOff, value ); - * similarly for getting the value - * obj->Get(serviceId, ETOUDlgOff, value); - * @lib vimpstsettingsstore.lib - * @since S60 v5.0 - */ - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsStoreFactory::NewL -// Create an instance of the class CVIMPSTSettingsStoreImp -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewL() - { - MVIMPSTSettingsStore* self = CVIMPSTSettingsStore::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::Destructor -// Release the singelton -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsStore::~CVIMPSTSettingsStore() - { - CVIMPSTSettingsStoreImp::Release(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsStoreFactory::NewLC -// Create an instance of the class CVIMPSTSettingsStoreImp -// ----------------------------------------------------------------------------- -// - -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewLC() - { - MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreImp::InitialiseLibraryL(); - CleanupDeletePushL ( self ); - return self; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstore.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstore.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions -* -*/ - -#ifndef __CVIMPSTSETTINGSSTORE_H -#define __CVIMPSTSETTINGSSTORE_H - -#include - -/** types of settings provided in meco settings */ -enum TSettingItemName - { - ETOUDlgOff = 0x00000000, // key value to enable or disable TOU Dialog to be shown - EURLRegistrationOff = 0x00000001, // key value to enable or disable URL registration query - EServiceSuccessfullLogin = 0x00000002, - EServiceToneFileName = 0x00000003, // key value to get the IM tone File name.complete path of the file name should be provided. example "C:\sounds\digital\imtone.wav" - EServiceURLLink = 0x00000004, // key value to get the URL link for IM based on service - EServiceAvatar = 0x00000005, // key value to get the Own Avatar for IM based on service - EServiceAvatarMimeType = 0x00000006, // key value to get the Own Avatar s 'mimetype' for IM based on service - EServiceOwnAvatarIconIndex = 0x00000007 , // key value to get the Own Icon index for avatar s - // key value to check whether the "Cancel Login" is supported or not - // if setting "value = 1" then cancel login not supported else supported. - // if cancel is supported , no need to write anything to cenrep. - // By default its taken as supported. - // if not supported then write explicitly this setting as '1' - EServiceCancelLoginNotSupported = 0x00000008 - }; - - - -//CLASS DECLARATION -/** - * M-Class for meco settingstore API's - * @lib vimpstsettingsstore.lib - * @since S60 5.0 - */ -class MVIMPSTSettingsStore - { - public: //Interface - - /** - * virtual Destructor. - */ - virtual ~MVIMPSTSettingsStore() - { - } - - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aBuffer, variable to set/get the value - * @return TInt, used as error passing value. - */ - virtual TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) = 0; - - virtual TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) = 0; - - }; - -/** - * vimpst settings API class - * - * Main class of managing vimpst settings - * - * @code example code of how to get/set a value to the setting item in cenrep - * MVIMPSTSettingsStore* obj = CVIMPSTUiSettingsStoreFactory::NewL(); - * TInt value = 1; - * TInt err = obj->Set(serviceId, ETOUDlgOff, value ); - * similarly for getting the value - * obj->Get(serviceId, ETOUDlgOff, value); - * @lib vimpstsettingsstore.lib - * @since S60 v5.0 - */ -NONSHARABLE_CLASS( CVIMPSTSettingsStore ): public CBase - { - - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - IMPORT_C static MVIMPSTSettingsStore* NewL(); - - /** - * Two-phased constructor. - */ - IMPORT_C static MVIMPSTSettingsStore* NewLC(); - - /** - * Destructors. - */ - virtual ~CVIMPSTSettingsStore(); - }; - -#endif /*__CVIMPSTSETTINGSSTORE_H*/ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstorefactory.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstorefactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions and repository transactions. -* -*/ - -// INCLUDES -#include -#include "s_vimpstsettingsstoreimp.h" - -/** - * vimpst settings API class - * - * Main class of managing vimpst settings - * - * @code example code of how to get/set a value to the setting item in cenrep - * MVIMPSTSettingsStore* obj = CVIMPSTUiSettingsStoreFactory::NewL(); - * TInt value = 1; - * TInt err = obj->Set(serviceId, ETOUDlgOff, value ); - * similarly for getting the value - * obj->Get(serviceId, ETOUDlgOff, value); - * @lib vimpstsettingsstore.lib - * @since S60 v5.0 - */ - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsStoreFactory::NewL -// Create an instance of the class CVIMPSTSettingsStoreImp -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStoreFactory::NewL() - { - MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreFactory::NewLC(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTEngineFactory::Destructor -// Release the singelton -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsStoreFactory::~CVIMPSTSettingsStoreFactory() - { - CVIMPSTSettingsStoreImp::Release(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsStoreFactory::NewLC -// Create an instance of the class CVIMPSTSettingsStoreImp -// ----------------------------------------------------------------------------- -// - -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStoreFactory::NewLC() - { - MVIMPSTSettingsStore* self = CVIMPSTSettingsStoreImp::InitialiseLibraryL(); - CleanupDeletePushL ( self ); - return self; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstoreimp.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstoreimp.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions and repository transactions. -* -*/ - -// INCLUDES -#include -#include "s_vimpstsettingsstoreimp.h" - -//dummy serviceId, assuming the service id not more than 256. for the first time -//and it is assumed that this service id is for initializing the cenrep keys only. -//not updated in the service table and hence will not get a TAB in phone book -//const TInt KServiceIDOffset = 16; - -// opaque data length, see cvimpstuisapsettings.h SetOpaqueDesC16 method description. -//const TInt KSapSettingsDataBufferLength = 5; -// Collation level 1 to ignore case -//const TInt KCollationLevel = 1; - -/** Key to CIMPSSAPSettings opaque value */ -//_LIT( KIMToUAccepted, "KIMToUAccepted" ); -/** User id separator in KIMToUAccepted list */ -//_LIT( KIMDot, "," ); - -//================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTSettingsStoreImp::NewL -// -// --------------------------------------------------------- -MVIMPSTSettingsStore* CVIMPSTSettingsStoreImp::InitialiseLibraryL( ) - { - // no existing instance, create a new one - MVIMPSTSettingsStore *settingsStoreImp = CVIMPSTSettingsStoreImp::NewL(); - return (MVIMPSTSettingsStore*)settingsStoreImp; - } - -void CVIMPSTSettingsStoreImp::Release( ) - { - - } -// --------------------------------------------------------- -// CVIMPSTSettingsStoreImp::NewLC -// -// --------------------------------------------------------- -MVIMPSTSettingsStore* CVIMPSTSettingsStoreImp::NewL( ) - { - CVIMPSTSettingsStoreImp* self = new (ELeave) CVIMPSTSettingsStoreImp( ); - CleanupStack::PushL( self ); - self->ConstructL( ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTSettingsStoreImp::ConstructL -// -// --------------------------------------------------------- - -void CVIMPSTSettingsStoreImp::ConstructL( ) - { - - } - -// --------------------------------------------------------- -// CVIMPSTSettingsStoreImp::Destructor -// -// --------------------------------------------------------- -CVIMPSTSettingsStoreImp::~CVIMPSTSettingsStoreImp() - { - - } - -// -------------------------------------------------------------------------------------------------- -// CVIMPSTSettingsStoreImp::SetL -// -// --------------------------------------------------------------------------------------------------- - -TInt CVIMPSTSettingsStoreImp::SetL(TUint32 /*aServiceId*/, TSettingItemName /*aSettingItemName*/, const TDesC8& /*aBuffer*/ ) - { - return KErrNone; // return the value : error code - } - -// -------------------------------------------------------------------------------------------------- -// CVIMPSTSettingsStoreImp::SetL -// -// --------------------------------------------------------------------------------------------------- - -TInt CVIMPSTSettingsStoreImp::GetL(TUint32 /*aServiceId*/, TSettingItemName /*aSettingItemName*/, const TDesC8& /*aBuffer*/ ) - { - return KErrNone; // return the value : error code - } - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstoreimp.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpstsettingsstoreimp.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions and repository transactions. -* -*/ - -#ifndef __CVIMPSTSETTINGSSTOREIMP_H -#define __CVIMPSTSETTINGSSTOREIMP_H - -// INCLUDES -#include -#include "s_vimpstsettingsstore.h" - -NONSHARABLE_CLASS( CVIMPSTSettingsStoreImp):public CBase, - public MVIMPSTSettingsStore -{ - - public: // Constructors and destructor - - /** - * Initialises the Library - */ - static MVIMPSTSettingsStore* InitialiseLibraryL(); - - /** - * Release the resources allocated - */ - static void Release(); - - /** - * Destructors. - */ - virtual ~CVIMPSTSettingsStoreImp(); - - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aBuffer, variable to set/get the value - * @return TInt, used as error passing value. - */ - TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) ; - - TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) ; - - - private: - /** - * Two-phased constructor. - */ - static MVIMPSTSettingsStore* NewL(); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - - }; - -#endif //__CVIMPSTSETTINGSSTOREIMP_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragecontact.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragecontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of contact data container -* -*/ - - -// INCLUDE FILES -#include "s_vimpststoragecontact.h" - -#include "tvimpstenums.h" -#include - -// ============================ MEMBER FUNCTIONS =============================== - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::UserId -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& MyVIMPSTStorageContactStub::UserId() const - { - return KNullDesC; - } - - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::OnlineStatus -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TOnlineStatus MyVIMPSTStorageContactStub::OnlineStatus() const - { - return iPresenceStatus; - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::SetOnlineStatus -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactStub::SetOnlineStatus( - TVIMPSTEnums::TOnlineStatus aOnlineStatus ) - { - - iPresenceStatus = aOnlineStatus; - } - - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::StatusText -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& MyVIMPSTStorageContactStub::StatusText() const - { - return KNullDesC; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::SetStatusTextL -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactStub::SetStatusTextL( const TDesC& /*aStatusText*/ ) - { - - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::SetUserIdL -// From MVIMPSTStorageExtendedStorageContact -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactStub::SetUserIdL( const TDesC& /*aUserId */ ) - { - - } - - -// --------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::ContactLink() -// --------------------------------------------------------------------------- -// -MVPbkContactLink* MyVIMPSTStorageContactStub::ContactLink() const - { - MVPbkContactLink* link = NULL; - - return link; - } - -// --------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::VoIPNumbers() -// --------------------------------------------------------------------------- -// -RPointerArray& MyVIMPSTStorageContactStub::ServiceDetails() - { - RPointerArray array; - - return array; - } - - - -// --------------------------------------------------------------------------- -// MyVIMPSTStorageContactStub::SetSeriveFields() -// --------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactStub::SignalChanges() - { - - } - // End of File - -// MyMVIMPSTStorageViewIdStub::SetOwnData -// From MVIMPSTStorageContacts. -// -// ----------------------------------------------------------------------------- - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragecontact.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragecontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,120 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact data container implementation -* -*/ - - -#ifndef CVIMPSTSTORAGECONTACT_H -#define CVIMPSTSTORAGECONTACT_H - -#include "tvimpstenums.h" -// INCLUDES -#include "mvimpststoragecontact.h" - -// FORWARD DECLARATIONS -class MVPbkContactLink; -class MVIMPSTStorageContact; - -// CLASS DECLARATION - -/** - * Contact data implementation - * @lib vimpststorage.dll - * @since 5.0 - */ -class MyVIMPSTStorageContactStub : public MVIMPSTStorageContact - { - public: // Constructors and destructor - - MyVIMPSTStorageContactStub() - { - - } - /** - * C++ Destructor. - */ - ~MyVIMPSTStorageContactStub() - { - - } - - - public: // Functions from base classes MVIMPSTStorageContact - - /** - * @see MVIMPSTStorageContact - */ - void SetUserIdL( const TDesC& aUserId ); - - /** - * @see MVIMPSTStorageContact - */ - MVPbkContactLink* ContactLink() const; - - /** - * @see MVIMPSTStorageContact - */ - RPointerArray& ServiceDetails(); - - - /** - * @see MVIMPSTStorageContact - */ - // void SetSeriveFields( const CDesCArray& aArrayOfServiceNumbers ); - - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& UserId() const; - - - /** - * @see MVIMPSTStorageContact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus() const; - - /** - * @see MVIMPSTStorageContact - */ - void SetOnlineStatus( TVIMPSTEnums::TOnlineStatus aOnlineStatus ); - - /** - * @see MVIMPSTStorageContact - */ - void SignalChanges(); - - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& StatusText() const; - - /** - * @see MVIMPSTStorageContact - */ - void SetStatusTextL( const TDesC& aStatusText ); - - - - private : - - TVIMPSTEnums::TOnlineStatus iPresenceStatus; - - }; - -#endif // CVIMPSTSTORAGECONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragecontactlist.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragecontactlist.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,147 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact list container implementation -* -*/ - - -// INCLUDE FILES -#include "s_vimpststoragecontactlist.h" - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::ListId -// ----------------------------------------------------------------------------- -// -const TDesC& MyVIMPSTStorageContactListStub::ListId() const - { - return KNullDesC; - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::DisplayName -// ----------------------------------------------------------------------------- -// -TPtrC MyVIMPSTStorageContactListStub::DisplayName() const - { - const TDesC& des ( KNullDesC ) ; - return des; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::SetDisplayName -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactListStub::SetDisplayNameL( const TDesC& /*aDisplayName*/ ) - { - - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::Sort -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactListStub::Sort() - { - - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::ResortContact -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactListStub::ResortContact( MVIMPSTStorageContact* /*aContact*/ ) - { - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::ContactFindById -// ----------------------------------------------------------------------------- -// -void MyVIMPSTStorageContactListStub::ResortUnKnownContact( MVIMPSTStorageContact* /*aContact*/ ) - { - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::FindIndexOfContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -TInt MyVIMPSTStorageContactListStub::FindIndexOfContact( const MVIMPSTStorageContact* /*aContact*/, - TVIMPSTEnums::TFilterType /*aFilter*/ ) const - { - return KErrNotFound; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::Count -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -TInt MyVIMPSTStorageContactListStub::Count() const - { - return 0; - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::operator[] -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& MyVIMPSTStorageContactListStub::operator[]( TInt /*aIndex */) const - { - MVIMPSTStorageContact* contact = NULL; - return *contact; - } - - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::FilteredContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& MyVIMPSTStorageContactListStub::FilteredContact( - TInt /*aIndex*/, TVIMPSTEnums::TFilterType /*aFilter*/ ) const - { - MVIMPSTStorageContact* contact = NULL; - return *contact; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::FilteredCount -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -TInt MyVIMPSTStorageContactListStub::FilteredCount( - TVIMPSTEnums::TFilterType /*aFilter*/ ) const - { - return 0; - } - -// ----------------------------------------------------------------------------- -// MyVIMPSTStorageContactListStub::FilterAllowsContact -// ----------------------------------------------------------------------------- -// -TBool MyVIMPSTStorageContactListStub::FilterAllowsContact( const MVIMPSTStorageContact* /*aContact*/, - TVIMPSTEnums::TFilterType /*aFilter*/ ) const - { - TBool showContact( EFalse ); - - return showContact; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragecontactlist.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragecontactlist.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact list container implementation -* -*/ - - -#ifndef CVIMPSTSTORAGECONTACTLIST_H -#define CVIMPSTSTORAGECONTACTLIST_H - -// INCLUDES -#include "tvimpstenums.h" -#include "mvimpststoragecontactlist.h" - -// FORWARD DECLARATIONS -class CVIMPSTStorageContactSorter; -class MVIMPSTStorageContactsObserver; -class MVIMPSTStorageContactList; -class MVIMPSTStorageContact; - -// CLASS DECLARATION - -/** - * Contact list data implementation - */ -class MyVIMPSTStorageContactListStub : public MVIMPSTStorageContactList - { - - public: - MyVIMPSTStorageContactListStub() - { - - } - /** - * Destructor. - */ - ~MyVIMPSTStorageContactListStub() - { - - } - - - - /** - * @see MVIMPSTStorageContactList - */ - const TDesC& ListId() const; - - /** - * @see MVIMPSTStorageContactList - */ - TPtrC DisplayName() const; - - /** - * @see MVIMPSTStorageContactList - */ - void SetDisplayNameL( const TDesC& aDisplayName ); - - - /** - * @see MVIMPSTStorageContactList - */ - TInt Count() const; - - /** - * @see MVIMPSTContactList - */ - MVIMPSTStorageContact& operator[]( TInt aIndex ) const; - - /** - * @see MVIMPSTStorageContactList - */ - MVIMPSTStorageContact& FilteredContact( - TInt aIndex, TVIMPSTEnums::TFilterType aFilter ) const; - - /** - * @see MVIMPSTStorageContactList - */ - TInt FilteredCount( - TVIMPSTEnums::TFilterType aFilter ) const; - - - /** - * @see MVIMPSTStorageContactList - */ - void Sort(); - - /** - * @see MVIMPSTStorageContactList - */ - void ResortContact( MVIMPSTStorageContact* aContact ); - - /** - * @see MVIMPSTStorageContactList - */ - void ResortUnKnownContact( MVIMPSTStorageContact* aContact ); - - /** - * @see MVIMPSTStorageContactList - */ - TInt FindIndexOfContact( - const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter = - TVIMPSTEnums::EFilterAll ) const; - - /** - * @see MVIMPSTStorageContactList - */ - TBool FilterAllowsContact( const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter ) const; - - }; - -#endif // CVIMPSTSTORAGECONTACTLIST_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragemanagerfactory.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragemanagerfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of CVIMPSTStorageManagerFactory -* -*/ - - -// INCLUDE FILES -#include "cvimpststoragemanagerfactory.h" -#include "s_vimpststoragecontact.h" -#include "s_vimpststorageserviceview.h" -#include "mvimpststoragecontact.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::InitialiseLibraryL -// Factory method that initialises the vimpststorage library -// used by CVIMPSTViewIdFactory -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseLibraryL() - { - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::Release -// Factory method to release the resource owned by the vimpststorage library -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CVIMPSTStorageManagerFactory::Release() - { - return 1; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::InitialiseViewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseViewL( - TUint32 aServiceId, - const TDesC& aStoreName, - const TDesC& aServiceName) - { - - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::ContactListInterfaceL() -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTStorageServiceView* CVIMPSTStorageManagerFactory::ContactListInterfaceL(TUint32 aServiceId) - { - MVIMPSTStorageServiceView *contact = vimpstserviceview_stub::NewL (); - return contact ; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::ItemModelInterfaceL -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTStorageItemModel* CVIMPSTStorageManagerFactory::ItemModelInterfaceL( TUint32 aServiceId ) - { - return NULL; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragemanagerfactory.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststoragemanagerfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2008 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: Declaration of CVIMPSTStorageManagerFactory - * -*/ - -#ifndef S_VIMPSTSTORAGEMANAGERFACTORY_H -#define S_VIMPSTSTORAGEMANAGERFACTORY_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class MVIMPSTStorageContacts; -class MVIMPSTStorageItemModel; - -// CLASS DECLARATION - -/** - * Factory to create contact and group list interfaces. - * @lib vimpststorage.lib - * @since S60 5.0 - */ -class CVIMPSTStorageManagerFactory : public CBase - { - public: // New functions - - /** - * Initialises the Library - */ - static void InitialiseLibraryL(); - - /** - * Release the resources allocated - */ - static TInt Release(); - - /** - * Inititalises the Store for the Service Id - * Must be called before using ContactListInterfaceL, - * ItemInterfaceL API's. - * @param aServiceId service id - * @param aStoreName storename for this service - * @param aServiceName ServiceName - */ - static void InitialiseViewL( TUint32 aServiceId, - const TDesC& aStoreName, - const TDesC& aServiceName) ; - - /** - * Returns the pointer to MVIMPSTStorageContacts - * this pointer can be used to perform numerous operations on - * contacts - * @param aServiceId service id - * @return MVIMPSTStorageServiceView* instance of the contact list interface - */ - static MVIMPSTStorageServiceView* ContactListInterfaceL(TUint32 aServiceId); - - /** - * Returns the pointer to MVIMPSTStorageItemModel - * this pointer can be used to perform numerous operations on - * contactlist - * @param aServiceId service id - * @return MVIMPSTStorageItemModel* interface to itemmodel - */ - static MVIMPSTStorageItemModel* ItemModelInterfaceL( TUint32 aServiceId ) ; - - }; - -#endif // CVIMPSTSTORAGEMANAGERFACTORY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststorageserviceview.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststorageserviceview.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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 "s_vimpststorageserviceview.h" - -MVIMPSTStorageServiceView* vimpstserviceview_stub::NewL() - { - MVIMPSTStorageServiceView* ob = new(ELeave)vimpstserviceview_stub; - return ob; - } - -void vimpstserviceview_stub::AddObserverL( MVIMPSTStorageContactsObserver* aObserver ) - { - - } - -void vimpstserviceview_stub::RemoveObserver( MVIMPSTStorageContactsObserver* aObserver ) - { - - } - - -MVIMPSTStorageContact* vimpstserviceview_stub::FindContactByUserId( const TDesC& aUserId ) - { - return NULL; - } - - -TInt vimpstserviceview_stub::ListCount() const -{ -return 1; -} - -MVIMPSTStorageContactList& vimpstserviceview_stub::ListAt( TInt aIndex ) const -{ -MVIMPSTStorageContactList *abc = NULL; - -return *abc; -} - - -MVIMPSTStorageContactList* vimpstserviceview_stub::FindContactList( const TDesC& aListId ) - { - return NULL; - } - -MVIMPSTStorageContactList* vimpstserviceview_stub::CreateContactListL( const TDesC& aContactListId, - const TDesC& aDisplayName ) - { - MVIMPSTStorageContactList *abc = NULL; - - return abc; - } - -void vimpstserviceview_stub::RemoveContactList( const TDesC& aContactListId ) - { - - } - - -TInt vimpstserviceview_stub::ContactCount(TBool aSkipOfflineContacts ) const -{ -return 0; -} - - - -MVIMPSTStorageContact* vimpstserviceview_stub::UpdatePresenceL(const TDesC& aContactId, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aStatusText, - const TDesC8& aAvatarData, - TBool aIsClearingAvatar ) - { - return NULL; - } - -MVIMPSTStorageContact* vimpstserviceview_stub::UpdateAvatarL(const TDesC& aContactId, - const TDesC8& aAvatarData ) - { - return NULL; - } - -MVIMPSTStorageContact* vimpstserviceview_stub::CreateNewContactL(const TDesC& aUserId, - const TDesC& aDisplayName, - TBool aIsInvitationItem , - TBool aInvitationAutoAccept) - { - MVIMPSTStorageContact* contact = NULL; - return contact; - } - -TInt vimpstserviceview_stub::CreateNewContactFromRetrivedIdL( TInt aIndexToUse ) - { - return 0; - } - -TInt vimpstserviceview_stub::DeleteNewContactFromRetrivedIdL( TInt aIndexToUse ) - { - return 0; - } - -TInt vimpstserviceview_stub::RemoveContactL( MVIMPSTStorageContact* aContact ) - { - return 0; - } - - -void vimpstserviceview_stub::CreateNewFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ) - { - - } - - -TBool vimpstserviceview_stub::IsLocalStore() const -{ -return ETrue; -} - - -TInt vimpstserviceview_stub::RetriveLinkXSPIdsL(const TDesC8& aContactPackLink ) - { - return 0; - } -const TDesC& vimpstserviceview_stub::GetRetrieveXSPIdL(TInt aIndex ) - { - return KNullDesC(); - } - -MVIMPSTStorageContact* vimpstserviceview_stub::FindContactByLink(const MVPbkContactLink& aContactLink ) - { - return NULL; - } - - -void vimpstserviceview_stub::Sort( const TDesC& aContactListId) - { - - } - -MVIMPSTStorageContact& vimpstserviceview_stub::OwnContactL() - { - MVIMPSTStorageContact *abc = NULL; - - return *abc; - } - -void vimpstserviceview_stub::DeleteDatabaseL() - { - - } - -void vimpstserviceview_stub::SetOwnUserIdL(const TDesC& aUserId ) - { - - } - -void vimpstserviceview_stub::SetUnnamedTextL(HBufC* aUnnamedText ) - { - - } - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststorageserviceview.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_vimpststorageserviceview.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for presence context. -* -*/ - - -#ifndef S_VIMPSTSTORAGESERVICEVIEW_H -#define S_VIMPSTSTORAGESERVICEVIEW_H - -#include "mvimpststorageserviceview.h" - -// INCLUDES -#include -#include - -class MVIMPSTStorageContact; -class vimpstserviceview_stub; - -class vimpstserviceview_stub : public MVIMPSTStorageServiceView - { - public : - static MVIMPSTStorageServiceView* NewL(); - void AddObserverL( MVIMPSTStorageContactsObserver* aObserver ) ; - - void RemoveObserver( MVIMPSTStorageContactsObserver* aObserver ); - - - MVIMPSTStorageContact* FindContactByUserId( const TDesC& aUserId ); - - - TInt ListCount() const; - - MVIMPSTStorageContactList& ListAt( TInt aIndex ) const ; - - - MVIMPSTStorageContactList* FindContactList( const TDesC& aListId ); - - MVIMPSTStorageContactList* CreateContactListL( const TDesC& aContactListId, - const TDesC& aDisplayName ) ; - - void RemoveContactList( const TDesC& aContactListId ); - - - TInt ContactCount(TBool aSkipOfflineContacts = EFalse ) const; - - - - MVIMPSTStorageContact* UpdatePresenceL(const TDesC& aContactId, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aStatusText, - const TDesC8& aAvatarData, - TBool aIsClearingAvatar = EFalse) ; - - MVIMPSTStorageContact* UpdateAvatarL(const TDesC& aContactId, - const TDesC8& aAvatarData ); - - MVIMPSTStorageContact* CreateNewContactL(const TDesC& aUserId, - const TDesC& aDisplayName = KNullDesC, - TBool aIsInvitationItem = EFalse , - TBool aInvitationAutoAccept = EFalse); - - TInt CreateNewContactFromRetrivedIdL( TInt aIndexToUse ); - - TInt DeleteNewContactFromRetrivedIdL( TInt aIndexToUse ); - - TInt RemoveContactL( MVIMPSTStorageContact* aContact ); - - - void CreateNewFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ); - - - TBool IsLocalStore() const; - - - TInt RetriveLinkXSPIdsL(const TDesC8& aContactPackLink ); - const TDesC& GetRetrieveXSPIdL(TInt aIndex ); - - MVIMPSTStorageContact* FindContactByLink(const MVPbkContactLink& aContactLink ); - - - void Sort( const TDesC& aContactListId = KNullDesC ); - - MVIMPSTStorageContact& OwnContactL() ; - - void DeleteDatabaseL() ; - - void SetOwnUserIdL(const TDesC& aUserId ) ; - - void SetUnnamedTextL(HBufC* aUnnamedText ); - - - }; - - - - -#endif // S_VIMPSTSTORAGESERVICEVIEW_H - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_wssession.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_wssession.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* 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: s_wssession.cpp -* -*/ -#include -#include - - -RWsSession::RWsSession() {} - -TInt RWsSession::Connect() {return KErrNone;} - -void RWsSession::Close() {} - - -TApaTask::TApaTask(RWsSession& aWsSession) -:iWsSession(aWsSession) -{} - -TBool TApaTask::Exists() const { return ETrue; } -void TApaTask::KillTask() {} -void TApaTask::EndTask() {} - -TApaTaskList::TApaTaskList(RWsSession& aWsSession) -:iWsSession(aWsSession) -{} - -TApaTask TApaTaskList::FindApp(TUid /*aAppUid*/) - { - - } - - -MWsClientClass::MWsClientClass() {} diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpclient.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpclient.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* 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: s_ximpclient.cpp -* -*/ -#include "s_ximpclient.h" -#include "s_ximpcontext.h" - -void MXIMPClientStub::GetProtocolsL( - RXIMPObjOwningPtrArray< MXIMPProtocolInfo >& /*aProtocols*/ ) - { - } - -MXIMPFeatureInfo* MXIMPClientStub::GetFrameworkFeaturesLC() - { - return NULL; - } - -MXIMPContext* MXIMPClientStub::NewPresenceContextLC() - { - MXIMPContext* context = new ( ELeave ) MXIMPContextStub; - CleanupStack::PushL( context ); - return context; - } - -const TAny* MXIMPClientStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MXIMPClientStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MXIMPClientStub::GetInterfaceId() const - { - return 0; - } - - -MXIMPClient* MXIMPClientStub::NewClientL() - { - return new (ELeave) MXIMPClientStub(); - } - - - -MXIMPClientStub::~MXIMPClientStub() - { - - } - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpclient.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpclient.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* 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: s_ximpclient.h -* -*/ -#ifndef _MXIMPCLIENTSTUB_ -#define _MXIMPCLIENTSTUB_ - -#include - -class MXIMPProtocolInfo; -class MXIMPFeatureInfo; -class MXIMPContext; - -class MXIMPClientStub : public CBase, public MXIMPClient - { - -public: - /** - * Factory method to instantiate MXIMPClient. - * - * Factory method to instantiate platform default - * MXIMPClient implementation through the ECom. - * If the default presence framework isn't supported - * in the platform, leaves with errorcode signalled - * from ECom. - * - * @return The new presence client object. Object - * ownership is returned to caller. - */ - static MXIMPClient* NewClientL(); - - - /** - * Public destructor. - * Object can be deleted through this interface. - */ - ~MXIMPClientStub(); - - void GetProtocolsL( - RXIMPObjOwningPtrArray< MXIMPProtocolInfo >& aProtocols ); - - MXIMPFeatureInfo* GetFrameworkFeaturesLC(); - - MXIMPContext* NewPresenceContextLC(); - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - -#endif // MXIMPFWCLIENT_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpcontext.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpcontext.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* 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: s_ximpcontext.cpp -* -*/ -#include "s_ximpcontext.h" -#include "s_ximpobjectfactory.h" - -TInt gUnBindingLeaves = KErrNone; - -void MXIMPContextStub::RegisterObserverL( - MXIMPContextObserver& /*aObserver*/, - const TArray* /*aEventFilter*/ ) - { - } - -void MXIMPContextStub::UnregisterObserver( - MXIMPContextObserver& /*aObserver*/ ) - { - } - -TXIMPRequestId MXIMPContextStub::BindToL( - TUid /*aProtocolImpUid*/, - const TDesC16& /*aServiceAddress*/, - const TDesC16& /*aUsername*/, - const TDesC16& /*aPassword*/, - TInt32 /*aIapId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MXIMPContextStub::BindToL( - TUid /*aProtocolImpUid*/, - const TDesC16& /*aServiceAddress*/, - const TDesC16& /*aUsername*/, - const TDesC16& /*aPassword*/, - const TDesC16& /*aClientId*/, - TInt32 /*aIapId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MXIMPContextStub::BindToL( - TUid /*aProtocolImpUid*/, - const TDesC16& /*aUsername*/, - const TDesC16& /*aPassword*/, - TInt /*aSettingsId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MXIMPContextStub::BindToL( TUid /*aProtocolImpUid*/, - TInt /*aSettingsId*/ ) - { - TXIMPRequestId id; - return id; - } - -TXIMPRequestId MXIMPContextStub::UnbindL() - { - User::LeaveIfError( gUnBindingLeaves ); - TXIMPRequestId id; - return id; - } - -MXIMPFeatureInfo* MXIMPContextStub::GetContextFeaturesLC() const - { - return NULL; - } - -MXIMPObjectFactory& MXIMPContextStub::ObjectFactory() const - { - - - MXIMPContextStub* thisObject = const_cast (this); - if (!thisObject->iObjFactory) - { - thisObject->iObjFactory = new (ELeave) MyMXIMPObjectFactoryStub(); - } - return *iObjFactory; - } - -const TAny* MXIMPContextStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MXIMPContextStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MXIMPContextStub::GetInterfaceId() const - { - return 0; - } - -MXIMPContextStub::MXIMPContextStub() -{ - -} - -MXIMPContextStub::~MXIMPContextStub() - { - delete iObjFactory; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpcontext.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpcontext.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* 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: s_ximpcontext.h -* -*/ -#ifndef MXIMPFWPRESENCECONTEXTSTUB_H -#define MXIMPFWPRESENCECONTEXTSTUB_H - -#include - -class MyMXIMPObjectFactoryStub; - -class MXIMPContextStub : public CBase, public MXIMPContext - { -public: - MXIMPContextStub(); - ~MXIMPContextStub(); - void RegisterObserverL( - MXIMPContextObserver& aObserver, - const TArray* aEventFilter = NULL ); - - void UnregisterObserver( - MXIMPContextObserver& aObserver ); - - TXIMPRequestId BindToL( - TUid aProtocolImpUid, - const TDesC16& aServiceAddress, - const TDesC16& aUsername, - const TDesC16& aPassword, - TInt32 aIapId ); - TXIMPRequestId BindToL( - TUid aProtocolImpUid, - const TDesC16& aServiceAddress, - const TDesC16& aUsername, - const TDesC16& aPassword, - const TDesC16& aClientId, - TInt32 aIapId ); - TXIMPRequestId BindToL( TUid aProtocolImpUid, - TInt aSettingsId ); - - TXIMPRequestId BindToL( - TUid aProtocolImpUid, - const TDesC16& aUsername, - const TDesC16& aPassword, - TInt aSettingsId ); - - TXIMPRequestId UnbindL(); - MXIMPFeatureInfo* GetContextFeaturesLC() const; - MXIMPObjectFactory& ObjectFactory() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - private: - MyMXIMPObjectFactoryStub* iObjFactory; - - }; - - -#endif // MXIMPFWPRESENCECONTEXT_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpcontextstateevent.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpcontextstateevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* 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: s_ximpcontextstateevent.cpp -* -*/ -#include "s_ximpcontextstateevent.h" - - -TInt32 gMXIMPContextStateEventStubInterfaceId = 0; - -const MXIMPContextState& MXIMPContextStateEventStub::ContextState() const - { - MXIMPContextState* state = NULL; - return *state; - } - -const MXIMPStatus* MXIMPContextStateEventStub::StateChangeReason() const - { - MXIMPStatus* status = NULL; - return status; - } - -const TAny* MXIMPContextStateEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - -TAny* MXIMPContextStateEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps */) - { - return NULL; - } - -TInt32 MXIMPContextStateEventStub::GetInterfaceId() const - { - return gMXIMPContextStateEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpcontextstateevent.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpcontextstateevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -/* -* 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: s_ximpcontextstateevent.h -* -*/ -#ifndef MXIMPFWCONTEXTSTATEEVENTSTUB_H -#define MXIMPFWCONTEXTSTATEEVENTSTUB_H - -#include - - -class MXIMPContextStateEventStub : public MXIMPContextStateEvent - { - const MXIMPContextState& ContextState() const; - const MXIMPStatus* StateChangeReason() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - -#endif // MXIMPFWCONTEXTSTATEEVENTSTUB_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpidentity.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpidentity.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for identity object. -* -*/ - -#include "s_ximpidentity.h" - -MyMXIMPIdentityStub::MyMXIMPIdentityStub() - { - } -MyMXIMPIdentityStub::~MyMXIMPIdentityStub() - { - if(iIdentity) - { - delete iIdentity; - } - } - -const TDesC16& MyMXIMPIdentityStub::Identity() const - { - _LIT(Kidentity,"Identity"); - - return Kidentity; - } - -void MyMXIMPIdentityStub::SetIdentityL( - const TDesC16& aIdentity ) - { - if ( iIdentity ) - { - iIdentity->ReAlloc( aIdentity.Length() ); - } - else - { - iIdentity = HBufC::NewL( aIdentity.Length() ); - } - - iIdentity->Des().Copy( aIdentity ); - - } - - -const TAny* MyMXIMPIdentityStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - -TAny* MyMXIMPIdentityStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) -{ -return this; -} - -TInt32 MyMXIMPIdentityStub::GetInterfaceId() const -{ -return KErrNone; -} diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpidentity.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpidentity.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for identity object. -* -*/ -#ifndef MyMXIMPIdentityStub_H -#define MyMXIMPIdentityStub_H - -#include -#include -#include -#include - -_LIT( KTestIdentity, "TEST_IDENTITY" ); - -/** - * Interface for identity object. - * - * Identity objects are used to identify - * presentities, presentity groups and - * presentity group members, XIMP framework - * client applications etc. entities in - * XIMP Framework. - * - * @ingroup ximpdatamodelapi - * @since S60 v3.2 - */ -class MyMXIMPIdentityStub : public CBase, public MXIMPIdentity - { - -public: - - MyMXIMPIdentityStub(); - - /** - * Public destructor. - * Objects can be deleted through this interface. - */ - ~MyMXIMPIdentityStub() ; - - -public: - - - /** - * Returns identity string. - * - * @return The identity string. - */ - const TDesC16& Identity() const ; - - - - /** - * Sets identity. - * - * @param [in] aIdentity - * Identity string. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - void SetIdentityL( - const TDesC16& aIdentity ) ; - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; -private: - HBufC* iIdentity; - -}; - - -#endif // MyMXIMPIdentityStub_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpobjectfactory.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpobjectfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for XIMP Framework object factory. -* -*/ - -#include "s_ximpobjectfactory.h" -#include "s_ximpidentity.h" - -TBool gCreateXIMPIdentity = EFalse; -/** - * Instantiates new status object. - * - * @return New status object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPStatus* MyMXIMPObjectFactoryStub::NewStatusLC() - { - return NULL; - } - - -/** - * Instantiates new identity object. - * - * @return New identity object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPIdentity* MyMXIMPObjectFactoryStub::NewIdentityLC() - { - if (gCreateXIMPIdentity) - { - MyMXIMPIdentityStub* ret = new (ELeave) MyMXIMPIdentityStub(); - CleanupStack::PushL(ret); - return ret; - } - - return NULL; - } - - -/** - * Instantiates new restricted object collection object. - * - * @return New restricted object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPRestrictedObjectCollection* MyMXIMPObjectFactoryStub::NewRestrictedObjectCollectionLC() { return NULL;} - - -/** - * Instantiates new object collection object. - * - * @return New object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPObjectCollection* MyMXIMPObjectFactoryStub::NewObjectCollectionLC() { return NULL; } - - -/** - * Instantiates new data subscription state object. - * - * @return New data subscription state instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ -MXIMPDataSubscriptionState* MyMXIMPObjectFactoryStub::NewDataSubscriptionStateLC() { return NULL; } - - -const TAny* MyMXIMPObjectFactoryStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return NULL; - } - -TAny* MyMXIMPObjectFactoryStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) -{ - return NULL; -} - -TInt32 MyMXIMPObjectFactoryStub::GetInterfaceId() const -{ - return KErrNone; -} - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpobjectfactory.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpobjectfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2006, 2007 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: Interface for XIMP Framework object factory. -* -*/ -#ifndef MyMXIMPObjectFactoryStub_H -#define MyMXIMPObjectFactoryStub_H - -#include -#include -#include -#include - - -class MXIMPStatus; -class MXIMPIdentity; -class MXIMPObjectCollection; -class MXIMPRestrictedObjectCollection; -class MXIMPDataSubscriptionState; - - -/** - * Interface for XIMP Framework object factory. - * - * XIMP object factory is used to instantiate - * data objects declared in Data Model API. - * - * MXimpFwObjectFactory interface can be obtained from - * MXIMPContext or MXIMPProtocolConnectionHost - * interfaces. - * - * @ingroup ximpdatamodelapi - * @since S60 v3.2 - */ -class MyMXIMPObjectFactoryStub : public CBase, public MXIMPObjectFactory - { -public: - - /** - * Protected destructor. - * Object instancies can't be deleted via this interface. - */ - ~MyMXIMPObjectFactoryStub() {}; - - MyMXIMPObjectFactoryStub() - { - - }; - - - /** - * Instantiates new status object. - * - * @return New status object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPStatus* NewStatusLC() ; - - - /** - * Instantiates new identity object. - * - * @return New identity object instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPIdentity* NewIdentityLC() ; - - - /** - * Instantiates new restricted object collection object. - * - * @return New restricted object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPRestrictedObjectCollection* NewRestrictedObjectCollectionLC() ; - - - /** - * Instantiates new object collection object. - * - * @return New object collection instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPObjectCollection* NewObjectCollectionLC() ; - - - /** - * Instantiates new data subscription state object. - * - * @return New data subscription state instance. - * Object ownership is returned to caller. - * - * @leave KErrNoMemory if failed to allocate memory. - */ - MXIMPDataSubscriptionState* NewDataSubscriptionStateLC() ; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - - - }; - -#endif // MyMXIMPObjectFactoryStub_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresenceauthorization.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresenceauthorization.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +0,0 @@ -/* -* 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: s_ximppresenceauthorization.cpp -* -*/ -#include "s_ximppresenceauthorization.h" - -TInt32 gMXIMPPresenceAuthorizationInterfaceId = 0; - - - -TXIMPRequestId MPresenceAuthorizationStub::SubscribePresenceGrantRequestListL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub::UnsubscribePresenceGrantRequestListL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: GrantPresenceForPresentityL( - const MXIMPIdentity& /*aPresentityId*/, - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: WithdrawPresenceGrantFromPresentityL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: GrantPresenceForPresentityGroupMembersL( - const MXIMPIdentity& /*aPresentityId*/, - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: WithdrawPresenceGrantFromPresentityGroupMembersL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: GrantPresenceForEveryoneL( - const MPresenceInfoFilter& /*aPif*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: WithdrawPresenceGrantFromEveryoneL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: SubscribePresenceBlockListL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: UnsubscribePresenceBlockListL() - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: BlockPresenceForPresentityL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - -TXIMPRequestId MPresenceAuthorizationStub:: CancelPresenceBlockFromPresentityL( - const MXIMPIdentity& /*aPresentityId*/ ) - { - TXIMPRequestId requestId; - return requestId; - } - - -const TAny* MPresenceAuthorizationStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MPresenceAuthorizationStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceAuthorizationStub::GetInterfaceId() const - { - return gMXIMPPresenceAuthorizationInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresenceauthorization.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresenceauthorization.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* 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: s_ximppresenceauthorization.h -* -*/ -#ifndef MXIMPFWPRESENCEAUTHORIZATIONSTUB_H -#define MXIMPFWPRESENCEAUTHORIZATIONSTUB_H - -#include - - -class MPresenceAuthorizationStub : public MPresenceAuthorization - { - TXIMPRequestId SubscribePresenceGrantRequestListL(); - - TXIMPRequestId UnsubscribePresenceGrantRequestListL(); - - TXIMPRequestId GrantPresenceForPresentityL( - const MXIMPIdentity& aPresentityId, - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId WithdrawPresenceGrantFromPresentityL( - const MXIMPIdentity& aPresentityId ); - - TXIMPRequestId GrantPresenceForPresentityGroupMembersL( - const MXIMPIdentity& aGroupId, - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId WithdrawPresenceGrantFromPresentityGroupMembersL( - const MXIMPIdentity& aGroupId ); - - TXIMPRequestId GrantPresenceForEveryoneL( - const MPresenceInfoFilter& aPif ); - - TXIMPRequestId WithdrawPresenceGrantFromEveryoneL(); - - TXIMPRequestId SubscribePresenceBlockListL(); - - TXIMPRequestId UnsubscribePresenceBlockListL(); - - TXIMPRequestId BlockPresenceForPresentityL( - const MXIMPIdentity& aPresentityId ); - - TXIMPRequestId CancelPresenceBlockFromPresentityL( - const MXIMPIdentity& aPresentityId ); - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENCEAUTHORIZATIONSTUB_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresencegrantrequestlistevent.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresencegrantrequestlistevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* -* 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: s_ximppresencegrantrequestlistevent.cpp -* -*/ - -#include "s_ximppresencegrantrequestlistevent.h" -#include "s_presencegrantrequestinfo.h" - -TInt32 gMXIMPPresenceGrantRequestListEventStubInterfaceId = 0; -MPresenceGrantRequestInfoStub gMPresenceGrantRequestInfo; -TInt gNewRequestsCountValue = KErrNone; -TInt gCurrentRequestsCountValue = KErrNone; - -TInt MPresenceGrantRequestListEventStub::NewRequestsCount() const - { - return gNewRequestsCountValue; - } - -const MPresenceGrantRequestInfo& MPresenceGrantRequestListEventStub::NewRequest( - TInt /*aIndex*/ ) const - { - MPresenceGrantRequestInfo* info = MPresenceGrantRequestInfoStub::NewL(); - //return *gMPresenceGrantRequestInfo; - return *info; - } - -TInt MPresenceGrantRequestListEventStub::DisappearedRequestsCount() const - { - return KErrNone; - } - -const MPresenceGrantRequestInfo& MPresenceGrantRequestListEventStub::DisappearedRequest( - TInt /*aIndex*/ ) const - { - MPresenceGrantRequestInfo* info = NULL; - return *info; - } - -TInt MPresenceGrantRequestListEventStub::CurrentRequestsCount() const - { - return gCurrentRequestsCountValue; - } - -const MPresenceGrantRequestInfo& MPresenceGrantRequestListEventStub::CurrentRequest( - TInt /*aIndex*/ ) const - { - return gMPresenceGrantRequestInfo; - } - -const MXIMPDataSubscriptionState& MPresenceGrantRequestListEventStub::DataSubscriptionState() const - { - MXIMPDataSubscriptionState* state = NULL; - return *state; - } - - -const TAny* MPresenceGrantRequestListEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MPresenceGrantRequestListEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresenceGrantRequestListEventStub::GetInterfaceId() const - { - return gMXIMPPresenceGrantRequestListEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresencegrantrequestlistevent.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresencegrantrequestlistevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* 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: s_ximppresencegrantrequestlistevent.h -* -*/ -#ifndef MXIMPFWPRESENCEGRANTREQUESTLISTEVENTSTUB_H -#define MXIMPFWPRESENCEGRANTREQUESTLISTEVENTSTUB_H - -#include - - -class MPresenceGrantRequestListEventStub : public MPresenceGrantRequestListEvent - { - TInt NewRequestsCount() const; - const MPresenceGrantRequestInfo& NewRequest( TInt aIndex ) const; - TInt DisappearedRequestsCount() const; - const MPresenceGrantRequestInfo& DisappearedRequest( TInt aIndex ) const; - TInt CurrentRequestsCount() const; - const MPresenceGrantRequestInfo& CurrentRequest( TInt aIndex ) const; - const MXIMPDataSubscriptionState& DataSubscriptionState() const; - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENCEGRANTREQUESTLISTEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresensitygroupcontentevent.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresensitygroupcontentevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* 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: s_ximppresensitygroupcontentevent.cpp -* -*/ -#include "s_ximppresensitygroupcontentevent.h" -#include "s_ximpidentity.h" - -TInt32 gMXIMPPresentityGroupEventStubInterfaceId = 0; -extern MyMXIMPIdentityStub gMXIMPIdentity; // already define in MPresentityPresenceEventStub - -const MXIMPIdentity& MPresentityGroupContentEventStub::GroupId() const - { - gMXIMPIdentity.SetIdentityL(_L("ty")); - return gMXIMPIdentity; - } - -TInt MPresentityGroupContentEventStub::NewMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::NewMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info = NULL; - return *info; - } - -TInt MPresentityGroupContentEventStub::UpdatedMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::UpdatedMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info = NULL; - return *info; - } - -TInt MPresentityGroupContentEventStub::DisappearedMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::DisappearedMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info = NULL; - return *info; - } - -TInt MPresentityGroupContentEventStub::CurrentMembersCount() const - { - return KErrNone; - } - -const MPresentityGroupMemberInfo& MPresentityGroupContentEventStub::CurrentMember( - TInt /*aIndex*/ ) const - { - MPresentityGroupMemberInfo* info = NULL; - return *info; - } - -const MXIMPDataSubscriptionState& MPresentityGroupContentEventStub::DataSubscriptionState() const - { - MXIMPDataSubscriptionState* state = NULL; - return *state; - } - - -const TAny* MPresentityGroupContentEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MPresentityGroupContentEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresentityGroupContentEventStub::GetInterfaceId() const - { - return gMXIMPPresentityGroupEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresensitygroupcontentevent.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresensitygroupcontentevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* 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: s_ximppresensitygroupcontentevent.h -* -*/ -#ifndef MXIMPFWPRESENSITYGROUPCONTENTEVENTSTUB_H -#define MXIMPFWPRESENSITYGROUPCONTENTEVENTSTUB_H - -#include - - -class MPresentityGroupContentEventStub : public MPresentityGroupContentEvent - { - const MXIMPIdentity& GroupId() const; - TInt NewMembersCount() const; - const MPresentityGroupMemberInfo& NewMember( TInt aIndex ) const; - TInt UpdatedMembersCount() const; - const MPresentityGroupMemberInfo& UpdatedMember( TInt aIndex ) const; - TInt DisappearedMembersCount() const; - const MPresentityGroupMemberInfo& DisappearedMember( TInt aIndex ) const; - TInt CurrentMembersCount() const; - const MPresentityGroupMemberInfo& CurrentMember( TInt aIndex ) const; - const MXIMPDataSubscriptionState& DataSubscriptionState() const; - - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENSITYGROUPCONTENTEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresensitypresenceevent.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresensitypresenceevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* 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: s_ximppresensitypresenceevent.cpp -* -*/ -#include "s_ximppresensitypresenceevent.h" -#include "s_ximpidentity.h" -#include "s_presenceinfo.h" - -MyMXIMPIdentityStub gMXIMPIdentity; -MPresenceInfoStub gMPresenceInfo; -//MXIMPDataSubscriptionState gMXIMPDataSubscriptionState; - -TInt32 gMXIMPPresentityPresenceEventStubInterfaceId = 0; - -const MXIMPIdentity& MPresentityPresenceEventStub::PresentityId() const - { - return gMXIMPIdentity; - } - -const MPresenceInfo& MPresentityPresenceEventStub::SubscribedPresence() const - { - return gMPresenceInfo; - } - -const MXIMPDataSubscriptionState& MPresentityPresenceEventStub::DataSubscriptionState() const - { - MXIMPDataSubscriptionState* state = NULL; - return *state; - } - - -const TAny* MPresentityPresenceEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MPresentityPresenceEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MPresentityPresenceEventStub::GetInterfaceId() const - { - return gMXIMPPresentityPresenceEventStubInterfaceId; - } - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresensitypresenceevent.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximppresensitypresenceevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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: s_ximppresensitypresenceevent.h -* -*/ -#ifndef MXIMPFWPRESENSITYPRESENCEEVENTSTUB_H -#define MXIMPFWPRESENSITYPRESENCEEVENTSTUB_H - -#include - - -class MPresentityPresenceEventStub : public MPresentityPresenceEvent - { - const MXIMPIdentity& PresentityId() const; - const MPresenceInfo& SubscribedPresence() const; - const MXIMPDataSubscriptionState& DataSubscriptionState() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWPRESENSITYPRESENCEEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximprequestcompleteevent.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximprequestcompleteevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* 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: s_ximprequestcompleteevent.cpp -* -*/ -#include "s_ximprequestcompleteevent.h" - -TInt32 gMXIMPRequestCompleteEventStubInterfaceId = 0; -TXIMPRequestId gMXIMPRequestCompleteEventStubRequestId; -TBool gRequestCompleteEventResultCodeKerrNotSupported = 0; -MyXIMPStatusStub gXIMPStatus; - -const TXIMPRequestId& MXIMPRequestCompleteEventStub::RequestId() const - { - return gMXIMPRequestCompleteEventStubRequestId; - } - -const MXIMPStatus& MXIMPRequestCompleteEventStub::CompletionResult() const - { - if (gRequestCompleteEventResultCodeKerrNotSupported) - { - gXIMPStatus.SetResultCode(KErrNotSupported); - return gXIMPStatus; - } - - gXIMPStatus.SetResultCode(KErrNone); - - return gXIMPStatus; - } - -const MXIMPBase* MXIMPRequestCompleteEventStub::LookupCompletionDataByType( - TInt32 /*aInterfaceId*/ ) const - { - MXIMPBase* base = NULL; - return base; - } - -const TAny* MXIMPRequestCompleteEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*Ops*/ ) const - { - return this; - } - -TAny* MXIMPRequestCompleteEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MXIMPRequestCompleteEventStub::GetInterfaceId() const - { - return gMXIMPRequestCompleteEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximprequestcompleteevent.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximprequestcompleteevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,144 +0,0 @@ -/* -* 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: s_ximprequestcompleteevent.h -* -*/ -#ifndef MXIMPFWREQUESTCOMPLETEEVENTSTUB_H -#define MXIMPFWREQUESTCOMPLETEEVENTSTUB_H - -#include -#include - -class MXIMPStatus; - -class MXIMPRequestCompleteEventStub : public MXIMPRequestCompleteEvent - { - const TXIMPRequestId& RequestId() const; - const MXIMPStatus& CompletionResult() const; - const MXIMPBase* LookupCompletionDataByType( TInt32 aInterfaceId ) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - - }; - - -/** - * Interface for status object. - * - * Status object is used in XIMP Framework API - * to present result code and additional textual - * details from request completions, context - * state changes and similar events. - * - * @ingroup ximpdatamodelapi - * @since S60 v3.2 - */ -class MyXIMPStatusStub : public MXIMPStatus - { - -public: - - /** - * Gets request completion code. - * - * Result code can be: - * - one of the system wide errors - * - one of the ximp core specific errors defined in in ximperrors.hrh - * - one of the presence specific errors defined in in presenceerrors.hrh - * - error specific to the underlying communication channel - * - * @return The result code. - */ - TInt ResultCode() const { return iCode; }; - - - /** - * Gets the protocol level response code. - * - * - * @return Protocol level response code. - * KErrNone if no protocol level response code available. - */ - TInt ProtocolResultCode() const { return KErrNone; } - - - - /** - * Get the textual result description. - * Textual descriptions are protocol specific. - * - * @return The textual result description. - * Empty descriptor if no description available. - */ - const TDesC16& ProtocolResultDescription() const { return KNullDesC; } - - - - /** - * Sets request completion code. - * - * @param [in] aCode - * The result code. - */ - void SetResultCode( - TInt aCode ) { iCode = aCode; }; - - - - /** - * Sets textual result description. - * - * @param [in] aCode - */ - void SetProtocolResultCode( - TInt /*aCode*/ ) {}; - - - - /** - * Sets textual result description. - * - * @param [in] aDescription - * The textual result description. - */ - void SetProtocolResultDescriptionL( - const TDesC16& /*aDescription*/ ) {}; - - const TAny* GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const { return NULL; } - - TAny* GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) { return NULL; } - - TInt32 GetInterfaceId() const { return KErrNone; } - - private: - TInt iCode; - - }; - -#endif // MXIMPFWREQUESTCOMPLETEEVENT_H - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpsearchevent.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpsearchevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* 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: s_ximpsearchevent.cpp -* -*/ - -#include "s_ximpsearchevent.h" - -TInt32 gMXIMPSearchEventStubInterfaceId = 0; - - -TInt MSearchEventStub::SearchResultCount()const - { - return KErrNone; - } - -const MSearchInfo& MSearchEventStub::SearchResult( TInt /*aIndex*/ )const - { - MSearchInfo* info = NULL; - return *info; - } - -const MXIMPIdentity& MSearchEventStub::SearchId()const - { - MXIMPIdentity* identity = NULL; - return *identity; - } - - -const TAny* MSearchEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MSearchEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MSearchEventStub::GetInterfaceId() const - { - return gMXIMPSearchEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpsearchevent.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpsearchevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -/* -* 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: s_ximpsearchevent.h -* -*/ -#ifndef MXIMPFWSEARCHEVENTSTUB_H -#define MXIMPFWSEARCHEVENTSTUB_H - -#include - - -class MSearchEventStub : public MSearchEvent - { - TInt SearchResultCount() const; - const MSearchInfo& SearchResult( TInt aIndex ) const; - const MXIMPIdentity& SearchId() const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWSEARCHEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpsearchkeysevent.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpsearchkeysevent.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* 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: s_ximpsearchkeysevent.cpp -* -*/ - -#include "s_ximpsearchkeysevent.h" - -TInt32 gMXIMPSearchKeysEventStubInterfaceId = 0; - - -TInt MSearchKeysEventStub::InfoCount()const - { - return KErrNone; - } - -const MSearchKeyInfo& MSearchKeysEventStub::SearchKeyInfo( TInt /*aIndex*/ )const - { - MSearchKeyInfo* info = NULL; - return *info; - } - - -const TAny* MSearchKeysEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) const - { - return this; - } - - TAny* MSearchKeysEventStub::GetInterface( - TInt32 /*aInterfaceId*/, - TIfGetOps /*aOps*/ ) - { - return NULL; - } - -TInt32 MSearchKeysEventStub::GetInterfaceId() const - { - return gMXIMPSearchKeysEventStubInterfaceId; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpsearchkeysevent.h --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpsearchkeysevent.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* 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: s_ximpsearchkeysevent.h -* -*/ -#ifndef MXIMPFWSEARCHKEYSEVENTSTUB_H -#define MXIMPFWSEARCHKEYSEVENTSTUB_H - -#include - - -class MSearchKeysEventStub : public MSearchKeysEvent - { - TInt InfoCount() const; - const MSearchKeyInfo& SearchKeyInfo( TInt aIndex ) const; - - const TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ) const; - - TAny* GetInterface( - TInt32 aInterfaceId, - TIfGetOps aOps ); - - TInt32 GetInterfaceId() const; - }; - - - -#endif // MXIMPFWSEARCHKEYSEVENTSTUB_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstengine.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstengine.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1065 +0,0 @@ -/* -* t_vimpstengine.cpp 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:t_vimpstengine.cpp -* -*/ -#include -#include -#include -#include "t_vimpstengine.h" - -#include -#include -#include - -#include "cvimpstengine.h" -#include "cvimpstengineservicetablefetcher.h" -#include "mvimpstenginecontactmgmtextention.h" -#include "mvimpstenginesearchmgrextention.h" -#include "mvimpstengineextentionfeatures.h" -#include "cvimpstenginesessioncntxtobserver.h" -//#include "cvimpstenginesearchmgrextention.h" -#include "cvimpstenginecontactmgmtextention.h" -#include "mvimpstenginesubservice.h" - -#include "s_cch.h" - -extern MyCchService* myService; -extern TBool createService ; -extern CSPSettings* myCSPSettings; - -extern TBool getUserName; -extern TBool getPassword; - -const TInt KTestServiceId = 4; -_LIT( KTestServiceName, "TEST_SERVICE" ); -//_LIT8( KTestBrandId, "TEST_BRAND_ID" ); - -_LIT( KTestInternetTelephoneField, "Internet telephone" ); - -T_VimpstEngine* T_VimpstEngine::NewLC() - { - T_VimpstEngine* self = new( ELeave ) T_VimpstEngine; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VimpstEngine::~T_VimpstEngine() - { - } - -void T_VimpstEngine::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - -void T_VimpstEngine::SetupL() - { - iServiceTableFetcher = CVIMPSTEngineServiceTableFetcher::NewL(); - - createService = ETrue; - myCSPSettings = CSPSettings::NewL(); - iTestServiceId = CreateSpEntryL( KTestServiceId ); - - iEngine = CVIMPSTEngine::NewL( - iTestServiceId, *iServiceTableFetcher ); - } - -void T_VimpstEngine::Teardown() - { - if ( iServiceTableFetcher ) - { - delete iServiceTableFetcher; - iServiceTableFetcher = NULL; - } - if ( iEngine ) - { - delete iEngine; - iEngine = NULL; - } - - if ( myService ) - { - delete myService; - myService = NULL; - } - - if ( myCSPSettings ) - { - delete myCSPSettings; - myCSPSettings = NULL; - } - - createService = EFalse; - getUserName = EFalse; - getPassword = EFalse; - } - - -// FROM OBSERVERS - -void T_VimpstEngine::HandleServiceEventL( - TVIMPSTEnums::TVIMPSTRegistrationState /*aState*/, - TInt /*aServiceError*/ ) - { - - } - - - -// HELP METHODS - -TInt T_VimpstEngine::CreateSpEntryL( TInt aServiceId ) - { - CSPEntry* entry = CSPEntry::NewLC(); - entry->SetServiceId( aServiceId ); - User::LeaveIfError( entry->SetServiceName( KTestServiceName ) ); - - CSPEntry* testEntry = CSPEntry::NewLC(); - TInt result = myCSPSettings->FindEntryL( entry->GetServiceId(), *testEntry ); - - if( result == KErrNone ) - { - myCSPSettings->UpdateEntryL( *entry ); - } - else - { - myCSPSettings->AddEntryL( *entry ); - } - - CSPProperty* property = NULL; - - // set voip enabled property - property = CSPProperty::NewLC(); - property->SetName( ESubPropertyVoIPEnabled ); - property->SetValue( EOn ); - entry->AddPropertyL( *property ); - CleanupStack::PopAndDestroy( property ); - - // set presence settings id property - property = CSPProperty::NewLC(); - property->SetName( ESubPropertyPresenceSettingsId ); - property->SetValue( 1 ); - entry->AddPropertyL( *property ); - CleanupStack::PopAndDestroy( property ); - - // set im settings id property - property = CSPProperty::NewLC(); - property->SetName( ESubPropertyIMSettingsId ); - property->SetValue( 1 ); - entry->AddPropertyL( *property ); - CleanupStack::PopAndDestroy( property ); - - // set Presence FW PSC plugin UID - property = CSPProperty::NewLC(); - property->SetName( EPropertyPCSPluginId ); - property->SetValue( 1 ); - entry->AddPropertyL( *property ); - CleanupStack::PopAndDestroy( property ); - - myCSPSettings->UpdateEntryL( *entry ); - TInt createdServiceId = entry->GetServiceId(); - - CleanupStack::PopAndDestroy( testEntry ); - CleanupStack::PopAndDestroy( entry ); - - return createdServiceId; - } - - - -// TEST CASES - -void T_VimpstEngine::T_NewLL() - { - EUNIT_ASSERT( iEngine != NULL ); - } - -void T_VimpstEngine::T_LoginL() - { - // iEngine->iCchHandler = mycch_stub::N - TInt err = iEngine->Login(); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEngine::T_LogoutL() - { - iEngine->LogoutL(); - } - -void T_VimpstEngine::T_ServiceIdL() - { - TUint32 serviceId( KErrNone ); - serviceId = iEngine->ServiceId(); - EUNIT_ASSERT( iTestServiceId == serviceId ); - } - -void T_VimpstEngine::T_ServiceNameL() - { - RBuf serviceName; - CleanupClosePushL( serviceName ); - serviceName.CreateL( 15 ); - serviceName.Copy( iEngine->ServiceName() ); - EUNIT_ASSERT( serviceName.Compare( KTestServiceName ) == 0 ); - CleanupStack::PopAndDestroy( &serviceName ); - } - -void T_VimpstEngine::T_ServiceStateL() - { - RArray states; - CleanupClosePushL( states ); - - states.AppendL( TVIMPSTEnums::ESVCENotRegistered ); - states.AppendL( TVIMPSTEnums::ESVCERegistered ); - states.AppendL( TVIMPSTEnums::ESVCENetworkConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEWaitingForNetwork ); - states.AppendL( TVIMPSTEnums::ESVCENetworkDisConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEUpdatingContacts ); - - for ( TInt i( 0 ) ; i < states.Count() ; i++ ) - { - iEngine->iState = states[ i ]; - TVIMPSTEnums::TVIMPSTRegistrationState state = - iEngine->ServiceState(); - EUNIT_ASSERT( state == states[ i ] ); - } - - CleanupStack::PopAndDestroy( &states ); - } - -void T_VimpstEngine::T_GetBrandInfoLL() - { - TLanguage language; - TInt version( KErrNone ); - RBuf8 brandId; - CleanupClosePushL( brandId ); - brandId.CreateL( 20 ); - - TRAPD( err, iEngine->GetBrandInfoL( - language, version, brandId ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - - CleanupStack::PopAndDestroy( &brandId ); - } - -void T_VimpstEngine::T_IsSubServiceSupportedLL() - { - RArray types; - CleanupClosePushL( types ); - - types.AppendL( TVIMPSTEnums::EVoip ); - types.AppendL( TVIMPSTEnums::EPresence ); - types.AppendL( TVIMPSTEnums::EIM ); - types.AppendL( TVIMPSTEnums::ELast ); - - for ( TInt i( 0 ) ; i < types.Count() ; i++ ) - { - TBool supported( EFalse ); - TRAPD( err, supported = - iEngine->IsSubServiceSupportedL( types[ i ] ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - EUNIT_ASSERT( ETrue == supported || EFalse == supported ); - } - - CleanupStack::PopAndDestroy( &types ); - } - -void T_VimpstEngine::T_IsSubServiceEnabledL() - { - RArray types; - CleanupClosePushL( types ); - - types.AppendL( TVIMPSTEnums::EVoip ); - types.AppendL( TVIMPSTEnums::EPresence ); - types.AppendL( TVIMPSTEnums::EIM ); - types.AppendL( TVIMPSTEnums::ELast ); - - for ( TInt i( 0 ) ; i < types.Count() ; i++ ) - { - TBool enabled( EFalse ); - TRAPD( err, enabled = - iEngine->IsSubServiceEnabled( types[ i ] ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - EUNIT_ASSERT( ETrue == enabled || EFalse == enabled ); - } - - CleanupStack::PopAndDestroy( &types ); - } - -void T_VimpstEngine::T_ContactStoreIdLL() - { - RBuf contactStoreId; - CleanupClosePushL( contactStoreId ); - contactStoreId.CreateL( 50 ); - - TRAPD( err, iEngine->ContactStoreIdL( contactStoreId ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - - CleanupStack::PopAndDestroy( &contactStoreId ); - } - -void T_VimpstEngine::T_RegisterServiceSessionObserverLL() - { - TInt err( KErrNone ); - - // Register observer - TRAP( err, iEngine->RegisterServiceSessionObserverL( this ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - - // Try to register same observer again - TRAP( err, iEngine->RegisterServiceSessionObserverL( this ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEngine::T_UnRegisterServiceSessionObserverLL() - { - TInt err( KErrNone ); - - // Register observer to be unregistered - TRAP( err, iEngine->RegisterServiceSessionObserverL( this ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - - // Unregister observer - TRAP( err, iEngine->UnRegisterServiceSessionObserver( this ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - - // Try to unregister observer again - TRAP( err, iEngine->UnRegisterServiceSessionObserver( this ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ) - } - -void T_VimpstEngine::T_IntializeStorageLL() - { - TRAPD( err, iEngine->IntializeStorageL() ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEngine::T_UnIntializeStorageLL() - { - iEngine->UnIntializeStorage(); - } - -/*void T_VimpstEngine::T_SetUserNameL() - { - TInt err( KErrNone ); - //err = iEngine->SetUserName( KTestUserName ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEngine::T_SetPasswordL() - { - TInt err( KErrNone ); - //rr = iEngine->SetPassword( KTestPassword ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - EUNIT_ASSERT( KErrNone == err ); - } -*/ -/* -void T_VimpstEngine::T_UserNameLL() - { - getUserName = ETrue; - - HBufC* userName = NULL; - TRAPD( err, userName = iEngine->UserNameL() ); - CleanupStack::PushL( userName ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - EUNIT_ASSERT( KErrNone == err ); - EUNIT_ASSERT( userName->Des().Compare( KTestUserName ) == 0 ); - - CleanupStack::PopAndDestroy( userName ); - }*/ -/* -void T_VimpstEngine::T_PasswordLL() - { - getPassword = ETrue; - - HBufC* passWord = NULL; - TRAPD( err, passWord = iEngine->PasswordL() ); - CleanupStack::PushL( passWord ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - EUNIT_ASSERT( KErrNone == err ); - EUNIT_ASSERT( passWord->Des().Compare( KTestPassword ) == 0 ); - - CleanupStack::PopAndDestroy( passWord ); - }*/ - -void T_VimpstEngine::T_SubServiceL() - { - RArray types; - CleanupClosePushL( types ); - - types.AppendL( TVIMPSTEnums::EVoip ); - types.AppendL( TVIMPSTEnums::EPresence ); - types.AppendL( TVIMPSTEnums::EIM ); - types.AppendL( TVIMPSTEnums::ELast ); - - for ( TInt i( 0 ) ; i < types.Count() ; i++ ) - { - MVIMPSTEngineSubService* subservice = - iEngine->SubService( types[ i ] ); - } - - CleanupStack::PopAndDestroy( &types ); - } - -void T_VimpstEngine::T_ExtentionFeaturesL() - { - // Try when no extension features exist - MVIMPSTEngineSearchMgrExtention* searchMgr = - dynamic_cast - (iEngine->ExtentionFeatures(TVIMPSTEnums::ESearch)); - - MVIMPSTEngineContactMgmtExtention* contactMgr = - dynamic_cast - (iEngine->ExtentionFeatures( - TVIMPSTEnums::EContactManagement)); - - iEngine->ExtentionFeatures( - TVIMPSTEnums::EBlocking); - - iEngine->ExtentionFeatures( - TVIMPSTEnums::EExtentionLast); - - // Test again after creating extension features - TRAPD( err, iEngine->CreateExtentionFeaturesL() ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - - searchMgr = NULL; - contactMgr = NULL; - - searchMgr = - dynamic_cast - (iEngine->ExtentionFeatures(TVIMPSTEnums::ESearch)); - - contactMgr = - dynamic_cast - (iEngine->ExtentionFeatures( - TVIMPSTEnums::EContactManagement)); - - iEngine->ExtentionFeatures( - TVIMPSTEnums::EBlocking); - - iEngine->ExtentionFeatures( - TVIMPSTEnums::EExtentionLast); - } - -void T_VimpstEngine::T_AddExtentionFeaturesLL() - { - /*CVIMPSTEngineSessionCntxtObserver* observer = - CVIMPSTEngineSessionCntxtObserver::NewLC( - iTestServiceId ); - - CVIMPSTEngineSearchMgrExtention* searchitem = - CVIMPSTEngineSearchMgrExtention::NewLC( - observer->XimpPresenceContextL(), - *observer->GetRequestMapper()); - - TRAPD( err, iEngine->AddExtentionFeaturesL( searchitem ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - - CleanupStack::PopAndDestroy( searchitem ); - CleanupStack::PopAndDestroy( observer );*/ - } - -void T_VimpstEngine::T_RemoveExtentionFeaturesL() - { - RArray types; - CleanupClosePushL( types ); - - // Add feature that can be removed - CVIMPSTEngineSessionCntxtObserver* observer = - CVIMPSTEngineSessionCntxtObserver::NewLC( - iTestServiceId ); - - /* CVIMPSTEngineSearchMgrExtention* searchitem = - CVIMPSTEngineSearchMgrExtention::NewLC( - observer->XimpPresenceContextL(), - *observer->GetRequestMapper()); - - TRAPD( err, iEngine->AddExtentionFeaturesL( searchitem ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - EUNIT_ASSERT( iEngine->iExtentionFeatures.Count() == 1 ); - */ - - // Test with all types - // types.AppendL( TVIMPSTEnums::ESearch ); - //types.AppendL( TVIMPSTEnums::EBlocking ); - types.AppendL( TVIMPSTEnums::EContactManagement ); - types.AppendL( TVIMPSTEnums::EExtentionLast ); - - for ( TInt i( 0 ) ; i < types.Count() ; i++ ) - { - iEngine->RemoveExtentionFeatures( types[ i ] ); - } - - // Created feature should be removed --> count = 0 - EUNIT_ASSERT( iEngine->iExtentionFeatures.Count() == 0 ); - - //CleanupStack::PopAndDestroy( searchitem ); - CleanupStack::PopAndDestroy( observer ); - CleanupStack::PopAndDestroy( &types ); - } - -void T_VimpstEngine::T_HandleServceConnectionEventLL() - { - TRAPD( err, iEngine->HandleServceConnectionEventL() ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEngine::T_ParseGetServiceStateL() - { - RArray states; - CleanupClosePushL( states ); - - states.AppendL( TVIMPSTEnums::ESVCENotRegistered ); - states.AppendL( TVIMPSTEnums::ESVCERegistered ); - states.AppendL( TVIMPSTEnums::ESVCENetworkConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEWaitingForNetwork ); - states.AppendL( TVIMPSTEnums::ESVCENetworkDisConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEUpdatingContacts ); - - TVIMPSTEnums::TVIMPSTRegistrationState state; - state = iEngine->ParseGetServiceState(); - EUNIT_ASSERT( state == TVIMPSTEnums::ESVCENotRegistered ); - - // TBD: test with different states - - CleanupStack::PopAndDestroy( &states ); - } - -void T_VimpstEngine::T_HandleContactFetchedLL() - { - TRAPD( err, iEngine->HandleContactFetchedL() ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } -/* -void T_VimpstEngine::T_HandleContactAddedLL() - { - RPointerArray serviceDetails; - CDesCArray* array = new (ELeave) CDesCArrayFlat( 1 ); - CleanupStack::PushL( array ); - - array->AppendL( KTestInternetTelephoneField ); - const CDesCArray& constArray = *array; - - for ( TInt i( 0 ) ; i < constArray.MdcaCount() ; i++ ) - { - serviceDetails.InsertInOrder( constArray[ i ].Alloc(),0); - } - - TRAPD( err, iEngine->HandleContactAddedL( serviceDetails ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - - CleanupStack::PopAndDestroy( array ); - serviceDetails.ResetAndDestroy(); - }*/ -/* -void T_VimpstEngine::T_HandleContactDeletedLL() - { - // RPointerArray serviceDetails; - MVIMPSTStorageContact* aStorageContact; - - //TRAPD( err, iEngine->HandleContactDeletedL( serviceDetails ) ); - - TRAPD( err, iEngine->HandleContactDeletedL( *aStorageContact ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - - //serviceDetails.ResetAndDestroy(); - - } -*/ -void T_VimpstEngine::T_CreateExtentionFeaturesLL() - { - TRAPD( err, iEngine->CreateExtentionFeaturesL() ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } -/* -void T_VimpstEngine::T_EmptySetUserNameL() - { - TRAPD( err, iEngine->SetUserNameL(KNullDesC()) ); - - if ( KErrNone != err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } -*/ -/* -void T_VimpstEngine::T_SetUserNameL() - { - TRAPD( err, iEngine->SetUserNameL(_L("testui")) ); - - if ( KErrNone != err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } -*/ -/* -void T_VimpstEngine::T_WithDomainNameSetUserNameL() - { - TRAPD( err, iEngine->SetUserNameL(_L("testui123@gmail.com")) ); - - if ( KErrNone != err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } -*/ -/* -void T_VimpstEngine::T_EmptySetPassword() - { - TRAPD( err, iEngine->SetPassword(KNullDesC()) ); - - if (KErrNone != err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } -*/ -/* -void T_VimpstEngine::T_SetPassword() - { - TRAPD( err, iEngine->SetPassword(_L("test_ui123")) ); - - if (KErrNone != err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } -*/ -void T_VimpstEngine::T_BlockNotSupported() - { - TBool isBlockSupported = iEngine->IsBlockSupportedL(); - EUNIT_ASSERT( EFalse == isBlockSupported ); - } - -void T_VimpstEngine::T_FetchBlockedListL() - { - TInt err = KErrNone; - TRAP(err,iEngine->FetchBlockedListL()) - EUNIT_ASSERT( KErrNone == err); - } - -void T_VimpstEngine::T_RegisterBlockedListObserver() - { - TInt err = KErrNone; - iEngine->RegisterBlockedListObserver(NULL); - EUNIT_ASSERT( NULL == iEngine->iBlockListObs ); - } - - -void T_VimpstEngine::T_BlockSupported() - { - - iEngine->iSessionCntxtObserver = CVIMPSTEngineSessionCntxtObserver::NewL(3); - TBool isBlockSupported = iEngine->IsBlockSupportedL(); - EUNIT_ASSERT( EFalse == isBlockSupported ); - } - -EUNIT_BEGIN_TEST_TABLE( T_VimpstEngine, "T_VimpstEngine", "" ) - -EUNIT_TEST( - "NewL - test ", - "T_VimpstEngine", - "NewL", - "FUNCTIONALITY", - SetupL, T_NewLL, Teardown) - -EUNIT_TEST( - "Login - test ", - "T_VimpstEngine", - "Login", - "FUNCTIONALITY", - SetupL, T_LoginL, Teardown) - -EUNIT_TEST( - "Logout - test ", - "T_VimpstEngine", - "Logout", - "FUNCTIONALITY", - SetupL, T_LogoutL, Teardown) - -EUNIT_TEST( - "ServiceId - test ", - "T_VimpstEngine", - "ServiceId", - "FUNCTIONALITY", - SetupL, T_ServiceIdL, Teardown) - -EUNIT_TEST( - "ServiceName - test ", - "T_VimpstEngine", - "ServiceName", - "FUNCTIONALITY", - SetupL, T_ServiceNameL, Teardown) - -EUNIT_TEST( - "ServiceState - test ", - "T_VimpstEngine", - "ServiceState", - "FUNCTIONALITY", - SetupL, T_ServiceStateL, Teardown) - -EUNIT_TEST( - "GetBrandInfoL - test ", - "T_VimpstEngine", - "GetBrandInfoL", - "FUNCTIONALITY", - SetupL, T_GetBrandInfoLL, Teardown) - -EUNIT_TEST( - "IsSubServiceSupportedL - test ", - "T_VimpstEngine", - "IsSubServiceSupportedL", - "FUNCTIONALITY", - SetupL, T_IsSubServiceSupportedLL, Teardown) - -EUNIT_TEST( - "IsSubServiceEnabled - test ", - "T_VimpstEngine", - "IsSubServiceEnabled", - "FUNCTIONALITY", - SetupL, T_IsSubServiceEnabledL, Teardown) - -EUNIT_TEST( - "ContactStoreIdL - test ", - "T_VimpstEngine", - "ContactStoreIdL", - "FUNCTIONALITY", - SetupL, T_ContactStoreIdLL, Teardown) - -EUNIT_TEST( - "RegisterServiceSessionObserverL", - "T_VimpstEngine", - "RegisterServiceSessionObserverL", - "FUNCTIONALITY", - SetupL, T_RegisterServiceSessionObserverLL, Teardown) - -EUNIT_TEST( - "UnRegisterServiceSessionObserverL - test ", - "T_VimpstEngine", - "UnRegisterServiceSessionObserverL", - "FUNCTIONALITY", - SetupL, T_UnRegisterServiceSessionObserverLL, Teardown) - -EUNIT_TEST( - "IntializeStorageL - test ", - "T_VimpstEngine", - "IntializeStorageL", - "FUNCTIONALITY", - SetupL, T_IntializeStorageLL, Teardown) - -EUNIT_TEST( - "UnIntializeStorageL - test ", - "T_VimpstEngine", - "UnIntializeStorageL", - "FUNCTIONALITY", - SetupL, T_UnIntializeStorageLL, Teardown) - -/*EUNIT_TEST( - "SetUserName - test ", - "T_VimpstEngine", - "SetUserName", - "FUNCTIONALITY", - SetupL, T_SetUserNameL, Teardown) - -EUNIT_TEST( - "SetPassword - test ", - "T_VimpstEngine", - "SetPassword", - "FUNCTIONALITY", - SetupL, T_SetPasswordL, Teardown) - */ - /* -EUNIT_TEST( - "UserNameL - test ", - "T_VimpstEngine", - "UserNameL", - "FUNCTIONALITY", - SetupL, T_UserNameLL, Teardown) - -EUNIT_TEST( - "PasswordL - test ", - "T_VimpstEngine", - "PasswordL", - "FUNCTIONALITY", - SetupL, T_PasswordLL, Teardown) - */ -EUNIT_TEST( - "SubService - test ", - "T_VimpstEngine", - "SubService", - "FUNCTIONALITY", - SetupL, T_SubServiceL, Teardown) - -EUNIT_TEST( - "ExtentionFeatures - test ", - "T_VimpstEngine", - "ExtentionFeatures", - "FUNCTIONALITY", - SetupL, T_ExtentionFeaturesL, Teardown) - -EUNIT_TEST( - "AddExtentionFeaturesL - test ", - "T_VimpstEngine", - "AddExtentionFeaturesL", - "FUNCTIONALITY", - SetupL, T_AddExtentionFeaturesLL, Teardown) - -EUNIT_TEST( - "RemoveExtentionFeatures - test ", - "T_VimpstEngine", - "RemoveExtentionFeatures", - "FUNCTIONALITY", - SetupL, T_RemoveExtentionFeaturesL, Teardown) - -EUNIT_TEST( - "HandleServceConnectionEventL - test ", - "T_VimpstEngine", - "HandleServceConnectionEventL", - "FUNCTIONALITY", - SetupL, T_HandleServceConnectionEventLL, Teardown) - -EUNIT_TEST( - "ParseGetServiceState - test ", - "T_VimpstEngine", - "ParseGetServiceState", - "FUNCTIONALITY", - SetupL, T_ParseGetServiceStateL, Teardown) - -EUNIT_TEST( - "HandleContactFetchedL - test ", - "T_VimpstEngine", - "HandleContactFetchedL", - "FUNCTIONALITY", - SetupL, T_HandleContactFetchedLL, Teardown) -/* -EUNIT_TEST( - "HandleContactAddedL - test ", - "T_VimpstEngine", - "HandleContactAddedL", - "FUNCTIONALITY", - SetupL, T_HandleContactAddedLL, Teardown) - -EUNIT_TEST( - "HandleContactDeletedL - test ", - "T_VimpstEngine", - "HandleContactDeletedL", - "FUNCTIONALITY", - SetupL, T_HandleContactDeletedLL, Teardown) - */ -EUNIT_TEST( - "CreateExtentionFeaturesL - test ", - "T_VimpstEngine", - "CreateExtentionFeaturesL", - "FUNCTIONALITY", - SetupL, T_CreateExtentionFeaturesLL, Teardown) - -/* -EUNIT_TEST( - "EmptySetPassword - test ", - "T_VimpstEngine", - "CreateExtentionFeaturesL", - "FUNCTIONALITY", - SetupL, T_EmptySetPassword, Teardown)*/ -/* -EUNIT_TEST( - "EmptySetUserNameL - test ", - "T_VimpstEngine", - "CreateExtentionFeaturesL", - "FUNCTIONALITY", - SetupL, T_EmptySetUserNameL, Teardown) - -EUNIT_TEST( - "SetUserNameL - test ", - "T_VimpstEngine", - "CreateExtentionFeaturesL", - "FUNCTIONALITY", - SetupL, T_SetUserNameL, Teardown) - -EUNIT_TEST( - "WithDomainNameSetUserNameL - test ", - "T_VimpstEngine", - "CreateExtentionFeaturesL", - "FUNCTIONALITY", - SetupL, T_WithDomainNameSetUserNameL, Teardown) - */ -EUNIT_TEST( - "BlockSupported - test ", - "T_VimpstEngine", - "BlockSupported", - "FUNCTIONALITY", - SetupL, T_BlockSupported, Teardown) - -EUNIT_TEST( - "BlockNotSupported - test ", - "T_VimpstEngine", - "BlockNotSupported", - "FUNCTIONALITY", - SetupL, T_BlockNotSupported, Teardown) - -EUNIT_TEST( - "FetchBlockedList - test ", - "T_FetchBlockedListL", - "FetchBlockedList", - "FUNCTIONALITY", - SetupL, T_FetchBlockedListL, Teardown) - -EUNIT_TEST( - "RegisterBlockedListObserver - test ", - "T_RegisterBlockedListObserver", - "RegisterBlockedListObserver", - "FUNCTIONALITY", - SetupL, T_RegisterBlockedListObserver , Teardown) - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginecchhandler.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginecchhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,458 +0,0 @@ -/* -* t_vimpstenginecchhandler.cpp : 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: t_vimpstenginecchhandler.cpp -* -*/ -#include -#include -#include -#include -#include "t_vimpstenginecchhandler.h" -#include "cvimpstenginecchhandler.h" - - -#include "s_cch.h" -#include "s_mcchuiobserver.h" - -extern MyCchService* myService; -extern TBool createService ; -extern TBool tryAllSubserviceAvailable ; -extern TBool tryVoipSubServiceAvailable ; -extern TBool tryPresenceSubServiceAvailable ; -extern TBool tryIMSubServiceAvailable ; -extern TBool tryConnParamLeaveWithNotSupported ; -extern TBool tryConnParamWithSuccess ; -extern TBool sendObserverEvent; -extern TBool tryConnParamWithFailure ; - - -T_VimpstEngineCchHandler* T_VimpstEngineCchHandler::NewLC() - { - T_VimpstEngineCchHandler* self = new( ELeave ) T_VimpstEngineCchHandler; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VimpstEngineCchHandler::~T_VimpstEngineCchHandler() - { - } - -void T_VimpstEngineCchHandler::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - -void T_VimpstEngineCchHandler::SetupL() - { - iCChHandler = CVIMPSTEngineCchHandler::NewL( 3,*iCchUiEventObserver ); - } - -void T_VimpstEngineCchHandler::SetupL1() - { - createService = ETrue; - iCChHandler = CVIMPSTEngineCchHandler::NewL( 3 ,*iCchUiEventObserver); - } - -void T_VimpstEngineCchHandler::Teardown() - { - delete myService; - myService = NULL; - createService = EFalse; - - tryAllSubserviceAvailable = EFalse; - tryVoipSubServiceAvailable = EFalse; - tryPresenceSubServiceAvailable = EFalse; - tryIMSubServiceAvailable = EFalse; - - tryConnParamLeaveWithNotSupported = EFalse; - tryConnParamWithSuccess = EFalse; - - delete iCChHandler; - iCChHandler = NULL; - } - - -void T_VimpstEngineCchHandler::TestConstructionL() - { - - EUNIT_ASSERT( iCChHandler ); - - } - -void T_VimpstEngineCchHandler::TestGetServiceStateServiceNotFoundL() - { - - TCCHSubserviceState state; - EUNIT_ASSERT_EQUALS( KErrNotFound, iCChHandler->GetServiceState( 99, ECCHVoIPSub, state ) ); - - - } - - -void T_VimpstEngineCchHandler::TestGetServiceStateServiceFoundL() - { - - TCCHSubserviceState state; - - createService = ETrue; - tryVoipSubServiceAvailable = ETrue; - - EUNIT_ASSERT_EQUALS( KErrNone, iCChHandler->GetServiceState( 5, ECCHVoIPSub, state ) ); - - } - - -void T_VimpstEngineCchHandler::TestEnableServiceServiceFoundL() - { - - createService = ETrue; - EUNIT_ASSERT_EQUALS( KErrNone, iCChHandler->EnableService() ); - - } - - -void T_VimpstEngineCchHandler::TestEnableServiceServiceNotFoundL() - { - - EUNIT_ASSERT_EQUALS( KErrNotFound, iCChHandler->EnableService() ); - - } - -void T_VimpstEngineCchHandler::TestDisableServiceServiceFoundL() - { - - createService = ETrue; - EUNIT_ASSERT_EQUALS( KErrNone, iCChHandler->DisableService() ); - - } - - -void T_VimpstEngineCchHandler::TestDisableServiceServiceNotFoundL() - { - - EUNIT_ASSERT_EQUALS( KErrNotFound, iCChHandler->DisableService() ); - - } -/* -void T_VimpstEngineCchHandler::ValidateServiceServiceNotFoundL() - { - EUNIT_ASSERT_EQUALS( EFalse, iCChHandler->ValidateService(99) ); - }*/ -/* -void T_VimpstEngineCchHandler::ValidateServiceAllSubserviceAvailableL() - { - createService = ETrue; - tryAllSubserviceAvailable = ETrue; - - EUNIT_ASSERT_EQUALS( ETrue, iCChHandler->ValidateService(99) ); - } -*/ -/* -void T_VimpstEngineCchHandler::ValidateServiceAnyOneSubserviceAvailableL() - { - createService = ETrue; - tryPresenceSubServiceAvailable = ETrue; - - EUNIT_ASSERT_EQUALS( ETrue, iCChHandler->ValidateService(99) ); - } -*/ - -void T_VimpstEngineCchHandler::GetConParametersServiceNotFoundL() - { - HBufC* temp = NULL; - - createService = ETrue; - tryConnParamWithFailure = ETrue; - - TRAPD(err, temp = iCChHandler->GetConParametersL(ECchUsername)); - - EUNIT_ASSERT_EQUALS( KErrNotFound, err ); - - if (temp) - { - User::Leave( KErrArgument ); // For alloc failure testing - } - - } - -void T_VimpstEngineCchHandler::GetConParametersServiceFoundL() - { - HBufC* temp = NULL; - - createService = ETrue; - tryConnParamWithSuccess = ETrue; - tryConnParamWithFailure = EFalse; - - TRAPD(err, temp = iCChHandler->GetConParametersL(ECchUsername)); - - EUNIT_ASSERT_EQUALS( KErrNone, err ); - - CleanupStack::PushL(temp); - - if (temp->Des().Compare(KTestUserName())) - { - User::Leave( KErrArgument ); // For alloc failure testing - } - - CleanupStack::PopAndDestroy(temp); - } - - -void T_VimpstEngineCchHandler::GetConParametersLeavesServiceFoundL() - { - HBufC* temp = NULL; - - createService = ETrue; - tryConnParamLeaveWithNotSupported = ETrue; - - TRAPD(err, temp = iCChHandler->GetConParametersL(ECchUsername)); - - EUNIT_ASSERT_EQUALS( KErrNotSupported, err ); - - if (temp) - { - User::Leave( KErrArgument ); // For alloc failure testing - } - } - - - - -void T_VimpstEngineCchHandler::SetConParametersServiceNotFoundL() - { - - TInt err = iCChHandler->SetConnectionParameter(ECchUsername, KTestUserName); - - EUNIT_ASSERT_EQUALS( KErrNotFound, err ); - - } - -void T_VimpstEngineCchHandler::SetConParametersServiceFoundL() - { - createService = ETrue; - tryConnParamWithSuccess = ETrue; - - TInt err = iCChHandler->SetConnectionParameter(ECchUsername, KTestUserName); - - EUNIT_ASSERT_EQUALS( KErrNone, err ); - - } - - -void T_VimpstEngineCchHandler::SetConParametersLeavesServiceFoundL() - { - createService = ETrue; - tryConnParamLeaveWithNotSupported = ETrue; - - TInt err = iCChHandler->SetConnectionParameter(ECchUsername, KTestUserName); - - EUNIT_ASSERT_EQUALS( KErrNotSupported, err ); - } - - -void T_VimpstEngineCchHandler::ShutdownCch() - { - iCChHandler->ShutdownCch(); - } - -void T_VimpstEngineCchHandler::CheckObservingForPresenceSubServiceL() - { - sendObserverEvent = ETrue; - tryPresenceSubServiceAvailable = ETrue; - - iCallingEnable = ETrue; - iGotObserverEvent = EFalse; - - iCChHandler->RegisterCchObserverL(this, ECCHPresenceSub); - iCChHandler->EnableService(); - iCChHandler->UnRegisterCchObserver(ECCHPresenceSub); - - EUNIT_ASSERT_EQUALS( ETrue, iGotObserverEvent ); - } - -void T_VimpstEngineCchHandler::CheckNoObservingForPrsenceSubServiceL() - { - sendObserverEvent = ETrue; - tryPresenceSubServiceAvailable = ETrue; - - iCallingEnable = ETrue; - iGotObserverEvent = EFalse; - - iCChHandler->RegisterCchObserverL(this, ECCHIMSub); - iCChHandler->EnableService(); - iCChHandler->UnRegisterCchObserver(ECCHIMSub); - - - EUNIT_ASSERT_EQUALS( EFalse, iGotObserverEvent ); - } - -void T_VimpstEngineCchHandler::RegisterObserverWithNull() - { - sendObserverEvent = ETrue; - tryPresenceSubServiceAvailable = ETrue; - - iCallingEnable = ETrue; - iGotObserverEvent = EFalse; - - iCChHandler->RegisterCchObserverL(NULL, ECCHUnknown); - iCChHandler->EnableService(); - iCChHandler->UnRegisterCchObserver(ECCHUnknown); - - - EUNIT_ASSERT_EQUALS( EFalse, iGotObserverEvent ); - } - - -void T_VimpstEngineCchHandler::CchEventOccuredL( - TUint /*aServiceId*/, - TCCHSubserviceState aState, - TInt /*aServiceError*/ ) - { - - if (iCallingEnable) - { - if (ECCHEnabled == aState) - { - iGotObserverEvent = ETrue; - } - } - } - -void T_VimpstEngineCchHandler::CheckObservingWithoutRegisteringL() - { - sendObserverEvent = ETrue; - - iCallingEnable = ETrue; - iGotObserverEvent = EFalse; - - iCChHandler->EnableService(); - - EUNIT_ASSERT_EQUALS( EFalse, iGotObserverEvent ); - } - - - -EUNIT_BEGIN_TEST_TABLE( T_VimpstEngineCchHandler, "T_VimpstEngineCchHandler", "" ) - - EUNIT_TEST("TestConstructionL ", - "T_VimpstEngineCchHandler", - "ConstructL", - "FUNCTIONALITY", - SetupL, TestConstructionL, Teardown ) - EUNIT_TEST("TestGetServiceStateServiceNotFoundL ", - "T_VimpstEngineCchHandler", - "GetServiceState", - "FUNCTIONALITY", - SetupL, TestGetServiceStateServiceNotFoundL, Teardown ) - EUNIT_TEST( "TestGetServiceStateServiceFoundL ", - "T_VimpstEngineCchHandler", - "GetServiceState", - "FUNCTIONALITY", - SetupL, TestGetServiceStateServiceFoundL, Teardown ) - EUNIT_TEST( "TestEnableServiceServiceFoundL ", - "T_VimpstEngineCchHandler", - "EnableService", - "FUNCTIONALITY", - SetupL, TestEnableServiceServiceFoundL, Teardown ) - EUNIT_TEST( "TestEnableServiceServiceNotFoundL ", - "T_VimpstEngineCchHandler", - "EnableService", - "FUNCTIONALITY", - SetupL, TestEnableServiceServiceNotFoundL, Teardown ) - /* EUNIT_TEST( "ValidateServiceServiceNotFoundL ", - "T_VimpstEngineCchHandler", - "ValidateService", - "FUNCTIONALITY", - SetupL, ValidateServiceServiceNotFoundL, Teardown ) - EUNIT_TEST("ValidateServiceAllSubserviceAvailableL ", - "T_VimpstEngineCchHandler", - "ValidateService", - "FUNCTIONALITY", - SetupL, ValidateServiceAllSubserviceAvailableL, Teardown ) - EUNIT_TEST("ValidateServiceAnyOneSubserviceAvailableL ", - "T_VimpstEngineCchHandler", - "ValidateService", - "FUNCTIONALITY", - SetupL, ValidateServiceAnyOneSubserviceAvailableL, Teardown ) - */ - EUNIT_TEST( "GetConParametersServiceNotFoundL ", - "T_VimpstEngineCchHandler", - "GetConParametersL", - "FUNCTIONALITY", - SetupL, GetConParametersServiceNotFoundL, Teardown ) - EUNIT_TEST( "GetConParametersServiceFoundL ", - "T_VimpstEngineCchHandler", - "GetConParametersL", - "FUNCTIONALITY", - SetupL, GetConParametersServiceFoundL, Teardown ) - EUNIT_TEST("GetConParametersLeavesServiceFoundL ", - "T_VimpstEngineCchHandler", - "GetConParametersL", - "FUNCTIONALITY", - SetupL, GetConParametersLeavesServiceFoundL, Teardown ) - EUNIT_TEST( "SetConParametersServiceNotFoundL ", - "T_VimpstEngineCchHandler", - "SetConParametersL", - "FUNCTIONALITY", - SetupL, SetConParametersServiceNotFoundL, Teardown ) - EUNIT_TEST( "SetConParametersServiceFoundL ", - "T_VimpstEngineCchHandler", - "SetConParametersL", - "FUNCTIONALITY", - SetupL, SetConParametersServiceFoundL, Teardown ) - EUNIT_TEST("SetConParametersLeavesServiceFoundL ", - "T_VimpstEngineCchHandler", - "SetConParametersL", - "FUNCTIONALITY", - SetupL, SetConParametersLeavesServiceFoundL, Teardown ) - EUNIT_TEST( "TestDisableServiceServiceFoundL ", - "T_VimpstEngineCchHandler", - "DisableService", - "FUNCTIONALITY", - SetupL, TestDisableServiceServiceFoundL, Teardown ) - EUNIT_TEST( "TestDisableServiceServiceNotFoundL ", - "T_VimpstEngineCchHandler", - "DisableService", - "FUNCTIONALITY", - SetupL, TestDisableServiceServiceNotFoundL, Teardown ) - EUNIT_TEST( "ShutdownCch ", - "T_VimpstEngineCchHandler", - "ShutdownCch", - "FUNCTIONALITY", - SetupL, ShutdownCch, Teardown ) - EUNIT_TEST( "CheckObservingForPresenceSubServiceL ", - "T_VimpstEngineCchHandler", - "CheckObservingForPresenceSubServiceL", - "FUNCTIONALITY", - SetupL1, CheckObservingForPresenceSubServiceL, Teardown ) - EUNIT_TEST( "CheckObservingWithoutRegisteringL ", - "T_VimpstEngineCchHandler", - "CheckObservingWithoutRegisteringL", - "FUNCTIONALITY", - SetupL1, CheckObservingWithoutRegisteringL, Teardown ) - EUNIT_TEST( "RegisterObserverWithNull ", - "T_VimpstEngineCchHandler", - "RegisterObserverWithNull", - "FUNCTIONALITY", - SetupL1, RegisterObserverWithNull, Teardown ) - EUNIT_TEST( "CheckNoObservingForPrsenceSubServiceL ", - "T_VimpstEngineCchHandler", - "CheckNoObservingForPrsenceSubServiceL", - "FUNCTIONALITY", - SetupL1, CheckNoObservingForPrsenceSubServiceL, Teardown ) - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginecontactmgmtextention.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginecontactmgmtextention.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ -/* -* t_vimpstenginecontactmgmtextention.cpp :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: t_vimpstenginecontactmgmtextention.cpp -* -*/ -#include -#include -#include -#include "t_vimpstenginecontactmgmtextention.h" -#include "cvimpstenginecontactmgmtextention.h" - -#include "s_ximpclient.h" -#include "s_ximpcontext.h" -#include "s_presencefeatures.h" -#include "s_presentitygroups.h" -//#include - -#include "cvimpstenginerequestmapper.h" -#include "cvimpstenginerequest.h" - -#include "s_ximprequestcompleteevent.h" - -_LIT(KTestId, "TestId"); -_LIT(KTestIdentity, "TEST_IDENTITY"); - - -extern TXIMPRequestId gTXIMPRequestId; -extern TBool gCreateXIMPIdentity; - -extern TInt32 gMXIMPRequestCompleteEventStubInterfaceId; -extern TXIMPRequestId gMXIMPRequestCompleteEventStubRequestId; -extern TBool gRequestCompleteEventResultCodeKerrNotSupported; - -T_VIMPSTEngineContactMgmtExtention* T_VIMPSTEngineContactMgmtExtention::NewLC() - { - T_VIMPSTEngineContactMgmtExtention* self = new( ELeave ) T_VIMPSTEngineContactMgmtExtention; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VIMPSTEngineContactMgmtExtention::~T_VIMPSTEngineContactMgmtExtention() - { - } - -void T_VIMPSTEngineContactMgmtExtention::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - - -void T_VIMPSTEngineContactMgmtExtention::SetupL() - { - iClient = MXIMPClientStub::NewClientL(); - - //Create new sink to receive ximp context events - iPresenceCtx = iClient->NewPresenceContextLC(); - // ignore code scanner warning, it gives panic - CleanupStack::Pop();// because of LC method - - iFeatures = MyMPresenceFeatureStub::NewStubL(iPresenceCtx); - // - iGroups = &(iFeatures->PresentityGroups()); - - iRequestMapper = CVIMPSTEngineRequestMapper::NewL() ; - - iContactManager = CVIMPSTEngineContactMgmtExtention::NewL( *iPresenceCtx, - *iGroups, - *iRequestMapper ); - - } - -void T_VIMPSTEngineContactMgmtExtention::Teardown() - { - - delete iContactManager; - delete iRequestMapper; - delete iFeatures; - delete iPresenceCtx; - delete iClient; - - //gCreateXIMPIdentity = EFalse; - //gRequestCompleteEventResultCodeKerrNotSupported = EFalse; - } - - -void T_VIMPSTEngineContactMgmtExtention::TestConstructionL() - { - EUNIT_ASSERT( iContactManager ); - } - -void T_VIMPSTEngineContactMgmtExtention::TestCreateIdentityNormalL() - { - gCreateXIMPIdentity = ETrue; - MXIMPIdentity* identity = iContactManager->CreateIdentityLC(KTestId); - EUNIT_ASSERT( identity ); - CleanupStack::PopAndDestroy(); - } - -void T_VIMPSTEngineContactMgmtExtention::TestAddServerContactSuccessValidDataL() - { - gCreateXIMPIdentity = ETrue; - iContactManager->iReqResult = KErrNone; - iContactManager->iSupported = TVIMPSTEnums::ESupported; - - TInt error = iContactManager->AddServerContactL(KTestId(), KTestId(), KTestId()); - - EUNIT_ASSERT(TVIMPSTEnums::ESupported == iContactManager->IsSupported()) - EUNIT_ASSERT( KErrNone == error ); - } - -void T_VIMPSTEngineContactMgmtExtention::TestAddServerContactSuccessWithDataLengthZeroL() - { - gCreateXIMPIdentity = ETrue; - iContactManager->iReqResult = KErrNone; - iContactManager->iSupported = TVIMPSTEnums::ESupported; - TInt error = iContactManager->AddServerContactL(KNullDesC(), KNullDesC(), KNullDesC()); - EUNIT_ASSERT(TVIMPSTEnums::ESupported == iContactManager->IsSupported()) - EUNIT_ASSERT( KErrNone == error ); - } - - - -void T_VIMPSTEngineContactMgmtExtention::TestAddServerContactErrorValidDataL() - { - gCreateXIMPIdentity = ETrue; - iContactManager->iReqResult = KErrNotSupported; - iContactManager->iSupported = TVIMPSTEnums::ENotSupported; - TInt error = iContactManager->AddServerContactL(KTestId(), KTestId(), KTestId()); - - EUNIT_ASSERT(TVIMPSTEnums::ENotSupported == iContactManager->IsSupported()) - EUNIT_ASSERT( KErrNone == error ); - } - - -void T_VIMPSTEngineContactMgmtExtention::TestType() - { - EUNIT_ASSERT(TVIMPSTEnums::EContactManagement == iContactManager->Type()) - } - - -void T_VIMPSTEngineContactMgmtExtention::TestIsSupported() - { - EUNIT_ASSERT(TVIMPSTEnums::ESupportUnKnown == iContactManager->IsSupported()) - } - - -void T_VIMPSTEngineContactMgmtExtention::TestDeleteServerContactSuccessValidDataL() - { - gCreateXIMPIdentity = ETrue; - iContactManager->iReqResult = KErrNone; - iContactManager->iSupported = TVIMPSTEnums::ESupported; - - TInt error = iContactManager->DeleteServerContactL(KTestId(), KTestId()); - - EUNIT_ASSERT(TVIMPSTEnums::ESupported == iContactManager->IsSupported()) - EUNIT_ASSERT( KErrNone == error ); - } - -void T_VIMPSTEngineContactMgmtExtention::TestDeleteServerContactSuccessWithDataLengthZeroL() - { - gCreateXIMPIdentity = ETrue; - iContactManager->iReqResult = KErrNone; - iContactManager->iSupported = TVIMPSTEnums::ESupported; - - TInt error = iContactManager->DeleteServerContactL(KNullDesC(), KNullDesC()); - - EUNIT_ASSERT(TVIMPSTEnums::ESupported == iContactManager->IsSupported()) - EUNIT_ASSERT( KErrNone == error ); - } - - - - - -void T_VIMPSTEngineContactMgmtExtention::TestDeleteServerContactErrorValidDataL() - { - gCreateXIMPIdentity = ETrue; - iContactManager->iReqResult = KErrNotSupported; - iContactManager->iSupported = TVIMPSTEnums::ENotSupported; - TInt error = iContactManager->DeleteServerContactL(KTestId(), KTestId()); - - EUNIT_ASSERT(TVIMPSTEnums::ENotSupported == iContactManager->IsSupported()) - EUNIT_ASSERT( KErrNone == error ); - } - - - -void T_VIMPSTEngineContactMgmtExtention::TestHandleSessionContextEventOperationDeleteErrNoneL() - { - TXIMPRequestId id; - id.Init( 10 ); - - iRequestMapper->CreateRequestL(id, ETrue, EVIMPSTXimpOperationDeleteContact);// waite here - - MXIMPRequestCompleteEventStub requestCompleteEvent; - ::gMXIMPRequestCompleteEventStubInterfaceId = MXIMPRequestCompleteEvent::KInterfaceId; - - ::gMXIMPRequestCompleteEventStubRequestId = id; - - iContactManager->HandleSessionContextEventL - (*iPresenceCtx, requestCompleteEvent, EVIMPSTXimpOperationDeleteContact); - - - CVIMPSTEngineRequest* req1 = iRequestMapper->FindRequestId(id); - EUNIT_ASSERT( NULL == req1 ); - - - EUNIT_ASSERT(KErrNone == iContactManager->iReqResult) - - } - - -void T_VIMPSTEngineContactMgmtExtention::TestHandleSessionContextEventOperationAddErrNoneL() - { - TXIMPRequestId id; - id.Init( 20 ); - - gRequestCompleteEventResultCodeKerrNotSupported = EFalse; - iRequestMapper->CreateRequestL(id, ETrue, EVIMPSTXimpOperationAddContact);// waite here - - MXIMPRequestCompleteEventStub requestCompleteEvent; - ::gMXIMPRequestCompleteEventStubInterfaceId = MXIMPRequestCompleteEvent::KInterfaceId; - - ::gMXIMPRequestCompleteEventStubRequestId = id; - - iContactManager->HandleSessionContextEventL - (*iPresenceCtx, requestCompleteEvent, EVIMPSTXimpOperationAddContact); - - CVIMPSTEngineRequest* req1 = iRequestMapper->FindRequestId(id); - EUNIT_ASSERT( NULL == req1 ); - - TInt res = iContactManager->iReqResult; - EUNIT_ASSERT(KErrNone == iContactManager->iReqResult) - - } - - - void T_VIMPSTEngineContactMgmtExtention::TestHandleSessionContextEventOperationDeleteNotSupportedL() - { - TXIMPRequestId id; - id.Init( 10 ); - - gRequestCompleteEventResultCodeKerrNotSupported = ETrue; - - iRequestMapper->CreateRequestL(id, ETrue, EVIMPSTXimpOperationDeleteContact);// waite here - - MXIMPRequestCompleteEventStub requestCompleteEvent; - ::gMXIMPRequestCompleteEventStubInterfaceId = MXIMPRequestCompleteEvent::KInterfaceId; - - ::gMXIMPRequestCompleteEventStubRequestId = id; - - iContactManager->HandleSessionContextEventL - (*iPresenceCtx, requestCompleteEvent, EVIMPSTXimpOperationDeleteContact); - - - CVIMPSTEngineRequest* req1 = iRequestMapper->FindRequestId(id); - EUNIT_ASSERT( NULL == req1 ); - - EUNIT_ASSERT(KErrNotSupported == iContactManager->iReqResult) - - } - - -void T_VIMPSTEngineContactMgmtExtention::TestHandleSessionContextEventOperationAddNotSupportedL() - { - TXIMPRequestId id; - id.Init( 20 ); - - gRequestCompleteEventResultCodeKerrNotSupported = ETrue; - - iRequestMapper->CreateRequestL(id, ETrue, EVIMPSTXimpOperationAddContact);// waite here - - MXIMPRequestCompleteEventStub requestCompleteEvent; - ::gMXIMPRequestCompleteEventStubInterfaceId = MXIMPRequestCompleteEvent::KInterfaceId; - - ::gMXIMPRequestCompleteEventStubRequestId = id; - - iContactManager->HandleSessionContextEventL - (*iPresenceCtx, requestCompleteEvent, EVIMPSTXimpOperationAddContact); - - CVIMPSTEngineRequest* req1 = iRequestMapper->FindRequestId(id); - EUNIT_ASSERT( NULL == req1 ); - - EUNIT_ASSERT(KErrNotSupported == iContactManager->iReqResult) - - } - - -void T_VIMPSTEngineContactMgmtExtention::TestHandleSessionContextEventOperationNotValidOperationL() - { - TXIMPRequestId id; - id.Init( 20 ); - - iRequestMapper->CreateRequestL(id, ETrue, EVIMPSTXimpOperationAddContact);// waite here - - MXIMPRequestCompleteEventStub requestCompleteEvent; - ::gMXIMPRequestCompleteEventStubInterfaceId = MXIMPRequestCompleteEvent::KInterfaceId; - - ::gMXIMPRequestCompleteEventStubRequestId = id; - - iContactManager->iReqResult = KErrNone; - - iContactManager->HandleSessionContextEventL - (*iPresenceCtx, requestCompleteEvent, EVIMPSTXimpOperationNoOperation); - - CVIMPSTEngineRequest* req1 = iRequestMapper->FindRequestId(id); - EUNIT_ASSERT( req1 ); - - EUNIT_ASSERT(KErrNone == iContactManager->iReqResult) - - } - - - -EUNIT_BEGIN_TEST_TABLE( T_VIMPSTEngineContactMgmtExtention, "T_VIMPSTEngineContactMgmtExtention", "" ) - - EUNIT_TEST( "TestConstructionL ", - "T_VIMPSTEngineContactMgmtExtention", - "ConstructionL", - "FUNCTIONALITY", SetupL, TestConstructionL, Teardown ) - EUNIT_TEST( "TestCreateIdentityNormalL ", - "T_VIMPSTEngineContactMgmtExtention", - "CreateIdentityLC", - "FUNCTIONALITY", SetupL, TestCreateIdentityNormalL, Teardown ) - - EUNIT_TEST( "TestAddServerContactSuccessValidDataL ", - "T_VIMPSTEngineContactMgmtExtention", - "AddServerContactL", - "FUNCTIONALITY", SetupL, TestAddServerContactSuccessValidDataL, Teardown ) - EUNIT_TEST( "TestAddServerContactSuccessWithDataLengthZeroL ", - "T_VIMPSTEngineContactMgmtExtention", - "AddServerContactL", - "FUNCTIONALITY", SetupL, TestAddServerContactSuccessWithDataLengthZeroL, Teardown ) - EUNIT_TEST( "TestAddServerContactErrorValidDataL ", - "T_VIMPSTEngineContactMgmtExtention", - "AddServerContactL", - "FUNCTIONALITY", SetupL, TestAddServerContactErrorValidDataL, Teardown ) - EUNIT_TEST( "TestIsSupported ", - "T_VIMPSTEngineContactMgmtExtention", - "IsSupported", - "FUNCTIONALITY", SetupL, TestIsSupported, Teardown ) - EUNIT_TEST( "TestType ", - "T_VIMPSTEngineContactMgmtExtention", - "Type", - "FUNCTIONALITY", SetupL, TestType, Teardown ) - EUNIT_TEST( "TestDeleteServerContactSuccessValidDataL ", - "T_VIMPSTEngineContactMgmtExtention", - "DeleteServerContactL", - "FUNCTIONALITY", SetupL, TestDeleteServerContactSuccessValidDataL, Teardown ) - EUNIT_TEST( "TestDeleteServerContactSuccessWithDataLengthZeroL ", - "T_VIMPSTEngineContactMgmtExtention", - "DeleteServerContactL", - "FUNCTIONALITY", SetupL, TestDeleteServerContactSuccessWithDataLengthZeroL, Teardown ) - EUNIT_TEST( "TestDeleteServerContactErrorValidDataL ", - "T_VIMPSTEngineContactMgmtExtention", - "DeleteServerContactL", - "FUNCTIONALITY", SetupL, TestDeleteServerContactErrorValidDataL, Teardown ) - - EUNIT_TEST( "TestHandleSessionContextEventOperationDeleteErrNoneL ", - "T_VIMPSTEngineContactMgmtExtention", - "HandleSessionContextEventL", - "FUNCTIONALITY", SetupL, TestHandleSessionContextEventOperationDeleteErrNoneL, Teardown ) - EUNIT_TEST( "TestHandleSessionContextEventOperationDeleteNotSupportedL ", - "T_VIMPSTEngineContactMgmtExtention", - "HandleSessionContextEventL", - "FUNCTIONALITY", SetupL, TestHandleSessionContextEventOperationDeleteNotSupportedL, Teardown ) - EUNIT_TEST("TestHandleSessionContextEventOperationAddErrNoneL ", - "T_VIMPSTEngineContactMgmtExtention", - "HandleSessionContextEventL", - "FUNCTIONALITY", SetupL, TestHandleSessionContextEventOperationAddErrNoneL, Teardown ) - EUNIT_TEST( "TestHandleSessionContextEventOperationAddNotSupportedL ", - "T_VIMPSTEngineContactMgmtExtention", - "HandleSessionContextEventL", - "FUNCTIONALITY",SetupL, TestHandleSessionContextEventOperationAddNotSupportedL, Teardown ) - EUNIT_TEST( "TestHandleSessionContextEventOperationNotValidOperationL ", - "T_VIMPSTEngineContactMgmtExtention", - "HandleSessionContextEventL", - "FUNCTIONALITY", SetupL, TestHandleSessionContextEventOperationNotValidOperationL, Teardown ) - - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstengineimsubservice.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstengineimsubservice.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,795 +0,0 @@ -/* -* t_vimpstengineimsubservice.cpp 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:t_vimpstengineimsubservice.cpp -* -*/ -#include -#include -#include -#include "t_vimpstengineimsubservice.h" - -#include -#include -#include - -#include "cvimpstengineimsubservice.h" -#include "cvimpstenginecchhandler.h" -#include "cvimpstengineservicetablefetcher.h" - -#include "s_cch.h" - -extern MyCchService* myService; -extern TBool createService ; -extern TBool tryConnParamWithSuccess ; -extern TBool gConversationExist; -extern TBool gConversationUnreadCount; - - -const TInt KTestServiceId = 5; - -_LIT( KTestBuddyId,"TEST_BUDDY_ID"); -//_LIT( KTestRequesterId,"TEST_REQUESTER_ID"); - -T_VimpstEngineImSubService* T_VimpstEngineImSubService::NewLC() - { - T_VimpstEngineImSubService* self = new( ELeave ) T_VimpstEngineImSubService; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VimpstEngineImSubService::~T_VimpstEngineImSubService() - { - } - -void T_VimpstEngineImSubService::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - - -// FROM OBSERVER INTERFACES -void T_VimpstEngineImSubService::HandleChatMessageEventL( TVIMPSTEnums::TIMEventType aEventType , - const TDesC& /*aSender*/) - { - iChatMsgReceived = ETrue; - } - -void T_VimpstEngineImSubService::HandleServceConnectionEventL() - { - } - - -void T_VimpstEngineImSubService::SetupL() - { - createService = ETrue; - tryConnParamWithSuccess = ETrue; - iTestServiceId = CreateSpEntryL( KTestServiceId ); - - iCchHandler = CVIMPSTEngineCchHandler::NewL( iTestServiceId ,*iCchUiEventObserver ); - - iServiceTableFetcher = CVIMPSTEngineServiceTableFetcher::NewL(); - - - iImSubService = CVIMPSTEngineIMSubService::NewL( - iTestServiceId, - *iCchHandler, - *iServiceTableFetcher, - *this ); - } - -void T_VimpstEngineImSubService::Teardown() - { - if ( iCchHandler ) - { - delete iCchHandler; - iCchHandler = NULL; - } - if ( iServiceTableFetcher ) - { - delete iServiceTableFetcher; - iServiceTableFetcher = NULL; - } - - if ( iImSubService ) - { - delete iImSubService; - iImSubService = NULL; - } - - if ( myService ) - { - delete myService; - myService = NULL; - } - gConversationExist = EFalse; - gConversationUnreadCount = EFalse; - - } - -TInt T_VimpstEngineImSubService::CreateSpEntryL( TInt aServiceId ) - { - CSPSettings* settings = CSPSettings::NewLC(); - - CSPEntry* entry = CSPEntry::NewLC(); - entry->SetServiceId( aServiceId ); - - CSPEntry* testEntry = CSPEntry::NewLC(); - TInt result = settings->FindEntryL( entry->GetServiceId(), *testEntry ); - - if( result == KErrNone ) - { - settings->UpdateEntryL( *entry ); - } - else - { - settings->AddEntryL( *entry ); - } - - TInt createdServiceId = entry->GetServiceId(); - - CleanupStack::PopAndDestroy( testEntry ); - CleanupStack::PopAndDestroy( entry ); - CleanupStack::PopAndDestroy( settings ); - - return createdServiceId; - } - -void T_VimpstEngineImSubService::T_NewLL() - { - CVIMPSTEngineIMSubService* imSubService = NULL; - imSubService = CVIMPSTEngineIMSubService::NewLC( - iTestServiceId, - *iCchHandler, - *iServiceTableFetcher, - *this); - - EUNIT_ASSERT( imSubService != NULL ); - CleanupStack::PopAndDestroy( imSubService ); - } - -void T_VimpstEngineImSubService::T_RegisterChatObserverL() - { - iImSubService->RegisterChatObserver( this ); - EUNIT_ASSERT( 1 == iImSubService->iChatObserver.Count() ); - } - -void T_VimpstEngineImSubService::T_UnRegisterChatObserverL() - { - iImSubService->RegisterChatObserver( this ); - iImSubService->UnRegisterChatObserver( this ); - EUNIT_ASSERT( 0 == iImSubService->iChatObserver.Count() ); - } - -void T_VimpstEngineImSubService::T_HandleIMCacheEventLL() - { - TInt error( KErrNone ); - - RArray cacheEventTypes; - CleanupClosePushL( cacheEventTypes ); - - // Add all cache events to array - cacheEventTypes.AppendL( EIMCacheRequestCompleted ); - cacheEventTypes.AppendL( EIMCacheNewMessage ); - cacheEventTypes.AppendL( EIMCacheUnreadMessage ); - cacheEventTypes.AppendL( EIMCacheUnreadChange ); - cacheEventTypes.AppendL( EIMCacheChatStarted ); - cacheEventTypes.AppendL( EIMCacheAllChatClosed ); - cacheEventTypes.AppendL( EIMCacheNewChat ); - cacheEventTypes.AppendL( EIMCacheChatClosed ); - - - // go through all cache events with NULL pointer - for ( TInt i( 0 ) ; i < cacheEventTypes.Count() ; i++ ) - { - TRAP( error, iImSubService->HandleIMCacheEventL( - cacheEventTypes[ i ], NULL ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - } - - // go through all cache events with chatData - SIMCacheMessageData chatData = - { - TIMCacheMessageType(0), - }; - - chatData.iBuddyId = HBufC::NewLC( KTestBuddyId().Length() ); - chatData.iBuddyId->Des().Copy( KTestBuddyId ); - - //for add request - /*SIMCacheContactData contactData = {0}; - - contactData.iServiceId = iTestServiceId; - contactData.iRequesterId = HBufC::NewLC( KTestBuddyId().Length() ); - contactData.iRequesterId->Des().Copy( KTestBuddyId ); - */ - for ( TInt i( 0 ) ; i < cacheEventTypes.Count() ; i++ ) - { - - if (cacheEventTypes[ i ] == EIMCacheChatStarted || - cacheEventTypes[ i ] == EIMCacheAllChatClosed) - { - TRAP( error, iImSubService->HandleIMCacheEventL( - cacheEventTypes[ i ]) ); - } - else - { - TRAP( error, iImSubService->HandleIMCacheEventL( - cacheEventTypes[ i ], &chatData ) ); - } - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - } - - // CleanupStack::PopAndDestroy(contactData.iRequesterId); - CleanupStack::PopAndDestroy(chatData.iBuddyId); - - EUNIT_ASSERT( EFalse == iChatMsgReceived ); - - CleanupStack::PopAndDestroy( &cacheEventTypes ); - } - -void T_VimpstEngineImSubService::T_SubServiceStateL() - { - RArray states; - CleanupClosePushL( states ); - states.AppendL( TVIMPSTEnums::ESVCENotRegistered ); - states.AppendL( TVIMPSTEnums::ESVCERegistered ); - states.AppendL( TVIMPSTEnums::ESVCENetworkConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEWaitingForNetwork ); - states.AppendL( TVIMPSTEnums::ESVCENetworkDisConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEUpdatingContacts ); - - for ( TInt i( 0 ) ; i < states.Count() ; i++ ) - { - iImSubService->iServiceState = states[ i ]; - EUNIT_ASSERT( states[ i ] == iImSubService->SubServiceState() ); - } - - CleanupStack::PopAndDestroy( &states ); - } - -void T_VimpstEngineImSubService::T_IsConversationExistLL() - { - gConversationExist = ETrue; - iImSubService->CreateIMCacheAccessorL(); - EUNIT_ASSERT( ETrue == iImSubService->IsConversationExistL(KTestBuddyId()) ); - iImSubService->ReleaseIMCacheAccessor(); - } - - -void T_VimpstEngineImSubService::T_IsConversationDoesntExistLL() - { - iImSubService->CreateIMCacheAccessorL(); - EUNIT_ASSERT( EFalse == iImSubService->IsConversationExistL(KTestBuddyId()) ); - iImSubService->ReleaseIMCacheAccessor(); - } - - - -void T_VimpstEngineImSubService::T_CloseConversationExisitingConversationLL() - { - gConversationExist = ETrue; - iImSubService->CreateIMCacheAccessorL(); - - TRAPD( err, iImSubService->CloseConversationL( KTestBuddyId() ) ); - - EUNIT_ASSERT( KErrNone == err ); - iImSubService->ReleaseIMCacheAccessor(); - } - -void T_VimpstEngineImSubService::T_CloseConversationNonExisitingConversationLL() - { - iImSubService->CreateIMCacheAccessorL(); - TRAPD( err, iImSubService->CloseConversationL( KTestBuddyId() ) ); - - EUNIT_ASSERT( KErrNone == err ); - iImSubService->ReleaseIMCacheAccessor(); - } - -void T_VimpstEngineImSubService::T_IsConversationExistNoIMCacheAccessorL() - { - - iImSubService->ReleaseIMCacheAccessor(); - EUNIT_ASSERT( EFalse == iImSubService->IsConversationExistL(KTestBuddyId()) ); - - } - - -void T_VimpstEngineImSubService::T_CloseConversationNoIMCacheAccessorL() - { - iImSubService->ReleaseIMCacheAccessor(); - - TRAPD( err, iImSubService->CloseConversationL( KTestBuddyId() ) ); - - EUNIT_ASSERT( KErrNone == err ); - } - - -void T_VimpstEngineImSubService::T_GetUnreadCountL() - { - gConversationUnreadCount = ETrue; - iImSubService->CreateIMCacheAccessorL(); - TInt count = -1; - - TRAPD( err, count = iImSubService->GetUnreadCountL( KTestBuddyId() ) ); - - EUNIT_ASSERT( 1 == count ); - - EUNIT_ASSERT( KErrNone == err ); - iImSubService->ReleaseIMCacheAccessor(); - } - - -void T_VimpstEngineImSubService::T_GetUnreadCountNoIMCacheAccessorL() - { - TInt count = -1; - - TRAPD( err, count = iImSubService->GetUnreadCountL( KTestBuddyId() ) ); - - EUNIT_ASSERT( 0 == count ); - - EUNIT_ASSERT( KErrNone == err ); - } - - -void T_VimpstEngineImSubService::T_ResolveServiceStateLL() - { - TInt error( KErrNone ); - - RArray subServiceStates; - CleanupClosePushL( subServiceStates ); - subServiceStates.AppendL( ECCHUninitialized ); - subServiceStates.AppendL( ECCHDisabled ); - subServiceStates.AppendL( ECCHConnecting ); - subServiceStates.AppendL( ECCHEnabled ); - subServiceStates.AppendL( ECCHDisconnecting ); - - // Test with service error: KErrNone and all subservice states. - TInt serviceError( KErrNone ); - - for ( TInt i( 0 ) ; i < subServiceStates.Count() ; i++ ) - { - TRAP( error, iImSubService->ResolveServiceStateL( - subServiceStates[ i ], serviceError ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - - EUNIT_ASSERT( KErrNone == error ); - } - - // Test with service error: KErrNotFound and all subservice states. - serviceError = KErrNotFound; - for ( TInt j( 0 ) ; j < subServiceStates.Count() ; j++ ) - { - TRAP( error, iImSubService->ResolveServiceStateL( - subServiceStates[ j ], serviceError ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - - EUNIT_ASSERT( KErrNone == error ); - } - - CleanupStack::PopAndDestroy( &subServiceStates ); - } - -void T_VimpstEngineImSubService::T_TypeL() - { - EUNIT_ASSERT( TVIMPSTEnums::EIM == iImSubService->Type() ); - } - -void T_VimpstEngineImSubService::T_CchEventOccuredLL() - { - TInt error( KErrNone ); - - RArray subServiceStates; - CleanupClosePushL( subServiceStates ); - subServiceStates.AppendL( ECCHUninitialized ); - subServiceStates.AppendL( ECCHDisabled ); - subServiceStates.AppendL( ECCHConnecting ); - subServiceStates.AppendL( ECCHEnabled ); - subServiceStates.AppendL( ECCHDisconnecting ); - - // Test with service error: KErrNone and all subservice states. - TInt serviceError( KErrNone ); - - for ( TInt i( 0 ) ; i < subServiceStates.Count() ; i++ ) - { - TRAP( error, iImSubService->CchEventOccuredL( - iTestServiceId, subServiceStates[ i ], serviceError ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - - EUNIT_ASSERT( KErrNone == error ); - } - - // Test with service error: KErrNotFound and all subservice states. - serviceError = KErrNotFound; - for ( TInt j( 0 ) ; j < subServiceStates.Count() ; j++ ) - { - TRAP( error, iImSubService->CchEventOccuredL( - iTestServiceId, subServiceStates[ j ], serviceError ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - - EUNIT_ASSERT( KErrNone == error ); - } - - CleanupStack::PopAndDestroy( &subServiceStates ); - } - -void T_VimpstEngineImSubService::T_DoHandleCchErrorLL() - { - RArray serviceErrors; - CleanupClosePushL( serviceErrors ); - - serviceErrors.AppendL( KErrGeneral ); // Tests default case - serviceErrors.AppendL( KCCHErrorBandwidthInsufficient ); - serviceErrors.AppendL( KCCHErrorInvalidIap ); - serviceErrors.AppendL( KCCHErrorAuthenticationFailed ); - serviceErrors.AppendL( KCCHErrorNetworkLost ); - serviceErrors.AppendL( KCCHErrorLoginFailed ); - serviceErrors.AppendL( KCCHErrorServiceNotResponding ); - serviceErrors.AppendL( KCCHErrorInvalidSettings ); - serviceErrors.AppendL( KCCHErrorAccessPointNotDefined ); - - for ( TInt i( 0 ) ; i < serviceErrors.Count() ; i++ ) - { - TRAPD( err, iImSubService->DoHandleCchErrorL( - serviceErrors[ i ] ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } - - CleanupStack::PopAndDestroy( &serviceErrors ); - } - -void T_VimpstEngineImSubService::T_CreateIMCacheAccessorLL() - { - - iImSubService->CreateIMCacheAccessorL(); - EUNIT_ASSERT(iImSubService->iIMCacheFactory); - EUNIT_ASSERT(iImSubService->iIMCacheAccessor) - - } - -void T_VimpstEngineImSubService::T_ReleaseIMCacheAccessorL() - { - iImSubService->CreateIMCacheAccessorL(); - iImSubService->ReleaseIMCacheAccessor(); - - EUNIT_ASSERT(NULL == iImSubService->iIMCacheFactory); - EUNIT_ASSERT(NULL == iImSubService->iIMCacheAccessor); - - } - - -void T_VimpstEngineImSubService::T_RegisterNULLChatObserverL() - { - iImSubService->RegisterChatObserver( NULL ); - EUNIT_ASSERT( 0 == iImSubService->iChatObserver.Count() ); - } - -void T_VimpstEngineImSubService::T_UnRegisterNULLChatObserverL() - { - iImSubService->RegisterChatObserver( NULL ); - iImSubService->UnRegisterChatObserver( NULL ); - EUNIT_ASSERT( 0 == iImSubService->iChatObserver.Count() ); - } - -void T_VimpstEngineImSubService::T_RegisterChatObserverTwiceL() - { - iImSubService->RegisterChatObserver( this ); - iImSubService->RegisterChatObserver( this ); - EUNIT_ASSERT( 1 == iImSubService->iChatObserver.Count() ); - } - -void T_VimpstEngineImSubService::T_UnRegisterChatObserverTwiceL() - { - iImSubService->RegisterChatObserver( this ); - iImSubService->UnRegisterChatObserver( this ); - iImSubService->UnRegisterChatObserver( this ); - EUNIT_ASSERT( 0 == iImSubService->iChatObserver.Count() ); - } - - -void T_VimpstEngineImSubService::T_HandleIMCacheEventWithRegisteredObserverL() - { - TInt error( KErrNone ); - - RArray cacheEventTypes; - CleanupClosePushL( cacheEventTypes ); - - iImSubService->RegisterChatObserver( this ); - - // Add all cache events to array - cacheEventTypes.AppendL( EIMCacheRequestCompleted ); - cacheEventTypes.AppendL( EIMCacheNewMessage ); - cacheEventTypes.AppendL( EIMCacheUnreadMessage ); - cacheEventTypes.AppendL( EIMCacheUnreadChange ); - cacheEventTypes.AppendL( EIMCacheChatStarted ); - cacheEventTypes.AppendL( EIMCacheAllChatClosed ); - cacheEventTypes.AppendL( EIMCacheNewChat ); - cacheEventTypes.AppendL( EIMCacheChatClosed ); - - // go through all cache events with NULL pointer - for ( TInt i( 0 ) ; i < cacheEventTypes.Count() ; i++ ) - { - TRAP( error, iImSubService->HandleIMCacheEventL( - cacheEventTypes[ i ], NULL ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - } - - // go through all cache events with chatData - SIMCacheMessageData chatData = - { - TIMCacheMessageType(0), - }; - - chatData.iBuddyId = HBufC::NewLC( KTestBuddyId().Length() ); - chatData.iBuddyId->Des().Copy( KTestBuddyId ); - - //for add request - /*SIMCacheContactData contactData = {0,}; - - contactData.iServiceId = iTestServiceId; - contactData.iRequesterId = HBufC::NewLC( KTestBuddyId().Length() ); - contactData.iRequesterId->Des().Copy( KTestBuddyId ); - */ - - for ( TInt i( 0 ) ; i < cacheEventTypes.Count() ; i++ ) - { - if (cacheEventTypes[ i ] == EIMCacheChatStarted || - cacheEventTypes[ i ] == EIMCacheAllChatClosed) - { - TRAP( error, iImSubService->HandleIMCacheEventL( - cacheEventTypes[ i ] ) ); - } - else - { - TRAP( error, iImSubService->HandleIMCacheEventL( - cacheEventTypes[ i ], &chatData ) ); - } - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - } - - //CleanupStack::PopAndDestroy(contactData.iRequesterId); - CleanupStack::PopAndDestroy(chatData.iBuddyId); - - iImSubService->UnRegisterChatObserver( this ); - - EUNIT_ASSERT( ETrue == iChatMsgReceived ); - - CleanupStack::PopAndDestroy( &cacheEventTypes ); - } - - -EUNIT_BEGIN_TEST_TABLE( T_VimpstEngineImSubService, "T_VimpstEngineImSubService", "" ) - -EUNIT_TEST( - "NewL - test ", - "T_VimpstEngineImSubService", - "NewL", - "FUNCTIONALITY", - SetupL, T_NewLL, Teardown) - -EUNIT_TEST( - "RegisterChatObserver - test ", - "T_VimpstEngineImSubService", - "RegisterChatObserver", - "FUNCTIONALITY", - SetupL, T_RegisterChatObserverL, Teardown) - -EUNIT_TEST( - "UnRegisterChatObserver - test ", - "T_VimpstEngineImSubService", - "UnRegisterChatObserver", - "FUNCTIONALITY", - SetupL, T_UnRegisterChatObserverL, Teardown) - -EUNIT_TEST( - "HandleIMCacheEventL - without RegisteredObservers ", - "T_VimpstEngineImSubService", - "HandleIMCacheEventL without RegisteredObservers", - "FUNCTIONALITY", - SetupL, T_HandleIMCacheEventLL, Teardown) - -EUNIT_TEST( - "GetUnreadCountL - test ", - "T_VimpstEngineImSubService", - "GetUnreadCountL", - "FUNCTIONALITY", - SetupL, T_GetUnreadCountL, Teardown) - -EUNIT_TEST( - "GetUnreadCountL - IMCacheAccessor Not Created ", - "T_VimpstEngineImSubService", - "GetUnreadCountL - IMCacheAccessor Not Created", - "FUNCTIONALITY", - SetupL, T_GetUnreadCountNoIMCacheAccessorL, Teardown) - - - -EUNIT_TEST( - "SubServiceState - test ", - "T_VimpstEngineImSubService", - "SubServiceState", - "FUNCTIONALITY", - SetupL, T_SubServiceStateL, Teardown) - -EUNIT_TEST( - "IsConversationExistL - test ", - "T_VimpstEngineImSubService", - "IsConversationExistL", - "FUNCTIONALITY", - SetupL, T_IsConversationExistLL, Teardown) - -EUNIT_TEST( - "IsConversationDoesntExistL - test ", - "T_VimpstEngineImSubService", - "T_IsConversationDoesntExistLL", - "FUNCTIONALITY", - SetupL, T_IsConversationDoesntExistLL, Teardown) - - -EUNIT_TEST( - "CloseExisitingConversationL - test ", - "T_VimpstEngineImSubService", - "CloseExisitingConversationL", - "FUNCTIONALITY", - SetupL, T_CloseConversationExisitingConversationLL, Teardown) - -EUNIT_TEST( - "CloseNonExisitingConversationL - test ", - "T_VimpstEngineImSubService", - "CloseNonExisitingConversationL", - "FUNCTIONALITY", - SetupL, T_CloseConversationNonExisitingConversationLL, Teardown) - -EUNIT_TEST( - "IsConversationExistL - IMCacheAccessor Not Created", - "T_VimpstEngineImSubService", - "IsConversationExistL - IMCacheAccessor Not Created", - "FUNCTIONALITY", - SetupL, T_IsConversationExistNoIMCacheAccessorL, Teardown) - - -EUNIT_TEST( - "CloseConversationL - IMCacheAccessor Not Created ", - "T_VimpstEngineImSubService", - "CloseConversationL - - IMCacheAccessor Not Created", - "FUNCTIONALITY", - SetupL, T_CloseConversationNoIMCacheAccessorL, Teardown) - - - -EUNIT_TEST( - "ResolveServiceStateL - test ", - "T_VimpstEngineImSubService", - "ResolveServiceStateL", - "FUNCTIONALITY", - SetupL, T_ResolveServiceStateLL, Teardown) - -EUNIT_TEST( - "Type - test ", - "T_VimpstEngineImSubService", - "Type", - "FUNCTIONALITY", - SetupL, T_TypeL, Teardown) - -EUNIT_TEST( - "CchEventOccuredL - test ", - "T_VimpstEngineImSubService", - "CchEventOccuredL", - "FUNCTIONALITY", - SetupL, T_CchEventOccuredLL, Teardown) - -EUNIT_TEST( - "DoHandleCchErrorL - test ", - "T_VimpstEngineImSubService", - "DoHandleCchErrorL", - "FUNCTIONALITY", - SetupL, T_DoHandleCchErrorLL, Teardown) - -EUNIT_TEST( - "CreateIMCacheAccessorL - test ", - "T_VimpstEngineImSubService", - "CreateIMCacheAccessorL", - "FUNCTIONALITY", - SetupL, T_CreateIMCacheAccessorLL, Teardown) - -EUNIT_TEST( - "ReleaseIMCacheAccessor - test ", - "T_VimpstEngineImSubService", - "ReleaseIMCacheAccessor", - "FUNCTIONALITY", - SetupL, T_ReleaseIMCacheAccessorL, Teardown) - - -EUNIT_TEST( - "RegisterChatObserver - NULL Observer ", - "T_VimpstEngineImSubService", - "RegisterChatObserver - NULL Observer", - "FUNCTIONALITY", - SetupL, T_RegisterNULLChatObserverL, Teardown) - -EUNIT_TEST( - "UnRegisterChatObserver - NULL Observer", - "T_VimpstEngineImSubService", - "UnRegisterChatObserver - NULL Observer", - "FUNCTIONALITY", - SetupL, T_UnRegisterNULLChatObserverL, Teardown) - -EUNIT_TEST( - "RegisterChatObserver - Twice Same Observer", - "T_VimpstEngineImSubService", - "RegisterChatObserver - Twice Same Observer", - "FUNCTIONALITY", - SetupL, T_RegisterChatObserverTwiceL, Teardown) - - -EUNIT_TEST( - "UnRegisterChatObserver - Twice Same Observer", - "T_VimpstEngineImSubService", - "UnRegisterChatObserver - Twice Same Observer", - "FUNCTIONALITY", - SetupL, T_UnRegisterChatObserverTwiceL, Teardown) - - -EUNIT_TEST( - "HandleIMCacheEventL - with RegisteredObserver ", - "T_VimpstEngineImSubService", - "HandleIMCacheEventL with RegisteredObserver", - "FUNCTIONALITY", - SetupL, T_HandleIMCacheEventWithRegisteredObserverL, Teardown) - - - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginepresencesubservice.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginepresencesubservice.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1312 +0,0 @@ -/* -* t_vimpstenginepresencesubservice.cpp ::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:t_vimpstenginepresencesubservice.cpp -* -*/ -#include -#include -#include -#include "t_vimpstenginepresencesubservice.h" - -#include -#include -#include -#include -//#include "vimpstcustomcleanupapi.h" -#include - -#include "s_ximpclient.h" -#include "s_ximpcontext.h" -#include "s_presencefeatures.h" -#include "s_presentitygroups.h" -#include "s_ximprequestcompleteevent.h" -#include "s_ximppresensitypresenceevent.h" -#include "s_ximppresencegrantrequestlistevent.h" -#include "s_ximppresensitygroupcontentevent.h" -#include "s_ximpcontextstateevent.h" -#include "s_ximpidentity.h" -#include "s_presenceinfo.h" -#include "s_presencebuddyinfo2.h" -#include "s_presenceblockinfo.h" - -//#include "s_presencebuddyinfolist.h" - -#include "s_ximppresensitypresenceevent.h" -#include "s_presencesubserviceeventobserver.h" -#include "cvimpstenginepresencesubservice.h" -#include "cvimpstenginecchhandler.h" -#include "cvimpstengineservicetablefetcher.h" -#include "cvimpstenginesessioncntxtobserver.h" -#include "cvimpstblockedlistmanager.h" - -//extern MyCchService* myService; -extern TBool createService; -extern TBool tryPresenceSubServiceAvailable; -extern TBool tryAllSubserviceAvailable; - -extern TInt32 gMXIMPRequestCompleteEventStubInterfaceId; -extern TInt32 gMXIMPContextStateEventStubInterfaceId; -extern TInt32 gMXIMPPresentityPresenceEventStubInterfaceId; -extern TInt32 gMXIMPPresenceGrantRequestListEventStubInterfaceId; -extern TInt32 gMXIMPPresenceBlockInfoStubInterfaceId; -extern TInt32 gMXIMPPresentityGroupEventStubInterfaceId; -extern TBool gRequestCompleteEventResultCodeKerrNotSupported; -extern TXIMPRequestId gMXIMPRequestCompleteEventStubRequestId; -extern TBool gCreateXIMPIdentity; -extern TInt gNewRequestsCountValue; -extern TInt gCurrentRequestsCountValue; -extern TBool gPersonPresenceInfoAvailable; -extern TBool tryConnParamWithSuccess; -extern TBool tryParamTomatchOwnId; -//extern MPresenceInfoStub* gMPresenceInfoStub; -// cache error -extern TInt gAllBuddiesPresenceInServiceError; -const TInt KTestServiceId = 5; - -//_LIT( KTestDb, "contacts.cdb" ); - -//_LIT( KTestContactList, "TEST_CONTACT_LIST" ); -//_LIT( KTestUserId, "TEST_USER_ID" ); -//_LIT( KTestNickName, "TEST_NICKNAME" ); -_LIT( KTestContactId, "TEST_CONTACT_ID" ); -_LIT( KTestStatusText, "TEST_STATUS" ); -//_LIT( KTestPresenceUri, "test@test.com" ); - -//availability status text -_LIT(KBlockedState,"BlockedState"); -//_LIT(KInvisibleState,"InvisibleState"); -//_LIT(KAwayState,"AwayState"); -//_LIT(KOnPhoneState,"OnPhoneState"); -//_LIT(KDndState,"DoNotDisturb"); -//_LIT(KPendingRequestState,"PendingRequestState"); - -//extern RPointerArray gPresenceArry; - - -T_VimpstEnginePresenceSubService* T_VimpstEnginePresenceSubService::NewLC() - { - T_VimpstEnginePresenceSubService* self = new( ELeave ) T_VimpstEnginePresenceSubService; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VimpstEnginePresenceSubService::~T_VimpstEnginePresenceSubService() - { - } - -void T_VimpstEnginePresenceSubService::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - - -// FROM OBSERVER INTERFACES -void T_VimpstEnginePresenceSubService::HandleServceConnectionEventL() - { - } - - -void T_VimpstEnginePresenceSubService::SetupL() - { - createService = ETrue; - tryPresenceSubServiceAvailable = ETrue; - - iTestServiceId = CreateSpEntryL( KTestServiceId ); - - iCchHandler = CVIMPSTEngineCchHandler::NewL( iTestServiceId, *iCchUiEventObserver); - - iServiceTableFetcher = CVIMPSTEngineServiceTableFetcher::NewL(); - - - iSessionCntxtObserver = CVIMPSTEngineSessionCntxtObserver::NewL( iTestServiceId ); - - delete iSessionCntxtObserver->iFeatures; - iSessionCntxtObserver->iFeatures = NULL; - delete iSessionCntxtObserver->iPresenceCtx; - iSessionCntxtObserver->iPresenceCtx = NULL; - delete iSessionCntxtObserver->iClient; - iSessionCntxtObserver->iClient = NULL; - - iSessionCntxtObserver->iClient = MXIMPClientStub::NewClientL(); - iSessionCntxtObserver->iPresenceCtx = - iSessionCntxtObserver->iClient->NewPresenceContextLC(); - CleanupStack::Pop();// because of LC method - iSessionCntxtObserver->iFeatures = MyMPresenceFeatureStub::NewStubL( iSessionCntxtObserver->iPresenceCtx); - - - iPresenceSubService = CVIMPSTEnginePresenceSubService::NewL( - iTestServiceId, - *iCchHandler, - *iServiceTableFetcher, - *iSessionCntxtObserver, - *this ); - } - -void T_VimpstEnginePresenceSubService::Teardown() - { - tryPresenceSubServiceAvailable = EFalse; - // tryAllSubserviceAvailable = EFalse; - createService = EFalse; - - // gCreateXIMPIdentity = EFalse; - // gPersonPresenceInfoAvailable = EFalse; - - if ( iSessionCntxtObserver ) - { - delete iSessionCntxtObserver->iFeatures; - iSessionCntxtObserver->iFeatures = NULL; - - delete iSessionCntxtObserver->iPresenceCtx; - iSessionCntxtObserver->iPresenceCtx = NULL; - - delete iSessionCntxtObserver->iClient; - iSessionCntxtObserver->iClient = NULL; - - delete iSessionCntxtObserver; - iSessionCntxtObserver = NULL; - } - - if ( iPresenceSubService ) - { - delete iPresenceSubService; - iPresenceSubService = NULL; - } - if ( iCchHandler ) - { - delete iCchHandler; - iCchHandler = NULL; - } - if ( iServiceTableFetcher ) - { - delete iServiceTableFetcher; - iServiceTableFetcher = NULL; - } - - /* if ( gMPresenceInfoStub ) - { - delete gMPresenceInfoStub; - gMPresenceInfoStub = NULL; - }*/ - } - -TInt T_VimpstEnginePresenceSubService::CreateSpEntryL( TInt aServiceId ) - { - CSPSettings* settings = CSPSettings::NewLC(); - CSPEntry* entry = CSPEntry::NewLC(); - entry->SetServiceId( aServiceId ); - CSPEntry* testEntry = CSPEntry::NewLC(); - TInt result = settings->FindEntryL( entry->GetServiceId(), *testEntry ); - if( result == KErrNone ) - { - settings->UpdateEntryL( *entry ); - } - else - { - settings->AddEntryL( *entry ); - } - TInt createdServiceId = entry->GetServiceId(); - CleanupStack::PopAndDestroy( testEntry ); - CleanupStack::PopAndDestroy( entry ); - CleanupStack::PopAndDestroy( settings ); - return createdServiceId; - } - -void T_VimpstEnginePresenceSubService::T_NewLL() - { - CVIMPSTEnginePresenceSubService* presenceSubService = NULL; - presenceSubService = CVIMPSTEnginePresenceSubService::NewL( - iTestServiceId, - *iCchHandler, - *iServiceTableFetcher, - *iSessionCntxtObserver, - *this); - - EUNIT_ASSERT( presenceSubService != NULL ); - delete presenceSubService; - presenceSubService = NULL; - } - -void T_VimpstEnginePresenceSubService::T_SubServiceStateL() - { - RArray states; - CleanupClosePushL( states ); - states.AppendL( TVIMPSTEnums::ESVCENotRegistered ); - states.AppendL( TVIMPSTEnums::ESVCERegistered ); - states.AppendL( TVIMPSTEnums::ESVCENetworkConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEWaitingForNetwork ); - states.AppendL( TVIMPSTEnums::ESVCENetworkDisConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEUpdatingContacts ); - for ( TInt i( 0 ) ; i < states.Count() ; i++ ) - { - iPresenceSubService->iServiceState = states[ i ]; - EUNIT_ASSERT( states[ i ] == iPresenceSubService->SubServiceState() ); - } - - CleanupStack::PopAndDestroy( &states ); - } - -void T_VimpstEnginePresenceSubService::T_TypeL() - { - EUNIT_ASSERT( TVIMPSTEnums::EPresence == iPresenceSubService->Type() ); - } - -void T_VimpstEnginePresenceSubService::T_Enabled() - { - // failed - iPresenceSubService->iServiceState = TVIMPSTEnums::ESVCERegistered; - TBool enabled = iPresenceSubService->Enabled(); - EUNIT_ASSERT( enabled == ETrue ); - - iPresenceSubService->iServiceState = TVIMPSTEnums::ESVCENotRegistered; - enabled = iPresenceSubService->Enabled(); - EUNIT_ASSERT( enabled == EFalse ); - } - -void T_VimpstEnginePresenceSubService::T_RetrieveSubscribedListLL() - { - TInt error( KErrNone ); - gCreateXIMPIdentity = EFalse; - TRAP( error, iPresenceSubService->RetrieveSubscribedListL( ) ); - EUNIT_ASSERT( KErrNoMemory == error ); - - gCreateXIMPIdentity = ETrue; - TRAP( error, iPresenceSubService->RetrieveSubscribedListL( ) ); - EUNIT_ASSERT( KErrNone == error ); - } - -void T_VimpstEnginePresenceSubService::T_SubscribePresenceOfSingleContactL() - { - gCreateXIMPIdentity = ETrue; - TRAPD( err, iPresenceSubService->SubscribePresenceOfSingleContactL( KNullDesC ) ); - EUNIT_ASSERT( err == KErrArgument ); - - gCreateXIMPIdentity = ETrue; - TRAP( err, iPresenceSubService->SubscribePresenceOfSingleContactL(KTestContactId ) ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_UnSubscribePresenceOfSingleContactLL() - { - gCreateXIMPIdentity = ETrue; - TRAPD( err, iPresenceSubService->UnSubscribePresenceOfSingleContactL( KTestContactId ) ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_DoHandlePresentityGroupContentEventLL() - { - TInt error( KErrNone ); - MXIMPContext* context = NULL; - MPresentityGroupContentEventStub presentityGroupContentEvent; - TRAP( error, iPresenceSubService->DoHandlePresentityGroupContentEventL( - *context, presentityGroupContentEvent ) ); - EUNIT_ASSERT( KErrNone == error ); - - iPresenceSubService->iServiceState = TVIMPSTEnums::ESVCEUpdatingContacts; - TRAP( error, iPresenceSubService->DoHandlePresentityGroupContentEventL( - *context, presentityGroupContentEvent ) ); - EUNIT_ASSERT( KErrNone == error ); - } - -void T_VimpstEnginePresenceSubService::T_DoHandlePresenceBlockListEventL() - { - TInt error( KErrNone ); - MXIMPContext* context = NULL; - MPresenceBlockInfoStub presenceblockinfo; - - TRAP( error, iPresenceSubService->DoHandlePresenceBlockListEventL( - *context, presenceblockinfo ) ); - - - EUNIT_ASSERT( KErrNone == error ); - - iPresenceSubService->iServiceState = TVIMPSTEnums::ESVCEUpdatingContacts; - TRAP( error, iPresenceSubService->DoHandlePresenceBlockListEventL( - *context, presenceblockinfo ) ); - - - EUNIT_ASSERT( KErrNone == error ); - } - -void T_VimpstEnginePresenceSubService::T_DoHandlePresenceGrantRequestListEventLL() - { - TInt error( KErrNone ); - MXIMPContext* context = NULL; - MPresenceGrantRequestListEventStub presenceGrantRequestListEventStub; - ::gNewRequestsCountValue = 1; - ::gCurrentRequestsCountValue = 1; - - TRAP( error, iPresenceSubService->DoHandlePresenceGrantRequestListEventL( - *context, presenceGrantRequestListEventStub ) ); - ::gNewRequestsCountValue = KErrNone; - ::gCurrentRequestsCountValue = KErrNone; - EUNIT_ASSERT( KErrNone == error ); - } - - -void T_VimpstEnginePresenceSubService::T_ResolveServiceStateLL() - { - TInt error( KErrNotFound ); - RArray subServiceStates; - CleanupClosePushL( subServiceStates ); - subServiceStates.AppendL( ECCHUninitialized ); - subServiceStates.AppendL( ECCHDisabled ); - subServiceStates.AppendL( ECCHConnecting ); - subServiceStates.AppendL( ECCHEnabled ); - subServiceStates.AppendL( ECCHDisconnecting ); - // Test with service error: KErrNone and all subservice states. - TInt serviceError( KErrNone ); - for ( TInt i( 0 ) ; i < subServiceStates.Count() ; i++ ) - { - TRAP( error, iPresenceSubService->ResolveServiceStateL( - subServiceStates[ i ], serviceError ) ); - EUNIT_ASSERT( KErrNone == error ); - } - - // Test with service error: KErrNotFound and all subservice states. - serviceError = KErrNotFound; - TRAP( error, iPresenceSubService->ResolveServiceStateL( - ECCHDisconnecting, serviceError ) ); - EUNIT_ASSERT( KErrNone == error ); - - CleanupStack::PopAndDestroy( &subServiceStates ); - } - -void T_VimpstEnginePresenceSubService::T_CchEventOccuredLL() - { - TInt error( KErrNotFound ); - RArray subServiceStates; - CleanupClosePushL( subServiceStates ); - subServiceStates.AppendL( ECCHUninitialized ); - subServiceStates.AppendL( ECCHDisabled ); - subServiceStates.AppendL( ECCHConnecting ); - subServiceStates.AppendL( ECCHEnabled ); - subServiceStates.AppendL( ECCHDisconnecting ); - // Test with service error: KErrNone and all subservice states. - TInt serviceError( KErrNone ); - for ( TInt i( 0 ) ; i < subServiceStates.Count() ; i++ ) - { - TRAP( error, iPresenceSubService->CchEventOccuredL( - iTestServiceId, subServiceStates[ i ], serviceError ) ); - EUNIT_ASSERT( KErrNone == error ); - } - // Test with service error: KErrNotFound and all subservice states. - serviceError = KErrNotFound; - for ( TInt j( 0 ) ; j < subServiceStates.Count() ; j++ ) - { - TRAP( error, iPresenceSubService->CchEventOccuredL( - iTestServiceId, subServiceStates[ j ], serviceError ) ); - EUNIT_ASSERT( KErrNone == error ); - } - CleanupStack::PopAndDestroy( &subServiceStates ); - EUNIT_ASSERT( KErrNone == error ); - } - -void T_VimpstEnginePresenceSubService::T_DoHandleCchErrorLL() - { - RArray serviceErrors; - CleanupClosePushL( serviceErrors ); - serviceErrors.AppendL( KErrGeneral ); // Tests default case - serviceErrors.AppendL( KCCHErrorBandwidthInsufficient ); - serviceErrors.AppendL( KCCHErrorInvalidIap ); - serviceErrors.AppendL( KCCHErrorAuthenticationFailed ); - serviceErrors.AppendL( KCCHErrorNetworkLost ); - serviceErrors.AppendL( KCCHErrorLoginFailed ); - serviceErrors.AppendL( KCCHErrorServiceNotResponding ); - serviceErrors.AppendL( KCCHErrorInvalidSettings ); - serviceErrors.AppendL( KCCHErrorAccessPointNotDefined ); - for ( TInt i( 0 ) ; i < serviceErrors.Count() ; i++ ) - { - TRAPD( err, iPresenceSubService->DoHandleCchErrorL( - serviceErrors[ i ] ) ); - EUNIT_ASSERT( KErrNone == err ); - } - CleanupStack::PopAndDestroy( &serviceErrors ); - } - - -void T_VimpstEnginePresenceSubService::T_PublishOwnPresenceLL() - { - RArray onlineStatusArray; - CleanupClosePushL( onlineStatusArray ); - onlineStatusArray.AppendL( TVIMPSTEnums::EUnknown ); - // onlineStatusArray.AppendL( TVIMPSTEnums::EOffline ); - // onlineStatusArray.AppendL( TVIMPSTEnums::EOnline ); - // onlineStatusArray.AppendL( TVIMPSTEnums::EInvisible ); - // onlineStatusArray.AppendL( TVIMPSTEnums::EAway ); - // onlineStatusArray.AppendL( TVIMPSTEnums::EBusy ); - for ( TInt i( 0 ); i < onlineStatusArray.Count() ; i++ ) - { - TRAPD( err, iPresenceSubService->PublishOwnPresenceL( - onlineStatusArray[ i ], KTestStatusText ) ); - EUNIT_ASSERT( KErrNone == err ); - } - CleanupStack::PopAndDestroy( &onlineStatusArray ); - } - -void T_VimpstEnginePresenceSubService::T_ConvertPresenceStatus() - { - EUNIT_ASSERT( NPresenceInfo::ENotAvailable == - iPresenceSubService->ConvertPresenceStatus( TVIMPSTEnums::EOffline ) ); - - EUNIT_ASSERT( NPresenceInfo::EAvailable == - iPresenceSubService->ConvertPresenceStatus( TVIMPSTEnums::EOnline ) ); - - EUNIT_ASSERT( NPresenceInfo::EHidden == - iPresenceSubService->ConvertPresenceStatus( TVIMPSTEnums::EInvisible ) ); - - EUNIT_ASSERT( NPresenceInfo::EAway == - iPresenceSubService->ConvertPresenceStatus( TVIMPSTEnums::EAway ) ); - - EUNIT_ASSERT( NPresenceInfo::EBusy == - iPresenceSubService->ConvertPresenceStatus( TVIMPSTEnums::EBusy ) ); - - EUNIT_ASSERT( NPresenceInfo::ENotAvailable == - iPresenceSubService->ConvertPresenceStatus( TVIMPSTEnums::EUnknown ) ); - } -/* -void T_VimpstEnginePresenceSubService::T_FetchPresenceFormCacheL() - { - TInt error = iPresenceSubService->FetchPresenceFormCache(); - EUNIT_ASSERT( KErrNone == error ); - - gAllBuddiesPresenceInServiceError = KErrBadHandle; - error = iPresenceSubService->FetchPresenceFormCache(); - EUNIT_ASSERT( KErrBadHandle == error ); - - delete iPresenceSubService->iServiceName; - iPresenceSubService->iServiceName = NULL; - error = iPresenceSubService->FetchPresenceFormCache(); - EUNIT_ASSERT( KErrArgument == error ); - - } -*/ -void T_VimpstEnginePresenceSubService::T_HandlePresenceReadLL() - { - TInt error( KErrNone ); - TInt testError( KErrGeneral ); - - tryConnParamWithSuccess = ETrue; - - RPointerArray< MPresenceBuddyInfo2> buddyInfoList; - TRAP( error, iPresenceSubService->HandlePresenceReadL( - testError, buddyInfoList ) ); - EUNIT_ASSERT( KErrNone == error ); - - CleanupClosePushL( buddyInfoList ); - MPresenceBuddyInfo2Stub* buddyInfo1 = MPresenceBuddyInfo2Stub::NewStubL(); - CleanupDeletePushL( buddyInfo1 ); - MPresenceBuddyInfo2Stub* buddyInfo2 = MPresenceBuddyInfo2Stub::NewStubL(); - CleanupDeletePushL( buddyInfo2 ); - MPresenceBuddyInfo2Stub* buddyInfo3 = MPresenceBuddyInfo2Stub::NewStubL(); - CleanupDeletePushL( buddyInfo3 ); - - buddyInfoList.AppendL( buddyInfo1 ); - buddyInfoList.AppendL( buddyInfo2 ); - buddyInfoList.AppendL( buddyInfo3 ); - testError = KErrNone; - TRAP( error, iPresenceSubService->HandlePresenceReadL( - testError, buddyInfoList ) ); - EUNIT_ASSERT( KErrNone == error ); - - CleanupStack::Pop(3); //buddyInfo1,2,3 just pop since ownership is tranferred - - tryConnParamWithSuccess = EFalse; - tryParamTomatchOwnId = ETrue; - - testError = KErrNone; - buddyInfo1 = MPresenceBuddyInfo2Stub::NewStubL(); - CleanupDeletePushL( buddyInfo1 ); - buddyInfoList.AppendL( buddyInfo1 ); - - TRAP( error, iPresenceSubService->HandlePresenceReadL( - testError, buddyInfoList ) ); // buddyInfo : ownership transferred - EUNIT_ASSERT( KErrNone == error ); - CleanupStack::Pop(2); //buddyInfoList,buddyInfo1 - } -/* -void T_VimpstEnginePresenceSubService::T_SubscribeToPresenceCacheLL() - { - TRAPD( err, iPresenceSubService->SubscribeToPresenceCacheL( - KTestContactId ) ); - EUNIT_ASSERT( KErrNone == err ); - - TRAP( err, iPresenceSubService->SubscribeToPresenceCacheL( - KNullDesC ) ); - EUNIT_ASSERT( KErrArgument == err ); - - }*/ - - -void T_VimpstEnginePresenceSubService::T_HandlePresenceNotificationLL() - { - tryConnParamWithSuccess = ETrue; - TInt error( KErrNone ); - MPresenceBuddyInfo2Stub* buddyInfo = NULL; - TInt testError( KErrGeneral ); - TRAP( error, iPresenceSubService->HandlePresenceNotificationL( - testError, buddyInfo ) ); - EUNIT_ASSERT( KErrNone == error ); - - testError = KErrNone; - buddyInfo = MPresenceBuddyInfo2Stub::NewStubL(); - TRAP( error, iPresenceSubService->HandlePresenceNotificationL( - testError, buddyInfo ) ); // buddyInfo : ownership transferred - EUNIT_ASSERT( KErrNone == error ); - tryConnParamWithSuccess = EFalse; - tryParamTomatchOwnId = ETrue; - - testError = KErrNone; - buddyInfo = MPresenceBuddyInfo2Stub::NewStubL(); - TRAP( error, iPresenceSubService->HandlePresenceNotificationL( - testError, buddyInfo ) ); // buddyInfo : ownership transferred - EUNIT_ASSERT( KErrNone == error ); - - } - -void T_VimpstEnginePresenceSubService::T_UnSubscribeForAuthorizationLL() - { - TRAPD( err, iPresenceSubService->UnsubscribeListsL() ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_SubscribeForAuthorizationLL() - { - TRAPD( err, iPresenceSubService->SubscribeForAuthorizationL() ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_SendPresenceGrantPresentityLL() - { - gCreateXIMPIdentity = EFalse; - TInt error( KErrNone ); - TRAP( error, iPresenceSubService->SendPresenceGrantPresentityL( - KTestContactId, EFalse ) ); - EUNIT_ASSERT( KErrNoMemory == error ); - - gCreateXIMPIdentity = ETrue; - TRAP( error, iPresenceSubService->SendPresenceGrantPresentityL( - KNullDesC, EFalse ) ); - EUNIT_ASSERT( KErrArgument == error ); - - TRAP( error, iPresenceSubService->SendPresenceGrantPresentityL( - KTestContactId, EFalse ) ); - EUNIT_ASSERT( KErrNone == error ); - - TRAP( error, iPresenceSubService->SendPresenceGrantPresentityL( - KTestContactId, ETrue ) ); - EUNIT_ASSERT( KErrNone == error ); - } - -void T_VimpstEnginePresenceSubService::T_HandleSessionContextEventLL() - { - // failed - gCreateXIMPIdentity = ETrue; - MXIMPContext* context = NULL; - //Test with MXIMPRequestCompleteEvent: HandleXimpRequestCompleteL - MXIMPRequestCompleteEventStub requestCompleteEvent; - ::gMXIMPRequestCompleteEventStubInterfaceId = MXIMPRequestCompleteEvent::KInterfaceId; - TInt error( KErrNone ); - - RArray ximpOperation; - CleanupClosePushL( ximpOperation ); - ximpOperation.AppendL( EVIMPSTXimpOperationNoOperation ); - ximpOperation.AppendL( EVIMPSTXimpOperationBind ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnBind ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetSubscribedList ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetBlockList ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetPresenceGrantList ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetWatcherList ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnsubcribeWatcherList ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnsubcribeGrantRequestList ); - ximpOperation.AppendL( EVIMPSTXimpOperationSubcribeGrantRequestList ); - ximpOperation.AppendL( EVIMPSTXimpOperationWithdrawPresenceGrant ); - ximpOperation.AppendL( EVIMPSTXimpOperationGrantPresenceForPresentity ); - ximpOperation.AppendL( EVIMPSTXimpOperationCancelPresenceBlockFromPresentity ); - ximpOperation.AppendL( EVIMPSTXimpOperationBlockPresenceForPresentity ); - ximpOperation.AppendL( EVIMPSTXimpOperationPublisOwnPresence ); - ximpOperation.AppendL( EVIMPSTXimpOperationSubscribe ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnsubscribe ); - ximpOperation.AppendL( EVIMPSTXimpOperationAddContact ); - ximpOperation.AppendL( EVIMPSTXimpOperationDeleteContact ); - ximpOperation.AppendL( EVIMPSTXimpOperationSearchContact ); - ximpOperation.AppendL( EVIMPSTXimpOperationSubscribeSearchKeys ); - - // Test with error code: KErrNone and all operations. - ::gRequestCompleteEventResultCodeKerrNotSupported = ETrue; - for ( TInt i( 0 ) ; i < ximpOperation.Count() ; i++ ) - { - TRAP( error, iPresenceSubService->HandleSessionContextEventL( - *context, requestCompleteEvent, ximpOperation[ i ] ) ); - EUNIT_ASSERT( KErrNone == error ); - } - - ::gRequestCompleteEventResultCodeKerrNotSupported = EFalse; - for ( TInt j( 0 ) ; j < ximpOperation.Count() ; j++ ) - { - TRAP( error, iPresenceSubService->HandleSessionContextEventL( - *context, requestCompleteEvent, ximpOperation[ j ] ) ); - EUNIT_ASSERT( KErrNone == error ); - } - //Test with MXIMPContextStateEvent - MXIMPContextStateEventStub contextStateEvent; - ::gMXIMPContextStateEventStubInterfaceId = MXIMPContextStateEvent::KInterfaceId; - TRAP( error, iPresenceSubService->HandleSessionContextEventL( - *context, contextStateEvent, ximpOperation[ 0 ] ) ); - EUNIT_ASSERT( KErrNone == error ); - - //Test with MPresentityGroupContentEvent: DoHandlePresentityGroupContentEventL( aContext, aEvent ) - MPresentityGroupContentEventStub presentityGroupContentEvent; - ::gMXIMPPresentityGroupEventStubInterfaceId = - MPresentityGroupContentEvent::KInterfaceId; - TRAP( error, iPresenceSubService->HandleSessionContextEventL( - *context, presentityGroupContentEvent, ximpOperation[ 0 ] ) ); - EUNIT_ASSERT( KErrNone == error ); - - //Test with MPresenceGrantRequestListEvent: DoHandlePresenceGrantRequestListEventL( aContext, aEvent ) - MPresenceGrantRequestListEventStub presenceGrantRequestListEventStub; - ::gMXIMPPresenceGrantRequestListEventStubInterfaceId = - MPresenceGrantRequestListEvent::KInterfaceId; - TRAP( error, iPresenceSubService->HandleSessionContextEventL( - *context, presenceGrantRequestListEventStub, ximpOperation[ 0 ] ) ); - EUNIT_ASSERT( KErrNone == error ); - - CleanupStack::PopAndDestroy( &ximpOperation ); - } - -void T_VimpstEnginePresenceSubService::T_HandleListEventCompleteLL() - { - // failed - gCreateXIMPIdentity = ETrue; - TInt error( KErrNone ); - RArray ximpOperation; - CleanupClosePushL( ximpOperation ); - - ximpOperation.AppendL( EVIMPSTXimpOperationNoOperation ); - ximpOperation.AppendL( EVIMPSTXimpOperationBind ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnBind ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetSubscribedList ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetBlockList ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetPresenceGrantList ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetWatcherList ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnsubcribeWatcherList ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnsubcribeGrantRequestList ); - ximpOperation.AppendL( EVIMPSTXimpOperationSubcribeGrantRequestList ); - ximpOperation.AppendL( EVIMPSTXimpOperationWithdrawPresenceGrant ); - ximpOperation.AppendL( EVIMPSTXimpOperationGrantPresenceForPresentity ); - ximpOperation.AppendL( EVIMPSTXimpOperationCancelPresenceBlockFromPresentity ); - ximpOperation.AppendL( EVIMPSTXimpOperationBlockPresenceForPresentity ); - ximpOperation.AppendL( EVIMPSTXimpOperationPublisOwnPresence ); - ximpOperation.AppendL( EVIMPSTXimpOperationSubscribe ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnsubscribe ); - ximpOperation.AppendL( EVIMPSTXimpOperationAddContact ); - ximpOperation.AppendL( EVIMPSTXimpOperationDeleteContact ); - ximpOperation.AppendL( EVIMPSTXimpOperationSearchContact ); - ximpOperation.AppendL( EVIMPSTXimpOperationSubscribeSearchKeys ); - - MXIMPRequestCompleteEventStub requestCompleteEvent; - // Test with error code: KErrNone and all operations. - TInt errorCode( KErrNone ); - for ( TInt i( 0 ) ; i < ximpOperation.Count() ; i++ ) - { - TRAP( error, iPresenceSubService->HandleListEventCompleteL( - ximpOperation[ i ], errorCode, requestCompleteEvent ) ); - EUNIT_ASSERT( KErrNone == error ); - } - // Test with random error code - errorCode = KErrGeneral; - for ( TInt j( 0 ) ; j < ximpOperation.Count() ; j++ ) - { - TRAP( error, iPresenceSubService->HandleListEventCompleteL( - ximpOperation[ j ], errorCode, requestCompleteEvent ) ); - EUNIT_ASSERT( KErrNone == error ); - } - CleanupStack::PopAndDestroy( &ximpOperation ); - EUNIT_ASSERT( KErrNone == error ); - } - -void T_VimpstEnginePresenceSubService::T_HandleXimpRequestCompleteLL() - { - // failed - gCreateXIMPIdentity = ETrue; - //Test with MXIMPRequestCompleteEvent: HandleXimpRequestCompleteL - MXIMPRequestCompleteEventStub requestCompleteEvent; - ::gMXIMPRequestCompleteEventStubInterfaceId = MXIMPRequestCompleteEvent::KInterfaceId; - TInt error( KErrNone ); - RArray ximpOperation; - CleanupClosePushL( ximpOperation ); - - ximpOperation.AppendL( EVIMPSTXimpOperationNoOperation ); - ximpOperation.AppendL( EVIMPSTXimpOperationBind ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnBind ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetSubscribedList ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetBlockList ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetPresenceGrantList ); - ximpOperation.AppendL( EVIMPSTXimpOperationGetWatcherList ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnsubcribeWatcherList ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnsubcribeGrantRequestList ); - ximpOperation.AppendL( EVIMPSTXimpOperationSubcribeGrantRequestList ); - ximpOperation.AppendL( EVIMPSTXimpOperationWithdrawPresenceGrant ); - ximpOperation.AppendL( EVIMPSTXimpOperationGrantPresenceForPresentity ); - ximpOperation.AppendL( EVIMPSTXimpOperationCancelPresenceBlockFromPresentity ); - ximpOperation.AppendL( EVIMPSTXimpOperationBlockPresenceForPresentity ); - ximpOperation.AppendL( EVIMPSTXimpOperationPublisOwnPresence ); - ximpOperation.AppendL( EVIMPSTXimpOperationSubscribe ); - ximpOperation.AppendL( EVIMPSTXimpOperationUnsubscribe ); - ximpOperation.AppendL( EVIMPSTXimpOperationAddContact ); - ximpOperation.AppendL( EVIMPSTXimpOperationDeleteContact ); - ximpOperation.AppendL( EVIMPSTXimpOperationSearchContact ); - ximpOperation.AppendL( EVIMPSTXimpOperationSubscribeSearchKeys ); - - // Test with error code: KErrNone and all operations. - ::gRequestCompleteEventResultCodeKerrNotSupported = ETrue; - // Test with KErrNone - TInt testError( KErrNone ); - for ( TInt i( 0 ) ; i < ximpOperation.Count() ; i++ ) - { - TRAP( error, iPresenceSubService->HandleXimpRequestCompleteL( - ximpOperation[ i ], testError, requestCompleteEvent ) ); - EUNIT_ASSERT( KErrNone == error ); - } - - // Test with random error code - testError = KErrGeneral; - for ( TInt j( 0 ) ; j < ximpOperation.Count() ; j++ ) - { - TRAP( error, iPresenceSubService->HandleXimpRequestCompleteL( - ximpOperation[ j ], testError, requestCompleteEvent ) ); - EUNIT_ASSERT( KErrNone == error ); - } - CleanupStack::PopAndDestroy( &ximpOperation ); - EUNIT_ASSERT( KErrNone == error ); - } - -void T_VimpstEnginePresenceSubService::T_StoreToVirtualStoreLL() - { - MPresentityGroupContentEventStub presentityGroupContentEvent; - TRAPD( err, iPresenceSubService->StoreToVirtualStoreL( presentityGroupContentEvent ) ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_IsChangeOwnStatusSupportedL() - { - iPresenceSubService->iChangeStatusSupported = EFalse; - TBool supported = - iPresenceSubService->IsChangeOwnStatusSupported(); - EUNIT_ASSERT( EFalse == supported ); - - iPresenceSubService->iChangeStatusSupported = ETrue; - supported = - iPresenceSubService->IsChangeOwnStatusSupported(); - EUNIT_ASSERT( ETrue == supported ); - } - -void T_VimpstEnginePresenceSubService::T_IsStatusMsgSupportedL() - { - iPresenceSubService->iChangeStatusMsgSupported = EFalse; - TBool supported = - iPresenceSubService->IsStatusMsgSupported(); - EUNIT_ASSERT( EFalse == supported ); - - iPresenceSubService->iChangeStatusMsgSupported = ETrue; - supported = - iPresenceSubService->IsStatusMsgSupported(); - EUNIT_ASSERT( ETrue == supported ); - } - -void T_VimpstEnginePresenceSubService::T_ConvertXimpToClientPresenceStatusL() - { - RArray presenceInfo; - // CleanupStack::PushL(&presenceInfo); - CleanupClosePushL( presenceInfo ); - presenceInfo.AppendL( MPresenceBuddyInfo2::EUnknownAvailability ); - presenceInfo.AppendL( MPresenceBuddyInfo2::ENotAvailable ); - presenceInfo.AppendL( MPresenceBuddyInfo2::EBusy ); - presenceInfo.AppendL( MPresenceBuddyInfo2::EAvailable ); - - RPointerArray availabilityTextArray; - // CleanupStack::PushL(&availabilityTextArray); - CleanupClosePushL( availabilityTextArray ); - - availabilityTextArray.Append(KBlockedState().AllocL()); - availabilityTextArray.Append(KInvisibleState().AllocL()); - availabilityTextArray.Append(KAwayState().AllocL()); - availabilityTextArray.Append(KOnPhoneState().AllocL()); - availabilityTextArray.Append(KDndState().AllocL()); - - TInt error( KErrNone ); - for ( TInt i( 0 ) ; i < presenceInfo.Count() ; i++ ) - { - if(MPresenceBuddyInfo2::EBusy == presenceInfo[i]) - { - for(TInt j = 0; j < availabilityTextArray.Count(); j++) - { - TRAP( error, iPresenceSubService->ConvertPresenceCacheEnums( - presenceInfo[ i ], availabilityTextArray[i]->Des())); - } - } - else - { - TRAP( error, iPresenceSubService->ConvertPresenceCacheEnums( - presenceInfo[ i ], KNullDesC())); - } - - EUNIT_ASSERT( KErrNone == error ); - } - //CleanupStack::PopAndDestroy(&availabilityTextArray); - //CleanupStack::PopAndDestroy( &presenceInfo ); - CleanupStack::PopAndDestroy(); - CleanupStack::PopAndDestroy(); - EUNIT_ASSERT( KErrNone == error ); - } -/* -void T_VimpstEnginePresenceSubService::T_RegisterPresenceEventObserverL() - { - MyPresenceSubServiceEventObserverStub* observerNull = NULL ; - TRAPD( error, iPresenceSubService->RegisterPresenceEventObserverL( observerNull ) ); - EUNIT_ASSERT( KErrArgument == error ); - - MyPresenceSubServiceEventObserverStub* observer = MyPresenceSubServiceEventObserverStub::NewL() ; - TRAP( error, iPresenceSubService->RegisterPresenceEventObserverL( observer ) ); - EUNIT_ASSERT( KErrNone == error ); - EUNIT_ASSERT( iPresenceSubService->iObserverArray.Count() == 1 ); - // Try to register same observer again - iPresenceSubService->RegisterPresenceEventObserverL( observer ); - EUNIT_ASSERT( iPresenceSubService->iObserverArray.Count() == 1 ); - delete observer; - } -*/ -/* -void T_VimpstEnginePresenceSubService::T_UnRegisterPresenceEventObserverL() - { - MyPresenceSubServiceEventObserverStub* observerNull = NULL ; - TRAPD( error, iPresenceSubService->RegisterPresenceEventObserverL( observerNull ) ); - EUNIT_ASSERT( KErrArgument == error ); - - MyPresenceSubServiceEventObserverStub* observer = MyPresenceSubServiceEventObserverStub::NewL() ; - TRAP( error, iPresenceSubService->RegisterPresenceEventObserverL( observer ) ); - EUNIT_ASSERT( KErrNone == error ); - TRAP(error, iPresenceSubService->RegisterPresenceEventObserverL( observer ) ); - EUNIT_ASSERT( KErrNone == error ); - - iPresenceSubService->UnRegisterPresenceEventObserver( observer ); - EUNIT_ASSERT( iPresenceSubService->iObserverArray.Count() == 0 ); - - // Try to unregister same observer again - iPresenceSubService->UnRegisterPresenceEventObserver ( observer ); - EUNIT_ASSERT( iPresenceSubService->iObserverArray.Count() == 0 ); - delete observer; - } -*/ -void T_VimpstEnginePresenceSubService::T_AddToBlockListL() - { - _LIT(KDummyUserID,"dummy@domian.com"); - TRAPD( err, iPresenceSubService->AddToBlockListL(KDummyUserID) ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_AddToBlockListL_NoUserid() - { - TRAPD( err, iPresenceSubService->AddToBlockListL(KNullDesC()) ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_AddToBlockListL_NoDomainNameL() - { - _LIT(KDummyUserID,"dummy"); - TRAPD( err, iPresenceSubService->AddToBlockListL(KDummyUserID) ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_RemoveFromBlockListL() - { - _LIT(KDummyUserID,"dummy@domian.com"); - TRAPD( err, iPresenceSubService->RemoveFromBlockListL(KDummyUserID) ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_RemoveFromBlockListMgr() - { - _LIT(KID1,"id1@xyz.com"); - _LIT(KID2,"id2@xyz.com"); - _LIT(KID3,"id3@xyz.com"); - _LIT(KID4,"id4@xyz.com"); - iPresenceSubService->ResetBlockedListManagerL(); - if(iPresenceSubService->iBlockedListMgr) - { - iPresenceSubService->iBlockedListMgr->AddToBlockedListL(KID1); - iPresenceSubService->iBlockedListMgr->AddToBlockedListL(KID2); - iPresenceSubService->iBlockedListMgr->AddToBlockedListL(KID3); - iPresenceSubService->iBlockedListMgr->AddToBlockedListL(KID4); - EUNIT_ASSERT( 4 == iPresenceSubService->iBlockedListMgr->iBlockedList.Count() ); - iPresenceSubService->iBlockedListMgr->RemoveFromBlockListL(KID2); - EUNIT_ASSERT( 3 == iPresenceSubService->iBlockedListMgr->iBlockedList.Count() ); - iPresenceSubService->iBlockedListMgr->RemoveFromBlockListL(KID1); - EUNIT_ASSERT( 2 == iPresenceSubService->iBlockedListMgr->iBlockedList.Count() ); - iPresenceSubService->iBlockedListMgr->RemoveFromBlockListL(KID3); - EUNIT_ASSERT( 1 == iPresenceSubService->iBlockedListMgr->iBlockedList.Count() ); - iPresenceSubService->iBlockedListMgr->RemoveFromBlockListL(KID4); - EUNIT_ASSERT( 0 == iPresenceSubService->iBlockedListMgr->iBlockedList.Count() ); - iPresenceSubService->iBlockedListMgr->RemoveFromBlockListL(KID4); - EUNIT_ASSERT( 0 == iPresenceSubService->iBlockedListMgr->iBlockedList.Count() ); - } - } - -void T_VimpstEnginePresenceSubService::T_FetchBlockedListFromServer() - { - iPresenceSubService->FetchBlockedListFromServerL(NULL); - EUNIT_ASSERT(iPresenceSubService->iBlockListFetchReqPending == ETrue ); - EUNIT_ASSERT(iPresenceSubService->iBlockedListObserver == NULL) - } - -void T_VimpstEnginePresenceSubService::T_RemoveFromBlockList_NoUseridL() - { - TRAPD( err, iPresenceSubService->RemoveFromBlockListL(KNullDesC()) ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_RemoveFromBlockList_NoDomainNameL() - { - _LIT(KDummyUserID,"dummy"); - TRAPD( err, iPresenceSubService->RemoveFromBlockListL(KDummyUserID) ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEnginePresenceSubService::T_GetKeyFiledsAndValuesStatusPendingL() - { - TVIMPSTEnums::TOnlineStatus status = TVIMPSTEnums::EUnknown; - MPresenceBuddyInfo2Stub* buddyInfo1 = MPresenceBuddyInfo2Stub::NewStubL(); - buddyInfo1->SetAnyFieldL(KExtensionKey,KPendingRequestExtensionValue); - //set the setanyfield to pending and get that status - TRAPD( error, iPresenceSubService->GetKeyFieldsAndValuesL(*buddyInfo1,status) ); - EUNIT_ASSERT(TVIMPSTEnums::EPending == status ) ; - - } - -void T_VimpstEnginePresenceSubService::T_GetKeyFiledsAndValuesStatusBlockedL() - { - TVIMPSTEnums::TOnlineStatus status = TVIMPSTEnums::EUnknown; - MPresenceBuddyInfo2Stub* buddyInfo1 = MPresenceBuddyInfo2Stub::NewStubL(); - buddyInfo1->SetAnyFieldL(KExtensionKey,KBlockedExtensionValue); - //set the setanyfield to pending and get that status - TRAPD( error, iPresenceSubService->GetKeyFieldsAndValuesL(*buddyInfo1,status) ); - EUNIT_ASSERT(TVIMPSTEnums::EBlocked == status ) ; - - } - -void T_VimpstEnginePresenceSubService::T_GetKeyFiledsAndValuesStatusUnknownL() - { - TVIMPSTEnums::TOnlineStatus status = TVIMPSTEnums::EUnknown; - MPresenceBuddyInfo2Stub* buddyInfo1 = MPresenceBuddyInfo2Stub::NewStubL(); - //set the setanyfield to pending and get that status - TRAPD( error, iPresenceSubService->GetKeyFieldsAndValuesL(*buddyInfo1,status ) ); - EUNIT_ASSERT(TVIMPSTEnums::EUnknown == status ) ; - - } -EUNIT_BEGIN_TEST_TABLE( T_VimpstEnginePresenceSubService, "T_VimpstEnginePresenceSubService", "" ) - -EUNIT_TEST( - "NewL - test ", - "T_VimpstEnginePresenceSubService", - "NewL", - "FUNCTIONALITY", - SetupL, T_NewLL, Teardown) - -EUNIT_TEST( - "SubServiceStateL - test ", - "T_VimpstEnginePresenceSubService", - "SubServiceStateL", - "FUNCTIONALITY", - SetupL, T_SubServiceStateL, Teardown) - -EUNIT_TEST( - "Type - test ", - "T_VimpstEnginePresenceSubService", - "Type", - "FUNCTIONALITY", - SetupL, T_TypeL, Teardown) - -EUNIT_TEST( - "Enabled - test ", - "T_VimpstEnginePresenceSubService", - "Enabled", - "FUNCTIONALITY", - SetupL, T_Enabled, Teardown) - -EUNIT_TEST( - "RetrieveSubscribedListL - test ", - "T_VimpstEnginePresenceSubService", - "RetrieveSubscribedListL", - "FUNCTIONALITY", - SetupL, T_RetrieveSubscribedListLL, Teardown) - -EUNIT_TEST( - "SubscribePresenceOfSingleContact - test ", - "T_VimpstEnginePresenceSubService", - "SubscribePresenceOfSingleContact", - "FUNCTIONALITY", - SetupL, T_SubscribePresenceOfSingleContactL, Teardown) - -EUNIT_TEST( - "UnSubscribePresenceOfSingleContactL - test ", - "T_VimpstEnginePresenceSubService", - "UnSubscribePresenceOfSingleContactL", - "FUNCTIONALITY", - SetupL, T_UnSubscribePresenceOfSingleContactLL, Teardown) - - -EUNIT_TEST( - "DoHandlePresentityGroupContentEventL - test ", - "T_VimpstEnginePresenceSubService", - "DoHandlePresentityGroupContentEventL", - "FUNCTIONALITY", - SetupL, T_DoHandlePresentityGroupContentEventLL, Teardown) - -EUNIT_TEST( - "DoHandlePresenceGrantRequestListEventL - test ", - "T_VimpstEnginePresenceSubService", - "DoHandlePresenceGrantRequestListEventL", - "FUNCTIONALITY", - SetupL, T_DoHandlePresenceGrantRequestListEventLL, Teardown) - -EUNIT_TEST( - "T_DoHandlePresenceBlockListEventL - test ", - "T_VimpstEnginePresenceSubService", - "T_DoHandlePresenceBlockListEventL", - "FUNCTIONALITY", - SetupL, T_DoHandlePresenceBlockListEventL, Teardown) - - -EUNIT_TEST( - "ResolveServiceStateL - test ", - "T_VimpstEnginePresenceSubService", - "ResolveServiceStateL", - "FUNCTIONALITY", - SetupL, T_ResolveServiceStateLL, Teardown) - -EUNIT_TEST( - "CchEventOccuredL - test ", - "T_VimpstEnginePresenceSubService", - "CchEventOccuredL", - "FUNCTIONALITY", - SetupL, T_CchEventOccuredLL, Teardown) - -EUNIT_TEST( - "DoHandleCchErrorL - test ", - "T_VimpstEnginePresenceSubService", - "DoHandleCchErrorL", - "FUNCTIONALITY", - SetupL, T_DoHandleCchErrorLL, Teardown) - -EUNIT_TEST( - "PublishOwnPresenceL - test ", - "T_VimpstEnginePresenceSubService", - "PublishOwnPresenceL", - "FUNCTIONALITY", - SetupL, T_PublishOwnPresenceLL, Teardown) - -EUNIT_TEST( - "ConvertPresenceStatus - test ", - "T_VimpstEnginePresenceSubService", - "ConvertPresenceStatus", - "FUNCTIONALITY", - SetupL, T_ConvertPresenceStatus, Teardown) -/* -EUNIT_TEST( - "FetchPresenceFormCache - test ", - "T_VimpstEnginePresenceSubService", - "FetchPresenceFormCache", - "FUNCTIONALITY", - SetupL, T_FetchPresenceFormCacheL, Teardown) - */ -EUNIT_TEST( - "HandlePresenceReadL - test ", - "T_VimpstEnginePresenceSubService", - "HandlePresenceReadL", - "FUNCTIONALITY", - SetupL, T_HandlePresenceReadLL, Teardown) -/* -EUNIT_TEST( - "SubscribeToPresenceCacheL - test ", - "T_VimpstEnginePresenceSubService", - "SubscribeToPresenceCacheL", - "FUNCTIONALITY", - SetupL, T_SubscribeToPresenceCacheLL, Teardown) - */ -EUNIT_TEST( - "HandlePresenceNotificationL - test ", - "T_VimpstEnginePresenceSubService", - "HandlePresenceNotificationL", - "FUNCTIONALITY", - SetupL, T_HandlePresenceNotificationLL, Teardown) - -EUNIT_TEST( - "UnSubscribeForAuthorizationL - test ", - "T_VimpstEnginePresenceSubService", - "UnSubscribeForAuthorizationL", - "FUNCTIONALITY", - SetupL, T_UnSubscribeForAuthorizationLL, Teardown) - -EUNIT_TEST( - "SubscribeForAuthorizationL - test ", - "T_VimpstEnginePresenceSubService", - "SubscribeForAuthorizationL", - "FUNCTIONALITY", - SetupL, T_SubscribeForAuthorizationLL, Teardown) - -EUNIT_TEST( - "SendPresenceGrantPresentityL - test ", - "T_VimpstEnginePresenceSubService", - "SendPresenceGrantPresentityL", - "FUNCTIONALITY", - SetupL, T_SendPresenceGrantPresentityLL, Teardown) - -EUNIT_TEST( - "HandleSessionContextEventL - test ", - "T_VimpstEnginePresenceSubService", - "HandleSessionContextEventL", - "FUNCTIONALITY", - SetupL, T_HandleSessionContextEventLL, Teardown) - -EUNIT_TEST( - "HandleListEventCompleteL - test ", - "T_VimpstEnginePresenceSubService", - "HandleListEventCompleteL", - "FUNCTIONALITY", - SetupL, T_HandleListEventCompleteLL, Teardown) - -EUNIT_TEST( - "HandleXimpRequestCompleteL - test ", - "T_VimpstEnginePresenceSubService", - "HandleXimpRequestCompleteL", - "FUNCTIONALITY", - SetupL, T_HandleXimpRequestCompleteLL, Teardown) - -EUNIT_TEST( - "StoreToVirtualStoreL - test ", - "T_VimpstEnginePresenceSubService", - "StoreToVirtualStoreL", - "FUNCTIONALITY", - SetupL, T_StoreToVirtualStoreLL, Teardown) - - -EUNIT_TEST( - "IsChangeOwnStatusSupported - test ", - "T_VimpstEnginePresenceSubService", - "IsChangeOwnStatusSupported", - "FUNCTIONALITY", - SetupL, T_IsChangeOwnStatusSupportedL, Teardown) - -EUNIT_TEST( - "IsStatusMsgSupported - test ", - "T_VimpstEnginePresenceSubService", - "IsStatusMsgSupported", - "FUNCTIONALITY", - SetupL, T_IsStatusMsgSupportedL, Teardown) - - - -EUNIT_TEST( - "ConvertXimpToClientPresenceStatus - test ", - "T_VimpstEnginePresenceSubService", - "ConvertXimpToClientPresenceStatus", - "FUNCTIONALITY", - SetupL, T_ConvertXimpToClientPresenceStatusL, Teardown) -/* -EUNIT_TEST( - "RegisterPresenceEventObserver - test ", - "T_VimpstEnginePresenceSubService", - "RegisterPresenceEventObserver", - "FUNCTIONALITY", - SetupL, T_RegisterPresenceEventObserverL, Teardown) - -EUNIT_TEST( - "UnRegisterPresenceEventObserver - test ", - "T_VimpstEnginePresenceSubService", - "UnRegisterPresenceEventObserver", - "FUNCTIONALITY", - SetupL, T_UnRegisterPresenceEventObserverL, Teardown) -*/ -EUNIT_TEST( - "AddToBlockListL - test ", - "T_VimpstEnginePresenceSubService", - "AddToBlockListL", - "FUNCTIONALITY", - SetupL, T_AddToBlockListL, Teardown) - -EUNIT_TEST( - "AddToBlockListL_nouserid - test ", - "T_VimpstEnginePresenceSubService", - "AddToBlockListL_nouserid", - "FUNCTIONALITY", - SetupL, T_AddToBlockListL_NoUserid, Teardown) -EUNIT_TEST( - "AddToBlockListL_nodomainname - test ", - "T_VimpstEnginePresenceSubService", - "AddToBlockListL_nodomainname", - "FUNCTIONALITY", - SetupL, T_AddToBlockListL_NoDomainNameL, Teardown) -EUNIT_TEST( - "RemoveFromBlockListL - test ", - "T_VimpstEnginePresenceSubService", - "RemoveFromBlockListL", - "FUNCTIONALITY", - SetupL, T_RemoveFromBlockListL, Teardown) - -EUNIT_TEST( - "RemoveFromBlockListL_nouserid - test ", - "T_VimpstEnginePresenceSubService", - "RemoveFromBlockListL_nouserid", - "FUNCTIONALITY", - SetupL, T_RemoveFromBlockList_NoUseridL, Teardown) - -EUNIT_TEST( - "T_RemoveFromBlockListMgr - test ", - "T_RemoveFromBlockListMgr", - "T_RemoveFromBlockListMgr", - "FUNCTIONALITY", - SetupL, T_RemoveFromBlockListMgr, Teardown) - -EUNIT_TEST( - "T_GetKeyFiledsAndValuesStatusPendingL - test ", - "T_GetKeyFiledsAndValuesStatusPendingL", - "T_GetKeyFiledsAndValuesStatusPendingL", - "FUNCTIONALITY", - SetupL, T_GetKeyFiledsAndValuesStatusPendingL, Teardown) - -EUNIT_TEST( - "T_GetKeyFiledsAndValuesStatusBlockedL - test ", - "T_GetKeyFiledsAndValuesStatusBlockedL", - "T_GetKeyFiledsAndValuesStatusBlockedL", - "FUNCTIONALITY", - SetupL, T_GetKeyFiledsAndValuesStatusBlockedL, Teardown) - -EUNIT_TEST( - "T_GetKeyFiledsAndValuesStatusUnknownL - test ", - "T_GetKeyFiledsAndValuesStatusUnknownL", - "T_GetKeyFiledsAndValuesStatusUnknownL", - "FUNCTIONALITY", - SetupL, T_GetKeyFiledsAndValuesStatusUnknownL, Teardown) - -EUNIT_TEST( - "T_FetchBlockedListFromServer - test ", - "T_FetchBlockedListFromServer", - "T_FetchBlockedListFromServer", - "FUNCTIONALITY", - SetupL, T_FetchBlockedListFromServer, Teardown) - - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginerequest.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginerequest.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* t_vimpstenginerequest.cpp :: 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:t_vimpstenginerequest.cpp -* -*/ -#include -#include -#include -#include "t_vimpstenginerequest.h" -#include "cvimpstenginerequest.h" - - -TXIMPRequestId gTXIMPRequestId; - -T_VIMPSTEngineRequest* T_VIMPSTEngineRequest::NewLC() - { - T_VIMPSTEngineRequest* self = new( ELeave ) T_VIMPSTEngineRequest; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VIMPSTEngineRequest::~T_VIMPSTEngineRequest() - { - } - -void T_VIMPSTEngineRequest::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - - -void T_VIMPSTEngineRequest::SetupL() - { - gTXIMPRequestId.Init(100); - iRequest = CVIMPSTEngineRequest::NewL(gTXIMPRequestId, - EVIMPSTXimpOperationBind) ; - } - -void T_VIMPSTEngineRequest::Teardown() - { - delete iRequest; - } - - -void T_VIMPSTEngineRequest::TestAllFunctionsL() - { - - //Do all the functions here.. - EUNIT_ASSERT( EVIMPSTXimpOperationBind == iRequest->RequestType() ); - - EUNIT_ASSERT( gTXIMPRequestId == iRequest->GetRequestId() ); - - - iRequest->SetRequestType(EVIMPSTXimpOperationUnBind); - EUNIT_ASSERT( EVIMPSTXimpOperationUnBind == iRequest->RequestType() ); - - - iRequest->StopWait(); - TBool temp = iRequest->IsWaitStarted(); - EUNIT_ASSERT( EFalse == temp ); - iRequest->StopWait(); - - iRequest->StartWait(); - temp = iRequest->IsWaitStarted(); - EUNIT_ASSERT( EFalse == temp ); - - - - } - - -EUNIT_BEGIN_TEST_TABLE( T_VIMPSTEngineRequest, "T_VIMPSTEngineRequest", "" ) - - EUNIT_TEST( "", "", "", "", SetupL, TestAllFunctionsL, Teardown ) - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginerequestmapper.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginerequestmapper.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ -/* -* t_vimpstenginerequestmapper.cpp :: 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: t_vimpstenginerequestmapper.cpp -* -*/ -#include -#include -#include -#include "t_vimpstenginerequestmapper.h" -#include "cvimpstenginerequestmapper.h" -#include "cvimpstenginerequest.h" - -extern TXIMPRequestId gTXIMPRequestId; - -T_VIMPSTEngineRequestMapper* T_VIMPSTEngineRequestMapper::NewLC() - { - T_VIMPSTEngineRequestMapper* self = new( ELeave ) T_VIMPSTEngineRequestMapper; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VIMPSTEngineRequestMapper::~T_VIMPSTEngineRequestMapper() - { - } - -void T_VIMPSTEngineRequestMapper::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - - -void T_VIMPSTEngineRequestMapper::SetupL() - { - iRequestMapper = CVIMPSTEngineRequestMapper::NewL() ; - } - -void T_VIMPSTEngineRequestMapper::Teardown() - { - delete iRequestMapper; - } - - -void T_VIMPSTEngineRequestMapper::TestAllFunctionsL() - { - - //Do all the functions here.. - gTXIMPRequestId.Init(1000); - - CVIMPSTEngineRequest* req1 = iRequestMapper->FindRequestId(gTXIMPRequestId); - EUNIT_ASSERT(NULL == req1); - req1 = NULL; - - // remove the request mapper - iRequestMapper->RemoveRequestId(gTXIMPRequestId); - - - CVIMPSTEngineRequest* req3 = iRequestMapper->CreateRequestL(gTXIMPRequestId, - ETrue, - EVIMPSTXimpOperationBind) ; - EUNIT_ASSERT(req3); - EUNIT_ASSERT(EVIMPSTXimpOperationBind == req3->RequestType()); - req3 = NULL; - - iRequestMapper->RemoveRequestId(gTXIMPRequestId) ; - - gTXIMPRequestId.Init(2000); - CVIMPSTEngineRequest* req5 = iRequestMapper->CreateRequestL(gTXIMPRequestId, - EFalse, - EVIMPSTXimpOperationUnBind) ; - EUNIT_ASSERT(req5); - EUNIT_ASSERT(EVIMPSTXimpOperationUnBind == req5->RequestType()); - req5 = NULL; - - CVIMPSTEngineRequest* req7 = iRequestMapper->FindRequestId(gTXIMPRequestId); - EUNIT_ASSERT(req7); - EUNIT_ASSERT(EVIMPSTXimpOperationUnBind == req7->RequestType()); - req7 = NULL; - - iRequestMapper->RemoveRequestId(gTXIMPRequestId) ; - } - - -EUNIT_BEGIN_TEST_TABLE( T_VIMPSTEngineRequestMapper, "T_VIMPSTEngineRequestMapper", "" ) - - EUNIT_TEST( "TestAllFunctionsL ", - "T_VIMPSTEngineRequestMapper", - "TestAllFunctionsL", - "FUNCTIONALITY", SetupL, TestAllFunctionsL, Teardown ) - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginesearchmgrextention.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginesearchmgrextention.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,192 +0,0 @@ -/* -* t_vimpstenginesearchmgrextention.cpp :: 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:t_vimpstenginesearchmgrextention.cpp -* -*/ -#include -#include -#include - -#include "T_vimpstenginesearchmgrextention.h" - -#include "s_presencefeatures.h" -#include "s_presentitygroups.h" -#include "s_ximpclient.h" -#include "s_ximpcontext.h" -#include "s_ximprequestcompleteevent.h" -#include "s_ximpobjectfactory.h" - -#include "cvimpstenginerequestmapper.h" -#include "cvimpstenginesearchmgrextention.h" -#include "cvimpstenginerequest.h" - - -/* - * To be tested: - * - SearchContactsL - * - SubscribeForSearchKeysL - * - IsSupported - * - Type - * - HandleSessionContextEventL - */ - - -extern TXIMPRequestId gTXIMPRequestId; - -T_VIMPSTEngineSearchMgrExtention* T_VIMPSTEngineSearchMgrExtention::NewLC() - { - T_VIMPSTEngineSearchMgrExtention* self = new( ELeave ) T_VIMPSTEngineSearchMgrExtention; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VIMPSTEngineSearchMgrExtention::~T_VIMPSTEngineSearchMgrExtention() - { - } - -void T_VIMPSTEngineSearchMgrExtention::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - - -void T_VIMPSTEngineSearchMgrExtention::SetupL() - { - iClient = MXIMPClientStub::NewClientL(); - - //Create new sink to receive ximp context events - iPresenceCtx = iClient->NewPresenceContextLC(); - // ignore code scanner warning, it gives panic - CleanupStack::Pop();// because of LC method - - iFeatures = MyMPresenceFeatureStub::NewStubL(iPresenceCtx); - - iRequestMapper = CVIMPSTEngineRequestMapper::NewL() ; - - iSearcMgrExtention = CVIMPSTEngineSearchMgrExtention::NewL( *iPresenceCtx, - *iRequestMapper ); - } - -void T_VIMPSTEngineSearchMgrExtention::Teardown() - { - delete iSearcMgrExtention; - delete iRequestMapper; - delete iFeatures; - delete iPresenceCtx; - delete iClient; - } - -// From MVIMPSTEngineSearchExtentionEventObserver -void HandleSearchResultL(RArray aSerachData) - { - - } -void HandleSearchFinishedL(TInt /*aError*/) - { - - } -void HandleSearchKeysEventL( RArray& /*aEnumKeysArray*/, RPointerArray& /*aLebelKeysArray*/ ) - { - - } - -// T_VIMPSTEngineSearchMgrExtention::TestSearchContactsL -// TODO: All test cases... -void T_VIMPSTEngineSearchMgrExtention::TestSearchContactsL() - { - TInt error = KErrNone; - iSearcMgrExtention->RegisterObserver( this ); - - - RArray aKeyDataArray; - TVIMPSTSearchKeyData data = - { - TVIMPSTEnums::EVIMPSTFirstName, - KNullDesC, - KNullDesC - }; - aKeyDataArray.Append(data); - - error = iSearcMgrExtention->SearchContactsL( aKeyDataArray ); - EUNIT_ASSERT( error == KErrNone ); - - iSearcMgrExtention->UnRegisterObserver( this ); - } - -// T_VIMPSTEngineSearchMgrExtention::TestSubscribeForSearchKeysL -// TODO: All test cases... -void T_VIMPSTEngineSearchMgrExtention::TestSubscribeForSearchKeysL() - { - //MXIMPBase* event = NULL; - } - -// T_VIMPSTEngineSearchMgrExtention::TestIsSupported -// TODO: All test cases... -void T_VIMPSTEngineSearchMgrExtention::TestIsSupported() - { - - } - -// T_VIMPSTEngineSearchMgrExtention::TestType -// TODO: All test cases... -void T_VIMPSTEngineSearchMgrExtention::TestType() - { - - } - -// T_VIMPSTEngineSearchMgrExtention::TestHandleSessionContextEventL -// TODO: All test cases... -void T_VIMPSTEngineSearchMgrExtention::TestHandleSessionContextEventL() - { - - } - -// T_VIMPSTEngineSearchMgrExtention::TestAllFunctionsL -// TODO: Remove this functio... -void T_VIMPSTEngineSearchMgrExtention::TestAllFunctionsL() - { - - //Do all the functions here.. - /*EUNIT_ASSERT( EVIMPSTXimpOperationBind == iRequest->RequestType() ); - - EUNIT_ASSERT( gTXIMPRequestId == iRequest->GetRequestId() ); - - - iRequest->SetRequestType(EVIMPSTXimpOperationUnBind); - EUNIT_ASSERT( EVIMPSTXimpOperationUnBind == iRequest->RequestType() ); - - iRequest->StartWait(); - EUNIT_ASSERT( ETrue == iRequest->IsWaitStarted() ); - iRequest->StartWait(); - - iRequest->StopWait(); - EUNIT_ASSERT( EFalse == iRequest->IsWaitStarted() ); - iRequest->StopWait();*/ - - - } - - -EUNIT_BEGIN_TEST_TABLE( T_VIMPSTEngineSearchMgrExtention, "T_VIMPSTEngineSearchMgrExtention", "" ) - - EUNIT_TEST( "", "", "", "", SetupL, TestSearchContactsL, Teardown ) - EUNIT_TEST( "", "", "", "", SetupL, TestSubscribeForSearchKeysL, Teardown ) - EUNIT_TEST( "", "", "", "", SetupL, TestIsSupported, Teardown ) - EUNIT_TEST( "", "", "", "", SetupL, TestType, Teardown ) - EUNIT_TEST( "", "", "", "", SetupL, TestHandleSessionContextEventL, Teardown ) - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstengineservicetablefetcher.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstengineservicetablefetcher.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,643 +0,0 @@ -/* -* t_vimpstengineservicetablefetcher.cpp 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: t_vimpstengineservicetablefetcher.cpp -* -*/ -#include -#include -#include -#include "t_vimpstengineservicetablefetcher.h" - -#include "cvimpstengineservicetablefetcher.h" -#include "vimpstextentionuiuid.h" - -#include -#include -#include - -#include "s_cch.h" - -#include "tvimpstenums.h" - -extern TBool createService ; -extern TBool tryPresenceSubServiceAvailable ; -extern MyCchService* myService; - -_LIT( KDbName, "contacts.cdb"); -_LIT( KDbNameURI, "cntdb://c:contacts.cdb"); -_LIT( KServiceName, "TestService"); - - -T_VIMPSTEngineServiceTableFetcher* T_VIMPSTEngineServiceTableFetcher::NewLC() - { - T_VIMPSTEngineServiceTableFetcher* self = new( ELeave ) T_VIMPSTEngineServiceTableFetcher; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VIMPSTEngineServiceTableFetcher::~T_VIMPSTEngineServiceTableFetcher() - { - } - -void T_VIMPSTEngineServiceTableFetcher::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - -void T_VIMPSTEngineServiceTableFetcher::SetupL() - { - iServiceTableFetcher = CVIMPSTEngineServiceTableFetcher::NewL(); - iSpSettings = CSPSettings::NewL(); - } - -void T_VIMPSTEngineServiceTableFetcher::Setup1L() - { - } - -void T_VIMPSTEngineServiceTableFetcher::Teardown() - { - delete myService; - myService = NULL; - createService = EFalse; - tryPresenceSubServiceAvailable = EFalse; - - delete iServiceTableFetcher; - //delete iSpSettings; only 1 instance of SPSettings is created this will be deleted by iServiceTableFetcher - } - - -void T_VIMPSTEngineServiceTableFetcher::TestConstructionL() - { - - EUNIT_ASSERT( iServiceTableFetcher ); - - } - - -void T_VIMPSTEngineServiceTableFetcher::TestConstructionWithValidServicesL() - { - - iSpSettings = CSPSettings::NewL(); - - createService = ETrue; - tryPresenceSubServiceAvailable = ETrue; //atleast 1 subservice is valid - - CreateSpEntryL( 1, EPropertyContactViewPluginId, KIMCONTACTSEXTNIMPLEMENTATIONUID ); - - iServiceTableFetcher = CVIMPSTEngineServiceTableFetcher::NewL(); - - EUNIT_ASSERT( iServiceTableFetcher ); - - } - - -void T_VIMPSTEngineServiceTableFetcher::TestConstructionWithInValidServicesL() - { - - iSpSettings = CSPSettings::NewL(); - - CreateSpEntryL( 1, EPropertyContactViewPluginId, KIMCONTACTSEXTNIMPLEMENTATIONUID ); - - iServiceTableFetcher = CVIMPSTEngineServiceTableFetcher::NewL(); - - EUNIT_ASSERT( iServiceTableFetcher ); - - } - - - -void T_VIMPSTEngineServiceTableFetcher::GetMasterServiceIdsNoServicesL() - { - RArray services; - - iServiceTableFetcher->GetMasterServiceIdsL(services); - - EUNIT_ASSERT_EQUALS( 0, services.Count() ); - - services.Close(); - } - - -void T_VIMPSTEngineServiceTableFetcher::GetMasterServiceIdsServicesMatchContactViewUidInValidServiceL() - { - RArray services; - - CreateSpEntryL( 1, EPropertyContactViewPluginId, KIMCONTACTSEXTNIMPLEMENTATIONUID ); - - iServiceTableFetcher->GetMasterServiceIdsL(services); - - EUNIT_ASSERT_EQUALS( 1, services.Count() ); - - services.Close(); - } - -void T_VIMPSTEngineServiceTableFetcher::GetMasterServiceIdsServicesMatchContactViewUidValidServiceL() - { - RArray services; - - createService = ETrue; - tryPresenceSubServiceAvailable = ETrue; //atleast 1 subservice is valid - - CreateSpEntryL( 1, EPropertyContactViewPluginId, KIMCONTACTSEXTNIMPLEMENTATIONUID ); - - iServiceTableFetcher->GetMasterServiceIdsL(services); - - EUNIT_ASSERT_EQUALS( 1, services.Count() ); - - services.Close(); - } - - -void T_VIMPSTEngineServiceTableFetcher::GetMasterServiceIdsServicesNoMatchContactViewUidL() - { - RArray services; - - CreateSpEntryL( 1, EPropertyContactViewPluginId, 0x20010000 ); - - iServiceTableFetcher->GetMasterServiceIdsL(services); - - EUNIT_ASSERT_EQUALS( 0, services.Count() ); - - services.Close(); - } - -void T_VIMPSTEngineServiceTableFetcher::CreateSpEntryL( TInt aServiceId, - TServicePropertyName aName, - TInt aValue ) - { - CSPProperty* property = CSPProperty::NewL(); - CleanupStack::PushL( property ); - property->SetName( aName ); - property->SetValue( aValue ); - - CSPEntry* entry = CSPEntry::NewL(); - CleanupStack::PushL( entry ); - entry->SetServiceId( aServiceId ); - entry->SetServiceName(KServiceName() ); - - entry->AddPropertyL( *property ); - - CSPEntry* testEntry = CSPEntry::NewLC(); - TInt result = iSpSettings->FindEntryL( entry->GetServiceId(), *testEntry ); - if( result == KErrNone ) - { - iSpSettings->UpdateEntryL( *entry ); - } - else - { - iSpSettings->AddEntryL( *entry ); - } - CleanupStack::PopAndDestroy( 3 ); - } - -void T_VIMPSTEngineServiceTableFetcher::CreateSpEntry1L( TInt aServiceId, - TServicePropertyName aName, - const TDesC& aValue ) - { - CSPProperty* property = CSPProperty::NewL(); - CleanupStack::PushL( property ); - property->SetName( aName ); - property->SetValue( aValue ); - - CSPEntry* entry = CSPEntry::NewL(); - CleanupStack::PushL( entry ); - entry->SetServiceId( aServiceId ); - entry->SetServiceName(KServiceName() ); - - entry->AddPropertyL( *property ); - - CSPEntry* testEntry = CSPEntry::NewLC(); - TInt result = iSpSettings->FindEntryL( entry->GetServiceId(), *testEntry ); - if( result == KErrNone ) - { - iSpSettings->UpdateEntryL( *entry ); - } - else - { - iSpSettings->AddEntryL( *entry ); - } - CleanupStack::PopAndDestroy( 3 ); - - } - - -void T_VIMPSTEngineServiceTableFetcher::CreateSpEntry1L( TInt aServiceId, - TServicePropertyName aName, - TOnOff aValue ) - { - CSPProperty* property = CSPProperty::NewL(); - CleanupStack::PushL( property ); - property->SetName( aName ); - property->SetValue( aValue ); - - CSPEntry* entry = CSPEntry::NewL(); - CleanupStack::PushL( entry ); - entry->SetServiceId( aServiceId ); - entry->SetServiceName(KServiceName() ); - - entry->AddPropertyL( *property ); - - CSPEntry* testEntry = CSPEntry::NewLC(); - TInt result = iSpSettings->FindEntryL( entry->GetServiceId(), *testEntry ); - if( result == KErrNone ) - { - iSpSettings->UpdateEntryL( *entry ); - } - else - { - iSpSettings->AddEntryL( *entry ); - } - CleanupStack::PopAndDestroy( 3 ); - - } - - -void T_VIMPSTEngineServiceTableFetcher::GetContactStoreIdPropertyNotFoundL() - { - - HBufC* contactStoreId = HBufC::NewL(500); - CleanupStack::PushL(contactStoreId); - - TPtr storeNamePtr = contactStoreId->Des(); - - iServiceTableFetcher->GetContactStoreIdL(1, storeNamePtr); - - EUNIT_ASSERT_EQUALS( 0, storeNamePtr.Length() ); - - CleanupStack::PopAndDestroy( contactStoreId ); - - } - - -void T_VIMPSTEngineServiceTableFetcher::GetContactStoreIdPropertyFoundL() - { - - HBufC* contactStoreId = HBufC::NewL(500); - CleanupStack::PushL(contactStoreId); - //contactStoreId->Des().Copy(_L("1_contacts.cdb")); - - TPtr storeNamePtr = contactStoreId->Des(); - - CreateSpEntry1L( 1, EPropertyContactStoreId, KDbName() ); - - iServiceTableFetcher->GetContactStoreIdL(1, storeNamePtr); - - if (storeNamePtr.Compare(KDbName)) - { - User::Leave( KErrArgument ); - } - - CleanupStack::PopAndDestroy( contactStoreId ); - - } - -void T_VIMPSTEngineServiceTableFetcher::GetContactStoreIdPropertyFoundWithContactUriDomainL() - { - - HBufC* contactStoreId = HBufC::NewL(500); - CleanupStack::PushL(contactStoreId); - - TPtr storeNamePtr = contactStoreId->Des(); - - CreateSpEntry1L( 1, EPropertyContactStoreId, KDbNameURI() ); - - iServiceTableFetcher->GetContactStoreIdL(1, storeNamePtr); - - if (storeNamePtr.Compare(KDbNameURI)) - { - User::Leave( KErrArgument ); - } - - CleanupStack::PopAndDestroy( contactStoreId ); - - } - - -void T_VIMPSTEngineServiceTableFetcher::GetBrandIdLPropertyNotFoundL() - { - - HBufC8* brandId = HBufC8::NewL(500); - CleanupStack::PushL(brandId); - - TPtr8 brandIdPtr = brandId->Des(); - - iServiceTableFetcher->GetBrandIdL(1, brandIdPtr); - - EUNIT_ASSERT_EQUALS( 0, brandIdPtr.Length() ); - - CleanupStack::PopAndDestroy( brandId ); - - } - - -void T_VIMPSTEngineServiceTableFetcher::GetBrandIdLPropertyFoundL() - { - - HBufC8* brandId = HBufC8::NewL(500); - CleanupStack::PushL(brandId); - - TPtr8 brandIdPtr = brandId->Des(); - - CreateSpEntry1L( 1, EPropertyBrandId, _L("MyBrand") ); - - iServiceTableFetcher->GetBrandIdL(1, brandIdPtr); - - if (brandIdPtr.Compare(_L8("MyBrand"))) - { - User::Leave( KErrArgument ); - } - - CleanupStack::PopAndDestroy( brandId ); - - } - - - -void T_VIMPSTEngineServiceTableFetcher::FindPropertyNotFoundL() - { - TInt err = iServiceTableFetcher->FindPropertyL(1, EPropertyContactViewPluginId); - - EUNIT_ASSERT_EQUALS( KErrNotFound, err ); - - } - -void T_VIMPSTEngineServiceTableFetcher::FindPropertyFoundL() - { - CreateSpEntryL( 1, EPropertyContactViewPluginId, 12234 ); - - TInt err = iServiceTableFetcher->FindPropertyL(1, EPropertyContactViewPluginId); - - EUNIT_ASSERT_EQUALS( KErrNone, err ); - } - - -void T_VIMPSTEngineServiceTableFetcher::PropertyBrandVersionNotFoundL() - { - TInt version = iServiceTableFetcher->PropertyBrandVersionL(1); - - EUNIT_ASSERT_EQUALS( KErrNotFound, version ); - - } - -void T_VIMPSTEngineServiceTableFetcher::PropertyBrandVersionFoundL() - { - CreateSpEntryL( 1, EPropertyBrandVersion, 1 ); - - TInt version = iServiceTableFetcher->PropertyBrandVersionL(1); - - EUNIT_ASSERT_EQUALS( 1, version ); - } - - -void T_VIMPSTEngineServiceTableFetcher::PropertyBrandLanguageNotFoundL() - { - TLanguage lang = iServiceTableFetcher->PropertyBrandLanguageL(1); - - EUNIT_ASSERT_EQUALS( ELangInternationalEnglish, lang ); //if not found default is set to english - - } - -void T_VIMPSTEngineServiceTableFetcher::PropertyBrandLanguageFoundL() - { - CreateSpEntryL( 1, EPropertyBrandLanguage, ELangFrench ); - - TLanguage lang = iServiceTableFetcher->PropertyBrandLanguageL(1); - - EUNIT_ASSERT_EQUALS( ELangFrench, lang ); - } - - -void T_VIMPSTEngineServiceTableFetcher::GetServiceNameNotFoundL() - { - - HBufC* name = HBufC::NewL(500); - CleanupStack::PushL(name); - - TPtr namePtr = name->Des(); - - iServiceTableFetcher->GetServiceNameL(1, namePtr); - - EUNIT_ASSERT_EQUALS( 0, namePtr.Length() ); - - CleanupStack::PopAndDestroy( name ); - - } - - -void T_VIMPSTEngineServiceTableFetcher::GetServiceNameFoundL() - { - - HBufC* name = HBufC::NewL(500); - CleanupStack::PushL(name); - - TPtr namePtr = name->Des(); - - CreateSpEntry1L( 1, EPropertyBrandId, _L("MyBrand") ); - - iServiceTableFetcher->GetServiceNameL(1, namePtr); - - if (namePtr.Compare(KServiceName())) - { - User::Leave( KErrArgument ); - } - - CleanupStack::PopAndDestroy( name ); - - } - - -void T_VIMPSTEngineServiceTableFetcher::XimpAdapterUidNotFoundL() - { - TInt ximpAdapter = iServiceTableFetcher->XimpAdapterUidL(1); - - EUNIT_ASSERT_EQUALS( KErrNotFound, ximpAdapter ); - - } - -void T_VIMPSTEngineServiceTableFetcher::XimpAdapterUidFoundL() - { - CreateSpEntryL( 1, EPropertyPCSPluginId, 0x2000 ); - - TInt ximpAdapter = iServiceTableFetcher->XimpAdapterUidL(1); - - EUNIT_ASSERT_EQUALS( ximpAdapter, 0x2000 ); - } - - -void T_VIMPSTEngineServiceTableFetcher::PresenceRequestStatusNotFoundL() - { - TVIMPSTEnums::TVIMPSTPresenceRequestStatus ret = iServiceTableFetcher->PresenceRequestStatusL(1); - - EUNIT_ASSERT_EQUALS( TVIMPSTEnums::ESVCEPresenceRequestStatusUnKnown, ret ); - - } - -void T_VIMPSTEngineServiceTableFetcher::PresenceRequestStatusFoundWithEOffL() - { - CreateSpEntry1L( 1, ESubPropertyPresenceRequestPreference, EOff ); - - TVIMPSTEnums::TVIMPSTPresenceRequestStatus ret = iServiceTableFetcher->PresenceRequestStatusL(1); - - EUNIT_ASSERT_EQUALS( ret, TVIMPSTEnums::ESVCEPresenceRequestStatusAlwaysAsk ); - } - -void T_VIMPSTEngineServiceTableFetcher::PresenceRequestStatusFoundWithEOnL() - { - CreateSpEntry1L( 1, ESubPropertyPresenceRequestPreference, EOn ); - - TVIMPSTEnums::TVIMPSTPresenceRequestStatus ret = iServiceTableFetcher->PresenceRequestStatusL(1); - - EUNIT_ASSERT_EQUALS( ret, TVIMPSTEnums::ESVCEPresenceRequestStatusAutoAccept ); - } - - -void T_VIMPSTEngineServiceTableFetcher::ShutDownPhonebookL() - { - //nothing to worry over here - iServiceTableFetcher->ShutDownPhonebookL(); - } - -void T_VIMPSTEngineServiceTableFetcher::DoHandleNotifyChangeL_withNewServiceL() - { - //nothing to worry over here - MVIMPSTEngine * engine = NULL; - iServiceTableFetcher->DoHandleNotifyChangeL(3, ETrue, engine); - } -void T_VIMPSTEngineServiceTableFetcher::DoHandleNotifyChangeL_withOutNewServiceL() - { - //nothing to worry over here - MVIMPSTEngine * engine = NULL; - iServiceTableFetcher->DoHandleNotifyChangeL(3, EFalse, engine); - } - - -EUNIT_BEGIN_TEST_TABLE( T_VIMPSTEngineServiceTableFetcher, "T_VIMPSTEngineServiceTableFetcher", "" ) - - EUNIT_TEST( "TestConstructionL ", - "T_VIMPSTEngineServiceTableFetcher", - "ConstructionL", - "FUNCTIONALITY", SetupL, TestConstructionL, Teardown ) - EUNIT_TEST( "TestConstructionWithValidServicesL ", - "T_VIMPSTEngineServiceTableFetcher", - "ConstructionL", - "FUNCTIONALITY", Setup1L, TestConstructionWithValidServicesL, Teardown ) - EUNIT_TEST( "TestConstructionWithInValidServicesL ", - "T_VIMPSTEngineServiceTableFetcher", - "ConstructionL", - "FUNCTIONALITY", Setup1L, TestConstructionWithInValidServicesL, Teardown ) - EUNIT_TEST("GetMasterServiceIdsNoServicesL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetMasterServiceIds", - "FUNCTIONALITY", SetupL, GetMasterServiceIdsNoServicesL, Teardown ) - EUNIT_TEST( "GetMasterServiceIdsServicesMatchContactViewUidValidServiceL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetMasterServiceIds", - "FUNCTIONALITY", SetupL, GetMasterServiceIdsServicesMatchContactViewUidValidServiceL, Teardown ) - EUNIT_TEST( "GetMasterServiceIdsServicesMatchContactViewUidInValidServiceL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetMasterServiceIds", - "FUNCTIONALITY", SetupL, GetMasterServiceIdsServicesMatchContactViewUidInValidServiceL, Teardown ) - EUNIT_TEST( "GetMasterServiceIdsServicesNoMatchContactViewUidL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetMasterServiceIds", - "FUNCTIONALITY", SetupL, GetMasterServiceIdsServicesNoMatchContactViewUidL, Teardown ) - EUNIT_TEST( "GetContactStoreIdPropertyNotFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetMasterServiceIds", - "FUNCTIONALITY", SetupL, GetContactStoreIdPropertyNotFoundL, Teardown ) - EUNIT_TEST( "GetContactStoreIdPropertyFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetContactStoreId", - "FUNCTIONALITY", SetupL, GetContactStoreIdPropertyFoundL, Teardown ) - EUNIT_TEST("GetContactStoreIdPropertyFoundWithContactUriDomainL ", - "T_VIMPSTEngineServiceTableFetcher", - "TestAllFunctionsL", - "GetContactStoreId", SetupL, GetContactStoreIdPropertyFoundWithContactUriDomainL, Teardown ) - EUNIT_TEST( "GetBrandIdLPropertyNotFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetBrandIdL", - "FUNCTIONALITY", SetupL, GetBrandIdLPropertyNotFoundL, Teardown ) - EUNIT_TEST( "GetBrandIdLPropertyFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetBrandIdL", - "FUNCTIONALITY",SetupL, GetBrandIdLPropertyFoundL, Teardown ) - EUNIT_TEST("FindPropertyNotFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "FindProperty", - "FUNCTIONALITY", SetupL, FindPropertyNotFoundL, Teardown ) - EUNIT_TEST( "FindPropertyFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "FindProperty", - "FUNCTIONALITY", SetupL, FindPropertyFoundL, Teardown ) - EUNIT_TEST( "PropertyBrandVersionNotFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "PropertyBrandVersion", - "FUNCTIONALITY", SetupL, PropertyBrandVersionNotFoundL, Teardown ) - EUNIT_TEST( "PropertyBrandVersionFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "PropertyBrandVersion", - "FUNCTIONALITY", SetupL, PropertyBrandVersionFoundL, Teardown ) - EUNIT_TEST( "PropertyBrandLanguageNotFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "PropertyBrandVersion", - "FUNCTIONALITY", SetupL, PropertyBrandLanguageNotFoundL, Teardown ) - EUNIT_TEST( "PropertyBrandLanguageFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "PropertyBrandVersion", - "FUNCTIONALITY", SetupL, PropertyBrandLanguageFoundL, Teardown ) - EUNIT_TEST( "GetServiceNameNotFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetServiceName", - "FUNCTIONALITY", SetupL, GetServiceNameNotFoundL, Teardown ) - EUNIT_TEST( "GetServiceNameFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "GetServiceName", - "FUNCTIONALITY", SetupL, GetServiceNameFoundL, Teardown ) - EUNIT_TEST( "XimpAdapterUidNotFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "XimpAdapterUid", - "FUNCTIONALITY", SetupL, XimpAdapterUidNotFoundL, Teardown ) - EUNIT_TEST( "XimpAdapterUidFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "XimpAdapterUid", - "FUNCTIONALITY",SetupL, XimpAdapterUidFoundL, Teardown ) - EUNIT_TEST( "PresenceRequestStatusNotFoundL ", - "T_VIMPSTEngineServiceTableFetcher", - "PresenceRequestStatus", - "FUNCTIONALITY", SetupL, PresenceRequestStatusNotFoundL, Teardown ) - EUNIT_TEST( "PresenceRequestStatusFoundWithEOffL ", - "T_VIMPSTEngineServiceTableFetcher", - "PresenceRequestStatus", - "FUNCTIONALITY", SetupL, PresenceRequestStatusFoundWithEOffL, Teardown ) - EUNIT_TEST("PresenceRequestStatusFoundWithEOnL ", - "T_VIMPSTEngineServiceTableFetcher", - "PresenceRequestStatus", - "FUNCTIONALITY", SetupL, PresenceRequestStatusFoundWithEOnL, Teardown ) - EUNIT_TEST("ShutDownPhonebookL ", - "T_VIMPSTEngineServiceTableFetcher", - "ShutDownPhonebookL", - "FUNCTIONALITY", SetupL, ShutDownPhonebookL, Teardown ) - EUNIT_TEST("DoHandleNotifyChangeL_withOutNewServiceL ", - "T_VIMPSTEngineServiceTableFetcher", - "ShutDownPhonebookL", - "FUNCTIONALITY", SetupL, DoHandleNotifyChangeL_withOutNewServiceL, Teardown ) - EUNIT_TEST("DoHandleNotifyChangeL_withNewServiceL ", - "T_VIMPSTEngineServiceTableFetcher", - "ShutDownPhonebookL", - "FUNCTIONALITY", SetupL, DoHandleNotifyChangeL_withNewServiceL, Teardown ) - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginesessioncntxtobserver.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginesessioncntxtobserver.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,559 +0,0 @@ -/* -* t_vimpstenginesessioncntxtobserver.cpp ::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:t_vimpstenginesessioncntxtobserver.cpp -* -*/ -#include -#include -#include -#include "t_vimpstenginesessioncntxtobserver.h" - -#include -#include -#include - -#include "cvimpstenginesessioncntxtobserver.h" - -#include "s_ximpclient.h" -#include "s_ximpcontext.h" -#include "s_ximpidentity.h" -#include "s_presencefeatures.h" -#include "s_presentitygroups.h" -#include "s_ximprequestcompleteevent.h" -#include "s_ximppresensitypresenceevent.h" -#include "s_ximppresensitygroupcontentevent.h" -#include "s_ximpcontextstateevent.h" -#include "s_ximppresencegrantrequestlistevent.h" -#include "s_ximpsearchevent.h" -#include "s_ximpsearchkeysevent.h" -#include "s_presenceblockinfo.h" - - -#include "mvimpstenginesessioncntxtobserver.h" - -extern TInt32 gMXIMPRequestCompleteEventStubInterfaceId; -extern TXIMPRequestId gMXIMPRequestCompleteEventStubRequestId; - -extern TInt gUnBindingLeaves; - -const TInt KTestServiceId = 5; - - -class dummy_observer: public MVIMPSTEngineSessionCntxtObserver - { - void HandleSessionContextEventL( const MXIMPContext& /*aContext*/, - const MXIMPBase& /*aEvent*/, - TXimpOperation /*aXimpOperation = EVIMPSTXimpOperationNoOperation*/ - ) - { - - } - }; - -T_VimpstEngineSessionCntxtObserver* T_VimpstEngineSessionCntxtObserver::NewLC() - { - T_VimpstEngineSessionCntxtObserver* self = - new( ELeave ) T_VimpstEngineSessionCntxtObserver; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VimpstEngineSessionCntxtObserver::~T_VimpstEngineSessionCntxtObserver() - { - } - -void T_VimpstEngineSessionCntxtObserver::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - -void T_VimpstEngineSessionCntxtObserver::Setup1L() - { - iTestServiceId = CreateSpEntryL( KTestServiceId ); - } - -void T_VimpstEngineSessionCntxtObserver::Setup2L() - { - iTestServiceId = CreateSpEntryL( KTestServiceId ); - iSessionCntxtObserver = - CVIMPSTEngineSessionCntxtObserver::NewL( iTestServiceId ); - - - delete iSessionCntxtObserver->iFeatures; - iSessionCntxtObserver->iFeatures = NULL; - delete iSessionCntxtObserver->iPresenceCtx; - iSessionCntxtObserver->iPresenceCtx = NULL; - delete iSessionCntxtObserver->iClient; - iSessionCntxtObserver->iClient = NULL; - - iSessionCntxtObserver->iClient = MXIMPClientStub::NewClientL();; - - //Create new sink to receive ximp context events - iSessionCntxtObserver->iPresenceCtx = - iSessionCntxtObserver->iClient->NewPresenceContextLC(); - CleanupStack::Pop();// because of LC method - - iSessionCntxtObserver->iFeatures = - MyMPresenceFeatureStub::NewStubL( - iSessionCntxtObserver->iPresenceCtx); - } - -void T_VimpstEngineSessionCntxtObserver::Teardown() - { - if ( iSessionCntxtObserver ) - { - delete iSessionCntxtObserver; - iSessionCntxtObserver = NULL; - } - } - -TInt T_VimpstEngineSessionCntxtObserver::CreateSpEntryL( TInt aServiceId ) - { - CSPSettings* settings = CSPSettings::NewLC(); - - CSPEntry* entry = CSPEntry::NewLC(); - entry->SetServiceId( aServiceId ); - - CSPEntry* testEntry = CSPEntry::NewLC(); - TInt result = settings->FindEntryL( entry->GetServiceId(), *testEntry ); - - if( result == KErrNone ) - { - settings->UpdateEntryL( *entry ); - } - else - { - settings->AddEntryL( *entry ); - } - - TInt createdServiceId = entry->GetServiceId(); - - CleanupStack::PopAndDestroy( testEntry ); - CleanupStack::PopAndDestroy( entry ); - CleanupStack::PopAndDestroy( settings ); - - return createdServiceId; - } - -void T_VimpstEngineSessionCntxtObserver::T_NewLL() - { - iSessionCntxtObserver = - CVIMPSTEngineSessionCntxtObserver::NewL( iTestServiceId ); - - EUNIT_ASSERT( iSessionCntxtObserver != NULL ); - } - -void T_VimpstEngineSessionCntxtObserver::T_HandlePresenceContextEventL() - { - MXIMPContext* context = NULL; - MXIMPRequestCompleteEventStub requestCompleteEvent; - iSessionCntxtObserver->HandlePresenceContextEvent( - *context, requestCompleteEvent ); - } - -void T_VimpstEngineSessionCntxtObserver::T_GetCompletedReqResultL() - { - TInt result( KErrNotFound ); - iSessionCntxtObserver->iReqResult = KErrNone; - result = iSessionCntxtObserver->GetCompletedReqResult(); - EUNIT_ASSERT( KErrNone == result ); - } - -void T_VimpstEngineSessionCntxtObserver::T_GetRequestMapperL() - { - CVIMPSTEngineRequestMapper* requestMapper = - iSessionCntxtObserver->GetRequestMapper(); - EUNIT_ASSERT( requestMapper != NULL ); - } - -void T_VimpstEngineSessionCntxtObserver::T_ServerBindL() - { - TInt err( KErrNone ); - TUid protocolUid( KNullUid ); - - // Test with bind status EVIMPSTBindDone - // -> error code shoud be KErrNotFound - iSessionCntxtObserver->iBindStatus = TVIMPSTEnums::EVIMPSTBindDone; - err = iSessionCntxtObserver->ServerBindL( protocolUid ); - EUNIT_ASSERT( KErrNotFound == err ); - - // Test with other bind status that EVIMPSTBindDone - // -> error code should be KErrNone - iSessionCntxtObserver->iBindStatus = TVIMPSTEnums::EVIMPSTBindNotDone; - err = iSessionCntxtObserver->ServerBindL( protocolUid ); - EUNIT_ASSERT( KErrNone == err ); - } - -void T_VimpstEngineSessionCntxtObserver::T_ServerUnBindL() - { - TInt err( KErrNone ); - TBool doUnsubscribe( EFalse ); - - // Test different combinations with bind status EVIMPSTBindDone and - // binding leaving with KErrGeneral - gUnBindingLeaves = KErrGeneral; - - doUnsubscribe = EFalse; - iSessionCntxtObserver->iBindStatus = TVIMPSTEnums::EVIMPSTBindDone; - err = iSessionCntxtObserver->ServerUnBindL( doUnsubscribe ); - EUNIT_ASSERT( KErrGeneral == err ); - - doUnsubscribe = ETrue; - iSessionCntxtObserver->iBindStatus = TVIMPSTEnums::EVIMPSTBindDone; - err = iSessionCntxtObserver->ServerUnBindL( doUnsubscribe ); - EUNIT_ASSERT( KErrGeneral == err ); - - // Test different combinations with bind status EVIMPSTBindDone and - // binding not leaving - gUnBindingLeaves = KErrNone; - - doUnsubscribe = EFalse; - iSessionCntxtObserver->iBindStatus = TVIMPSTEnums::EVIMPSTBindDone; - err = iSessionCntxtObserver->ServerUnBindL( doUnsubscribe ); - EUNIT_ASSERT( KErrNone == err ); - - doUnsubscribe = ETrue; - iSessionCntxtObserver->iBindStatus = TVIMPSTEnums::EVIMPSTBindDone; - err = iSessionCntxtObserver->ServerUnBindL( doUnsubscribe ); - EUNIT_ASSERT( KErrNone == err ); - - // Test with bind status EVIMPSTBindFailureMode - iSessionCntxtObserver->iBindStatus = TVIMPSTEnums::EVIMPSTBindFailureMode; - err = iSessionCntxtObserver->ServerUnBindL( doUnsubscribe ); - EUNIT_ASSERT( KErrNotFound == err ); - - // Test with some other bind status that EVIMPSTBindDone or EVIMPSTBindFailureMode - iSessionCntxtObserver->iBindStatus = TVIMPSTEnums::EVIMPSTBindNotDone; - err = iSessionCntxtObserver->ServerUnBindL( doUnsubscribe ); - EUNIT_ASSERT( KErrNotFound == err ); - } - -void T_VimpstEngineSessionCntxtObserver::T_UriFromXimpOperationLCL() - { - MPresentityPresenceEventStub event; - HBufC* uri = iSessionCntxtObserver->UriFromXimpOperationLC( event ); - EUNIT_ASSERT( uri != NULL ) - //EUNIT_ASSERT( uri->Des().Compare( KTestIdentity ) == 0 ); - CleanupStack::PopAndDestroy( uri ); - } -void T_VimpstEngineSessionCntxtObserver::T_DoHandlePresenceContextEventLL() - { - TInt error( KErrNone ); - - MXIMPContext* context = NULL; - - // Test with MXIMPRequestCompleteEventStub - MXIMPRequestCompleteEventStub requestCompleteEvent; - TRAP( error, iSessionCntxtObserver->DoHandlePresenceContextEventL( - *context, requestCompleteEvent ) ); - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - - // Test with MXIMPContextStateEventStub - MXIMPContextStateEventStub contextStateEvent; - TRAP( error, iSessionCntxtObserver->DoHandlePresenceContextEventL( - *context, contextStateEvent ) ); - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - - // Test with MPresentityPresenceEventStub - MPresentityPresenceEventStub presentityPresenceEvent; - TRAP( error, iSessionCntxtObserver->DoHandlePresenceContextEventL( - *context, presentityPresenceEvent ) ); - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - - // Test with MPresentityGroupContentEventStub - MPresentityGroupContentEventStub presentityGroupContentEvent; - TRAP( error, iSessionCntxtObserver->DoHandlePresenceContextEventL( - *context, presentityGroupContentEvent ) ); - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - - // Test with MPresenceGrantRequestListEventStub - MPresenceGrantRequestListEventStub presenceGrantRequestListEvent; - TRAP( error, iSessionCntxtObserver->DoHandlePresenceContextEventL( - *context, presentityGroupContentEvent ) ); - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - - // Test with MPresenceblockinfostub - MPresenceBlockInfoStub presenceblockinfo; - TRAP( error, iSessionCntxtObserver->DoHandlePresenceContextEventL( - *context, presenceblockinfo ) ); - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - - // Test with MSearchEventStub - MSearchEventStub searchEvent; - TRAP( error, iSessionCntxtObserver->DoHandlePresenceContextEventL( - *context, searchEvent ) ); - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - - //Test with MSearchKeysEventStub - MSearchKeysEventStub searchKeysEvent; - TRAP( error, iSessionCntxtObserver->DoHandlePresenceContextEventL( - *context, searchKeysEvent ) ); - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - EUNIT_ASSERT( KErrNone == error ); - } -void T_VimpstEngineSessionCntxtObserver::T_XimpAuthorizationLL() - { - MPresenceAuthorization& presenceAuthorization = - iSessionCntxtObserver->XimpAuthorizationL(); - } -void T_VimpstEngineSessionCntxtObserver::T_XimpPresenceWatchingLL() - { - TRAPD( err, - MPresenceWatching& presenceWatching = - iSessionCntxtObserver->XimpPresenceWatchingL() - ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err || KErrNotSupported == err ); - } -void T_VimpstEngineSessionCntxtObserver::T_XimpPresentityGroupsLL() - { - TRAPD( err, - MPresentityGroups& presentityGroups = - iSessionCntxtObserver->XimpPresentityGroupsL() - ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err || KErrNotSupported == err ); - } -void T_VimpstEngineSessionCntxtObserver::T_XimpPresencePublishingLL() - { - TRAPD( err, - MPresencePublishing& presencePublishing = - iSessionCntxtObserver->XimpPresencePublishingL() - ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err || KErrNotSupported == err ); - } -void T_VimpstEngineSessionCntxtObserver::T_XimpPresenceContextL() - { - MXIMPContext& ximpContext = - iSessionCntxtObserver->XimpPresenceContextL(); - } -void T_VimpstEngineSessionCntxtObserver::T_PresenceObjectFactoryL() - { - MPresenceObjectFactory& presenceObjectFactory = - iSessionCntxtObserver->PresenceObjectFactoryL(); - } - -void T_VimpstEngineSessionCntxtObserver::T_RegisterObserverL() - { - MVIMPSTEngineSessionCntxtObserver* observer = new dummy_observer; // chauhan - iSessionCntxtObserver->RegisterObserver( observer ); - EUNIT_ASSERT( iSessionCntxtObserver->iObserverArray.Count() == 1 ); - } - -void T_VimpstEngineSessionCntxtObserver::T_UnRegisterObserverL() - { - MVIMPSTEngineSessionCntxtObserver* observer = new dummy_observer; // chauhan - iSessionCntxtObserver->RegisterObserver( observer ); - EUNIT_ASSERT( iSessionCntxtObserver->iObserverArray.Count() == 1 ); - - iSessionCntxtObserver->UnRegisterObserver( observer ); - EUNIT_ASSERT( iSessionCntxtObserver->iObserverArray.Count() == 0 ); - } - -void T_VimpstEngineSessionCntxtObserver::T_IdentifySupportedFeaturesL() - { - iSessionCntxtObserver->IdentifySupportedFeaturesL(); - } - -void T_VimpstEngineSessionCntxtObserver::T_GetSupportedFeaturesL() - { - TInt supportedFeatures = - iSessionCntxtObserver->GetSupportedFeatures(); - } - - - - - - -EUNIT_BEGIN_TEST_TABLE( T_VimpstEngineSessionCntxtObserver, "T_VimpstEngineSessionCntxtObserver", "" ) - -EUNIT_TEST( - "NewL - test ", - "T_VimpstEngineSessionCntxtObserver", - "NewL", - "FUNCTIONALITY", - Setup1L, T_NewLL, Teardown) - -EUNIT_TEST( - "HandlePresenceContextEvent - test ", - "T_VimpstEngineSessionCntxtObserver", - "HandlePresenceContextEvent", - "FUNCTIONALITY", - Setup2L, T_HandlePresenceContextEventL, Teardown) - -EUNIT_TEST( - "GetCompletedReqResult - test ", - "T_VimpstEngineSessionCntxtObserver", - "GetCompletedReqResult", - "FUNCTIONALITY", - Setup2L, T_GetCompletedReqResultL, Teardown) - -EUNIT_TEST( - "GetRequestMapper - test ", - "T_VimpstEngineSessionCntxtObserver", - "GetRequestMapper", - "FUNCTIONALITY", - Setup2L, T_GetRequestMapperL, Teardown) - -EUNIT_TEST( - "ServerBind - test ", - "T_VimpstEngineSessionCntxtObserver", - "ServerBind", - "FUNCTIONALITY", - Setup2L, T_ServerBindL, Teardown) - -EUNIT_TEST( - "ServerUnBind - test ", - "T_VimpstEngineSessionCntxtObserver", - "ServerUnBind", - "FUNCTIONALITY", - Setup2L, T_ServerUnBindL, Teardown) - -EUNIT_TEST( - "UriFromXimpOperationLC - test ", - "T_VimpstEngineSessionCntxtObserver", - "UriFromXimpOperationLC", - "FUNCTIONALITY", - Setup2L, T_UriFromXimpOperationLCL, Teardown) - -EUNIT_TEST( - "DoHandlePresenceContextEventL - test ", - "T_VimpstEngineSessionCntxtObserver", - "DoHandlePresenceContextEventL", - "FUNCTIONALITY", - Setup2L, T_DoHandlePresenceContextEventLL, Teardown) - -EUNIT_TEST( - "XimpAuthorizationL - test ", - "T_VimpstEngineSessionCntxtObserver", - "XimpAuthorizationL", - "FUNCTIONALITY", - Setup2L, T_XimpAuthorizationLL, Teardown) - -EUNIT_TEST( - "XimpPresenceWatchingL - test ", - "T_VimpstEngineSessionCntxtObserver", - "XimpPresenceWatchingL", - "FUNCTIONALITY", - Setup2L, T_XimpPresenceWatchingLL, Teardown) - -EUNIT_TEST( - "XimpPresentityGroupsL - test ", - "T_VimpstEngineSessionCntxtObserver", - "XimpPresentityGroupsL", - "FUNCTIONALITY", - Setup2L, T_XimpPresentityGroupsLL, Teardown) - -EUNIT_TEST( - "XimpPresencePublishingL - test ", - "T_VimpstEngineSessionCntxtObserver", - "XimpPresencePublishingL", - "FUNCTIONALITY", - Setup2L, T_XimpPresencePublishingLL, Teardown) - -EUNIT_TEST( - "XimpPresenceContext - test ", - "T_VimpstEngineSessionCntxtObserver", - "XimpPresenceContext", - "FUNCTIONALITY", - Setup2L, T_XimpPresenceContextL, Teardown) - -EUNIT_TEST( - "PresenceObjectFactory - test ", - "T_VimpstEngineSessionCntxtObserver", - "PresenceObjectFactory", - "FUNCTIONALITY", - Setup2L, T_PresenceObjectFactoryL, Teardown) - -EUNIT_TEST( - "RegisterObserver - test ", - "T_VimpstEngineSessionCntxtObserver", - "RegisterObserver", - "FUNCTIONALITY", - Setup2L, T_RegisterObserverL, Teardown) - -EUNIT_TEST( - "UnRegisterObserver - test ", - "T_VimpstEngineSessionCntxtObserver", - "UnRegisterObserver", - "FUNCTIONALITY", - Setup2L, T_UnRegisterObserverL, Teardown) - -EUNIT_TEST( - "IdentifySupportedFeatures - test ", - "T_VimpstEngineSessionCntxtObserver", - "IdentifySupportedFeatures", - "FUNCTIONALITY", - Setup2L, T_IdentifySupportedFeaturesL, Teardown) - -EUNIT_TEST( - "GetSupportedFeatures - test ", - "T_VimpstEngineSessionCntxtObserver", - "GetSupportedFeatures", - "FUNCTIONALITY", - Setup2L, T_GetSupportedFeaturesL, Teardown) - - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginevoipsubservice.cpp --- a/uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/t_vimpstenginevoipsubservice.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,328 +0,0 @@ -/* -* 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:t_vimpstenginevoipsubservice.cpp -* -*/ -#include -#include -#include -#include "t_vimpstenginevoipsubservice.h" - -#include -#include -#include - -#include "cvimpstenginevoipsubservice.h" -#include "cvimpstenginecchhandler.h" -#include "cvimpstengineservicetablefetcher.h" - -const TInt KTestServiceId = 5; - -T_VimpstEngineVoipSubService* T_VimpstEngineVoipSubService::NewLC() - { - T_VimpstEngineVoipSubService* self = new( ELeave ) T_VimpstEngineVoipSubService; - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -T_VimpstEngineVoipSubService::~T_VimpstEngineVoipSubService() - { - } - -void T_VimpstEngineVoipSubService::ConstructL() - { - CEUnitTestSuiteClass::ConstructL(); - } - - -// FROM OBSERVER INTERFACES -void T_VimpstEngineVoipSubService::HandleServceConnectionEventL() - { - } - - -void T_VimpstEngineVoipSubService::SetupL() - { - iTestServiceId = CreateSpEntryL( KTestServiceId ); - // MVIMPSTEngineCchUiEventObserver *aCchUiEventObserver; - - iCchHandler = CVIMPSTEngineCchHandler::NewL( iTestServiceId, *iCchUiEventObserver); - iServiceTableFetcher = CVIMPSTEngineServiceTableFetcher::NewL(); - - iVoIPSubService = CVIMPSTEngineVOIPSubService::NewL( - iTestServiceId, - *iCchHandler, - *iServiceTableFetcher, - *this ); - } - -void T_VimpstEngineVoipSubService::Teardown() - { - if ( iCchHandler ) - { - delete iCchHandler; - iCchHandler = NULL; - } - if ( iServiceTableFetcher ) - { - delete iServiceTableFetcher; - iServiceTableFetcher = NULL; - } - - if ( iVoIPSubService ) - { - delete iVoIPSubService; - iVoIPSubService = NULL; - } - } - -TInt T_VimpstEngineVoipSubService::CreateSpEntryL( TInt aServiceId ) - { - CSPSettings* settings = CSPSettings::NewLC(); - - CSPEntry* entry = CSPEntry::NewLC(); - entry->SetServiceId( aServiceId ); - - CSPEntry* testEntry = CSPEntry::NewLC(); - TInt result = settings->FindEntryL( entry->GetServiceId(), *testEntry ); - - if( result == KErrNone ) - { - settings->UpdateEntryL( *entry ); - } - else - { - settings->AddEntryL( *entry ); - } - - TInt createdServiceId = entry->GetServiceId(); - - CleanupStack::PopAndDestroy( testEntry ); - CleanupStack::PopAndDestroy( entry ); - CleanupStack::PopAndDestroy( settings ); - - return createdServiceId; - } - -void T_VimpstEngineVoipSubService::T_NewLL() - { - CVIMPSTEngineVOIPSubService* voipSubService = NULL; - voipSubService = CVIMPSTEngineVOIPSubService::NewL( - iTestServiceId, - *iCchHandler, - *iServiceTableFetcher, - *this); - - EUNIT_ASSERT( voipSubService != NULL ); - - delete voipSubService; - voipSubService = NULL; - } - -void T_VimpstEngineVoipSubService::T_CchEventOccuredLL() - { - TInt error( KErrNone ); - - RArray subServiceStates; - CleanupClosePushL( subServiceStates ); - subServiceStates.AppendL( ECCHUninitialized ); - subServiceStates.AppendL( ECCHDisabled ); - subServiceStates.AppendL( ECCHConnecting ); - subServiceStates.AppendL( ECCHEnabled ); - subServiceStates.AppendL( ECCHDisconnecting ); - - // Test with service error: KErrNone and all subservice states. - TInt serviceError( KErrNone ); - - for ( TInt i( 0 ) ; i < subServiceStates.Count() ; i++ ) - { - TRAP( error, iVoIPSubService->CchEventOccuredL( - iTestServiceId, subServiceStates[ i ], serviceError ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - - EUNIT_ASSERT( KErrNone == error ); - } - - // Test with service error: KErrNotFound and all subservice states. - serviceError = KErrNotFound; - for ( TInt j( 0 ) ; j < subServiceStates.Count() ; j++ ) - { - TRAP( error, iVoIPSubService->CchEventOccuredL( - iTestServiceId, subServiceStates[ j ], serviceError ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - - EUNIT_ASSERT( KErrNone == error ); - } - - CleanupStack::PopAndDestroy( &subServiceStates ); - } - -void T_VimpstEngineVoipSubService::T_DoHandleCchErrorLL() - { - RArray serviceErrors; - CleanupClosePushL( serviceErrors ); - - serviceErrors.AppendL( KErrGeneral ); // Tests default case - serviceErrors.AppendL( KCCHErrorBandwidthInsufficient ); - serviceErrors.AppendL( KCCHErrorInvalidIap ); - serviceErrors.AppendL( KCCHErrorAuthenticationFailed ); - serviceErrors.AppendL( KCCHErrorNetworkLost ); - serviceErrors.AppendL( KCCHErrorLoginFailed ); - serviceErrors.AppendL( KCCHErrorServiceNotResponding ); - serviceErrors.AppendL( KCCHErrorInvalidSettings ); - serviceErrors.AppendL( KCCHErrorAccessPointNotDefined ); - - for ( TInt i( 0 ) ; i < serviceErrors.Count() ; i++ ) - { - TRAPD( err, iVoIPSubService->DoHandleCchErrorL( - serviceErrors[ i ] ) ); - - if ( KErrNoMemory == err ) - { - User::Leave( err ); - } - - EUNIT_ASSERT( KErrNone == err ); - } - - CleanupStack::PopAndDestroy( &serviceErrors ); - } - -void T_VimpstEngineVoipSubService::T_ResolveServiceStateL() - { - TInt error( KErrNone ); - - RArray subServiceStates; - CleanupClosePushL( subServiceStates ); - subServiceStates.AppendL( ECCHUninitialized ); - subServiceStates.AppendL( ECCHDisabled ); - subServiceStates.AppendL( ECCHConnecting ); - subServiceStates.AppendL( ECCHEnabled ); - subServiceStates.AppendL( ECCHDisconnecting ); - - // Test with service error: KErrNone and all subservice states. - TInt serviceError( KErrNone ); - - for ( TInt i( 0 ) ; i < subServiceStates.Count() ; i++ ) - { - TRAP( error, iVoIPSubService->ResolveServiceState( - subServiceStates[ i ], serviceError ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - - EUNIT_ASSERT( KErrNone == error ); - } - - // Test with service error: KErrNotFound and all subservice states. - serviceError = KErrNotFound; - for ( TInt j( 0 ) ; j < subServiceStates.Count() ; j++ ) - { - TRAP( error, iVoIPSubService->ResolveServiceState( - subServiceStates[ j ], serviceError ) ); - - if ( KErrNoMemory == error ) - { - User::Leave( error ); - } - - EUNIT_ASSERT( KErrNone == error ); - } - - CleanupStack::PopAndDestroy( &subServiceStates ); - } - -void T_VimpstEngineVoipSubService::T_SubServiceStateL() - { - RArray states; - CleanupClosePushL( states ); - states.AppendL( TVIMPSTEnums::ESVCENotRegistered ); - states.AppendL( TVIMPSTEnums::ESVCERegistered ); - states.AppendL( TVIMPSTEnums::ESVCENetworkConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEWaitingForNetwork ); - states.AppendL( TVIMPSTEnums::ESVCENetworkDisConnecting ); - states.AppendL( TVIMPSTEnums::ESVCEUpdatingContacts ); - - for ( TInt i( 0 ) ; i < states.Count() ; i++ ) - { - iVoIPSubService->iServiceState = states[ i ]; - EUNIT_ASSERT( states[ i ] == iVoIPSubService->SubServiceState() ); - } - - CleanupStack::PopAndDestroy( &states ); - } - -void T_VimpstEngineVoipSubService::T_TypeL() - { - EUNIT_ASSERT( TVIMPSTEnums::EVoip == iVoIPSubService->Type() ); - } - -EUNIT_BEGIN_TEST_TABLE( T_VimpstEngineVoipSubService, "T_VimpstEngineVoipSubService", "" ) - -EUNIT_TEST( - "NewL - test ", - "T_VimpstEngineVoipSubService", - "NewL", - "FUNCTIONALITY", - SetupL, T_NewLL, Teardown) - -EUNIT_TEST( - "CchEventOccuredL - test ", - "T_VimpstEngineVoipSubService", - "CchEventOccuredL", - "FUNCTIONALITY", - SetupL, T_CchEventOccuredLL, Teardown) - -EUNIT_TEST( - "DoHandleCchErrorL - test ", - "T_VimpstEngineVoipSubService", - "DoHandleCchErrorL", - "FUNCTIONALITY", - SetupL, T_DoHandleCchErrorLL, Teardown) - -EUNIT_TEST( - "ResolveServiceState - test ", - "T_VimpstEngineVoipSubService", - "ResolveServiceState", - "FUNCTIONALITY", - SetupL, T_ResolveServiceStateL, Teardown) - -EUNIT_TEST( - "SubServiceState - test ", - "T_VimpstEngineVoipSubService", - "SubServiceState", - "FUNCTIONALITY", - SetupL, T_SubServiceStateL, Teardown) - -EUNIT_TEST( - "Type - test ", - "T_VimpstEngineVoipSubService", - "Type", - "FUNCTIONALITY", - SetupL, T_TypeL, Teardown) - -EUNIT_END_TESTCASE_TABLE - -// END OF FILE diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/bwins/vimpststorageu.def --- a/uiservicetab/vimpststorage/bwins/vimpststorageu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -EXPORTS - ?InitialiseViewL@CVIMPSTStorageManagerFactory@@SAXKABVTDesC16@@0@Z @ 1 NONAME ; void CVIMPSTStorageManagerFactory::InitialiseViewL(unsigned long, class TDesC16 const &, class TDesC16 const &) - ?ItemModelInterfaceL@CVIMPSTStorageManagerFactory@@SAPAVMVIMPSTStorageItemModel@@K@Z @ 2 NONAME ; class MVIMPSTStorageItemModel * CVIMPSTStorageManagerFactory::ItemModelInterfaceL(unsigned long) - ?InitialiseLibraryL@CVIMPSTStorageManagerFactory@@SAXXZ @ 3 NONAME ; void CVIMPSTStorageManagerFactory::InitialiseLibraryL(void) - ?Release@CVIMPSTStorageManagerFactory@@SAHXZ @ 4 NONAME ; int CVIMPSTStorageManagerFactory::Release(void) - ?ContactListInterfaceL@CVIMPSTStorageManagerFactory@@SAPAVMVIMPSTStorageServiceView@@K@Z @ 5 NONAME ; class MVIMPSTStorageServiceView * CVIMPSTStorageManagerFactory::ContactListInterfaceL(unsigned long) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/eabi/vimpststorageu.def --- a/uiservicetab/vimpststorage/eabi/vimpststorageu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -EXPORTS - _ZN28CVIMPSTStorageManagerFactory15InitialiseViewLEmRK7TDesC16S2_ @ 1 NONAME - _ZN28CVIMPSTStorageManagerFactory18InitialiseLibraryLEv @ 2 NONAME - _ZN28CVIMPSTStorageManagerFactory19ItemModelInterfaceLEm @ 3 NONAME - _ZN28CVIMPSTStorageManagerFactory21ContactListInterfaceLEm @ 4 NONAME - _ZN28CVIMPSTStorageManagerFactory7ReleaseEv @ 5 NONAME - _ZTI21CVIMPSTStorageManager @ 6 NONAME ; ## - _ZTV21CVIMPSTStorageManager @ 7 NONAME ; ## - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/group/bld.inf --- a/uiservicetab/vimpststorage/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2008 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: Build information file for VIMPSTStorage -* -*/ - - - -PRJ_PLATFORMS -DEFAULT - -PRJ_MMPFILES -vimpststorage.mmp - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/group/vimpststorage.mmp --- a/uiservicetab/vimpststorage/group/vimpststorage.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2008 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: MMP -* -*/ - - -// To get the APP_LAYER_SYSTEMINCLUDE-definition -#include -#include - -#include "../../inc/vimpstbuilddefinitions.h" - -CAPABILITY CAP_GENERAL_DLL -TARGET vimpststorage.dll -TARGETTYPE dll -UID 0x1000008d 0x20012422 -VENDORID VID_DEFAULT - -VERSION 10.0 - -SOURCEPATH ../src - -SOURCE cvimpststoragemanagerfactory.cpp -SOURCE cvimpststoragemanager.cpp -SOURCE cvimpststorageserviceview.cpp -SOURCE cvimpststoragecontactlist.cpp -SOURCE cvimpststoragecontact.cpp -SOURCE cvimpststoragevpbklocalstore.cpp -SOURCE cvimpststoragevpbkserverstore.cpp -SOURCE cvimpststoragevpbkstorehandler.cpp -SOURCE cvimpststoragecontactsorter.cpp -SOURCE cvimpststorageactivehandler.cpp -SOURCE vimpststorageutils.cpp - -USERINCLUDE ../inc -USERINCLUDE ../src -USERINCLUDE ../../inc -USERINCLUDE ../../Group - - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY estor.lib -LIBRARY efsrv.lib -LIBRARY edbms.lib -LIBRARY bafl.lib -LIBRARY sysutil.lib -LIBRARY ecom.lib -LIBRARY avkon.lib -LIBRARY eikcore.lib - - -// Virtual phonebook -LIBRARY VPbkEng.lib -LIBRARY VPbkEngUtils.lib -LIBRARY Pbk2Presentation.lib - -LIBRARY cntmodel.lib cntview.lib - -//#ifdef CHAT_ENABLE_DEBUG_PRINT -LIBRARY flogger.lib -//#endif - -LANG SC - - -// EXPORTUNFROZEN - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststorageactivehandler.h --- a/uiservicetab/vimpststorage/inc/cvimpststorageactivehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2008 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: Active class implementation to wait multiple refresh. -* -*/ - - - -#ifndef CVIMPSTSTORAGEACTIVEHANDLER_H -#define CVIMPSTSTORAGEACTIVEHANDLER_H - -// INCLUDES -#include -#include "tvimpstenums.h" -// FORWARD DECLARATIONS -class MVIMPSTStorageActiveObserver; -class MVIMPSTStorageContactList; -class MVIMPSTStorageContact; -// CLASS DECLARATION - -/** -* The CVIMPSTStorageRefreshTimer class handles the waiting functionality for the -* storage manager to wait before calling observer in case of multiple -* contacts adding. -* -* @lib vimpststorage.dll -* @since 5.0 -*/ -NONSHARABLE_CLASS ( CVIMPSTStorageActiveHandler ) : public CTimer - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aObserver The observer to which the notify about the - * timer events is - * given. - */ - static CVIMPSTStorageActiveHandler * NewL( MVIMPSTStorageActiveObserver* aObserver ); - - /** - * Destructor. - */ - ~CVIMPSTStorageActiveHandler(); - - protected: // Functions from CActive - - /** - * @see CActive - */ - void RunL(); - - /** - * @see CActive - */ - TInt RunError( TInt aError ); - - /** - * @see CActive - */ - void DoCancel(); - - public: // new methods - - /** - * Starts timer. If timer is already running, stops timer and - * restarts it. - */ - void IssueRequest(TVIMPSTEnums::TVIMPSTStorgaeEventType aType, - MVIMPSTStorageContactList *aList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ); - - private: - - /** - * C++ default constructor. - */ - CVIMPSTStorageActiveHandler( MVIMPSTStorageActiveObserver* aObserver ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - // A pointer to the observer - MVIMPSTStorageActiveObserver* iObserver; /// Not owned - // Event type - TVIMPSTEnums::TVIMPSTStorgaeEventType iEventType; - // Not owns a contact List - MVIMPSTStorageContactList* iList; - // Not owns contact - MVIMPSTStorageContact* iContact; - // index of contact - TInt iContactIndex; - }; - -#endif // CVIMPSTSTORAGEACTIVEHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststoragecontact.h --- a/uiservicetab/vimpststorage/inc/cvimpststoragecontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,214 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact data container implementation -* -*/ - - - -#ifndef CVIMPSTSTORAGECONTACT_H -#define CVIMPSTSTORAGECONTACT_H - - -// INCLUDES - -#include -#include -#include "mvimpststoragecontact.h" - -// FORWARD DECLARATIONS -class Cvimpststorage_test; //Unit testClass -class MVIMPSTStorageVPbkContactStore; -// CLASS DECLARATION - -/** - * Contact data implementation - * @lib vimpststorage.dll - * @since 5.0 - */ -NONSHARABLE_CLASS (CVIMPSTStorageContact) : public CBase, - public MVIMPSTStorageContact - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aObserver contact data container observer - * @param aContactLink pointer to contact link - * @param aStoreContact pointer to the stored contact - * @param aContactManager reference to virtual pbk manager - * @param aContactManagementObserver - Notified of ContactOperation Add/Deleted - * @return CVIMPSTStorageContact* a new instance of this class - */ - static CVIMPSTStorageContact* NewL(const TDesC& aUserId, - const TDesC& aDisplayName, - const MVPbkContactLink& aContactLink, - const TDesC8& aAvatarContent - ); - - /** - * Two-phased constructor. - * @param aObserver contact data container observer - * @param aContactLink pointer to contact link - * @param aStoreContact pointer to the stored contact - * @param aContactManager reference to virtual pbk manager - * @param aContactManagementObserver - Notified of ContactOperation Add/Deleted - * @return CVIMPSTStorageContact* a new instance of this class - */ - static CVIMPSTStorageContact* NewL(const TDesC& aUserId, - const TDesC& aDisplayName ); - - /** - * Two-phased constructor. - * @param aObserver contact data container observer - * @param aContactLink pointer to contact link - * @param aStoreContact pointer to the stored contact - * @param aContactManager reference to virtual pbk manager - * @param aContactManagementObserver - Notified of ContactOperation Add/Deleted - * @return CVIMPSTStorageContact* a new instance of this class - */ - static CVIMPSTStorageContact* NewLC(const TDesC& aUserId, - const TDesC& aDisplayName, - const MVPbkContactLink& aContactLink, - const TDesC8& aAvatarContent - ); - - /** - * C++ Destructor. - */ - ~CVIMPSTStorageContact(); - - - public: // Functions from base classes MVIMPSTStorageContact - - /** - * @see MVIMPSTStorageContact - */ - void SetUserIdL( const TDesC& aUserId ); - - - void SetAvatarContentL( const TDesC8& aAvatarContent , - MVIMPSTStorageVPbkContactStore& aVPPkStoreHandler); - - /** - * Set User ID - * @param aUserId, user id to be set. - */ - void SetNameL( const TDesC& aName ) ; - - /** - * @see MVIMPSTStorageContact - */ - MVPbkContactLink* ContactLink() const; - - - /** - * @see MVIMPSTStorageContact - */ - const TDesC8& AvatarContent() const; - - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& UserId() const; - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& Name() const; - - - /** - * @see MVIMPSTStorageContact - */ - TVIMPSTEnums::TOnlineStatus OnlineStatus() const; - - - /** - * @see MVIMPSTStorageContact - */ - void SetOnlineStatus( - TVIMPSTEnums::TOnlineStatus aOnlineStatus ); - - /** - * @see MVIMPSTStorageContact - */ - const TDesC& StatusText() const; - - /** - * @see MVIMPSTStorageContact - */ - void SetStatusTextL( const TDesC& aStatusText ); - - - void SetAvatarIndex(TInt aIndex ) ; - - - TInt AvatarIndex() const; - - private: - - /** - * C++ default constructor. - * @param aObserver contact data container observer - * @param aContactManager reference to virtual pbk manager - * @param aStoreContact pointer to the stored contact - * @param aContactManagementObserver - Notified of ContactOperation Add/Deleted - */ - CVIMPSTStorageContact(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(const TDesC& aUserId, - const TDesC& aDisplayName, - const MVPbkContactLink& aContactLink, - const TDesC8& aAvatarContent); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(const TDesC& aUserId, - const TDesC& aDisplayName ); - private: // Data - - // user ID - HBufC* iUserId; // owns - - // user ID - HBufC* iDisplayName; - - // presence status (online, offline, etc) - TVIMPSTEnums::TOnlineStatus iPresenceStatus; - - /// Status text. Owns. - HBufC* iStatusText; - - // Own, virtual phonebook contact link - MVPbkContactLink* iContactLink; - - // avatar content Owns - HBufC8* iAvatarContent; - - TInt iAvatarIndex; - - //for test cases - friend class Cvimpststorage_test; - - }; - -#endif // CVIMPSTSTORAGECONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststoragecontactlist.h --- a/uiservicetab/vimpststorage/inc/cvimpststoragecontactlist.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,234 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact list container implementation -* -*/ - - - -#ifndef CVIMPSTSTORAGECONTACTLIST_H -#define CVIMPSTSTORAGECONTACTLIST_H - -// INCLUDES -#include -#include "mvimpststoragecontactlist.h" -#include "mvimpststoragecontact.h" -#include "tvimpstenums.h" - -// FORWARD DECLARATIONS -class CVIMPSTStorageContactSorter; -class MVPbkContactLink; -class MVPbkBaseContact; - - -// CLASS DECLARATION - -/** - * Contact list data implementation - */ -NONSHARABLE_CLASS( CVIMPSTStorageContactList ) : public CBase, - public MVIMPSTStorageContactList - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aObserver. Observer for events - * @param aSorter. Sorter for contaclist. - * @param aInfo. Information from storage - * @param alistId. List id of list. Default value KNullDesC, if not set. - * @param aDisplayname. Name of list. - */ - static CVIMPSTStorageContactList* NewL( CVIMPSTStorageContactSorter& aSorter, - const TDesC& aListId, - const TDesC& aDisplayName = KNullDesC ); - /** - * Two-phased constructor. - * @param aObserver. Observer for events - * @param aSorter. Sorter for contaclist. - * @param aInfo. Information from storage - * @param alistId. List id of list. - * @param alistId. List id of list. Default value KNullDesC, if not set. - */ - static CVIMPSTStorageContactList* NewLC( CVIMPSTStorageContactSorter& aSorter, - const TDesC& aListId, - const TDesC& aDisplayName = KNullDesC ); - - /** - * Destructor. - */ - ~CVIMPSTStorageContactList(); - - - public: - - /** - * @see MVIMPSTStorageContactList - */ - const TDesC& ListId() const; - - /** - * @see MVIMPSTStorageContactList - */ - TPtrC DisplayName() const; - - /** - * @see MVIMPSTStorageContactList - */ - TInt Count() const; - - /** - * @see MVIMPSTContactList - */ - MVIMPSTStorageContact& operator[]( TInt aIndex ) const; - - /** - * @see MVIMPSTStorageContactList - */ - MVIMPSTStorageContact& FilteredContact( - TInt aIndex, TVIMPSTEnums::TFilterType aFilter ) const; - - /** - * @see MVIMPSTStorageContactList - */ - virtual TInt FilteredCount( - TVIMPSTEnums::TFilterType aFilter ) const; - - - /** - * @see MVIMPSTStorageContactList - */ - void Sort(); - - /** - * @see MVIMPSTStorageContactList - */ - void ResortContact( MVIMPSTStorageContact* aContact ); - - /** - * @see MVIMPSTStorageContactList - */ - TInt FindIndexOfContact( - const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter = - TVIMPSTEnums::EFilterAll ) const; - - /** - * @see MVIMPSTStorageContactList - */ - TBool FilterAllowsContact( const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter ) const; - public: // New functions - - MVIMPSTStorageContact* FindContact( const TDesC& aContactId ); - - - /** - * Find contact by MVPbkContactLink Contact Link VPBK. - * @param aContactLink. Contact Link to find. - * @return Pointer to found contact. NULL if not found. - */ - MVIMPSTStorageContact* FindContactByContactLink( const MVPbkContactLink& aContactLink ); - - - /** - * Remove contact from list - * @param aContactId. Id of contact to be removed. - */ - TInt RemoveContactFromCacheL( const TDesC& aContactId, TInt& index ); - - - /** - * Remove contact from list - * @param aContactLink. Contact Link of the item to be removed. - */ - TInt RemoveContactFromCacheL( const MVPbkContactLink& aContactLink, TInt& index ); - - /** - * add contact to list - * @param aContact. Contact item to be added. - * @param index of index - */ - TInt AddStorageContactToCacheL( MVIMPSTStorageContact* aContact, TInt& aIndex ); - - /** - * Count of contacts in list. Skipp all ofline contacts. - */ - TInt ContactCount( TBool aSkipOfflineContacts, - TBool aSkipBlocekedContacts ) const; - - /** - * Count of online items in list - * @return count of online contacts - */ - TInt OnlineCount() const; - - - /** - * Get online list item by index from list - * @param aIndex. Index of online item. - * @return Online contact in index. - */ - MVIMPSTStorageContact& OnlineContact( TInt aIndex ) const; - - - private: // Own methods - - /** - * Constructor - */ - CVIMPSTStorageContactList( CVIMPSTStorageContactSorter& aSorter); - - /** - * Two-phased constructor - */ - void ConstructL( const TDesC& aListId, const TDesC& aDisplayName ); - - /** - * Find Contact based on contact link - */ - TInt FindContactByLinkL( const MVPbkContactLink& aContactLink, - TInt& aIndexOrderedArray ) const; - - /** - * Gets the index of given aContact - */ - TInt FindContactEntry( const MVIMPSTStorageContact* aContact ) const; - - - TInt FindContactIndex( const TDesC& aContactId, - TInt& aOrderedIndex ) const; - - private: // Data - - /// Owns Stored contacts in contact list. - RPointerArray< MVIMPSTStorageContact > iContactArray; - - /// Not owns Alphabeticaly ordered Contacts - RPointerArray< MVIMPSTStorageContact > iOrderedContacts; - - /// Sorter for contacts. - CVIMPSTStorageContactSorter& iSorter; - - /// Id of list - HBufC* iListId; - - /// Displayname of list - HBufC* iDisplayName; - - }; - -#endif // CVIMPSTSTORAGECONTACTLIST_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststoragecontactsorter.h --- a/uiservicetab/vimpststorage/inc/cvimpststoragecontactsorter.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact sorter -* -*/ - - -#ifndef CVIMPSTSTORAGECONTACTSORTER_H -#define CVIMPSTSTORAGECONTACTSORTER_H - -// INCLUDES -#include -#include "mvimpststoragecontact.h" - -// CLASS DECLARATION - -/** -* contact items array sorter -* Changes used sorting algorithm based on setting item value. -* It also listen to changes -* in setting item value. -* Offers also an API to compare two contacts. -* -*/ -NONSHARABLE_CLASS( CVIMPSTStorageContactSorter ) : public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CVIMPSTStorageContactSorter* NewL(); - - /** - * Destructor. - */ - ~CVIMPSTStorageContactSorter(); - - public: //New Methods - - /** - * Sorts given array. - * @param aList Reference to list which is sorted. - */ - void Sort( RPointerArray< MVIMPSTStorageContact >& aList ); - - /** - * Returns which given contact is first in list. - * @param aFirst Reference to first contact. - * @param aSecond Reference to second contact. - * @return Integer, -1 if aFirst is greater, 0 if equal, - * 1 if aSecond is greater. - */ - TInt Compare( const MVIMPSTStorageContact& aFirst, - const MVIMPSTStorageContact& aSecond ) const; - - /** - * Set the Sort Algorithm - * @param aAlgorithm - ECompareAlphabetically/ECompareByPresence - */ - void SetSortAlgorithm( MVIMPSTStorageContact::TSortAlgorithm aAlgorithm ); - - /** - * Gets the algorithm chosen - * returns the algorithm used for sorting - */ - TLinearOrder< MVIMPSTStorageContact >& InsertOrder(); - - private: - /** - * C++ default constructor. - */ - CVIMPSTStorageContactSorter(); - - private: // Data - - // This contains a pointer to a function used in sorting and comparing. - TLinearOrder< MVIMPSTStorageContact > iAlgorithm; - }; - -#endif // CVIMPSTSTORAGECONTACTSORTER_H - -//End Of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststoragedefs.h --- a/uiservicetab/vimpststorage/inc/cvimpststoragedefs.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -/* -* Copyright (c) 2008 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: Storage database table names - * -*/ - - -#ifndef __CVIMPSTSTORAGEDEFS_H__ -#define __CVIMPSTSTORAGEDEFS_H__ - -// "test character identity and accents, ignore case" -const TInt KCollationLevel = 1; -const TInt KMaxFields = 40; - -#endif // __CVIMPSTSTORAGEDEFS_H__ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststoragemanager.h --- a/uiservicetab/vimpststorage/inc/cvimpststoragemanager.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2008 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: Declaration of storage manager class - * -*/ - - - -#ifndef CVIMPSTSTORAGEMANAGER_H -#define CVIMPSTSTORAGEMANAGER_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CVIMPSTStorageServiceView; - -// CLASS DECLARATION - -/** - * Factory to create contact and group list interfaces. - */ -class CVIMPSTStorageManager : public CBase - { - public: // New functions - - /** - * Initialises the Library - */ - static void InitialiseLibraryL(); - - /** - * Release the resources allocated - */ - static TInt Release(); - - /** - * Returns the instance of Storagemanager - * @return CVIMPSTStorageManager pointer - */ - static CVIMPSTStorageManager& Instance(); - - - /** - * Creates object of viewid - * @param aServiceId - Service Id - * @param ContactStoreName - * @param aServiceName ServiceName - * @return CVIMPSTStorageViewId pointer - */ - CVIMPSTStorageServiceView* CreateServiceViewL(TUint32 aServiceId, - const TDesC& aStoreName, - const TDesC& aServiceName); - - /** - * Find the storage views index - * @param aServiceId - Service Id - * @return index of the view - */ - TInt FindServiceView(TUint32 aServiceId); - - - /** - * Romoves the storage view from the array. - * @param aServiceId - Service Id - */ - void RemoveServiceView(TUint32 aServiceId); - - /** - * Destructor - */ - ~CVIMPSTStorageManager(); - - private: - - /** - * Two-phased constructor. - */ - static CVIMPSTStorageManager* NewL(); - - // ConstructL - void CVIMPSTStorageManager::ConstructL(); - - - private: - - // list of storage viewsn created for diff services - // owns - RPointerArray< CVIMPSTStorageServiceView > iServiceViewList; - - }; - -#endif // CVIMPSTSTORAGEMANAGER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststoragemanagerfactory.h --- a/uiservicetab/vimpststorage/inc/cvimpststoragemanagerfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2008 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: Declaration of CVIMPSTStorageManagerFactory - * -*/ - - - -#ifndef CVIMPSTSTORAGEMANAGERFACTORY_H -#define CVIMPSTSTORAGEMANAGERFACTORY_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CVIMPSTStorageManager; -class MVIMPSTStorageServiceView; -class MVIMPSTStorageItemModel; - -// CLASS DECLARATION - -/** - * Factory to create contact and group list interfaces. - * @lib vimpststorage.lib - * @since S60 5.0 - */ -class CVIMPSTStorageManagerFactory : public CBase - { - public: // New functions - - /** - * Initialises the Library - */ - IMPORT_C static void InitialiseLibraryL(); - - /** - * Release the resources allocated - */ - IMPORT_C static TInt Release(); - - /** - * Inititalises the Store for the Service Id - * Must be called before using ContactListInterfaceL, - * ItemInterfaceL API's. - * @param aServiceId service id - * @param aStoreName storename for this service - * @param aServiceName ServiceName - */ - IMPORT_C static void InitialiseViewL( TUint32 aServiceId, - const TDesC& aStoreName, - const TDesC& aServiceName) ; - - /** - * Returns the pointer to MVIMPSTStorageServiceView - * this pointer can be used to perform numerous operations on - * contacts - * @param aServiceId service id - * @return MVIMPSTStorageServiceView* instance of the contact list interface - */ - IMPORT_C static MVIMPSTStorageServiceView* ContactListInterfaceL(TUint32 aServiceId); - - - - /** - * Returns the pointer to MVIMPSTStorageItemModel - * this pointer can be used to perform numerous operations on - * contactlist - * @param aServiceId service id - * @return MVIMPSTStorageItemModel* interface to itemmodel - */ - IMPORT_C static MVIMPSTStorageItemModel* ItemModelInterfaceL( TUint32 aServiceId ) ; - - - }; - -#endif // CVIMPSTSTORAGEMANAGERFACTORY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststorageserviceview.h --- a/uiservicetab/vimpststorage/inc/cvimpststorageserviceview.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,454 +0,0 @@ -/* -* Copyright (c) 2008 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: Storage view implementation -* -*/ - -#ifndef CVIMPSTSTORAGESERVICEVIEW_H -#define CVIMPSTSTORAGESERVICEVIEW_H - - -// INCLUDES -#include -#include -#include - -#include "mvimpststorageserviceview.h" -#include "tvimpststoragepanics.h" -#include "tvimpstenums.h" -#include "mvimpststorageitemmodel.h" -#include "mvimpststorageactiveobserver.h" - -// FORWARD DECLARATIONS -class CVIMPSTStorageContactList; -class CVIMPSTStorageContactSorter; -class MVIMPSTStorageVPbkContactStore; -class MVPbkContactLink; -class CVIMPSTStorageActiveHandler; - -// CLASS DECLARATION - -NONSHARABLE_CLASS ( CVIMPSTStorageServiceView ): public CBase, - public MVIMPSTStorageServiceView, - public MVIMPSTStorageServiceCacheWriter, - public MVIMPSTStorageItemModel, - public MVIMPSTStorageActiveObserver - - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CVIMPSTStorageServiceView* NewL(TUint32 aServiceId, const TDesC& aStoreName, - const TDesC& aServiceName); - - /** - * Destructor. - */ - ~CVIMPSTStorageServiceView(); - - public: // New functions - - - TUint32 GetServiceId(); - - public: // Functions from base classes - - /** - * From MVIMPSTStorageServiceView - */ - void AddObserverL( MVIMPSTStorageContactsObserver* aObserver ) ; - - /** - * From MVIMPSTStorageServiceView - */ - void RemoveObserver( MVIMPSTStorageContactsObserver* aObserver ) ; - - /** - * From MVIMPSTStorageServiceView - */ - MVIMPSTStorageContact* FindContactByUserId( const TDesC& aUserId ) ; - - /** - * From MVIMPSTStorageServiceView - */ - MVIMPSTStorageContact* FindContactByLink(const MVPbkContactLink& aContactLink ) ; - - /** - * From MVIMPSTStorageServiceView - */ - TInt ListCount() const ; - - - /** - * From MVIMPSTStorageServiceView - */ - MVIMPSTStorageContactList& ListAt( TInt aIndex ) const ; - - - /** - * From MVIMPSTStorageServiceView - */ - MVIMPSTStorageContactList* FindContactList( const TDesC& aListId ) ; - - - /** - * From MVIMPSTStorageServiceView - */ - MVIMPSTStorageContactList* CreateContactListL( const TDesC& aContactListId, - const TDesC& aDisplayName ) ; - - - /** - * From MVIMPSTStorageServiceView - */ - void RemoveContactList( const TDesC& aContactListId ) ; - - - - /** - * From MVIMPSTStorageServiceView - */ - TInt ContactCount( TBool aSkipOfflineContacts = EFalse ) const ; - - - /** - * Update presence information of contact. - * @param aContactId Id of contact which presence is updated. - * @param aStatus. New presence status - * @param aAlias. New alias. - * @param aStatusText New status message text. - * @return MVIMPSTStorageContact* pointer of the contact - */ - MVIMPSTStorageContact* UpdatePresenceL(const TDesC& aContactId, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aStatusText, - const TDesC8& aAvatarData, - TBool aIsClearingAvatar = EFalse) ; - - /** - * Update presence information of contact. - * @param aContactId Id of contact which presence is updated. - * @param aStatus. New presence status - * @param aAlias. New alias. - * @param aStatusText New status message text. - * @return MVIMPSTStorageContact* pointer of the contact - */ - MVIMPSTStorageContact* UpdateAvatarL(const TDesC& aContactId, - const TDesC8& aAvatarData ) ; - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - MVIMPSTStorageContact* CreateNewContactL(const TDesC& aUserId, - const TDesC& aDisplayName = KNullDesC, - TBool aIsInvitationItem = EFalse, - TBool aInvitationAutoAccept = EFalse) ; - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - TInt CreateNewContactFromRetrivedIdL( TInt aIndexToUse ); - - /** - * remove contact ot the virtual phonebook. - * @param aContact contact id to be removed. - */ - TInt DeleteNewContactFromRetrivedIdL( TInt aIndexToUse ); - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - void CreateNewFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ) ; - - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - TInt RemoveContactL( MVIMPSTStorageContact* aContact ) ; - - - /** - * From MVIMPSTStorageServiceView - */ - TBool IsLocalStore() const ; - - /** - * From MVIMPSTStorageServiceView - */ - void SetOwnUserIdL( const TDesC& aUserId ); - - - /** - * From MVIMPSTStorageServiceView - */ - TInt RetriveLinkXSPIdsL(const TDesC8& aContactPackLink ); - - /** - * From MVIMPSTStorageServiceView - */ - const TDesC& GetRetrieveXSPIdL(TInt aIndex ) ; - - /** - * From MVIMPSTStorageServiceView - */ - MVIMPSTStorageContact& OwnContactL(); - - /** - * From MVIMPSTStorageServiceView - */ - void DeleteDatabaseL(); - - /** - * From MVIMPSTStorageServiceView - */ - void SetUnnamedTextL(HBufC* aUnnamedText ); - - public: // MVIMPSTStorageServiceCacheWriter - - /** - * update existing contact - * @param aContactLink contact id to be updatated - * @param aUserId contact id to be updated - * @param aDisplayName contact display name to be updated - * @reurn the storage contact pointer if found else NULL - */ - MVIMPSTStorageContact* UpdateCacheContactL(const MVPbkContactLink& aContactLink, - const TDesC& aUserId, - const TDesC& aDisplayName, - const TDesC8& aAvatarContent ) ; - - /** - * add a new contact to cache - * @param aContactLink contact id to be add - * @param aUserId contact id to be add - * @param aDisplayName contact display name to be add - * @reurn the new storage contact pointer if contact is already exist return the smae - - */ - MVIMPSTStorageContact* AddContactToCacheL(const MVPbkContactLink& aContactLink, - const TDesC& aUserId, - const TDesC& aDisplayName, - const TDesC8& aAvatarContent, - TVIMPSTEnums::TVIMPSTStorgaeEventType aType ) ; - - /* - * remopve existing contact - * @param aContactLink contact id to be removed - * @param aUserId contact id to be removed - * @param aDisplayName contact display name to be removed - * @reurn the error if any - */ - TInt RemoveContactFromCacheL(const MVPbkContactLink& aContactLink,TVIMPSTEnums::TVIMPSTStorgaeEventType aType ) ; - - - /** - * Removes all contacts from cache and notify to observers - */ - void RemoveAllCacheContactsL() ; - - /** - * Read the default contact list if exist else create default list - * @return contact list pointer - */ - MVIMPSTStorageContactList* GetDefaultContactListL() ; - - /** - * find contact by user id - * @param aUserId contact id to be find - * @return storage contact pointer if found else NULL - */ - MVIMPSTStorageContact* FindCacheContactByUserId( const TDesC& aUserId ) ; - - - /** - * find contact by user id - * @param aContactLink contact link to be find - * @return storage contact pointer if found else NULL - */ - MVIMPSTStorageContact* FindCacheContactByLink(const MVPbkContactLink& aContactLink) ; - - /** - * add contact to the contact cache and notify the observers - * @param aContact contact id to be added. - */ - TInt AddStorageContactToCacheL(MVIMPSTStorageContact* aContactToAdd ); - - /** - * add contact to the contact cache and notify the observers - * @param aContact contact id to be added. - */ - void NotifyServiceViewL( TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType, - MVIMPSTStorageContact* aContact = NULL ) ; - - public : //MVIMPSTStorageActiveObserver - - /** - * This call is made when the waiting completes - * @param aError error code for waiting error, KErrNone if completes without error - * - */ - void HandleDelayedNotificationL(TVIMPSTEnums::TVIMPSTStorgaeEventType aType, - MVIMPSTStorageContactList *aList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex) ; - private: - - - /** - * C++ default constructor. - */ - CVIMPSTStorageServiceView(TUint32 aServiceId); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(const TDesC& aStoreName, const TDesC& aServiceName); - - - CVIMPSTStorageContactList* FindContactListInternal( const TDesC& aListId ); - - - TInt FindContactListById(const TDesC& aListId ); - - // TLinearOrder - static TInt ContactListOrderByDisplayName( - const CVIMPSTStorageContactList& aContactA, - const CVIMPSTStorageContactList& aContactB ); - - static TBool ContactListFindByContactListId( - const CVIMPSTStorageContactList& aContactA, - const CVIMPSTStorageContactList& aContactB ); - - - /** - * Notify all the observers about the given event - * @param aType The type of observer event - * @param aContact The contact in question - * (or -1 == KCAStorageDontKnowPos to force search for given contact id - * in aParameter) - * @param aFromPEC, ETrue, if event is coming from PEC - */ - void NotifyAllObserversL( TVIMPSTEnums::TVIMPSTStorgaeEventType aType, - MVIMPSTStorageContactList* aContactList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ); - - /** - * Notify all the observer about the given event after small delay - * If new notify events come during delay, then notify is "shifted" - * with new delay time and notify event is change to "multiplechanges". - * @param aType The type of observer event - * @param aContact The contact in question - * (or -1 == KCAStorageDontKnowPos to force search for given contact id - * in aParameter) - * @param aFromPEC, ETrue, if event is coming from PEC - */ - void NotifyAllObserversWithDelay( TVIMPSTEnums::TVIMPSTStorgaeEventType aType, - MVIMPSTStorageContactList* aContactList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ); - - - public : // from MVIMPSTStorageItemModel - - /** - * @return Count of items - */ - TInt Count() const; - - /** - * Returns List item at given index. - * @param aIndex - * @return List item - */ - MVIMPSTStorageItemModel::SItem Item( TInt aIndex ) const; - - /** - * @see MVIMPSTStorageItemModel - */ - TInt IndexOfContact( MVIMPSTStorageContact* aContact ) const; - - /** - * @see MVIMPSTStorageItemModel - */ - TInt IndexOfList( MVIMPSTStorageContactList* aList, - TBool aIgnoreOwnItem /*= EFalse*/, - TBool aIgnoreEmptyLists /*= ETrue*/ ) const; - - public : - - /** - * Sets the correct sorting method to storage - * according to current setting value - */ - void SetSort(); - - /** - * sort the contacts of list - * according to current setting value - */ - void Sort( const TDesC& aContactListId = KNullDesC ); - - - protected: // Functions from MDesCArray - - /** - * @see MDesCArray - */ - TInt MdcaCount() const; - - /** - * @see MDesCArray - */ - TPtrC MdcaPoint(TInt aIndex) const; - - private: // Data - - // observers list, used with MVIMPSTStorageServiceView inherited methods - RPointerArray< MVIMPSTStorageContactsObserver > iContactObservers; - - // list of contacts - RPointerArray< CVIMPSTStorageContactList > iContactListArray; // owns - - //Service ID - TUint32 iServiceId; - // owns : pointer to service store ,Local/Server - MVIMPSTStorageVPbkContactStore* iVPbkContactStore; - - /// Sorter for contacts. Owns - CVIMPSTStorageContactSorter* iContactSorter; - - /// Contact for own data - MVIMPSTStorageContact* iOwnContact; - /// Owns : refreshTimer - CVIMPSTStorageActiveHandler* iActiveHandler; - - // if ETrue meaning a invitation is getting added to cache - TBool iIsInvitationItem; - - // owns : unnamed text - HBufC* iUnNamedText; - - }; - -#endif // CVIMPSTSTORAGESERVICEVIEW_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststoragevpbklocalstore.h --- a/uiservicetab/vimpststorage/inc/cvimpststoragevpbklocalstore.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,329 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that provides handling of vpbk local store -* -*/ - - -#ifndef C_CVIMPSTSTORAGELOCALSTORE_H -#define C_CVIMPSTSTORAGELOCALSTORE_H - -#include -#include -#include - -#include "mvimpststoragevpbkcontactstore.h" -#include "mvimpststoragevpbkstorehandler.h" - -//forward declaration -class CVIMPSTStorageVPbkStoreHandler; -class MVPbkViewContact; -class CVPbkContactIdConverter; -class MVIMPSTStorageVPbkStoreHandler; -class MVIMPSTStorageServiceCacheWriter; -class MVPbkContactLink; -class MVPbkStoreContact; -class CVPbkContactLinkArray; -class MVIMPSTStorageContact; - -// CLASS DECLARATION -/** - * vpbk local store - * This class implements the use of Virtual Phonebook for Local Store(Contacts.cdb) - * - * @lib vimpststorage.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTStorageVPbkLocalStore ) : public CActive, - public MVIMPSTStorageVPbkContactStore, - public MVIMPSTStorageVPbkStoreHandler - - - { - - public: - - /** - * Two-phased constructor. - * - * @param aContactDb, contact database - * @param aListId, Default List ID - * @param aServiceId - Service Id - * @param aServiceName - Service Name - * @param aStorageView, Ref to Storage (CVIMPSTStorageViewId) - */ - static CVIMPSTStorageVPbkLocalStore* NewL(const TDesC& aContactDb, const TDesC& aServiceName, - MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ); - - /** - * Two-phased constructor. - * - * @param aContactDb, contact database - * @param aListId, Default List ID - * @param aServiceId - Service Id - * @param aServiceName - Service Name - * @param aStorageView, Ref to Storage (CVIMPSTStorageViewId) - */ - static CVIMPSTStorageVPbkLocalStore* NewLC( const TDesC& aContactDb, const TDesC& aServiceName, - MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ); - - /** - * Standard C++ destructor - */ - ~CVIMPSTStorageVPbkLocalStore(); - - public: // from MVIMPSTStorageVPbkContactStore - - /** - * See @MVIMPSTStorageVPbkContactStore - * @ return ETrue - **/ - TBool LocalStore() const ; - - TInt CreateVPbkContactL( const TDesC& aUserId, - const TDesC& aDisplayName, - TBool aInvitationAutoAccept = EFalse) ; - - TInt RemoveVPbkContactL(const MVPbkContactLink& aContactLink) ; - - TInt RemoveVPbkContactsL(const MVPbkContactLink& aContactLink) ; - - TInt RetrieveVPbkXSPIdL(const TDesC8& aPackedLinks ) ; - - TInt CreateRetriveVPbkContactL(TInt aIndexToUse ) ; - - TInt deleteRetriveVPbkContactL(TInt aIndexToUse ) ; - - TInt UpdateAvatarFieldDataL(const MVPbkContactLink& aContactLink, - const TDesC8& aAvatartData ); - - TInt RemoveAvatarFieldL(MVPbkStoreContact& aStoreContact); - - - void AddVPbkFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ) ; - - TInt RemoveAllVPbkContactsL() ; - - const TDesC& GetRetrieveVPbkXSPIdL(TInt aIndex ) ; - - void DeleteDatabaseL() ; - - public : // MVIMPSTStorageVPbkStoreHandler - /** - * From MVPbkContactStoreObserver - * Callback: Store event occured - * - * @since S60 5.0 - * @param aContactStore, contact store - * @param aStoreEvent, event - */ - void HandleVPbkStoreEventL(TVIMPSTVPbkStoreEvent aVPbkStoreEvent) ; - - private: // From CActive - void RunL(); - void DoCancel(); - TInt RunError(TInt aError ); - - private: - - /** - * Issues Request - * - */ - void IssueRequest(); - - - private: - - /** - * Check if database exists - * @return ETrue, if database exists. - */ - TBool DbExists(); - - /** - * Creates new CPermanentFileStore stream and creates database on it. - */ - void CreateDbL(); - - /** - * Open existing database. - */ - - void OpenDbL(); - - - /** - * Close database. - */ - void CloseDb(); - - /* - * Create tables to database - */ - void CreateTablesL(); - - - /** - * Add a column to colset - * @param aName Name of column - * @param aType Type of column - * @param aColset Colset, where column is added. - * @param aMaxLength Maximum column length - * 0 = use columns default value - */ - void AddColumnL( const TDesC& aName, TDbColType aType, - CDbColSet* aColset ); - - - /* - * Leaves if free diskspace is low. - * @param aSize amount of free diskspace needed. - */ - void DoFreespaceLevelCheckL( TInt aSize ); - - - /** - * Opens database table - */ - void OpenTableL(); - - /** - * Closes database table - */ - void CloseTable(); - - - /** - * Seek a specific row with given contactlink in the database file. - * @param aColNo The column number (KContactLink) - * @param aContactLink - Packed Contact Link - * @return ETrue if seek successful, otherwise EFalse - */ - TBool SeekRowL( TDbColNo aColNo, TDesC8& aContactLink ); - - - /** - * Seek a specific row with given contact identifier in the database file. - * @param aColNo The column number (KContactId) - * @param aContactId - Contact identifier - * @return ETrue if seek successful, otherwise EFalse - */ - TBool SeekRowL( TDbColNo aColNo, TInt32& aContactId ); - - - /** - * Write the given data to the database file - * @param aContactLink - Packed Contact Link - * @param aIdentifier - Contact identifier - */ - void WriteToStoreDbL( TInt32& aIdentifier ); - - - /** - * Reads first contact from storage - * @param aContactLink - Packed Contact Link - * @return KErrNone, if successful. - */ - void ReadCurrentL( TInt32& aContactLink); - - - /** - * Reads next contact from storage - * @param aContactLink - Packed Contact Link - * @return KErrNone, if successful. - */ - TInt ReadNextL( TInt32& aContactId ); - - /** - * Reads first contact from storage - * @param aContactLink - Packed Contact Link - * @return KErrNone, if successful. - */ - TInt ReadFirstL( TInt32& aContactLink ); - - - /* - * Deletes contact from storage - * @param aContactId - Contact Identifier of the Contact to Delete - */ - void DeleteContactFromInternalStoreL( TInt32& aContactId ); - - void DeleteAllContactFromInternalStoreL(); - - - private: // Implementation - - /** - * Standard C++ constructor - */ - CVIMPSTStorageVPbkLocalStore(MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter); - - /** - * Performs the 2nd phase of construction. - * - * @param aContactDb, contact database address - * @param aServiceName, service name - */ - void ConstructL(const TDesC& aContactDb, const TDesC& aServiceName ); - - /* - * helper method for deleting entry from iFetchContactsToBeAdded - */ - void ResetAndDestroyLocalArrayL(); - - /* - * compare both string without colon part - * return ETrue if both contact are same - */ - TBool IsSameContactIdL(const TDesC& aFirstId, const TDesC& aSecondId ); - - private: // Data - - MVIMPSTStorageServiceCacheWriter& iServiceCacheWriter; - // Own: pointer to a class which interact with Virtual phonebook - CVIMPSTStorageVPbkStoreHandler* iVPbkStoreHandler; - - // own , contact id converter to and from link - CVPbkContactIdConverter* iIdConverter; - - //Ownns - DB Store - CPermanentFileStore* iFileStore; - - //File Stream - RFs iFs; - - //DataBase Object for Creating/Opening/Closing DB - RDbStoreDatabase iDb; - - // current column set - CDbColSet* iColset; // owned - - RDbTable iTable; // current table - - HBufC* iLocalDBName; - - RArray iFetchContactsToBeAdded; - - TVIMPSTFetchingSteps iFetchStep; - - RPointerArray iRetrivedContactArray; - // owns : id of invitation geting accepted - HBufC* iInviteId; - }; - -#endif // C_CVIMPSTSTORAGELOCALSTORE_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststoragevpbkserverstore.h --- a/uiservicetab/vimpststorage/inc/cvimpststoragevpbkserverstore.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,175 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that provides handling of vpbk server store -* -*/ - - -#ifndef C_CVIMPSTSTORAGESERVERSTORE_H -#define C_CVIMPSTSTORAGESERVERSTORE_H - -#include -#include "mvimpststoragevpbkcontactstore.h" -#include "mvimpststoragevpbkstorehandler.h" - -class CVIMPSTStorageVPbkStoreHandler; -class MVIMPSTStorageServiceCacheWriter; -class MVPbkContactLink; -class MVPbkStoreContact; -class MVIMPSTStorageContact; - -// CLASS DECLARATION -/** - * vpbk local store - * This class implements the use of Virtual Phonebook for Local Store(Contacts.cdb) - * - * @lib vimpststorage.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTStorageVPbkServerStore ) : public CActive, - public MVIMPSTStorageVPbkContactStore, - public MVIMPSTStorageVPbkStoreHandler - { - - public: - - - /** - * Two-phased constructor. - * - * @param aContactDb, contact database - * @param aListId, Default List ID - * @param aServiceId - Service Id - * @param aServiceName - Service Name - * @param aStorageView, Ref to Storage (CVIMPSTStorageViewId) - */ - static CVIMPSTStorageVPbkServerStore* NewL(const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ); - - /** - * Two-phased constructor. - * - * @param aContactDb, contact database - * @param aListId, Default List ID - * @param aServiceId - Service Id - * @param aServiceName - Service Name - * @param aStorageView, Ref to Storage (CVIMPSTStorageViewId) - */ - static CVIMPSTStorageVPbkServerStore* NewLC( const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ); - - /** - * Standard C++ destructor - */ - ~CVIMPSTStorageVPbkServerStore(); - - public: // from MVIMPSTStorageVPbkContactStore - - /** - * See @MVIMPSTStorageVPbkContactStore - * @ return ETrue - **/ - TBool LocalStore() const ; - - TInt CreateVPbkContactL(const TDesC& aUserId, - const TDesC& aDisplayName, - TBool aInvitationAutoAccept = EFalse ) ; - - TInt RemoveVPbkContactL(const MVPbkContactLink& aContactLink) ; - - TInt RetrieveVPbkXSPIdL(const TDesC8& aPackedLinks ) ; - - TInt CreateRetriveVPbkContactL(TInt aIndexToUse ) ; - - TInt deleteRetriveVPbkContactL(TInt aIndexToUse ) ; - - TInt UpdateAvatarFieldDataL(const MVPbkContactLink& aContactLink, - const TDesC8& aAvatartData ); - - TInt RemoveAvatarFieldL(MVPbkStoreContact& aStoreContact); - - - void AddVPbkFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ) ; - - const TDesC& GetRetrieveVPbkXSPIdL(TInt aIndex ) ; - - TInt RemoveAllVPbkContactsL(); - - - void DeleteDatabaseL(); - public : - /** - * From MVPbkContactStoreObserver - * Callback: Store event occured - * - * @since S60 5.0 - * @param aContactStore, contact store - * @param aStoreEvent, event - */ - void HandleVPbkStoreEventL(TVIMPSTVPbkStoreEvent aVPbkStoreEvent) ; - - private: // From CActive - void RunL(); - void DoCancel(); - TInt RunError(TInt aError ); - - private: - - /** - * Issues Request - * - */ - void IssueRequest(); - - private: // Implementation - - /** - * Standard C++ constructor - */ - CVIMPSTStorageVPbkServerStore(MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter); - - /** - * Performs the 2nd phase of construction. - * - * @param aContactDb, contact database address - * @param aServiceName, service name - */ - void ConstructL(const TDesC& aContactDb,const TDesC& aServiceName ); - - /* - * helper method for deleing the etry from iFetchContactsToBeAdded - */ - void ResetAndDestroyLocalArrayL(); - - - private: // Data - MVIMPSTStorageServiceCacheWriter& iServiceCacheWriter; - // Own: pointer to a class which interact with Virtual phonebook - CVIMPSTStorageVPbkStoreHandler* iVPbkStoreHandler; - // owns : fetched contacts - RArray iFetchContactsToBeAdded; - // owns - TVIMPSTFetchingSteps iFetchStep; - // owns : list of xsp id - RPointerArray iRetrivedXSPIdArray; - - - }; - -#endif // C_CVIMPSTSTORAGELOCALSTORE_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/cvimpststoragevpbkstorehandler.h --- a/uiservicetab/vimpststorage/inc/cvimpststoragevpbkstorehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,404 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that provides handling of vpbk store -* -*/ - - -#ifndef CVIMPSTSTOTRAGEVPBKSTOREHANDLER_H -#define CVIMPSTSTOTRAGEVPBKSTOREHANDLER_H - -// INCLUDES -#include -#include - -#include "mvimpststoragevpbkstorehandler.h" - -#include -#include -#include -#include -#include -#include - -#include - -// FORWARD DECLARATIONS -class MVPbkContactViewBase; -class MVPbkContactLink; -class CVPbkContactManager; -class MVPbkContactStoreList; -class MVPbkContactView; -class MVPbkStoreContact; -class MVPbkViewContact; -class CVPbkContactLinkArray; -class MVIMPSTStorageVPbkStoreHandler; -class CPbk2SortOrderManager; -class MVPbkContactOperationBase; -class MVPbkBaseContact; -class CVPbkContactLinkArray; - -// CLASS DECLARATION -/** - * vpbk store Handler - * This class implements the use of Virtual Phonebook for XSP Stores - * - * @lib vimpststorage.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTStorageVPbkStoreHandler ) : public CActive, - public MVPbkContactViewObserver, - public MVPbkContactStoreObserver, - public MVPbkContactStoreListObserver, - public MVPbkContactObserver, - public MVPbkBatchOperationObserver, - public MVPbkSingleContactOperationObserver - { - - struct TVIMPSTAvatarData - { - // owns - MVPbkContactLink* iContactLink; - // owns - HBufC8* iAvatarContent; - }; - public: - - /** - * Two-phased constructor. - * - * @param aContactDb, contact database - * @param aListId, Default List ID - * @param aServiceId - Service Id - * @param aServiceName - Service Name - * @param aStorageView, Ref to Storage (CVIMPSTStorageViewId) - */ - static CVIMPSTStorageVPbkStoreHandler* NewL(const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageVPbkStoreHandler& aStoreHandler, - TBool aLocalStore ); - - /** - * Two-phased constructor. - * - * @param aContactDb, contact database - * @param aListId, Default List ID - * @param aServiceId - Service Id - * @param aServiceName - Service Name - * @param aStorageView, Ref to Storage (CVIMPSTStorageViewId) - */ - static CVIMPSTStorageVPbkStoreHandler* NewLC(const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageVPbkStoreHandler& aStoreHandler, - TBool aLocalStore ); - - /** - * Standard C++ destructor - */ - ~CVIMPSTStorageVPbkStoreHandler(); - public : // - /** - * return vpbk store - * @param aUri uri of store - */ - MVPbkContactStore* GetDefaultStoreL( const TDesC& aUri ); - - TInt CreateVPbkContactL( const TDesC& aUserId, - const TDesC& aDisplayName ) ; - - TInt RemoveVPbkContactL(const CVPbkContactLinkArray& aContactLinkArray ) ; - - TInt RetrieveVPbkContactL(const TDesC8& aPackedLinks ); - - TInt UpdateAvatarFieldDataL(const MVPbkContactLink& aContactLink, - const TDesC8& aAvatartData ); - - TInt RemoveAvatarFieldL(MVPbkStoreContact& aStoreContact); - - TInt RemoveAllVPbkContactsL(); - - private: // From MVPbkContactViewObserver - - /** - * From MVPbkContactViewObserver - * Callback: Contact view is ready - * - * @since S60 5.0 - * @param aView, view that is ready - */ - void ContactViewReady( MVPbkContactViewBase& aView ); - - /** - * From MVPbkContactViewObserver - * Callback: Contact view is unavailable - * - * @since S60 5.0 - * @param aView, view that is unavailable - */ - void ContactViewUnavailable( MVPbkContactViewBase& aView ); - - /** - * From MVPbkContactViewObserver - * Callback: Contact is added to view - * - * @since S60 5.0 - * @param aView, view that contact was added to - * @param aIndex, position to where the contact was added to - * @param MVPbkContactLink, contact link of the added contact - */ - void ContactAddedToView( MVPbkContactViewBase& aView, - TInt aIndex, const MVPbkContactLink& aContactLink ); - - /** - * From MVPbkContactViewObserver - * Callback: Contact was removed from the view - * - * @since S60 5.0 - * @param aView, view that contact was removed from - * @param aIndex, position from where the contact was removed from - * @param MVPbkContactLink, contact link of the removed contact - */ - void ContactRemovedFromView( MVPbkContactViewBase& aView, - TInt aIndex, const MVPbkContactLink& aContactLink ); - - /** - * From MVPbkContactViewObserver - * Callback: Contact view error - * - * @since S60 5.0 - * @param aView, view that caused the error - * @param aError, error that occured - * @param aErrorNotified, was it notified - */ - void ContactViewError( MVPbkContactViewBase& aView, - TInt aError, TBool aErrorNotified ); - - private: // From MVPbkContactStoreObserver - - /** - * From MVPbkContactStoreObserver - * Callback: Contact store is ready - * - * @since S60 5.0 - * @param aContactStore, contact store - */ - void StoreReady( MVPbkContactStore& aContactStore); - - /** - * From MVPbkContactStoreObserver - * Callback: Store is unavailable - * - * @since S60 5.0 - * @param aContactStore, contact store - * @param aReason, error code - */ - void StoreUnavailable( MVPbkContactStore& aContactStore, TInt aReason); - - /** - * From MVPbkContactStoreObserver - * Callback: Store event occured - * - * @since S60 5.0 - * @param aContactStore, contact store - * @param aStoreEvent, event - */ - void HandleStoreEventL( MVPbkContactStore& aContactStore , - TVPbkContactStoreEvent aStoreEvent ); - - private: // From MVPbkContactStoreListObserver - - /** - * From MVPbkContactStoreListObserver - * Callback: List open is completed - * - * @since S60 5.0 - */ - void OpenComplete(); - - private: - /** - * From MVPbkContactObserver - */ - void ContactOperationCompleted(TContactOpResult aResult); - - /** - * From MVPbkContactObserver - */ - void ContactOperationFailed( TContactOp aOpCode, - TInt aErrorCode, - TBool aErrorNotified); - - private: // From MVPbkBatchOperationObserver - void StepComplete( MVPbkContactOperationBase& aOperation, - TInt aStepSize ); - TBool StepFailed( MVPbkContactOperationBase& aOperation, - TInt aStepSize, TInt aError ); - void OperationComplete( MVPbkContactOperationBase& aOperation ); - - public: // From MVPbkSingleContactOperationObserver - - /** - * from MVPbkSingleContactOperationObserver. - * Called when the operation is completed. - * - * A client has the operation as a member and it can delete the operation - * instance in this function call. If the implementation of the store - * calls the function from the operation instance it must not handle - * any member data after calling it. - * - * @param aOperation The completed operation. - * @param aContact The contact returned by the operation. - * A client must take the ownership immediately. - * - * NOTE: - * If you use CleanupStack for MVPbkStoreContact - * Use MVPbkStoreContact::PushL or - * CleanupDeletePushL from e32base.h. - * (Do Not Use CleanupStack::PushL(TAny*) because - * then the virtual destructor of the M-class - * won't be called when the object is deleted). - * @since S60 v5.0 - */ - void VPbkSingleContactOperationComplete( - MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact); - - /** - * from MVPbkSingleContactOperationObserver. - * Called if the operation fails. - * - * A client has the operation as a member and it can delete the operation - * instance in this function call. If the implementation of the store - * calls the function from the operation instance it must not handle - * any member data after calling it. - * - * @param aOperation The failed operation. - * @param aError An error code of the failure. - * @since S60 v5.0 - */ - void VPbkSingleContactOperationFailed( - MVPbkContactOperationBase& aOperation, - TInt aError); - - private: // From CActive - void RunL(); - void DoCancel(); - TInt RunError(TInt aError ); - - private: - - /** - * Issues Request - * - */ - void IssueRequest(); - - void HandleContactViewReadyL( MVPbkContactViewBase& aView ); - - void DoHnadleSingleContactOperationCompleteL( MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact ); - - void DoHnadleOpenCompleteL(); - - void RetriveFieldDataAndSendEventL(const MVPbkStoreContact& aContact ); - - /** - * destroys the content of RArray. - */ - void ResetAndDestroyRArray(); - - private: // Implementation - - /** - * Standard C++ constructor - */ - CVIMPSTStorageVPbkStoreHandler( MVIMPSTStorageVPbkStoreHandler& aStoreHandler,TBool aLocalStore ); - - /** - * Performs the 2nd phase of construction. - * - * @param aContactDb, contact database address - * @param aServiceName, service Name - */ - void ConstructL( const TDesC& aContactDb,const TDesC& aServiceName ); - - - HBufC* GetContactFieldDataLC(const MVPbkStoreContact& aContact, - TInt aFieldResId ) ; - - /** - * To get the avatar data - * - * @param aContact, contact - * @param aFieldResId, field id - */ - HBufC8* GetContactBinaryFieldDataLC(const MVPbkStoreContact& aContact, - TInt aFieldResId ); - - /** - * check if any pending add contacts - * commit if pending - */ - void CommitNextPendingContactsL() ; - - private: // Data - // Not owns reference to contactStore - MVIMPSTStorageVPbkStoreHandler& iStoreHandler; - // Own: Virtual phonebook - CVPbkContactManager* iContactManager; - // Not own, Contact store list owned by the contact - // manager, do not delete - MVPbkContactStoreList* iStores; - // Not own, Contact store owned by the contact - // manager, do not delete - MVPbkContactStore* iStore; - // Own, contact view containing contacts in store - MVPbkContactView* iContactView; - //OWN: Active scheduler wait for waiting the completion - CActiveSchedulerWait iWait; - // owns : Service store name - HBufC* iStoreName; - // Own, sort order manager - CPbk2SortOrderManager* iSortOrderManager; - // owns : service name - HBufC* iServiceName; - // owns : a vpbk store contact - MVPbkStoreContact* iStoreContact; - // owns : operation contact - MVPbkContactOperationBase* iContactOperation; - // owns : a contact Link; - MVPbkContactLink* iContactLink; - // owns : results - TInt iOperationError; - // owns : Store event type - TVIMPSTVPbkStoreEventType iStoreEventType; - // owns : fetching index - TInt iFetcingIndex; - // owns : adding of contact is in progress - HBufC* iAddIdInProgress; - // ETrue if local store used - TBool iLocalStore; - // is contact operation is in use - TBool iCommitOperationInProgress; - // owns : synch contact which are overlapping or pending contacts - RPointerArray iUnCommittedVPbkContacts; - - // owns : synch avatars which are overlapping or pending avatars - RArray iPendingAvatars; - - }; - -#endif // CVIMPSTSTOTRAGEVPBKSTOREHANDLER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/mvimpststorageactiveobserver.h --- a/uiservicetab/vimpststorage/inc/mvimpststorageactiveobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2008 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: This interface is used to observer refresh timer lauch -* -*/ - - -#ifndef __MVIMPSTSTORAGEREFRESHTIMEROBSERVER_H -#define __MVIMPSTSTORAGEREFRESHTIMEROBSERVER_H - -#include -#include "tvimpstenums.h" - -class MVIMPSTStorageContactList; -class MVIMPSTStorageContact; - -class MVIMPSTStorageActiveObserver - { - public: - - /** - * This call is made when the waiting completes - * @param aError error code for waiting error, KErrNone if completes without error - * - */ - virtual void HandleDelayedNotificationL(TVIMPSTEnums::TVIMPSTStorgaeEventType aType, - MVIMPSTStorageContactList *aList , - MVIMPSTStorageContact* aContact, - TInt aContactIndex) = 0; - - /** - * Virtual destructor - */ - virtual ~MVIMPSTStorageActiveObserver() {}; - }; - -#endif // __MVIMPSTSTORAGEREFRESHTIMEROBSERVER_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/mvimpststoragecontact.h --- a/uiservicetab/vimpststorage/inc/mvimpststoragecontact.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/* -* Copyright (c) 2008 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: Stored contact data interface (getters/setters) -* -*/ - - - -#ifndef MVIMPSTSTORAGECONTACT_H -#define MVIMPSTSTORAGECONTACT_H - -#include -#include "tvimpstenums.h" -// CLASS DECLARATION -class MVPbkContactLink; -class MVIMPSTStorageVPbkContactStore; - -/** - * Getter/Setter interface for contacts. - * - * @lib vimpststorage.dll - * @since 5.0 - */ -class MVIMPSTStorageContact - { - public: // Definitions - - /** - * An Enum - * to define which sorting algorithm need to be used to sort contacts. - */ - - enum TSortAlgorithm - { - ECompareAlphabetically, /* sort alphabetically */ - ECompareByPresence /* sort based on presence */ - }; - - public: // Interface - /** - * Avatar data - * this returns the avatar data of available else Knulldec8 - * - * @return TDesC8& avatar content of this contact or knulldec8 - */ - virtual const TDesC8& AvatarContent() const = 0; - - /** - * User id - * @return TDesC& User ID of this contact - */ - virtual const TDesC& UserId() const = 0; - - /** - * User id - * @return TDesC& User ID of this contact - */ - virtual const TDesC& Name() const = 0; - - /** - * Online status - * @return TOnlineStatus On-line status of this contact - */ - virtual TVIMPSTEnums::TOnlineStatus OnlineStatus() const = 0; - - /** - * Set online status - * @param aOnlineStatus, online status to be set. - */ - virtual void SetOnlineStatus( TVIMPSTEnums::TOnlineStatus aOnlineStatus ) = 0; - - /** - * Set User ID - * @param aUserId, user id to be set. - */ - virtual void SetUserIdL( const TDesC& aUserId ) = 0; - - - virtual void SetAvatarContentL( const TDesC8& aAvatarContent , - MVIMPSTStorageVPbkContactStore& aVPPkStoreHandler) = 0 ; - - /** - * Set User ID - * @param aUserId, user id to be set. - */ - virtual void SetNameL( const TDesC& aName ) = 0; - - /** - * Get the status text for the contact - * @return TDesC& reference to the status text. - */ - virtual const TDesC& StatusText() const = 0; - - /** - * Set Status Text - * @param aStatusText, status text to be set. - */ - virtual void SetStatusTextL( const TDesC& aStatusText ) = 0; - - /** - * Returns virtual phonebook contact link of this contact - * - * @since S60 5.0 - * @return MVPbkContactLink*, virtual phonebook contact link. Can be NULL - */ - virtual MVPbkContactLink* ContactLink() const = 0; - - - virtual void SetAvatarIndex(TInt aIndex ) = 0 ; - - - virtual TInt AvatarIndex() const = 0; - - /** - * Destruction. - */ - virtual ~MVIMPSTStorageContact(){}; - }; - -#endif // MVIMPSTSTORAGECONTACT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/mvimpststoragecontactlist.h --- a/uiservicetab/vimpststorage/inc/mvimpststoragecontactlist.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,156 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact list container implementation -* -*/ - - - -#ifndef MVIMPSTSTORAGECONTACTLIST_H -#define MVIMPSTSTORAGECONTACTLIST_H - -// INCLUDES -#include "tvimpstenums.h" - -#include - -// FORWARD DECLARATIONS -class MVIMPSTStorageContact; -class MVPbkContactLink; -// CLASS DECLARATION - -/** - * Contact list data interface - * - * @lib vimpststorage.dll - * @since 5.0 - */ -class MVIMPSTStorageContactList - { - public: // Definitions - /** - * An Enum - * to define the sync state of the contact list. - * not used. - */ - enum TSynchroniseState - { - ESynchroniseNotDone, /* sync not done */ - ESynchroniseDone, /* sync done */ - ESynchroniseFailed /* sync failed. */ - }; - - public: // New functions - - /** - * List id of contact list - * @return TDesC& List id of contact list. - */ - virtual const TDesC& ListId() const = 0; - - /** - * Displayname of contact list - * @return TPtrC Display name of list. - * If displayname is not set, Id part of list id is returned. - */ - virtual TPtrC DisplayName() const = 0; - - - /** - * Count of items in list - * @return count of contacts. - */ - virtual TInt Count() const = 0; - - /** - * Get list item by index from list. - * @param aIndex. Index of item. - * @return MVIMPSTStorageContact& Contact in index. - */ - virtual MVIMPSTStorageContact& operator[]( TInt aIndex ) const = 0; - - /** - * Get Filtered list item by index from list - * @param aIndex. Index of Filtered item. - * @param aFilter. Filters the contacts according to this filter. - * @return MVIMPSTStorageContact& contact in index upon the filter. - */ - virtual MVIMPSTStorageContact& FilteredContact( - TInt aIndex, TVIMPSTEnums::TFilterType aFilter ) const = 0; - - /** - * Count of non-blocked items in list - * @return TInt count of non-blocked contacts - */ - virtual TInt FilteredCount( TVIMPSTEnums::TFilterType aFilter ) const = 0; - - /** - * Sort the contact list - */ - virtual void Sort()= 0; - - /** - * Find index of contact in list. - * @param aContact. Contact item to be found. - * @param aFilter. Filters the contacts according to this filter. - * @return TInt index of contact or KErrNotFound, if contact is not found. - */ - virtual TInt FindIndexOfContact( - const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter = - TVIMPSTEnums::EFilterAll ) const = 0; - - /* - * Checks if the contact should be shown according to the filter - * @param aContact Contact to check - * @param aFilter Tells which contacts should be shown - * @return TBool ETrue if contact should be shown according - * to the given filter. EFalse otherwise. - */ - virtual TBool FilterAllowsContact( const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter ) const = 0; - - /** - * Resorts the contacts in the list according the presence updation. - * @param aContact contact id whose presence has been updated. - */ - virtual void ResortContact( MVIMPSTStorageContact* aContact ) = 0; - - - /** - * add contact to list - * @param aContact. Contact item to be added. - * @param index of index - */ - virtual TInt AddStorageContactToCacheL( MVIMPSTStorageContact* aContact, TInt& aIndex ) = 0 ; - - - /** - * Remove contact from list - * @param aContactLink. Contact Link of the item to be removed. - */ - virtual TInt RemoveContactFromCacheL( const MVPbkContactLink& aContactLink, TInt& index ) = 0 ; - - protected: // Constructors and destructor - - /** - * Destructor. - */ - ~MVIMPSTStorageContactList(){}; - }; - - -#endif // MVIMPSTSTORAGECONTACTLIST_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/mvimpststoragecontactsobserver.h --- a/uiservicetab/vimpststorage/inc/mvimpststoragecontactsobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact data container observer interface -* -*/ - - - -#ifndef MVIMPSTSTORAGECONTACTSOBSERVER_H -#define MVIMPSTSTORAGECONTACTSOBSERVER_H - -#include -#include "tvimpstenums.h" - -class MVIMPSTStorageContact; -class MVIMPSTStorageContactList; - -// CLASS DECLARATION - -/** - * Interface for contact data container observer - * - * @lib vimpststorage.dll - * @since 5.0 - */ -class MVIMPSTStorageContactsObserver - { - public: // New functions - - /** - * Called when a contact or list is about to change, or has been changed. - * @param aList List that is changed. Can be NULL if contact is changed. - * @param aContact Contact that is changed. Can be NULL if list is changed - * @param aEventType The type of event: EStorageEventPreChange before - * the change (contact still has the old information), or - * EStorageEventPostChange after the change took place - * (contact has new information) - * @param aUserIdChanged, ETrue if userid has been changed else EFalse. - */ - virtual void HandleStorageChangeL( TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType, - MVIMPSTStorageContactList* aList, - MVIMPSTStorageContact* aContact , - TInt aContactIndex ) = 0; - - /** - * Virtual destructor - */ - virtual ~MVIMPSTStorageContactsObserver() {}; - }; - -#endif // MVIMPSTSTORAGECONTACTSOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/mvimpststorageitemmodel.h --- a/uiservicetab/vimpststorage/inc/mvimpststorageitemmodel.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/* -* Copyright (c) 2008 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: MVIMPSTStorageItemModel -* -*/ - - - -#ifndef MVIMPSTSTORAGECONTACTLISTMODEL_H -#define MVIMPSTSTORAGECONTACTLISTMODEL_H - -// INCLUDES -#include "tvimpstenums.h" - -#include -#include - -// FORWARD DECLARATIONS -class MVIMPSTStorageContactList; -class MVIMPSTStorageContact; - -// CLASS DECLARATION - -/** - * Contact list model for UI. - * Wrapper between UI and storage, hides multiple contact list handling logic. - * - * @lib vimpststorage.lib - * @since 5.0 - */ -class MVIMPSTStorageItemModel : public MDesCArray - { - - public: // Enumerations and typedefs - - /** - * An Enum - * To define Type of the item. - * not used. - */ - enum TItemType - { - EInvalid, /* Not a valid item*/ - EOwnStatus, /* own data item*/ - EContactList, /* Contact list item*/ - EContactItem, /* contact item*/ - EAll /* all item includes owndata, contactlist, contact */ - }; - - /** - * structure - * To package the data of type of item(contact list/contact) - * if its a contactl list the third variable iContact will be null. - * not used. - */ - struct SItem - { - TItemType iType;/*Type of the item*/ - MVIMPSTStorageContactList* iContactList; /*ocntact list*/ - MVIMPSTStorageContact* iContact;/*contact*/ - }; - - public: // New functions - - /** - * @return TInt Count of items - */ - virtual TInt Count() const = 0; - - /** - * Returns List item at given index. - * @param aIndex - * @return SItem List item - */ - virtual SItem Item( TInt aIndex ) const = 0; - - - /** - * Get index for contact. - * @param aContact. Contact item to be found. - * @return TInt Index of contact. If contact not found returns KErrNotFound - */ - virtual TInt IndexOfContact( MVIMPSTStorageContact* aContact ) const = 0; - - /** - * Get index for list - * @param aList. Contact item to be found. - * @param aIgnoreOwnItem. If ETrue own item is not taken into account - * when resolving index. - * @param aIgnoreEmptyLists If ETrue, empty lists are ignored. - * @return TInt Index of list. If list not found returns KErrNotFound - */ - virtual TInt IndexOfList( MVIMPSTStorageContactList* aList, - TBool aIgnoreOwnItem = EFalse, - TBool aIgnoreEmptyLists = ETrue ) const = 0; - - - - - - public: // From MDesCArray - - /** - * @see MDesCArray - */ - TPtrC MdcaPoint( TInt aIndex ) const = 0; - - /** - * @see MDesCArray - */ - TInt MdcaCount() const = 0; - - - - protected: // prevent deletion through this interface - - /** - * Destructor. - */ - virtual ~MVIMPSTStorageItemModel() {}; - - }; - -#endif // MVIMPSTStorageContactListModel_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/mvimpststorageserviceview.h --- a/uiservicetab/vimpststorage/inc/mvimpststorageserviceview.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,300 +0,0 @@ -/* -* Copyright (c) 2008 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: Stored contact data container interface -* -*/ - - -#ifndef MVIMPSTSTORAGESERVICEVIEW_H -#define MVIMPSTSTORAGESERVICEVIEW_H - - -#include "tvimpstenums.h" - -#include -#include -#include "mvimpststoragecontact.h" - -// FORWARD DECLARATIONS -class MVIMPSTStorageContactsObserver; -class MVIMPSTStorageContactList; -class MVIMPSTStorageContact; -class MVPbkContactLink; - -// CLASS DECLARATION - -class MVIMPSTStorageServiceCacheWriter - { - public: - - /** - * update existing contact - * @param aContactLink contact id to be updatated - * @param aUserId contact id to be updated - * @param aDisplayName contact display name to be updated - * @reurn the storage contact pointer if found else NULL - */ - virtual MVIMPSTStorageContact* UpdateCacheContactL(const MVPbkContactLink& aContactLink, - const TDesC& aUserId, - const TDesC& aDisplayName, - const TDesC8& aAvatarContent ) = 0 ; - - /** - * add a new contact to cache - * @param aContactLink contact id to be add - * @param aUserId contact id to be add - * @param aDisplayName contact display name to be add - * @reurn the new storage contact pointer if contact is already exist return the smae - - */ - virtual MVIMPSTStorageContact* AddContactToCacheL(const MVPbkContactLink& aContactLink, - const TDesC& aUserId, - const TDesC& aDisplayName, - const TDesC8& aAvatarContent, - TVIMPSTEnums::TVIMPSTStorgaeEventType aType ) =0 ; - - /* - * remopve existing contact - * @param aContactLink contact id to be removed - * @param aUserId contact id to be removed - * @param aDisplayName contact display name to be removed - * @reurn the error if any - */ - virtual TInt RemoveContactFromCacheL(const MVPbkContactLink& aContactLink,TVIMPSTEnums::TVIMPSTStorgaeEventType aType ) = 0; - - - /** - * Removes all contacts from cache and notify to observers - */ - virtual void RemoveAllCacheContactsL() = 0; - - /** - * Read the default contact list if exist else create default list - * @return contact list pointer - */ - virtual MVIMPSTStorageContactList* GetDefaultContactListL() =0; - - /** - * send the notificatoion about fetch completion - */ - virtual void NotifyServiceViewL(TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType, MVIMPSTStorageContact* aContact = NULL ) = 0 ; - - /** - * find contact by user id - * @param aUserId contact id to be find - * @return storage contact pointer if found else NULL - */ - virtual MVIMPSTStorageContact* FindCacheContactByUserId( const TDesC& aUserId ) = 0 ; - - - /** - * find contact by user id - * @param aContactLink contact link to be find - * @return storage contact pointer if found else NULL - */ - virtual MVIMPSTStorageContact* FindCacheContactByLink(const MVPbkContactLink& aContactLink) = 0 ; - - /** - * add contact to the contact cache and notify the observers - * @param aContact contact id to be added. - */ - virtual TInt AddStorageContactToCacheL(MVIMPSTStorageContact* aContactToAdd ) = 0 ; - - - }; -/** - * Interface for stored contacts container - * - * @lib VIMPSTStorage.dll - * @since 5.0 - */ -class MVIMPSTStorageServiceView - { - public: // Definitions - - /** - * Add an observer. - * @param aObserver The observer - */ - virtual void AddObserverL( MVIMPSTStorageContactsObserver* aObserver ) = 0; - - /** - * Remove an observer. - * @param aObserver The observer - */ - virtual void RemoveObserver( MVIMPSTStorageContactsObserver* aObserver ) = 0; - - - /** - * Find a contact from the store by using Service ID - * @param aServiceId the Service ID of the contact to find - * @return The contact - */ - virtual MVIMPSTStorageContact* FindContactByUserId( const TDesC& aUserId ) = 0; - - - /** - * Count of lists. - * @return Count of lists. - */ - virtual TInt ListCount() const = 0; - - /** - * List in index. - * @param aIndex. Index of list. - * return Contact list. - */ - virtual MVIMPSTStorageContactList& ListAt( TInt aIndex ) const = 0; - - /** - * Find contact list by id - * @param aListId. Id to find. - * @return Contactlist. If not found return NULL - */ - virtual MVIMPSTStorageContactList* FindContactList( const TDesC& aListId ) = 0; - - /** - * Add new contact list. - * @param aContactListId Id for new contact list. - * @param aDisplayName Display name of new contact list. - */ - virtual MVIMPSTStorageContactList* CreateContactListL( const TDesC& aContactListId, - const TDesC& aDisplayName ) = 0; - - /** - * Remove contact list from store. - * @param aContactListId. Id of contact list to be removed. - */ - virtual void RemoveContactList( const TDesC& aContactListId ) = 0; - - - /** - * Count of stored contacts - * @param aSkipOfflineContacts ETrue skip offline contacts. - * EFalse Do not skip. - * @return TInt Count of contacts - */ - virtual TInt ContactCount(TBool aSkipOfflineContacts = EFalse ) const = 0; - - - /** - * Update presence information of contact. - * @param aContactId Id of contact which presence is updated. - * @param aStatus. New presence status - * @param aAlias. New alias. - * @param aStatusText New status message text. - * @param aAvatarData avatar content, - * @param aIsClearingAvatar set to ETrue while clearing the avatar - * @return MVIMPSTStorageContact* pointer of the contact - */ - virtual MVIMPSTStorageContact* UpdatePresenceL(const TDesC& aContactId, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aStatusText, - const TDesC8& aAvatarData, - TBool aIsClearingAvatar = EFalse) = 0; - - /** - * Update presence information of contact. - * @param aContactId Id of contact which presence is updated. - * @param aStatus. New presence status - * @param aAlias. New alias. - * @param aStatusText New status message text. - * @return MVIMPSTStorageContact* pointer of the contact - */ - virtual MVIMPSTStorageContact* UpdateAvatarL(const TDesC& aContactId, - const TDesC8& aAvatarData ) = 0; - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - virtual MVIMPSTStorageContact* CreateNewContactL(const TDesC& aUserId, - const TDesC& aDisplayName = KNullDesC, - TBool aIsInvitationItem = EFalse , - TBool aInvitationAutoAccept = EFalse) = 0; - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - virtual TInt CreateNewContactFromRetrivedIdL( TInt aIndexToUse ) = 0; - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - virtual TInt DeleteNewContactFromRetrivedIdL( TInt aIndexToUse ) = 0; - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - virtual TInt RemoveContactL( MVIMPSTStorageContact* aContact ) = 0 ; - - - /** - * add contact ot the virtual phonebook. - * @param aContact contact id to be added. - */ - virtual void CreateNewFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ) = 0; - - - /** - * returns ETrue if Local Store, EFalse if XSP Store - * @return TBool - */ - virtual TBool IsLocalStore() const = 0; - - - /** - * From MVIMPSTStorageServiceView - */ - virtual TInt RetriveLinkXSPIdsL(const TDesC8& aContactPackLink ) = 0 ; - - /** - * From MVIMPSTStorageServiceView - */ - virtual const TDesC& GetRetrieveXSPIdL(TInt aIndex ) = 0 ; - - /** - * From MVIMPSTStorageServiceView - */ - virtual MVIMPSTStorageContact* FindContactByLink(const MVPbkContactLink& aContactLink ) = 0 ; - - - virtual void Sort( const TDesC& aContactListId = KNullDesC ) = 0 ; - - virtual MVIMPSTStorageContact& OwnContactL() = 0 ; - - virtual void DeleteDatabaseL() = 0 ; - - virtual void SetOwnUserIdL(const TDesC& aUserId ) = 0 ; - - /** - * From MVIMPSTStorageServiceView - * takes the ownership of aUnnamedText - */ - virtual void SetUnnamedTextL(HBufC* aUnnamedText ) = 0 ; - - protected: - /** - * virtual destructor. - */ - virtual ~MVIMPSTStorageServiceView(){}; - }; - -#endif // MVIMPSTSTORAGESERVICEVIEW_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/mvimpststoragevpbkcontactstore.h --- a/uiservicetab/vimpststorage/inc/mvimpststoragevpbkcontactstore.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2008 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: contact store class implementaion to virtual phonebook store type -* -*/ - - -#ifndef MVIMPSTSTORAGECONTACTSTORE_H_ -#define MVIMPSTSTORAGECONTACTSTORE_H_ - -class MVPbkContactLink; -class MVPbkStoreContact; -class MVIMPSTStorageContact; - -/* -* structure to hold the fetch contact information -*/ -struct TVIMPSTContactInfo - { - ///Own: user Id - HBufC* iUserId; - ///Own: display name - HBufC* iDisplayName; - }; - -class MVIMPSTStorageVPbkContactStore - - { - public: - - enum TVIMPSTFetchingSteps - { - EFetchingUnknown = -1, - EContactReadComplete, - EFetchingCalled, - EFetchingOn, - EFetchStart - }; - /** - * - * return ETrue if local store - **/ - virtual TBool LocalStore() const = 0 ; - - virtual TInt CreateVPbkContactL( const TDesC& aUserId, - const TDesC& aDisplayName, - TBool aInvitationAutoAccept = EFalse)=0 ; - - virtual TInt CreateRetriveVPbkContactL( TInt aIndezToUse ) = 0; - - virtual TInt deleteRetriveVPbkContactL( TInt aIndezToUse ) = 0; - - virtual TInt RemoveVPbkContactL(const MVPbkContactLink& aContactLink) = 0 ; - - virtual TInt RetrieveVPbkXSPIdL(const TDesC8& aPackedLinks ) = 0 ; - - virtual TInt UpdateAvatarFieldDataL(const MVPbkContactLink& aContactLink, - const TDesC8& aAvatartData ) = 0 ; - - virtual TInt RemoveAvatarFieldL(MVPbkStoreContact& aStoreContact) = 0 ; - - virtual void AddVPbkFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ) = 0 ; - - virtual TInt RemoveAllVPbkContactsL() = 0 ; - - virtual const TDesC& GetRetrieveVPbkXSPIdL(TInt aIndex ) = 0 ; - - virtual void DeleteDatabaseL() = 0 ; - /* - * virtual destructor - */ - virtual ~MVIMPSTStorageVPbkContactStore() - { - - } - }; - -#endif /*MVIMPSTSTORAGECONTACTSTORE_H_*/ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/mvimpststoragevpbkstorehandler.h --- a/uiservicetab/vimpststorage/inc/mvimpststoragevpbkstorehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ - -/* -* Copyright (c) 2008 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: class implementatio from vpbkstorage handler to store -* -*/ - - -#ifndef MVIMPSTSTORAGEVPBKSTOREHANDLER_H -#define MVIMPSTSTORAGEVPBKSTOREHANDLER_H - -#include -#include - -class MVPbkContactViewBase; -class MVPbkContactLink; -class MVPbkContactStore; -class MVPbkStoreContact; - -/** - * A class for a contact store event. - * - * The contact store event contains the type of the event and - * possibly a contact link to a changed contact. - */ -enum TVIMPSTVPbkStoreEventType - { - EVPbkUnknownEvent = -1, - EVPbkUnknownChanges = 0, - EVPbkContactAdded , - EVPbkContactDeleted, - EVPbkContactChanged, - EVPbkContactRetriving, - EVPbkContactFetching, - EVPbkContactReading, - EVPbkUpdatingAvatar, - EVPbkContactSynchronizing, - EVPbkContactReadCompleted - }; - - class TVIMPSTVPbkStoreEvent - { - - public: // Interface - - /** - * Constructor - * - * @param aEventType The type of the contact store event - * @param aContactLink The identifier of the changed contact or NULL. - * The link is not owned by this class. - */ - TVIMPSTVPbkStoreEvent( TVIMPSTVPbkStoreEventType aEventType, - MVPbkContactLink* aContactLink = NULL, - MVPbkStoreContact* aContact = NULL , - const TDesC& aUserId = KNullDesC , - const TDesC& aName = KNullDesC, - const TDesC8& aAvatarContent = KNullDesC8 ); - - public: - /// Own: Type of the event that has happened - TVIMPSTVPbkStoreEventType iEventType; - /// Ref: Link to the contact that is accociated with the event or NULL. - /// The link is valid only during HandleStoreEventL function call - /// and client can not take the ownership of the instance. - // Client must clone the link if it needs it later. - MVPbkContactLink* iContactLink; - ///Own: Spare for future extension - MVPbkStoreContact* iVPbkContact; - ///Own: Spare for future extension - TPtrC iUserId; - ///Own: Spare for future extension - TPtrC iDisplayName; - // owns avatar content - TPtrC8 iAvatarContent; - }; - -inline TVIMPSTVPbkStoreEvent::TVIMPSTVPbkStoreEvent( - TVIMPSTVPbkStoreEventType aEventType, - MVPbkContactLink* aContactLink, - MVPbkStoreContact* aContact, - const TDesC& aUserId , - const TDesC& aName , - const TDesC8& aAvatarContent ) : - iEventType(aEventType), - iContactLink(aContactLink), - iVPbkContact( aContact ), - iUserId(aUserId ), - iDisplayName( aName ), - iAvatarContent( aAvatarContent ) - { - } -/** - * Interface for contact data container observer - * - * @lib vimpststorage.dll - * @since 5.0 - */ -class MVIMPSTStorageVPbkStoreHandler - { - public: // New functions - - /** - * From MVPbkContactStoreObserver - * Callback: Store event occured - * - * @since S60 5.0 - * @param aContactStore, contact store - * @param aStoreEvent, event - */ - virtual void HandleVPbkStoreEventL(TVIMPSTVPbkStoreEvent aVPbkStoreEvent) = 0 ; - - - /** - * Virtual destructor - */ - virtual ~MVIMPSTStorageVPbkStoreHandler() {}; - }; - -#endif // MVIMPSTSTOREDCONTACTSOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/tvimpststoragepanics.h --- a/uiservicetab/vimpststorage/inc/tvimpststoragepanics.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact list container implementation - * -*/ - - -#ifndef TVIMPSTSTORAGEPANICS_H -#define TVIMPSTSTORAGEPANICS_H - -// CONSTANTS -_LIT( KPanicCategory, "vimpststorage" ); -_LIT( KViewUnInitialised, "vimpststorage - View Uninitialised" ); - - -#define KLIBNOTINITIALIZED KErrBadLibraryEntryPoint -#define KVIEWNOTREADY KErrNotReady - -// DATA TYPES -enum TVIMPSTStoragePanics - { - ENoSuitableIdentification, // for some reason contact identification is NULL - EObserverIsNull, // Storage manager panics if given observer is NULL - EStreamLengthIsZero, // if read stream length is zero during internalizing - ENoSuitableUserId, // for some reason contact userID is NULL - ESortingCorupted, // Sorting of the contact has failed - EContactsArrayOutOfSync // Two arrays of the contact list are out of synchronization - }; - -// FUNCTION PROTOTYPES - -// ---------------------------------------------------- -// Panic -// Panic handler -// ---------------------------------------------------- -// -GLDEF_C void Panic( TVIMPSTStoragePanics aPanic ); - -#endif // TVIMPSTSTORAGEPANICS_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/inc/vimpststorageutils.h --- a/uiservicetab/vimpststorage/inc/vimpststorageutils.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2008 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: Utils for vimpststorage -* -*/ - - -#ifndef __VIMPSTSTORAGEUTILS_H__ -#define __VIMPSTSTORAGEUTILS_H__ - -#include -#include -#include - -// FORWARD CLASS DECLERATIONS - -// CLASS DECLARATION - -/** - * Utils for IMUiServiceTab modules. - */ -class VIMPSTStorageUtils - { - public: // new methods - - /** - * Case insensitive comparison of WVIDs, using protocol ("wv:") neutral - * comparison. The "wv:" part (actually everything up to the first - * ":") is ignored in the comparison. If aDomainNeutral is ETrue, does - * domain-neutral comparison with the following logic: - * - If only one of aId1 or aId2 (but not both) contains domain, - * domain-neutral comparison is done - * - If both or none of aId1 and aId2 contain domain, ordinary - * wv-neutral comparison is done - * If aDomainNeutral is EFalse, then falls back to the old way of - * comparing, i.e. wv-neutral only - * @param aId1 The first id to compare (network-given) - * @param aId2 The second id to compare - * @param aDomainNeutral Do domain neutral comparison (ETrue, default) - * @return -1, 0 or +1, like CompareC. - * @since 2.5 - */ - static TInt NeutralCompare( const TDesC& aId1, const TDesC& aId2, TBool - aDomainNeutral = ETrue ); - /** - * Process userid/groupid/listid so that the "wv:" part is hidden, - * depending on the branded setting coming from the UI. - * @param aId The id to process - * @return The id with the "wv:" (userid, groupid) or "wv:user" (listid) - * part hidden - */ - static TPtrC DisplayId( const TDesC& aId, TBool aListHiding = EFalse ); - - - }; - -#endif // __VIMPSTSTORAGEUTILS_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststorageactivehandler.cpp --- a/uiservicetab/vimpststorage/src/cvimpststorageactivehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* Copyright (c) 2008 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: The CVIMPSTStorageActiveHandler class handles the waiting functionality -* -*/ - - -// INCLUDE FILES -#include "cvimpststorageactivehandler.h" -#include "mvimpststorageactiveobserver.h" - -#include "uiservicetabtracer.h" -#include - -// CONSTANTS -const TInt KTimeToWaitBeforeRefresh( 1000000 ); // 1 seconds in microseconds -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageActiveHandler::CVIMPSTStorageActiveHandler -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageActiveHandler::CVIMPSTStorageActiveHandler( MVIMPSTStorageActiveObserver* aObserver ) : - CTimer( EPriorityIdle ), - iObserver( aObserver ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageActiveHandler::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageActiveHandler::ConstructL() - { - // the base class must be constructed explicitely - CTimer::ConstructL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageActiveHandler::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageActiveHandler* CVIMPSTStorageActiveHandler::NewL( - MVIMPSTStorageActiveObserver* aObserver ) - { - TRACER_AUTO; - CVIMPSTStorageActiveHandler* self = new( ELeave ) CVIMPSTStorageActiveHandler( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// Destructor -CVIMPSTStorageActiveHandler::~CVIMPSTStorageActiveHandler() - { - Cancel(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageActiveHandler::Start -// ----------------------------------------------------------------------------- - -void CVIMPSTStorageActiveHandler::IssueRequest(TVIMPSTEnums::TVIMPSTStorgaeEventType aType, - MVIMPSTStorageContactList *aList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ) - { - TRACER_AUTO; - - if( IsActive() ) - { - Cancel(); - } - TTimeIntervalMicroSeconds32 waittime( KTimeToWaitBeforeRefresh ); - CTimer::After( waittime ); - - iEventType = aType ; - iList = aList ; - iContact = aContact ; - iContactIndex = aContactIndex; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageActiveHandler::RunL -// Derived from CActive -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageActiveHandler::RunL() - { - TRACER_AUTO; - if( iObserver ) - { - TRACE( "send notification" ); - TInt status( iStatus.Int() ); - if( status != KErrCancel ) - { - iObserver->HandleDelayedNotificationL(iEventType, - iList , - iContact, - iContactIndex ); - } - - - TRACE( " notification sent" ); - } - } - -// --------------------------------------------------------- -// CVIMPSTStorageActiveHandler::RunError -// Derived from CActive -// --------------------------------------------------------- -// -TInt CVIMPSTStorageActiveHandler::RunError( TInt aError ) - { - TRACER_AUTO; - if( iObserver ) - { - TRAP_IGNORE( iObserver->HandleDelayedNotificationL(iEventType, - iList , - iContact, - iContactIndex ) ); - } - return aError; - } -// --------------------------------------------------------- -// CVIMPSTStorageActiveHandler::DoCancel -// Derived from CActive -// --------------------------------------------------------- -// -void CVIMPSTStorageActiveHandler::DoCancel() - { - CTimer::DoCancel();// not required - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststoragecontact.cpp --- a/uiservicetab/vimpststorage/src/cvimpststoragecontact.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,318 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of contact data container -* -*/ - - - -// INCLUDE FILES -#include "cvimpststoragecontact.h" -#include "tvimpstenums.h" -#include "uiservicetabtracer.h" -#include "cvimpststoragedefs.h" - -#include -#include -#include -#include "mvimpststoragevpbkcontactstore.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::CVIMPSTStorageContact -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageContact::CVIMPSTStorageContact() - { - iPresenceStatus = TVIMPSTEnums::EOffline; - iAvatarIndex = 0; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContact::ConstructL(const TDesC& aUserId, - const TDesC& aDisplayName, - const MVPbkContactLink& aContactLink, - const TDesC8& aAvatarContent ) - { - TRACER_AUTO; - iUserId = aUserId.AllocL(); - iDisplayName = aDisplayName.AllocL(); - MVPbkContactLink* link = aContactLink.CloneLC(); - iContactLink = link; - CleanupStack::Pop(); // link - iAvatarContent = aAvatarContent.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContact::ConstructL(const TDesC& aUserId, - const TDesC& aDisplayName ) - { - TRACER_AUTO; - iUserId = aUserId.AllocL(); - iDisplayName = aDisplayName.AllocL(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageContact* CVIMPSTStorageContact::NewL(const TDesC& aUserId, - const TDesC& aDisplayName, - const MVPbkContactLink& aContactLink, - const TDesC8& aAvatarContent) - { - TRACER_AUTO; - CVIMPSTStorageContact* self = CVIMPSTStorageContact::NewLC( aUserId,aDisplayName,aContactLink,aAvatarContent ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageContact* CVIMPSTStorageContact::NewL(const TDesC& aUserId, - const TDesC& aDisplayName ) - { - TRACER_AUTO; - CVIMPSTStorageContact* self = new (ELeave) CVIMPSTStorageContact(); - CleanupStack::PushL( self ); - self->ConstructL( aUserId,aDisplayName ); - CleanupStack::Pop( self ); - return self; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::NewLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageContact* CVIMPSTStorageContact::NewLC(const TDesC& aUserId, - const TDesC& aDisplayName, - const MVPbkContactLink& aContactLink, - const TDesC8& aAvatarContent) - { - TRACER_AUTO; - CVIMPSTStorageContact* self = new( ELeave ) CVIMPSTStorageContact(); - CleanupStack::PushL( self ); - self->ConstructL( aUserId,aDisplayName,aContactLink ,aAvatarContent); - return self; - } - -// Destructor -CVIMPSTStorageContact::~CVIMPSTStorageContact() - { - - if(iContactLink) - { - - delete iContactLink; - iContactLink = NULL; - } - - delete iUserId; - delete iDisplayName; - delete iStatusText; - delete iAvatarContent; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::UserId -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& CVIMPSTStorageContact::UserId() const - { - TRACER_AUTO; - if( iUserId ) - { - return *iUserId; - } - return KNullDesC; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::UserId -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& CVIMPSTStorageContact::Name() const - { - TRACER_AUTO; - if( iDisplayName ) - { - return *iDisplayName; - } - return KNullDesC; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::OnlineStatus -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TOnlineStatus CVIMPSTStorageContact::OnlineStatus() const - { - return iPresenceStatus; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetOnlineStatus -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContact::SetOnlineStatus( - TVIMPSTEnums::TOnlineStatus aOnlineStatus ) - { - iPresenceStatus = aOnlineStatus; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::StatusText -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -const TDesC& CVIMPSTStorageContact::StatusText() const - { - TRACER_AUTO; - if( iStatusText ) - { - return *iStatusText; - } - return KNullDesC; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetStatusTextL -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContact::SetStatusTextL( const TDesC& aStatusText ) - { - if( iStatusText ) - { - delete iStatusText; - iStatusText = NULL; - } - iStatusText= aStatusText.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetAvatarContentL -// From MVIMPSTStorageContact -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContact::SetAvatarContentL( const TDesC8& aAvatarContent ,MVIMPSTStorageVPbkContactStore& aVPPkStoreHandler ) - { - TRACER_AUTO; - if( iAvatarContent ) - { - if( iAvatarContent->Compare( aAvatarContent ) == 0 ) - { - // no need to set - return; - } - delete iAvatarContent; - iAvatarContent = NULL; - } - iAvatarContent = aAvatarContent.AllocL(); - if( iContactLink ) - { - aVPPkStoreHandler.UpdateAvatarFieldDataL(*iContactLink, *iAvatarContent); - } - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetUserIdL -// From MVIMPSTStorageExtendedStorageContact -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContact::SetUserIdL( const TDesC& aUserId ) - { - if( iUserId ) - { - delete iUserId; - iUserId = NULL; - } - iUserId = aUserId.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetNameL -// From MVIMPSTStorageExtendedStorageContact -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContact::SetNameL( const TDesC& aName ) - { - TRACER_AUTO; - if( iDisplayName ) - { - delete iDisplayName; - iDisplayName = NULL; - } - iDisplayName= aName.AllocL(); - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageContact::ContactLink() -// --------------------------------------------------------------------------- -// -MVPbkContactLink* CVIMPSTStorageContact::ContactLink() const - { - return iContactLink; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageContact::AvatarContent -// --------------------------------------------------------------------------- -// -const TDesC8& CVIMPSTStorageContact::AvatarContent() const - { - if( iAvatarContent ) - { - return *iAvatarContent; - } - return KNullDesC8(); - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageContact::SetAvatarIndex() -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageContact::SetAvatarIndex(TInt aIndex ) - { - iAvatarIndex = aIndex; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageContact::AvatarIndex -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContact::AvatarIndex() const - { - return iAvatarIndex; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststoragecontactlist.cpp --- a/uiservicetab/vimpststorage/src/cvimpststoragecontactlist.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,615 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact list container implementation -* -*/ - - - -// INCLUDE FILES -#include "cvimpststoragecontactlist.h" -#include "vimpststorageutils.h" -#include "cvimpststoragecontactsorter.h" -#include "mvimpststoragecontact.h" -#include "mvimpststoragecontactsobserver.h" -#include "tvimpststoragepanics.h" -#include "uiservicetabtracer.h" -#include "vimpstdebugassert.h" -#include "cvimpststoragecontact.h" - -#include //vpbk - -// ============================ MEMBER FUNCTIONS =============================== - -// Compares two contacts -TInt CompareUserIdAlphabetically( - const MVIMPSTStorageContact& aFirst, - const MVIMPSTStorageContact& aSecond ) - { - return VIMPSTStorageUtils::NeutralCompare( aFirst.UserId(), aSecond.UserId() ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::CVIMPSTStorageContactList -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageContactList::CVIMPSTStorageContactList( CVIMPSTStorageContactSorter& aSorter ) -: iSorter( aSorter ) - { - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContactList::ConstructL( const TDesC& aContactListId, - const TDesC& aDisplayName ) - { - TRACER_AUTO; - iListId = aContactListId.AllocL(); - iDisplayName = aDisplayName.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageContactList* CVIMPSTStorageContactList::NewL(CVIMPSTStorageContactSorter& aSorter, - const TDesC& aContactListId, - const TDesC& aDisplayName ) - { - TRACER_AUTO; - CVIMPSTStorageContactList* self = NewLC( aSorter, - aContactListId, - aDisplayName ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::NewLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageContactList* CVIMPSTStorageContactList::NewLC(CVIMPSTStorageContactSorter& aSorter, - const TDesC& aContactListId, - const TDesC& aDisplayName ) - { - TRACER_AUTO; - CVIMPSTStorageContactList* self = new( ELeave ) CVIMPSTStorageContactList(aSorter ); - CleanupStack::PushL( self ); - self->ConstructL( aContactListId, aDisplayName ); - return self; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageContactList::~CVIMPSTStorageContactList() - { - iContactArray.ResetAndDestroy(); - iContactArray.Close(); - iOrderedContacts.Reset(); - delete iListId; - delete iDisplayName; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::ListId -// ----------------------------------------------------------------------------- -// -const TDesC& CVIMPSTStorageContactList::ListId() const - { - if( iListId ) - { - return *iListId; - } - return KNullDesC; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::DisplayName -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTStorageContactList::DisplayName() const - { - if( iDisplayName ) - { - return *iDisplayName; - } - return KNullDesC(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::AddStorageContactToCacheL -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::AddStorageContactToCacheL( MVIMPSTStorageContact* aContact, TInt& aIndex ) - { - TRACER_AUTO; - - if( !aContact ) - { - return KErrArgument; - } - TPtrC userID = aContact->UserId(); - TRACE( " userId = %S", &userID ); - // optimize insert for inserting of reverse alphabetical order - TInt idIndex( 0 ); - TInt count( iOrderedContacts.Count() ); - TRACE("count = %d",count ); - if( count && aContact->UserId().Length() && - ( 0 <= VIMPSTStorageUtils::NeutralCompare( aContact->UserId(), - iOrderedContacts[ 0 ]->UserId() ) ) ) - { - TRACE( "inside if" ); - // there are items and the contact should not be inserted to beginning - // => find the correct place - TLinearOrder< MVIMPSTStorageContact > userIdOrder( *CompareUserIdAlphabetically ); - if( KErrNone == iOrderedContacts.FindInOrder( aContact, idIndex, userIdOrder ) ) - { - TRACE( "contact already exists." ); - // this contact already exists, return it - return KErrAlreadyExists; - } - } - TRACE( "inserting the contact" ); - // the position is now correct, insert the contact - iOrderedContacts.InsertL( aContact, idIndex ); - - // insert also to list sorted by contact "identification" - TInt err( KErrNone ); - count = iContactArray.Count(); - TRACE( "iContactsArray count %d",count ); - TLinearOrder< MVIMPSTStorageContact >& order = iSorter.InsertOrder(); - if( count && 0 > (*order)( aContact, iContactArray[ 0 ] ) ) - { - // the item should be inserted in the beginning of the array - err = iContactArray.Insert( aContact, 0 ); - } - else - { - // insert in correct position - err = iContactArray.InsertInOrderAllowRepeats( aContact, order ); - } - TRACE( "iContactsArray inserting error %d",err ); - if( err != KErrNone ) - { - // appending to second array did not succeed, so remove from first and leave - iOrderedContacts.Remove( idIndex ); - User::Leave( err ); - } - aIndex = idIndex; - return err; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::RemoveContactFromCacheL -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::RemoveContactFromCacheL( const TDesC& aContactId, TInt& aIndex ) - { - TRACER_AUTO; - TInt orderedIndex(0); - TInt contactIndex = FindContactIndex( aContactId, orderedIndex ); - aIndex = contactIndex; - if( KErrNotFound != contactIndex ) - { - delete iContactArray[ contactIndex ]; - iContactArray.Remove( contactIndex ); - iOrderedContacts.Remove( orderedIndex ); - iContactArray.Compress(); - iOrderedContacts.Compress(); - return KErrNone; - } - return KErrNotFound; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::RemoveContactFromCacheL -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::RemoveContactFromCacheL( const MVPbkContactLink& aContactLink, TInt& index ) - { - TRACER_AUTO; - TInt error = KErrNotFound; - TInt orderedIndex(0); - TInt contactIndex = FindContactByLinkL( aContactLink, orderedIndex ); - index = contactIndex; - if( KErrNotFound != contactIndex ) - { - MVIMPSTStorageContact* contact = iContactArray[ contactIndex ]; - iContactArray.Remove( contactIndex ); - iOrderedContacts.Remove( orderedIndex ); - delete contact; - iContactArray.Compress(); - iOrderedContacts.Compress(); - error = KErrNone; - } - return error; - } - // ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContact -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::ContactCount( TBool aSkipOfflineContacts, - TBool aSkipBlocekedContacts ) const - { - TRACER_AUTO; - if( !aSkipOfflineContacts && !aSkipBlocekedContacts ) - { - return iContactArray.Count(); - } - TInt countOfContacts( 0 ); - TInt count( iContactArray.Count() ); - for( TInt a( 0 ); a < count; ++a ) - { - TVIMPSTEnums::TOnlineStatus status( - iContactArray[ a ]->OnlineStatus() ); - if( status == TVIMPSTEnums::EOnline || - status == TVIMPSTEnums::EAway || - status == TVIMPSTEnums::EBusy || - status == TVIMPSTEnums::EDoNotDisturb ) - { - ++countOfContacts; - } - } - return countOfContacts; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContactIndex -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::FindContactIndex( const TDesC& aUserId, - TInt& aOrderedIndex ) const - { - TRACER_AUTO; - TInt low( 0 ); - TInt high( iOrderedContacts.Count() ); - while( high > low ) - { - TInt m( ( low + high ) / 2 ); - TInt compare( VIMPSTStorageUtils::NeutralCompare( aUserId, iOrderedContacts[ m ]->UserId() ) ); - if ( compare == KErrNone ) - { - aOrderedIndex = m; - return FindContactEntry( iOrderedContacts[ m ] ); - } - else if ( compare > 0 ) - { - low = m + 1; - } - else - { - high = m; - } - } - aOrderedIndex = KErrNotFound; - return KErrNotFound; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContactEntry -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::FindContactEntry( const MVIMPSTStorageContact* aContact ) const - { - TInt index( iContactArray.Find( aContact ) ); - __ASSERT_DEBUG( index != KErrNotFound , Panic( EContactsArrayOutOfSync )); - return index; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::Sort -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContactList::Sort() - { - iSorter.Sort( iContactArray ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::ResortContact -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageContactList::ResortContact( MVIMPSTStorageContact* aContact ) - { - TRACER_AUTO; - // let it panic, if index is not found, which would be bad - TInt index( iContactArray.Find( aContact ) ); - __ASSERT_DEBUG( index != KErrNotFound , Panic( ESortingCorupted )); - // Check if resort is even needed for the contact - TLinearOrder< MVIMPSTStorageContact >& order = iSorter.InsertOrder(); - if( - ( - ( index == 0 ) - || - ( 0 >= (*order)( iContactArray[ index - 1], aContact ) ) - ) - && - ( - ( index == ( iContactArray.Count() - 1 ) ) - || - ( 0 <= (*order)( iContactArray[ index + 1], aContact ) ) - ) - ) - { - // the item is in correct position - // => no need to resort - return; - } - - iContactArray.Remove( index ); - // this should alway succeed, since we did not actually add anything to array - // no need to add contact to the ordered array, should be there already - TInt err( iContactArray.InsertInOrderAllowRepeats( aContact, order ) ); - __ASSERT_DEBUG( err == KErrNone , Panic( ESortingCorupted )); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindIndexOfContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::FindIndexOfContact( const MVIMPSTStorageContact* aContact, - TVIMPSTEnums::TFilterType aFilter ) const - { - TRACER_AUTO; - TInt count( iContactArray.Count() ); - if ( aFilter == TVIMPSTEnums::EFilterAll ) - { - for( TInt a( 0 ); a < count; ++a ) - { - const MVIMPSTStorageContact* contact = iContactArray[ a ]; - if( aContact == contact ) - { - return a; - } - } - } - else - { - TInt filteredIndex( -1 ); - for( TInt i( 0 ); i < count; ++i ) - { - MVIMPSTStorageContact* contact ( iContactArray[i] ); - if ( FilterAllowsContact( contact, aFilter ) ) - { - // contact was in the correct state - filteredIndex++; - if( contact == aContact) - { - // Contact was found, return the index - return filteredIndex; - } - } - } - } - return KErrNotFound; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::Count -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::Count() const - { - return ContactCount( EFalse, EFalse ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::OnlineCount -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::OnlineCount() const - { - return FilteredCount( TVIMPSTEnums::EFilterNonOffline ); - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::operator[] -// From MVIMPSTStorageContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& CVIMPSTStorageContactList::operator[]( TInt aIndex ) const - { - TRACER_AUTO; - __CHAT_ASSERT_DEBUG( aIndex < iContactArray.Count() ) - return *iContactArray[ aIndex ]; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::OnlineContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& CVIMPSTStorageContactList::OnlineContact( TInt aIndex ) const - { - return FilteredContact( - aIndex, TVIMPSTEnums::EFilterNonOffline ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FilteredContact -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& CVIMPSTStorageContactList::FilteredContact( - TInt aIndex, TVIMPSTEnums::TFilterType aFilter ) const - { - TRACER_AUTO; - if ( aFilter == TVIMPSTEnums::EFilterAll ) - { - return (*this)[aIndex]; - } - else - { - TInt filteredIndex( -1 ); - TInt count( iContactArray.Count() ); - for( TInt i(0); i < count; ++i ) - { - MVIMPSTStorageContact* contact = iContactArray[i]; - if ( FilterAllowsContact( contact, aFilter ) ) - { - // Contact was in correct state - filteredIndex++; - if ( aIndex == filteredIndex ) - { - // index was also correct - return *iContactArray[i]; - } - } - } - __CHAT_ASSERT_DEBUG( EFalse ); - // prevent compiler warning - return ( MVIMPSTStorageContact& )KNullDesC; - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FilteredCount -// From MVIMPSTContactList -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::FilteredCount( - TVIMPSTEnums::TFilterType aFilter ) const - { - TRACER_AUTO; - if ( aFilter == TVIMPSTEnums::EFilterAll ) - { - return Count(); - } - TInt filtered( 0 ); - TInt count( iContactArray.Count() ); - for( TInt i( 0 ); iOnlineStatus() ); - - if( aFilter & TVIMPSTEnums::EFilterAndOperation ) - { - myStatus = myStatus | TVIMPSTEnums::EFilterAndOperation; - } - - if ( status == TVIMPSTEnums::EOnline ) - { - myStatus = myStatus | TVIMPSTEnums::EFilterOnline; - } - - if ( status == TVIMPSTEnums::EOnline || - status == TVIMPSTEnums::EAway || - status == TVIMPSTEnums::EBusy || - status == TVIMPSTEnums::EDoNotDisturb) - { - myStatus = myStatus | TVIMPSTEnums::EFilterNonOffline; - } - - if ( status == TVIMPSTEnums::EAway) - { - myStatus |= TVIMPSTEnums::EFilterAway; - } - - if( aFilter & TVIMPSTEnums::EFilterAndOperation ) - { - if( ( myStatus & aFilter ) == aFilter ) - { - showContact = ETrue; - } - } - else - { - if( myStatus & aFilter ) - { - showContact = ETrue; - } - } - - return showContact; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContact -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* CVIMPSTStorageContactList::FindContact( const TDesC& aContactId ) - { - TRACER_AUTO; - TInt orderedIndex(0); - TInt contactIndex = FindContactIndex( aContactId, orderedIndex ); - return ( contactIndex >= 0 ? iContactArray[ contactIndex ] : NULL ); - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContactByContactLinkL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* CVIMPSTStorageContactList::FindContactByContactLink( const MVPbkContactLink& aContactLink ) - { - TRACER_AUTO; - TInt orderedIndex(0); - TInt contactIndex = -1; - TRAP_IGNORE( contactIndex = FindContactByLinkL( aContactLink, orderedIndex );) - return ( contactIndex >= 0 ? iContactArray[ contactIndex ] : NULL ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageContactList::FindContactByLinkL -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageContactList::FindContactByLinkL( const MVPbkContactLink& aContactLink, - TInt& aIndexOrderedArray ) const - { - TRACER_AUTO; - TInt count( iOrderedContacts.Count() ); - TInt contactIndex = KErrNotFound; - //Does a Linear Search - for (TInt index = 0; indexContactLink(); - if( contactLink && contactLink->IsSame( aContactLink ) ) - { - aIndexOrderedArray = index; - contactIndex = FindContactEntry( iOrderedContacts[ index ] ); - break; - } - } - return contactIndex; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststoragecontactsorter.cpp --- a/uiservicetab/vimpststorage/src/cvimpststoragecontactsorter.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -/* -* Copyright (c) 2008 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: Contact sorter -* -*/ - - -// INCLUDE FILES -#include "cvimpststoragecontactsorter.h" -#include "mvimpststoragecontact.h" -#include "tvimpstenums.h" -#include "cvimpststoragedefs.h" -#include "uiservicetabtracer.h" - -// The order of contacts if sorted by status -const TInt KConstOnline = 1; -const TInt KConstBusy = 2; -const TInt KConstAway = 3; -const TInt KConstServiceOut = 4; -const TInt KConstOnPhone = 5; -const TInt KConstInvisible = 6; -const TInt KConstOffline = 7; -const TInt KConstCallForward = 8; -const TInt KConstUnknown = 9; - -// local functions -// sorting algorithms, you can add new one to extend functionality - - -// Compares alphabetically using MVIMPSTStorageContact::Identification and -// TDesC::CompareC -TInt CompareAlphabetically( const MVIMPSTStorageContact& aFirst, - const MVIMPSTStorageContact& aSecond ) - { - TRACER_AUTO; - return aFirst.Name().CompareC( aSecond.Name(), - KCollationLevel, NULL ); - } - - -// Group the contact by it's status. -TInt OrderContact( const MVIMPSTStorageContact& aContact ) - { - TRACER_AUTO; - // Contact is not blocked, group by presence status - switch( aContact.OnlineStatus() ) - { - case TVIMPSTEnums::EOnline: - { - return KConstOnline; // First group, contact is online - } - case TVIMPSTEnums::EDoNotDisturb: - case TVIMPSTEnums::EBusy: - { - return KConstBusy; // second group, contact is busy/donotdisturb - } - case TVIMPSTEnums::EOnPhone: - { - return KConstOnPhone; //fifth group, contact is onphone - } - case TVIMPSTEnums::EInvisible: - { - return KConstInvisible; // sixth group, contact is invisible - } - case TVIMPSTEnums::EAway: - { - return KConstAway; // third group, contact is away - } - case TVIMPSTEnums::EOffline: - { - return KConstOffline; // seventh group, contact is offline - } - case TVIMPSTEnums::ECallForward: - { - return KConstCallForward; // eight group, contact state is callforward - } - case TVIMPSTEnums::EServiceOut: - { - return KConstServiceOut; // fourth group, contact is serviceout(has ony pstn or msisdn number) - } - default: - { - return KConstUnknown; // unknown status - } - } - } - -// Compares by contact status, -1 = aFirst is greater, 1 = aSecond is greater. -TInt CompareByPresence( const MVIMPSTStorageContact& aFirst, - const MVIMPSTStorageContact& aSecond ) - { - TRACER_AUTO; - TInt firstGroup( OrderContact( aFirst ) ); - TInt secondGroup( OrderContact( aSecond ) ); - - // If both contacts belong to same group, sort alphabetically - if( firstGroup == secondGroup ) - { - return CompareAlphabetically( aFirst, aSecond ); - } - - // Otherwise return the difference of groups - return firstGroup - secondGroup; - } - -// ================= MEMBER FUNCTIONS ======================= - -// Two-phased constructor. -CVIMPSTStorageContactSorter* CVIMPSTStorageContactSorter::NewL() - { - TRACER_AUTO; - CVIMPSTStorageContactSorter* self = new( ELeave ) CVIMPSTStorageContactSorter(); - return self; - } - -// Destructor -CVIMPSTStorageContactSorter::~CVIMPSTStorageContactSorter() - { - TRACER_AUTO; - } - -// --------------------------------------------------------- -// CVIMPSTStorageContactSorter::Sort( RPointerArray& aList ) -// Sorts given array. -// --------------------------------------------------------- -// -void CVIMPSTStorageContactSorter::Sort( RPointerArray< MVIMPSTStorageContact >& aList ) - { - TRACER_AUTO; - aList.Sort( iAlgorithm ); - } - -// --------------------------------------------------------- -// CVIMPSTStorageContactSorter::Compare( const MVIMPSTStorageContact& aFirst, -// const MVIMPSTStorageContact& aSecond ) const -// Get function pointer from inside of TLinearOrder and -// execute the function. -// --------------------------------------------------------- -// -TInt CVIMPSTStorageContactSorter::Compare( const MVIMPSTStorageContact& aFirst, - const MVIMPSTStorageContact& aSecond ) const - { - TRACER_AUTO; - return iAlgorithm.operator TGeneralLinearOrder()( &aFirst, &aSecond ); - } - -// C++ default constructor can NOT contain any code, that -// might leave. -// Default algorithm is alphabetic. It is changed later in ConstructL. -// -CVIMPSTStorageContactSorter::CVIMPSTStorageContactSorter() : - iAlgorithm( *CompareByPresence ) - { - } - -// --------------------------------------------------------- -// CVIMPSTStorageContactSorter::SetSortAlgorithm() -// Get setting item value and choose algorithm. -// New algorithms can be added to this method. -// --------------------------------------------------------- -// -void CVIMPSTStorageContactSorter::SetSortAlgorithm( - MVIMPSTStorageContact::TSortAlgorithm aAlgorithm ) - { - TRACER_AUTO; - switch( aAlgorithm ) - { - case MVIMPSTStorageContact::ECompareByPresence: - { - iAlgorithm = - TLinearOrder< MVIMPSTStorageContact > ( *CompareByPresence ); - break; - } - - case MVIMPSTStorageContact::ECompareAlphabetically: // flowthrough - default : - { - iAlgorithm = - TLinearOrder< MVIMPSTStorageContact > ( *CompareAlphabetically ); - break; - } - } - } - -// --------------------------------------------------------- -// CVIMPSTStorageContactSorter::InsertOrder() -// Get setting item value and choose algorithm. -// New algorithms can be added to this method. -// --------------------------------------------------------- -// -TLinearOrder< MVIMPSTStorageContact >& CVIMPSTStorageContactSorter::InsertOrder() - { - return iAlgorithm; - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststoragemanager.cpp --- a/uiservicetab/vimpststorage/src/cvimpststoragemanager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of storage manager -* -*/ - - - -// INCLUDE FILES -#include "cvimpststorageserviceview.h" - -#include - -#include "cvimpststoragemanager.h" -#include "tvimpststoragepanics.h" -#include "uiservicetabtracer.h" - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::InitialiseLibraryL -// Factory method that create the singleton instance of the storage manager -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageManager::InitialiseLibraryL() - { - TRACER_AUTO; - //see whether there is an instance in the TLS - //if not create the instance and set the same in TLS - CVIMPSTStorageManager *sm = static_cast( Dll::Tls() ); - if ( ! sm ) - { - // no existing instance, create a new one - CVIMPSTStorageManager *manager = CVIMPSTStorageManager::NewL(); - sm = manager; - CleanupStack::PushL( manager ); - User::LeaveIfError( Dll::SetTls( static_cast( sm ) ) ); - CleanupStack::Pop( manager ); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::Release -// Factory method to release the singleton instance of the storage manager -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageManager::Release() - { - TRACER_AUTO; - //if any instance in TLS get the same and delete it - CVIMPSTStorageManager *storage = static_cast( Dll::Tls() ); - if ( storage ) - { - delete storage; - Dll::SetTls( NULL ); - } - return KErrNone; - } - - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::Instance() -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageManager& CVIMPSTStorageManager::Instance() - { - TRACER_AUTO; - //get the instance frm TLS and return the same - CVIMPSTStorageManager *storage = static_cast( Dll::Tls() ); - - __ASSERT_ALWAYS( storage, - User::Panic( KPanicCategory, KLIBNOTINITIALIZED ) ); - return *storage; - } - - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::NewL -// ----------------------------------------------------------------------------- -// - CVIMPSTStorageManager* CVIMPSTStorageManager::NewL() - { - TRACER_AUTO; - //creates the instance - CVIMPSTStorageManager* self = new( ELeave ) CVIMPSTStorageManager; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::ConstructL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageManager::ConstructL() - { - TRACER_AUTO; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::~CVIMPSTStorageManager -// ----------------------------------------------------------------------------- -// - CVIMPSTStorageManager::~CVIMPSTStorageManager() - { - TRACER_AUTO; - //release all the existing views - iServiceViewList.ResetAndDestroy(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::CreateServiceViewL -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageServiceView* CVIMPSTStorageManager::CreateServiceViewL( TUint32 aServiceId, - const TDesC& aStoreName, - const TDesC& aServiceName ) - { - TRACER_AUTO; - //creates a new view based on the service id. - TInt index = KErrNotFound; - CVIMPSTStorageServiceView* serviceView = NULL; - - //check if the view already exists in the viewlist - index = FindServiceView(aServiceId); - if( KErrNotFound == index ) - { - TRACE( "service does not exit" ); - // service view is not found - // check if store name is valid create a service view for aServiceId - if( aStoreName.Length() ) - { - TRACE(" store name is valid" ); - serviceView = CVIMPSTStorageServiceView::NewL(aServiceId, - aStoreName, aServiceName); - iServiceViewList.Append(serviceView); - TRACE( "new view created for serviceId = %d",aServiceId ); - } - // if store name is not valid ,return NULL - } - else - { - TRACE( " service already exist = %d",aServiceId ); - serviceView = iServiceViewList[ FindServiceView(aServiceId)]; - } - //return the extisting view from the viewlist - return serviceView; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::FindServiceView -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageManager::FindServiceView( TUint32 aServiceId) - { - TRACER_AUTO; - //search whether the view exists in the view list. - TInt index = KErrNotFound; - TInt count = iServiceViewList.Count(); - for(TInt i = 0; i < count; i++ ) - { - if( aServiceId == iServiceViewList[ i ]->GetServiceId() ) - { - TRACE( "aServiceId found = %d" ,aServiceId ); - index = i; - break; - } - } - return index; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::RemoveServiceView -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageManager::RemoveServiceView( TUint32 aServiceId) - { - TRACER_AUTO; - //searches and removes the view from the view list. - TInt index = FindServiceView(aServiceId); - if( index >= 0 ) - { - TRACE( "aServiceId found = %d" ,aServiceId ); - //view exists, so delete and remove the same - CVIMPSTStorageServiceView* serviceView = iServiceViewList[ index ]; - iServiceViewList.Remove( index ); - delete serviceView; - iServiceViewList.Compress(); - } - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststoragemanagerfactory.cpp --- a/uiservicetab/vimpststorage/src/cvimpststoragemanagerfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation of CVIMPSTStorageManagerFactory -* -*/ - -// INCLUDE FILES -#include - -#include "cvimpststoragemanagerfactory.h" -#include "cvimpststoragemanager.h" -#include "cvimpststorageserviceview.h" - -//debug prints -#include "uiservicetabtracer.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::InitialiseLibraryL -// Factory method that initialises the vimpststorage library -// used by CVIMPSTViewIdFactory -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseLibraryL() - { - TRACER_AUTO; - CVIMPSTStorageManager::InitialiseLibraryL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::Release -// Factory method to release the resource owned by the vimpststorage library -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CVIMPSTStorageManagerFactory::Release() - { - TRACER_AUTO; - return CVIMPSTStorageManager::Release(); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::InitialiseViewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTStorageManagerFactory::InitialiseViewL( - TUint32 aServiceId, - const TDesC& aStoreName, - const TDesC& aServiceName) - { - TRACER_AUTO; - //get the stroage manager instance - CVIMPSTStorageManager& storagemanager = CVIMPSTStorageManager::Instance( ); - - //create the storageview based on the service id - CVIMPSTStorageServiceView* contactlistInterface = - storagemanager.CreateServiceViewL( aServiceId, aStoreName, aServiceName ); - - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManager::ContactListInterfaceL() -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTStorageServiceView* CVIMPSTStorageManagerFactory::ContactListInterfaceL(TUint32 aServiceId) - { - TRACER_AUTO; - //get the stroage manager instance - CVIMPSTStorageManager& storagemanager = CVIMPSTStorageManager::Instance( ); - - //create the storageview based on the service id - CVIMPSTStorageServiceView* contactlistInterface = - storagemanager.CreateServiceViewL( aServiceId, KNullDesC, KNullDesC ); - - //cast to the base class and return the MVIMPSTStorageServiceView base ptr - return dynamic_cast(contactlistInterface); - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageManagerFactory::ItemModelInterfaceL -// ----------------------------------------------------------------------------- -// -EXPORT_C MVIMPSTStorageItemModel* CVIMPSTStorageManagerFactory::ItemModelInterfaceL( TUint32 aServiceId ) - { - TRACER_AUTO; - //get the stroage manager instance - CVIMPSTStorageManager& storagemanager = CVIMPSTStorageManager::Instance( ); - - //create the storageview based on the service id - CVIMPSTStorageServiceView* itemModel = - storagemanager.CreateServiceViewL( aServiceId, KNullDesC, KNullDesC ); - - //cast to the base class and return the MVIMPSTStorageItemModel base ptr - return dynamic_cast(itemModel); - - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststorageserviceview.cpp --- a/uiservicetab/vimpststorage/src/cvimpststorageserviceview.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1275 +0,0 @@ -/* -* Copyright (c) 2008 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: Storage service view implementation -* -*/ - - -// INCLUDE FILES -#include "cvimpststorageserviceview.h" - -#include "cvimpststoragecontactlist.h" -#include "cvimpststoragecontact.h" -#include "mvimpststoragevpbkcontactstore.h" -#include "cvimpststoragevpbkserverstore.h" -#include "cvimpststoragevpbklocalstore.h" -#include "cvimpststoragecontactsorter.h" -#include "cvimpststorageactivehandler.h" -#include "mvimpststoragecontactsobserver.h" -#include "vimpststorageutils.h" - -#include -#include -#include -#include "uiservicetabtracer.h" -#include "tvimpstconsts.h" -#include "mvimpststoragecontact.h" - - -// ============================ MEMBER FUNCTIONS =============================== - - -// panic handler -GLDEF_C void Panic( TVIMPSTStoragePanics aPanic ) - { - User::Panic( KPanicCategory, aPanic ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::CVIMPSTStorageServiceView -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageServiceView::CVIMPSTStorageServiceView(TUint32 aServiceId) : - iServiceId(aServiceId), - iOwnContact( NULL ), - iUnNamedText( NULL ) - { - TRACER_AUTO; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::ConstructL -// Symbian 2nd phase constructor can leave. -// The constructor also does synchronizing with Phone Book by removing the -// deleted elements from the persistent storage -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::ConstructL(const TDesC& aStoreName, const TDesC& aServiceName) - { - TRACER_AUTO; - - iActiveHandler = CVIMPSTStorageActiveHandler::NewL(this); - - // create sorter for contacts - iContactSorter = CVIMPSTStorageContactSorter::NewL(); - - //set the sorting algorithem to order by presence. - iContactSorter->SetSortAlgorithm( MVIMPSTStorageContact::ECompareByPresence); - - TRACE( "SubServiceType() Type : %S", &aStoreName ); - //find whether its a local store or xsp store - if ( VPbkContactStoreUris::DefaultCntDbUri().CompareC( aStoreName, 1, NULL ) - != 0 ) - { - TRACE( " service store created" ); - //Create XSP Store - iVPbkContactStore = - CVIMPSTStorageVPbkServerStore::NewL(aStoreName,aServiceName ,*this ); - } - else - { - TRACE( "local store created " ); - //Create Local Contacts.cdb store - iVPbkContactStore = CVIMPSTStorageVPbkLocalStore::NewL(VPbkContactStoreUris::DefaultCntDbUri(), - aServiceName, - *this ); - } - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageServiceView* CVIMPSTStorageServiceView::NewL(TUint32 aServiceId, - const TDesC& aStoreName, - const TDesC& aServiceName) - { - TRACER_AUTO; - - CVIMPSTStorageServiceView* self = new( ELeave ) CVIMPSTStorageServiceView(aServiceId); - CleanupStack::PushL( self ); - self->ConstructL(aStoreName, aServiceName); - CleanupStack::Pop( self ); - return self; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::~CVIMPSTStorageServiceView -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// Destructor -CVIMPSTStorageServiceView::~CVIMPSTStorageServiceView() - { - TRACER_AUTO; - if( iActiveHandler ) - { - iActiveHandler->Cancel(); - delete iActiveHandler; - } - - iContactListArray.ResetAndDestroy(); - - delete iOwnContact; - delete iContactSorter; - delete iVPbkContactStore; - iContactObservers.Reset(); - iContactObservers.Close(); - - if(iUnNamedText) - { - delete iUnNamedText; - iUnNamedText = NULL; - } - - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::AddObserverL -// From MVIMPSTStorageServiceView -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::AddObserverL( MVIMPSTStorageContactsObserver* - aObserver ) - { - TRACER_AUTO; - User::LeaveIfError( aObserver ? KErrNone : KErrArgument ); - TInt index = iContactObservers.Find( aObserver ); - if( index == KErrNotFound ) - { - TRACE( "aObserver added "); - User::LeaveIfError( iContactObservers.Append( aObserver ) ); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::RemoveObserverL -// From MVIMPSTStorageServiceView -// ----------------------------------------------------------------------------- -void CVIMPSTStorageServiceView::RemoveObserver( MVIMPSTStorageContactsObserver* - aObserver ) - { - TRACER_AUTO; - __ASSERT_ALWAYS( aObserver, Panic( EObserverIsNull )); - const TInt index( iContactObservers.Find( aObserver ) ); - if ( index >=0) - { - TRACE( "aObserver found" ); - iContactObservers.Remove( index ); - iContactObservers.Compress(); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::SetUnnamedTextL -// From MVIMPSTStorageServiceView -// ----------------------------------------------------------------------------- -void CVIMPSTStorageServiceView::SetUnnamedTextL(HBufC* aUnnamedText ) - { - // takes ownership - iUnNamedText = aUnnamedText; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::CreateContactListL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContactList* CVIMPSTStorageServiceView::CreateContactListL( - const TDesC& aContactListId, - const TDesC& aDisplayName ) - { - TRACER_AUTO; - CVIMPSTStorageContactList* contactList = - CVIMPSTStorageContactList::NewLC(*iContactSorter, - aContactListId, - aDisplayName ); - - TIdentityRelation< CVIMPSTStorageContactList > findBy( - CVIMPSTStorageServiceView::ContactListFindByContactListId); - TInt indexOfList( iContactListArray.Find( contactList, findBy ) ); - if( indexOfList == KErrNotFound ) - { - TRACE( "list not exist in list"); - TLinearOrder< CVIMPSTStorageContactList > order( - CVIMPSTStorageServiceView::ContactListOrderByDisplayName ); - iContactListArray.InsertInOrderAllowRepeats( contactList, order ); - CleanupStack::Pop( contactList ); - TRACE( " new list created"); - } - else - { - TRACE( " list already exist in list" ); - CleanupStack::PopAndDestroy( contactList ); - contactList = iContactListArray[ indexOfList ]; - } - return contactList; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::RemoveContactList -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::RemoveContactList( const TDesC& aContactListId ) - { - TRACER_AUTO; - TInt pos( FindContactListById( aContactListId ) ); - if( pos >= 0 ) - { - TRACE( "aContactListId found" ); - delete iContactListArray[ pos ]; - iContactListArray.Remove( pos ); - iContactListArray.Compress(); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::ListCount -// Count of contactlists -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::ListCount() const - { - TRACER_AUTO; - return iContactListArray.Count(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::ListAt -// Reference to contact list -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContactList& CVIMPSTStorageServiceView::ListAt( TInt aIndex ) const - { - TRACER_AUTO; - // User::LeaveIfError( aIndex < iContactListArray.Count() ? KErrNone : KErrArgument ); - __ASSERT_ALWAYS( (aIndex < iContactListArray.Count() && aIndex >=0 ), Panic( EContactsArrayOutOfSync )); - return *iContactListArray[ aIndex ]; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::ContactCount -// Count of contacts -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::ContactCount( TBool aSkipOfflineContacts ) const - { - TRACER_AUTO; - TInt contactCount( 0 ); - TInt count( iContactListArray.Count() ); - for( TInt a( 0 ); a < count; ++a ) - { - contactCount += iContactListArray[ a ]->ContactCount( aSkipOfflineContacts, - EFalse ); - } - TRACE(" contactCount = %d" ,contactCount ); - return contactCount; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::UpdatepresenceL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* CVIMPSTStorageServiceView::UpdatePresenceL( - const TDesC& aContactId, - TVIMPSTEnums::TOnlineStatus aStatus, - const TDesC& aStatusText, - const TDesC8& aAvatarData, - TBool aIsClearingAvatar /*= EFalse*/) - { - TRACER_AUTO; - MVIMPSTStorageContact* contact = NULL; - if( iOwnContact && ( aContactId.Compare( iOwnContact->UserId() ) == 0 ) ) - { - TRACE("own Item presence"); - if( aAvatarData.Compare(iOwnContact->AvatarContent() ) != 0 ) - { - if((aIsClearingAvatar)||(aAvatarData.Length() > 0)) - { - TRACE( "own avatar change NotifyAllObserversL"); - iOwnContact->SetAvatarContentL( aAvatarData ,*iVPbkContactStore ); - NotifyAllObserversL(TVIMPSTEnums::EStorageAvatarChange,NULL,iOwnContact,0); - } - } - if( ( iOwnContact->OnlineStatus() != aStatus ) || ( aStatusText.Compare( iOwnContact->StatusText() ) != 0 ) ) - { - // own presence has changes - // update to own presence - iOwnContact->SetOnlineStatus( aStatus ); - iOwnContact->SetStatusTextL(aStatusText); - TRACE( " own presene NotifyAllObserversL"); - NotifyAllObserversL(TVIMPSTEnums::EStorageOwnPresenceChange,NULL, iOwnContact,0); - } - contact = iOwnContact; - } - else - { - TRACE( "contact item "); - contact = FindContactByUserId( aContactId ); - if(contact) - { - TRACE( "contact exist " ); - TInt index = KErrNotFound; - TVIMPSTEnums::TOnlineStatus oldOnlineStatus = contact->OnlineStatus(); - TRACE( "contact oldOnlineStatus = %d", oldOnlineStatus ); - TRACE( "contact new presence = %d", aStatus ); - //status text can be different for the sam status hence not inside the if condition. - if( oldOnlineStatus != aStatus ) - { - TRACE( "contact presence change "); - - contact->SetOnlineStatus( aStatus ); - TInt count = iContactListArray.Count(); - for(TInt i = 0; i < count; i++) - { - index = iContactListArray[i]->FindIndexOfContact(contact); - if(KErrNotFound != index ) - { - iContactListArray[i]->ResortContact(contact); - TRACE( "contact ResortContact " ); - // get the index of the sorted contact, as after sorting the - // index would have changed based on presence. - // break after the contact list is found and the contact is found - break; - } - } - contact->SetStatusTextL(aStatusText); - if(aAvatarData.Length()>0) - { - TInt oldIndex = IndexOfContact (contact); - contact->SetAvatarContentL( aAvatarData ,*iVPbkContactStore); - NotifyAllObserversL(TVIMPSTEnums::EStorageAvatarChange,NULL, contact, oldIndex ); - } - - // once this event occued ,apply the sorting - NotifyAllObserversWithDelay(TVIMPSTEnums::EStorageMultiplePresenceChange,NULL, contact, -1); - } - else if( aStatusText.Compare( contact->StatusText() ) != 0 ) - { - TInt oldIndex = IndexOfContact (contact); - contact->SetStatusTextL(aStatusText); - NotifyAllObserversL(TVIMPSTEnums::EStoragePresenceChange,NULL, contact, oldIndex ); - } - else if( aAvatarData.Length() && aAvatarData.Compare( contact->AvatarContent() ) != 0 ) - { - TInt oldIndex = IndexOfContact (contact); - contact->SetAvatarContentL( aAvatarData ,*iVPbkContactStore); - NotifyAllObserversL(TVIMPSTEnums::EStorageAvatarChange,NULL, contact, oldIndex ); - } - TRACE("aStatusText = %S ", &aStatusText ); - TRACE( "NotifyAllObserversL called" ); - TRACE( "NotifyAllObserversL finish" ); - } - } - return contact; - } - - // ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::UpdateAvatarL -// ----------------------------------------------------------------------------- -// - MVIMPSTStorageContact* CVIMPSTStorageServiceView::UpdateAvatarL(const TDesC& aContactId, - const TDesC8& aAvatarData ) - { - TRACER_AUTO; - MVIMPSTStorageContact* contact = NULL; - if( iOwnContact && ( aContactId.Compare( iOwnContact->UserId() ) == 0 ) ) - { - TRACE( "own avatar" ); - iOwnContact->SetAvatarContentL( aAvatarData ,*iVPbkContactStore); - NotifyAllObserversL(TVIMPSTEnums::EStorageOwnPresenceChange,NULL, iOwnContact,0); - contact = iOwnContact; - } - else - { - TRACE( "buddy avatar" ); - contact = FindContactByUserId( aContactId ); - if(contact) - { - TRACE( "contact exit"); - contact->SetAvatarContentL( aAvatarData ,*iVPbkContactStore); - TInt index = IndexOfContact(contact); - NotifyAllObserversL(TVIMPSTEnums::EStorageAvatarChange,NULL, contact,index); - TRACE( " NotifyAllObserversL called" ); - } - } - return contact; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::FindContactListInternal -// ----------------------------------------------------------------------------- -// -CVIMPSTStorageContactList* CVIMPSTStorageServiceView::FindContactListInternal( - const TDesC& aListId ) - { - TRACER_AUTO; - TInt contactListIndex( FindContactListById( aListId ) ); - return ( contactListIndex >= 0 ? iContactListArray[ contactListIndex ] : NULL ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::FindContactList -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContactList* CVIMPSTStorageServiceView::FindContactList( const TDesC& aListId ) - { - TRACER_AUTO; - return FindContactListInternal( aListId ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::FindContactListById -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::FindContactListById(const TDesC& aListId ) - { - TRACER_AUTO; - TInt index = KErrNotFound; - TInt count( iContactListArray.Count() ); - TRACE( " count = %d", count ); - for( TInt i= 0 ; i < count ; i++ ) - { - if( KErrNone == VIMPSTStorageUtils::NeutralCompare( - aListId, - iContactListArray[ i ]->ListId(), EFalse ) ) - { - TRACE( " contact list found" ); - index = i; - break; - } - } - return index; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::FindContactListById -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* CVIMPSTStorageServiceView::FindContactByLink(const MVPbkContactLink& aContactLink ) - { - TRACER_AUTO; - MVIMPSTStorageContact* contact = NULL; - TInt count( iContactListArray.Count() ); - for( TInt i= 0 ; i < count ; i++ ) - { - CVIMPSTStorageContactList* contactList = iContactListArray[ i ]; - contact = contactList->FindContactByContactLink( aContactLink ); - if( contact ) - { - TRACE( " contact found = %d ", i ); - break; - } - } - return contact; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::GetServiceId -// ----------------------------------------------------------------------------- -// -TUint32 CVIMPSTStorageServiceView::GetServiceId() - { - TRACER_AUTO; - return iServiceId; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::LocalStore -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTStorageServiceView::IsLocalStore() const - { - TRACER_AUTO; - return iVPbkContactStore->LocalStore(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::OwnContactL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact& CVIMPSTStorageServiceView::OwnContactL() - { - TRACER_AUTO; - if( !iOwnContact ) - { - iOwnContact = CVIMPSTStorageContact::NewL(KNullDesC, - KNullDesC ) ; - } - return *iOwnContact; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::SetOwnUserIdL -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::SetOwnUserIdL(const TDesC& aUserId ) - { - TRACER_AUTO; - if( !iOwnContact ) - { - iOwnContact = CVIMPSTStorageContact::NewL(aUserId, - KNullDesC - ) ; - TRACE( "iOwnContact created" ); - } - else if( aUserId.Compare( iOwnContact->UserId() ) != 0 ) - { - _LIT (KNullWithSpace, " "); - TRACE( "SetOwnUserIdL iOwnContact was existing" ); - if(KNullWithSpace ().Compare(iOwnContact->UserId())!=0) - { - iVPbkContactStore->RemoveAllVPbkContactsL(); // if user id is changed remove all contacts - RemoveAllCacheContactsL(); - } - iOwnContact->SetUserIdL( aUserId ); - iOwnContact->SetAvatarContentL(KNullDesC8,*iVPbkContactStore ); - - NotifyAllObserversL( TVIMPSTEnums::EStorageEventOwnUserChanged,NULL,iOwnContact,0 ); - TRACE( "NotifyAllObserversL delivered" ); - } - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::FindContactByUserId -// From MVIMPSTStorageServiceView. -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- -MVIMPSTStorageContact* CVIMPSTStorageServiceView::FindContactByUserId( const TDesC& aUserId ) - { - TRACER_AUTO; - MVIMPSTStorageContact* contact = NULL; - CVIMPSTStorageContactList* contactList = NULL; - TInt count( iContactListArray.Count() ); - for( TInt a( 0 ); a < count; ++a ) - { - contactList = iContactListArray[ a ]; - contact = contactList->FindContact( aUserId ); - if( contact ) - { - TRACE(" contact found " ); - break; - } - if(!contact) - { - TInt acount =contactList->Count(); - for( TInt i( 0 ); i < acount; ++i ) - { - MVIMPSTStorageContact* acontact = &(contactList->operator [](i)); - if( acontact->UserId().Compare( aUserId) == 0 ) - { - contact=acontact; - break; - } - } - } - } - - return contact; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::FindContactByUserId -// From MVIMPSTStorageServiceView. -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- -MVIMPSTStorageContact* CVIMPSTStorageServiceView::FindCacheContactByUserId( const TDesC& aUserId ) - { - TRACER_AUTO; - return FindContactByUserId( aUserId ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::FindCacheContactByLink -// From MVIMPSTStorageServiceView. -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- -MVIMPSTStorageContact* CVIMPSTStorageServiceView::FindCacheContactByLink(const MVPbkContactLink& aContactLink ) - { - TRACER_AUTO; - return FindContactByLink( aContactLink ); - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::CreateContactL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* CVIMPSTStorageServiceView::CreateNewContactL(const TDesC& aUserId, - const TDesC& aDisplayName /*= KNullDesC*/, - TBool aIsInvitationItem /*=EFalse*/, - TBool aInvitationAutoAccept /*= EFalse */) - { - TRACER_AUTO; - // This will create a contact in the CDB file. It returns MVPbkContactLink link to the CDB file. - MVIMPSTStorageContact* contact = FindCacheContactByUserId( aUserId ); - if( !contact ) - { - iIsInvitationItem = aIsInvitationItem; - TRACE( "contact does not exist in list" ); - iVPbkContactStore->CreateVPbkContactL( aUserId ,aDisplayName, aInvitationAutoAccept ); - TRACE( "new contact created"); - } - return contact; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::CreateNewFetchContactsL -// ----------------------------------------------------------------------------- -// - void CVIMPSTStorageServiceView::CreateNewFetchContactsL( RArray &aFirstNameList, - RArray &aServiceField ) - { - TRACER_AUTO; - if( !iVPbkContactStore->LocalStore() ) - { - RemoveAllCacheContactsL(); - } - iVPbkContactStore->AddVPbkFetchContactsL( aFirstNameList, aServiceField ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::RemoveContactL -// From MVIMPSTStorageServiceView. -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- - -TInt CVIMPSTStorageServiceView::RemoveContactL( MVIMPSTStorageContact* aContact ) - { - TRACER_AUTO; - TInt error = KErrArgument; - if( aContact ) - { - TRACE( "contact found" ); - error = iVPbkContactStore->RemoveVPbkContactL( *aContact->ContactLink() ); - } - return error; - } - - - // ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::RetriveLinkXSPIdsL -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::RetriveLinkXSPIdsL(const TDesC8& aContactPackLink ) - { - TRACER_AUTO; - // return the no of retrived xsp of contacts - return iVPbkContactStore->RetrieveVPbkXSPIdL( aContactPackLink ); - } - - // --------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::GetRetrieveXSPIdL -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTStorageServiceView::GetRetrieveXSPIdL(TInt aIndex ) - { - TRACER_AUTO; - TRACE( " aIndex = %d",aIndex ); - return iVPbkContactStore->GetRetrieveVPbkXSPIdL( aIndex ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::CreateNewContactFromRetrivedIdL -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::CreateNewContactFromRetrivedIdL( TInt aIndexToUse ) - { - TRACER_AUTO; - TRACE( "aIndexToUse = %d",aIndexToUse ); - // This will create a contact in the CDB file. It returns MVPbkContactLink link to the CDB file. - return iVPbkContactStore->CreateRetriveVPbkContactL( aIndexToUse ); - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::DeleteNewContactFromRetrivedIdL -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::DeleteNewContactFromRetrivedIdL( TInt aIndexToUse ) - { - TRACER_AUTO; - TRACE( "aIndexToUse = %d",aIndexToUse ); - // This will create a contact in the CDB file. It returns MVPbkContactLink link to the CDB file. - return iVPbkContactStore->deleteRetriveVPbkContactL( aIndexToUse ); - } - - // ---------------------------------------------------------- -// CVIMPSTStorageServiceView::DeleteDatabaseL -// ---------------------------------------------------------- -void CVIMPSTStorageServiceView::DeleteDatabaseL() - { - TRACER_AUTO; - iVPbkContactStore->DeleteDatabaseL(); - } - -//================================================== from writer interface======================= - // ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::UpdateCacheContactL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContact* CVIMPSTStorageServiceView::UpdateCacheContactL(const MVPbkContactLink& aContactLink, - const TDesC& aUserId, - const TDesC& aDisplayName, - const TDesC8& aAvatarContent) - { - TRACER_AUTO; - MVIMPSTStorageContact* contact = FindContactByLink(aContactLink); - if( contact ) - { - TInt oldIndex = IndexOfContact( contact ); - TBool sortNeeded = EFalse; - if( contact->UserId().Compare( aUserId) != 0 ) - { - TRACE( "user id changed" ); - NotifyAllObserversL( TVIMPSTEnums::EStorageEventUserIdPreChange,NULL, contact,oldIndex); - contact->SetUserIdL( aUserId ); - if(aUserId.Length()== 0) - { - sortNeeded = ETrue; - contact->SetOnlineStatus(TVIMPSTEnums::EUnknown); - } - NotifyAllObserversL( TVIMPSTEnums::EStorageEventUserIdPostChange,NULL, contact,oldIndex); - TRACE( "NotifyAllObserversL delivered" ); - } - if(contact->Name().Compare(aDisplayName) != 0 ) - { - sortNeeded = ETrue; - TRACE( "display name changed" ); - if( aDisplayName.Length() <= 0 && iUnNamedText ) - { - contact->SetNameL( *iUnNamedText ); - } - else - { - contact->SetNameL( aDisplayName ); - } - } - if(sortNeeded) - { - TInt index = KErrNotFound; - TInt count = iContactListArray.Count(); - for(TInt i = 0; i < count; i++) - { - index = iContactListArray[i]->FindIndexOfContact(contact); - if(KErrNotFound != index ) - { - iContactListArray[i]->ResortContact(contact); - // get the index of the sorted contact, as after sorting the - // index would have changed based on presence. - // break after the contact list is found and the contact is found - break; - } - } - NotifyAllObserversL( TVIMPSTEnums::EStorageEventContactChange,NULL,contact, oldIndex ); - } - if( contact->AvatarContent().Compare( aAvatarContent ) != 0 ) - { - TRACE( "User id changed" ); - contact->SetAvatarContentL( aAvatarContent,*iVPbkContactStore ); - NotifyAllObserversL( TVIMPSTEnums::EStorageAvatarChange,NULL, contact, KErrNotFound); - TRACE( " NotifyAllObserversL delivered" ); - } - } - return contact; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::AddContactToCacheL -// ----------------------------------------------------------------------------- -MVIMPSTStorageContact* CVIMPSTStorageServiceView::AddContactToCacheL (const MVPbkContactLink& aContactLink, - const TDesC& aUserId, - const TDesC& aDisplayName, - const TDesC8& aAvatarContent, - TVIMPSTEnums::TVIMPSTStorgaeEventType aType ) - { - TRACER_AUTO; - TRACE(" user id: %S", &aUserId); - TRACE( " storageeventtype: %d", aType ); - MVIMPSTStorageContactList* contactList = FindContactListInternal( KFriendList ); - if( !contactList ) - { - contactList = CreateContactListL(KFriendList,KNullDesC); - } - TRACE(" Before findcontactlink" ); - MVIMPSTStorageContact* contact = FindContactByLink(aContactLink); - TRACE( " After findcontactlink check for findcontactuserid" ); - if(!contact && aUserId.Length() ) - { - MVIMPSTStorageContact* contact = FindContactByUserId( aUserId ); - } - TRACE( " After findcontactuserid " ); - if( !contact ) - { - TRACE( " contact not exist "); - TInt error = KErrGeneral; - TInt index = KErrNotFound; - if( aDisplayName.Length() <= 0 && iUnNamedText ) - { - TRACE(" no display name " ); - contact = CVIMPSTStorageContact::NewLC( aUserId, *iUnNamedText , aContactLink ,aAvatarContent ); - } - else - { - TRACE( " has display name " ); - contact = CVIMPSTStorageContact::NewLC( aUserId, aDisplayName , aContactLink, aAvatarContent); - } - // if the xsp id is numm, then the presence state should be EUnknown; - if(0 == aUserId.Length()) - { - contact->SetOnlineStatus(TVIMPSTEnums::EUnknown); - } - else if( aType == TVIMPSTEnums::EStorageEventContactAddition && !iIsInvitationItem ) - { - // if a invitation item getting accepted do not set to pending again - // if user has choosen add contact set the default status as pending - // to avoid any kind of flickering - contact->SetOnlineStatus(TVIMPSTEnums::EPending); - } - error = contactList->AddStorageContactToCacheL( contact, index ); - TRACE( "AddStorageContactToCacheL error= %d ",error ); - if( error == KErrNone ) - { - TRACE( "success " ); - CleanupStack::Pop(); // contact - TInt count = iContactListArray.Count(); - for(TInt i = 0; i < count; i++) - { - index = iContactListArray[i]->FindIndexOfContact(contact); - if(KErrNotFound != index ) - { - iContactListArray[i]->ResortContact(contact); - TRACE( " contact ResortContact " ); - // get the index of the sorted contact, as after sorting the - // index would have changed based on presence. - // break after the contact list is found and the contact is found - break; - } - } - index = IndexOfContact(contact); - NotifyAllObserversL( aType,NULL, contact, index ); - } - else - { - TRACE( " not success " ); - CleanupStack::PopAndDestroy(); // contact - contact = NULL; - } - } - iIsInvitationItem = EFalse; // reset the flag - return contact; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::AddStorageContactToCacheL -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::AddStorageContactToCacheL(MVIMPSTStorageContact* aContactToAdd ) - { - TRACER_AUTO; - TInt error = KErrGeneral; - MVIMPSTStorageContactList* contactList = FindContactListInternal( KFriendList ); - if( !contactList ) - { - contactList = CreateContactListL(KFriendList,KNullDesC); // create the default list :TODO chnage to proper sol - } - if( aContactToAdd ) - { - if( aContactToAdd->Name().Length() <= 0 && iUnNamedText ) - { - aContactToAdd->SetNameL( *iUnNamedText ); - } - TInt index = KErrNotFound; - TRACE( " online status = %d ", TVIMPSTEnums::EPending); - // if the userid(xsp field is null then the presence is unknown.) - if(aContactToAdd->UserId().Length() == 0) - { - aContactToAdd->SetOnlineStatus(TVIMPSTEnums::EUnknown); - } - else - { - aContactToAdd->SetOnlineStatus(TVIMPSTEnums::EPending); - } - error = contactList->AddStorageContactToCacheL( aContactToAdd, index ); // aContactToAdd ownership is transfered - TRACE( "index = %d ",index ); - if( error == KErrNone ) - { - TInt count = iContactListArray.Count(); - for(TInt i = 0; i < count; i++) - { - index = iContactListArray[i]->FindIndexOfContact(aContactToAdd); - if(KErrNotFound != index ) - { - iContactListArray[i]->ResortContact(aContactToAdd); - TRACE( "contact ResortContact " ); - // get the index of the sorted contact, as after sorting the - // index would have changed based on presence. - // break after the contact list is found and the contact is found - break; - } - } - index = IndexOfContact(aContactToAdd); - NotifyAllObserversL( TVIMPSTEnums::EStorageEventContactAddition,NULL, aContactToAdd, index ); - } - } - TRACE( " error = %d ",error ); - return error; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::RemoveContactFromCacheL -// From MVIMPSTStorageServiceView. -// Try to load with given ID, return NULL if not found. -// ----------------------------------------------------------------------------- - -TInt CVIMPSTStorageServiceView::RemoveContactFromCacheL(const MVPbkContactLink& aContactLink, - TVIMPSTEnums::TVIMPSTStorgaeEventType aType) - { - TRACER_AUTO; - TInt error = KErrNotFound; - MVIMPSTStorageContactList* contactList = FindContactListInternal( KFriendList ); - if( !contactList ) - { - contactList = CreateContactListL( KFriendList,KNullDesC ); // create the default list :TODO chnage to proper sol - } - MVIMPSTStorageContact* contact = FindContactByLink(aContactLink); - if( contact ) - { - // do not change the order of below line - // contact can be access just before deletion but not after delete from cache - if( aType == TVIMPSTEnums::EStorageEventDeleteFromPbk ) - { - // in EStorageEventDeleteFromPbk event ,caller should not remove from his local list - // this just to inform that if user caller want to do any pre operation like unsubscriibtion etc - NotifyAllObserversL( aType ,NULL,contact,0); //contact is still valid - } - TInt index = 0; - error = contactList->RemoveContactFromCacheL( aContactLink, index ); - NotifyAllObserversL( TVIMPSTEnums::EStorageEventContactDelete ,NULL,NULL,index); //contact is not valid ,deleted - } - TRACE("error = %d ",error ); - return error; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::RemoveAllCacheContactsL -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::RemoveAllCacheContactsL() - { - TRACER_AUTO; - TRACE( " count = %d", iContactListArray.Count()); - iContactListArray.ResetAndDestroy(); - TRACE( " remove sucess" ); - NotifyAllObserversL(TVIMPSTEnums::EStorageAllContactRemoved,NULL,NULL,0 ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::GetDefaultContactListL -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageContactList* CVIMPSTStorageServiceView::GetDefaultContactListL() - { - TRACER_AUTO; - MVIMPSTStorageContactList* contactList = FindContactListInternal( KFriendList ); - return contactList; - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::NotifyServiceViewL -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::NotifyServiceViewL( TVIMPSTEnums::TVIMPSTStorgaeEventType aEventType, - MVIMPSTStorageContact* aContact /*= NULL */ ) - { - TRACER_AUTO; - NotifyAllObserversL(aEventType,NULL, aContact,0 ); - } - - //================================================== from writer interface end =========================== -// TLinearOrder -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::ContactListOrderByDisplayName -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::ContactListOrderByDisplayName( - const CVIMPSTStorageContactList& aContactListA, - const CVIMPSTStorageContactList& aContactListB ) - { - TRACER_AUTO; - return aContactListA.DisplayName().CompareC( aContactListB.DisplayName() ); - } - -// TIdentityRelation -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::ContactListFindByContactListId -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTStorageServiceView::ContactListFindByContactListId( - const CVIMPSTStorageContactList& aContactListA, - const CVIMPSTStorageContactList& aContactListB ) - { - TRACER_AUTO; - const MVIMPSTStorageContactList& listA = aContactListA; - const MVIMPSTStorageContactList& listB = aContactListB; - TRACE(" return" ); - return ( VIMPSTStorageUtils::NeutralCompare( listA.ListId(), - listB.ListId(), EFalse ) == 0 ); - } -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::Count -// Returns item count -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::Count() const - { - TRACER_AUTO; - // fetch contact list count from storage - // and add contact counts from expanded contact lists - TInt listCount( ListCount() ); - TInt itemCount( 0 ); - TInt contactCount = 0; - for( TInt i(0); i 0 ) - { - // if list is expanded, add count of count of contacts - // in this list to item count - itemCount += contactCount; - //check for this - } - } - TRACE( "itemCount =%d",itemCount ); - return itemCount; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::Item -// Returns item at given index -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -MVIMPSTStorageItemModel::SItem CVIMPSTStorageServiceView::Item( TInt aIndex ) const - { - TRACER_AUTO; - MVIMPSTStorageItemModel::SItem item; - item.iType = MVIMPSTStorageItemModel::EInvalid; - item.iContactList = NULL; - item.iContact = NULL; - TInt contactCount = 0; - TInt count( 0 ); - TInt listCount( ListCount() ); - for( TInt i( 0 ); i < listCount; ++i ) - { - MVIMPSTStorageContactList& list = ListAt( i ); - item.iContactList = &list; - - ++count; - if( count > aIndex ) - { - // there's a list in given index - item.iType = MVIMPSTStorageItemModel::EContactList; - TRACE( "Item end" ); - return item; - } - contactCount = list.Count() ; - if( contactCount > 0 ) - { - // list is expanded, consider also contacts in this list - if( count + contactCount > aIndex ) - { - // there's a contact in given index - TInt contactIndex( aIndex - count ); - item.iType = MVIMPSTStorageItemModel::EContactItem; - item.iContact = &list[contactIndex]; - TRACE( "Item end" ); - return item; - } - // add expanded list's contact count - count += contactCount; - } - } - // not found - return item; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::IndexOfContact -// Gets index of contact in list -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::IndexOfContact( MVIMPSTStorageContact* aContact ) const - { - TRACER_AUTO; - TInt listCount( ListCount() ); - TInt itemCount( 0 ); - TInt contactCount = 0; - TInt indexOfContact = KErrNotFound; - for( TInt i(0); i < listCount; ++i ) - { - MVIMPSTStorageContactList& list = ListAt(i); - contactCount = list.Count( ) ; - indexOfContact = list.FindIndexOfContact( aContact ); - // if we're showing all contacts or - // there are online contacts in this list, - // the list-item is shown => increase count check this? - //itemCount; //++itemCount; - if( indexOfContact != KErrNotFound ) - { - // add earlier items to index. - indexOfContact += itemCount; - break; - } - else - { - itemCount += contactCount; - } - //add the code for if contact not found in first list - } - TRACE( " indexOfContact = %d", indexOfContact ); - return indexOfContact; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::IndexOfList -// Gets index of contact in list -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTStorageServiceView::IndexOfList( MVIMPSTStorageContactList* aList, - TBool /*aIgnoreOwnItem = EFalse*/, - TBool /*aIgnoreEmptyLists = ETrue*/ ) const - { - TRACER_AUTO; - TInt listCount( ListCount() ); - TInt itemCount( 0 ); - for( TInt i(0); i sort all -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::Sort( const TDesC& aContactListId /* = KNullDesC */ ) - { - TRACER_AUTO; - if( aContactListId.Length() != 0 ) - { - MVIMPSTStorageContactList* list = FindContactList( aContactListId ); - if( list ) - { - TRACE( " list sort" ); - list->Sort(); - } - } - else - { - TInt count( iContactListArray.Count() ); - for( TInt a( 0 ); a < count; ++a ) - { - MVIMPSTStorageContactList& list = *iContactListArray[ a ]; - TRACE( " all list sort" ); - list.Sort(); - } - } - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::NotifyAllObservers -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::NotifyAllObserversL( TVIMPSTEnums::TVIMPSTStorgaeEventType aType, - MVIMPSTStorageContactList *aList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ) - { - TRACER_AUTO; - TInt count = iContactObservers.Count(); - for( TInt i=0; iHandleStorageChangeL( aType, aList, aContact, aContactIndex ); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::NotifyAllObserversWithDelay -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::NotifyAllObserversWithDelay( TVIMPSTEnums::TVIMPSTStorgaeEventType aType, - MVIMPSTStorageContactList *aList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex ) - { - TRACER_AUTO; - if(iActiveHandler->IsActive() ) - { - iActiveHandler->Cancel(); - } - iActiveHandler->IssueRequest( aType, aList, aContact, aContactIndex ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageServiceView::HandleDelayedNotificationL -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageServiceView::HandleDelayedNotificationL(TVIMPSTEnums::TVIMPSTStorgaeEventType aType, - MVIMPSTStorageContactList *aList, - MVIMPSTStorageContact* aContact, - TInt aContactIndex) - { - TRACER_AUTO; - NotifyAllObserversL( aType, aList, aContact, aContactIndex ); - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststoragevpbklocalstore.cpp --- a/uiservicetab/vimpststorage/src/cvimpststoragevpbklocalstore.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1071 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that provides handling of vpbk local store -* -*/ - -// INCLUDE FILES -#include -#include "cvimpststoragevpbklocalstore.h" - -#include "cvimpststoragevpbkstorehandler.h" - -#include -#include -#include "mvimpststorageserviceview.h" -#include "uiservicetabtracer.h" -#include "tvimpstconsts.h" -#include -#include -#include "cvimpststoragecontact.h" -#include "vimpststorageutils.h" - -#include -#include - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore:: -// CVIMPSTStorageVPbkLocalStore -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkLocalStore:: CVIMPSTStorageVPbkLocalStore( MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ): - CActive( CActive::EPriorityIdle ), - iServiceCacheWriter( aServiceCacheWriter ), - iFetchStep( EFetchingUnknown ) - { - TRACER_AUTO; - CActiveScheduler::Add( this ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkLocalStore* CVIMPSTStorageVPbkLocalStore::NewL( const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ) - { - TRACER_AUTO; - CVIMPSTStorageVPbkLocalStore* self = NewLC( aContactDb, - aServiceName, - aServiceCacheWriter); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::NewLC -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkLocalStore* - CVIMPSTStorageVPbkLocalStore::NewLC( const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ) - { - TRACER_AUTO; - - CVIMPSTStorageVPbkLocalStore* self = - new (ELeave) CVIMPSTStorageVPbkLocalStore(aServiceCacheWriter); - CleanupStack::PushL( self ); - self->ConstructL( aContactDb, aServiceName ); - - return self; - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::ConstructL( const TDesC& aContactDb, const TDesC& aServiceName ) - { - TRACER_AUTO; - - iVPbkStoreHandler = CVIMPSTStorageVPbkStoreHandler::NewL( aContactDb ,aServiceName, *this,ETrue ); - TRACE( "iVPbkStoreHandler created" ); - //construct the persistent store name - iLocalDBName = HBufC::NewL( aServiceName.Length()+ KStorageExtn().Length()); - TPtr iLocalDBNamePtr = iLocalDBName->Des(); - iLocalDBNamePtr.Append(aServiceName); - _LIT(KSpecialChar ,"/\\:*?<>\""); - AknTextUtils :: StripCharacters(iLocalDBNamePtr,KSpecialChar); - iLocalDBNamePtr.Append(KStorageExtn()); - TRACE( "iLocalDBNamePtr: %S", &iLocalDBNamePtr ); - MVPbkContactStore* defaultStore = iVPbkStoreHandler->GetDefaultStoreL( aContactDb ); - User::LeaveIfNull(defaultStore); - TRACE("defaultStore retrived" ); - iIdConverter = CVPbkContactIdConverter::NewL(*defaultStore); - TRACE( "iIdConverter created" ); - User::LeaveIfError( iFs.Connect() ); - // Open existing or create new database. - TRACE( "connected to file server" ); - if ( DbExists() ) - { - TRACE( "local db exist" ); - OpenDbL(); - TRACE( "open success" ); - } - else - { - TRACE("local db not exist" ); - DoFreespaceLevelCheckL( KEmptyDbSize ); - CreateDbL(); - TRACE("local db created"); - } - OpenTableL(); - TRACE("OpenTableL success " ); - iColset = iDb.ColSetL( KContactTable ); - TRACE( " iColset is set" ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore:: -// ~CVIMPSTStorageVPbkLocalStore -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkLocalStore::~CVIMPSTStorageVPbkLocalStore() - { - TRACER_AUTO; - - iRetrivedContactArray.ResetAndDestroy(); - TRAP_IGNORE( ResetAndDestroyLocalArrayL() ); - - CloseTable(); - delete iColset; - CloseDb(); - iFs.Close(); - - delete iLocalDBName; - delete iIdConverter; - delete iInviteId; - delete iVPbkStoreHandler; - - } - - // --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore:: -// ResetAndDestroyLocalArrayL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::ResetAndDestroyLocalArrayL() - { - TRACER_AUTO; - TInt count = iFetchContactsToBeAdded.Count(); - while( count ) - { - TVIMPSTContactInfo contactInf = iFetchContactsToBeAdded[ count-1 ]; - iFetchContactsToBeAdded.Remove( count-1 ); - delete contactInf.iUserId; - contactInf.iUserId = NULL; - delete contactInf.iDisplayName; - contactInf.iDisplayName = NULL; - // not exist need to add - iFetchContactsToBeAdded.Compress(); - count = iFetchContactsToBeAdded.Count(); - } - iFetchContactsToBeAdded.Reset(); - - } - -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::LocalStore -// ---------------------------------------------------------- -// -TBool CVIMPSTStorageVPbkLocalStore::LocalStore() const - { - TRACER_AUTO; - return ETrue; - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::HandleVPbkStoreEventL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::HandleVPbkStoreEventL(TVIMPSTVPbkStoreEvent aVPbkStoreEvent) - { - TRACER_AUTO; - switch( aVPbkStoreEvent.iEventType ) - { - case EVPbkContactReadCompleted: - { - TRACE( " EVPbkContactReadCompleted started" ); - iServiceCacheWriter.NotifyServiceViewL(TVIMPSTEnums::EStorageContactReadComplete); - if( iFetchStep == EFetchingCalled ) - { - TRACE( " EVPbkContactReadCompleted EFetchingCalled " ); - IssueRequest(); - } - iFetchStep = EContactReadComplete; - TRACE( "EContactReadComplete completed " ); - break; - } - case EVPbkContactReading: - { - // a contact entry has been created in virtual database store - // create the cache contact - TInt32 linkId = iIdConverter->LinkToIdentifier(*aVPbkStoreEvent.iContactLink ); - TDbColNo colNo = iColset->ColNo( KContactId ); - if ( SeekRowL( colNo, linkId ) ) - { - TRACE( "EVPbkContactReading contact" ); - /* - * This is local store, that is phone book and service tab shares only one cdb file. - * in that case, if somebody edits the cdb file from contacts tab, then also we get the - * callback, then checking for entry in db table makes sens.. - */ - /* - * in case when the user adds a contact from the service tab, then it first tries to add it in the - * cdb file, after that we get this callback, then , there is no way that it will be present in the - * db table, in that case, we will not add it in the cache - which is wrong.. - * so we need to make a differentiation, on how the contact was added.. whether from cotnacts tab - * or from the service tab. --- to solve this issue.. we can store the userid in memberVariable.. - * before making a add request to the VPBK (cdb file).. then in this function, we check if - * the contactid is same as the member variable. aVPbkStoreEvent contains the userid that was added. - * then if it matches, then we know that it was added from our service tab.. and then we can add it in our DB. - */ - // contatc found in local database ,add to storage - iServiceCacheWriter.AddContactToCacheL (*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName, - aVPbkStoreEvent.iAvatarContent, - TVIMPSTEnums::EStorageContactReading ); - } - - break; - } - case EVPbkContactFetching: - case EVPbkContactAdded: - { - // a contact entry has been created in virtual database store - // create the cache contact - TInt32 linkId = iIdConverter->LinkToIdentifier(*aVPbkStoreEvent.iContactLink ); - TDbColNo colNo = iColset->ColNo( KContactId ); - if( iFetchStep == EFetchingOn ) - { - TRACE( "EVPbkContactFetching contact" ); - WriteToStoreDbL( linkId ); - iServiceCacheWriter.AddContactToCacheL (*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName , - aVPbkStoreEvent.iAvatarContent, - TVIMPSTEnums::EStorageContactFetching ); - IssueRequest(); - } - else if ( SeekRowL( colNo, linkId ) ) - { - TRACE( " EVPbkContactAdded start" ); - /* - * This is local store, that is phone book and service tab shares only one cdb file. - * in that case, if somebody edits the cdb file from contacts tab, then also we get the - * callback, then checking for entry in db table makes sens.. - */ - /* - * in case when the user adds a contact from the service tab, then it first tries to add it in the - * cdb file, after that we get this callback, then , there is no way that it will be present in the - * db table, in that case, we will not add it in the cache - which is wrong.. - * so we need to make a differentiation, on how the contact was added.. whether from cotnacts tab - * or from the service tab. --- to solve this issue.. we can store the userid in memberVariable.. - * before making a add request to the VPBK (cdb file).. then in this function, we check if - * the contactid is same as the member variable. aVPbkStoreEvent contains the userid that was added. - * then if it matches, then we know that it was added from our service tab.. and then we can add it in our DB. - */ - // contatc found in local database ,add to storage - iServiceCacheWriter.AddContactToCacheL (*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName, - aVPbkStoreEvent.iAvatarContent, - TVIMPSTEnums::EStorageEventContactAddition ); - TRACE( "EVPbkContactAdded completed" ); - } - else if( iInviteId ) - { - TRACE( "iInviteId accepted" ); - if( IsSameContactIdL( *iInviteId, aVPbkStoreEvent.iUserId ) ) - { - WriteToStoreDbL( linkId ); - iServiceCacheWriter.AddContactToCacheL (*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName, - aVPbkStoreEvent.iAvatarContent, - TVIMPSTEnums::EStorageEventContactAddition ); - delete iInviteId; - iInviteId = NULL; - } - TRACE( "iInviteId accepted sucess" ); - } - break; - } - case EVPbkContactSynchronizing: - { - TRACE( "EVPbkContactSynchronizing " ); - // a contact entry has been created in virtual database store - // create the cache contact - TInt32 linkId = iIdConverter->LinkToIdentifier(*aVPbkStoreEvent.iContactLink ); - TDbColNo colNo = iColset->ColNo( KContactId ); - if ( SeekRowL( colNo, linkId ) ) - { - /* - * This is local store, that is phone book and service tab shares only one cdb file. - * in that case, if somebody edits the cdb file from contacts tab, then also we get the - * callback, then checking for entry in db table makes sens.. - */ - /* - * in case when the user adds a contact from the service tab, then it first tries to add it in the - * cdb file, after that we get this callback, then , there is no way that it will be present in the - * db table, in that case, we will not add it in the cache - which is wrong.. - * so we need to make a differentiation, on how the contact was added.. whether from cotnacts tab - * or from the service tab. --- to solve this issue.. we can store the userid in memberVariable.. - * before making a add request to the VPBK (cdb file).. then in this function, we check if - * the contactid is same as the member variable. aVPbkStoreEvent contains the userid that was added. - * then if it matches, then we know that it was added from our service tab.. and then we can add it in our DB. - */ - // contatc found in local database ,add to storage - iServiceCacheWriter.AddContactToCacheL (*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName, - aVPbkStoreEvent.iAvatarContent, - TVIMPSTEnums::EStorageContactFetching ); - } - if(iFetchStep == EFetchingOn) - { - TRACE( "EVPbkContactSynchronizing fetchin on" ); - IssueRequest(); - } - TRACE(" EVPbkContactSynchronizing completed" ); - break; - } - case EVPbkContactDeleted: - { - TRACE( "EVPbkContactDeleted" ); - TInt32 linkId = iIdConverter->LinkToIdentifier(*aVPbkStoreEvent.iContactLink ); - // a contact entry has been deleted from virtual database store - TDbColNo colNo = iColset->ColNo( KContactId ); - if ( SeekRowL( colNo, linkId ) ) - { - TRACE( "EVPbkContactDeleted found in db" ); - // contatc found in local database ,delete from local database - DeleteContactFromInternalStoreL( linkId ); - TRACE( "EVPbkContactDeleted deleted from db" ); - // delete from cache contact - iServiceCacheWriter.RemoveContactFromCacheL(*aVPbkStoreEvent.iContactLink, - TVIMPSTEnums::EStorageEventDeleteFromPbk ); - TRACE( "EVPbkContactDeleted deleted from cache" ); - } - break; - } - case EVPbkContactChanged: - { - TRACE( "EVPbkContactChanged "); - TInt32 linkId = iIdConverter->LinkToIdentifier(*aVPbkStoreEvent.iContactLink ); - TDbColNo colNo = iColset->ColNo( KContactId ); - if ( SeekRowL( colNo, linkId ) ) - { - TRACE( "EVPbkContactChanged found in local db" ); - // found in the list update it - iServiceCacheWriter.UpdateCacheContactL(*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName, - aVPbkStoreEvent.iAvatarContent ); - TRACE( "EVPbkContactChanged changed in cache"); - } - break; - } - case EVPbkContactRetriving: - { - TRACE( "EVPbkContactRetriving"); - // in case of local we allow all - TRACE( "EVPbkContactRetriving valid Id"); - CVIMPSTStorageContact* retrivedContact = CVIMPSTStorageContact::NewL( aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName, - *aVPbkStoreEvent.iContactLink, - aVPbkStoreEvent.iAvatarContent); - iRetrivedContactArray.Append( retrivedContact ); // takes the ownership of retrivedContact - TRACE( "EVPbkContactRetriving valid Id added" ); - // keep the backup of retrieved contacts - // user can add later once it sent to server - break; - } - case EVPbkUnknownChanges: - { - TRACE("EVPbkUnknownChanges start" ); - DeleteAllContactFromInternalStoreL(); - TRACE( " EVPbkUnknownChanges all delete from db" ); - // unknow mean all contact deleted from store - iServiceCacheWriter.RemoveAllCacheContactsL(); - TRACE( " EVPbkUnknownChanges all delete from cache" ); - break; - } - default: - break; - } - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::IssueRequest -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::IssueRequest() - { - TRACER_AUTO; - if( !IsActive() ) - { - TRACE( "SetActive" ); - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone ); - SetActive(); - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::RunL -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::RunL() - { - TRACER_AUTO; - TInt count = iFetchContactsToBeAdded.Count(); - TRACE( "count to be added = %d ",count ); - if( !count ) - { - TRACE(" fetch completed " ); - iFetchStep = EContactReadComplete; - iServiceCacheWriter.NotifyServiceViewL( TVIMPSTEnums::EStorageContactFetchComplete ); - TRACE( "fetch completed notification sent" ); - } - else - { - TRACE( "fetch in progress" ); - iFetchStep = EFetchingOn; - TVIMPSTContactInfo contactInfoToAdd = iFetchContactsToBeAdded[0]; - MVIMPSTStorageContact* exist = iServiceCacheWriter.FindCacheContactByUserId( *contactInfoToAdd.iUserId ); - if( exist ) - { - // contact is already exist ,send the notification about this - iServiceCacheWriter.NotifyServiceViewL(TVIMPSTEnums::EStorageContactFetchExistInStore, exist ); - TRACE( " fetch in progress id exist" ); - // process next - IssueRequest(); - } - else - { - TRACE( "fetch in progress create id in store called" ); - // pass the display NAme in place of NULL - iVPbkStoreHandler->CreateVPbkContactL( *contactInfoToAdd.iUserId, *contactInfoToAdd.iDisplayName ); // process always 0th item - } - iFetchContactsToBeAdded.Remove( 0 ); - delete contactInfoToAdd.iUserId; - contactInfoToAdd.iUserId = NULL; - delete contactInfoToAdd.iDisplayName; - contactInfoToAdd.iDisplayName = NULL ; - iFetchContactsToBeAdded.Compress(); - TRACE( "fetch in progress iFetchContactsToBeAdded ,one entry removed" ); - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::DoCancel -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::DoCancel() - { - TRACER_AUTO; - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::RunError -// -------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::RunError( TInt aError ) - { - TRACER_AUTO; - return aError; - } - -////////////////////////////////////////////////////////// -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::CreateVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::CreateVPbkContactL(const TDesC& aUserId, - const TDesC& aDisplayName , - TBool aInvitationAutoAccept /* = EFalse */ ) - { - TRACER_AUTO; - TInt error = KErrGeneral; - if( aInvitationAutoAccept) - { - TRACE("autoaccept add contact" ); - delete iInviteId; - iInviteId = NULL; - iInviteId = aUserId.AllocL(); - error = iVPbkStoreHandler->CreateVPbkContactL( *iInviteId,aDisplayName ); - } - TRACE( "error = %d",error ); - - return error; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::RemoveVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::RemoveVPbkContactL(const MVPbkContactLink& aContactLink) - { - TRACER_AUTO;; - TInt error = KErrNotFound; - // text now holds the name (or first field of the contact) - TInt32 linkId = iIdConverter->LinkToIdentifier(aContactLink); - // a contact entry has been deleted from virtual database store - TDbColNo colNo = iColset->ColNo( KContactId ); - if ( SeekRowL( colNo, linkId ) ) - { - TRACE( "link exist in db" ); - // contatc found in local database ,delete from local database - DeleteContactFromInternalStoreL( linkId ); - TRACE( "link deleted from db" ); - // delete from cache contact - error = iServiceCacheWriter.RemoveContactFromCacheL(aContactLink, - TVIMPSTEnums::EStorageEventContactDelete ); - TRACE( "link deleted from cache" ); - } - TRACE("error %d",error ); - - return error; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::RemoveAllVPbkContactsL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::RemoveAllVPbkContactsL() - { - TRACER_AUTO; - iRetrivedContactArray.ResetAndDestroy(); - DeleteAllContactFromInternalStoreL(); - TRACE( "all contacts deleted from db" ); - iServiceCacheWriter.RemoveAllCacheContactsL(); - TRACE( "all contacts deleted from cache" ); - - return KErrNone;// local store : delete from local store ,own user has changed - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::RetrieveVPbkXSPIdL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::RetrieveVPbkXSPIdL(const TDesC8& aPackedLinks ) - { - TRACER_AUTO; - iRetrivedContactArray.ResetAndDestroy(); - TRACE( " iRetrivedContactArray Reset" ); - iVPbkStoreHandler->RetrieveVPbkContactL( aPackedLinks ); - TRACE( "iRetrivedContactArray count= %d " ,iRetrivedContactArray.Count() ); - - return iRetrivedContactArray.Count(); - } - - // --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::GetRetrieveVPbkXSPIdL -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTStorageVPbkLocalStore::GetRetrieveVPbkXSPIdL(TInt aIndex ) - { - TRACER_AUTO; - TRACE( "aIndex = %d" ,aIndex ); - MVIMPSTStorageContact* contact = NULL; - if( aIndex >= 0 && aIndex < iRetrivedContactArray.Count() ) - { - contact = iRetrivedContactArray[ aIndex ]; - } - - return contact ? contact->UserId() : KNullDesC ; - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::CreateRetriveVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::CreateRetriveVPbkContactL( TInt aIndexToUse ) - { - TRACER_AUTO; - if( aIndexToUse < 0 && aIndexToUse >= iRetrivedContactArray.Count() ) - { - TRACE( " argument error" ); - return KErrArgument; - } - TInt error = KErrAlreadyExists; - MVIMPSTStorageContact* retrivedContact = iRetrivedContactArray[ aIndexToUse ]; - - MVPbkContactLink* contactLink = retrivedContact->ContactLink(); - MVIMPSTStorageContact* exist = NULL; - if( contactLink ) - { - exist = iServiceCacheWriter.FindCacheContactByLink( *contactLink ); - } - if( !exist ) - { - TRACE( "adding to cache" ); - MVPbkContactLink* link = retrivedContact->ContactLink(); - if( link ) - { - CVIMPSTStorageContact* contactToAdd = CVIMPSTStorageContact::NewL( retrivedContact->UserId() , - retrivedContact->Name(), - *link, - retrivedContact->AvatarContent() - ); - CleanupStack::PushL( contactToAdd ); - TInt32 linkId = iIdConverter->LinkToIdentifier( *link ); - error = iServiceCacheWriter.AddStorageContactToCacheL( contactToAdd ); // contactToAdd ownership is transfered - TRACE( " adding to cache done" ); - if( error == KErrNone ) - { - CleanupStack::Pop(); // contactToAdd , Ownership is transfered to AddStorageContactToCacheL - WriteToStoreDbL( linkId ); - } - else - { - CleanupStack::PopAndDestroy(); // contactToAdd - } - TRACE( " adding to db done" ); - } - } - TRACE( "error =%d" ,error ); - - return error; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::deleteRetriveVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::deleteRetriveVPbkContactL( TInt aIndexToUse ) - { - TRACER_AUTO; - if( aIndexToUse < 0 && aIndexToUse >= iRetrivedContactArray.Count() ) - { - TRACE( "argument error" ); - return KErrArgument; - } - MVIMPSTStorageContact* retrivedContact = iRetrivedContactArray[ aIndexToUse ]; - MVPbkContactLink* contactLink = retrivedContact->ContactLink(); - // delete from cache contact - CVPbkContactLinkArray* contactsToDelete = CVPbkContactLinkArray::NewLC(); - MVPbkContactLink* link = contactLink->CloneLC(); - contactsToDelete->AppendL( link ); // takes ownership - CleanupStack::Pop(); // link - TInt error = iVPbkStoreHandler->RemoveVPbkContactL( *contactsToDelete ); - CleanupStack::PopAndDestroy(); // contactsToDelete - - return error; - } -// CVIMPSTStorageVPbkLocalStore::UpdateAvatarFieldDataL() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::UpdateAvatarFieldDataL(const MVPbkContactLink& aContactLink, - const TDesC8& aAvatartData ) - { - TRACER_AUTO; - return iVPbkStoreHandler->UpdateAvatarFieldDataL( aContactLink, aAvatartData ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::RemoveAvatarFieldL() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::RemoveAvatarFieldL(MVPbkStoreContact& aStoreContact) - { - TRACER_AUTO; - return iVPbkStoreHandler->RemoveAvatarFieldL( aStoreContact ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::AddVPbkFetchContactsL() -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::AddVPbkFetchContactsL( RArray & aFirstNameList, - RArray &aServiceField ) - { - TRACER_AUTO; - // in case of server contacts delete all contacts - ResetAndDestroyLocalArrayL(); - TInt count = aServiceField.Count(); - TRACE( " count=%d" ,count ); - for( TInt i = 0; i storagePath; - - storagePath.Append( KDbPath ); - storagePath.Append( *iLocalDBName ); - TBool ret = ETrue; - TInt err( temp.Open( iFs, *(&storagePath), EFileShareReadersOrWriters|EFileRead ) ); - TInt size( 0 ); - if ( err == KErrNone ) - { - temp.Size( size ); - } - temp.Close(); - if ( (size == 0) || ( err != KErrNone ) ) - { - ret = EFalse; - } - - return ret; - } - - -// ----------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::CreateDbL -// ----------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::CreateDbL() - { - TRACER_AUTO; - TBuf< KMaxPath > storagePath; - storagePath.Append( KDbPath ); - iFs.MkDirAll( storagePath ); // make sure the directory exists - storagePath.Append( *iLocalDBName ); - iFs.SetAtt( *iLocalDBName ,KEntryAttHidden|KEntryAttSystem , KEntryAttNormal); - iFileStore = CPermanentFileStore::ReplaceL( iFs, storagePath, EFileShareReadersOrWriters|EFileWrite ); - - iFileStore->SetTypeL( iFileStore->Layout() ); - - TStreamId streamId( 0 ); - TRAPD( err, streamId = iDb.CreateL( iFileStore ) ); - - if( err ) - { - TRACE( " err = %d" ,err ); - delete iFileStore; - iFileStore = NULL; - - // remember to keep this updated - iFs.Delete( storagePath ); - User::Leave( err ); - } - - iFileStore->SetRootL( streamId ); - TInt err2( iFileStore->Commit() ); - User::LeaveIfError( err2 ); - - TRAPD( err3, CreateTablesL() ); - if( err3 ) - { - delete iFileStore; - iFileStore = NULL; - iDb.Close(); - iFs.Delete( storagePath ); - User::Leave( err3 ); - } - - } - -// ----------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::OpenDbL -// ----------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::OpenDbL() - { - TRACER_AUTO; - TBuf< KMaxPath > storagePath; - storagePath.Append( KDbPath ); - storagePath.Append( *iLocalDBName ); - iFileStore = CPermanentFileStore::OpenL( iFs, storagePath, EFileShareReadersOrWriters|EFileWrite ); - iFileStore->SetTypeL( iFileStore->Layout() ); - iDb.OpenL( iFileStore, iFileStore->Root() ); - - } - -// ----------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::CloseDb -// ----------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::CloseDb() - { - TRACER_AUTO; - delete iFileStore; - iFileStore = NULL; - iDb.Close(); - - } - -// ----------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::CreateTablesL -// ----------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::CreateTablesL() - { - TRACER_AUTO; - CDbColSet* contactId = CDbColSet::NewLC(); - - AddColumnL( KContactId, EDbColInt32, contactId ); - - TInt err = iDb.CreateTable( KContactTable, *contactId ); - TRACE( "err = %d" ,err ); - User::LeaveIfError( err ); - - CleanupStack::PopAndDestroy( contactId ); - - } - -// ----------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::AddColumnL -// ----------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::AddColumnL( const TDesC& aName, TDbColType aType, CDbColSet* aColset ) - { - TRACER_AUTO; - TDbCol column( aName, aType ); - aColset->AddL( column ); - - } - -// ----------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::DoFreespaceLevelCheckL -// ----------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::DoFreespaceLevelCheckL( TInt aSize ) - { - TRACER_AUTO; - if ( SysUtil::FFSSpaceBelowCriticalLevelL( &iFs, aSize ) ) - { - User::Leave( KErrDiskFull ); - } - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::DeleteAllContactFromInternalStoreL -// ----------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::DeleteAllContactFromInternalStoreL() - { - TRACER_AUTO; - iColset->ColNo( KContactId ); - iTable.LastL(); - while( !iTable.IsEmptyL() ) - { - iTable.GetL(); - iTable.DeleteL(); - iDb.Compact(); - // delete alwasy first item untill table is empty - iTable.LastL(); - } - - } -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::DeleteContactFromInternalStoreL -// ---------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::DeleteContactFromInternalStoreL( TInt32& aIdentifier ) - { - TRACER_AUTO; - TDbColNo colNo = iColset->ColNo( KContactId ); - if ( SeekRowL( colNo, aIdentifier ) ) - { - iTable.DeleteL(); - iDb.Compact(); - TRACE( "found deleted" ); - } - - } - -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::WriteToStoreDbL -// ---------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::WriteToStoreDbL( TInt32& aIdentifier ) - { - TRACER_AUTO; - TDbColNo colNo = iColset->ColNo( KContactId ); - if (!SeekRowL( colNo, aIdentifier ) ) - { - iTable.InsertL(); - - colNo = iColset->ColNo( KContactId ); - iTable.SetColL( colNo, aIdentifier ); - - // Write row to table - TRAPD( err, iTable.PutL() ); - if( err != KErrNone ) - { - // recover - iTable.Cancel(); - iTable.Reset(); - } - } - - } -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::OpenTableL -// ---------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::OpenTableL() - { - TRACER_AUTO; - TInt err( iTable.Open( iDb, KContactTable ) ); - if ( err != KErrNone ) - { - TRACE( " err =%d" ,err ); - iTable.Close(); - User::Leave( err ); - } - - } - -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::CloseTable -// ---------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::CloseTable() - { - TRACER_AUTO; - iTable.Close(); - - } - -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::ReadFirstL -// ---------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::ReadFirstL( TInt32& aIdentifier ) - { - TRACER_AUTO; - iTable.BeginningL(); - - return ReadNextL( aIdentifier ); - } - -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::ReadNextL -// ---------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkLocalStore::ReadNextL( TInt32& aIdentifier ) - { - TRACER_AUTO; - TInt err = KErrNotFound; - if ( iTable.NextL() ) - { - TRAP( err, ReadCurrentL( aIdentifier ) ); - // For some reason ReadCurrentL leaves with KErrEof, - // even if the contact was read succesfully. - } - TRACE( " err = %d" ,err ); - - return err; - } - - -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::ReadCurrentL -// ---------------------------------------------------------- -// -void CVIMPSTStorageVPbkLocalStore::ReadCurrentL( TInt32& aIdentifier ) - { - TRACER_AUTO; - iTable.GetL(); - // Get Column number for contact data size - TDbColNo colNo = iColset->ColNo( KContactId ); - aIdentifier = iTable.ColInt32(colNo); - - } - -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::SeekRowL -// ---------------------------------------------------------- -// -TBool CVIMPSTStorageVPbkLocalStore::SeekRowL( TDbColNo aColNo, TInt32& aIdentifier ) - { - TRACER_AUTO; - TBool ret = EFalse; - iTable.BeginningL(); - while ( iTable.NextL() ) - { - iTable.GetL(); - if ( iTable.ColInt32( aColNo ) == aIdentifier ) - { - ret = ETrue; - break; - } - } - - return ret; - } -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::DeleteDatabaseL -// ---------------------------------------------------------- -void CVIMPSTStorageVPbkLocalStore::DeleteDatabaseL() - { - TRACER_AUTO; - TBuf< KMaxPath > storagePath; - storagePath.Append( KDbPath ); - iFs.MkDirAll( storagePath ); - storagePath.Append( *iLocalDBName ); - //close db before deleting it. - CloseDb(); - iFs.Delete( storagePath ); - - } -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkLocalStore::IsSameContactIdL -// ---------------------------------------------------------- -TBool CVIMPSTStorageVPbkLocalStore::IsSameContactIdL(const TDesC& aFirstId, const TDesC& aSecondId ) - { - TRACER_AUTO; - TInt colIndex = aFirstId.Find(_L(":")); - TPtrC firstId = aFirstId.Right( aFirstId.Length() - colIndex -1); - colIndex = aSecondId.Find(_L(":")); - TPtrC secondId = aSecondId.Right( aSecondId.Length() - colIndex -1); - //if( Compare( firstId,secondId ) == 0 ) - if(firstId.Compare(aSecondId) ==0 ) - { - return ETrue; - } - return EFalse; - } -// End of file - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststoragevpbkserverstore.cpp --- a/uiservicetab/vimpststorage/src/cvimpststoragevpbkserverstore.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,537 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that provides handling of vpbk server store -* -*/ - - - -// INCLUDE FILES -#include "cvimpststoragevpbkserverstore.h" - -#include "cvimpststoragevpbkstorehandler.h" - -#include -#include -#include "uiservicetabtracer.h" -#include "tvimpstconsts.h" -#include "mvimpststorageserviceview.h" -#include -#include -#include "cvimpststoragecontact.h" - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore:: -// CVIMPSTStorageVPbkServerStore -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkServerStore:: CVIMPSTStorageVPbkServerStore( MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ): - CActive( CActive::EPriorityIdle ), - iServiceCacheWriter( aServiceCacheWriter ), - iFetchStep( EFetchingUnknown ) - { - TRACER_AUTO; - CActiveScheduler::Add( this ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkServerStore::ConstructL( const TDesC& aContactDb, const TDesC& aServiceName) - { - TRACER_AUTO; - iVPbkStoreHandler = CVIMPSTStorageVPbkStoreHandler::NewL( aContactDb,aServiceName, *this, EFalse ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkServerStore* - CVIMPSTStorageVPbkServerStore::NewL( const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ) - { - TRACER_AUTO; - CVIMPSTStorageVPbkServerStore* self = NewLC( aContactDb, - aServiceName, - aServiceCacheWriter ); - CleanupStack::Pop( self ); - - return self; - - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::NewLC -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkServerStore* - CVIMPSTStorageVPbkServerStore::NewLC(const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageServiceCacheWriter& aServiceCacheWriter ) - { - TRACER_AUTO; - CVIMPSTStorageVPbkServerStore* self = - new (ELeave) CVIMPSTStorageVPbkServerStore(aServiceCacheWriter); - CleanupStack::PushL( self ); - self->ConstructL( aContactDb,aServiceName ); - - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore:: -// ~CVIMPSTStorageVPbkServerStore -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkServerStore::~CVIMPSTStorageVPbkServerStore() - { - TRACER_AUTO; - iRetrivedXSPIdArray.ResetAndDestroy(); - TRAP_IGNORE( ResetAndDestroyLocalArrayL() ); - delete iVPbkStoreHandler; - - } - - // --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::ResetAndDestroyLocalArrayL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkServerStore::ResetAndDestroyLocalArrayL() - { - TRACER_AUTO; - TInt count = iFetchContactsToBeAdded.Count(); - while( count ) - { - TVIMPSTContactInfo contactInf = iFetchContactsToBeAdded[ count-1 ]; - iFetchContactsToBeAdded.Remove( count-1 ); - delete contactInf.iUserId; - contactInf.iUserId = NULL; - delete contactInf.iDisplayName; - contactInf.iDisplayName = NULL; - // not exist need to add - iFetchContactsToBeAdded.Compress(); - count = iFetchContactsToBeAdded.Count(); - } - iFetchContactsToBeAdded.Reset(); - - } -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::LocalStore -// ---------------------------------------------------------- -// -TBool CVIMPSTStorageVPbkServerStore::LocalStore() const - { - TRACER_AUTO; - return EFalse; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::HandleVPbkStoreEventL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkServerStore::HandleVPbkStoreEventL(TVIMPSTVPbkStoreEvent aVPbkStoreEvent) - { - TRACER_AUTO; - switch( aVPbkStoreEvent.iEventType ) - { - case EVPbkContactReadCompleted: - { - TRACE( "EVPbkContactReadCompleted started" ); - iServiceCacheWriter.NotifyServiceViewL(TVIMPSTEnums::EStorageContactReadComplete); - if( iFetchStep == EFetchingCalled ) - { - TRACE( "EVPbkContactReadCompleted fetcing in progress " ); - IssueRequest(); - } - TRACE( "iFetchStep set to state EContactReadComplete" ); - iFetchStep = EContactReadComplete; - TRACE( " completed" ); - break; - } - case EVPbkContactReading: - { - TRACE(" EVPbkContactReading started"); - // a contact entry has been created in virtual database store - // create the cache contact - // fetched one by one contact from cdb file - // Add to storage cache - - iServiceCacheWriter.AddContactToCacheL(*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName , - aVPbkStoreEvent.iAvatarContent, - TVIMPSTEnums::EStorageContactReading ); - TRACE( "EVPbkContactReading completed" ); - break; - } - case EVPbkContactFetching: - case EVPbkContactAdded: - { - TRACE( "EVPbkContactAdded or EVPbkContactFetching" ); - TVIMPSTEnums::TVIMPSTStorgaeEventType event = TVIMPSTEnums::EStorageEventContactAddition; - // a contact entry has been created in virtual database store - // create the cache contact - // fetched one by one contact from cdb file - // Add to storage cache - if( iFetchStep == EFetchingOn ) - { - event = TVIMPSTEnums::EStorageContactFetching; - } - iServiceCacheWriter.AddContactToCacheL(*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName , - aVPbkStoreEvent.iAvatarContent, - event ); - if(iFetchStep == EFetchingOn) - { - TRACE( "EVPbkContactAdded or EVPbkContactFetching fetchin on" ); - IssueRequest(); - } - TRACE( " EVPbkContactAdded or EVPbkContactFetching completed" ); - break; - } - case EVPbkContactSynchronizing: - { - TRACE( "EVPbkContactSynchronizing " ); - // a contact entry has been created in virtual database store - // create the cache contact - // fetched one by one contact from cdb file - // Add to storage cache - iServiceCacheWriter.AddContactToCacheL(*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName , - aVPbkStoreEvent.iAvatarContent, - TVIMPSTEnums::EStorageContactSynchronizing ); - TRACE( "EVPbkContactSynchronizing(iFetchStep): %d " , iFetchStep ); - if(iFetchStep == EFetchingOn) - { - TRACE( " EVPbkContactSynchronizing fetchin on" ); - IssueRequest(); - } - TRACE( " EVPbkContactSynchronizing completed" ); - break; - } - case EVPbkContactDeleted: - { - TRACE( "EVPbkContactDeleted Event" ); - // a contact entry has been deleted from virtual database store - // delete from cache contact - // not Needed in case of server contact - iServiceCacheWriter.RemoveContactFromCacheL(*aVPbkStoreEvent.iContactLink, - TVIMPSTEnums::EStorageEventContactDelete ); - TRACE( " EVPbkContactDeleted Event done" ); - break; - } - case EVPbkContactChanged: - { - TRACE( " EVPbkContactChanged started" ); - // a contact entry has been updated to virtual database store - // update to cache contact - // not Needed in case of server contact - iServiceCacheWriter.UpdateCacheContactL(*aVPbkStoreEvent.iContactLink , - aVPbkStoreEvent.iUserId , - aVPbkStoreEvent.iDisplayName, - aVPbkStoreEvent.iAvatarContent); - if(iFetchStep == EFetchingOn) - { - TRACE(" EVPbkContactAdded or EVPbkContactFetching fetchin on" ); - IssueRequest(); - } - TRACE( " EVPbkContactChanged started" ); - break; - } - case EVPbkContactRetriving: - { - TRACE( " EVPbkContactRetriving started " ); - // ONLY VALID USER ID ALLOWED - if( aVPbkStoreEvent.iUserId.Length() ) - { - TRACE( "EVPbkContactRetriving valid id " ); - HBufC* sxpId = aVPbkStoreEvent.iUserId.AllocL(); - iRetrivedXSPIdArray.Append( sxpId ); // takes the ownership of retrivedContact - // keep the backup of retrieved contacts - // user can add later once it sent to server - } - TRACE( " EVPbkContactRetriving done" ); - break; - } - case EVPbkUnknownChanges: - { - TRACE( " EVPbkUnknownChanges Event in" ); - // unknow mean all contact deleted from store - // Not supported in case of server contact - iServiceCacheWriter.RemoveAllCacheContactsL(); - if(iFetchStep == EFetchingCalled ) - { - TRACE( " EVPbkUnknownChanges fetching on" ); - IssueRequest(); - } - TRACE( "EVPbkUnknownChanges Event done" ); - break; - } - default: - { - TRACE( "default" ); - break; - } - } - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::IssueRequest -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkServerStore::IssueRequest() - { - TRACER_AUTO; - if( !IsActive() ) - { - TRequestStatus* status = &iStatus; - TRACE( "RequestComplete"); - User::RequestComplete( status, KErrNone ); - SetActive(); - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::RunL -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkServerStore::RunL() - { - TRACER_AUTO; - TInt count = iFetchContactsToBeAdded.Count(); - TRACE( " count = %d",count ); - if( !count ) - { - TRACE(" set to state EContactReadComplete" ); - iFetchStep = EContactReadComplete; - iServiceCacheWriter.NotifyServiceViewL( TVIMPSTEnums::EStorageContactFetchComplete ); - TRACE( "calling NotifyFetchCompleteL" ); - } - else - { - TRACE( " set to state EFetchingOn" ); - iFetchStep = EFetchingOn; - TVIMPSTContactInfo contactInfoToAdd = iFetchContactsToBeAdded[0]; - // pass the display NAme in place of NULL - TRACE( "calling CreateVPbkContactL" ); - iVPbkStoreHandler->CreateVPbkContactL( *contactInfoToAdd.iUserId, *contactInfoToAdd.iDisplayName ); // process always 0th item - - iFetchContactsToBeAdded.Remove( 0 ); - delete contactInfoToAdd.iUserId; - contactInfoToAdd.iUserId = NULL; - delete contactInfoToAdd.iDisplayName; - contactInfoToAdd.iDisplayName = NULL ; - - iFetchContactsToBeAdded.Compress(); - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::DoCancel -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkServerStore::DoCancel() - { - TRACER_AUTO; - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::RunError -// -------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkServerStore::RunError( TInt aError ) - { - TRACER_AUTO; - TRACE( "error code = %d", aError ); - - return aError; - } - -////////////////////////////////////////////////////////// -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::CreateVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkServerStore::CreateVPbkContactL( const TDesC& aUserId, - const TDesC& aDisplayName, - TBool /*aInvitationAutoAccept = EFalse */ ) - { - TRACER_AUTO; - return iVPbkStoreHandler->CreateVPbkContactL( aUserId ,aDisplayName ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::AddVPbkFetchContactsL -// ----------------------------------------------------------------------------- -// - void CVIMPSTStorageVPbkServerStore::AddVPbkFetchContactsL( RArray & aFirstNameList, - RArray &aServiceField ) - { - // in case of server case we delete all contacts and then add fetch contacts - // in case of server contacts delete all contacts - TRACER_AUTO; - TInt oldContactCount = RemoveAllVPbkContactsL(); - TRACE( " oldContactCount = %d", oldContactCount ); - ResetAndDestroyLocalArrayL(); - TInt fetchContactCount = aServiceField.Count(); - for( TInt i = 0; iAppendL( link ); // takes ownership - CleanupStack::Pop(); // link - TInt error = iVPbkStoreHandler->RemoveVPbkContactL( *contactsToDelete ); - CleanupStack::PopAndDestroy(); // contactsToDelete - TRACE( " error code = %d", error ); - - return error; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::RemoveAllVPbkContactsL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkServerStore::RemoveAllVPbkContactsL() - { - TRACER_AUTO; - iRetrivedXSPIdArray.ResetAndDestroy(); - return iVPbkStoreHandler->RemoveAllVPbkContactsL(); - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::RetrieveVPbkXSPIdL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkServerStore::RetrieveVPbkXSPIdL(const TDesC8& aPackedLinks ) - { - TRACER_AUTO; - iRetrivedXSPIdArray.ResetAndDestroy(); - TRACE( " iRetrivedXSPIdArray Reset" ); - iVPbkStoreHandler->RetrieveVPbkContactL( aPackedLinks ); - - return iRetrivedXSPIdArray.Count(); - } - - // --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::GetRetrieveVPbkXSPIdL -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTStorageVPbkServerStore::GetRetrieveVPbkXSPIdL(TInt aIndex ) - { - TRACER_AUTO; - HBufC* contactId = NULL; - if( aIndex >= 0 && aIndex < iRetrivedXSPIdArray.Count() ) - { - contactId = iRetrivedXSPIdArray[ aIndex ]; - } - if( contactId ) - { - TRACE( "RetrieveVPbkXSPIdL() end"); - return *contactId; - } - - return KNullDesC ; - } - // --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::CreateRetriveVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkServerStore::CreateRetriveVPbkContactL( TInt /*aIndexToUse*/ ) - { - TRACER_AUTO; - // Not applicable for server store - return KErrNotSupported; - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::deleteRetriveVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkServerStore::deleteRetriveVPbkContactL( TInt /*aIndexToUse*/ ) - { - TRACER_AUTO; - // Not applicable for server store - return KErrNotSupported; - } -// CVIMPSTStorageVPbkServerStore::UpdateAvatarFieldDataL() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkServerStore::UpdateAvatarFieldDataL(const MVPbkContactLink& aContactLink, - const TDesC8& aAvatartData ) - { - TRACER_AUTO; - return iVPbkStoreHandler->UpdateAvatarFieldDataL( aContactLink, aAvatartData ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::RemoveAvatarFieldL() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkServerStore::RemoveAvatarFieldL(MVPbkStoreContact& aStoreContact) - { - TRACER_AUTO; - return iVPbkStoreHandler->RemoveAvatarFieldL( aStoreContact ); - } - -// ---------------------------------------------------------- -// CVIMPSTStorageVPbkServerStore::DeleteDatabaseL -// ---------------------------------------------------------- -void CVIMPSTStorageVPbkServerStore::DeleteDatabaseL() - { - TRACER_AUTO; - // TODO : Not supported yet - - } -// End of file - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/cvimpststoragevpbkstorehandler.cpp --- a/uiservicetab/vimpststorage/src/cvimpststoragevpbkstorehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1318 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that provides handling of vpbk store -* -*/ - - -// INCLUDE FILES -#include "cvimpststoragevpbkstorehandler.h" - -#include "mvimpststoragevpbkstorehandler.h" - -//vpbk interfaces -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "uiservicetabtracer.h" -#include "tvimpstconsts.h" -#include - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler:: -// CVIMPSTStorageVPbkStoreHandler -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkStoreHandler:: CVIMPSTStorageVPbkStoreHandler( MVIMPSTStorageVPbkStoreHandler& aStoreHandler,TBool aLocalStore ): - CActive( CActive::EPriorityIdle ), - iStoreHandler(aStoreHandler ), - iStoreEventType( EVPbkUnknownEvent ), - iFetcingIndex( 0 ), - iLocalStore( aLocalStore ) - { - TRACER_AUTO; - CActiveScheduler::Add( this ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::ConstructL(const TDesC& aStoreName,const TDesC& aServiceName ) - { - TRACER_AUTO; - iAddIdInProgress = NULL; - iStoreName = aStoreName.AllocL(); - iServiceName = aServiceName.AllocL(); - CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewLC(); - uriArray->AppendL( TVPbkContactStoreUriPtr( aStoreName ) ); - if( !uriArray->IsIncluded( TVPbkContactStoreUriPtr( KPhoneBookDbURI ) ) ) - { - TRACE( "phonebook store apended" ); - uriArray->AppendL( TVPbkContactStoreUriPtr( KPhoneBookDbURI ) ); - } - iContactManager = CVPbkContactManager::NewL( *uriArray, NULL ); - CleanupStack::PopAndDestroy( uriArray ); - TRACE( "iContactManager created" ); - iStores = &iContactManager->ContactStoresL(); - iStores->OpenAllL( *this ); - TRACE( " OpenAllL called" ); - iSortOrderManager = CPbk2SortOrderManager::NewL( iContactManager->FieldTypes(), NULL ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkStoreHandler* CVIMPSTStorageVPbkStoreHandler::NewL( const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageVPbkStoreHandler& aStoreHandler, - TBool aLocalStore ) - { - TRACER_AUTO; - CVIMPSTStorageVPbkStoreHandler* self = NewLC( aContactDb ,aServiceName, aStoreHandler,aLocalStore ); - CleanupStack::Pop( self ); - - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::NewLC -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkStoreHandler* CVIMPSTStorageVPbkStoreHandler::NewLC( const TDesC& aContactDb, - const TDesC& aServiceName, - MVIMPSTStorageVPbkStoreHandler& aStoreHandler, - TBool aLocalStore ) - { - TRACER_AUTO; - CVIMPSTStorageVPbkStoreHandler* self = - new (ELeave) CVIMPSTStorageVPbkStoreHandler( aStoreHandler ,aLocalStore ); - CleanupStack::PushL( self ); - self->ConstructL( aContactDb,aServiceName ); - - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler:: -// ~CVIMPSTStorageVPbkStoreHandler -// --------------------------------------------------------------------------- -// -CVIMPSTStorageVPbkStoreHandler:: ~CVIMPSTStorageVPbkStoreHandler() - { - TRACER_AUTO; - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - Cancel(); - ResetAndDestroyRArray(); - iUnCommittedVPbkContacts.ResetAndDestroy(); - delete iAddIdInProgress; - delete iContactOperation; - delete iContactLink; - delete iStoreContact; - delete iContactView; - if ( iContactManager ) - { - TRAP_IGNORE( iContactManager->ContactStoresL().CloseAll( *this ) ); - TRACE( "CloseAll called" ); - delete iContactManager; - } - delete iStoreName; - delete iSortOrderManager; - delete iServiceName; - - } - // --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::ContactViewReady -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::ContactViewReady( - MVPbkContactViewBase& aView ) - { - TRACER_AUTO; - if ( iContactView == &aView && ( iStoreEventType == EVPbkUnknownEvent ) ) - { - iStoreEventType = EVPbkContactReading ; - TRAP_IGNORE( HandleContactViewReadyL( *iContactView ) ); - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::ContactViewUnavailable -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::ContactViewUnavailable( - MVPbkContactViewBase& /*aView*/ ) - { - TRACER_AUTO; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::ContactAddedToView -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::ContactAddedToView( - MVPbkContactViewBase& /*aView*/, - TInt /*aIndex*/, const MVPbkContactLink& /*aContactLink*/ ) - { - TRACER_AUTO; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::ContactRemovedFromView -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::ContactRemovedFromView( - MVPbkContactViewBase& /*aView*/, - TInt /*aIndex*/, const MVPbkContactLink& /*aContactLink*/ ) - { - TRACER_AUTO; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::ContactViewError -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::ContactViewError( - MVPbkContactViewBase& /*aView*/, - TInt /*aError*/, TBool /*aErrorNotified*/ ) - { - TRACER_AUTO; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::StoreReady -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::StoreReady( - MVPbkContactStore& /*aContactStore*/ ) - { - TRACER_AUTO; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::StoreUnavailable -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::StoreUnavailable( - MVPbkContactStore& /*aContactStore*/, - TInt /*aReason*/ ) - { - TRACER_AUTO; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::HandleStoreEventL -// --------------------------------------------------------------------------- -// -MVPbkContactStore* CVIMPSTStorageVPbkStoreHandler::GetDefaultStoreL( const TDesC& aUri ) - { - TRACER_AUTO; - return iStores->Find( TVPbkContactStoreUriPtr( aUri ) ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::HandleStoreEventL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::HandleStoreEventL( - MVPbkContactStore& aContactStore , - TVPbkContactStoreEvent aStoreEvent ) - { - TRACER_AUTO; - if( iStore == &aContactStore ) - { - TRACE( "store event" ); - switch( aStoreEvent.iEventType ) - { - case TVPbkContactStoreEvent::EContactAdded: - { - TRACE( "EContactAdded event"); - delete iContactLink; - iContactLink = NULL; - MVPbkContactLink* contactLink = aStoreEvent.iContactLink->CloneLC(); - iContactLink = contactLink; - CleanupStack::Pop(); // contactLink - IssueRequest(); // complete the request - TRACE( " EContactAdded done" ); - break; - } - case TVPbkContactStoreEvent::EContactDeleted: - { - TRACE( "EContactDeleted event" ); - MVPbkContactLink* contactLink = aStoreEvent.iContactLink->CloneLC(); - delete iContactLink; - iContactLink = NULL; - iContactLink = contactLink; - CleanupStack::Pop(); // contactLink - TVIMPSTVPbkStoreEvent storeEvent(EVPbkContactDeleted, iContactLink ); - iStoreHandler.HandleVPbkStoreEventL( storeEvent ) ; - TRACE( "EContactDeleted done" ); - break; - } - case TVPbkContactStoreEvent::EContactChanged: - { - TRACE( " EContactChanged event" ); - delete iContactLink; - iContactLink = NULL; - MVPbkContactLink* contactLink = aStoreEvent.iContactLink->CloneLC(); - iContactLink = contactLink; - CleanupStack::Pop(); // contactLink - iStoreEventType = EVPbkContactChanged; - IssueRequest(); // complete the request which will begin retriving the iContactLink - TRACE("EContactChanged done"); - break; - } - case TVPbkContactStoreEvent::EUnknownChanges: - { - TRACE( " EUnknownChanges event" ); - iStoreEventType = EVPbkUnknownChanges; - TVIMPSTVPbkStoreEvent storeEvent(iStoreEventType); - iStoreHandler.HandleVPbkStoreEventL( storeEvent ) ; - TRACE( "EUnknownChanges done" ); - break; - } - default: - break; - } - } - - } -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::OpenComplete -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::OpenComplete() - { - TRACER_AUTO; - // stores OpenAll completed - TRAP_IGNORE( DoHnadleOpenCompleteL() ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::DoHnadleOpenCompleteL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::DoHnadleOpenCompleteL() - { - TRACER_AUTO; - iStore = GetDefaultStoreL( *iStoreName ) ; - CVPbkContactViewDefinition* viewDefinition = - CVPbkContactViewDefinition::NewL(); - CleanupStack::PushL( viewDefinition ); - viewDefinition->SetType( EVPbkContactsView ); - viewDefinition->SetUriL( *iStoreName ); - if ( iStore ) - { - TRACE( "store view creating"); - MVPbkContactView* tmpView = iStore->CreateViewLC( - *viewDefinition, - *this, - iSortOrderManager->SortOrder() ); - CleanupStack::Pop(); // tmpView - TRACE( "store view created"); - iContactView = tmpView; - } - CleanupStack::PopAndDestroy(); //viewDefinition, can not pop ny name - - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::ContactOperationCompleted -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::ContactOperationCompleted( - TContactOpResult /*aResult*/ ) - { - TRACER_AUTO; - // called when contact commit is successful - iOperationError = KErrNone; - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - TRAP_IGNORE( CommitNextPendingContactsL() ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::ContactOperationFailed -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::ContactOperationFailed( - TContactOp /*aOpCode*/, TInt aErrorCode, TBool /*aErrorNotified*/ ) - { - TRACER_AUTO; - // called when contact commit is unsuccessful - iOperationError = aErrorCode; - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - TRAP_IGNORE( CommitNextPendingContactsL() ); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::StepComplete -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::StepComplete( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/ ) - { - TRACER_AUTO; - // called when batch operation call - iOperationError = KErrNone; - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::StepFailed -// -------------------------------------------------------------------------- -// -TBool CVIMPSTStorageVPbkStoreHandler::StepFailed( - MVPbkContactOperationBase& /*aOperation*/, - TInt /*aStepSize*/, - TInt aError ) - { - TRACER_AUTO; - // called when batch operation call - iOperationError = aError; - - return EFalse; - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::OperationComplete -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::OperationComplete( - MVPbkContactOperationBase& aOperation ) - { - TRACER_AUTO; - // called when batch operation call for opening the multiple store - if ( &aOperation == iContactOperation ) - { - delete iContactOperation; - iContactOperation = NULL; - } - iOperationError = KErrNone; - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - - } - -//---------------------------------------------------------------------- -//CVIMPSTStorageVPbkStoreHandler::VPbkSingleContactOperationComplete() -//---------------------------------------------------------------------- -void CVIMPSTStorageVPbkStoreHandler::VPbkSingleContactOperationComplete( MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact ) - { - TRACER_AUTO; - // called when contact details is retrived - TRAP_IGNORE( DoHnadleSingleContactOperationCompleteL( aOperation, aContact ) ); - - } - -//---------------------------------------------------------------------- -//CVIMPSTStorageVPbkStoreHandler::DoHnadleSingleContactOperationCompleteL() -//---------------------------------------------------------------------- -void CVIMPSTStorageVPbkStoreHandler::DoHnadleSingleContactOperationCompleteL( MVPbkContactOperationBase& aOperation, - MVPbkStoreContact* aContact ) - { - TRACER_AUTO; - TRACE( "StoreEventType: %d",iStoreEventType); - // called when contact details is retrived - if( iStoreContact ) - { - delete iStoreContact; - iStoreContact = NULL; - } - iStoreContact = aContact ; // iStoreContact owns thea Contact - if( ( &aOperation == iContactOperation) && iStoreContact ) - { - TRACE( "inside if (operation) "); - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - delete iContactOperation; - iContactOperation = NULL; - TRACE( " before iCommitOperationInProgress: %d",iCommitOperationInProgress); - iCommitOperationInProgress = EFalse; - TRACE( "After iCommitOperationInProgress: %d",iCommitOperationInProgress); - - if( iStoreEventType != EVPbkUpdatingAvatar ) - { - TRACE( " inside if (iStoreEventType != EVPbkUpdatingAvatar ) "); - if( !iLocalStore && iStoreEventType == EVPbkContactRetriving ) - { - TRACE( " EVPbkContactRetriving"); - RetriveFieldDataAndSendEventL( *iStoreContact ); - } - else - { - TRACE( "inside else start"); - HBufC* userId = GetContactFieldDataLC( *iStoreContact, R_VPBK_FIELD_TYPE_IMPP ); - HBufC* firstname = GetContactFieldDataLC( *iStoreContact,R_VPBK_FIELD_TYPE_FIRSTNAME ); - HBufC* lastname = GetContactFieldDataLC( *iStoreContact,R_VPBK_FIELD_TYPE_LASTNAME ); - - HBufC* disname = NULL; - /* - * There are three scenarios where I can form the Display name. - * 1. First and last name are present. - * 2. First name is present but no last name is present. - * 3. Lastname is there and no first name. - * 4. if none, then assigning NULL - */ - if ( firstname && lastname ) - { - disname = HBufC::NewLC( firstname->Des().Length() + lastname->Des().Length()+ 1 ); - TPtr disnamePtr( disname->Des() ); - disnamePtr.Append(*firstname); - if(firstname->Length() && lastname->Length() ) - { - disnamePtr.Append(KSpace); - } - disnamePtr.Append(*lastname); - } - else - { - disname = KNullDesC().AllocLC(); - } - HBufC8* avatarContent = GetContactBinaryFieldDataLC( *iStoreContact,R_VPBK_FIELD_TYPE_THUMBNAILPIC ); - TRACE( "iStoreHandler.HandleVPbkStoreEventL: %d", iStoreEventType); - TPtr useridPtr = userId->Des(); - TRACE( "inside else UserId : %S", &useridPtr); - TVIMPSTVPbkStoreEvent storeEvent(iStoreEventType, - iContactLink, - NULL, - *userId, - *disname, - *avatarContent); - iStoreHandler.HandleVPbkStoreEventL( storeEvent ) ; - CleanupStack::PopAndDestroy(5); // disname,lastname,firstname,userId,avatarContent - TRACE( " inside else end"); - } - delete iAddIdInProgress; - iAddIdInProgress = NULL; - } - - iOperationError = KErrNone; - if( iStoreEventType == EVPbkContactReading && iContactView ) - { - TRACE( " if after iOperationError"); - HandleContactViewReadyL( *iContactView ); - } - - else if(!iCommitOperationInProgress ) - { - TRACE( "else if after if after iOperationError"); - CommitNextPendingContactsL();// commit only if any pending contact - } - - } - } -//---------------------------------------------------------------------- -//CVIMPSTStorageVPbkStoreHandler::VPbkSingleContactOperationComplete() -//---------------------------------------------------------------------- -void CVIMPSTStorageVPbkStoreHandler::VPbkSingleContactOperationFailed( MVPbkContactOperationBase& aOperation, - TInt aError) - { - TRACER_AUTO; - if( &aOperation == iContactOperation ) - { - delete iContactOperation; - iContactOperation = NULL; - } - iOperationError = aError; - iCommitOperationInProgress = EFalse; - if( iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - TRAP_IGNORE( CommitNextPendingContactsL() );// commit only if any pending contact - - } -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::HandleContactViewReadyL -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::HandleContactViewReadyL( MVPbkContactViewBase& aView ) - { - TRACER_AUTO; - TInt contactCount = aView.ContactCountL(); - TRACE( "begin"); - if( contactCount == iFetcingIndex && iStoreEventType == EVPbkContactReading ) - { - TRACE( "reading completed" ); - iStoreEventType = EVPbkContactReadCompleted; - TVIMPSTVPbkStoreEvent storeEvent(iStoreEventType); - iStoreHandler.HandleVPbkStoreEventL( storeEvent ) ; - } - else if( iFetcingIndex < contactCount && iFetcingIndex>=0 ) - { - TRACE( " reading"); - const MVPbkViewContact& contact = aView.ContactAtL( iFetcingIndex ); - MVPbkContactLink* contactLink = contact.CreateLinkLC(); - delete iContactLink; - iContactLink = NULL; - iContactLink = contactLink; - CleanupStack::Pop(); // contactLink - IssueRequest(); - iFetcingIndex++; - } - - } -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::IssueRequest -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::IssueRequest() - { - TRACER_AUTO; - if( !IsActive() ) - { - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone ); - SetActive(); - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::RunL -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::RunL() - { - TRACER_AUTO; - if( iContactLink ) - { - delete iContactOperation; - iContactOperation = NULL; - iContactOperation = iContactManager->RetrieveContactL( *iContactLink, *this ); - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::DoCancel -// -------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::DoCancel() - { - TRACER_AUTO; - } - -// -------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::RunError -// -------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkStoreHandler::RunError( TInt aError ) - { - TRACER_AUTO; - return aError; - } - -////////////////////////////////////////////////////////// -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::CreateVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkStoreHandler::CreateVPbkContactL(const TDesC& aUserId, - const TDesC& aDisplayName ) - { - TRACER_AUTO; - TRACE( "aUserId = %S", &aUserId ); - - if( iAddIdInProgress && iAddIdInProgress->Compare( aUserId ) == 0 ) - { - TPtr iAddIdInProgressPtr = iAddIdInProgress->Des(); - TRACE("iAddIdInProgressPtr = %S", &iAddIdInProgressPtr ); - TRACE("already Adding" ); - return KErrAlreadyExists; - } - TRACE( "After If" ); - delete iAddIdInProgress; - iAddIdInProgress = NULL; - iAddIdInProgress = aUserId.AllocL(); - - if(iStore) - { - MVPbkStoreContact* storedContact = iStore->CreateNewContactLC(); //1 - if( !storedContact ) - { - return NULL; - } - if(aUserId.Length()!= 0) - { - TRACE( " valid xsp Id" ); - TInt prefixLocation = aUserId.Locate( ':' ); - const MVPbkContactStoreProperties& storeProperties = storedContact->ParentStore().StoreProperties(); - const MVPbkFieldTypeList& supportedFieldTypes = storeProperties.SupportedFields(); - TInt fieldCount = supportedFieldTypes.FieldTypeCount(); - - for( TInt index = 0 ; index < fieldCount ; index++ ) - { - const MVPbkFieldType* fieldType = &(supportedFieldTypes.FieldTypeAt(index)); - if ( fieldType && ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_IMPP )) - { - TRACE(" XSP Id-IMMP field creating" ); - MVPbkStoreContactField* fielduri = storedContact->CreateFieldLC(*fieldType); //2 - // Check for prefix and remove if found - //append the internettelephoney field. - HBufC* fieldData = NULL; - TInt serFieldLength = aUserId.Length(); - if( prefixLocation >=0 && ( prefixLocation < serFieldLength ) ) - { - fieldData = aUserId.Right(serFieldLength - prefixLocation - 1).AllocLC(); //3 - } - else - { - fieldData = aUserId.AllocLC(); // 3 - } - if (fieldData) - { - TPtr fieldDataPtr( fieldData->Des() ); - MVPbkContactFieldUriData& address = MVPbkContactFieldUriData::Cast( fielduri->FieldData() ); - // TODO check here about servicename:userId - address.SetUriL(*iServiceName,*fieldData); - // fielduri ownership is transfered to storedContact - storedContact->AddFieldL(fielduri); - CleanupStack::PopAndDestroy(fieldData); //3 - CleanupStack::Pop(); //fielduri 2 - }//End if (fieldData) - else - { - CleanupStack::PopAndDestroy(); //2 fielduri - } - TRACE( " XSP Id-IMMP field created" ); - }//end of if - else if ( fieldType && - ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_FIRSTNAME )) - { - TRACE( " first name field creating" ); - HBufC* firstName = NULL; - - // if there is no display name then allocate hte user id as displayname. - if(!(aDisplayName.Length())) - { - // if aServiceField is sip:user1@ouped111147.nmp.nokia.com, then - // rippedaServiceField will be user1@ouped111147.nmp.nokia.com - TPtrC rippedaServiceField = aUserId.Mid(prefixLocation+1); - //append first name. - TInt atLocation = rippedaServiceField.Locate( '@' ); - if( atLocation > 0 && ( atLocation < rippedaServiceField.Length() ) ) - { - // atLocation must be greater that 0 - firstName = rippedaServiceField.Left( atLocation ).AllocLC() ; //2 - } - else - { - firstName = rippedaServiceField.AllocLC(); //2 - } - } - // there is a display name hence allocate it. - else - { - firstName = aDisplayName.AllocLC();//2 - } - - if (firstName) - { - MVPbkStoreContactField* firstNamefield = storedContact->CreateFieldLC(*fieldType); //2 - MVPbkContactFieldTextData& firstNameText = MVPbkContactFieldTextData::Cast( firstNamefield->FieldData() ); - firstNameText.SetTextL(*firstName); - storedContact->AddFieldL(firstNamefield); // firstNamefield ownership transfered to storedContact - CleanupStack::Pop(); //firstNamefield 2 - CleanupStack::PopAndDestroy(firstName); // 3 - }//End if (firstName) - - TRACE( "first name field created" ); - }//end of if. - }//end of for. - TRACE( "iCommitOperationInProgress = %d",iCommitOperationInProgress ); - if( iCommitOperationInProgress ) - { - TRACE("inside if" ); - iUnCommittedVPbkContacts.AppendL( storedContact ); //takes ownership - CleanupStack::Pop(); //storedContact - } - else - { - TRACE( "inside else"); - iCommitOperationInProgress = ETrue; - if(iStoreContact) - { - delete iStoreContact; - iStoreContact = NULL; - } - TRACE( "contact fields added" ); - iStoreContact = storedContact; - CleanupStack::Pop(); //storedContact - iStoreContact->CommitL(*this); - iStoreEventType = EVPbkContactAdded; - } - TRACE( "contact commited"); - //Start the wait untill adding of new contact is complete - } - } - //return the added contact - TRACE( "iOperationError =%d",iOperationError ); - - return iOperationError; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::CommitNextPendingContactsL -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::CommitNextPendingContactsL() - { - - TRACER_AUTO; - TRACE("iStoreEventType = %d",iStoreEventType ); - if( !iCommitOperationInProgress && iUnCommittedVPbkContacts.Count() && iStoreEventType != EVPbkUpdatingAvatar) - { - TRACE( " Commit next" ); - iCommitOperationInProgress = ETrue; - if(iStoreContact) - { - delete iStoreContact; - iStoreContact = NULL; - } - TRACE( "comming..." ); - iStoreContact = iUnCommittedVPbkContacts[0]; - iUnCommittedVPbkContacts.Remove(0); - iUnCommittedVPbkContacts.Compress(); - iStoreContact->CommitL(*this); - iStoreEventType = EVPbkContactSynchronizing; - TRACE( " Commit called" ); - } - else if(!iCommitOperationInProgress && iPendingAvatars.Count() && iStoreEventType != EVPbkUpdatingAvatar) - { - TRACE( "Commit next pending avatar" ); - TVIMPSTAvatarData avatarData = iPendingAvatars[0]; - UpdateAvatarFieldDataL( *avatarData.iContactLink, *avatarData.iAvatarContent ); - iPendingAvatars.Remove( 0 ); - delete avatarData.iContactLink; - avatarData.iContactLink = NULL; - delete avatarData.iAvatarContent; - avatarData.iAvatarContent = NULL; - iPendingAvatars.Compress(); - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::RemoveVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkStoreHandler::RemoveVPbkContactL(const CVPbkContactLinkArray& aContactLinkArray ) - { - TRACER_AUTO; - // text now holds the name (or first field of the contact) - delete iContactOperation; - iContactOperation = NULL; - iContactOperation = iContactManager->DeleteContactsL(aContactLinkArray, *this ); - if( !iWait.IsStarted() ) - { - iWait.Start(); - } - TRACE( "iOperationError=%d",iOperationError ); - - return iOperationError; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::RetrieveVPbkContactL -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkStoreHandler::RetrieveVPbkContactL(const TDesC8& aPackedLinks) - { - TRACER_AUTO; - iStoreEventType = EVPbkContactRetriving; - CVPbkContactLinkArray* linkArray = CVPbkContactLinkArray::NewLC(aPackedLinks, *iStores ); - // text now holds the name (or first field of the contact) - TInt count = linkArray->Count(); - TRACE( "count=%d",count ); - for ( TInt i=0; iAt( i ).CloneLC(); - iContactLink = cloneLink; - CleanupStack::Pop(); // cloneLink - - delete iContactOperation; - iContactOperation = NULL; - - iContactOperation = iContactManager->RetrieveContactL( *iContactLink, *this ); - if( !iWait.IsStarted() ) - { - iWait.Start(); - } - } - CleanupStack::PopAndDestroy();//linkArray - - return iOperationError; - } - - - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::UpdateAvatarFieldDataL() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkStoreHandler::UpdateAvatarFieldDataL(const MVPbkContactLink& aContactLink, - const TDesC8& aAvatartData ) - { - TRACER_AUTO; - - // local variable caz cant push member variable to cleanup stack - MVPbkContactLink* cloneLink = aContactLink.CloneLC(); - TRACE( "iCommitOperationInProgress: %d",iCommitOperationInProgress ); - TRACE( "iUnCommittedVPbkContacts: %d",iUnCommittedVPbkContacts.Count() ); - if(iCommitOperationInProgress || iUnCommittedVPbkContacts.Count() || iStoreEventType == EVPbkUpdatingAvatar ) - { - TRACE( "Inside if" ); - TVIMPSTAvatarData avatarData = { - cloneLink, - aAvatartData.AllocL() - }; - iPendingAvatars.Append( avatarData ); - CleanupStack::Pop(); // cloneLink - return KErrInUse; - } - iCommitOperationInProgress = ETrue; - TRACE( "Inside after if" ); - delete iContactLink; - iContactLink = NULL; - iContactLink = cloneLink; - CleanupStack::Pop(); // cloneLink - - //before updating the avatar, check if there are any pending operation already, if there are any, - // then delete them and create the next one. - if(iContactOperation) - { - delete iContactOperation; - iContactOperation = NULL; - } - iStoreEventType = EVPbkUpdatingAvatar; - iContactOperation = iContactManager->RetrieveContactL( *iContactLink, *this ); - if( !iWait.IsStarted() ) - { - iWait.Start(); - } - // exception KErrInUse If another asynchronous operation is - // already in progress. - // exception KErrAccessDenied if the contact can not be modified. - iStoreContact->LockL(*this); - - - //wait till lock operation is succeded - if(!iWait.IsStarted() ) - { - iWait.Start(); - } - TInt fieldcount = iStoreContact->Fields().FieldCount(); - for( TInt j = 0 ; j < fieldcount ; j++ ) - { - const MVPbkFieldType* fieldType = iStoreContact->Fields().FieldAt(j).BestMatchingFieldType(); - if( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_THUMBNAILPIC ) - { - iStoreContact->RemoveField(j); - break; - } - } - if( aAvatartData.Length() ) - { - const MVPbkContactStoreProperties& storeProperties = iStoreContact->ParentStore().StoreProperties(); - const MVPbkFieldTypeList& supportedFieldTypes = storeProperties.SupportedFields(); - TInt fieldCount = supportedFieldTypes.FieldTypeCount(); - for( TInt index = 0 ; index < fieldCount ; index++ ) - { - const MVPbkFieldType* fieldType = &( supportedFieldTypes.FieldTypeAt(index) ); - //find the relevant voip fields/email id fileds. - if ( fieldType && ( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_THUMBNAILPIC ) ) - { - //updating avatar field in the virtual phonebook - //found the required fieldtype - MVPbkStoreContactField* storeField = iStoreContact->CreateFieldLC(*fieldType); - // The aField instance can not be used after AddFieldL - //storeField ownership is transferred - TInt fieldIndex = iStoreContact->AddFieldL(storeField); - MVPbkContactFieldData& dataField = iStoreContact->Fields().FieldAt( fieldIndex ).FieldData(); - MVPbkContactFieldBinaryData& data = MVPbkContactFieldBinaryData::Cast(dataField); - data.SetBinaryDataL(aAvatartData); - CleanupStack::Pop(); // storeField - break; - } - } - } - TRACE( "Inside after if(avatardata.length)" ); - iStoreEventType = EVPbkContactChanged; - TRACE( "Inside after if(avatardata.length ): %d",iStoreEventType ); - iStoreContact->CommitL(*this); - //wait for delete Avatar operation to complete. - if(!iWait.IsStarted() ) - { - iWait.Start(); - } - - return iOperationError; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::RemoveAvatarFieldL() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTStorageVPbkStoreHandler::RemoveAvatarFieldL(MVPbkStoreContact& aStoreContact) - { - TRACER_AUTO; - aStoreContact.LockL(*this); - //wait till lock operation is succeded - if(!iWait.IsStarted() ) - { - iWait.Start(); - } - TInt fieldcount = aStoreContact.Fields().FieldCount(); - for( TInt j = 0 ; j < fieldcount ; j++ ) - { - const MVPbkFieldType* fieldType = aStoreContact.Fields().FieldAt(j).BestMatchingFieldType(); - if( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_THUMBNAILPIC ) - { - aStoreContact.RemoveField(j); - break; - } - } - aStoreContact.CommitL(*this); - //wait for delete Avatar operation to complete. - if(!iWait.IsStarted() ) - { - iWait.Start(); - } - TRACE( "iOperationError =%d",iOperationError ); - - return iOperationError; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::GetContactFieldDataLC() -// --------------------------------------------------------------------------- -// -HBufC* CVIMPSTStorageVPbkStoreHandler::GetContactFieldDataLC(const MVPbkStoreContact& aContact, - TInt aFieldResId ) - { - TRACER_AUTO; - HBufC* retValue = NULL; - const MVPbkStoreContactFieldCollection& fieldCollection = aContact.Fields(); - TInt fieldCount = fieldCollection.FieldCount(); - TRACE( " fieldCount%d",fieldCount ); - for( TInt index = 0 ; index < fieldCount ; index++ ) - { - const MVPbkStoreContactField& field = fieldCollection.FieldAt( index ); - const MVPbkFieldType* fieldType = field.BestMatchingFieldType(); - //find the relevant xSP field - if ( fieldType && ( fieldType->FieldTypeResId() == aFieldResId ) ) - { - const MVPbkContactFieldData& fieldData = field.FieldData(); - switch( fieldData.DataType() ) - { - case EVPbkFieldStorageTypeText: - { - TRACE(" Text" ); - retValue = MVPbkContactFieldTextData::Cast(fieldData).Text().AllocLC(); - break; - } - case EVPbkFieldStorageTypeUri: - { - TRACE(" Uri "); - retValue = MVPbkContactFieldUriData::Cast(fieldData).Text().AllocLC(); - break; - } - - }//End switch - if( aFieldResId == R_VPBK_FIELD_TYPE_IMPP && retValue ) - { - TRACE( " IMPP fild found"); - // TODO RAMC : Nikhil/Mukesh - // in case of srver contacts it also find the first valid xsp id - // not valid through NULL - // which can be clarified - // earlier it show selection query in UI which one to use - TPtrC scheme = MVPbkContactFieldUriData::Cast(fieldData).Scheme(); - if( scheme.Compare( *iServiceName ) == 0 ) - { - TRACE( " actual xsp Id found"); - // actual xsp id found break the loop and return - break; - } - else - { - // actual xsp not yet found continue looking - CleanupStack::PopAndDestroy(); // retValue; - retValue = NULL; - } - } - else if( retValue ) - { - // break this loop once the given aFieldResId is found - // with valid data - break; - } - } - } - if( !retValue ) - { - TRACE( " NULL value"); - // if NULL assign valid ptr - retValue = KNullDesC().AllocLC(); - } - - return retValue;// ownership is return to caller - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::GetContactBinaryFieldDataLC() -// --------------------------------------------------------------------------- -// -HBufC8* CVIMPSTStorageVPbkStoreHandler::GetContactBinaryFieldDataLC(const MVPbkStoreContact& aContact, - TInt aFieldResId ) - { - TRACER_AUTO; - HBufC8* retValue = NULL; - const MVPbkStoreContactFieldCollection& fieldCollection = aContact.Fields(); - TInt fieldCount = fieldCollection.FieldCount(); - TRACE( "fieldCount%d",fieldCount ); - for( TInt index = 0 ; index < fieldCount ; index++ ) - { - const MVPbkStoreContactField& field = fieldCollection.FieldAt( index ); - const MVPbkFieldType* fieldType = field.BestMatchingFieldType(); - //find the relevant xSP field - if ( fieldType && ( fieldType->FieldTypeResId() == aFieldResId ) ) - { - const MVPbkContactFieldData& fieldData = field.FieldData(); - switch( fieldData.DataType() ) - { - case EVPbkFieldStorageTypeBinary: - { - TRACE( " Text" ); - retValue = MVPbkContactFieldBinaryData::Cast(fieldData).BinaryData().AllocLC(); - break; - } - }//End switch - if( retValue ) - { - // break this loop once the given aFieldResId is found - // with valid data - break; - } - } - } - if( !retValue ) - { - TRACE( " NULL value"); - // if NULL assign valid ptr - retValue = KNullDesC8().AllocLC(); - } - - return retValue;// ownership is return to caller - } - - -// --------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::RetriveFieldDataAndSendEventL -// -// --------------------------------------------------------- -void CVIMPSTStorageVPbkStoreHandler::RetriveFieldDataAndSendEventL(const MVPbkStoreContact& aContact ) - { - TRACER_AUTO; - HBufC* retValue = NULL; - const MVPbkStoreContactFieldCollection& fieldCollection = aContact.Fields(); - TInt fieldCount = fieldCollection.FieldCount(); - for( TInt index = 0 ; index < fieldCount ; index++ ) - { - const MVPbkStoreContactField& field = fieldCollection.FieldAt( index ); - const MVPbkFieldType* fieldType = field.BestMatchingFieldType(); - //find the relevant xSP field - //if ( fieldType && ( fieldType->FieldTypeResId() == aFieldResId ) ) - if ( fieldType && (( fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_IMPP ) - || (fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_LANDPHONEHOME ) - ||(fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_MOBILEPHONEHOME ) - ||(fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_LANDPHONEWORK ) - ||(fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_MOBILEPHONEWORK ) - ||(fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_VOIPWORK ) - ||(fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_VOIPHOME ) - ||(fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_LANDPHONEGEN ) - ||(fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_MOBILEPHONEGEN ) - ||(fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_VOIPGEN ) - ||(fieldType->FieldTypeResId() == R_VPBK_FIELD_TYPE_SIP ) )) - { - const MVPbkContactFieldData& fieldData = field.FieldData(); - switch( fieldData.DataType() ) - { - case EVPbkFieldStorageTypeText: - { - TRACE( "Text" ); - retValue = MVPbkContactFieldTextData::Cast(fieldData).Text().AllocLC(); - break; - } - case EVPbkFieldStorageTypeUri: - { - TRACE( "begin" ) ; - retValue = MVPbkContactFieldUriData::Cast(fieldData).Text().AllocLC(); - break; - } - - }//End switch - if( retValue ) - { - TRACE( " begin" ); - TVIMPSTVPbkStoreEvent storeEvent(iStoreEventType, - NULL, - NULL, - *retValue, - KNullDesC ); - iStoreHandler.HandleVPbkStoreEventL( storeEvent ) ; - CleanupStack::PopAndDestroy(); // retValue; - retValue = NULL; - } - } - } - - } - -// --------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::RemoveAllVPbkContactsL -// -// --------------------------------------------------------- -TInt CVIMPSTStorageVPbkStoreHandler::RemoveAllVPbkContactsL() - { - TRACER_AUTO; - TRACE( " before if" ); - if(iAddIdInProgress) - { - TPtr iAddIdInProgressPtr = iAddIdInProgress->Des(); - TRACE( "iAddIdInProgressPtr = %S", &iAddIdInProgressPtr ); - delete iAddIdInProgress; - iAddIdInProgress = NULL; - } - // intialize it to efalse as, somewhere it would have missed. - iCommitOperationInProgress = EFalse; - TRACE( " After if"); - TInt count = 0; - if( iContactView ) - { - count = iContactView->ContactCountL(); - } - TRACE( "count = %d",count) ; - TPtr iStoreNamePtr(iStoreName->Des() ); - TInt index = iStoreNamePtr.Find(_L(":") ); - if( index >= 0 && count ) - { - TPtrC store = iStoreNamePtr.Right( iStoreNamePtr.Length() - index -3 ); - CContactIdArray* contactIds = CContactIdArray::NewLC(); - CContactDatabase* contactDb = NULL; - //Open the database - TRAPD(err, contactDb = CContactDatabase::OpenL( store ) ); - if(err == KErrNone ) - { - CleanupStack::PushL( contactDb ); - // rest if already old ids exist - contactIds->Reset(); - TContactIter iterator(*contactDb); - TContactItemId contactId = iterator.FirstL(); - while(contactId != KNullContactId) - { - TRACE( "in side while" ); - // store into iContactIds for later deletion of contacts - contactIds->AddL(contactId ); - // get the next contactids - contactId = iterator.NextL(); - } - contactDb->DeleteContactsL(*contactIds); - // reset old ids - contactIds->Reset(); - CleanupStack::PopAndDestroy( contactDb ); - } - CleanupStack::PopAndDestroy( contactIds ); - } - - return count; - } - -// --------------------------------------------------------------------------- -// CVIMPSTStorageVPbkStoreHandler::ResetAndDestroyRArray -// --------------------------------------------------------------------------- -// -void CVIMPSTStorageVPbkStoreHandler::ResetAndDestroyRArray() - { - TRACER_AUTO; - TInt count = iPendingAvatars.Count(); - while( count ) - { - TVIMPSTAvatarData contactInf = iPendingAvatars[ 0 ]; - iPendingAvatars.Remove(0 ); - delete contactInf.iAvatarContent; - contactInf.iAvatarContent = NULL; - delete contactInf.iContactLink; - contactInf.iContactLink = NULL; - // not exist need to add - iPendingAvatars.Compress(); - count = iPendingAvatars.Count(); - } - iPendingAvatars.Reset(); - - } -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/src/vimpststorageutils.cpp --- a/uiservicetab/vimpststorage/src/vimpststorageutils.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* Copyright (c) 2008 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: Utils for storage modules. -* -*/ - - -#include "vimpststorageutils.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" - -#include "uiservicetabtracer.h" -#include "vimpstbuilddefinitions.h" - -#include -#include - -// needed to skip prefixes in domain-neutral comparison (TUint version) -const TUint KColonUInt( ':' ); - -// needed to skip domains in domain-neutral comparison (TUint version) -const TUint KAtUInt( '@' ); - -// "test character identity and accents, ignore case" -const TInt KCollationLevel = 1; - - - -// defines how far we are going to search for the protocol part in user id -const TInt KMaxLengthSearchProtPart = 4; - -// ----------------------------------------------------------------------------- -// VIMPSTStorageUtils::NeutralCompare -// ----------------------------------------------------------------------------- -// -TInt VIMPSTStorageUtils::NeutralCompare( const TDesC& aId1, - const TDesC& aId2, TBool aDomainNeutral ) - { - TRACER_AUTO; - // points to user part of id - TPtrC ptrId1( aId1 ); - TPtrC ptrId2( aId2 ); - - // Reduce looking for protocol part only to beginning of the WVID and - // skip protocol part ("anything:") in the beginning of the WVID - TInt colonPos1 = aId1.Left( KMaxLengthSearchProtPart ).Locate( KColonUInt ); - - // first id - if ( ( KErrNotFound != colonPos1 ) && ( aId1.Length() -1 != colonPos1 ) ) - { - // contains ":", and it is not the last char - ptrId1.Set( aId1.Mid( colonPos1 + 1 ) ); - } - - TInt colonPos2 = aId2.Left( KMaxLengthSearchProtPart ).Locate( KColonUInt ); - - // second id - if ( ( KErrNotFound != colonPos2 ) && ( aId2.Length() -1 != colonPos2 ) ) - { - // contains ":", and it is not the last char - ptrId2.Set( aId2.Mid( colonPos2 + 1 ) ); - } - - // find out if we have domains in the ids - TInt domainPos1( ptrId1.Locate( KAtUInt ) ); - TInt domainPos2( ptrId2.Locate( KAtUInt ) ); - - TBool domainIn1( KErrNotFound != domainPos1 ); - TBool domainIn2( KErrNotFound != domainPos2 ); - - // points to domains in the neutral id - TPtrC ptrDom1( KNullDesC ); - TPtrC ptrDom2( KNullDesC ); - - // points to user parts in the neutral id - TPtrC ptrUid1( ptrId1 ); - TPtrC ptrUid2( ptrId2 ); - - // separate user id parts and domain parts - if ( domainIn1 ) - { - ptrDom1.Set( ptrId1.Mid( domainPos1 + 1) ); - ptrUid1.Set( ptrId1.Mid( 0, domainPos1 ) ); - } - - if ( domainIn2 ) - { - ptrDom2.Set( ptrId2.Mid( domainPos2 + 1) ); - ptrUid2.Set( ptrId2.Mid( 0, domainPos2 ) ); - } - - // Create custom collation method to ignore punctuations - // index 0 gets the default method - TCollationMethod collation = - *Mem::CollationMethodByIndex( 0 ); - collation.iFlags |= TCollationMethod::EIgnoreNone; - - // domains are compared only when it is really needed - // check if userid part is the same in both ids - - TInt idResult = ptrUid1.Compare( ptrUid2); - - if( idResult != 0 ) - { - return idResult; - } - - // id part is same, we have to compare domain - - // If domain comparison is neutral and one id is without domain - // -> Domains are same. Other situation domainResult stays valid. - if( aDomainNeutral && ( domainIn1 ^ domainIn2 ) ) - { - return 0; - } - else - { - return ptrDom1.CompareC( ptrDom2, KCollationLevel, &collation ); - } - } - -// ----------------------------------------------------------------------------- -// VIMPSTStorageUtils::DisplayId -// ----------------------------------------------------------------------------- -// -TPtrC VIMPSTStorageUtils::DisplayId( const TDesC& aId, TBool /*aListHiding*/ ) - { - TRACER_AUTO; - TPtrC ret( aId ); - - return ret; - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/bwins/vimpststorage_testu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/bwins/vimpststorage_testu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - ?FieldTypeFilter@CVPbkContactViewDefinition@@QBEPAVCVPbkFieldTypeSelector@@XZ @ 2 NONAME ; class CVPbkFieldTypeSelector * CVPbkContactViewDefinition::FieldTypeFilter(void) const - ?UriDes@TVPbkContactStoreUriPtr@@QBEABVTDesC16@@XZ @ 3 NONAME ; class TDesC16 const & TVPbkContactStoreUriPtr::UriDes(void) const - ?NewL@CPbk2SortOrderManager@@SAPAV1@ABVMVPbkFieldTypeList@@PAVRFs@@@Z @ 4 NONAME ; class CPbk2SortOrderManager * CPbk2SortOrderManager::NewL(class MVPbkFieldTypeList const &, class RFs *) - ?Cancel@CActive@@QAEXXZ @ 5 NONAME ; void CActive::Cancel(void) - ?ContactAttributeManagerL@CVPbkContactManager@@QAEAAVMVPbkContactAttributeManager@@XZ @ 6 NONAME ; class MVPbkContactAttributeManager & CVPbkContactManager::ContactAttributeManagerL(void) - ?SetId@CVPbkContactViewDefinition@@QAEXH@Z @ 7 NONAME ; void CVPbkContactViewDefinition::SetId(int) - ?CompressStoresL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@AAVMVPbkBatchOperationObserver@@@Z @ 8 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CompressStoresL(class MVPbkBatchOperationObserver &) - ?DefaultSavingStoreL@CPbk2StoreConfiguration@@QBE?AVTVPbkContactStoreUriPtr@@XZ @ 9 NONAME ; class TVPbkContactStoreUriPtr CPbk2StoreConfiguration::DefaultSavingStoreL(void) const - ?Set@TVPbkContactStoreUriPtr@@QAEXABV1@@Z @ 10 NONAME ; void TVPbkContactStoreUriPtr::Set(class TVPbkContactStoreUriPtr const &) - ?Length@TVPbkContactStoreUriPtr@@QBEHXZ @ 11 NONAME ; int TVPbkContactStoreUriPtr::Length(void) const - ?SetPriority@CActive@@QAEXH@Z @ 12 NONAME ; void CActive::SetPriority(int) - ?RemoveObserver@CPbk2SortOrderManager@@QAEXAAVMPbk2SortOrderObserver@@@Z @ 13 NONAME ; void CPbk2SortOrderManager::RemoveObserver(class MPbk2SortOrderObserver &) - ?ContactListInterfaceL@CVIMPSTStorageManagerFactory@@SAPAVMVIMPSTStorageContacts@@K@Z @ 14 NONAME ; class MVIMPSTStorageContacts * CVIMPSTStorageManagerFactory::ContactListInterfaceL(unsigned long) - ?AddDefaultSavingStoreObserverL@CPbk2StoreConfiguration@@QAEXAAVMPbk2DefaultSavingStoreObserver@@@Z @ 15 NONAME ; void CPbk2StoreConfiguration::AddDefaultSavingStoreObserverL(class MPbk2DefaultSavingStoreObserver &) - ?NameDisplayOrder@CPbk2SortOrderManager@@QBE?AW4TPbk2NameDisplayOrder@1@XZ @ 16 NONAME ; enum CPbk2SortOrderManager::TPbk2NameDisplayOrder CPbk2SortOrderManager::NameDisplayOrder(void) const - ?Type@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewType@@XZ @ 17 NONAME ; enum TVPbkContactViewType CVPbkContactViewDefinition::Type(void) const - ?RetrieveContactL@CVPbkContactManager@@QBEPAVMVPbkContactOperationBase@@ABVMVPbkContactLink@@AAVMVPbkSingleContactOperationObserver@@@Z @ 18 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::RetrieveContactL(class MVPbkContactLink const &, class MVPbkSingleContactOperationObserver &) const - ?NewL@CVPbkContactViewDefinition@@SAPAV1@XZ @ 19 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(void) - ?Id@CVPbkContactViewDefinition@@QBEHXZ @ 20 NONAME ; int CVPbkContactViewDefinition::Id(void) const - ?AddSubViewL@CVPbkContactViewDefinition@@QAEXPAV1@@Z @ 21 NONAME ; void CVPbkContactViewDefinition::AddSubViewL(class CVPbkContactViewDefinition *) - ?Release@CVIMPSTStorageManagerFactory@@SAHXZ @ 22 NONAME ; int CVIMPSTStorageManagerFactory::Release(void) - ?Cast@MVPbkContactFieldUriData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 23 NONAME ; class MVPbkContactFieldUriData & MVPbkContactFieldUriData::Cast(class MVPbkContactFieldData &) - ?CreateContactViewLC@CVPbkContactManager@@QBEPAVMVPbkContactViewBase@@AAVMVPbkContactViewObserver@@ABVCVPbkContactViewDefinition@@ABVMVPbkFieldTypeList@@@Z @ 24 NONAME ; class MVPbkContactViewBase * CVPbkContactManager::CreateContactViewLC(class MVPbkContactViewObserver &, class CVPbkContactViewDefinition const &, class MVPbkFieldTypeList const &) const - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@XZ @ 25 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(void) - ?Remove@CVPbkContactLinkArray@@QAEXH@Z @ 26 NONAME ; void CVPbkContactLinkArray::Remove(int) - ?SimGlobalOwnNumberUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 27 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalOwnNumberUri(void) - ?Extension_@CActive@@MAEHIAAPAXPAX@Z @ 28 NONAME ; int CActive::Extension_(unsigned int, void * &, void *) - ?NewLC@CVPbkContactStoreUriArray@@SAPAV1@ABVTDesC8@@@Z @ 29 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewLC(class TDesC8 const &) - ?CreateLinksLC@CVPbkContactManager@@QBEPAVMVPbkContactLinkArray@@AAVRReadStream@@@Z @ 30 NONAME ; class MVPbkContactLinkArray * CVPbkContactManager::CreateLinksLC(class RReadStream &) const - ?SetFieldTypeFilterL@CVPbkContactViewDefinition@@QAEXPAVCVPbkFieldTypeSelector@@@Z @ 31 NONAME ; void CVPbkContactViewDefinition::SetFieldTypeFilterL(class CVPbkFieldTypeSelector *) - ?SetContactViewL@CPbk2SortOrderManager@@QAEXAAVMVPbkContactViewBase@@@Z @ 32 NONAME ; void CPbk2SortOrderManager::SetContactViewL(class MVPbkContactViewBase &) - ?FsSession@CVPbkContactManager@@QAEAAVRFs@@XZ @ 33 NONAME ; class RFs & CVPbkContactManager::FsSession(void) - ??1CActiveSchedulerWait@@UAE@XZ @ 34 NONAME ; CActiveSchedulerWait::~CActiveSchedulerWait(void) - ?Cast@MVPbkContactFieldUriData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 35 NONAME ; class MVPbkContactFieldUriData const & MVPbkContactFieldUriData::Cast(class MVPbkContactFieldData const &) - ?SetActive@CActive@@IAEXXZ @ 36 NONAME ; void CActive::SetActive(void) - ??0TVPbkContactStoreUriPtr@@QAE@ABVTDesC16@@@Z @ 37 NONAME ; TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(class TDesC16 const &) - ?Compare@TVPbkContactStoreUriPtr@@QBEHABVTDesC16@@W4TVPbkContactStoreUriComponent@1@@Z @ 38 NONAME ; int TVPbkContactStoreUriPtr::Compare(class TDesC16 const &, enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?Sharing@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewSharing@@XZ @ 39 NONAME ; enum TVPbkContactViewSharing CVPbkContactViewDefinition::Sharing(void) const - ?SupportedStoreConfigurationL@CPbk2StoreConfiguration@@QBEPAVCVPbkContactStoreUriArray@@XZ @ 40 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::SupportedStoreConfigurationL(void) const - ?ContactSelector@CVPbkContactViewDefinition@@QBEPAVMVPbkContactSelector@@XZ @ 41 NONAME ; class MVPbkContactSelector * CVPbkContactViewDefinition::ContactSelector(void) const - ?CopyContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMVPbkContactLinkArray@@PAVMVPbkContactStore@@AAVMVPbkBatchOperationObserver@@@Z @ 42 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CopyContactsL(class MVPbkContactLinkArray const &, class MVPbkContactStore *, class MVPbkBatchOperationObserver &) - ?Start@CActiveSchedulerWait@@QAEXXZ @ 43 NONAME ; void CActiveSchedulerWait::Start(void) - ?Delete@CVPbkContactLinkArray@@QAEXH@Z @ 44 NONAME ; void CVPbkContactLinkArray::Delete(int) - ?CommitContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABV?$TArray@PAVMVPbkStoreContact@@@@AAVMVPbkBatchOperationObserver@@@Z @ 45 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CommitContactsL(class TArray const &, class MVPbkBatchOperationObserver &) - ?Compare@TVPbkContactStoreUriPtr@@QBEHABV1@W4TVPbkContactStoreUriComponent@1@@Z @ 46 NONAME ; int TVPbkContactStoreUriPtr::Compare(class TVPbkContactStoreUriPtr const &, enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ??0TVPbkContactStoreUriPtr@@QAE@XZ @ 47 NONAME ; TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(void) - ?SetFlag@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewFlag@@H@Z @ 48 NONAME ; void CVPbkContactViewDefinition::SetFlag(enum TVPbkContactViewFlag, int) - ?AppendAllL@CVPbkContactStoreUriArray@@QAEXABV1@@Z @ 49 NONAME ; void CVPbkContactStoreUriArray::AppendAllL(class CVPbkContactStoreUriArray const &) - ?ExternalizedSize@TVPbkContactStoreUriPtr@@UBEHXZ @ 50 NONAME ; int TVPbkContactStoreUriPtr::ExternalizedSize(void) const - ?AppendL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@@Z @ 51 NONAME ; void CVPbkContactLinkArray::AppendL(class MVPbkContactLink *) - ?ItemInterfaceL@CVIMPSTStorageManagerFactory@@SAPAVMVIMPSTStorageItemModel@@K@Z @ 52 NONAME ; class MVIMPSTStorageItemModel * CVIMPSTStorageManagerFactory::ItemInterfaceL(unsigned long) - ?NewLC@CVPbkContactStoreUriArray@@SAPAV1@XZ @ 53 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewLC(void) - ?SetType@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewType@@@Z @ 54 NONAME ; void CVPbkContactViewDefinition::SetType(enum TVPbkContactViewType) - ?AppendL@CVPbkContactStoreUriArray@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 55 NONAME ; void CVPbkContactStoreUriArray::AppendL(class TVPbkContactStoreUriPtr const &) - ?FieldTypes@CVPbkContactManager@@QBEABVMVPbkFieldTypeList@@XZ @ 56 NONAME ; class MVPbkFieldTypeList const & CVPbkContactManager::FieldTypes(void) const - ?NewL@CVPbkContactViewDefinition@@SAPAV1@ABV1@@Z @ 57 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(class CVPbkContactViewDefinition const &) - ?SortOrder@CPbk2SortOrderManager@@QBEABVMVPbkFieldTypeList@@XZ @ 58 NONAME ; class MVPbkFieldTypeList const & CPbk2SortOrderManager::SortOrder(void) const - ?NewLC@CVPbkContactLinkArray@@SAPAV1@AAVRReadStream@@ABVMVPbkContactStoreList@@@Z @ 59 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class RReadStream &, class MVPbkContactStoreList const &) - ?SetNameL@CVPbkContactViewDefinition@@QAEXABVTDesC16@@@Z @ 60 NONAME ; void CVPbkContactViewDefinition::SetNameL(class TDesC16 const &) - ?FlagIsOn@CVPbkContactViewDefinition@@QBEHW4TVPbkContactViewFlag@@@Z @ 61 NONAME ; int CVPbkContactViewDefinition::FlagIsOn(enum TVPbkContactViewFlag) const - ?RemoveObserver@CPbk2StoreConfiguration@@QAEXAAVMPbk2StoreConfigurationObserver@@@Z @ 62 NONAME ; void CPbk2StoreConfiguration::RemoveObserver(class MPbk2StoreConfigurationObserver &) - ?RunError@CActive@@MAEHH@Z @ 63 NONAME ; int CActive::RunError(int) - ?SubViewAt@CVPbkContactViewDefinition@@QAEAAV1@H@Z @ 64 NONAME ; class CVPbkContactViewDefinition & CVPbkContactViewDefinition::SubViewAt(int) - ?SetContactSelector@CVPbkContactViewDefinition@@QAEXPAVMVPbkContactSelector@@@Z @ 65 NONAME ; void CVPbkContactViewDefinition::SetContactSelector(class MVPbkContactSelector *) - ?SimGlobalFdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 66 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalFdnUri(void) - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@AAVTResourceReader@@@Z @ 67 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(class TResourceReader &) - ?LoadContactStoreL@CVPbkContactManager@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 68 NONAME ; void CVPbkContactManager::LoadContactStoreL(class TVPbkContactStoreUriPtr const &) - ?Uri@CVPbkContactViewDefinition@@QBEABVTDesC16@@XZ @ 69 NONAME ; class TDesC16 const & CVPbkContactViewDefinition::Uri(void) const - ?ExternalizeL@TVPbkContactStoreUriPtr@@UBEXAAVRWriteStream@@@Z @ 70 NONAME ; void TVPbkContactStoreUriPtr::ExternalizeL(class RWriteStream &) const - ?NewL@CVPbkContactStoreUriArray@@SAPAV1@XZ @ 71 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewL(void) - ?SimGlobalSdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 72 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalSdnUri(void) - ?Cast@MVPbkContactFieldTextData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 73 NONAME ; class MVPbkContactFieldTextData & MVPbkContactFieldTextData::Cast(class MVPbkContactFieldData &) - ?Reset@CVPbkContactLinkArray@@QAEXXZ @ 74 NONAME ; void CVPbkContactLinkArray::Reset(void) - ?Pbk2AppUi@Phonebook2@@YAPAVMPbk2AppUi@@XZ @ 75 NONAME ; class MPbk2AppUi * Phonebook2::Pbk2AppUi(void) - ?PackLC@CVPbkContactStoreUriArray@@QBEPAVHBufC8@@XZ @ 76 NONAME ; class HBufC8 * CVPbkContactStoreUriArray::PackLC(void) const - ?PackedBufferSize@CVPbkContactLinkArray@@QBEHXZ @ 77 NONAME ; int CVPbkContactLinkArray::PackedBufferSize(void) const - ?Add@CActiveScheduler@@SAXPAVCActive@@@Z @ 78 NONAME ; void CActiveScheduler::Add(class CActive *) - ?AddObserverL@CPbk2StoreConfiguration@@QAEXAAVMPbk2StoreConfigurationObserver@@@Z @ 79 NONAME ; void CPbk2StoreConfiguration::AddObserverL(class MPbk2StoreConfigurationObserver &) - ?AddContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 80 NONAME ; void CPbk2StoreConfiguration::AddContactStoreURIL(class TVPbkContactStoreUriPtr) - ?RemoveContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 81 NONAME ; void CPbk2StoreConfiguration::RemoveContactStoreURIL(class TVPbkContactStoreUriPtr) - ??0CActive@@IAE@H@Z @ 82 NONAME ; CActive::CActive(int) - ?Name@CVPbkContactViewDefinition@@QBEABVTDesC16@@XZ @ 83 NONAME ; class TDesC16 const & CVPbkContactViewDefinition::Name(void) const - ?Cast@MVPbkContactFieldTextData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 84 NONAME ; class MVPbkContactFieldTextData const & MVPbkContactFieldTextData::Cast(class MVPbkContactFieldData const &) - ?AsyncStop@CActiveSchedulerWait@@QAEXXZ @ 85 NONAME ; void CActiveSchedulerWait::AsyncStop(void) - ?ResetAndDestroy@CVPbkContactLinkArray@@QAEXXZ @ 86 NONAME ; void CVPbkContactLinkArray::ResetAndDestroy(void) - ?CreateLinksLC@CVPbkContactManager@@QBEPAVMVPbkContactLinkArray@@ABVTDesC8@@@Z @ 87 NONAME ; class MVPbkContactLinkArray * CVPbkContactManager::CreateLinksLC(class TDesC8 const &) const - ?Remove@CVPbkContactStoreUriArray@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 88 NONAME ; void CVPbkContactStoreUriArray::Remove(class TVPbkContactStoreUriPtr const &) - ?Count@CVPbkContactStoreUriArray@@QBEHXZ @ 89 NONAME ; int CVPbkContactStoreUriArray::Count(void) const - ?CurrentConfigurationL@CPbk2StoreConfiguration@@QBEPAVCVPbkContactStoreUriArray@@XZ @ 90 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::CurrentConfigurationL(void) const - ?SetUriL@CVPbkContactViewDefinition@@QAEXABVTDesC16@@@Z @ 91 NONAME ; void CVPbkContactViewDefinition::SetUriL(class TDesC16 const &) - ?RemoveSupportedContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 92 NONAME ; void CPbk2StoreConfiguration::RemoveSupportedContactStoreURIL(class TVPbkContactStoreUriPtr) - ??1CActive@@UAE@XZ @ 93 NONAME ; CActive::~CActive(void) - ?Cast@MVPbkContactFieldBinaryData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 94 NONAME ; class MVPbkContactFieldBinaryData & MVPbkContactFieldBinaryData::Cast(class MVPbkContactFieldData &) - ?ContactStoresL@CVPbkContactManager@@QAEAAVMVPbkContactStoreList@@XZ @ 95 NONAME ; class MVPbkContactStoreList & CVPbkContactManager::ContactStoresL(void) - ?DeleteContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMVPbkContactLinkArray@@AAVMVPbkBatchOperationObserver@@@Z @ 96 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::DeleteContactsL(class MVPbkContactLinkArray const &, class MVPbkBatchOperationObserver &) - ?MatchPhoneNumberL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVTDesC16@@HAAVMVPbkContactFindObserver@@@Z @ 97 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::MatchPhoneNumberL(class TDesC16 const &, int, class MVPbkContactFindObserver &) - ?NewL@CVPbkContactManager@@SAPAV1@VTSecurityInfo@@ABVCVPbkContactStoreUriArray@@PAVRFs@@@Z @ 98 NONAME ; class CVPbkContactManager * CVPbkContactManager::NewL(class TSecurityInfo, class CVPbkContactStoreUriArray const &, class RFs *) - ?DefaultCntDbUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 99 NONAME ; class TDesC16 const & VPbkContactStoreUris::DefaultCntDbUri(void) - ?InitialiseLibraryL@CVIMPSTStorageManagerFactory@@SAXXZ @ 100 NONAME ; void CVIMPSTStorageManagerFactory::InitialiseLibraryL(void) - ?AddSupportedContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 101 NONAME ; void CPbk2StoreConfiguration::AddSupportedContactStoreURIL(class TVPbkContactStoreUriPtr) - ?RemoveDefaultSavingStoreObserver@CPbk2StoreConfiguration@@QAEXAAVMPbk2DefaultSavingStoreObserver@@@Z @ 102 NONAME ; void CPbk2StoreConfiguration::RemoveDefaultSavingStoreObserver(class MPbk2DefaultSavingStoreObserver &) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@ABVTDesC8@@ABVMVPbkContactStoreList@@@Z @ 103 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class TDesC8 const &, class MVPbkContactStoreList const &) - ?FindL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVTDesC16@@ABVMVPbkFieldTypeList@@AAVMVPbkContactFindObserver@@@Z @ 104 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::FindL(class TDesC16 const &, class MVPbkFieldTypeList const &, class MVPbkContactFindObserver &) - ?SetNameDisplayOrderL@CPbk2SortOrderManager@@QAEXW4TPbk2NameDisplayOrder@1@ABVTDesC16@@@Z @ 105 NONAME ; void CPbk2SortOrderManager::SetNameDisplayOrderL(enum CPbk2SortOrderManager::TPbk2NameDisplayOrder, class TDesC16 const &) - ?NewL@CVPbkContactLinkArray@@SAPAV1@XZ @ 106 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewL(void) - ?SubViewCount@CVPbkContactViewDefinition@@QBEHXZ @ 107 NONAME ; int CVPbkContactViewDefinition::SubViewCount(void) const - ?IsIncluded@CVPbkContactStoreUriArray@@QBEHABVTVPbkContactStoreUriPtr@@@Z @ 108 NONAME ; int CVPbkContactStoreUriArray::IsIncluded(class TVPbkContactStoreUriPtr const &) const - ?Component@TVPbkContactStoreUriPtr@@QBE?BVTPtrC16@@W4TVPbkContactStoreUriComponent@1@@Z @ 109 NONAME ; class TPtrC16 const TVPbkContactStoreUriPtr::Component(enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@ABV1@@Z @ 110 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(class CVPbkContactViewDefinition const &) - ?SubViewAt@CVPbkContactViewDefinition@@QBEABV1@H@Z @ 111 NONAME ; class CVPbkContactViewDefinition const & CVPbkContactViewDefinition::SubViewAt(int) const - ?Cast@MVPbkContactFieldBinaryData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 112 NONAME ; class MVPbkContactFieldBinaryData const & MVPbkContactFieldBinaryData::Cast(class MVPbkContactFieldData const &) - ?InsertL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@H@Z @ 113 NONAME ; void CVPbkContactLinkArray::InsertL(class MVPbkContactLink *, int) - ??ACVPbkContactStoreUriArray@@QBE?AVTVPbkContactStoreUriPtr@@H@Z @ 114 NONAME ; class TVPbkContactStoreUriPtr CVPbkContactStoreUriArray::operator[](int) const - ?SimGlobalAdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 115 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalAdnUri(void) - ?CurrentSeparator@CPbk2SortOrderManager@@QBEABVTDesC16@@XZ @ 116 NONAME ; class TDesC16 const & CPbk2SortOrderManager::CurrentSeparator(void) const - ??0CActiveSchedulerWait@@QAE@XZ @ 117 NONAME ; CActiveSchedulerWait::CActiveSchedulerWait(void) - ?NewL@CVPbkContactManager@@SAPAV1@ABVCVPbkContactStoreUriArray@@PAVRFs@@@Z @ 118 NONAME ; class CVPbkContactManager * CVPbkContactManager::NewL(class CVPbkContactStoreUriArray const &, class RFs *) - ?DefaultSeparator@CPbk2SortOrderManager@@QAEABVTDesC16@@XZ @ 119 NONAME ; class TDesC16 const & CPbk2SortOrderManager::DefaultSeparator(void) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@XZ @ 120 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(void) - ?SearchStoreConfigurationL@CPbk2StoreConfiguration@@QAEPAVCVPbkContactStoreUriArray@@XZ @ 121 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::SearchStoreConfigurationL(void) - ?SortPolicy@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewSortPolicy@@XZ @ 122 NONAME ; enum TVPbkContactViewSortPolicy CVPbkContactViewDefinition::SortPolicy(void) const - ?InitialiseViewL@CVIMPSTStorageManagerFactory@@SAXKABVTDesC16@@0@Z @ 123 NONAME ; void CVIMPSTStorageManagerFactory::InitialiseViewL(unsigned long, class TDesC16 const &, class TDesC16 const &) - ?SetSharing@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewSharing@@@Z @ 124 NONAME ; void CVPbkContactViewDefinition::SetSharing(enum TVPbkContactViewSharing) - ?NewL@CPbk2StoreConfiguration@@SAPAV1@XZ @ 125 NONAME ; class CPbk2StoreConfiguration * CPbk2StoreConfiguration::NewL(void) - ?AddObserverL@CPbk2SortOrderManager@@QAEXAAVMPbk2SortOrderObserver@@@Z @ 126 NONAME ; void CPbk2SortOrderManager::AddObserverL(class MPbk2SortOrderObserver &) - ?Start@CPeriodic@@QAEXVTTimeIntervalMicroSeconds32@@0VTCallBack@@@Z @ 127 NONAME ; void CPeriodic::Start(class TTimeIntervalMicroSeconds32, class TTimeIntervalMicroSeconds32, class TCallBack) - ?FindL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMDesC16Array@@ABVMVPbkFieldTypeList@@AAVMVPbkContactFindFromStoresObserver@@ABVTCallBack@@@Z @ 128 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::FindL(class MDesC16Array const &, class MVPbkFieldTypeList const &, class MVPbkContactFindFromStoresObserver &, class TCallBack const &) - ?NewL@CVPbkContactViewDefinition@@SAPAV1@AAVTResourceReader@@@Z @ 129 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(class TResourceReader &) - ?SetSortPolicy@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewSortPolicy@@@Z @ 130 NONAME ; void CVPbkContactViewDefinition::SetSortPolicy(enum TVPbkContactViewSortPolicy) - ?Deque@CActive@@QAEXXZ @ 131 NONAME ; void CActive::Deque(void) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/conf/CVIMPSTStorageContactList_UT.cfg --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/conf/CVIMPSTStorageContactList_UT.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,299 +0,0 @@ -[Define] - -LISTID myList@nokia.com -DISPLAYNAME emirates -NULL null -NOTNULL notnull - -// --- Flags to indicate the type of params, for test cases 11-17 - -SINGLE_VALID_CONTACT 1 -SINGLE_NULL_CONTACT 2 -AT_POSITIVE_INDEX 3 -AT_NEGATIVE_INDEX 4 -AT_ZERO_INDEX 5 -SAME_CONTACT 6 -DIFFERENT_CONTACTS 7 - -// --- Flags to indicate the type of params, for test cases 18-19 - -MULTIPLE_CONTACTS 1 -ZERO_CONTACTS 2 - -// --- Flags to indicate the type of filters ( params ), for test cases 20-23 - -FILTER1 1 -FILTER2 2 -FILTER3 3 -ALLFILTER 4 -NOFILTER 5 - -// --- Flags to indicate the type of filters ( params ), for test cases 25-27 - -FILTEREDCOUNT1 6 -FILTEREDCOUNT2 7 -FILTEREDCOUNT3 8 - -// --- Flags to indicate filters - -FILTERNOTDEFINED -1 -FILTERALL 0 -FILTERANDOPERATION 1 -FILTERONLINE 2 -FILTERNONBLOCKED 4 -FILTERAWAY 8 -FILTERNONOFFLINE 16 - - -[Enddefine] - -[Test] - -// --- Test cases 1 to 8, test the NewL function --- - - // --- Test Case with valid listid, valid displayname, valid contactsorter -title 1.Test_NewL_valid_listid_valid_displayname -create CVIMPSTStorageContactList_UT foobar -foobar Test_NewL LISTID DISPLAYNAME -delete foobar -[Endtest] - - // --- Test Case with valid listid, null displayname, valid contactsorter -[Test] -title 2.Test_NewL_valid_listid_null_displayname -create CVIMPSTStorageContactList_UT foobar -foobar Test_NewL LISTID NULL -delete foobar -[Endtest] - - // --- Test Case with null listid, valid displayname, valid contactsorter -[Test] -title 3.Test_NewL_null_listid_valid_displayname -create CVIMPSTStorageContactList_UT foobar -foobar Test_NewL NULL DISPLAYNAME -delete foobar -[Endtest] - - // --- Test Case with null listid, null displayname, valid contactsorter -[Test] -title 4.Test_NewL_null_listid_null_displayname -create CVIMPSTStorageContactList_UT foobar -foobar Test_NewL NULL NULL -delete foobar -[Endtest] - -// --- Test Case 5-6 to test ListId() function - -[Test] -title 5.Test_ListId_valid_listid -create CVIMPSTStorageContactList_UT foobar -foobar Test_ListId LISTID -delete foobar -[Endtest] - -[Test] -title 6.Test_ListId_null_listid -create CVIMPSTStorageContactList_UT foobar -foobar Test_ListId NULL -delete foobar -[Endtest] - -// --- Test Case 7-8 to test DisplayName function - -[Test] -title 7.Test_DisplayName_valid_displayname -create CVIMPSTStorageContactList_UT foobar -foobar Test_DisplayName DISPLAYNAME LISTID -delete foobar -[Endtest] - -[Test] -title 8.Test_DisplayName_null_displayname -create CVIMPSTStorageContactList_UT foobar -foobar Test_DisplayName NULL LISTID -delete foobar -[Endtest] - -// --- Test Case 9-10 to test Count function -[Test] -title 9.Test_Count_Positive_Count -create CVIMPSTStorageContactList_UT foobar -foobar Test_Count 1 -delete foobar -[Endtest] - -[Test] -title 10.Test_Count_Negative_Count -create CVIMPSTStorageContactList_UT foobar -foobar Test_Count 2 -delete foobar -[Endtest] - -// --- Test Case 11- to test AddStorageContacttoCacheL function -[Test] -title 11.Test_AddContactToList-SINGLE_VALID_CONTACT -create CVIMPSTStorageContactList_UT foobar -foobar Test_AddContactToList SINGLE_VALID_CONTACT -delete foobar -[Endtest] - -[Test] -title 12.Test_AddContactToList-SINGLE_NULL_CONTACT -create CVIMPSTStorageContactList_UT foobar -foobar Test_AddContactToList SINGLE_NULL_CONTACT -delete foobar -[Endtest] - -[Test] -title 13.Test_AddContactToList-AT_POSITIVE_INDEX -create CVIMPSTStorageContactList_UT foobar -foobar Test_AddContactToList AT_POSITIVE_INDEX -delete foobar -[Endtest] - -[Test] -title 14.Test_AddContactToList-AT_NEGATIVE_INDEX -create CVIMPSTStorageContactList_UT foobar -foobar Test_AddContactToList AT_NEGATIVE_INDEX -delete foobar -[Endtest] - -[Test] -title 15.Test_AddContactToList-AT_ZERO_INDEX -create CVIMPSTStorageContactList_UT foobar -foobar Test_AddContactToList AT_ZERO_INDEX -delete foobar -[Endtest] - -[Test] -title 16.Test_AddContactToList-SAME_CONTACT -create CVIMPSTStorageContactList_UT foobar -foobar Test_AddContactToList SAME_CONTACT -delete foobar -[Endtest] - -[Test] -title 17.Test_AddContactToList-DIFFERENT_CONTACTS -create CVIMPSTStorageContactList_UT foobar -foobar Test_AddContactToList DIFFERENT_CONTACTS -delete foobar -[Endtest] - -// --- Test cases to test the Count function - -[Test] -title 18.Test_Count-MULTIPLE_CONTACTS -create CVIMPSTStorageContactList_UT foobar -foobar Test_Count MULTIPLE_CONTACTS -delete foobar -[Endtest] - -[Test] -title 19.Test_Count-ZERO_CONTACTS -create CVIMPSTStorageContactList_UT foobar -foobar Test_Count ZERO_CONTACTS -delete foobar -[Endtest] - -// --- Test cases for FilteredContact function - -[Test] -title 20.Test_FilteredContact-FILTER1 -create CVIMPSTStorageContactList_UT foobar -// Passing 1, indicating the test case variant. Map with -// the list of unit test case in the xls. Similarly in -// test cases 21 and 22. -foobar Test_FilteredContact 1 -delete foobar -[Endtest] - -[Test] -title 21.Test_FilteredContact-FILTER2 -create CVIMPSTStorageContactList_UT foobar -foobar Test_FilteredContact 2 -delete foobar -[Endtest] - -[Test] -title 22.Test_FilteredContact-FILTER3 -create CVIMPSTStorageContactList_UT foobar -foobar Test_FilteredContact 3 -delete foobar -[Endtest] - -// --- Test Cases to check FilteredCount function - -[Test] -title 25.Test_FilteredCount -create CVIMPSTStorageContactList_UT foobar -foobar Test_FilteredCount 1 -delete foobar -[Endtest] - -[Test] -title 26.Test_FilteredCount -create CVIMPSTStorageContactList_UT foobar -foobar Test_FilteredCount 2 -delete foobar -[Endtest] - -[Test] -title 27.Test_FilteredCount -create CVIMPSTStorageContactList_UT foobar -foobar Test_FilteredCount 3 -delete foobar -[Endtest] - -// --- FilterAllowsContact test cases --- - -[Test] -title 28.Test_FilterAllowsContact -create CVIMPSTStorageContactList_UT foobar -foobar Test_FilterAllowsContact NULL FILTERNOTDEFINED 28 -delete foobar -[Endtest] - -[Test] -title 29.Test_FilterAllowsContact -create CVIMPSTStorageContactList_UT foobar -foobar Test_FilterAllowsContact NOTNULL FILTERONLINE 29 -delete foobar -[Endtest] - -[Test] -title 30.Test_FilterAllowsContact -create CVIMPSTStorageContactList_UT foobar -foobar Test_FilterAllowsContact NOTNULL FILTERAWAY 30 -delete foobar -[Endtest] - -[Test] -title 31.Test_FilterAllowsContact -create CVIMPSTStorageContactList_UT foobar -foobar Test_FilterAllowsContact NOTNULL FILTERNOTDEFINED 31 -delete foobar -[Endtest] - -// --- FindIndexOfContact test cases --- - -[Test] -title 32.Test_FilterAllowsContact -create CVIMPSTStorageContactList_UT foobar -foobar Test_FindIndexOfContact 1 -delete foobar -[Endtest] - -[Test] -title 33.Test_FilterAllowsContact -create CVIMPSTStorageContactList_UT foobar -foobar Test_FindIndexOfContact 2 -delete foobar -[Endtest] - -[Test] -title 34.Test_FindIndexOfContact -create CVIMPSTStorageContactList_UT foobar -foobar Test_FindIndexOfContact 3 -delete foobar -[Endtest] - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/conf/CVIMPSTStorageContactSorter_UT.cfg --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/conf/CVIMPSTStorageContactSorter_UT.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -[Define] - -[Enddefine] - -// --- Test Case 1, tests NewL() - -[Test] -title 1.CreateSorter -create CVIMPSTStorageContactSorter_UT foobar -foobar CreateSorter -delete foobar -[Endtest] - -// --- Test Case 2-3, tests SetSortAlgorithm() - -[Test] -title 2.SelectAlgorithm -create CVIMPSTStorageContactSorter_UT foobar -foobar SelectAlgorithm 1 -delete foobar -[Endtest] - -[Test] -title 3.SelectAlgorithm -create CVIMPSTStorageContactSorter_UT foobar -foobar SelectAlgorithm 2 -delete foobar -[Endtest] - -// --- Test Cases 4-6, tests Sort() - -[Test] -title 4.DoSort -create CVIMPSTStorageContactSorter_UT foobar -foobar DoSort alpha -delete foobar -[Endtest] - -[Test] -title 5.DoSort -create CVIMPSTStorageContactSorter_UT foobar -foobar DoSort presence -delete foobar -[Endtest] - -[Test] -title 6.DoSort -create CVIMPSTStorageContactSorter_UT foobar -foobar DoSort default -delete foobar -[Endtest] - -// --- Test Cases 7-11, Compare() - -[Test] -title 7.CompareContacts 2 valid contacts -create CVIMPSTStorageContactSorter_UT foobar -foobar CompareContacts 2validcontacts -delete foobar -[Endtest] - -[Test] -title 8.CompareContacts 1 valid contact -create CVIMPSTStorageContactSorter_UT foobar -foobar CompareContacts 1validcontact -delete foobar -[Endtest] - -[Test] -title 9.CompareContacts 1 null contact -create CVIMPSTStorageContactSorter_UT foobar -foobar CompareContacts 1nullcontact -delete foobar -[Endtest] - -[Test] -title 10.CompareContacts 2 null contacts -create CVIMPSTStorageContactSorter_UT foobar -foobar CompareContacts 2nullcontacts -delete foobar -[Endtest] - -[Test] -title 11.CompareContacts same contacts -create CVIMPSTStorageContactSorter_UT foobar -foobar CompareContacts samecontacts -delete foobar -[Endtest] diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/conf/CVIMPSTStorageContact_UT.cfg --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/conf/CVIMPSTStorageContact_UT.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -[Define] - -USERID nokia@nokia.com -USERID1 sonyericsson@sony.com -DISPLAYNAME connectingpeople -DISPLAYNAME1 Lordaeron -AVATARCONTENT jejamma jejamma -NULL null - -UNKNOWN EUnknown -OFFLINE EOffline -ONLINE EOnline -INVISIBLE EInvisible -AWAY EAway -BUSY EBusy -ONPHONE EOnPhone -DND EDoNotDisturb -PENDING EPending -BLOCKED EBlocked - -STATUSTEXT TheAngelFallsForMe - -POSITIVEINDEX 3 -NEGATIVEINDEX -3 -ZEROINDEX 0 -NULLINDEX 0 - -[Enddefine] - - // Test Cases 1-8 , Test for the NewL function. - -[Test] -title 1.CreateStorageContact-Valid Userid Valid DisplayName -create CVIMPSTStorageContact_UT obj -obj CreateStorageContact USERID DISPLAYNAME NULL -delete obj -[Endtest] - -[Test] -title 2.CreateStorageContact-Valid Userid Null DisplayName -create CVIMPSTStorageContact_UT obj -obj CreateStorageContact USERID NULL NULL -delete obj -[Endtest] - -[Test] -title 3.CreateStorageContact-Null Userid Valid DisplayName -create CVIMPSTStorageContact_UT obj -obj CreateStorageContact NULL DISPLAYNAME NULL -delete obj -[Endtest] - -[Test] -title 4.CreateStorageContact-Null Userid Null DisplayName -create CVIMPSTStorageContact_UT obj -obj CreateStorageContact NULL NULL NULL -delete obj -[Endtest] - -[Test] -title 5.CreateStorageContact-Valid Userid Valid DisplayName Null ContactLink -create CVIMPSTStorageContact_UT obj -obj CreateStorageContact USERID DISPLAYNAME CLINK -delete obj -[Endtest] - -[Test] -title 6.CreateStorageContact-Valid Userid Null DisplayName Null ContactLink -create CVIMPSTStorageContact_UT obj -obj CreateStorageContact USERID NULL CLINK -delete obj -[Endtest] - -[Test] -title 7.CreateStorageContact-Null Userid Valid DisplayName Null ContactLink -create CVIMPSTStorageContact_UT obj -obj CreateStorageContact NULL DISPLAYNAME CLINK -delete obj -[Endtest] - -[Test] -title 8.CreateStorageContact-Null Userid Null DisplayName Null ContactLink -create CVIMPSTStorageContact_UT obj -obj CreateStorageContact NULL NULL CLINK -delete obj -[Endtest] - -// Test Cases 9-10, Test for UserId() and SetUserId () - -[Test] -title 9.SetGetUserId-ValidId -create CVIMPSTStorageContact_UT obj -obj SetGetUserId USERID1 -delete obj -[Endtest] - -[Test] -title 10.SetGetUserId-NullId -create CVIMPSTStorageContact_UT obj -obj SetGetUserId NULL -delete obj -[Endtest] - -// Test Cases 11-12, Test for Avatar() and SetAvatarContentL() - -[Test] -title 11.SetAvatarContent-ValidContent -create CVIMPSTStorageContact_UT obj -obj SetAvatarContent AVATARCONTENT -delete obj -[Endtest] - -[Test] -title 12.SetAvatarContent-NullContent -create CVIMPSTStorageContact_UT obj -obj SetAvatarContent NULL -delete obj -[Endtest] - -// Test Cases 13-14, Test for DisplayName() and SetDisplayName() - -[Test] -title 13.SetGetDisplayName-ValidName -create CVIMPSTStorageContact_UT obj -obj SetGetDisplayName DISPLAYNAME1 -delete obj -[Endtest] - -[Test] -title 14.SetGetDisplayName-NullId -create CVIMPSTStorageContact_UT obj -obj SetGetDisplayName NULL -delete obj -[Endtest] - -// Test Cases 15-16, Test for OnlineStatus() and SetOnlineStatus() - -[Test] -title 15.SetGetPresenceStatus-ValidState -create CVIMPSTStorageContact_UT obj -obj SetGetPresenceStatus ONPHONE -delete obj -[Endtest] - -[Test] -title 16.SetGetPresenceStatus-InValidState -create CVIMPSTStorageContact_UT obj -obj SetGetPresenceStatus NULL -delete obj -[Endtest] - -// Test Cases 17-18, Test for StatusText() and SetStatusText() - -[Test] -title 17.SetGetStatusText-ValidText -create CVIMPSTStorageContact_UT obj -obj SetGetStatusText STATUSTEXT -delete obj -[Endtest] - -[Test] -title 18.SetGetStatusText-NullText -create CVIMPSTStorageContact_UT obj -obj SetGetStatusText NULL -delete obj -[Endtest] - -// Test Cases 19-22, Test for AvatarIndex() and SetAvatarIndex() - -[Test] -title 19.SetGetAvatarIndex-PositiveIndex -create CVIMPSTStorageContact_UT obj -obj SetGetAvatarIndex POSITIVEINDEX -delete obj -[Endtest] - -[Test] -title 20.SetGetAvatarIndex-NegativeIndex -create CVIMPSTStorageContact_UT obj -obj SetGetAvatarIndex NEGATIVEINDEX -delete obj -[Endtest] - -[Test] -title 21.SetGetAvatarIndex-ZeroIndex -create CVIMPSTStorageContact_UT obj -obj SetGetAvatarIndex ZEROINDEX -delete obj -[Endtest] - -[Test] -title 22.SetGetAvatarIndex-NullIndex -create CVIMPSTStorageContact_UT obj -obj SetGetAvatarIndex NULLINDEX -delete obj -[Endtest] - -// Test case 23, Test for ContactLink() - -[Test] -title 23.ContactLink -create CVIMPSTStorageContact_UT obj -obj ContactLink -delete obj -[Endtest] \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/conf/vimpststorage_test.cfg --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/conf/vimpststorage_test.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -[Define] - -ADD_USER_1 storageTest1@domain.com -ADD_USER_2 storageTest2@domain.com -USER_NAME storagetest -USER_ID storage@domain.com - -ADD_DEL_USER storageTestadddel@domain.com -ADD_DEL_USER_NAME storageadddel - -[Enddefine] - -[Test] -title 1.InitialiseLibrary Test -create vimpststorage_test vimpsobj -vimpsobj InitialiseLibraryTest -delete vimpsobj -[Endtest] - -[Test] -title 2.InitialiseView Test -create vimpststorage_test vimpsobj -vimpsobj InitialiseViewTest -delete vimpsobj -[Endtest] - -[Test] -title 3.CVIMPSTStorageContact NewL Test 1 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase1L -delete vimpsobj -[Endtest] - -[Test] -title 4.CVIMPSTStorageContact NewL Test 2 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase2L -delete vimpsobj -[Endtest] - - -[Test] -title 5.CVIMPSTStorageContact NewL Test 3 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase3L -delete vimpsobj -[Endtest] - -[Test] -title 6.CVIMPSTStorageContact NewL Test 4 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase4L -delete vimpsobj -[Endtest] - - -[Test] -title 7.CVIMPSTStorageContact NewL Test 6 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase6L -delete vimpsobj -[Endtest] - - -[Test] -title 8.CVIMPSTStorageContact NewL Test 7 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase7L -delete vimpsobj -[Endtest] - -[Test] -title 9.CVIMPSTStorageContact NewL Test 8 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase8L -delete vimpsobj -[Endtest] - - -[Test] -title 10.CVIMPSTStorageContact NewL Test 9 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase9L -delete vimpsobj -[Endtest] - - -[Test] -title 11.CVIMPSTStorageContact NewL Test 10 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase10L -delete vimpsobj -[Endtest] - -[Test] -title 12.CVIMPSTStorageContact NewL Test 11 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase11L -delete vimpsobj -[Endtest] - -[Test] -title 13.CVIMPSTStorageContact NewL Test 12 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase12L -delete vimpsobj -[Endtest] - - -[Test] -title 14.CVIMPSTStorageContact NewL Test 13 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase13L -delete vimpsobj -[Endtest] - - -[Test] -title 15.CVIMPSTStorageContact NewL Test 14 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase14L -delete vimpsobj -[Endtest] - - -[Test] -title 16.CVIMPSTStorageContact NewL Test 15 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactTestCase15L -delete vimpsobj -[Endtest] - - -[Test] -title 17.CVIMPSTStorageContactList Test 01 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactListTestCase16L -delete vimpsobj -[Endtest] - -[Test] -title 18.CVIMPSTStorageContactList Test 03 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactListTestCase17L -delete vimpsobj -[Endtest] - - -[Test] -title 19.CVIMPSTStorageContactList Test 04 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactListTestCase18L -delete vimpsobj -[Endtest] - - -[Test] -title 20.CVIMPSTStorageContactList Test 05 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactListTestCase19L -delete vimpsobj -[Endtest] - -[Test] -title 21.CVIMPSTStorageContactList Test 06 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactListTestCase20L -delete vimpsobj -[Endtest] - - -[Test] -title 22.CVIMPSTStorageContactList Test 07 -create vimpststorage_test vimpsobj -vimpsobj CVIMPSTStorageContactListTestCase21L -delete vimpsobj -[Endtest] diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/bmarm/cvimpststoragecontact_utu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/bmarm/cvimpststoragecontact_utu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/bwins/cvimpststoragecontact_utu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/bwins/cvimpststoragecontact_utu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - ??0CActive@@IAE@H@Z @ 2 NONAME ; CActive::CActive(int) - ??0CActiveSchedulerWait@@QAE@XZ @ 3 NONAME ; CActiveSchedulerWait::CActiveSchedulerWait(void) - ??0TVPbkContactStoreUriPtr@@QAE@ABVTDesC16@@@Z @ 4 NONAME ; TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(class TDesC16 const &) - ??0TVPbkContactStoreUriPtr@@QAE@XZ @ 5 NONAME ; TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(void) - ??1CActive@@UAE@XZ @ 6 NONAME ; CActive::~CActive(void) - ??1CActiveSchedulerWait@@UAE@XZ @ 7 NONAME ; CActiveSchedulerWait::~CActiveSchedulerWait(void) - ??ACVPbkContactStoreUriArray@@QBE?AVTVPbkContactStoreUriPtr@@H@Z @ 8 NONAME ; class TVPbkContactStoreUriPtr CVPbkContactStoreUriArray::operator[](int) const - ?Add@CActiveScheduler@@SAXPAVCActive@@@Z @ 9 NONAME ; void CActiveScheduler::Add(class CActive *) - ?AddContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 10 NONAME ; void CPbk2StoreConfiguration::AddContactStoreURIL(class TVPbkContactStoreUriPtr) - ?AddDefaultSavingStoreObserverL@CPbk2StoreConfiguration@@QAEXAAVMPbk2DefaultSavingStoreObserver@@@Z @ 11 NONAME ; void CPbk2StoreConfiguration::AddDefaultSavingStoreObserverL(class MPbk2DefaultSavingStoreObserver &) - ?AddObserverL@CPbk2SortOrderManager@@QAEXAAVMPbk2SortOrderObserver@@@Z @ 12 NONAME ; void CPbk2SortOrderManager::AddObserverL(class MPbk2SortOrderObserver &) - ?AddObserverL@CPbk2StoreConfiguration@@QAEXAAVMPbk2StoreConfigurationObserver@@@Z @ 13 NONAME ; void CPbk2StoreConfiguration::AddObserverL(class MPbk2StoreConfigurationObserver &) - ?AddSubViewL@CVPbkContactViewDefinition@@QAEXPAV1@@Z @ 14 NONAME ; void CVPbkContactViewDefinition::AddSubViewL(class CVPbkContactViewDefinition *) - ?AddSupportedContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 15 NONAME ; void CPbk2StoreConfiguration::AddSupportedContactStoreURIL(class TVPbkContactStoreUriPtr) - ?AppendAllL@CVPbkContactStoreUriArray@@QAEXABV1@@Z @ 16 NONAME ; void CVPbkContactStoreUriArray::AppendAllL(class CVPbkContactStoreUriArray const &) - ?AppendL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@@Z @ 17 NONAME ; void CVPbkContactLinkArray::AppendL(class MVPbkContactLink *) - ?AppendL@CVPbkContactStoreUriArray@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 18 NONAME ; void CVPbkContactStoreUriArray::AppendL(class TVPbkContactStoreUriPtr const &) - ?AsyncStop@CActiveSchedulerWait@@QAEXXZ @ 19 NONAME ; void CActiveSchedulerWait::AsyncStop(void) - ?Cancel@CActive@@QAEXXZ @ 20 NONAME ; void CActive::Cancel(void) - ?Cast@MVPbkContactFieldBinaryData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 21 NONAME ; class MVPbkContactFieldBinaryData & MVPbkContactFieldBinaryData::Cast(class MVPbkContactFieldData &) - ?Cast@MVPbkContactFieldBinaryData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 22 NONAME ; class MVPbkContactFieldBinaryData const & MVPbkContactFieldBinaryData::Cast(class MVPbkContactFieldData const &) - ?Cast@MVPbkContactFieldTextData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 23 NONAME ; class MVPbkContactFieldTextData & MVPbkContactFieldTextData::Cast(class MVPbkContactFieldData &) - ?Cast@MVPbkContactFieldTextData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 24 NONAME ; class MVPbkContactFieldTextData const & MVPbkContactFieldTextData::Cast(class MVPbkContactFieldData const &) - ?Cast@MVPbkContactFieldUriData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 25 NONAME ; class MVPbkContactFieldUriData & MVPbkContactFieldUriData::Cast(class MVPbkContactFieldData &) - ?Cast@MVPbkContactFieldUriData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 26 NONAME ; class MVPbkContactFieldUriData const & MVPbkContactFieldUriData::Cast(class MVPbkContactFieldData const &) - ?CommitContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABV?$TArray@PAVMVPbkStoreContact@@@@AAVMVPbkBatchOperationObserver@@@Z @ 27 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CommitContactsL(class TArray const &, class MVPbkBatchOperationObserver &) - ?Compare@TVPbkContactStoreUriPtr@@QBEHABV1@W4TVPbkContactStoreUriComponent@1@@Z @ 28 NONAME ; int TVPbkContactStoreUriPtr::Compare(class TVPbkContactStoreUriPtr const &, enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?Compare@TVPbkContactStoreUriPtr@@QBEHABVTDesC16@@W4TVPbkContactStoreUriComponent@1@@Z @ 29 NONAME ; int TVPbkContactStoreUriPtr::Compare(class TDesC16 const &, enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?Component@TVPbkContactStoreUriPtr@@QBE?BVTPtrC16@@W4TVPbkContactStoreUriComponent@1@@Z @ 30 NONAME ; class TPtrC16 const TVPbkContactStoreUriPtr::Component(enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?CompressStoresL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@AAVMVPbkBatchOperationObserver@@@Z @ 31 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CompressStoresL(class MVPbkBatchOperationObserver &) - ?ContactAttributeManagerL@CVPbkContactManager@@QAEAAVMVPbkContactAttributeManager@@XZ @ 32 NONAME ; class MVPbkContactAttributeManager & CVPbkContactManager::ContactAttributeManagerL(void) - ?ContactSelector@CVPbkContactViewDefinition@@QBEPAVMVPbkContactSelector@@XZ @ 33 NONAME ; class MVPbkContactSelector * CVPbkContactViewDefinition::ContactSelector(void) const - ?ContactStoresL@CVPbkContactManager@@QAEAAVMVPbkContactStoreList@@XZ @ 34 NONAME ; class MVPbkContactStoreList & CVPbkContactManager::ContactStoresL(void) - ?CopyContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMVPbkContactLinkArray@@PAVMVPbkContactStore@@AAVMVPbkBatchOperationObserver@@@Z @ 35 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CopyContactsL(class MVPbkContactLinkArray const &, class MVPbkContactStore *, class MVPbkBatchOperationObserver &) - ?Count@CVPbkContactStoreUriArray@@QBEHXZ @ 36 NONAME ; int CVPbkContactStoreUriArray::Count(void) const - ?CreateContactViewLC@CVPbkContactManager@@QBEPAVMVPbkContactViewBase@@AAVMVPbkContactViewObserver@@ABVCVPbkContactViewDefinition@@ABVMVPbkFieldTypeList@@@Z @ 37 NONAME ; class MVPbkContactViewBase * CVPbkContactManager::CreateContactViewLC(class MVPbkContactViewObserver &, class CVPbkContactViewDefinition const &, class MVPbkFieldTypeList const &) const - ?CreateLinksLC@CVPbkContactManager@@QBEPAVMVPbkContactLinkArray@@AAVRReadStream@@@Z @ 38 NONAME ; class MVPbkContactLinkArray * CVPbkContactManager::CreateLinksLC(class RReadStream &) const - ?CreateLinksLC@CVPbkContactManager@@QBEPAVMVPbkContactLinkArray@@ABVTDesC8@@@Z @ 39 NONAME ; class MVPbkContactLinkArray * CVPbkContactManager::CreateLinksLC(class TDesC8 const &) const - ?CurrentConfigurationL@CPbk2StoreConfiguration@@QBEPAVCVPbkContactStoreUriArray@@XZ @ 40 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::CurrentConfigurationL(void) const - ?CurrentSeparator@CPbk2SortOrderManager@@QBEABVTDesC16@@XZ @ 41 NONAME ; class TDesC16 const & CPbk2SortOrderManager::CurrentSeparator(void) const - ?DefaultCntDbUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 42 NONAME ; class TDesC16 const & VPbkContactStoreUris::DefaultCntDbUri(void) - ?DefaultSavingStoreL@CPbk2StoreConfiguration@@QBE?AVTVPbkContactStoreUriPtr@@XZ @ 43 NONAME ; class TVPbkContactStoreUriPtr CPbk2StoreConfiguration::DefaultSavingStoreL(void) const - ?DefaultSeparator@CPbk2SortOrderManager@@QAEABVTDesC16@@XZ @ 44 NONAME ; class TDesC16 const & CPbk2SortOrderManager::DefaultSeparator(void) - ?Delete@CVPbkContactLinkArray@@QAEXH@Z @ 45 NONAME ; void CVPbkContactLinkArray::Delete(int) - ?DeleteContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMVPbkContactLinkArray@@AAVMVPbkBatchOperationObserver@@@Z @ 46 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::DeleteContactsL(class MVPbkContactLinkArray const &, class MVPbkBatchOperationObserver &) - ?Deque@CActive@@QAEXXZ @ 47 NONAME ; void CActive::Deque(void) - ?Extension_@CActive@@MAEHIAAPAXPAX@Z @ 48 NONAME ; int CActive::Extension_(unsigned int, void * &, void *) - ?ExternalizeL@TVPbkContactStoreUriPtr@@UBEXAAVRWriteStream@@@Z @ 49 NONAME ; void TVPbkContactStoreUriPtr::ExternalizeL(class RWriteStream &) const - ?ExternalizedSize@TVPbkContactStoreUriPtr@@UBEHXZ @ 50 NONAME ; int TVPbkContactStoreUriPtr::ExternalizedSize(void) const - ?FieldTypeFilter@CVPbkContactViewDefinition@@QBEPAVCVPbkFieldTypeSelector@@XZ @ 51 NONAME ; class CVPbkFieldTypeSelector * CVPbkContactViewDefinition::FieldTypeFilter(void) const - ?FieldTypes@CVPbkContactManager@@QBEABVMVPbkFieldTypeList@@XZ @ 52 NONAME ; class MVPbkFieldTypeList const & CVPbkContactManager::FieldTypes(void) const - ?FindL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMDesC16Array@@ABVMVPbkFieldTypeList@@AAVMVPbkContactFindFromStoresObserver@@ABVTCallBack@@@Z @ 53 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::FindL(class MDesC16Array const &, class MVPbkFieldTypeList const &, class MVPbkContactFindFromStoresObserver &, class TCallBack const &) - ?FindL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVTDesC16@@ABVMVPbkFieldTypeList@@AAVMVPbkContactFindObserver@@@Z @ 54 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::FindL(class TDesC16 const &, class MVPbkFieldTypeList const &, class MVPbkContactFindObserver &) - ?FlagIsOn@CVPbkContactViewDefinition@@QBEHW4TVPbkContactViewFlag@@@Z @ 55 NONAME ; int CVPbkContactViewDefinition::FlagIsOn(enum TVPbkContactViewFlag) const - ?FsSession@CVPbkContactManager@@QAEAAVRFs@@XZ @ 56 NONAME ; class RFs & CVPbkContactManager::FsSession(void) - ?Id@CVPbkContactViewDefinition@@QBEHXZ @ 57 NONAME ; int CVPbkContactViewDefinition::Id(void) const - ?InsertL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@H@Z @ 58 NONAME ; void CVPbkContactLinkArray::InsertL(class MVPbkContactLink *, int) - ?IsIncluded@CVPbkContactStoreUriArray@@QBEHABVTVPbkContactStoreUriPtr@@@Z @ 59 NONAME ; int CVPbkContactStoreUriArray::IsIncluded(class TVPbkContactStoreUriPtr const &) const - ?Length@TVPbkContactStoreUriPtr@@QBEHXZ @ 60 NONAME ; int TVPbkContactStoreUriPtr::Length(void) const - ?LoadContactStoreL@CVPbkContactManager@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 61 NONAME ; void CVPbkContactManager::LoadContactStoreL(class TVPbkContactStoreUriPtr const &) - ?MatchPhoneNumberL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVTDesC16@@HAAVMVPbkContactFindObserver@@@Z @ 62 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::MatchPhoneNumberL(class TDesC16 const &, int, class MVPbkContactFindObserver &) - ?Name@CVPbkContactViewDefinition@@QBEABVTDesC16@@XZ @ 63 NONAME ; class TDesC16 const & CVPbkContactViewDefinition::Name(void) const - ?NameDisplayOrder@CPbk2SortOrderManager@@QBE?AW4TPbk2NameDisplayOrder@1@XZ @ 64 NONAME ; enum CPbk2SortOrderManager::TPbk2NameDisplayOrder CPbk2SortOrderManager::NameDisplayOrder(void) const - ?NewL@CPbk2SortOrderManager@@SAPAV1@ABVMVPbkFieldTypeList@@PAVRFs@@@Z @ 65 NONAME ; class CPbk2SortOrderManager * CPbk2SortOrderManager::NewL(class MVPbkFieldTypeList const &, class RFs *) - ?NewL@CPbk2StoreConfiguration@@SAPAV1@XZ @ 66 NONAME ; class CPbk2StoreConfiguration * CPbk2StoreConfiguration::NewL(void) - ?NewL@CVPbkContactLinkArray@@SAPAV1@XZ @ 67 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewL(void) - ?NewL@CVPbkContactManager@@SAPAV1@ABVCVPbkContactStoreUriArray@@PAVRFs@@@Z @ 68 NONAME ; class CVPbkContactManager * CVPbkContactManager::NewL(class CVPbkContactStoreUriArray const &, class RFs *) - ?NewL@CVPbkContactManager@@SAPAV1@VTSecurityInfo@@ABVCVPbkContactStoreUriArray@@PAVRFs@@@Z @ 69 NONAME ; class CVPbkContactManager * CVPbkContactManager::NewL(class TSecurityInfo, class CVPbkContactStoreUriArray const &, class RFs *) - ?NewL@CVPbkContactStoreUriArray@@SAPAV1@XZ @ 70 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewL(void) - ?NewL@CVPbkContactViewDefinition@@SAPAV1@AAVTResourceReader@@@Z @ 71 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(class TResourceReader &) - ?NewL@CVPbkContactViewDefinition@@SAPAV1@ABV1@@Z @ 72 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(class CVPbkContactViewDefinition const &) - ?NewL@CVPbkContactViewDefinition@@SAPAV1@XZ @ 73 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(void) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@AAVRReadStream@@ABVMVPbkContactStoreList@@@Z @ 74 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class RReadStream &, class MVPbkContactStoreList const &) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@ABVTDesC8@@ABVMVPbkContactStoreList@@@Z @ 75 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class TDesC8 const &, class MVPbkContactStoreList const &) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@XZ @ 76 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(void) - ?NewLC@CVPbkContactStoreUriArray@@SAPAV1@ABVTDesC8@@@Z @ 77 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewLC(class TDesC8 const &) - ?NewLC@CVPbkContactStoreUriArray@@SAPAV1@XZ @ 78 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewLC(void) - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@AAVTResourceReader@@@Z @ 79 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(class TResourceReader &) - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@ABV1@@Z @ 80 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(class CVPbkContactViewDefinition const &) - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@XZ @ 81 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(void) - ?PackLC@CVPbkContactStoreUriArray@@QBEPAVHBufC8@@XZ @ 82 NONAME ; class HBufC8 * CVPbkContactStoreUriArray::PackLC(void) const - ?PackedBufferSize@CVPbkContactLinkArray@@QBEHXZ @ 83 NONAME ; int CVPbkContactLinkArray::PackedBufferSize(void) const - ?Pbk2AppUi@Phonebook2@@YAPAVMPbk2AppUi@@XZ @ 84 NONAME ; class MPbk2AppUi * Phonebook2::Pbk2AppUi(void) - ?Remove@CVPbkContactLinkArray@@QAEXH@Z @ 85 NONAME ; void CVPbkContactLinkArray::Remove(int) - ?Remove@CVPbkContactStoreUriArray@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 86 NONAME ; void CVPbkContactStoreUriArray::Remove(class TVPbkContactStoreUriPtr const &) - ?RemoveContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 87 NONAME ; void CPbk2StoreConfiguration::RemoveContactStoreURIL(class TVPbkContactStoreUriPtr) - ?RemoveDefaultSavingStoreObserver@CPbk2StoreConfiguration@@QAEXAAVMPbk2DefaultSavingStoreObserver@@@Z @ 88 NONAME ; void CPbk2StoreConfiguration::RemoveDefaultSavingStoreObserver(class MPbk2DefaultSavingStoreObserver &) - ?RemoveObserver@CPbk2SortOrderManager@@QAEXAAVMPbk2SortOrderObserver@@@Z @ 89 NONAME ; void CPbk2SortOrderManager::RemoveObserver(class MPbk2SortOrderObserver &) - ?RemoveObserver@CPbk2StoreConfiguration@@QAEXAAVMPbk2StoreConfigurationObserver@@@Z @ 90 NONAME ; void CPbk2StoreConfiguration::RemoveObserver(class MPbk2StoreConfigurationObserver &) - ?RemoveSupportedContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 91 NONAME ; void CPbk2StoreConfiguration::RemoveSupportedContactStoreURIL(class TVPbkContactStoreUriPtr) - ?Reset@CVPbkContactLinkArray@@QAEXXZ @ 92 NONAME ; void CVPbkContactLinkArray::Reset(void) - ?ResetAndDestroy@CVPbkContactLinkArray@@QAEXXZ @ 93 NONAME ; void CVPbkContactLinkArray::ResetAndDestroy(void) - ?RetrieveContactL@CVPbkContactManager@@QBEPAVMVPbkContactOperationBase@@ABVMVPbkContactLink@@AAVMVPbkSingleContactOperationObserver@@@Z @ 94 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::RetrieveContactL(class MVPbkContactLink const &, class MVPbkSingleContactOperationObserver &) const - ?RunError@CActive@@MAEHH@Z @ 95 NONAME ; int CActive::RunError(int) - ?SearchStoreConfigurationL@CPbk2StoreConfiguration@@QAEPAVCVPbkContactStoreUriArray@@XZ @ 96 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::SearchStoreConfigurationL(void) - ?Set@TVPbkContactStoreUriPtr@@QAEXABV1@@Z @ 97 NONAME ; void TVPbkContactStoreUriPtr::Set(class TVPbkContactStoreUriPtr const &) - ?SetActive@CActive@@IAEXXZ @ 98 NONAME ; void CActive::SetActive(void) - ?SetContactSelector@CVPbkContactViewDefinition@@QAEXPAVMVPbkContactSelector@@@Z @ 99 NONAME ; void CVPbkContactViewDefinition::SetContactSelector(class MVPbkContactSelector *) - ?SetContactViewL@CPbk2SortOrderManager@@QAEXAAVMVPbkContactViewBase@@@Z @ 100 NONAME ; void CPbk2SortOrderManager::SetContactViewL(class MVPbkContactViewBase &) - ?SetFieldTypeFilterL@CVPbkContactViewDefinition@@QAEXPAVCVPbkFieldTypeSelector@@@Z @ 101 NONAME ; void CVPbkContactViewDefinition::SetFieldTypeFilterL(class CVPbkFieldTypeSelector *) - ?SetFlag@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewFlag@@H@Z @ 102 NONAME ; void CVPbkContactViewDefinition::SetFlag(enum TVPbkContactViewFlag, int) - ?SetId@CVPbkContactViewDefinition@@QAEXH@Z @ 103 NONAME ; void CVPbkContactViewDefinition::SetId(int) - ?SetNameDisplayOrderL@CPbk2SortOrderManager@@QAEXW4TPbk2NameDisplayOrder@1@ABVTDesC16@@@Z @ 104 NONAME ; void CPbk2SortOrderManager::SetNameDisplayOrderL(enum CPbk2SortOrderManager::TPbk2NameDisplayOrder, class TDesC16 const &) - ?SetNameL@CVPbkContactViewDefinition@@QAEXABVTDesC16@@@Z @ 105 NONAME ; void CVPbkContactViewDefinition::SetNameL(class TDesC16 const &) - ?SetPriority@CActive@@QAEXH@Z @ 106 NONAME ; void CActive::SetPriority(int) - ?SetSharing@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewSharing@@@Z @ 107 NONAME ; void CVPbkContactViewDefinition::SetSharing(enum TVPbkContactViewSharing) - ?SetSortPolicy@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewSortPolicy@@@Z @ 108 NONAME ; void CVPbkContactViewDefinition::SetSortPolicy(enum TVPbkContactViewSortPolicy) - ?SetType@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewType@@@Z @ 109 NONAME ; void CVPbkContactViewDefinition::SetType(enum TVPbkContactViewType) - ?SetUriL@CVPbkContactViewDefinition@@QAEXABVTDesC16@@@Z @ 110 NONAME ; void CVPbkContactViewDefinition::SetUriL(class TDesC16 const &) - ?Sharing@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewSharing@@XZ @ 111 NONAME ; enum TVPbkContactViewSharing CVPbkContactViewDefinition::Sharing(void) const - ?SimGlobalAdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 112 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalAdnUri(void) - ?SimGlobalFdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 113 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalFdnUri(void) - ?SimGlobalOwnNumberUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 114 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalOwnNumberUri(void) - ?SimGlobalSdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 115 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalSdnUri(void) - ?SortOrder@CPbk2SortOrderManager@@QBEABVMVPbkFieldTypeList@@XZ @ 116 NONAME ; class MVPbkFieldTypeList const & CPbk2SortOrderManager::SortOrder(void) const - ?SortPolicy@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewSortPolicy@@XZ @ 117 NONAME ; enum TVPbkContactViewSortPolicy CVPbkContactViewDefinition::SortPolicy(void) const - ?Start@CActiveSchedulerWait@@QAEXXZ @ 118 NONAME ; void CActiveSchedulerWait::Start(void) - ?Start@CPeriodic@@QAEXVTTimeIntervalMicroSeconds32@@0VTCallBack@@@Z @ 119 NONAME ; void CPeriodic::Start(class TTimeIntervalMicroSeconds32, class TTimeIntervalMicroSeconds32, class TCallBack) - ?SubViewAt@CVPbkContactViewDefinition@@QAEAAV1@H@Z @ 120 NONAME ; class CVPbkContactViewDefinition & CVPbkContactViewDefinition::SubViewAt(int) - ?SubViewAt@CVPbkContactViewDefinition@@QBEABV1@H@Z @ 121 NONAME ; class CVPbkContactViewDefinition const & CVPbkContactViewDefinition::SubViewAt(int) const - ?SubViewCount@CVPbkContactViewDefinition@@QBEHXZ @ 122 NONAME ; int CVPbkContactViewDefinition::SubViewCount(void) const - ?SupportedStoreConfigurationL@CPbk2StoreConfiguration@@QBEPAVCVPbkContactStoreUriArray@@XZ @ 123 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::SupportedStoreConfigurationL(void) const - ?Type@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewType@@XZ @ 124 NONAME ; enum TVPbkContactViewType CVPbkContactViewDefinition::Type(void) const - ?Uri@CVPbkContactViewDefinition@@QBEABVTDesC16@@XZ @ 125 NONAME ; class TDesC16 const & CVPbkContactViewDefinition::Uri(void) const - ?UriDes@TVPbkContactStoreUriPtr@@QBEABVTDesC16@@XZ @ 126 NONAME ; class TDesC16 const & TVPbkContactStoreUriPtr::UriDes(void) const - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/eabi/cvimpststoragecontact_utu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/eabi/cvimpststoragecontact_utu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/group/CVIMPSTStorageContact_UT_DoxyFile.txt --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/group/CVIMPSTStorageContact_UT_DoxyFile.txt Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -# 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: MMP file for STIF Test Framework's TestScripter -# testclass test module. -# -# - -# Doxyfile 1.4.1 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = CVIMPSTStorageContact_UT -PROJECT_NUMBER = -OUTPUT_DIRECTORY = J:/testsetups/CVIMPSTStorageContact_UT/ -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = YES -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = NO -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = NO -GENERATE_TESTLIST = NO -GENERATE_BUGLIST = NO -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = J:/testsetups/CVIMPSTStorageContact_UT/ -FILE_PATTERNS = *.h / - *.rh / - *.hrh -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = NO -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = YES -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = YES -TOC_EXPAND = YES -DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = YES -RTF_OUTPUT = Doc -COMPACT_RTF = YES -RTF_HYPERLINKS = YES -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = NONSHARABLE_CLASS -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/group/bld.inf --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* 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: -: -* -*/ - - - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these - - DEFAULT - -PRJ_TESTEXPORTS -// NOTE: If using ARS requirements all export operations should be done under this. -// 'abld test export' - -PRJ_EXPORTS - -PRJ_TESTMMPFILES - - cvimpststoragecontact_ut.mmp - -PRJ_MMPFILES - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/group/cvimpststoragecontact_ut.mmp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/group/cvimpststoragecontact_ut.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: cvimpststoragecontact_ut.dll -* -*/ - - -#include - -TARGET CVIMPSTStorageContact_UT.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -EPOCALLOWDLLDATA -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE cvimpststoragecontact_ut.def - -USERINCLUDE ../inc -USERINCLUDE ../../stubs -USERINCLUDE ../../../../inc -USERINCLUDE ../../../../../inc - -//OS_LAYER_SYSTEMINCLUDE -APP_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../../../../src - -SOURCE cvimpststoragecontact.cpp - -SOURCEPATH ../src - -SOURCE CVIMPSTStorageContact_UT.cpp -SOURCE CVIMPSTStorageContact_UTBlocks.cpp - -SOURCEPATH ../../stubs - -//stubs -SOURCE s_MVPbkContactFieldTextData.cpp -SOURCE s_MVPbkContactFieldUriData.cpp -SOURCE s_MVPbkContactFieldBinaryData.cpp -SOURCE s_CVPbkContactManager.cpp -SOURCE s_MVPbkContactLinkstub.cpp -SOURCE CVPbkContactStoreUriArrayStub.cpp -SOURCE CVPbkStoreContactStub.cpp -SOURCE s_CVPbkBaseContactFieldCollection.cpp -SOURCE s_CVPbkStoreContactField.cpp -SOURCE s_CVPbkContactStoreList.cpp -SOURCE s_CVPbkContactViewDefinition.cpp -SOURCE s_CVPbkContactView.cpp -SOURCE s_CPbk2SortOrderManager.cpp -SOURCE s_TVPbkContactStoreUriPtr.cpp -SOURCE s_CVPbkContactLinkArray.cpp -SOURCE s_VPbkContactStoreUris.cpp -SOURCE pbkuistubs.cpp -SOURCE s_cactive.cpp -SOURCE s_CPBK2StoreConfiguration.cpp - - -//RESOURCE resource_file -//RESOURCE resource_file2 - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/group/vimpststorage_test.pkg --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/group/vimpststorage_test.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -; -; 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: package file for vimpststorage_test -; -;Header -#{"vimpststorage_test"}, (0x101FB3E3), 1, 2, 3, TYPE=SP - -;Language - standard language definitions -&EN - -;Vendor ID -:"Nokia Corporation" - -;Localised vendor -%{"Vendor-EN"} - -;Supports Series 60 v 0.9 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - - -;INI FILE -; ttestframework , because rom will not allow to update , rename it -; after install to testframework.ini - -"..\..\init\testframework.ini" - "c:\Testframework\testframework.ini" - -;CFG FILES - "..\..\conf\CVIMPSTStorageContact_UT.cfg" -"c:\Testframework\CVIMPSTStorageContact_UT.cfg" - "..\..\conf\CVIMPSTStorageContactList_UT.cfg" -"c:\Testframework\CVIMPSTStorageContactList_UT.cfg" - "..\..\conf\CVIMPSTStorageContactSorter_UT.cfg" -"c:\Testframework\CVIMPSTStorageContactSorter_UT.cfg" - -;vimststorage_test dll files - "\epoc32\release\armv5\urel\CVIMPSTStorageContact_UT.dll" - "!:\Sys\Bin\CVIMPSTStorageContact_UT.dll" - "\epoc32\release\armv5\urel\CVIMPSTStorageContactList_UT.dll" - "!:\Sys\Bin\CVIMPSTStorageContactList_UT.dll" - "\epoc32\release\armv5\urel\CVIMPSTStorageContactSorter_UT.dll" - "!:\Sys\Bin\CVIMPSTStorageContactSorter_UTs.dll" \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/inc/CVIMPSTStorageContact_UT.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/inc/CVIMPSTStorageContact_UT.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* 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: -: -* -*/ - - - -#ifndef CVIMPSTSTORAGECONTACT_UT_H -#define CVIMPSTSTORAGECONTACT_UT_H - -// INCLUDES -#include -#include -#include -#include - -#define TEST_CLASS_VERSION_MAJOR 0 -#define TEST_CLASS_VERSION_MINOR 0 -#define TEST_CLASS_VERSION_BUILD 0 - -// Logging path -_LIT( KCVIMPSTStorageContact_UTLogPath, "//logs//testframework//CVIMPSTStorageContact_UT//" ); -// Log file -_LIT( KCVIMPSTStorageContact_UTLogFile, "CVIMPSTStorageContact_UT.txt" ); -_LIT( KCVIMPSTStorageContact_UTLogFileWithTitle, "CVIMPSTStorageContact_UT_[%S].txt" ); - -class CCVIMPSTStorageContact_UT; - - -/** -* CCVIMPSTStorageContact_UT test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS(CCVIMPSTStorageContact_UT) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CCVIMPSTStorageContact_UT* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~CCVIMPSTStorageContact_UT(); - - public: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - /* - * Test case to test NewL function - */ - TInt Test_NewL( CStifItemParser& aItem ); - - /* - * This is a test function. - * It tests getting and setting userid for a contact. - */ - TInt Test_SetUserId_UserIdL( CStifItemParser& aItem ); - - /* - * This is a test function. - * It tests getting and setting avatar content. - */ - TInt Test_AvatarContentL( CStifItemParser& aItem ); - - /* - * This is a test function. - * It tests getting and setting displayName for a contact. - */ - TInt Test_DisplayNameL( CStifItemParser& aItem ); - - /* - * This is a test function. - * It tests getting and setting the presence status for a contact. - */ - TInt Test_PresenceStatusL( CStifItemParser& aItem ); - - /* - * This is a test function. - * It tests getting and setting the status text for a contact. - */ - TInt Test_StatusTextL( CStifItemParser& aItem ); - - /* - * This is a test function. - * It tests getting and setting the avatar index for a contact. - */ - TInt Test_AvatarIndexL( CStifItemParser& aItem ); - - /* - * This is test function. - * It tests the getting ContactLink functionality for a contact. - */ - TInt Test_ContactLinkL( CStifItemParser& aItem ); - - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - - private: - - /** - * C++ default constructor. - */ - CCVIMPSTStorageContact_UT( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - /** - * Test methods are listed below. - */ - - /** - * Method used to log version of test class - */ - void SendTestClassVersion(); - - //ADD NEW METHOD DEC HERE - //[TestMethods] - Do not remove - - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - private: // Data - - // ?one_line_short_description_of_data - //?data_declaration; - - // Reserved pointer for future extension - //TAny* iReserved; - - public: // Friend classes - //?friend_class_declaration; - protected: // Friend classes - //?friend_class_declaration; - private: // Friend classes - //?friend_class_declaration; - - }; - -#endif // CVIMPSTSTORAGECONTACT_UT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/src/CVIMPSTStorageContact_UT.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/src/CVIMPSTStorageContact_UT.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +0,0 @@ -/* -* 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 FILES -#include -#include "CVIMPSTStorageContact_UT.h" -#include -#include "vimpstdebugtrace.h" - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContact_UT::CCVIMPSTStorageContact_UT -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCVIMPSTStorageContact_UT::CCVIMPSTStorageContact_UT( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContact_UT::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCVIMPSTStorageContact_UT::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(KCVIMPSTStorageContact_UTLogFileWithTitle, &title); - } - else - { - logFileName.Copy(KCVIMPSTStorageContact_UTLogFile); - } - - iLog = CStifLogger::NewL( KCVIMPSTStorageContact_UTLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - SendTestClassVersion(); - } - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContact_UT::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCVIMPSTStorageContact_UT* CCVIMPSTStorageContact_UT::NewL( - CTestModuleIf& aTestModuleIf ) - { - CCVIMPSTStorageContact_UT* self = new (ELeave) CCVIMPSTStorageContact_UT( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -CCVIMPSTStorageContact_UT::~CCVIMPSTStorageContact_UT() - { - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - } - -//----------------------------------------------------------------------------- -// CCVIMPSTStorageContact_UT::SendTestClassVersion -// Method used to send version of test class -//----------------------------------------------------------------------------- -// -void CCVIMPSTStorageContact_UT::SendTestClassVersion() - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; - moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; - moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; - - TFileName moduleName; - moduleName = _L("CVIMPSTStorageContact_UT.dll"); - - TBool newVersionOfMethod = ETrue; - TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) CCVIMPSTStorageContact_UT::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/src/CVIMPSTStorageContact_UTBlocks.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontact_ut/src/CVIMPSTStorageContact_UTBlocks.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,492 +0,0 @@ -/* -* 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 FILES] - do not remove -#include -#include -#include -#include "CVIMPSTStorageContact_UT.h" -#include "mvimpststoragecontact.h" -#include "cvimpststoragecontact.h" -//#include -#include "s_MVPbkContactLinkstub.h" - -_LIT( KUserName, "nokia@nokia.com" ); -_LIT( KDisplayName, "connectingpeople" ); -_LIT( KUserName1, "sonyericsson@sony.com" ); - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContact_UT::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void CCVIMPSTStorageContact_UT::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContact_UT::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt CCVIMPSTStorageContact_UT::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - //ENTRY( "Example", CCVIMPSTStorageContact_UT::ExampleL ), - ENTRY( "CreateStorageContact", CCVIMPSTStorageContact_UT::Test_NewL ), - ENTRY( "SetGetUserId", CCVIMPSTStorageContact_UT::Test_SetUserId_UserIdL ), - ENTRY( "SetAvatarContent", CCVIMPSTStorageContact_UT::Test_AvatarContentL ), - ENTRY( "SetGetDisplayName", CCVIMPSTStorageContact_UT::Test_DisplayNameL ), - ENTRY( "SetGetPresenceStatus", CCVIMPSTStorageContact_UT::Test_PresenceStatusL ), - ENTRY( "SetGetStatusText", CCVIMPSTStorageContact_UT::Test_StatusTextL ), - ENTRY( "SetGetAvatarIndex", CCVIMPSTStorageContact_UT::Test_AvatarIndexL ), - ENTRY( "ContactLink", CCVIMPSTStorageContact_UT::Test_ContactLinkL ), - //ADD NEW ENTRY HERE SetGetAvatarIndex - // [test cases entries] - Do not remove - - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageContact_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContact_UT::Test_NewL( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - TPtrC userId; - aItem.GetNextString( userId ); - - if( userId.Compare( _L("null") ) == 0 ) - { - userId.Set( KNullDesC ); - } - - TPtrC displayName; - aItem.GetNextString( displayName ); - if( displayName.Compare( _L("null") ) == 0 ) - { - displayName.Set( KNullDesC ); - } - - TPtrC contactLinkFlag; - aItem.GetNextString( contactLinkFlag ); - CVIMPSTStorageContact* contact = NULL; - MVPbkContactLink* contactLink = NULL; - HBufC8* aAvatarContent = NULL; - if( contactLinkFlag.Compare( _L("CLINK")) == 0) - { - contact = CVIMPSTStorageContact::NewL( userId, displayName, *contactLink,*aAvatarContent ); - } - else - { - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - } - if( contact ) - { - result = KErrNone; - } - - return result; - - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageContact_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContact_UT::Test_SetUserId_UserIdL( CStifItemParser& aItem ) - { - - TInt result = KErrGeneral; - - TBuf<64> userId; - userId.Copy( KUserName ); - - TBuf<64> displayName; - displayName.Copy( KDisplayName ); - - TPtrC input; - TPtrC output; - - CVIMPSTStorageContact* contact = NULL; - - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - - if( contact ) - { - - aItem.GetNextString( input ); - - if( input.Compare(_L("null")) == 0 ) - { - input.Set( KNullDesC ); - contact->SetUserIdL( KNullDesC ); - } - else - { - contact->SetUserIdL( input ); - } - - output.Set(contact->UserId()); - - if( input.Compare( output ) == 0 ) - { - result = KErrNone; - } - - } - - return result; - - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageContact_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContact_UT::Test_AvatarContentL( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TBuf<64> userId; - userId.Copy( KUserName ); - - TBuf<64> displayName; - displayName.Copy( KDisplayName ); - - TPtrC tempInput; - - TBuf8<256> input; - - TPtrC8 output; - - CVIMPSTStorageContact* contact = NULL; - MVIMPSTStorageVPbkContactStore* VPbkContactStore = NULL; - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - - if( contact ) - { - aItem.GetNextString( tempInput ); - - input.Copy( tempInput ); - - if( input.Compare(_L8("null")) == 0 ) - { - input.Copy( KNullDesC ); - } - else - { - contact->SetAvatarContentL( input, *VPbkContactStore ); - } - - output.Set( contact->AvatarContent() ); - - if( input.Compare( output ) == 0 ) - { - result = KErrNone; - } - - } - return result; - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageContact_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContact_UT::Test_DisplayNameL( CStifItemParser& aItem) - { - TInt result = KErrGeneral; - - TBuf<64> userId; - userId.Copy( KUserName ); - - TBuf<64> displayName; - displayName.Copy( KDisplayName ); - - TPtrC input; - TPtrC output; - - CVIMPSTStorageContact* contact = NULL; - - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - - if( contact ) - { - - aItem.GetNextString( input ); - - if( input.Compare(_L("null")) == 0 ) - { - input.Set( KNullDesC ); - } - contact->SetNameL( input ); - output.Set(contact->Name()); - - if( input.Compare( output ) == 0 ) - { - result = KErrNone; - } - - } - - return result; - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageContact_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContact_UT::Test_PresenceStatusL( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TBuf<64> userId; - userId.Copy( KUserName ); - - TBuf<64> displayName; - displayName.Copy( KDisplayName ); - - TPtrC input; - TVIMPSTEnums::TOnlineStatus inputState,outputState; - - CVIMPSTStorageContact* contact = NULL; - - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - - if( contact ) - { - aItem.GetNextString( input ); - - if( input.Compare( _L("EOnPhone") ) == 0 ) - { - inputState = TVIMPSTEnums::EOnPhone; - contact->SetOnlineStatus( inputState ); - } - else - { - inputState = TVIMPSTEnums::EUnknown; - } - outputState = contact->OnlineStatus(); - - if( inputState == outputState ) - { - result = KErrNone; - } - } - return result; - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageContact_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContact_UT::Test_StatusTextL( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TBuf<64> userId; - userId.Copy( KUserName ); - - TBuf<64> displayName; - displayName.Copy( KDisplayName ); - - TPtrC input; - TPtrC output; - - CVIMPSTStorageContact* contact = NULL; - - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - - if( contact ) - { - - aItem.GetNextString( input ); - - if( input.Compare(_L("null")) == 0 ) - { - input.Set( KNullDesC ); - } - else - { - contact->SetStatusTextL( input ); - } - - output.Set(contact->StatusText()); - - if( input.Compare( output ) == 0 ) - { - result = KErrNone; - } - - } - - return result; - - - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageContact_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContact_UT::Test_AvatarIndexL( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TBuf<64> userId; - userId.Copy( KUserName ); - - TBuf<64> displayName; - displayName.Copy( KDisplayName ); - - TInt input; - TInt output; - - CVIMPSTStorageContact* contact = NULL; - - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - - - if( contact ) - { - - aItem.GetNextInt( input ); - - if( input != -1 ) - contact->SetAvatarIndex( input ); - - output = contact->AvatarIndex(); - - if( input == output ) - { - result = KErrNone; - } - - } - - return result; - - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageContact_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContact_UT::Test_ContactLinkL( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TBuf<64> userId; - userId.Copy( KUserName ); - - TBuf<64> displayName; - displayName.Copy( KDisplayName ); - - TInt output; - - CVIMPSTStorageContact* contact = NULL; - - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - - - if( contact ) - { - - MVPbkContactLink * link = contact->ContactLink(); - - if( link == NULL ) - result = KErrNone; - - } - - return result; - - } - - -// [End of File] - Do not remove diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/bmarm/cvimpststoragecontactlist_utu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/bmarm/cvimpststoragecontactlist_utu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/bwins/cvimpststoragecontactlist_utu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/bwins/cvimpststoragecontactlist_utu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - ?RemoveObserver@CPbk2StoreConfiguration@@QAEXAAVMPbk2StoreConfigurationObserver@@@Z @ 2 NONAME ; void CPbk2StoreConfiguration::RemoveObserver(class MPbk2StoreConfigurationObserver &) - ?FieldTypeFilter@CVPbkContactViewDefinition@@QBEPAVCVPbkFieldTypeSelector@@XZ @ 3 NONAME ; class CVPbkFieldTypeSelector * CVPbkContactViewDefinition::FieldTypeFilter(void) const - ?SubViewAt@CVPbkContactViewDefinition@@QAEAAV1@H@Z @ 4 NONAME ; class CVPbkContactViewDefinition & CVPbkContactViewDefinition::SubViewAt(int) - ?RunError@CActive@@MAEHH@Z @ 5 NONAME ; int CActive::RunError(int) - ?UriDes@TVPbkContactStoreUriPtr@@QBEABVTDesC16@@XZ @ 6 NONAME ; class TDesC16 const & TVPbkContactStoreUriPtr::UriDes(void) const - ?NewL@CPbk2SortOrderManager@@SAPAV1@ABVMVPbkFieldTypeList@@PAVRFs@@@Z @ 7 NONAME ; class CPbk2SortOrderManager * CPbk2SortOrderManager::NewL(class MVPbkFieldTypeList const &, class RFs *) - ?SimGlobalFdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 8 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalFdnUri(void) - ?SetContactSelector@CVPbkContactViewDefinition@@QAEXPAVMVPbkContactSelector@@@Z @ 9 NONAME ; void CVPbkContactViewDefinition::SetContactSelector(class MVPbkContactSelector *) - ?Cancel@CActive@@QAEXXZ @ 10 NONAME ; void CActive::Cancel(void) - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@AAVTResourceReader@@@Z @ 11 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(class TResourceReader &) - ?LoadContactStoreL@CVPbkContactManager@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 12 NONAME ; void CVPbkContactManager::LoadContactStoreL(class TVPbkContactStoreUriPtr const &) - ?ContactAttributeManagerL@CVPbkContactManager@@QAEAAVMVPbkContactAttributeManager@@XZ @ 13 NONAME ; class MVPbkContactAttributeManager & CVPbkContactManager::ContactAttributeManagerL(void) - ?Uri@CVPbkContactViewDefinition@@QBEABVTDesC16@@XZ @ 14 NONAME ; class TDesC16 const & CVPbkContactViewDefinition::Uri(void) const - ?ExternalizeL@TVPbkContactStoreUriPtr@@UBEXAAVRWriteStream@@@Z @ 15 NONAME ; void TVPbkContactStoreUriPtr::ExternalizeL(class RWriteStream &) const - ?SimGlobalSdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 16 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalSdnUri(void) - ?NewL@CVPbkContactStoreUriArray@@SAPAV1@XZ @ 17 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewL(void) - ?SetId@CVPbkContactViewDefinition@@QAEXH@Z @ 18 NONAME ; void CVPbkContactViewDefinition::SetId(int) - ?CompressStoresL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@AAVMVPbkBatchOperationObserver@@@Z @ 19 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CompressStoresL(class MVPbkBatchOperationObserver &) - ?Cast@MVPbkContactFieldTextData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 20 NONAME ; class MVPbkContactFieldTextData & MVPbkContactFieldTextData::Cast(class MVPbkContactFieldData &) - ?DefaultSavingStoreL@CPbk2StoreConfiguration@@QBE?AVTVPbkContactStoreUriPtr@@XZ @ 21 NONAME ; class TVPbkContactStoreUriPtr CPbk2StoreConfiguration::DefaultSavingStoreL(void) const - ?Set@TVPbkContactStoreUriPtr@@QAEXABV1@@Z @ 22 NONAME ; void TVPbkContactStoreUriPtr::Set(class TVPbkContactStoreUriPtr const &) - ?Reset@CVPbkContactLinkArray@@QAEXXZ @ 23 NONAME ; void CVPbkContactLinkArray::Reset(void) - ?Pbk2AppUi@Phonebook2@@YAPAVMPbk2AppUi@@XZ @ 24 NONAME ; class MPbk2AppUi * Phonebook2::Pbk2AppUi(void) - ?Length@TVPbkContactStoreUriPtr@@QBEHXZ @ 25 NONAME ; int TVPbkContactStoreUriPtr::Length(void) const - ?PackLC@CVPbkContactStoreUriArray@@QBEPAVHBufC8@@XZ @ 26 NONAME ; class HBufC8 * CVPbkContactStoreUriArray::PackLC(void) const - ?PackedBufferSize@CVPbkContactLinkArray@@QBEHXZ @ 27 NONAME ; int CVPbkContactLinkArray::PackedBufferSize(void) const - ?Add@CActiveScheduler@@SAXPAVCActive@@@Z @ 28 NONAME ; void CActiveScheduler::Add(class CActive *) - ?SetPriority@CActive@@QAEXH@Z @ 29 NONAME ; void CActive::SetPriority(int) - ?RemoveObserver@CPbk2SortOrderManager@@QAEXAAVMPbk2SortOrderObserver@@@Z @ 30 NONAME ; void CPbk2SortOrderManager::RemoveObserver(class MPbk2SortOrderObserver &) - ?AddContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 31 NONAME ; void CPbk2StoreConfiguration::AddContactStoreURIL(class TVPbkContactStoreUriPtr) - ?AddObserverL@CPbk2StoreConfiguration@@QAEXAAVMPbk2StoreConfigurationObserver@@@Z @ 32 NONAME ; void CPbk2StoreConfiguration::AddObserverL(class MPbk2StoreConfigurationObserver &) - ?RemoveContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 33 NONAME ; void CPbk2StoreConfiguration::RemoveContactStoreURIL(class TVPbkContactStoreUriPtr) - ??0CActive@@IAE@H@Z @ 34 NONAME ; CActive::CActive(int) - ?AddDefaultSavingStoreObserverL@CPbk2StoreConfiguration@@QAEXAAVMPbk2DefaultSavingStoreObserver@@@Z @ 35 NONAME ; void CPbk2StoreConfiguration::AddDefaultSavingStoreObserverL(class MPbk2DefaultSavingStoreObserver &) - ?NameDisplayOrder@CPbk2SortOrderManager@@QBE?AW4TPbk2NameDisplayOrder@1@XZ @ 36 NONAME ; enum CPbk2SortOrderManager::TPbk2NameDisplayOrder CPbk2SortOrderManager::NameDisplayOrder(void) const - ?Name@CVPbkContactViewDefinition@@QBEABVTDesC16@@XZ @ 37 NONAME ; class TDesC16 const & CVPbkContactViewDefinition::Name(void) const - ?Type@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewType@@XZ @ 38 NONAME ; enum TVPbkContactViewType CVPbkContactViewDefinition::Type(void) const - ?AsyncStop@CActiveSchedulerWait@@QAEXXZ @ 39 NONAME ; void CActiveSchedulerWait::AsyncStop(void) - ?Cast@MVPbkContactFieldTextData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 40 NONAME ; class MVPbkContactFieldTextData const & MVPbkContactFieldTextData::Cast(class MVPbkContactFieldData const &) - ?ResetAndDestroy@CVPbkContactLinkArray@@QAEXXZ @ 41 NONAME ; void CVPbkContactLinkArray::ResetAndDestroy(void) - ?CreateLinksLC@CVPbkContactManager@@QBEPAVMVPbkContactLinkArray@@ABVTDesC8@@@Z @ 42 NONAME ; class MVPbkContactLinkArray * CVPbkContactManager::CreateLinksLC(class TDesC8 const &) const - ?Remove@CVPbkContactStoreUriArray@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 43 NONAME ; void CVPbkContactStoreUriArray::Remove(class TVPbkContactStoreUriPtr const &) - ?Count@CVPbkContactStoreUriArray@@QBEHXZ @ 44 NONAME ; int CVPbkContactStoreUriArray::Count(void) const - ?SetUriL@CVPbkContactViewDefinition@@QAEXABVTDesC16@@@Z @ 45 NONAME ; void CVPbkContactViewDefinition::SetUriL(class TDesC16 const &) - ?CurrentConfigurationL@CPbk2StoreConfiguration@@QBEPAVCVPbkContactStoreUriArray@@XZ @ 46 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::CurrentConfigurationL(void) const - ?RemoveSupportedContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 47 NONAME ; void CPbk2StoreConfiguration::RemoveSupportedContactStoreURIL(class TVPbkContactStoreUriPtr) - ?RetrieveContactL@CVPbkContactManager@@QBEPAVMVPbkContactOperationBase@@ABVMVPbkContactLink@@AAVMVPbkSingleContactOperationObserver@@@Z @ 48 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::RetrieveContactL(class MVPbkContactLink const &, class MVPbkSingleContactOperationObserver &) const - ?NewL@CVPbkContactViewDefinition@@SAPAV1@XZ @ 49 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(void) - ?Id@CVPbkContactViewDefinition@@QBEHXZ @ 50 NONAME ; int CVPbkContactViewDefinition::Id(void) const - ?AddSubViewL@CVPbkContactViewDefinition@@QAEXPAV1@@Z @ 51 NONAME ; void CVPbkContactViewDefinition::AddSubViewL(class CVPbkContactViewDefinition *) - ??1CActive@@UAE@XZ @ 52 NONAME ; CActive::~CActive(void) - ?Cast@MVPbkContactFieldBinaryData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 53 NONAME ; class MVPbkContactFieldBinaryData & MVPbkContactFieldBinaryData::Cast(class MVPbkContactFieldData &) - ?ContactStoresL@CVPbkContactManager@@QAEAAVMVPbkContactStoreList@@XZ @ 54 NONAME ; class MVPbkContactStoreList & CVPbkContactManager::ContactStoresL(void) - ?NewL@CVPbkContactManager@@SAPAV1@VTSecurityInfo@@ABVCVPbkContactStoreUriArray@@PAVRFs@@@Z @ 55 NONAME ; class CVPbkContactManager * CVPbkContactManager::NewL(class TSecurityInfo, class CVPbkContactStoreUriArray const &, class RFs *) - ?MatchPhoneNumberL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVTDesC16@@HAAVMVPbkContactFindObserver@@@Z @ 56 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::MatchPhoneNumberL(class TDesC16 const &, int, class MVPbkContactFindObserver &) - ?DeleteContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMVPbkContactLinkArray@@AAVMVPbkBatchOperationObserver@@@Z @ 57 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::DeleteContactsL(class MVPbkContactLinkArray const &, class MVPbkBatchOperationObserver &) - ?Cast@MVPbkContactFieldUriData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 58 NONAME ; class MVPbkContactFieldUriData & MVPbkContactFieldUriData::Cast(class MVPbkContactFieldData &) - ?CreateContactViewLC@CVPbkContactManager@@QBEPAVMVPbkContactViewBase@@AAVMVPbkContactViewObserver@@ABVCVPbkContactViewDefinition@@ABVMVPbkFieldTypeList@@@Z @ 59 NONAME ; class MVPbkContactViewBase * CVPbkContactManager::CreateContactViewLC(class MVPbkContactViewObserver &, class CVPbkContactViewDefinition const &, class MVPbkFieldTypeList const &) const - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@XZ @ 60 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(void) - ?DefaultCntDbUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 61 NONAME ; class TDesC16 const & VPbkContactStoreUris::DefaultCntDbUri(void) - ?RemoveDefaultSavingStoreObserver@CPbk2StoreConfiguration@@QAEXAAVMPbk2DefaultSavingStoreObserver@@@Z @ 62 NONAME ; void CPbk2StoreConfiguration::RemoveDefaultSavingStoreObserver(class MPbk2DefaultSavingStoreObserver &) - ?AddSupportedContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 63 NONAME ; void CPbk2StoreConfiguration::AddSupportedContactStoreURIL(class TVPbkContactStoreUriPtr) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@ABVTDesC8@@ABVMVPbkContactStoreList@@@Z @ 64 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class TDesC8 const &, class MVPbkContactStoreList const &) - ?Remove@CVPbkContactLinkArray@@QAEXH@Z @ 65 NONAME ; void CVPbkContactLinkArray::Remove(int) - ?FindL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVTDesC16@@ABVMVPbkFieldTypeList@@AAVMVPbkContactFindObserver@@@Z @ 66 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::FindL(class TDesC16 const &, class MVPbkFieldTypeList const &, class MVPbkContactFindObserver &) - ?SimGlobalOwnNumberUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 67 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalOwnNumberUri(void) - ?SetNameDisplayOrderL@CPbk2SortOrderManager@@QAEXW4TPbk2NameDisplayOrder@1@ABVTDesC16@@@Z @ 68 NONAME ; void CPbk2SortOrderManager::SetNameDisplayOrderL(enum CPbk2SortOrderManager::TPbk2NameDisplayOrder, class TDesC16 const &) - ?SubViewCount@CVPbkContactViewDefinition@@QBEHXZ @ 69 NONAME ; int CVPbkContactViewDefinition::SubViewCount(void) const - ?NewL@CVPbkContactLinkArray@@SAPAV1@XZ @ 70 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewL(void) - ?Extension_@CActive@@MAEHIAAPAXPAX@Z @ 71 NONAME ; int CActive::Extension_(unsigned int, void * &, void *) - ?NewLC@CVPbkContactStoreUriArray@@SAPAV1@ABVTDesC8@@@Z @ 72 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewLC(class TDesC8 const &) - ?IsIncluded@CVPbkContactStoreUriArray@@QBEHABVTVPbkContactStoreUriPtr@@@Z @ 73 NONAME ; int CVPbkContactStoreUriArray::IsIncluded(class TVPbkContactStoreUriPtr const &) const - ?CreateLinksLC@CVPbkContactManager@@QBEPAVMVPbkContactLinkArray@@AAVRReadStream@@@Z @ 74 NONAME ; class MVPbkContactLinkArray * CVPbkContactManager::CreateLinksLC(class RReadStream &) const - ?SubViewAt@CVPbkContactViewDefinition@@QBEABV1@H@Z @ 75 NONAME ; class CVPbkContactViewDefinition const & CVPbkContactViewDefinition::SubViewAt(int) const - ?SetFieldTypeFilterL@CVPbkContactViewDefinition@@QAEXPAVCVPbkFieldTypeSelector@@@Z @ 76 NONAME ; void CVPbkContactViewDefinition::SetFieldTypeFilterL(class CVPbkFieldTypeSelector *) - ?SetContactViewL@CPbk2SortOrderManager@@QAEXAAVMVPbkContactViewBase@@@Z @ 77 NONAME ; void CPbk2SortOrderManager::SetContactViewL(class MVPbkContactViewBase &) - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@ABV1@@Z @ 78 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(class CVPbkContactViewDefinition const &) - ?Component@TVPbkContactStoreUriPtr@@QBE?BVTPtrC16@@W4TVPbkContactStoreUriComponent@1@@Z @ 79 NONAME ; class TPtrC16 const TVPbkContactStoreUriPtr::Component(enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?Cast@MVPbkContactFieldBinaryData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 80 NONAME ; class MVPbkContactFieldBinaryData const & MVPbkContactFieldBinaryData::Cast(class MVPbkContactFieldData const &) - ?FsSession@CVPbkContactManager@@QAEAAVRFs@@XZ @ 81 NONAME ; class RFs & CVPbkContactManager::FsSession(void) - ??1CActiveSchedulerWait@@UAE@XZ @ 82 NONAME ; CActiveSchedulerWait::~CActiveSchedulerWait(void) - ?Cast@MVPbkContactFieldUriData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 83 NONAME ; class MVPbkContactFieldUriData const & MVPbkContactFieldUriData::Cast(class MVPbkContactFieldData const &) - ??ACVPbkContactStoreUriArray@@QBE?AVTVPbkContactStoreUriPtr@@H@Z @ 84 NONAME ; class TVPbkContactStoreUriPtr CVPbkContactStoreUriArray::operator[](int) const - ?InsertL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@H@Z @ 85 NONAME ; void CVPbkContactLinkArray::InsertL(class MVPbkContactLink *, int) - ?SetActive@CActive@@IAEXXZ @ 86 NONAME ; void CActive::SetActive(void) - ??0TVPbkContactStoreUriPtr@@QAE@ABVTDesC16@@@Z @ 87 NONAME ; TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(class TDesC16 const &) - ?Compare@TVPbkContactStoreUriPtr@@QBEHABVTDesC16@@W4TVPbkContactStoreUriComponent@1@@Z @ 88 NONAME ; int TVPbkContactStoreUriPtr::Compare(class TDesC16 const &, enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?Sharing@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewSharing@@XZ @ 89 NONAME ; enum TVPbkContactViewSharing CVPbkContactViewDefinition::Sharing(void) const - ?SupportedStoreConfigurationL@CPbk2StoreConfiguration@@QBEPAVCVPbkContactStoreUriArray@@XZ @ 90 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::SupportedStoreConfigurationL(void) const - ?SimGlobalAdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 91 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalAdnUri(void) - ?CurrentSeparator@CPbk2SortOrderManager@@QBEABVTDesC16@@XZ @ 92 NONAME ; class TDesC16 const & CPbk2SortOrderManager::CurrentSeparator(void) const - ?ContactSelector@CVPbkContactViewDefinition@@QBEPAVMVPbkContactSelector@@XZ @ 93 NONAME ; class MVPbkContactSelector * CVPbkContactViewDefinition::ContactSelector(void) const - ??0CActiveSchedulerWait@@QAE@XZ @ 94 NONAME ; CActiveSchedulerWait::CActiveSchedulerWait(void) - ?CopyContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMVPbkContactLinkArray@@PAVMVPbkContactStore@@AAVMVPbkBatchOperationObserver@@@Z @ 95 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CopyContactsL(class MVPbkContactLinkArray const &, class MVPbkContactStore *, class MVPbkBatchOperationObserver &) - ?Start@CActiveSchedulerWait@@QAEXXZ @ 96 NONAME ; void CActiveSchedulerWait::Start(void) - ?NewL@CVPbkContactManager@@SAPAV1@ABVCVPbkContactStoreUriArray@@PAVRFs@@@Z @ 97 NONAME ; class CVPbkContactManager * CVPbkContactManager::NewL(class CVPbkContactStoreUriArray const &, class RFs *) - ?Delete@CVPbkContactLinkArray@@QAEXH@Z @ 98 NONAME ; void CVPbkContactLinkArray::Delete(int) - ?DefaultSeparator@CPbk2SortOrderManager@@QAEABVTDesC16@@XZ @ 99 NONAME ; class TDesC16 const & CPbk2SortOrderManager::DefaultSeparator(void) - ?SearchStoreConfigurationL@CPbk2StoreConfiguration@@QAEPAVCVPbkContactStoreUriArray@@XZ @ 100 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::SearchStoreConfigurationL(void) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@XZ @ 101 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(void) - ?CommitContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABV?$TArray@PAVMVPbkStoreContact@@@@AAVMVPbkBatchOperationObserver@@@Z @ 102 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CommitContactsL(class TArray const &, class MVPbkBatchOperationObserver &) - ?SortPolicy@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewSortPolicy@@XZ @ 103 NONAME ; enum TVPbkContactViewSortPolicy CVPbkContactViewDefinition::SortPolicy(void) const - ?Compare@TVPbkContactStoreUriPtr@@QBEHABV1@W4TVPbkContactStoreUriComponent@1@@Z @ 104 NONAME ; int TVPbkContactStoreUriPtr::Compare(class TVPbkContactStoreUriPtr const &, enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ??0TVPbkContactStoreUriPtr@@QAE@XZ @ 105 NONAME ; TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(void) - ?SetFlag@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewFlag@@H@Z @ 106 NONAME ; void CVPbkContactViewDefinition::SetFlag(enum TVPbkContactViewFlag, int) - ?SetSharing@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewSharing@@@Z @ 107 NONAME ; void CVPbkContactViewDefinition::SetSharing(enum TVPbkContactViewSharing) - ?AppendAllL@CVPbkContactStoreUriArray@@QAEXABV1@@Z @ 108 NONAME ; void CVPbkContactStoreUriArray::AppendAllL(class CVPbkContactStoreUriArray const &) - ?NewL@CPbk2StoreConfiguration@@SAPAV1@XZ @ 109 NONAME ; class CPbk2StoreConfiguration * CPbk2StoreConfiguration::NewL(void) - ?ExternalizedSize@TVPbkContactStoreUriPtr@@UBEHXZ @ 110 NONAME ; int TVPbkContactStoreUriPtr::ExternalizedSize(void) const - ?AppendL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@@Z @ 111 NONAME ; void CVPbkContactLinkArray::AppendL(class MVPbkContactLink *) - ?Start@CPeriodic@@QAEXVTTimeIntervalMicroSeconds32@@0VTCallBack@@@Z @ 112 NONAME ; void CPeriodic::Start(class TTimeIntervalMicroSeconds32, class TTimeIntervalMicroSeconds32, class TCallBack) - ?NewLC@CVPbkContactStoreUriArray@@SAPAV1@XZ @ 113 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewLC(void) - ?AddObserverL@CPbk2SortOrderManager@@QAEXAAVMPbk2SortOrderObserver@@@Z @ 114 NONAME ; void CPbk2SortOrderManager::AddObserverL(class MPbk2SortOrderObserver &) - ?SetType@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewType@@@Z @ 115 NONAME ; void CVPbkContactViewDefinition::SetType(enum TVPbkContactViewType) - ?AppendL@CVPbkContactStoreUriArray@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 116 NONAME ; void CVPbkContactStoreUriArray::AppendL(class TVPbkContactStoreUriPtr const &) - ?FieldTypes@CVPbkContactManager@@QBEABVMVPbkFieldTypeList@@XZ @ 117 NONAME ; class MVPbkFieldTypeList const & CVPbkContactManager::FieldTypes(void) const - ?NewL@CVPbkContactViewDefinition@@SAPAV1@ABV1@@Z @ 118 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(class CVPbkContactViewDefinition const &) - ?FindL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMDesC16Array@@ABVMVPbkFieldTypeList@@AAVMVPbkContactFindFromStoresObserver@@ABVTCallBack@@@Z @ 119 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::FindL(class MDesC16Array const &, class MVPbkFieldTypeList const &, class MVPbkContactFindFromStoresObserver &, class TCallBack const &) - ?SortOrder@CPbk2SortOrderManager@@QBEABVMVPbkFieldTypeList@@XZ @ 120 NONAME ; class MVPbkFieldTypeList const & CPbk2SortOrderManager::SortOrder(void) const - ?SetSortPolicy@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewSortPolicy@@@Z @ 121 NONAME ; void CVPbkContactViewDefinition::SetSortPolicy(enum TVPbkContactViewSortPolicy) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@AAVRReadStream@@ABVMVPbkContactStoreList@@@Z @ 122 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class RReadStream &, class MVPbkContactStoreList const &) - ?NewL@CVPbkContactViewDefinition@@SAPAV1@AAVTResourceReader@@@Z @ 123 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(class TResourceReader &) - ?SetNameL@CVPbkContactViewDefinition@@QAEXABVTDesC16@@@Z @ 124 NONAME ; void CVPbkContactViewDefinition::SetNameL(class TDesC16 const &) - ?Deque@CActive@@QAEXXZ @ 125 NONAME ; void CActive::Deque(void) - ?FlagIsOn@CVPbkContactViewDefinition@@QBEHW4TVPbkContactViewFlag@@@Z @ 126 NONAME ; int CVPbkContactViewDefinition::FlagIsOn(enum TVPbkContactViewFlag) const - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/conf/CVIMPSTStorageContactList_UT.cfg --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/conf/CVIMPSTStorageContactList_UT.cfg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -[Test] -title Example -create CVIMPSTStorageContactList_UT foobar -foobar Example pa ra me ters -delete foobar -[Endtest] - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/eabi/cvimpststoragecontactlist_utu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/eabi/cvimpststoragecontactlist_utu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - _ZN10Phonebook29Pbk2AppUiEv @ 2 NONAME - _ZN19CVPbkContactManager13CopyContactsLERK21MVPbkContactLinkArrayP17MVPbkContactStoreR27MVPbkBatchOperationObserver @ 3 NONAME - _ZN19CVPbkContactManager14ContactStoresLEv @ 4 NONAME - _ZN19CVPbkContactManager15CommitContactsLERK6TArrayIP17MVPbkStoreContactER27MVPbkBatchOperationObserver @ 5 NONAME - _ZN19CVPbkContactManager15CompressStoresLER27MVPbkBatchOperationObserver @ 6 NONAME - _ZN19CVPbkContactManager15DeleteContactsLERK21MVPbkContactLinkArrayR27MVPbkBatchOperationObserver @ 7 NONAME - _ZN19CVPbkContactManager17LoadContactStoreLERK23TVPbkContactStoreUriPtr @ 8 NONAME - _ZN19CVPbkContactManager17MatchPhoneNumberLERK7TDesC16iR24MVPbkContactFindObserver @ 9 NONAME - _ZN19CVPbkContactManager24ContactAttributeManagerLEv @ 10 NONAME - _ZN19CVPbkContactManager4NewLE13TSecurityInfoRK25CVPbkContactStoreUriArrayP3RFs @ 11 NONAME - _ZN19CVPbkContactManager4NewLERK25CVPbkContactStoreUriArrayP3RFs @ 12 NONAME - _ZN19CVPbkContactManager5FindLERK12MDesC16ArrayRK18MVPbkFieldTypeListR34MVPbkContactFindFromStoresObserverRK9TCallBack @ 13 NONAME - _ZN19CVPbkContactManager5FindLERK7TDesC16RK18MVPbkFieldTypeListR24MVPbkContactFindObserver @ 14 NONAME - _ZN19CVPbkContactManager9FsSessionEv @ 15 NONAME - _ZN20VPbkContactStoreUris15DefaultCntDbUriEv @ 16 NONAME - _ZN20VPbkContactStoreUris15SimGlobalAdnUriEv @ 17 NONAME - _ZN20VPbkContactStoreUris15SimGlobalFdnUriEv @ 18 NONAME - _ZN20VPbkContactStoreUris15SimGlobalSdnUriEv @ 19 NONAME - _ZN20VPbkContactStoreUris21SimGlobalOwnNumberUriEv @ 20 NONAME - _ZN21CPbk2SortOrderManager12AddObserverLER22MPbk2SortOrderObserver @ 21 NONAME - _ZN21CPbk2SortOrderManager14RemoveObserverER22MPbk2SortOrderObserver @ 22 NONAME - _ZN21CPbk2SortOrderManager15SetContactViewLER20MVPbkContactViewBase @ 23 NONAME - _ZN21CPbk2SortOrderManager16DefaultSeparatorEv @ 24 NONAME - _ZN21CPbk2SortOrderManager20SetNameDisplayOrderLENS_21TPbk2NameDisplayOrderERK7TDesC16 @ 25 NONAME - _ZN21CPbk2SortOrderManager4NewLERK18MVPbkFieldTypeListP3RFs @ 26 NONAME - _ZN21CVPbkContactLinkArray15ResetAndDestroyEv @ 27 NONAME - _ZN21CVPbkContactLinkArray4NewLEv @ 28 NONAME - _ZN21CVPbkContactLinkArray5NewLCER11RReadStreamRK21MVPbkContactStoreList @ 29 NONAME - _ZN21CVPbkContactLinkArray5NewLCERK6TDesC8RK21MVPbkContactStoreList @ 30 NONAME - _ZN21CVPbkContactLinkArray5NewLCEv @ 31 NONAME - _ZN21CVPbkContactLinkArray5ResetEv @ 32 NONAME - _ZN21CVPbkContactLinkArray6DeleteEi @ 33 NONAME - _ZN21CVPbkContactLinkArray6RemoveEi @ 34 NONAME - _ZN21CVPbkContactLinkArray7AppendLEP16MVPbkContactLink @ 35 NONAME - _ZN21CVPbkContactLinkArray7InsertLEP16MVPbkContactLinki @ 36 NONAME - _ZN23CPbk2StoreConfiguration4NewLEv @ 37 NONAME - _ZN23TVPbkContactStoreUriPtr3SetERKS_ @ 38 NONAME - _ZN23TVPbkContactStoreUriPtrC1ERK7TDesC16 @ 39 NONAME - _ZN23TVPbkContactStoreUriPtrC1Ev @ 40 NONAME - _ZN23TVPbkContactStoreUriPtrC2ERK7TDesC16 @ 41 NONAME - _ZN23TVPbkContactStoreUriPtrC2Ev @ 42 NONAME - _ZN24MVPbkContactFieldUriData4CastER21MVPbkContactFieldData @ 43 NONAME - _ZN24MVPbkContactFieldUriData4CastERK21MVPbkContactFieldData @ 44 NONAME - _ZN25CVPbkContactStoreUriArray10AppendAllLERKS_ @ 45 NONAME - _ZN25CVPbkContactStoreUriArray4NewLEv @ 46 NONAME - _ZN25CVPbkContactStoreUriArray5NewLCERK6TDesC8 @ 47 NONAME - _ZN25CVPbkContactStoreUriArray5NewLCEv @ 48 NONAME - _ZN25CVPbkContactStoreUriArray6RemoveERK23TVPbkContactStoreUriPtr @ 49 NONAME - _ZN25CVPbkContactStoreUriArray7AppendLERK23TVPbkContactStoreUriPtr @ 50 NONAME - _ZN25MVPbkContactFieldTextData4CastER21MVPbkContactFieldData @ 51 NONAME - _ZN25MVPbkContactFieldTextData4CastERK21MVPbkContactFieldData @ 52 NONAME - _ZN26CVPbkContactViewDefinition10SetSharingE23TVPbkContactViewSharing @ 53 NONAME - _ZN26CVPbkContactViewDefinition11AddSubViewLEPS_ @ 54 NONAME - _ZN26CVPbkContactViewDefinition13SetSortPolicyE26TVPbkContactViewSortPolicy @ 55 NONAME - _ZN26CVPbkContactViewDefinition18SetContactSelectorEP20MVPbkContactSelector @ 56 NONAME - _ZN26CVPbkContactViewDefinition19SetFieldTypeFilterLEP22CVPbkFieldTypeSelector @ 57 NONAME - _ZN26CVPbkContactViewDefinition4NewLER15TResourceReader @ 58 NONAME - _ZN26CVPbkContactViewDefinition4NewLERKS_ @ 59 NONAME - _ZN26CVPbkContactViewDefinition4NewLEv @ 60 NONAME - _ZN26CVPbkContactViewDefinition5NewLCER15TResourceReader @ 61 NONAME - _ZN26CVPbkContactViewDefinition5NewLCERKS_ @ 62 NONAME - _ZN26CVPbkContactViewDefinition5NewLCEv @ 63 NONAME - _ZN26CVPbkContactViewDefinition5SetIdEi @ 64 NONAME - _ZN26CVPbkContactViewDefinition7SetFlagE20TVPbkContactViewFlagi @ 65 NONAME - _ZN26CVPbkContactViewDefinition7SetTypeE20TVPbkContactViewType @ 66 NONAME - _ZN26CVPbkContactViewDefinition7SetUriLERK7TDesC16 @ 67 NONAME - _ZN26CVPbkContactViewDefinition8SetNameLERK7TDesC16 @ 68 NONAME - _ZN26CVPbkContactViewDefinition9SubViewAtEi @ 69 NONAME - _ZN27MVPbkContactFieldBinaryData4CastER21MVPbkContactFieldData @ 70 NONAME - _ZN27MVPbkContactFieldBinaryData4CastERK21MVPbkContactFieldData @ 71 NONAME - _ZNK19CVPbkContactManager10FieldTypesEv @ 72 NONAME - _ZNK19CVPbkContactManager13CreateLinksLCER11RReadStream @ 73 NONAME - _ZNK19CVPbkContactManager13CreateLinksLCERK6TDesC8 @ 74 NONAME - _ZNK19CVPbkContactManager16RetrieveContactLERK16MVPbkContactLinkR35MVPbkSingleContactOperationObserver @ 75 NONAME - _ZNK19CVPbkContactManager19CreateContactViewLCER24MVPbkContactViewObserverRK26CVPbkContactViewDefinitionRK18MVPbkFieldTypeList @ 76 NONAME - _ZNK21CPbk2SortOrderManager16CurrentSeparatorEv @ 77 NONAME - _ZNK21CPbk2SortOrderManager16NameDisplayOrderEv @ 78 NONAME - _ZNK21CPbk2SortOrderManager9SortOrderEv @ 79 NONAME - _ZNK21CVPbkContactLinkArray16PackedBufferSizeEv @ 80 NONAME - _ZNK23TVPbkContactStoreUriPtr12ExternalizeLER12RWriteStream @ 81 NONAME - _ZNK23TVPbkContactStoreUriPtr16ExternalizedSizeEv @ 82 NONAME - _ZNK23TVPbkContactStoreUriPtr6LengthEv @ 83 NONAME - _ZNK23TVPbkContactStoreUriPtr6UriDesEv @ 84 NONAME - _ZNK23TVPbkContactStoreUriPtr7CompareERK7TDesC16NS_29TVPbkContactStoreUriComponentE @ 85 NONAME - _ZNK23TVPbkContactStoreUriPtr7CompareERKS_NS_29TVPbkContactStoreUriComponentE @ 86 NONAME - _ZNK23TVPbkContactStoreUriPtr9ComponentENS_29TVPbkContactStoreUriComponentE @ 87 NONAME - _ZNK25CVPbkContactStoreUriArray10IsIncludedERK23TVPbkContactStoreUriPtr @ 88 NONAME - _ZNK25CVPbkContactStoreUriArray5CountEv @ 89 NONAME - _ZNK25CVPbkContactStoreUriArray6PackLCEv @ 90 NONAME - _ZNK25CVPbkContactStoreUriArrayixEi @ 91 NONAME - _ZNK26CVPbkContactViewDefinition10SortPolicyEv @ 92 NONAME - _ZNK26CVPbkContactViewDefinition12SubViewCountEv @ 93 NONAME - _ZNK26CVPbkContactViewDefinition15ContactSelectorEv @ 94 NONAME - _ZNK26CVPbkContactViewDefinition15FieldTypeFilterEv @ 95 NONAME - _ZNK26CVPbkContactViewDefinition2IdEv @ 96 NONAME - _ZNK26CVPbkContactViewDefinition3UriEv @ 97 NONAME - _ZNK26CVPbkContactViewDefinition4NameEv @ 98 NONAME - _ZNK26CVPbkContactViewDefinition4TypeEv @ 99 NONAME - _ZNK26CVPbkContactViewDefinition7SharingEv @ 100 NONAME - _ZNK26CVPbkContactViewDefinition8FlagIsOnE20TVPbkContactViewFlag @ 101 NONAME - _ZNK26CVPbkContactViewDefinition9SubViewAtEi @ 102 NONAME - _ZTI14CPbk2AppUiStub @ 103 NONAME - _ZTI19CVPbkContactManager @ 104 NONAME - _ZTI20CActiveSchedulerWait @ 105 NONAME - _ZTI20CVPbkContactLinkStub @ 106 NONAME - _ZTI20CVPbkContactViewStub @ 107 NONAME - _ZTI21CPbk2SortOrderManager @ 108 NONAME - _ZTI21CVPbkContactLinkArray @ 109 NONAME - _ZTI21CVPbkContactStoreStub @ 110 NONAME - _ZTI21CVPbkStoreContactStub @ 111 NONAME - _ZTI23CPbk2CommandHandlerStub @ 112 NONAME - _ZTI23CPbk2StoreConfiguration @ 113 NONAME - _ZTI23TVPbkContactStoreUriPtr @ 114 NONAME - _ZTI25CVPbkContactStoreListStub @ 115 NONAME - _ZTI25CVPbkContactStoreUriArray @ 116 NONAME - _ZTI26CVPbkContactViewDefinition @ 117 NONAME - _ZTI26CVPbkStoreContactFieldStub @ 118 NONAME - _ZTI28CPbk2ApplicationServicesStub @ 119 NONAME - _ZTI29CVPbkContactFieldUriData_Stub @ 120 NONAME - _ZTI30CVPbkContactFieldTextData_stub @ 121 NONAME - _ZTI31CVPbkContactFieldBinaryDataStub @ 122 NONAME - _ZTI35CVPbkBaseContactFieldCollectionStub @ 123 NONAME - _ZTI7CActive @ 124 NONAME - _ZTV14CPbk2AppUiStub @ 125 NONAME - _ZTV19CVPbkContactManager @ 126 NONAME - _ZTV20CActiveSchedulerWait @ 127 NONAME - _ZTV20CVPbkContactLinkStub @ 128 NONAME - _ZTV20CVPbkContactViewStub @ 129 NONAME - _ZTV21CPbk2SortOrderManager @ 130 NONAME - _ZTV21CVPbkContactLinkArray @ 131 NONAME - _ZTV21CVPbkContactStoreStub @ 132 NONAME - _ZTV21CVPbkStoreContactStub @ 133 NONAME - _ZTV23CPbk2CommandHandlerStub @ 134 NONAME - _ZTV23CPbk2StoreConfiguration @ 135 NONAME - _ZTV23TVPbkContactStoreUriPtr @ 136 NONAME - _ZTV25CVPbkContactStoreListStub @ 137 NONAME - _ZTV25CVPbkContactStoreUriArray @ 138 NONAME - _ZTV26CVPbkContactViewDefinition @ 139 NONAME - _ZTV26CVPbkStoreContactFieldStub @ 140 NONAME - _ZTV28CPbk2ApplicationServicesStub @ 141 NONAME - _ZTV29CVPbkContactFieldUriData_Stub @ 142 NONAME - _ZTV30CVPbkContactFieldTextData_stub @ 143 NONAME - _ZTV31CVPbkContactFieldBinaryDataStub @ 144 NONAME - _ZTV35CVPbkBaseContactFieldCollectionStub @ 145 NONAME - _ZTV7CActive @ 146 NONAME - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/CVIMPSTStorageContactList_UT.mmp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/CVIMPSTStorageContactList_UT.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* 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: MMP file for STIF Test Framework's TestScripter -* testclass test module. -* -*/ - -#include - -TARGET CVIMPSTStorageContactList_UT.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -EPOCALLOWDLLDATA -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE cvimpststoragecontactlist_ut.def - -USERINCLUDE ../inc -USERINCLUDE ../../stubs -USERINCLUDE ../../../../inc -USERINCLUDE ../../../../../inc -USERINCLUDE ../../../../../vimpstutils/inc - -//OS_LAYER_SYSTEMINCLUDE -APP_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../../../../src -SOURCE cvimpststoragecontact.cpp -SOURCE cvimpststoragecontactsorter.cpp -SOURCE cvimpststoragecontactlist.cpp -SOURCE cvimpststorageserviceview.cpp -SOURCE cvimpststoragevpbklocalstore.cpp -SOURCE cvimpststoragevpbkserverstore.cpp -SOURCE cvimpststorageactivehandler.cpp -SOURCE cvimpststoragevpbkstorehandler.cpp -SOURCE vimpststorageutils.cpp - -SOURCEPATH ../src - -SOURCE CVIMPSTStorageContactList_UT.cpp -SOURCE CVIMPSTStorageContactList_UTBlocks.cpp - -SOURCEPATH ../../stubs - -//stubs -SOURCE s_MVPbkContactFieldTextData.cpp -SOURCE s_MVPbkContactFieldUriData.cpp -SOURCE s_MVPbkContactFieldBinaryData.cpp -SOURCE s_CVPbkContactManager.cpp -SOURCE s_MVPbkContactLinkstub.cpp -SOURCE CVPbkContactStoreUriArrayStub.cpp -SOURCE CVPbkStoreContactStub.cpp -SOURCE s_CVPbkBaseContactFieldCollection.cpp -SOURCE s_CVPbkStoreContactField.cpp -SOURCE s_CVPbkContactStoreList.cpp -SOURCE s_CVPbkContactViewDefinition.cpp -SOURCE s_CVPbkContactView.cpp -SOURCE s_CPbk2SortOrderManager.cpp -SOURCE s_TVPbkContactStoreUriPtr.cpp -SOURCE s_CVPbkContactLinkArray.cpp -SOURCE s_VPbkContactStoreUris.cpp -SOURCE pbkuistubs.cpp -SOURCE s_cactive.cpp -SOURCE s_CPBK2StoreConfiguration.cpp -//RESOURCE resource_file -//RESOURCE resource_file2 - -LIBRARY euser.lib -LIBRARY estor.lib -LIBRARY sysutil.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib -LIBRARY flogger.lib -LIBRARY efsrv.lib -LIBRARY edbms.lib -LIBRARY bafl.lib -LIBRARY ecom.lib -LIBRARY cntmodel.lib -LIBRARY cntview.lib - -LIBRARY eikcore.lib -LIBRARY avkon.lib - -// Virtual phonebook - - - - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/CVIMPSTStorageContactList_UT.pkg --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/CVIMPSTStorageContactList_UT.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +0,0 @@ -; -; 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: -; -; Installation file for STIF -; - -; Languages -&EN - -; Provide value for uid -#{"STIF"},(0x00000000),1,1,0,TYPE=SA - -; Series60 product id for S60 3.0 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - -; Logo -; None - -; Package signature - Optional -; None - -; Start of Package body - -; Condition blocks -; None - -; Options list -; None - -; Install files -"\epoc32\release\armv5\udeb\CVIMPSTStorageContactList_UT.dll" - "!:\Sys\Bin\CVIMPSTStorageContactList_UT.dll" - -; Embedded SIS -; None - -; End of Package body - -; PKG dependencies -; None - -; PKG capabilities -; None diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/CVIMPSTStorageContactList_UT_DoxyFile.txt --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/CVIMPSTStorageContactList_UT_DoxyFile.txt Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -# 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: MMP file for STIF Test Framework's TestScripter -# testclass test module. -# -# - -# Doxyfile 1.4.1 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = CVIMPSTStorageContactList_UT -PROJECT_NUMBER = -OUTPUT_DIRECTORY = U:\sf\app\conversations\uiservicetab\vimpststorage\tsrc\vimpststorage_ut\CVIMPSTStorageContactList_UT\ -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = YES -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = NO -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = NO -GENERATE_TESTLIST = NO -GENERATE_BUGLIST = NO -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = U:\sf\app\conversations\uiservicetab\vimpststorage\tsrc\vimpststorage_ut\CVIMPSTStorageContactList_UT\ -FILE_PATTERNS = *.h \ - *.rh \ - *.hrh -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = NO -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = YES -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = YES -TOC_EXPAND = YES -DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = YES -RTF_OUTPUT = Doc -COMPACT_RTF = YES -RTF_HYPERLINKS = YES -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = NONSHARABLE_CLASS -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/CVIMPSTStorageContactList_UT_nrm.mmp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/CVIMPSTStorageContactList_UT_nrm.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/*TYPE TESTCLASS*/ -/* -* 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: MMP file for STIF Test Framework's TestScripter -* testclass test module. -* -*/ - -#include - -TARGET CVIMPSTStorageContactList_UT.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE CVIMPSTStorageContactList_UT.def - -USERINCLUDE ../inc - -OS_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../src - -SOURCE CVIMPSTStorageContactList_UT.cpp -SOURCE CVIMPSTStorageContactList_UTBlocks.cpp - -//RESOURCE resource_file -//RESOURCE resource_file2 - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/bld.inf --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* 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: -* -*/ - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these - - DEFAULT - -PRJ_TESTEXPORTS -// NOTE: If using ARS requirements all export operations should be done under this. -// 'abld test export' - -PRJ_EXPORTS -// Specify the source file followed by its destination here -// copy will be used to copy the source file to its destination -// If there's no destination then the source file will be copied -// to the same name in -// Example: - - -PRJ_TESTMMPFILES - - CVIMPSTStorageContactList_UT.mmp - -PRJ_MMPFILES - - -// Specify the .mmp files required for building the important component -// releasables. -// -// Specify "tidy" if the component you need to build doesn't need to be -// released. Specify "ignore" if the MMP file exists but should be -// ignored. -// Example: - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/inc/CVIMPSTStorageContactList_UT.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/inc/CVIMPSTStorageContactList_UT.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,312 +0,0 @@ -/* -* 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: STIF testclass declaration -* -*/ - -#ifndef CVIMPSTSTORAGECONTACTLIST_UT_H -#define CVIMPSTSTORAGECONTACTLIST_UT_H - -// INCLUDES -#include -#include -#include -#include -#include "vimpstutils.h" -#include "cvimpststoragecontact.h" -#include "cvimpststoragecontactsorter.h" -#include "cvimpststoragecontactlist.h" -#include "tvimpstenums.h" - -// MACROS -//#define ?macro ?macro_def -#define TEST_CLASS_VERSION_MAJOR 0 -#define TEST_CLASS_VERSION_MINOR 0 -#define TEST_CLASS_VERSION_BUILD 0 - -// Logging path -_LIT( KCVIMPSTStorageContactList_UTLogPath, "\\logs\\testframework\\CVIMPSTStorageContactList_UT\\" ); -// Log file -_LIT( KCVIMPSTStorageContactList_UTLogFile, "CVIMPSTStorageContactList_UT.txt" ); -_LIT( KCVIMPSTStorageContactList_UTLogFileWithTitle, "CVIMPSTStorageContactList_UT_[%S].txt" ); - -// FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; -class CCVIMPSTStorageContactList_UT; - -// DATA TYPES -//enum ?declaration -//typedef ?declaration -//extern ?data_type; - -// CLASS DECLARATION - -/** -* CCVIMPSTStorageContactList_UT test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS(CCVIMPSTStorageContactList_UT) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CCVIMPSTStorageContactList_UT* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~CCVIMPSTStorageContactList_UT(); - - public: // New functions - - /* - * This is a test function. - * This tests the NewL function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_NewL( CStifItemParser& aItem ); - - /* - * This is a test function. - * This tests the ListId function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_ListId( CStifItemParser& aItem ); - - /* - * This is a test function. - * This tests the ListId function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_DisplayName( CStifItemParser& aItem ); - - /* - * This is a test function. - * This tests the AddContactToList function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_AddContactToList( CStifItemParser& aItem ); - - /* - * This is a test function. - * This tests the RemoveContactFromList function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_RemoveContactFromList( CStifItemParser& aItem ); - - /* - * This is a test function. - * This tests the Count function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_Count( CStifItemParser& aItem ); - - /* - * This is a test function. - * This tests the FilteredContact function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_FilteredContact( CStifItemParser& aItem ); - - /* - * This is a test function. - * This tests the FilteredCount function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_FilteredCount( CStifItemParser& aItem ); - - /* - * This is a test function. - * This tests the FilterAllowsContact function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_FilterAllowsContact( CStifItemParser& aItem ); - - /* - * This is a test function. - * This tests the FindIndexOfContact function of the CVIMPSTStorageContactList - * class. - * @param: aItem,stif parser item to fetch parameters passed in the cfg file - * @return: integer, indicates the result of the test. If KErrNone - * is returned then it indicates that test case is passed. Any other - * return value indicates failure of the test. - */ - TInt Test_FindIndexOfContact( CStifItemParser& aItem ); - - /* - * This is a helper function. - * This function returns the desired filtered based on the - * integer passed into it. - * @param: a integer, indicating the filter. these integers are - * defined in the cfg file. - * @return: filtertype. - */ - TVIMPSTEnums::TFilterType GetFilter( TInt aFilter ); - - /* - * This is a helper function. - * This function returns the desired presence status - * based on the integer passed into it. - * @param: a integer, indicating the status. these integers are - * defined in the cfg file. - * @return: online status. - */ - TVIMPSTEnums::TOnlineStatus GetStatus( TInt aStatus ); - - /* - * This is a helper function. - * This function returns the a contact list with - * predefined contacts in it. Tester can change - * the contacts at will in this function for test - * purposes. - * The function does not take any params, because - * to create a long list, the param list will be - * long. - * @return: pointer to the contact list. - */ - MVIMPSTStorageContactList* GetList( ); - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - - private: - - /** - * C++ default constructor. - */ - CCVIMPSTStorageContactList_UT( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - // Prohibit copy constructor if not deriving from CBase. - // ?classname( const ?classname& ); - // Prohibit assigment operator if not deriving from CBase. - // ?classname& operator=( const ?classname& ); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - /** - * Test methods are listed below. - */ - - /** - * Method used to log version of test class - */ - void SendTestClassVersion(); - - //ADD NEW METHOD DEC HERE - //[TestMethods] - Do not remove - - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - private: // Data - - // ?one_line_short_description_of_data - //?data_declaration; - - // Reserved pointer for future extension - //TAny* iReserved; - - public: // Friend classes - //?friend_class_declaration; - protected: // Friend classes - //?friend_class_declaration; - private: // Friend classes - //?friend_class_declaration; - - }; - -#endif // CVIMPSTSTORAGECONTACTLIST_UT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/src/CVIMPSTStorageContactList_UT.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/src/CVIMPSTStorageContactList_UT.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -/* -* 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: This file contains testclass implementation. -* -*/ - -// INCLUDE FILES -#include -#include "CVIMPSTStorageContactList_UT.h" -#include - -// EXTERNAL DATA STRUCTURES -//extern ?external_data; - -// EXTERNAL FUNCTION PROTOTYPES -//extern ?external_function( ?arg_type,?arg_type ); - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def - -// LOCAL CONSTANTS AND MACROS -//const ?type ?constant_var = ?constant; -//#define ?macro_name ?macro_def - -// MODULE DATA STRUCTURES -//enum ?declaration -//typedef ?declaration - -// LOCAL FUNCTION PROTOTYPES -//?type ?function_name( ?arg_type, ?arg_type ); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; - -// ============================= LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// ?function_name ?description. -// ?description -// Returns: ?value_1: ?description -// ?value_n: ?description_line1 -// ?description_line2 -// ----------------------------------------------------------------------------- -// -/* -?type ?function_name( - ?arg_type arg, // ?description - ?arg_type arg) // ?description - { - - ?code // ?comment - - // ?comment - ?code - } -*/ - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::CCVIMPSTStorageContactList_UT -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCVIMPSTStorageContactList_UT::CCVIMPSTStorageContactList_UT( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCVIMPSTStorageContactList_UT::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(KCVIMPSTStorageContactList_UTLogFileWithTitle, &title); - } - else - { - logFileName.Copy(KCVIMPSTStorageContactList_UTLogFile); - } - - iLog = CStifLogger::NewL( KCVIMPSTStorageContactList_UTLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - SendTestClassVersion(); - } - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCVIMPSTStorageContactList_UT* CCVIMPSTStorageContactList_UT::NewL( - CTestModuleIf& aTestModuleIf ) - { - CCVIMPSTStorageContactList_UT* self = new (ELeave) CCVIMPSTStorageContactList_UT( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -CCVIMPSTStorageContactList_UT::~CCVIMPSTStorageContactList_UT() - { - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - } - -//----------------------------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::SendTestClassVersion -// Method used to send version of test class -//----------------------------------------------------------------------------- -// -void CCVIMPSTStorageContactList_UT::SendTestClassVersion() - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; - moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; - moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; - - TFileName moduleName; - moduleName = _L("CVIMPSTStorageContactList_UT.dll"); - - TBool newVersionOfMethod = ETrue; - TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) CCVIMPSTStorageContactList_UT::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/src/CVIMPSTStorageContactList_UTBlocks.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactlist_ut/src/CVIMPSTStorageContactList_UTBlocks.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,882 +0,0 @@ -/* -* 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: This file contains testclass implementation. -* -*/ - -// [INCLUDE FILES] - do not remove -#include -#include -#include -#include -#include "CVIMPSTStorageContactList_UT.h" -#include "vimpststorageutils.h" -#include "vimpstdebugassert.h" -#include "vimpststorageutils.h" -#include "tvimpststoragepanics.h" -#include "cvimpststoragecontact.h" - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void CCVIMPSTStorageContactList_UT::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt CCVIMPSTStorageContactList_UT::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - ENTRY( "Test_NewL", CCVIMPSTStorageContactList_UT::Test_NewL ), - ENTRY( "Test_ListId", CCVIMPSTStorageContactList_UT::Test_ListId ), - ENTRY( "Test_DisplayName", CCVIMPSTStorageContactList_UT::Test_DisplayName ), - ENTRY( "Test_AddContactToList", CCVIMPSTStorageContactList_UT::Test_AddContactToList ), - ENTRY( "Test_RemoveContactFromList", CCVIMPSTStorageContactList_UT::Test_RemoveContactFromList ), - ENTRY( "Test_Count", CCVIMPSTStorageContactList_UT::Test_Count ), - ENTRY( "Test_FilteredContact", CCVIMPSTStorageContactList_UT::Test_FilteredContact ), - ENTRY( "Test_FilterAllowsContact", CCVIMPSTStorageContactList_UT::Test_FilterAllowsContact ), - ENTRY( "Test_FilteredCount", CCVIMPSTStorageContactList_UT::Test_FilteredCount ), - ENTRY( "Test_FindIndexOfContact", CCVIMPSTStorageContactList_UT::Test_FindIndexOfContact ), - - //ADD NEW ENTRY HERE - // [test cases entries] - Do not remove - - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } -//----------------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::Test_NewL -// Function to test the NewL function of StorageContactList. -//----------------------------------------------------------------- -// -TInt CCVIMPSTStorageContactList_UT::Test_NewL( CStifItemParser& aItem ) - { - - TInt result = KErrGeneral; - - TPtrC listId; - TPtrC displayName; - - aItem.GetNextString( listId ); - if( listId.Compare( _L("null") ) == 0 ) - { - listId.Set( KNullDesC ); - } - - aItem.GetNextString( displayName ); - if( displayName.Compare( _L("null") ) == 0 ) - { - displayName.Set( KNullDesC ); - } - - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL(); - - CVIMPSTStorageContactList* contactList = - CVIMPSTStorageContactList::NewL( *sorter, listId, displayName ); - - if( contactList ) - { - result = KErrNone; - delete contactList; - } - - return result; - - } - -// ---------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::Test_ListId -// Function to test the ListId function of StorageContactList. -// ----------------------------------------------------------- -// -TInt CCVIMPSTStorageContactList_UT::Test_ListId( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TPtrC listId; - TPtrC displayName; - - aItem.GetNextString( listId ); - if( listId.Compare( _L("null") ) == 0 ) - { - listId.Set( KNullDesC ); - } - - displayName.Set( KNullDesC ); - - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL(); - - CVIMPSTStorageContactList* contactList = - CVIMPSTStorageContactList::NewL( *sorter, listId, displayName ); - - TPtrC resultListId; - resultListId.Set(contactList->ListId()); - - if( listId.Compare( resultListId ) == 0 ) - { - result = KErrNone; - } - - if( contactList ) - delete contactList; - - return result; - - } - -// ---------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::Test_DisplayName -// Function to test the ListId function of StorageContactList. -// ----------------------------------------------------------- -// -TInt CCVIMPSTStorageContactList_UT::Test_DisplayName( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TPtrC listId; - TPtrC displayName; - - aItem.GetNextString( displayName ); - if( displayName.Compare( _L("null") ) == 0 ) - { - displayName.Set( KNullDesC ); - } - aItem.GetNextString( listId ); - if( listId.Compare( _L("null") ) == 0 ) - { - listId.Set( KNullDesC ); - } - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL(); - - CVIMPSTStorageContactList* contactList = - CVIMPSTStorageContactList::NewL( *sorter, listId, displayName ); - - TPtrC resultDisplayName; - resultDisplayName.Set(contactList->DisplayName() ); - - if( displayName.Compare( resultDisplayName ) == 0 ) - { - result = KErrNone; - } - - if( contactList ) - delete contactList; - - return result; - - } - -// ---------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::Test_AddContactToList -// Function to test the AddStorageContactToCacheL function of StorageContactList. -// ----------------------------------------------------------- -// - -TInt CCVIMPSTStorageContactList_UT::Test_AddContactToList( CStifItemParser& aItem ) - { - TInt result = KErrNotFound; - - TInt flag; - - aItem.GetNextInt( flag ); - - CVIMPSTStorageContact* contact = NULL; - - //TVIMPSTEnums::TOnlineStatus status; - TBuf<64> userId; - TBuf<64> displayName; - - TBuf<64> listId; - - - userId.Copy( _L("jbl@nokia.com") ); - displayName.Copy( _L("Jabber Limited") ); - listId.Copy( _L("mycontacts") ); - - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL(); - - displayName.Copy( _L("my list") ); - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *sorter, listId, displayName ); - - TInt index = 0; // first element. - TInt err = 0; // no error - switch( flag ) - { - case 1: - { - // this case tests addition of a normal contact to - // the contactlist. - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - err = list->AddStorageContactToCacheL( contact, index ); - - if( 0 == err ) - result = KErrNone; - - break; - } - case 2: - { - // this case tests addition of a null contact to the - // contactlist. - err = list->AddStorageContactToCacheL( contact, index ); - - if( KErrArgument == err ) - result = KErrNone; - - break; - } - case 3: - { - // this case tests addition of a contact by passing - // positive index. - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - index = 2; - - err = list->AddStorageContactToCacheL( contact, index ); - - if( 0 == err ) - result = KErrNone; - - break; - } - case 4: - { - // this case tests addition of a contact by passing negative - // index. - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - index = -2; - - err = list->AddStorageContactToCacheL( contact, index ); - - if( 0 == err ) - result = KErrNone; - - break; - } - case 5: - { - // this case tests addition of a contact by passing zero - // index. - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - index = 0; - - err = list->AddStorageContactToCacheL( contact, index ); - - if( 0 == err ) - result = KErrNone; - - break; - } - case 6: - { - // This case adds same contact twice. - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - list->AddStorageContactToCacheL( contact, index ); - - index++; - - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - err = list->AddStorageContactToCacheL( contact, index ); - - if( KErrAlreadyExists == err ) - result = KErrNone; - - break; - } - case 7: - { - - TInt err1, err2, err3; - - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - err1 = list->AddStorageContactToCacheL( contact, index ); - - userId.Copy( _L("bose@nokia.com") ); - displayName.Copy( _L("Boss") ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - err2 = list->AddStorageContactToCacheL( contact, index ); - - userId.Copy( _L("logitect@nokia.com") ); - displayName.Copy( _L("Logis") ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - err3 = list->AddStorageContactToCacheL( contact, index ); - - if( !err1 && !err2 && !err3) - result = KErrNone; - - break; - } - - } - return result; - - } - -// ---------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::Test_RemoveContactFromList -// Function to test the RemoveContactFromList function of StorageContactList. -// ----------------------------------------------------------- -// - -TInt CCVIMPSTStorageContactList_UT::Test_RemoveContactFromList( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - /* Currently no test cases related to this function - * because we phonebook is stubbed and contactlink - * is always returned as null. - * Once corrected, test cases can be written. - */ - - return result; - } -// ----------------------------------------------------------------------------- -// -TInt CCVIMPSTStorageContactList_UT::Test_Count( CStifItemParser& aItem ) - { - - TInt result = KErrGeneral; - - TInt flag; - - aItem.GetNextInt( flag ); - - TBuf<64> userId; - TBuf<64> listId; - TBuf<64> displayName; - CVIMPSTStorageContact* contact = NULL; - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL(); - listId.Copy( _L("mycontacts") ); - displayName.Copy( _L("my list") ); - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *sorter, listId, displayName ); - - TInt count = 0; // contacts count - TInt index = 0; - - switch( flag ) - { - case 1: - { - userId.Copy( _L("logitect@nokia.com") ); - displayName.Copy( _L("Logis") ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - if( !list->AddStorageContactToCacheL( contact, index ) ) - { - count++; - } - - userId.Copy( _L("bose@nokia.com") ); - displayName.Copy( _L("Boss") ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - if( !list->AddStorageContactToCacheL( contact, index ) ) - { - count++; - } - - // adding same contact, won't be added to list. - userId.Copy( _L("logitect@nokia.com") ); - displayName.Copy( _L("argen") ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - if( !list->AddStorageContactToCacheL( contact, index ) ) - { - count++; - } - - break; - } - case 2: - default: - { - // No contacts added - break; - } - } - - TInt listCount = list->Count(); - - if( listCount == count ) - { - result = KErrNone; - } - - delete list; - delete sorter; - - return result; - - } -// ---------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::Test_Count -// Function to test the Count function of StorageContactList. -// ----------------------------------------------------------- -// - -TInt CCVIMPSTStorageContactList_UT::Test_FilteredContact( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - MVIMPSTStorageContactList* list = GetList(); - - TInt flag; - aItem.GetNextInt( flag ); - - switch( flag ) - { - case 1: - { - // Variant 1. - MVIMPSTStorageContact& filteredContact = - list->FilteredContact( 0, TVIMPSTEnums::EFilterNonOffline); - //MVIMPSTStorageContact& filteredContact = (*list[0] - TInt compare = ( (*list)[0].UserId() ).Compare( filteredContact.UserId() ); - if( compare == 0 ) - result = KErrNone; - break; - } - case 2: - { - // Variant 2. - MVIMPSTStorageContact& filteredContact = - list->FilteredContact( 5, TVIMPSTEnums::EFilterNonOffline); - TInt compare = ( (*list)[5].UserId() ).Compare( filteredContact.UserId() ); - if( compare == 0 ) - result = KErrNone; - break; - } - case 3: - { - // Variant 3. - delete (CVIMPSTStorageContactSorter *) list; - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL(); - list = CVIMPSTStorageContactList::NewL( *sorter, _L("MyList"), _L("display") ); - MVIMPSTStorageContact& filteredContact = - list->FilteredContact( 1, TVIMPSTEnums::EFilterAway); - TInt compare = ( (*list)[6].UserId() ).Compare( filteredContact.UserId() ); - if( compare == 0 ) - result = KErrNone; - break; - } - } - - delete (CVIMPSTStorageContactSorter *) list; - - return result; - } - -// ---------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::Test_Count -// Function to test the Count function of StorageContactList. -// ----------------------------------------------------------- -// - -TInt CCVIMPSTStorageContactList_UT::Test_FilterAllowsContact( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TInt inputFilter; - TInt testCaseNumber; - TPtrC inputString; - TVIMPSTEnums::TFilterType filter; - - aItem.GetNextString( inputString ); - aItem.GetNextInt( inputFilter ); - aItem.GetNextInt( testCaseNumber ); - - CVIMPSTStorageContact* contact = NULL; - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL(); - - // Creating a contactList - TBuf<64> listId; - TBuf<64> displayName; - - listId.Copy( _L("contacts.manu") ); - displayName.Copy( _L("Personal Contacts") ); - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *sorter, listId, displayName ); - - TVIMPSTEnums::TOnlineStatus status; - // Create a list of 8 contacts - - filter = GetFilter( inputFilter ); - - if( inputString.Compare( _L("null") ) != 0 ) - { - TBuf<64> userId; - TInt index = 0; - // contact number 1 - userId.Copy( _L("prashanth.ds@infosys.com") ); - if( 31 != testCaseNumber ) - { - status = TVIMPSTEnums::EOnline; - } - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( status ); - list->AddStorageContactToCacheL( contact, index ); - } - - TBool funcValue; - funcValue = list->FilterAllowsContact( contact, filter ); - - if( !funcValue && testCaseNumber == 28 ) - result = KErrNone; - - if( funcValue && testCaseNumber == 29 ) - result = KErrNone; - - if( !funcValue && testCaseNumber == 30 ) - result = KErrNone; - - if( funcValue && testCaseNumber == 31 ) - result = KErrNone; - - delete sorter; - delete list; - - return result; - } - -// ---------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::FilteredCount -// ----------------------------------------------------------- -// - -TInt CCVIMPSTStorageContactList_UT::Test_FilteredCount( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - MVIMPSTStorageContactList* list = GetList(); - - TInt inputFilter; - - aItem.GetNextInt( inputFilter ); - - TVIMPSTEnums::TFilterType filter; - - switch( inputFilter ) - { - case 1: - { - filter = TVIMPSTEnums::EFilterNotDefined; - if( 0 == list->FilteredCount( filter ) ) - { - result = KErrNone; - } - } - break; - case 2: - { - filter = TVIMPSTEnums::EFilterOnline; - if( 4 == list->FilteredCount( filter ) ) - { - result = KErrNone; - } - } - break; - case 3: - { - if( list->FilteredCount( filter ) ) - { - result = KErrNone; - } - } - break; - } - delete (CVIMPSTStorageContactSorter *)list; - return result; - } - - -TInt CCVIMPSTStorageContactList_UT::Test_FindIndexOfContact( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - CVIMPSTStorageContactList* list = (CVIMPSTStorageContactList *) GetList(); - - MVIMPSTStorageContact* contact = NULL; - - contact = CVIMPSTStorageContact::NewL( KNullDesC, KNullDesC ); - - TInt inputFilter; - - aItem.GetNextInt( inputFilter ); - - TVIMPSTEnums::TFilterType filter; - - filter = TVIMPSTEnums::EFilterOnline; - - switch( inputFilter ) - { - case 1: - { - MVIMPSTStorageContact& contact1 = (*list)[0]; - - if( 0 == list->FindIndexOfContact( &contact1 ) ) - { - result = KErrNone; - } - } - break; - case 2: - { - MVIMPSTStorageContact& contact1 = (*list)[2]; - - if( 2 == list->FindIndexOfContact( &contact1, filter ) ) - { - result = KErrNone; - } - } - break; - case 3: - { - MVIMPSTStorageContact& contact1 = (*list)[5]; - - if( KErrNotFound == list->FindIndexOfContact( &contact1, filter ) ) - { - result = KErrNone; - } - } - break; - } - - delete (CVIMPSTStorageContact *) contact; - delete (CVIMPSTStorageContactSorter *)list; - - return result; - } - -// ---------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::GetFilter -// ----------------------------------------------------------- -// - -TVIMPSTEnums::TFilterType CCVIMPSTStorageContactList_UT::GetFilter( TInt aFilter ) - { - TVIMPSTEnums::TFilterType filter; - switch( aFilter ) - { - case -1: - { - filter = TVIMPSTEnums::EFilterNotDefined; - } - break; - case 0: - { - filter = TVIMPSTEnums::EFilterAll; - } - break; - case 1: - { - filter = TVIMPSTEnums::EFilterAndOperation; - } - break; - case 2: - { - filter = TVIMPSTEnums::EFilterOnline; - } - break; - case 4: - { - filter = TVIMPSTEnums::EFilterNonBlocked; - } - break; - case 8: - { - filter = TVIMPSTEnums::EFilterAway; - } - break; - case 16: - { - filter = TVIMPSTEnums::EFilterNonOffline; - } - break; - - } - - return filter; - - } - -// ---------------------------------------------------------- -// CCVIMPSTStorageContactList_UT::GetStatus -// ----------------------------------------------------------- -// -TVIMPSTEnums::TOnlineStatus CCVIMPSTStorageContactList_UT::GetStatus( TInt aStatus ) - { - TVIMPSTEnums::TOnlineStatus status; - switch( aStatus ) - { - case 0: - { - status = TVIMPSTEnums::EUnknown; - } - break; - case 1: - { - status = TVIMPSTEnums::EOffline; - } - break; - case 2: - { - status = TVIMPSTEnums::EOnline; - } - break; - case 3: - { - status = TVIMPSTEnums::EInvisible; - } - break; - case 4: - { - status = TVIMPSTEnums::EAway; - } - break; - case 5: - { - status = TVIMPSTEnums::EBusy; - } - break; - case 6: - { - status = TVIMPSTEnums::EOnPhone; - } - break; - case 7: - { - status = TVIMPSTEnums::EDoNotDisturb; - } - break; - case 8: - { - status = TVIMPSTEnums::EPending; - } - break; - case 9: - { - status = TVIMPSTEnums::EBlocked; - } - break; - } - return status; - - } - -MVIMPSTStorageContactList* CCVIMPSTStorageContactList_UT::GetList( ) - { - CVIMPSTStorageContact* contact = NULL; - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL(); - - // Creating a contactList - TBuf<64> listId; - TBuf<64> displayName; - - listId.Copy( _L("contacts.manu") ); - displayName.Copy( _L("Personal Contacts") ); - - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *sorter, listId, displayName ); - - // Create a list of 8 contacts - - TBuf<64> userId; - TVIMPSTEnums::TOnlineStatus status; - TInt index = 0; - // contact number 1 - userId.Copy( _L("prashanth.ds@infosys.com") ); - displayName.Copy( _L("prashanth") ); - status = TVIMPSTEnums::EOnline; - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( status ); - list->AddStorageContactToCacheL( contact, index ); - - // contact number 2 - userId.Copy( _L("dovin.fern@tcs.com") ); - displayName.Copy( _L("dovin") ); - status = TVIMPSTEnums::EOnline; - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( status ); - list->AddStorageContactToCacheL( contact, index ); - - // contact number 3 - userId.Copy( _L("basavaraj.hn@accenture.com") ); - displayName.Copy( _L("basava") ); - status = TVIMPSTEnums::EOnline; - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( status ); - list->AddStorageContactToCacheL( contact, index ); - - // contact number 4 - userId.Copy( _L("nandan.av@tcs.com") ); - displayName.Copy( _L("nandan") ); - status = TVIMPSTEnums::EOnline; - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( status ); - list->AddStorageContactToCacheL( contact, index ); - - // contact number 5 - userId.Copy( _L("mithun.shettigara@tataelxsi.com") ); - displayName.Copy( _L("Mithun") ); - status = TVIMPSTEnums::EOffline; - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( status ); - list->AddStorageContactToCacheL( contact, index ); - - // contact number 6 - userId.Copy( _L("santosh.wagle@bel.com") ); - displayName.Copy( _L("Santhosh") ); - status = TVIMPSTEnums::EAway; - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( status ); - list->AddStorageContactToCacheL( contact, index ); - - // contact number 7 - userId.Copy( _L("sandeep.hebbar@tcs.com") ); - displayName.Copy( _L("Sandeep") ); - status = TVIMPSTEnums::EPending; - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( status ); - list->AddStorageContactToCacheL( contact, index ); - - // contact number 8 - userId.Copy( _L("niranjan.murthy@mindtree.com") ); - displayName.Copy( _L("Niranjan") ); - status = TVIMPSTEnums::EBusy; - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( status ); - list->AddStorageContactToCacheL( contact, index ); - - - return list; - - } -// [End of File] - Do not remove diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/bmarm/cvimpststoragecontactsorter_utu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/bmarm/cvimpststoragecontactsorter_utu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - LibEntryL__FR13CTestModuleIf @ 1 NONAME R3UNUSED ; LibEntryL(CTestModuleIf &) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/bwins/cvimpststoragecontactsorter_utu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/bwins/cvimpststoragecontactsorter_utu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +0,0 @@ -EXPORTS - ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * __cdecl LibEntryL(class CTestModuleIf &) - ??0CActive@@IAE@H@Z @ 2 NONAME ; CActive::CActive(int) - ??0CActiveSchedulerWait@@QAE@XZ @ 3 NONAME ; CActiveSchedulerWait::CActiveSchedulerWait(void) - ??0TVPbkContactStoreUriPtr@@QAE@ABVTDesC16@@@Z @ 4 NONAME ; TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(class TDesC16 const &) - ??0TVPbkContactStoreUriPtr@@QAE@XZ @ 5 NONAME ; TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(void) - ??1CActive@@UAE@XZ @ 6 NONAME ; CActive::~CActive(void) - ??1CActiveSchedulerWait@@UAE@XZ @ 7 NONAME ; CActiveSchedulerWait::~CActiveSchedulerWait(void) - ??ACVPbkContactStoreUriArray@@QBE?AVTVPbkContactStoreUriPtr@@H@Z @ 8 NONAME ; class TVPbkContactStoreUriPtr CVPbkContactStoreUriArray::operator[](int) const - ?Add@CActiveScheduler@@SAXPAVCActive@@@Z @ 9 NONAME ; void CActiveScheduler::Add(class CActive *) - ?AddContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 10 NONAME ; void CPbk2StoreConfiguration::AddContactStoreURIL(class TVPbkContactStoreUriPtr) - ?AddDefaultSavingStoreObserverL@CPbk2StoreConfiguration@@QAEXAAVMPbk2DefaultSavingStoreObserver@@@Z @ 11 NONAME ; void CPbk2StoreConfiguration::AddDefaultSavingStoreObserverL(class MPbk2DefaultSavingStoreObserver &) - ?AddObserverL@CPbk2SortOrderManager@@QAEXAAVMPbk2SortOrderObserver@@@Z @ 12 NONAME ; void CPbk2SortOrderManager::AddObserverL(class MPbk2SortOrderObserver &) - ?AddObserverL@CPbk2StoreConfiguration@@QAEXAAVMPbk2StoreConfigurationObserver@@@Z @ 13 NONAME ; void CPbk2StoreConfiguration::AddObserverL(class MPbk2StoreConfigurationObserver &) - ?AddSubViewL@CVPbkContactViewDefinition@@QAEXPAV1@@Z @ 14 NONAME ; void CVPbkContactViewDefinition::AddSubViewL(class CVPbkContactViewDefinition *) - ?AddSupportedContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 15 NONAME ; void CPbk2StoreConfiguration::AddSupportedContactStoreURIL(class TVPbkContactStoreUriPtr) - ?AppendAllL@CVPbkContactStoreUriArray@@QAEXABV1@@Z @ 16 NONAME ; void CVPbkContactStoreUriArray::AppendAllL(class CVPbkContactStoreUriArray const &) - ?AppendL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@@Z @ 17 NONAME ; void CVPbkContactLinkArray::AppendL(class MVPbkContactLink *) - ?AppendL@CVPbkContactStoreUriArray@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 18 NONAME ; void CVPbkContactStoreUriArray::AppendL(class TVPbkContactStoreUriPtr const &) - ?AsyncStop@CActiveSchedulerWait@@QAEXXZ @ 19 NONAME ; void CActiveSchedulerWait::AsyncStop(void) - ?Cancel@CActive@@QAEXXZ @ 20 NONAME ; void CActive::Cancel(void) - ?Cast@MVPbkContactFieldBinaryData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 21 NONAME ; class MVPbkContactFieldBinaryData & MVPbkContactFieldBinaryData::Cast(class MVPbkContactFieldData &) - ?Cast@MVPbkContactFieldBinaryData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 22 NONAME ; class MVPbkContactFieldBinaryData const & MVPbkContactFieldBinaryData::Cast(class MVPbkContactFieldData const &) - ?Cast@MVPbkContactFieldTextData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 23 NONAME ; class MVPbkContactFieldTextData & MVPbkContactFieldTextData::Cast(class MVPbkContactFieldData &) - ?Cast@MVPbkContactFieldTextData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 24 NONAME ; class MVPbkContactFieldTextData const & MVPbkContactFieldTextData::Cast(class MVPbkContactFieldData const &) - ?Cast@MVPbkContactFieldUriData@@SAAAV1@AAVMVPbkContactFieldData@@@Z @ 25 NONAME ; class MVPbkContactFieldUriData & MVPbkContactFieldUriData::Cast(class MVPbkContactFieldData &) - ?Cast@MVPbkContactFieldUriData@@SAABV1@ABVMVPbkContactFieldData@@@Z @ 26 NONAME ; class MVPbkContactFieldUriData const & MVPbkContactFieldUriData::Cast(class MVPbkContactFieldData const &) - ?CommitContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABV?$TArray@PAVMVPbkStoreContact@@@@AAVMVPbkBatchOperationObserver@@@Z @ 27 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CommitContactsL(class TArray const &, class MVPbkBatchOperationObserver &) - ?Compare@TVPbkContactStoreUriPtr@@QBEHABV1@W4TVPbkContactStoreUriComponent@1@@Z @ 28 NONAME ; int TVPbkContactStoreUriPtr::Compare(class TVPbkContactStoreUriPtr const &, enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?Compare@TVPbkContactStoreUriPtr@@QBEHABVTDesC16@@W4TVPbkContactStoreUriComponent@1@@Z @ 29 NONAME ; int TVPbkContactStoreUriPtr::Compare(class TDesC16 const &, enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?Component@TVPbkContactStoreUriPtr@@QBE?BVTPtrC16@@W4TVPbkContactStoreUriComponent@1@@Z @ 30 NONAME ; class TPtrC16 const TVPbkContactStoreUriPtr::Component(enum TVPbkContactStoreUriPtr::TVPbkContactStoreUriComponent) const - ?CompressStoresL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@AAVMVPbkBatchOperationObserver@@@Z @ 31 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CompressStoresL(class MVPbkBatchOperationObserver &) - ?ContactAttributeManagerL@CVPbkContactManager@@QAEAAVMVPbkContactAttributeManager@@XZ @ 32 NONAME ; class MVPbkContactAttributeManager & CVPbkContactManager::ContactAttributeManagerL(void) - ?ContactSelector@CVPbkContactViewDefinition@@QBEPAVMVPbkContactSelector@@XZ @ 33 NONAME ; class MVPbkContactSelector * CVPbkContactViewDefinition::ContactSelector(void) const - ?ContactStoresL@CVPbkContactManager@@QAEAAVMVPbkContactStoreList@@XZ @ 34 NONAME ; class MVPbkContactStoreList & CVPbkContactManager::ContactStoresL(void) - ?CopyContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMVPbkContactLinkArray@@PAVMVPbkContactStore@@AAVMVPbkBatchOperationObserver@@@Z @ 35 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::CopyContactsL(class MVPbkContactLinkArray const &, class MVPbkContactStore *, class MVPbkBatchOperationObserver &) - ?Count@CVPbkContactStoreUriArray@@QBEHXZ @ 36 NONAME ; int CVPbkContactStoreUriArray::Count(void) const - ?CreateContactViewLC@CVPbkContactManager@@QBEPAVMVPbkContactViewBase@@AAVMVPbkContactViewObserver@@ABVCVPbkContactViewDefinition@@ABVMVPbkFieldTypeList@@@Z @ 37 NONAME ; class MVPbkContactViewBase * CVPbkContactManager::CreateContactViewLC(class MVPbkContactViewObserver &, class CVPbkContactViewDefinition const &, class MVPbkFieldTypeList const &) const - ?CreateLinksLC@CVPbkContactManager@@QBEPAVMVPbkContactLinkArray@@AAVRReadStream@@@Z @ 38 NONAME ; class MVPbkContactLinkArray * CVPbkContactManager::CreateLinksLC(class RReadStream &) const - ?CreateLinksLC@CVPbkContactManager@@QBEPAVMVPbkContactLinkArray@@ABVTDesC8@@@Z @ 39 NONAME ; class MVPbkContactLinkArray * CVPbkContactManager::CreateLinksLC(class TDesC8 const &) const - ?CurrentConfigurationL@CPbk2StoreConfiguration@@QBEPAVCVPbkContactStoreUriArray@@XZ @ 40 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::CurrentConfigurationL(void) const - ?CurrentSeparator@CPbk2SortOrderManager@@QBEABVTDesC16@@XZ @ 41 NONAME ; class TDesC16 const & CPbk2SortOrderManager::CurrentSeparator(void) const - ?DefaultCntDbUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 42 NONAME ; class TDesC16 const & VPbkContactStoreUris::DefaultCntDbUri(void) - ?DefaultSavingStoreL@CPbk2StoreConfiguration@@QBE?AVTVPbkContactStoreUriPtr@@XZ @ 43 NONAME ; class TVPbkContactStoreUriPtr CPbk2StoreConfiguration::DefaultSavingStoreL(void) const - ?DefaultSeparator@CPbk2SortOrderManager@@QAEABVTDesC16@@XZ @ 44 NONAME ; class TDesC16 const & CPbk2SortOrderManager::DefaultSeparator(void) - ?Delete@CVPbkContactLinkArray@@QAEXH@Z @ 45 NONAME ; void CVPbkContactLinkArray::Delete(int) - ?DeleteContactsL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMVPbkContactLinkArray@@AAVMVPbkBatchOperationObserver@@@Z @ 46 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::DeleteContactsL(class MVPbkContactLinkArray const &, class MVPbkBatchOperationObserver &) - ?Deque@CActive@@QAEXXZ @ 47 NONAME ; void CActive::Deque(void) - ?Extension_@CActive@@MAEHIAAPAXPAX@Z @ 48 NONAME ; int CActive::Extension_(unsigned int, void * &, void *) - ?ExternalizeL@TVPbkContactStoreUriPtr@@UBEXAAVRWriteStream@@@Z @ 49 NONAME ; void TVPbkContactStoreUriPtr::ExternalizeL(class RWriteStream &) const - ?ExternalizedSize@TVPbkContactStoreUriPtr@@UBEHXZ @ 50 NONAME ; int TVPbkContactStoreUriPtr::ExternalizedSize(void) const - ?FieldTypeFilter@CVPbkContactViewDefinition@@QBEPAVCVPbkFieldTypeSelector@@XZ @ 51 NONAME ; class CVPbkFieldTypeSelector * CVPbkContactViewDefinition::FieldTypeFilter(void) const - ?FieldTypes@CVPbkContactManager@@QBEABVMVPbkFieldTypeList@@XZ @ 52 NONAME ; class MVPbkFieldTypeList const & CVPbkContactManager::FieldTypes(void) const - ?FindL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVMDesC16Array@@ABVMVPbkFieldTypeList@@AAVMVPbkContactFindFromStoresObserver@@ABVTCallBack@@@Z @ 53 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::FindL(class MDesC16Array const &, class MVPbkFieldTypeList const &, class MVPbkContactFindFromStoresObserver &, class TCallBack const &) - ?FindL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVTDesC16@@ABVMVPbkFieldTypeList@@AAVMVPbkContactFindObserver@@@Z @ 54 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::FindL(class TDesC16 const &, class MVPbkFieldTypeList const &, class MVPbkContactFindObserver &) - ?FlagIsOn@CVPbkContactViewDefinition@@QBEHW4TVPbkContactViewFlag@@@Z @ 55 NONAME ; int CVPbkContactViewDefinition::FlagIsOn(enum TVPbkContactViewFlag) const - ?FsSession@CVPbkContactManager@@QAEAAVRFs@@XZ @ 56 NONAME ; class RFs & CVPbkContactManager::FsSession(void) - ?Id@CVPbkContactViewDefinition@@QBEHXZ @ 57 NONAME ; int CVPbkContactViewDefinition::Id(void) const - ?InsertL@CVPbkContactLinkArray@@QAEXPAVMVPbkContactLink@@H@Z @ 58 NONAME ; void CVPbkContactLinkArray::InsertL(class MVPbkContactLink *, int) - ?IsIncluded@CVPbkContactStoreUriArray@@QBEHABVTVPbkContactStoreUriPtr@@@Z @ 59 NONAME ; int CVPbkContactStoreUriArray::IsIncluded(class TVPbkContactStoreUriPtr const &) const - ?Length@TVPbkContactStoreUriPtr@@QBEHXZ @ 60 NONAME ; int TVPbkContactStoreUriPtr::Length(void) const - ?LoadContactStoreL@CVPbkContactManager@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 61 NONAME ; void CVPbkContactManager::LoadContactStoreL(class TVPbkContactStoreUriPtr const &) - ?MatchPhoneNumberL@CVPbkContactManager@@QAEPAVMVPbkContactOperationBase@@ABVTDesC16@@HAAVMVPbkContactFindObserver@@@Z @ 62 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::MatchPhoneNumberL(class TDesC16 const &, int, class MVPbkContactFindObserver &) - ?Name@CVPbkContactViewDefinition@@QBEABVTDesC16@@XZ @ 63 NONAME ; class TDesC16 const & CVPbkContactViewDefinition::Name(void) const - ?NameDisplayOrder@CPbk2SortOrderManager@@QBE?AW4TPbk2NameDisplayOrder@1@XZ @ 64 NONAME ; enum CPbk2SortOrderManager::TPbk2NameDisplayOrder CPbk2SortOrderManager::NameDisplayOrder(void) const - ?NewL@CPbk2SortOrderManager@@SAPAV1@ABVMVPbkFieldTypeList@@PAVRFs@@@Z @ 65 NONAME ; class CPbk2SortOrderManager * CPbk2SortOrderManager::NewL(class MVPbkFieldTypeList const &, class RFs *) - ?NewL@CPbk2StoreConfiguration@@SAPAV1@XZ @ 66 NONAME ; class CPbk2StoreConfiguration * CPbk2StoreConfiguration::NewL(void) - ?NewL@CVPbkContactLinkArray@@SAPAV1@XZ @ 67 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewL(void) - ?NewL@CVPbkContactManager@@SAPAV1@ABVCVPbkContactStoreUriArray@@PAVRFs@@@Z @ 68 NONAME ; class CVPbkContactManager * CVPbkContactManager::NewL(class CVPbkContactStoreUriArray const &, class RFs *) - ?NewL@CVPbkContactManager@@SAPAV1@VTSecurityInfo@@ABVCVPbkContactStoreUriArray@@PAVRFs@@@Z @ 69 NONAME ; class CVPbkContactManager * CVPbkContactManager::NewL(class TSecurityInfo, class CVPbkContactStoreUriArray const &, class RFs *) - ?NewL@CVPbkContactStoreUriArray@@SAPAV1@XZ @ 70 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewL(void) - ?NewL@CVPbkContactViewDefinition@@SAPAV1@AAVTResourceReader@@@Z @ 71 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(class TResourceReader &) - ?NewL@CVPbkContactViewDefinition@@SAPAV1@ABV1@@Z @ 72 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(class CVPbkContactViewDefinition const &) - ?NewL@CVPbkContactViewDefinition@@SAPAV1@XZ @ 73 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewL(void) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@AAVRReadStream@@ABVMVPbkContactStoreList@@@Z @ 74 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class RReadStream &, class MVPbkContactStoreList const &) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@ABVTDesC8@@ABVMVPbkContactStoreList@@@Z @ 75 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(class TDesC8 const &, class MVPbkContactStoreList const &) - ?NewLC@CVPbkContactLinkArray@@SAPAV1@XZ @ 76 NONAME ; class CVPbkContactLinkArray * CVPbkContactLinkArray::NewLC(void) - ?NewLC@CVPbkContactStoreUriArray@@SAPAV1@ABVTDesC8@@@Z @ 77 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewLC(class TDesC8 const &) - ?NewLC@CVPbkContactStoreUriArray@@SAPAV1@XZ @ 78 NONAME ; class CVPbkContactStoreUriArray * CVPbkContactStoreUriArray::NewLC(void) - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@AAVTResourceReader@@@Z @ 79 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(class TResourceReader &) - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@ABV1@@Z @ 80 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(class CVPbkContactViewDefinition const &) - ?NewLC@CVPbkContactViewDefinition@@SAPAV1@XZ @ 81 NONAME ; class CVPbkContactViewDefinition * CVPbkContactViewDefinition::NewLC(void) - ?PackLC@CVPbkContactStoreUriArray@@QBEPAVHBufC8@@XZ @ 82 NONAME ; class HBufC8 * CVPbkContactStoreUriArray::PackLC(void) const - ?PackedBufferSize@CVPbkContactLinkArray@@QBEHXZ @ 83 NONAME ; int CVPbkContactLinkArray::PackedBufferSize(void) const - ?Pbk2AppUi@Phonebook2@@YAPAVMPbk2AppUi@@XZ @ 84 NONAME ; class MPbk2AppUi * Phonebook2::Pbk2AppUi(void) - ?Remove@CVPbkContactLinkArray@@QAEXH@Z @ 85 NONAME ; void CVPbkContactLinkArray::Remove(int) - ?Remove@CVPbkContactStoreUriArray@@QAEXABVTVPbkContactStoreUriPtr@@@Z @ 86 NONAME ; void CVPbkContactStoreUriArray::Remove(class TVPbkContactStoreUriPtr const &) - ?RemoveContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 87 NONAME ; void CPbk2StoreConfiguration::RemoveContactStoreURIL(class TVPbkContactStoreUriPtr) - ?RemoveDefaultSavingStoreObserver@CPbk2StoreConfiguration@@QAEXAAVMPbk2DefaultSavingStoreObserver@@@Z @ 88 NONAME ; void CPbk2StoreConfiguration::RemoveDefaultSavingStoreObserver(class MPbk2DefaultSavingStoreObserver &) - ?RemoveObserver@CPbk2SortOrderManager@@QAEXAAVMPbk2SortOrderObserver@@@Z @ 89 NONAME ; void CPbk2SortOrderManager::RemoveObserver(class MPbk2SortOrderObserver &) - ?RemoveObserver@CPbk2StoreConfiguration@@QAEXAAVMPbk2StoreConfigurationObserver@@@Z @ 90 NONAME ; void CPbk2StoreConfiguration::RemoveObserver(class MPbk2StoreConfigurationObserver &) - ?RemoveSupportedContactStoreURIL@CPbk2StoreConfiguration@@QAEXVTVPbkContactStoreUriPtr@@@Z @ 91 NONAME ; void CPbk2StoreConfiguration::RemoveSupportedContactStoreURIL(class TVPbkContactStoreUriPtr) - ?Reset@CVPbkContactLinkArray@@QAEXXZ @ 92 NONAME ; void CVPbkContactLinkArray::Reset(void) - ?ResetAndDestroy@CVPbkContactLinkArray@@QAEXXZ @ 93 NONAME ; void CVPbkContactLinkArray::ResetAndDestroy(void) - ?RetrieveContactL@CVPbkContactManager@@QBEPAVMVPbkContactOperationBase@@ABVMVPbkContactLink@@AAVMVPbkSingleContactOperationObserver@@@Z @ 94 NONAME ; class MVPbkContactOperationBase * CVPbkContactManager::RetrieveContactL(class MVPbkContactLink const &, class MVPbkSingleContactOperationObserver &) const - ?RunError@CActive@@MAEHH@Z @ 95 NONAME ; int CActive::RunError(int) - ?SearchStoreConfigurationL@CPbk2StoreConfiguration@@QAEPAVCVPbkContactStoreUriArray@@XZ @ 96 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::SearchStoreConfigurationL(void) - ?Set@TVPbkContactStoreUriPtr@@QAEXABV1@@Z @ 97 NONAME ; void TVPbkContactStoreUriPtr::Set(class TVPbkContactStoreUriPtr const &) - ?SetActive@CActive@@IAEXXZ @ 98 NONAME ; void CActive::SetActive(void) - ?SetContactSelector@CVPbkContactViewDefinition@@QAEXPAVMVPbkContactSelector@@@Z @ 99 NONAME ; void CVPbkContactViewDefinition::SetContactSelector(class MVPbkContactSelector *) - ?SetContactViewL@CPbk2SortOrderManager@@QAEXAAVMVPbkContactViewBase@@@Z @ 100 NONAME ; void CPbk2SortOrderManager::SetContactViewL(class MVPbkContactViewBase &) - ?SetFieldTypeFilterL@CVPbkContactViewDefinition@@QAEXPAVCVPbkFieldTypeSelector@@@Z @ 101 NONAME ; void CVPbkContactViewDefinition::SetFieldTypeFilterL(class CVPbkFieldTypeSelector *) - ?SetFlag@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewFlag@@H@Z @ 102 NONAME ; void CVPbkContactViewDefinition::SetFlag(enum TVPbkContactViewFlag, int) - ?SetId@CVPbkContactViewDefinition@@QAEXH@Z @ 103 NONAME ; void CVPbkContactViewDefinition::SetId(int) - ?SetNameDisplayOrderL@CPbk2SortOrderManager@@QAEXW4TPbk2NameDisplayOrder@1@ABVTDesC16@@@Z @ 104 NONAME ; void CPbk2SortOrderManager::SetNameDisplayOrderL(enum CPbk2SortOrderManager::TPbk2NameDisplayOrder, class TDesC16 const &) - ?SetNameL@CVPbkContactViewDefinition@@QAEXABVTDesC16@@@Z @ 105 NONAME ; void CVPbkContactViewDefinition::SetNameL(class TDesC16 const &) - ?SetPriority@CActive@@QAEXH@Z @ 106 NONAME ; void CActive::SetPriority(int) - ?SetSharing@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewSharing@@@Z @ 107 NONAME ; void CVPbkContactViewDefinition::SetSharing(enum TVPbkContactViewSharing) - ?SetSortPolicy@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewSortPolicy@@@Z @ 108 NONAME ; void CVPbkContactViewDefinition::SetSortPolicy(enum TVPbkContactViewSortPolicy) - ?SetType@CVPbkContactViewDefinition@@QAEXW4TVPbkContactViewType@@@Z @ 109 NONAME ; void CVPbkContactViewDefinition::SetType(enum TVPbkContactViewType) - ?SetUriL@CVPbkContactViewDefinition@@QAEXABVTDesC16@@@Z @ 110 NONAME ; void CVPbkContactViewDefinition::SetUriL(class TDesC16 const &) - ?Sharing@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewSharing@@XZ @ 111 NONAME ; enum TVPbkContactViewSharing CVPbkContactViewDefinition::Sharing(void) const - ?SimGlobalAdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 112 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalAdnUri(void) - ?SimGlobalFdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 113 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalFdnUri(void) - ?SimGlobalOwnNumberUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 114 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalOwnNumberUri(void) - ?SimGlobalSdnUri@VPbkContactStoreUris@@YAABVTDesC16@@XZ @ 115 NONAME ; class TDesC16 const & VPbkContactStoreUris::SimGlobalSdnUri(void) - ?SortOrder@CPbk2SortOrderManager@@QBEABVMVPbkFieldTypeList@@XZ @ 116 NONAME ; class MVPbkFieldTypeList const & CPbk2SortOrderManager::SortOrder(void) const - ?SortPolicy@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewSortPolicy@@XZ @ 117 NONAME ; enum TVPbkContactViewSortPolicy CVPbkContactViewDefinition::SortPolicy(void) const - ?Start@CActiveSchedulerWait@@QAEXXZ @ 118 NONAME ; void CActiveSchedulerWait::Start(void) - ?Start@CPeriodic@@QAEXVTTimeIntervalMicroSeconds32@@0VTCallBack@@@Z @ 119 NONAME ; void CPeriodic::Start(class TTimeIntervalMicroSeconds32, class TTimeIntervalMicroSeconds32, class TCallBack) - ?SubViewAt@CVPbkContactViewDefinition@@QAEAAV1@H@Z @ 120 NONAME ; class CVPbkContactViewDefinition & CVPbkContactViewDefinition::SubViewAt(int) - ?SubViewAt@CVPbkContactViewDefinition@@QBEABV1@H@Z @ 121 NONAME ; class CVPbkContactViewDefinition const & CVPbkContactViewDefinition::SubViewAt(int) const - ?SubViewCount@CVPbkContactViewDefinition@@QBEHXZ @ 122 NONAME ; int CVPbkContactViewDefinition::SubViewCount(void) const - ?SupportedStoreConfigurationL@CPbk2StoreConfiguration@@QBEPAVCVPbkContactStoreUriArray@@XZ @ 123 NONAME ; class CVPbkContactStoreUriArray * CPbk2StoreConfiguration::SupportedStoreConfigurationL(void) const - ?Type@CVPbkContactViewDefinition@@QBE?AW4TVPbkContactViewType@@XZ @ 124 NONAME ; enum TVPbkContactViewType CVPbkContactViewDefinition::Type(void) const - ?Uri@CVPbkContactViewDefinition@@QBEABVTDesC16@@XZ @ 125 NONAME ; class TDesC16 const & CVPbkContactViewDefinition::Uri(void) const - ?UriDes@TVPbkContactStoreUriPtr@@QBEABVTDesC16@@XZ @ 126 NONAME ; class TDesC16 const & TVPbkContactStoreUriPtr::UriDes(void) const - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/eabi/cvimpststoragecontactsorter_utu.def --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/eabi/cvimpststoragecontactsorter_utu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - _ZN10Phonebook29Pbk2AppUiEv @ 2 NONAME - _ZN19CVPbkContactManager13CopyContactsLERK21MVPbkContactLinkArrayP17MVPbkContactStoreR27MVPbkBatchOperationObserver @ 3 NONAME - _ZN19CVPbkContactManager14ContactStoresLEv @ 4 NONAME - _ZN19CVPbkContactManager15CommitContactsLERK6TArrayIP17MVPbkStoreContactER27MVPbkBatchOperationObserver @ 5 NONAME - _ZN19CVPbkContactManager15CompressStoresLER27MVPbkBatchOperationObserver @ 6 NONAME - _ZN19CVPbkContactManager15DeleteContactsLERK21MVPbkContactLinkArrayR27MVPbkBatchOperationObserver @ 7 NONAME - _ZN19CVPbkContactManager17LoadContactStoreLERK23TVPbkContactStoreUriPtr @ 8 NONAME - _ZN19CVPbkContactManager17MatchPhoneNumberLERK7TDesC16iR24MVPbkContactFindObserver @ 9 NONAME - _ZN19CVPbkContactManager24ContactAttributeManagerLEv @ 10 NONAME - _ZN19CVPbkContactManager4NewLE13TSecurityInfoRK25CVPbkContactStoreUriArrayP3RFs @ 11 NONAME - _ZN19CVPbkContactManager4NewLERK25CVPbkContactStoreUriArrayP3RFs @ 12 NONAME - _ZN19CVPbkContactManager5FindLERK12MDesC16ArrayRK18MVPbkFieldTypeListR34MVPbkContactFindFromStoresObserverRK9TCallBack @ 13 NONAME - _ZN19CVPbkContactManager5FindLERK7TDesC16RK18MVPbkFieldTypeListR24MVPbkContactFindObserver @ 14 NONAME - _ZN19CVPbkContactManager9FsSessionEv @ 15 NONAME - _ZN20VPbkContactStoreUris15DefaultCntDbUriEv @ 16 NONAME - _ZN20VPbkContactStoreUris15SimGlobalAdnUriEv @ 17 NONAME - _ZN20VPbkContactStoreUris15SimGlobalFdnUriEv @ 18 NONAME - _ZN20VPbkContactStoreUris15SimGlobalSdnUriEv @ 19 NONAME - _ZN20VPbkContactStoreUris21SimGlobalOwnNumberUriEv @ 20 NONAME - _ZN21CPbk2SortOrderManager12AddObserverLER22MPbk2SortOrderObserver @ 21 NONAME - _ZN21CPbk2SortOrderManager14RemoveObserverER22MPbk2SortOrderObserver @ 22 NONAME - _ZN21CPbk2SortOrderManager15SetContactViewLER20MVPbkContactViewBase @ 23 NONAME - _ZN21CPbk2SortOrderManager16DefaultSeparatorEv @ 24 NONAME - _ZN21CPbk2SortOrderManager20SetNameDisplayOrderLENS_21TPbk2NameDisplayOrderERK7TDesC16 @ 25 NONAME - _ZN21CPbk2SortOrderManager4NewLERK18MVPbkFieldTypeListP3RFs @ 26 NONAME - _ZN21CVPbkContactLinkArray15ResetAndDestroyEv @ 27 NONAME - _ZN21CVPbkContactLinkArray4NewLEv @ 28 NONAME - _ZN21CVPbkContactLinkArray5NewLCER11RReadStreamRK21MVPbkContactStoreList @ 29 NONAME - _ZN21CVPbkContactLinkArray5NewLCERK6TDesC8RK21MVPbkContactStoreList @ 30 NONAME - _ZN21CVPbkContactLinkArray5NewLCEv @ 31 NONAME - _ZN21CVPbkContactLinkArray5ResetEv @ 32 NONAME - _ZN21CVPbkContactLinkArray6DeleteEi @ 33 NONAME - _ZN21CVPbkContactLinkArray6RemoveEi @ 34 NONAME - _ZN21CVPbkContactLinkArray7AppendLEP16MVPbkContactLink @ 35 NONAME - _ZN21CVPbkContactLinkArray7InsertLEP16MVPbkContactLinki @ 36 NONAME - _ZN23CPbk2StoreConfiguration4NewLEv @ 37 NONAME - _ZN23TVPbkContactStoreUriPtr3SetERKS_ @ 38 NONAME - _ZN23TVPbkContactStoreUriPtrC1ERK7TDesC16 @ 39 NONAME - _ZN23TVPbkContactStoreUriPtrC1Ev @ 40 NONAME - _ZN23TVPbkContactStoreUriPtrC2ERK7TDesC16 @ 41 NONAME - _ZN23TVPbkContactStoreUriPtrC2Ev @ 42 NONAME - _ZN24MVPbkContactFieldUriData4CastER21MVPbkContactFieldData @ 43 NONAME - _ZN24MVPbkContactFieldUriData4CastERK21MVPbkContactFieldData @ 44 NONAME - _ZN25CVPbkContactStoreUriArray10AppendAllLERKS_ @ 45 NONAME - _ZN25CVPbkContactStoreUriArray4NewLEv @ 46 NONAME - _ZN25CVPbkContactStoreUriArray5NewLCERK6TDesC8 @ 47 NONAME - _ZN25CVPbkContactStoreUriArray5NewLCEv @ 48 NONAME - _ZN25CVPbkContactStoreUriArray6RemoveERK23TVPbkContactStoreUriPtr @ 49 NONAME - _ZN25CVPbkContactStoreUriArray7AppendLERK23TVPbkContactStoreUriPtr @ 50 NONAME - _ZN25MVPbkContactFieldTextData4CastER21MVPbkContactFieldData @ 51 NONAME - _ZN25MVPbkContactFieldTextData4CastERK21MVPbkContactFieldData @ 52 NONAME - _ZN26CVPbkContactViewDefinition10SetSharingE23TVPbkContactViewSharing @ 53 NONAME - _ZN26CVPbkContactViewDefinition11AddSubViewLEPS_ @ 54 NONAME - _ZN26CVPbkContactViewDefinition13SetSortPolicyE26TVPbkContactViewSortPolicy @ 55 NONAME - _ZN26CVPbkContactViewDefinition18SetContactSelectorEP20MVPbkContactSelector @ 56 NONAME - _ZN26CVPbkContactViewDefinition19SetFieldTypeFilterLEP22CVPbkFieldTypeSelector @ 57 NONAME - _ZN26CVPbkContactViewDefinition4NewLER15TResourceReader @ 58 NONAME - _ZN26CVPbkContactViewDefinition4NewLERKS_ @ 59 NONAME - _ZN26CVPbkContactViewDefinition4NewLEv @ 60 NONAME - _ZN26CVPbkContactViewDefinition5NewLCER15TResourceReader @ 61 NONAME - _ZN26CVPbkContactViewDefinition5NewLCERKS_ @ 62 NONAME - _ZN26CVPbkContactViewDefinition5NewLCEv @ 63 NONAME - _ZN26CVPbkContactViewDefinition5SetIdEi @ 64 NONAME - _ZN26CVPbkContactViewDefinition7SetFlagE20TVPbkContactViewFlagi @ 65 NONAME - _ZN26CVPbkContactViewDefinition7SetTypeE20TVPbkContactViewType @ 66 NONAME - _ZN26CVPbkContactViewDefinition7SetUriLERK7TDesC16 @ 67 NONAME - _ZN26CVPbkContactViewDefinition8SetNameLERK7TDesC16 @ 68 NONAME - _ZN26CVPbkContactViewDefinition9SubViewAtEi @ 69 NONAME - _ZN27MVPbkContactFieldBinaryData4CastER21MVPbkContactFieldData @ 70 NONAME - _ZN27MVPbkContactFieldBinaryData4CastERK21MVPbkContactFieldData @ 71 NONAME - _ZNK19CVPbkContactManager10FieldTypesEv @ 72 NONAME - _ZNK19CVPbkContactManager13CreateLinksLCER11RReadStream @ 73 NONAME - _ZNK19CVPbkContactManager13CreateLinksLCERK6TDesC8 @ 74 NONAME - _ZNK19CVPbkContactManager16RetrieveContactLERK16MVPbkContactLinkR35MVPbkSingleContactOperationObserver @ 75 NONAME - _ZNK19CVPbkContactManager19CreateContactViewLCER24MVPbkContactViewObserverRK26CVPbkContactViewDefinitionRK18MVPbkFieldTypeList @ 76 NONAME - _ZNK21CPbk2SortOrderManager16CurrentSeparatorEv @ 77 NONAME - _ZNK21CPbk2SortOrderManager16NameDisplayOrderEv @ 78 NONAME - _ZNK21CPbk2SortOrderManager9SortOrderEv @ 79 NONAME - _ZNK21CVPbkContactLinkArray16PackedBufferSizeEv @ 80 NONAME - _ZNK23TVPbkContactStoreUriPtr12ExternalizeLER12RWriteStream @ 81 NONAME - _ZNK23TVPbkContactStoreUriPtr16ExternalizedSizeEv @ 82 NONAME - _ZNK23TVPbkContactStoreUriPtr6LengthEv @ 83 NONAME - _ZNK23TVPbkContactStoreUriPtr6UriDesEv @ 84 NONAME - _ZNK23TVPbkContactStoreUriPtr7CompareERK7TDesC16NS_29TVPbkContactStoreUriComponentE @ 85 NONAME - _ZNK23TVPbkContactStoreUriPtr7CompareERKS_NS_29TVPbkContactStoreUriComponentE @ 86 NONAME - _ZNK23TVPbkContactStoreUriPtr9ComponentENS_29TVPbkContactStoreUriComponentE @ 87 NONAME - _ZNK25CVPbkContactStoreUriArray10IsIncludedERK23TVPbkContactStoreUriPtr @ 88 NONAME - _ZNK25CVPbkContactStoreUriArray5CountEv @ 89 NONAME - _ZNK25CVPbkContactStoreUriArray6PackLCEv @ 90 NONAME - _ZNK25CVPbkContactStoreUriArrayixEi @ 91 NONAME - _ZNK26CVPbkContactViewDefinition10SortPolicyEv @ 92 NONAME - _ZNK26CVPbkContactViewDefinition12SubViewCountEv @ 93 NONAME - _ZNK26CVPbkContactViewDefinition15ContactSelectorEv @ 94 NONAME - _ZNK26CVPbkContactViewDefinition15FieldTypeFilterEv @ 95 NONAME - _ZNK26CVPbkContactViewDefinition2IdEv @ 96 NONAME - _ZNK26CVPbkContactViewDefinition3UriEv @ 97 NONAME - _ZNK26CVPbkContactViewDefinition4NameEv @ 98 NONAME - _ZNK26CVPbkContactViewDefinition4TypeEv @ 99 NONAME - _ZNK26CVPbkContactViewDefinition7SharingEv @ 100 NONAME - _ZNK26CVPbkContactViewDefinition8FlagIsOnE20TVPbkContactViewFlag @ 101 NONAME - _ZNK26CVPbkContactViewDefinition9SubViewAtEi @ 102 NONAME - _ZTI14CPbk2AppUiStub @ 103 NONAME ; ## - _ZTI19CVPbkContactManager @ 104 NONAME ; ## - _ZTI20CActiveSchedulerWait @ 105 NONAME ; ## - _ZTI20CVPbkContactLinkStub @ 106 NONAME ; ## - _ZTI20CVPbkContactViewStub @ 107 NONAME ; ## - _ZTI21CPbk2SortOrderManager @ 108 NONAME ; ## - _ZTI21CVPbkContactLinkArray @ 109 NONAME ; ## - _ZTI21CVPbkContactStoreStub @ 110 NONAME ; ## - _ZTI21CVPbkStoreContactStub @ 111 NONAME ; ## - _ZTI23CPbk2CommandHandlerStub @ 112 NONAME ; ## - _ZTI23CPbk2StoreConfiguration @ 113 NONAME ; ## - _ZTI23TVPbkContactStoreUriPtr @ 114 NONAME ; ## - _ZTI25CVPbkContactStoreListStub @ 115 NONAME ; ## - _ZTI25CVPbkContactStoreUriArray @ 116 NONAME ; ## - _ZTI26CVPbkContactViewDefinition @ 117 NONAME ; ## - _ZTI26CVPbkStoreContactFieldStub @ 118 NONAME ; ## - _ZTI28CPbk2ApplicationServicesStub @ 119 NONAME ; ## - _ZTI29CVPbkContactFieldUriData_Stub @ 120 NONAME ; ## - _ZTI30CVPbkContactFieldTextData_stub @ 121 NONAME ; ## - _ZTI31CVPbkContactFieldBinaryDataStub @ 122 NONAME ; ## - _ZTI35CVPbkBaseContactFieldCollectionStub @ 123 NONAME ; ## - _ZTI7CActive @ 124 NONAME ; ## - _ZTV14CPbk2AppUiStub @ 125 NONAME ; ## - _ZTV19CVPbkContactManager @ 126 NONAME ; ## - _ZTV20CActiveSchedulerWait @ 127 NONAME ; ## - _ZTV20CVPbkContactLinkStub @ 128 NONAME ; ## - _ZTV20CVPbkContactViewStub @ 129 NONAME ; ## - _ZTV21CPbk2SortOrderManager @ 130 NONAME ; ## - _ZTV21CVPbkContactLinkArray @ 131 NONAME ; ## - _ZTV21CVPbkContactStoreStub @ 132 NONAME ; ## - _ZTV21CVPbkStoreContactStub @ 133 NONAME ; ## - _ZTV23CPbk2CommandHandlerStub @ 134 NONAME ; ## - _ZTV23CPbk2StoreConfiguration @ 135 NONAME ; ## - _ZTV23TVPbkContactStoreUriPtr @ 136 NONAME ; ## - _ZTV25CVPbkContactStoreListStub @ 137 NONAME ; ## - _ZTV25CVPbkContactStoreUriArray @ 138 NONAME ; ## - _ZTV26CVPbkContactViewDefinition @ 139 NONAME ; ## - _ZTV26CVPbkStoreContactFieldStub @ 140 NONAME ; ## - _ZTV28CPbk2ApplicationServicesStub @ 141 NONAME ; ## - _ZTV29CVPbkContactFieldUriData_Stub @ 142 NONAME ; ## - _ZTV30CVPbkContactFieldTextData_stub @ 143 NONAME ; ## - _ZTV31CVPbkContactFieldBinaryDataStub @ 144 NONAME ; ## - _ZTV35CVPbkBaseContactFieldCollectionStub @ 145 NONAME ; ## - _ZTV7CActive @ 146 NONAME ; ## - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/group/CVIMPSTStorageContactSorter_UT.mmp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/group/CVIMPSTStorageContactSorter_UT.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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: vimpststorage_test.dll -* -*/ - - -#include - -TARGET CVIMPSTStorageContactSorter_UT.dll -TARGETTYPE dll -UID 0x1000008D 0x101FB3E3 - -EPOCALLOWDLLDATA -CAPABILITY ALL -TCB -/* Remove comments and replace 0x00000000 with correct vendor id */ -// VENDORID 0x00000000 -/* Remove comments and replace 0x00000000 with correct secure id */ -// SECUREID 0x00000000 - -//TARGETPATH ?target_path -DEFFILE cvimpststoragecontactsorter_ut.def - -USERINCLUDE ../inc -USERINCLUDE ../../stubs -USERINCLUDE ../../../../inc -USERINCLUDE ../../../../../inc - -//OS_LAYER_SYSTEMINCLUDE -APP_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../../../../src -SOURCE cvimpststoragecontact.cpp -SOURCE cvimpststoragecontactsorter.cpp -SOURCE cvimpststoragecontactlist.cpp -SOURCE vimpststorageutils.cpp -SOURCEPATH ../src - -SOURCE CVIMPSTStorageContactSorter_UT.cpp -SOURCE CVIMPSTStorageContactSorter_UTBlocks.cpp - -SOURCEPATH ../../stubs - -//stubs -SOURCE s_MVPbkContactFieldTextData.cpp -SOURCE s_MVPbkContactFieldUriData.cpp -SOURCE s_MVPbkContactFieldBinaryData.cpp -SOURCE s_CVPbkContactManager.cpp -SOURCE s_MVPbkContactLinkstub.cpp -SOURCE CVPbkContactStoreUriArrayStub.cpp -SOURCE CVPbkStoreContactStub.cpp -SOURCE s_CVPbkBaseContactFieldCollection.cpp -SOURCE s_CVPbkStoreContactField.cpp -SOURCE s_CVPbkContactStoreList.cpp -SOURCE s_CVPbkContactViewDefinition.cpp -SOURCE s_CVPbkContactView.cpp -SOURCE s_CPbk2SortOrderManager.cpp -SOURCE s_TVPbkContactStoreUriPtr.cpp -SOURCE s_CVPbkContactLinkArray.cpp -SOURCE s_VPbkContactStoreUris.cpp -SOURCE pbkuistubs.cpp -SOURCE s_cactive.cpp -SOURCE s_CPBK2StoreConfiguration.cpp -//RESOURCE resource_file -//RESOURCE resource_file2 - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib -LIBRARY flogger.lib - -LANG SC - -/* -START WINS -?wins_specific_information -END - -START MARM -?marm_specific_information -END -*/ -// Other possible keywords: - -// DOCUMENT ?file, that is not compiled, but added to MSVC project workspace (i.e. release notes) -/* -START BITMAP ?target -TARGETPATH ?emulated_path_on_target_machine -HEADER -SOURCE ?color_depth ?source_bitmap -END -*/ -// DEFFILE ?filename -// AIF ?filename - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/group/CVIMPSTStorageContactSorter_UT_DoxyFile.txt --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/group/CVIMPSTStorageContactSorter_UT_DoxyFile.txt Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -# 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: MMP file for STIF Test Framework's TestScripter -# testclass test module. -# -# - -# Doxyfile 1.4.1 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = CVIMPSTStorageContactSorter_UT -PROJECT_NUMBER = -OUTPUT_DIRECTORY = j:/testsetups/CVIMPSTStorageContactSorter_UT/ -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = YES -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -DISTRIBUTE_GROUP_DOC = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = NO -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = YES -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = NO -GENERATE_TESTLIST = NO -GENERATE_BUGLIST = NO -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = YES -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = j:/testsetups/CVIMPSTStorageContactSorter_UT/ -FILE_PATTERNS = *.h / - *.rh / - *.hrh -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = NO -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = YES -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = YES -TOC_EXPAND = YES -DISABLE_INDEX = YES -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = YES -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = YES -RTF_OUTPUT = Doc -COMPACT_RTF = YES -RTF_HYPERLINKS = YES -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = YES -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = NONSHARABLE_CLASS -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = YES -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 0 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/group/bld.inf --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* 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: -: -* -*/ - - - -PRJ_PLATFORMS -// specify the platforms your component needs to be built for here -// defaults to WINS MARM so you can ignore this if you just build these - - DEFAULT - -PRJ_TESTEXPORTS -// NOTE: If using ARS requirements all export operations should be done under this. -// 'abld test export' - -PRJ_EXPORTS - -PRJ_TESTMMPFILES - CVIMPSTStorageContactSorter_UT.mmp -PRJ_MMPFILES - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/inc/CVIMPSTStorageContactSorter_UT.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/inc/CVIMPSTStorageContactSorter_UT.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,233 +0,0 @@ -/* -* 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: -: -* -*/ - - - -#ifndef CVIMPSTSTORAGECONTACTSORTER_UT_H -#define CVIMPSTSTORAGECONTACTSORTER_UT_H - -// INCLUDES -#include -#include -#include -#include -#include -#include "vimpststorageutils.h" -#include "cvimpststoragecontactsorter.h" - -// CONSTANTS -//const ?type ?constant_var = ?constant; - -// MACROS -//#define ?macro ?macro_def -#define TEST_CLASS_VERSION_MAJOR 0 -#define TEST_CLASS_VERSION_MINOR 0 -#define TEST_CLASS_VERSION_BUILD 0 - -// Logging path -_LIT( KCVIMPSTStorageContactSorter_UTLogPath, "//logs//testframework//CVIMPSTStorageContactSorter_UT//" ); -// Log file -_LIT( KCVIMPSTStorageContactSorter_UTLogFile, "CVIMPSTStorageContactSorter_UT.txt" ); -_LIT( KCVIMPSTStorageContactSorter_UTLogFileWithTitle, "CVIMPSTStorageContactSorter_UT_[%S].txt" ); - -// FUNCTION PROTOTYPES -//?type ?function_name(?arg_list); - -// FORWARD DECLARATIONS -//class ?FORWARD_CLASSNAME; -class CCVIMPSTStorageContactSorter_UT; - -// DATA TYPES -//enum ?declaration -//typedef ?declaration -//extern ?data_type; - -// CLASS DECLARATION - -/** -* CCVIMPSTStorageContactSorter_UT test class for STIF Test Framework TestScripter. -* ?other_description_lines -* -* @lib ?library -* @since ?Series60_version -*/ -NONSHARABLE_CLASS(CCVIMPSTStorageContactSorter_UT) : public CScriptBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CCVIMPSTStorageContactSorter_UT* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~CCVIMPSTStorageContactSorter_UT(); - - public: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - /* - * Test Function: Test construction of sorter object. - */ - TInt Test_NewL( CStifItemParser& aItem ); - - /* - * Test Function: Tests sorting functionality. - */ - TInt Test_SortL( CStifItemParser& aItem ); - - /* - * Test Function: Tests Comparing functionality. - */ - TInt Test_CompareL( CStifItemParser& aItem ); - - /* - * Test Function: Tests setting algorithm. - */ - TInt SetSortAlgorithm( CStifItemParser& aItem ); - - - public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since ?Series60_version - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - - protected: // New functions - - /** - * ?member_description. - * @since ?Series60_version - * @param ?arg1 ?description - * @return ?description - */ - //?type ?member_function( ?type ?arg1 ); - - protected: // Functions from base classes - - /** - * From ?base_class ?member_description - */ - //?type ?member_function(); - - private: - - /** - * C++ default constructor. - */ - CCVIMPSTStorageContactSorter_UT( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - /** - * Frees all resources allocated from test methods. - * @since ?Series60_version - */ - void Delete(); - - /** - * Test methods are listed below. - */ - - /** - * Method used to log version of test class - */ - void SendTestClassVersion(); - - /* - * Helper Function: Creates an array of contacts. - */ - void CreateContactArray(); - - /* - * Helper Function: Creates an array of contacts. - * In alphabetical order. - * The array created by this function is used to - * cross check the array given as a result by sort function. - */ - void CreateAlphabeticalSortArray(); - - /* - * Helper Function: Creates an array of contacts. - * In order of presence. - * The array created by this function is used to cross - * check the array given as a result by sort function. - */ - void CreatePresenceSortArray(); - - /* - * Helper Function: Compares two arrays. - * It compares the userids of the corresponding elements - * of the arrays and returns - * : zero, if arrays are equal. - * : index of difference, if difference is found. - */ - TInt CompareArray(RPointerArray< MVIMPSTStorageContact > & aFirstArray, RPointerArray< MVIMPSTStorageContact >& aSecondArray ); - - /* - * Helper Function: Resets the arrays after use. - */ - void ResetArray( RPointerArray< MVIMPSTStorageContact > & aArray ); - - //ADD NEW METHOD DEC HERE - //[TestMethods] - Do not remove - - public: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - protected: // Data - // ?one_line_short_description_of_data - //?data_declaration; - - private: // Data - - RPointerArray< MVIMPSTStorageContact > iContactArray; - - RPointerArray< MVIMPSTStorageContact > iAlphabeticalSortArray; - - RPointerArray< MVIMPSTStorageContact > iPresenceSortArray; - - public: // Friend classes - //?friend_class_declaration; - protected: // Friend classes - //?friend_class_declaration; - private: // Friend classes - //?friend_class_declaration; - - }; - -#endif // CVIMPSTSTORAGECONTACTSORTER_UT_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/src/CVIMPSTStorageContactSorter_UT.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/src/CVIMPSTStorageContactSorter_UT.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* 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 FILES -#include -#include "CVIMPSTStorageContactSorter_UT.h" -#include -#include - -// ============================= LOCAL FUNCTIONS =============================== - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactSorter_UT::CCVIMPSTStorageContactSorter_UT -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CCVIMPSTStorageContactSorter_UT::CCVIMPSTStorageContactSorter_UT( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactSorter_UT::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CCVIMPSTStorageContactSorter_UT::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(KCVIMPSTStorageContactSorter_UTLogFileWithTitle, &title); - } - else - { - logFileName.Copy(KCVIMPSTStorageContactSorter_UTLogFile); - } - - iLog = CStifLogger::NewL( KCVIMPSTStorageContactSorter_UTLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - SendTestClassVersion(); - } - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactSorter_UT::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CCVIMPSTStorageContactSorter_UT* CCVIMPSTStorageContactSorter_UT::NewL( - CTestModuleIf& aTestModuleIf ) - { - CCVIMPSTStorageContactSorter_UT* self = new (ELeave) CCVIMPSTStorageContactSorter_UT( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -CCVIMPSTStorageContactSorter_UT::~CCVIMPSTStorageContactSorter_UT() - { - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - } - -//----------------------------------------------------------------------------- -// CCVIMPSTStorageContactSorter_UT::SendTestClassVersion -// Method used to send version of test class -//----------------------------------------------------------------------------- -// -void CCVIMPSTStorageContactSorter_UT::SendTestClassVersion() - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; - moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; - moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; - - TFileName moduleName; - moduleName = _L("CVIMPSTStorageContactSorter_UT.dll"); - - TBool newVersionOfMethod = ETrue; - TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) CCVIMPSTStorageContactSorter_UT::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/src/CVIMPSTStorageContactSorter_UTBlocks.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/cvimpststoragecontactsorter_ut/src/CVIMPSTStorageContactSorter_UTBlocks.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,530 +0,0 @@ -/* -* 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 FILES] - do not remove -#include -#include -#include -#include "CVIMPSTStorageContactSorter_UT.h" -#include "cvimpststoragecontactsorter.h" -#include "vimpstdebugtrace.h" -#include -#include "mvimpststoragecontact.h" -#include "cvimpststoragecontact.h" -#include "tvimpstenums.h" -#include "tvimpststoragepanics.h" - -_LIT( KUserId1, "vidic@mu.com"); -_LIT( KUserId2, "carr@mu.com"); -_LIT( KUserId3, "terry@mu.com"); -_LIT( KUserId4, "gibbs@mu.com"); - -_LIT( KDisplayName1, "vidic"); -_LIT( KDisplayName2, "carr"); -_LIT( KDisplayName3, "terry"); -_LIT( KDisplayName4, "gibbs"); -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactSorter_UT::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void CCVIMPSTStorageContactSorter_UT::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// CCVIMPSTStorageContactSorter_UT::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt CCVIMPSTStorageContactSorter_UT::RunMethodL( - CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - ENTRY( "CreateSorter", CCVIMPSTStorageContactSorter_UT::Test_NewL ), - ENTRY( "DoSort", CCVIMPSTStorageContactSorter_UT::Test_SortL ), - ENTRY( "SelectAlgorithm", CCVIMPSTStorageContactSorter_UT::SetSortAlgorithm ), - ENTRY( "CompareContacts", CCVIMPSTStorageContactSorter_UT::Test_CompareL ), - //ADD NEW ENTRY HERE - // [test cases entries] - Do not remove - - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageSorter_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContactSorter_UT::Test_NewL( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - CVIMPSTStorageContactSorter* sorter = NULL; - - sorter = CVIMPSTStorageContactSorter::NewL(); - - if( sorter ) - { - result = KErrNone; - } - if( sorter ) - { - delete sorter; - } - return result; - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageSorter_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContactSorter_UT::Test_SortL( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TPtrC param; - - MVIMPSTStorageContact::TSortAlgorithm sortAlgorithm; - - aItem.GetNextString( param ); - - CVIMPSTStorageContactSorter* sorter = NULL; - - sorter = CVIMPSTStorageContactSorter::NewL(); - - // setting the algorithm to be used for sorting. - if( param.Compare( _L("alpha") ) == 0 ) - { - sortAlgorithm = MVIMPSTStorageContact::ECompareAlphabetically; - } - else if( param.Compare( _L("presence") ) == 0 ) - { - sortAlgorithm = MVIMPSTStorageContact::ECompareByPresence; - } - - // comparing the sorted array and result array. - // setting the result for the test case. - TInt compareResult = -1; - - CreateContactArray(); - - switch( sortAlgorithm ) - { - case MVIMPSTStorageContact::ECompareByPresence: - { - // sorting the contact array - sorter->SetSortAlgorithm( sortAlgorithm ); - CreatePresenceSortArray(); - sorter->Sort( iContactArray ); - compareResult = CompareArray( iContactArray, iPresenceSortArray ); - ResetArray( iPresenceSortArray ); - break; - } - case MVIMPSTStorageContact::ECompareAlphabetically: - default: - { - // sorting the contact array - sorter->SetSortAlgorithm( sortAlgorithm ); - CreateAlphabeticalSortArray(); - sorter->Sort( iContactArray ); - compareResult = CompareArray( iContactArray, iAlphabeticalSortArray ); - ResetArray( iAlphabeticalSortArray ); - break; - } - } - ResetArray( iContactArray ); - - if( -1 == compareResult ) - { - result = KErrNone; - } - - if( sorter ) - delete sorter; - - return result; - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageSorter_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContactSorter_UT::Test_CompareL( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - CVIMPSTStorageContactSorter* sorter = NULL; - - sorter = CVIMPSTStorageContactSorter::NewL(); - - CVIMPSTStorageContact* contact1 = NULL; - CVIMPSTStorageContact* contact2 = NULL; - TBuf<64> userId; - TBuf<64> displayName; - - TPtrC param; - aItem.GetNextString( param ); - TInt compareResult; - - if( param.Compare( _L("2validcontacts") ) == 0 ) - { - // first contact - userId.Copy(KUserId1); - displayName.Copy( KDisplayName1 ); - contact1 = CVIMPSTStorageContact::NewL( userId, displayName ); - - // second contact - userId.Copy(KUserId2); - displayName.Copy( KDisplayName2 ); - contact2 = CVIMPSTStorageContact::NewL( userId, displayName ); - - compareResult = sorter->Compare( *contact1, *contact2 ); - - if( compareResult ) - { - result = KErrNone; - } - - } - else if( param.Compare( _L("1validcontact") ) == 0 ) - { - // first contact - userId.Copy(KUserId1); - displayName.Copy( KDisplayName1 ); - contact1 = CVIMPSTStorageContact::NewL( userId, displayName ); - - // null contact - - userId.Copy( KNullDesC ); - displayName.Copy( KNullDesC ); - contact2 = CVIMPSTStorageContact::NewL( userId, displayName ); - - compareResult = sorter->Compare( *contact1, *contact2 ); - - if( compareResult ) // Not Equal - { - result = KErrNone; - } - - } - else if( param.Compare( _L("1nullcontact") ) == 0 ) - { - - // nullcontact - userId.Copy( KNullDesC ); - displayName.Copy( KNullDesC ); - contact1 = CVIMPSTStorageContact::NewL( userId, displayName ); - - // second contact - userId.Copy(KUserId2); - displayName.Copy( KDisplayName2 ); - contact2 = CVIMPSTStorageContact::NewL( userId, displayName ); - - compareResult = sorter->Compare( *contact1, *contact2 ); - - if( compareResult ) // Not Equal - { - result = KErrNone; - } - - } - else if( param.Compare( _L( "2nullcontacts") ) == 0 ) - { - // first contact, null - userId.Copy( KNullDesC ); - displayName.Copy( KNullDesC ); - contact1 = CVIMPSTStorageContact::NewL( userId, displayName ); - - // second contact, null - userId.Copy( KNullDesC ); - displayName.Copy( KNullDesC ); - contact2 = CVIMPSTStorageContact::NewL( userId, displayName ); - - - // no contact - compareResult = sorter->Compare( *contact1, *contact2 ); - - if( compareResult == 0 ) - { - result = KErrNone; - } - - } - else if( param.Compare( _L( "samecontacts") ) == 0 ) - { - // first contact - userId.Copy(KUserId1); - displayName.Copy( KDisplayName1 ); - contact1 = CVIMPSTStorageContact::NewL( userId, displayName ); - // second contact - userId.Copy(KUserId1); - displayName.Copy( KDisplayName1 ); - contact2 = CVIMPSTStorageContact::NewL( userId, displayName ); - - compareResult = sorter->Compare( *contact1, *contact2 ); - - if( compareResult == 0 ) - { - result = KErrNone; - } - - } - if( contact1 ) - delete contact1; - if( contact2 ) - delete contact2; - if( sorter ) - delete sorter; - return result; - - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageSorter_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContactSorter_UT::SetSortAlgorithm( CStifItemParser& aItem ) - { - TInt result = KErrGeneral; - - TInt input; - - aItem.GetNextInt( input ); - - CVIMPSTStorageContactSorter* sorter = NULL; - - sorter = CVIMPSTStorageContactSorter::NewL(); - - switch( input ) - { - case 1: - { - sorter->SetSortAlgorithm( MVIMPSTStorageContact::ECompareByPresence ); - result = KErrNone; - } - break; - case 2: - { - sorter->SetSortAlgorithm( MVIMPSTStorageContact::ECompareAlphabetically ); - result = KErrNone; - } - break; - } - - delete sorter; - - return result; - - } - - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageSorter_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -void CCVIMPSTStorageContactSorter_UT::CreateContactArray() - { - - CVIMPSTStorageContact* contact = NULL; - - TBuf<64> userId; - TBuf<64> displayName; - - // first contact - userId.Copy(KUserId1); - displayName.Copy( KDisplayName1 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EBusy ); - iContactArray.AppendL( contact ); - - // second contact - userId.Copy(KUserId2); - displayName.Copy( KDisplayName2 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EOnline ); - iContactArray.AppendL( contact ); - - // third contact - userId.Copy(KUserId3); - displayName.Copy( KDisplayName3 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EPending ); - - iContactArray.AppendL( contact ); - - // fourth contact - userId.Copy(KUserId4); - displayName.Copy( KDisplayName4 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EOnPhone ); - iContactArray.AppendL( contact ); - - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageSorter_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -void CCVIMPSTStorageContactSorter_UT::CreateAlphabeticalSortArray() - { - // order of sort : contact2, contact4, contact3, contact1 - CVIMPSTStorageContact* contact = NULL; - - TBuf<64> userId; - TBuf<64> displayName; - - // first contact - userId.Copy(KUserId2); - displayName.Copy( KDisplayName2 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EBusy ); - iAlphabeticalSortArray.AppendL( contact ); - - // second contact - userId.Copy( KUserId4 ); - displayName.Copy( KDisplayName4 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EOnline ); - iAlphabeticalSortArray.AppendL( contact ); - - // third contact - userId.Copy(KUserId3); - displayName.Copy( KDisplayName3 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EPending ); - iAlphabeticalSortArray.AppendL( contact ); - - // fourth contact - userId.Copy(KUserId1); - displayName.Copy( KDisplayName1 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EOnPhone ); - iAlphabeticalSortArray.AppendL( contact ); - - } -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageSorter_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -void CCVIMPSTStorageContactSorter_UT::CreatePresenceSortArray() - { - // order of sort : contact2, contact1, contact4, contact 3 - - CVIMPSTStorageContact* contact = NULL; - - TBuf<64> userId; - TBuf<64> displayName; - - // first contact - userId.Copy(KUserId2); - displayName.Copy( KDisplayName2 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EBusy ); - iPresenceSortArray.AppendL( contact ); - - // second contact - userId.Copy( KUserId1 ); - displayName.Copy( KDisplayName1 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EOnline ); - iPresenceSortArray.AppendL( contact ); - - // third contact - userId.Copy( KUserId4 ); - displayName.Copy( KDisplayName4 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EPending ); - iPresenceSortArray.AppendL( contact ); - - // fourth contact - userId.Copy( KUserId3 ); - displayName.Copy( KDisplayName3 ); - contact = CVIMPSTStorageContact::NewL( userId, displayName ); - contact->SetOnlineStatus( TVIMPSTEnums::EOnPhone ); - iPresenceSortArray.AppendL( contact ); - - - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageSorter_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -TInt CCVIMPSTStorageContactSorter_UT::CompareArray(RPointerArray< MVIMPSTStorageContact > & aFirstArray, RPointerArray< MVIMPSTStorageContact >& aSecondArray ) - { - // Number of contacts to be compared - TInt count = 4; - TInt result = -1; - - - TBuf<64> userId1,userId2; - - - // loop index - TInt i = -1; - for( i=0; iUserId() ); - userId2.Copy( aSecondArray[i]->UserId() ); - - if( userId1.Compare( userId2 ) != 0 ) - { - result = i; - break; - } - } - - return result; - - } - -// -- -- -- -- ------------------------------------------------- -// @ see CVIMPSTStorageSorter_UT.h for description. -// -- -- -- -- ------------------------------------------------- -// -void CCVIMPSTStorageContactSorter_UT::ResetArray( RPointerArray< MVIMPSTStorageContact > & aArray ) - { - aArray.ResetAndDestroy(); - } - -//---------------------------- -// To fix build break, please refer task no. in synergy. -//---------------------------- -// -void Panic( TVIMPSTStoragePanics aPanic ) - { - User::Panic( KPanicCategory, aPanic ); - } -// [End of File] - Do not remove diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/init/TestFramework.ini --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/init/TestFramework.ini Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -# Module configurations start - -[New_Module] -ModuleName= testscripter -TestCaseFile= C:\testframework\CVIMPSTStorageContact_UT.cfg -TestCaseFile= C:\testframework\CVIMPSTStorageContactList_UT.cfg -TestCaseFile= C:\testframework\CVIMPSTStorageContactSorter_UT.cfg -[End_Module] - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkContactFieldTextData_stub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkContactFieldTextData_stub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPBKCONTACTFIELDTEXTDATASTUB_H -#define CVPBKCONTACTFIELDTEXTDATASTUB_H - - -// INCLUDES -#include - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook Contact field text data. - * This interface is used to manipulate text contact field data. - */ -class CVPbkContactFieldTextData_stub : public MVPbkContactFieldTextData - { - public: // Destructor - /** - * Destructor. - */ - ~CVPbkContactFieldTextData_stub(); - CVPbkContactFieldTextData_stub(); - - - public: // Interface - - /** - * Returns the string data. - * @return Pointer to the text data. - */ - TPtrC Text() const; - - /** - * Sets the string data. - * @exception KErrOverflow if (aText.Length() > MaxLength()) - */ - void SetTextL( const TDesC& aText ) ; - - /** - * Returns maximum length of the field. - * @return Maximum length of the field or KVPbkUnlimitedFieldLength - * if length is only limited by available memory. - */ - TInt MaxLength() const ; - - - /** - * Returns the derived data type id. - * @return Contact field storage type. - */ - TVPbkFieldStorageType DataType() const; - - /** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ - TBool IsEmpty() const; - - /** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ - void CopyL(const MVPbkContactFieldData& aFieldData) ; - }; - -#endif // CVPBKCONTACTFIELDTEXTDATASTUB_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkContactOperationBaseStub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkContactOperationBaseStub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPbkContactOperationBaseStub_H -#define CVPbkContactOperationBaseStub_H - -// INCLUDES -#include - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook abtract asynchronous contact operation. - * This interface is used as a handle to asynchronous contact operations. - * Clients should keep a reference to the handle during the asynchronous - * operation to be able to delete and cancel the operation before it - * completes. - */ -class CVPbkContactOperationBaseStub : public CBase , - public MVPbkContactOperationBase - { - public: // Interface - /** - * Destructor. Cancels this operation and releases any - * resources held by it. - */ - ~CVPbkContactOperationBaseStub() - { - - } - - }; - -#endif // CVPbkContactOperationBaseStub_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkContactStoreUriArrayStub.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkContactStoreUriArrayStub.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -/* -* Copyright (c) 2002-2007 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 - -#include -/** - * Creates a new instance of this class. - * @return Newly created instance of this class. - */ -EXPORT_C CVPbkContactStoreUriArray* CVPbkContactStoreUriArray::NewL() -{ -return new (ELeave) CVPbkContactStoreUriArray(); -} - -/** - * Creates a new instance of this class. Leaves - * the instance to the cleanup stack. - * @return Newly created instance of this class. - */ -EXPORT_C CVPbkContactStoreUriArray* CVPbkContactStoreUriArray::NewLC(){ return NULL; } - -/** - * Creates a new instance of this class internalizing the - * contents of the descriptor. - * @param aPackedUris Packed URIs created by using the - * PackLC functionality of this class. - * @return Newly created instance of this class. - */ -EXPORT_C CVPbkContactStoreUriArray* CVPbkContactStoreUriArray::NewLC(const TDesC8& /*aPackedUris*/){ return NULL; } - -/** - * Destructor. - */ -CVPbkContactStoreUriArray::~CVPbkContactStoreUriArray(){} - - -/** - * Appends StoreUriPtr to this array. - * - * @param aStoreUri Store URI to add array. - */ -EXPORT_C void CVPbkContactStoreUriArray::AppendL(const TVPbkContactStoreUriPtr& /*aStoreUri*/){} - -/** - * Appends array of StoreUriPtr to this array. - * - * @param aUriArray Array of Store URIs to add array. - */ -EXPORT_C void CVPbkContactStoreUriArray::AppendAllL(const CVPbkContactStoreUriArray& /*aUriArray*/){} - -/** - * Removes StoreUriPtr from this array. - * - * @param aStoreUri Store Uri to add array. - */ -EXPORT_C void CVPbkContactStoreUriArray::Remove(const TVPbkContactStoreUriPtr& /*aStoreUri*/){} - -/** - * Returns the count of Store URIs in this array. - * - * @return Count of Store URIs in array. - */ -EXPORT_C TInt CVPbkContactStoreUriArray::Count() const{ return 0; } - -/** - * Gets the URI pointer descriptor from this array at - * the given index. - * - * @param aIndex Index which URI Ptr is needed - * @return URI pointer descriptor. - */ -EXPORT_C TVPbkContactStoreUriPtr CVPbkContactStoreUriArray::operator[](TInt /*aIndex*/) const -{ -TVPbkContactStoreUriPtr ret; -return ret; -} - -/** - * Packs this URI array to a heap descriptor. - * - * @return Packed URI array in a heap descriptor. - */ -EXPORT_C HBufC8* CVPbkContactStoreUriArray::PackLC() const{ return NULL; } - -/** - * Checks whether the given URI is already in this array. - * - * @param aStoreUri Store URI to check. - * @return ETrue if Store URI is in this array, EFalse if not. - */ -EXPORT_C TBool CVPbkContactStoreUriArray::IsIncluded(const TVPbkContactStoreUriPtr& /*aStoreUri*/) const{ return EFalse; } - -CVPbkContactStoreUriArray::CVPbkContactStoreUriArray(){} -void CVPbkContactStoreUriArray::ConstructL(){} -void CVPbkContactStoreUriArray::ConstructL(const TDesC8& /*aPackedUris*/){} -TInt CVPbkContactStoreUriArray::CalculateExternalizedSize() const{ return 0; } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkStoreContactStub.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkStoreContactStub.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ -/* -* Copyright (c) 2007 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 "CVPbkStoreContactStub.h" -#include "s_CVPbkBaseContactFieldCollection.h" -#include -#include "s_MVPbkContactLinkstub.h" - -CVPbkBaseContactFieldCollectionStub gFeildCollection; - -CVPbkStoreContactStub::CVPbkStoreContactStub() -{ - -} - - -MVPbkStoreContactFieldCollection& CVPbkStoreContactStub::Fields() - { - return gFeildCollection; - } -/** - * Returns this contact's fields (read only). - * @return This contact's fields in read only mode. - */ -const MVPbkStoreContactFieldCollection& CVPbkStoreContactStub::Fields() const - { - return gFeildCollection; - } - -/** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ -TBool CVPbkStoreContactStub::IsSame(const MVPbkBaseContact& /*aOtherContact*/) const {return ETrue;} - -/** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ -TBool CVPbkStoreContactStub::IsSame(const MVPbkStoreContact& /*aOtherContact*/) const { return ETrue; } - -/** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ -TBool CVPbkStoreContactStub::IsSame(const MVPbkViewContact& /*aOtherContact*/) const { return ETrue; } - -/** - * Creates link representing this contact. - * - * @return A link or NULL if the contact doesn't exist in the store, - * e.g. a folding contact in the view could be that kind or - * a new contact that hasn't been committed to the store. - * NULL is not put into the CleanupStack. - */ -MVPbkContactLink* CVPbkStoreContactStub::CreateLinkLC() const - { - CVPbkContactLinkStub* contactLink = new (ELeave) CVPbkContactLinkStub(); - CleanupStack::PushL(contactLink); - - return contactLink; - - } - -/** - * Deletes this contact from store asynchronously. - * - * @param aObserver The observer to call back when this operation - * completes. The observer will not be called - * if this function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if the contact can not be modified. - */ -void CVPbkStoreContactStub::DeleteL(MVPbkContactObserver& /*aObserver*/) const {} - -/** - * Returns ETrue if this view contact is from given store - * - * @param aContactStoreUri the URI of the store to compare - * @return ETrue if the view contact was from the given store - */ -TBool CVPbkStoreContactStub::MatchContactStore( - const TDesC& /*aContactStoreUri*/) const { return EFalse; } - -/** - * Returns ETrue if this contact is from the same store - * domain as the given one. - * - * @param aContactStoreDomain the the store domain - * @return ETrue if the contact was from the same store domain. - */ -TBool CVPbkStoreContactStub::MatchContactStoreDomain( - const TDesC& /*aContactStoreDomain*/) const { return EFalse; } - -/** - * Creates and returns a bookmark that points to the contact. - * Bookmark can be used to retrieve an index of the contact in - * the view. - * - * @return A new bookmark to the contact - */ -MVPbkContactBookmark* CVPbkStoreContactStub::CreateBookmarkLC() const { return NULL; } - -/** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ -MVPbkObjectHierarchy& CVPbkStoreContactStub::ParentObject() const -{ -MVPbkObjectHierarchy* ret = NULL; - -return *ret; -} - -/** - * Returns the parent view of the contact. - * - * @return The parent view of the contact. - */ -MVPbkContactViewBase& CVPbkStoreContactStub::ParentView() const -{ -MVPbkContactViewBase* ret=NULL; -return *ret; -} - -/** - * Reads the whole contact from the store asynchronously. - * - * A client can use this if it has a reference of the view contact but - * it needs all the data fields instead of only those that are included - * in the view contact. - * - * The contact is returned in a call back. - * - * @param aObserver An observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - */ -void CVPbkStoreContactStub::ReadL( MVPbkContactObserver& /*aObserver*/ ) const -{ - -} - -/** - * Reads the whole contact and locks it for modification - * asynchronously. - * - * A client can use this if it has a reference of the view contact and - * it needs to modify the contact. - * - * The contact is returned in a call back. - * - * @param aObserver An observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if contact is read-only - */ -void CVPbkStoreContactStub::ReadAndLockL( MVPbkContactObserver& /*aObserver*/ ) const -{ - -} - -/** - * Returns expandable interface for this object or NULL if expanding is - * not supported. - * - * Examples are a contact group that can be expanded to its members view - * or a folding view that can be extended to its internals. Client can - * get the type of the view from MVPbkContactViewBase::Type which is useful - * for knowing the type of expansion. - * - * @return An expansion or NULL. - */ -MVPbkExpandable* CVPbkStoreContactStub::Expandable() const -{ -return NULL; -}; - -/** - * Returns ETrue if two contacts are same. - * - * @param aOtherContact A contact to be compared. - * @param aContactStore The store of the aOtherContact. - * @return ETrue if two contacts are same. - */ -TBool CVPbkStoreContactStub::IsSame( const MVPbkViewContact& /*aOtherContact*/, - const MVPbkContactStore* /*aContactStore*/ ) const - { - return EFalse; - } - -/** - * Returns ETrue if two contacts are same. - * - * @param aOtherContact A contact to be compared. - * @param aContactStore The store of the aOtherContact. - * @return ETrue if two contacts are same. - */ -TBool CVPbkStoreContactStub::IsSame( const MVPbkStoreContact& /*aOtherContact*/, - const MVPbkContactStore* /*aContactStore*/ ) const - { - return EFalse; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkStoreContactStub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/CVPbkStoreContactStub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,393 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef CVPbkStoreContactStub_H -#define CVPbkStoreContactStub_H - - -// INCLUDES -#include -#include - -// CLASS DECLARATIONS - -/** - * An interface for store contacts. - * - * A store contact is a contact that includes all the fields of - * the contact. For this reason it usually contains more data compared - * to the corresponding view contact. It can contain all types of fields that - * are supported by the its parent store. - * - * The store contact can be edited if it's not read-only. The client must - * first lock the existing contact then edit it and finally commit the changes. - * - * @see MVPbkContactStore - * @see MVPbkViewContact - */ -class CVPbkStoreContactStub : public CBase, - public MVPbkStoreContact, - public MVPbkViewContact - { - public: // Destructor - CVPbkStoreContactStub() ; - - ~CVPbkStoreContactStub() { } - - public: // From MVPbkBaseContact (covariant return types) - const MVPbkStoreContactFieldCollection& Fields() const ; - - - - /** - * Returns the parent view of the contact. - * - * @return The parent view of the contact. - */ - MVPbkContactViewBase& ParentView() const ; - - /** - * Reads the whole contact from the store asynchronously. - * - * A client can use this if it has a reference of the view contact but - * it needs all the data fields instead of only those that are included - * in the view contact. - * - * The contact is returned in a call back. - * - * @param aObserver An observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - */ - void ReadL( MVPbkContactObserver& aObserver ) const ; - - /** - * Reads the whole contact and locks it for modification - * asynchronously. - * - * A client can use this if it has a reference of the view contact and - * it needs to modify the contact. - * - * The contact is returned in a call back. - * - * @param aObserver An observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if contact is read-only - */ - void ReadAndLockL( MVPbkContactObserver& aObserver ) const ; - - /** - * Returns expandable interface for this object or NULL if expanding is - * not supported. - * - * Examples are a contact group that can be expanded to its members view - * or a folding view that can be extended to its internals. Client can - * get the type of the view from MVPbkContactViewBase::Type which is useful - * for knowing the type of expansion. - * - * @return An expansion or NULL. - */ - MVPbkExpandable* Expandable() const ; - - /** - * Returns ETrue if two contacts are same. - * - * @param aOtherContact A contact to be compared. - * @param aContactStore The store of the aOtherContact. - * @return ETrue if two contacts are same. - */ - TBool IsSame( const MVPbkViewContact& aOtherContact, - const MVPbkContactStore* aContactStore ) const ; - - /** - * Returns ETrue if two contacts are same. - * - * @param aOtherContact A contact to be compared. - * @param aContactStore The store of the aOtherContact. - * @return ETrue if two contacts are same. - */ - TBool IsSame( const MVPbkStoreContact& aOtherContact, - const MVPbkContactStore* aContactStore ) const ; - - public: // New functions - - - /** - * Returns this contact's parent store. - * - * @return The parent store of the contact. - */ - MVPbkContactStore& ParentStore() const - { - MVPbkContactStore* ret=NULL; - return *ret; - }; - - /** - * Returns this contact's fields (read-write). - * - * @return A collection of contact fields. - */ - MVPbkStoreContactFieldCollection& Fields(); - - /** - * Creates a new field for this contact. - * - * The new field must be added to the contact using AddFieldL. - * - * @param aFieldType A type of the field to create. Must be found in - * ParentStore().SupportedFieldTypes(). - * @return A new field object. The returned object is left on the - * cleanup stack. - * @exception KErrNotSupported if the field type is not supported. - * @exception KErrAccessDenied if the contact can not be modified. - */ - MVPbkStoreContactField* CreateFieldLC( - const MVPbkFieldType& /*aFieldType*/) const { return NULL; }; - - /** - * Adds a new field to the contact. - * - * The field must be previously created with CreateFieldLC and - * it must NOT be used after adding. - * - * If the client needs the field after adding it must be retrieved - * using Fields(). - * - * @param aField A new field that was created using CreateFieldLC. - * This object takes ownership of the field. - * @precond aField must not be NULL or - * VPbkError::Panic(VPbkError::ENullContactField) is raised. - * @precond aField must be returned from this->CreateFieldLC or - * VPbkError::Panic(VPbkError::EInvalidContactField) panic is raised. - * @postcond this->Fields().FieldCount() == - * old(this->Fields().FieldCount()) + 1 - * @return The index of the new field in the field collection. - * @exception KErrAccessDenied if the contact can not be modified. - */ - TInt AddFieldL(MVPbkStoreContactField* /*aField*/) { return 0; }; - - /** - * Removes a field from the contact. - * - * @param aIndex A zero-based index of the field to remove. - * @precond aIndex >= 0 && aIndex < FieldCount(). - * Panics with VPbkError::EInvalidFieldIndex. - * @precond The contact is not read-only otherwise panics with - * VPbkError::EInvalidAccessToReadOnlyContact. - * @postcond this->Fields().FieldCount() == - * old(this->Fields().FieldCount()) - 1 - */ - void RemoveField(TInt /*aIndex*/) {}; - - /** - * Removes all the fields from the contact. - * - * @precond The contact is not read-only otherwise panics with - * VPbkError::EInvalidAccessToReadOnlyContact. - * @postcond this->Fields().FieldCount() = - */ - void RemoveAllFields() {}; - - /** - * Locks this contact for modification asynchronously. - * - * Once the observer is notified this contact is locked and cab - * be modified. - * - * @param aObserver The observer to call back when the operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is - * already in progress. - * @exception KErrAccessDenied if the contact can not be modified. - */ - void LockL(MVPbkContactObserver& /*aObserver*/) const {}; - - /** - * Saves the contact to its associated store asynchronously. - * - * LockL must have been called before commit if this is - * an existing contact. Otherwise ContactOperationFailed is called - * with KErrAccessDenied. - * - * @param aObserver The observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if the contact can not be modified. - */ - void CommitL(MVPbkContactObserver& /*aObserver*/) const {}; - - /** - * Returns the identifiers of the groups that the contact - * belongs to. - * - * @return The groups that this contact belongs to. - */ - MVPbkContactLinkArray* GroupsJoinedLC() const { return NULL; }; - - /** - * Returns the group interface of the store contact if this contact - * is a group. - * If this contact is not a group, NULL is returned. - * - * @return The group interface or NULL. - */ - MVPbkContactGroup* Group() { return NULL; }; - - /** - * Returns the maximum amount of fields of given type that can be - * inserted to the contact. - * - * E.g. A USIM ADN contact can have 1 or more phone numbers but there - * is a limit that the store in USIM defines. - * On the other hand the contact in the Contacts Model data base - * doesn't have limits. - * - * @param aType The field type of the field - * @return The maximum amount fields of given type in the contact - * or KVPbkStoreContactUnlimitedNumber it there is no limit - * set by the store contact - */ - TInt MaxNumberOfFieldL(const MVPbkFieldType& /*aType*/) const { return 0; }; - - /** - * Returns auxiliary properties. - * Can return NULL if underlying store doesn't support any - * of MVPbkStoreContactProperties functions. - * - * @return A properties object - */ - MVPbkStoreContactProperties* PropertiesL() const { return NULL; }; - - /** - * Set the contact as the store's current own contact asynchronously. - * - * @param aObserver The observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrNotSupported If store does not support own contact - */ - void SetAsOwnL(MVPbkContactObserver& /*aObserver*/) const {}; - - - - /** - * Returns this contact's fields (read only). - * @return This contact's fields in read only mode. - */ - // const MVPbkBaseContactFieldCollection& Fields() const ; - - /** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ - TBool IsSame(const MVPbkBaseContact& aOtherContact) const ; - - /** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ - TBool IsSame(const MVPbkStoreContact& aOtherContact) const ; - - /** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ - TBool IsSame(const MVPbkViewContact& aOtherContact) const ; - - /** - * Creates link representing this contact. - * - * @return A link or NULL if the contact doesn't exist in the store, - * e.g. a folding contact in the view could be that kind or - * a new contact that hasn't been committed to the store. - * NULL is not put into the CleanupStack. - */ - MVPbkContactLink* CreateLinkLC() const ; - - /** - * Deletes this contact from store asynchronously. - * - * @param aObserver The observer to call back when this operation - * completes. The observer will not be called - * if this function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if the contact can not be modified. - */ - void DeleteL(MVPbkContactObserver& aObserver) const ; - - /** - * Returns ETrue if this view contact is from given store - * - * @param aContactStoreUri the URI of the store to compare - * @return ETrue if the view contact was from the given store - */ - TBool MatchContactStore( - const TDesC& aContactStoreUri) const ; - - /** - * Returns ETrue if this contact is from the same store - * domain as the given one. - * - * @param aContactStoreDomain the the store domain - * @return ETrue if the contact was from the same store domain. - */ - TBool MatchContactStoreDomain( - const TDesC& aContactStoreDomain) const ; - - /** - * Creates and returns a bookmark that points to the contact. - * Bookmark can be used to retrieve an index of the contact in - * the view. - * - * @return A new bookmark to the contact - */ - MVPbkContactBookmark* CreateBookmarkLC() const ; - - /** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ - MVPbkObjectHierarchy& ParentObject() const; - - }; - - -#endif // CVPbkStoreContactStub - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/pbkuistubs.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/pbkuistubs.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,367 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: -: -* -*/ - - - - - -// INCLUDES -#include "pbkuistubs.h" - - -/** - * Returns Phonebook 2 application UI interface. - * Usage: MPbk2AppUi* appUi = Phonebook2::Pbk2AppUi(); - * - * @return Phonebook 2 application UI interface. - */ -EXPORT_C MPbk2AppUi* Phonebook2::Pbk2AppUi() -{ -return NULL; -}; - -CPbk2AppUiStub::CPbk2AppUiStub(){ } - -CPbk2AppUiStub::~CPbk2AppUiStub(){ } - -/** - * Returns the currently active view. - * - * @return Active view. - */ -CPbk2AppViewBase* CPbk2AppUiStub::ActiveView() const { return NULL; } - -/** - * Returns the Phonebook 2 view explorer if it exists. - * - * @return View explorer. - */ -MPbk2ViewExplorer* CPbk2AppUiStub::Pbk2ViewExplorer() const { return NULL; } - -/** - * Returns the Phonebook 2 startup monitor. - * - * @return Startup monitor. - */ -MPbk2StartupMonitor* CPbk2AppUiStub::Pbk2StartupMonitor() const { return NULL; } - -/** - * Returns Phonebook 2 tab group container. - * - * @return Tab group container. - */ -CPbk2TabGroupContainer* CPbk2AppUiStub::TabGroups() const { return NULL; } - -/** - * Returns Phonebook 2 key event handler. - * - * @return Key event handler. - */ -MPbk2KeyEventHandler& CPbk2AppUiStub::KeyEventHandler() -{ -MPbk2KeyEventHandler* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 application services. - * - * @return Application services. - */ -MPbk2ApplicationServices& CPbk2AppUiStub::ApplicationServices() const -{ -MPbk2ApplicationServices* ret = NULL; -return *ret; -} - -/** - * Handles a command. If Phonebook 2 command handler does not - * handle a command it can then be passed to application UI - * command handler which ultimately handles it. - * For example, exit command is handled by - * application UI not by command handler. - * - * @return Id of the command to handle. - */ -void CPbk2AppUiStub::HandleCommandL( - TInt /*aCommand*/ ) { } - -/** - * Exits application. - */ -void CPbk2AppUiStub::ExitApplication() { } - -CPbk2ApplicationServicesStub::CPbk2ApplicationServicesStub(){ } - -CPbk2ApplicationServicesStub::~CPbk2ApplicationServicesStub(){ } - -/** - * Returns Virtual Phonebook contact manager. - * - * @return Virtual Phonebook contact manager. - */ -CVPbkContactManager& CPbk2ApplicationServicesStub::ContactManager() const -{ -CVPbkContactManager* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 command handler, which handles - * all the commands. - * - * @return Phonebook 2 command handler. - */ -MPbk2CommandHandler* CPbk2ApplicationServicesStub::CommandHandlerL() -{ -return NULL; -} - -/** - * Returns the name formatter object. - * - * @return Phonebook 2 name formatter. - */ -MPbk2ContactNameFormatter& CPbk2ApplicationServicesStub::NameFormatter() const -{ -MPbk2ContactNameFormatter* ret = NULL; -return *ret; -} - -/** - * Returns the sort order manager. - * - * @return Sort order manager. - */ -CPbk2SortOrderManager& CPbk2ApplicationServicesStub::SortOrderManager() const -{ -CPbk2SortOrderManager* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 global send UI. - * - * @return SendUi instance. - */ -CSendUi* CPbk2ApplicationServicesStub::SendUiL() { return NULL; } - -/** - * Returns store property array. - * - * @return Store property array. - */ -CPbk2StorePropertyArray& CPbk2ApplicationServicesStub::StoreProperties() const -{ -CPbk2StorePropertyArray* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 field properties. - * - * @return Phonebook 2 field properties. - */ -CPbk2FieldPropertyArray& CPbk2ApplicationServicesStub::FieldProperties() const -{ -CPbk2FieldPropertyArray* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 store configuration. - * - * @return Phonebook 2 store configuration. - */ -CPbk2StoreConfiguration& CPbk2ApplicationServicesStub::StoreConfiguration() const -{ -CPbk2StoreConfiguration* ret=NULL; -return *ret; -} - -/** - * Returns Phonebook 2 contact store observation register. - * - * @return Phonebook 2 store observation register. - */ -MPbk2StoreObservationRegister& CPbk2ApplicationServicesStub:: - StoreObservationRegister() const - { - MPbk2StoreObservationRegister* ret = NULL; - return *ret; - } - - -/** - * Returns Phonebook 2 contact store validity informer. - * - * @return Phonebook 2 store validity informer. - */ -MPbk2StoreValidityInformer& CPbk2ApplicationServicesStub:: - StoreValidityInformer() const - { - MPbk2StoreValidityInformer* ret = NULL; - return *ret; - } - -/** - * Returns Phonebook 2 view supplier. - * - * @return Phonebook 2 view supplier. - */ -MPbk2ContactViewSupplier& CPbk2ApplicationServicesStub::ViewSupplier() const -{ -MPbk2ContactViewSupplier* ret = NULL; -return *ret; -} - -/** - * Returns global menu filtering flags. - * - * @return Global menu filtering flags. - */ -TInt CPbk2ApplicationServicesStub::GlobalMenuFilteringFlagsL() const { return 0; } - -/** - * Returns service manager. - * - * @return Service manager. - */ -CPbk2ServiceManager& CPbk2ApplicationServicesStub::ServiceManager() const -{ -CPbk2ServiceManager* ret = NULL; -return *ret; -} - -CPbk2CommandHandlerStub::CPbk2CommandHandlerStub(){ } - -CPbk2CommandHandlerStub::~CPbk2CommandHandlerStub(){ } -/** - * Handles Phonebook 2 commands. - * - * @param aCommandId The id of the command to handle. - * @param aControl The UI control of the calling view. - * @param aAppView Application view from where - * the command is launched. - * @return ETrue if the command was handled, EFalse otherwise. - */ -TBool CPbk2CommandHandlerStub::HandleCommandL( - const TInt /*aCommandId*/, - MPbk2ContactUiControl& /*aControl*/, - const CPbk2AppViewBase* /*aAppView*/ ) { return EFalse; } - -/** - * Performs Phonebook 2 menu filtering. - * - * @param aResourceId Resource id of the filtered menu pane. - * @param aMenuPane Menu pane to be filtered. - * @param aViewBase Application view where the filtering - * takes place. - * @param aControl The UI control of the calling view. - */ -void CPbk2CommandHandlerStub::DynInitMenuPaneL( - TInt /*aResourceId*/, - CEikMenuPane* /*aMenuPane*/, - CPbk2AppViewBase& /*aViewBase*/, - MPbk2ContactUiControl& /*aControl*/ ) { } - -/** - * Registers (attaches) to an AIW service. - * - * @param aInterestId Id of the AIW interest. - * @param aMenuResourceId Resource id of the menu to - * attach to the AIW interest. - * @param aInterestResourceId Resource id of the AIW interest. - * @param aAttachBaseService If ETrue, attaches the AIW - * resource id to the AIW base - * service also. This enables command - * handling via AIW without menus. - */ -void CPbk2CommandHandlerStub::RegisterAiwInterestL( - const TInt /*aInterestId*/, - const TInt /*aMenuResourceId*/, - const TInt /*aInterestResourceId*/, - const TBool /*aAttachBaseService*/ ) { } - -/** - * Returns the AIW service command id associated to - * given menu command. If found, it means that there is a - * provider which can handle the menu command. - * - * @see CAiwServiceHandler::ServiceCmdByMenuCmd - * @param aMenuCmdId Menu command id to inspect. - * @return Service command id or KAiwCmdNone. - */ -TInt CPbk2CommandHandlerStub::ServiceCmdByMenuCmd( - TInt /*aMenuCmdId*/ ) const { return 0; } - -/** - * Adds the command into the Phonebook 2 command store and executes it. - * Takes the ownership of the command. - * - * @param aCommand The command to be executed. - */ -void CPbk2CommandHandlerStub::AddAndExecuteCommandL( - MPbk2Command* /*aCommand*/ ) { } - -/** - * Adds a menu command observer. - * - * @param aObserver Menu command observer to add. - */ -void CPbk2CommandHandlerStub::AddMenuCommandObserver( - MPbk2MenuCommandObserver& /*aObserver*/ ) { } - -/** - * Removes a menu command observer. - * - * @param aObserver Menu command observer to remove. - */ -void CPbk2CommandHandlerStub::RemoveMenuCommandObserver( - MPbk2MenuCommandObserver& /*aObserver*/ ) { } - -/** - * Initialises toolbar before it is drawn. - * - * @param aResourceId The resource id of the toolbar. - * @param aToolbar The toolbar object. - * @param aAppView Application view from where - * the command is launched. - * @param aControl The UI control of the calling view. - */ -void CPbk2CommandHandlerStub::DynInitToolbarL( - TInt /*aResourceId*/, - CAknToolbar* /*aToolbar*/, - const CPbk2AppViewBase& /*aAppView*/, - MPbk2ContactUiControl& /*aControl*/ ) { } - -/** - * Handles toolbar events for a certain toolbar item. - * - * @param aCommand The command id of the toolbar item. - * @param aControl The UI control of the calling view. - * @param aAppView Application view from where - * the command is launched. - */ -void CPbk2CommandHandlerStub::OfferToolbarEventL( - TInt /*aCommand*/, - MPbk2ContactUiControl& /*aControl*/, - const CPbk2AppViewBase* /*aAppView*/ ) { } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/pbkuistubs.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/pbkuistubs.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,346 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: -: -* -*/ - - - -#ifndef STUBPBK2APPUI_H -#define STUBPBK2APPUI_H - -// INCLUDES -#include -#include -#include -#include - -// CLASS DECLARATION -class CPbk2ServiceManager; - -/** - * Phonebook 2 application UI interface. - */ -class CPbk2AppUiStub : public CBase, public MPbk2AppUi - { - public: // Interface - - CPbk2AppUiStub(); - - ~CPbk2AppUiStub(); - - /** - * Returns the currently active view. - * - * @return Active view. - */ - CPbk2AppViewBase* ActiveView() const ; - - /** - * Returns the Phonebook 2 view explorer if it exists. - * - * @return View explorer. - */ - MPbk2ViewExplorer* Pbk2ViewExplorer() const ; - - /** - * Returns the Phonebook 2 startup monitor. - * - * @return Startup monitor. - */ - MPbk2StartupMonitor* Pbk2StartupMonitor() const ; - - /** - * Returns Phonebook 2 tab group container. - * - * @return Tab group container. - */ - CPbk2TabGroupContainer* TabGroups() const ; - - /** - * Returns Phonebook 2 key event handler. - * - * @return Key event handler. - */ - MPbk2KeyEventHandler& KeyEventHandler() ; - - /** - * Returns Phonebook 2 application services. - * - * @return Application services. - */ - MPbk2ApplicationServices& ApplicationServices() const ; - - /** - * Handles a command. If Phonebook 2 command handler does not - * handle a command it can then be passed to application UI - * command handler which ultimately handles it. - * For example, exit command is handled by - * application UI not by command handler. - * - * @return Id of the command to handle. - */ - void HandleCommandL( - TInt aCommand ) ; - - /** - * Exits application. - */ - void ExitApplication() ; - }; - - - -// CLASS DECLARATION - -/** - * Phonebook 2 application services interface. - * Shares commonly used objects. - */ -class CPbk2ApplicationServicesStub : public MPbk2ApplicationServices - { - public: // Interface - - CPbk2ApplicationServicesStub(); - - ~CPbk2ApplicationServicesStub(); - - /** - * Returns Virtual Phonebook contact manager. - * - * @return Virtual Phonebook contact manager. - */ - CVPbkContactManager& ContactManager() const ; - - /** - * Returns Phonebook 2 command handler, which handles - * all the commands. - * - * @return Phonebook 2 command handler. - */ - MPbk2CommandHandler* CommandHandlerL() ; - - /** - * Returns the name formatter object. - * - * @return Phonebook 2 name formatter. - */ - MPbk2ContactNameFormatter& NameFormatter() const ; - - /** - * Returns the sort order manager. - * - * @return Sort order manager. - */ - CPbk2SortOrderManager& SortOrderManager() const ; - - /** - * Returns Phonebook 2 global send UI. - * - * @return SendUi instance. - */ - CSendUi* SendUiL() ; - - /** - * Returns store property array. - * - * @return Store property array. - */ - CPbk2StorePropertyArray& StoreProperties() const ; - - /** - * Returns Phonebook 2 field properties. - * - * @return Phonebook 2 field properties. - */ - CPbk2FieldPropertyArray& FieldProperties() const ; - - /** - * Returns Phonebook 2 store configuration. - * - * @return Phonebook 2 store configuration. - */ - CPbk2StoreConfiguration& StoreConfiguration() const ; - - /** - * Returns Phonebook 2 contact store observation register. - * - * @return Phonebook 2 store observation register. - */ - MPbk2StoreObservationRegister& - StoreObservationRegister() const ; - - /** - * Returns Phonebook 2 contact store validity informer. - * - * @return Phonebook 2 store validity informer. - */ - MPbk2StoreValidityInformer& - StoreValidityInformer() const ; - - /** - * Returns Phonebook 2 view supplier. - * - * @return Phonebook 2 view supplier. - */ - MPbk2ContactViewSupplier& ViewSupplier() const ; - - /** - * Returns global menu filtering flags. - * - * @return Global menu filtering flags. - */ - TInt GlobalMenuFilteringFlagsL() const ; - - /** - * Returns service manager. - * - * @return Service manager. - */ - CPbk2ServiceManager& ServiceManager() const ; - - - }; - - -/** - * Phonebook 2 command handler interface. - */ -class CPbk2CommandHandlerStub : public MPbk2CommandHandler - { - public: // Interface - - CPbk2CommandHandlerStub(); - - ~CPbk2CommandHandlerStub(); - /** - * Handles Phonebook 2 commands. - * - * @param aCommandId The id of the command to handle. - * @param aControl The UI control of the calling view. - * @param aAppView Application view from where - * the command is launched. - * @return ETrue if the command was handled, EFalse otherwise. - */ - TBool HandleCommandL( - const TInt aCommandId, - MPbk2ContactUiControl& aControl, - const CPbk2AppViewBase* aAppView ) ; - - /** - * Performs Phonebook 2 menu filtering. - * - * @param aResourceId Resource id of the filtered menu pane. - * @param aMenuPane Menu pane to be filtered. - * @param aViewBase Application view where the filtering - * takes place. - * @param aControl The UI control of the calling view. - */ - void DynInitMenuPaneL( - TInt aResourceId, - CEikMenuPane* aMenuPane, - CPbk2AppViewBase& aViewBase, - MPbk2ContactUiControl& aControl ) ; - - /** - * Registers (attaches) to an AIW service. - * - * @param aInterestId Id of the AIW interest. - * @param aMenuResourceId Resource id of the menu to - * attach to the AIW interest. - * @param aInterestResourceId Resource id of the AIW interest. - * @param aAttachBaseService If ETrue, attaches the AIW - * resource id to the AIW base - * service also. This enables command - * handling via AIW without menus. - */ - void RegisterAiwInterestL( - const TInt aInterestId, - const TInt aMenuResourceId, - const TInt aInterestResourceId, - const TBool aAttachBaseService ) ; - - /** - * Returns the AIW service command id associated to - * given menu command. If found, it means that there is a - * provider which can handle the menu command. - * - * @see CAiwServiceHandler::ServiceCmdByMenuCmd - * @param aMenuCmdId Menu command id to inspect. - * @return Service command id or KAiwCmdNone. - */ - TInt ServiceCmdByMenuCmd( - TInt aMenuCmdId ) const ; - - /** - * Adds the command into the Phonebook 2 command store and executes it. - * Takes the ownership of the command. - * - * @param aCommand The command to be executed. - */ - void AddAndExecuteCommandL( - MPbk2Command* aCommand ) ; - - /** - * Adds a menu command observer. - * - * @param aObserver Menu command observer to add. - */ - void AddMenuCommandObserver( - MPbk2MenuCommandObserver& aObserver ) ; - - /** - * Removes a menu command observer. - * - * @param aObserver Menu command observer to remove. - */ - void RemoveMenuCommandObserver( - MPbk2MenuCommandObserver& aObserver ) ; - - /** - * Initialises toolbar before it is drawn. - * - * @param aResourceId The resource id of the toolbar. - * @param aToolbar The toolbar object. - * @param aAppView Application view from where - * the command is launched. - * @param aControl The UI control of the calling view. - */ - void DynInitToolbarL( - TInt aResourceId, - CAknToolbar* aToolbar, - const CPbk2AppViewBase& aAppView, - MPbk2ContactUiControl& aControl ) ; - - /** - * Handles toolbar events for a certain toolbar item. - * - * @param aCommand The command id of the toolbar item. - * @param aControl The UI control of the calling view. - * @param aAppView Application view from where - * the command is launched. - */ - void OfferToolbarEventL( - TInt aCommand, - MPbk2ContactUiControl& aControl, - const CPbk2AppViewBase* aAppView ) ; - - - }; - -#endif // STUBPBK2APPUI_H - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CPBK2StoreConfiguration.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CPBK2StoreConfiguration.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,146 +0,0 @@ -/* -* Copyright (c) 2005-2007 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 -#include -/** - * Creates a new instance of this class. - * - * @return A new instance of this class. - */ - EXPORT_C /*static*/ CPbk2StoreConfiguration* CPbk2StoreConfiguration::NewL(){ } - -/** - * Destructor. - */ - CPbk2StoreConfiguration::~CPbk2StoreConfiguration(){ } - - - -/** - * Fetches an array of configured contact store URIs. - * - * @return Array of URIs that is the current configuration. - */ - CVPbkContactStoreUriArray* CPbk2StoreConfiguration::CurrentConfigurationL() const{ } - -/** - * Fetches an array of contact store URIs to be used - * in searching, for example in phone number matching. - * - * @return Array of URIs to be used for searching. - */ - CVPbkContactStoreUriArray* CPbk2StoreConfiguration::SearchStoreConfigurationL(){ } - -/** - * Fetches an array of supported contact stores URIs. - * NOTE: All returned stores are not necessarily supported by - * the current HW / SW configuration of the phone. - * - * @return Array of URIs that is the supported store configuration. - */ - CVPbkContactStoreUriArray* CPbk2StoreConfiguration::SupportedStoreConfigurationL() const{ } - -/** - * Returns the URI of the default store for saving contacts. - * - * @return URI of the default store. - */ - TVPbkContactStoreUriPtr CPbk2StoreConfiguration::DefaultSavingStoreL() const{ } - -/** - * Adds a new contact store URI to current configuration. - * Then use AddSupportedContactStoreUriL to add the store to - * supported configuration if desired. - * - * @param aURI The URI to add. - */ - void CPbk2StoreConfiguration::AddContactStoreURIL( - TVPbkContactStoreUriPtr aURI ){ } - -/** - * Removes a contact store URI from current configuration. - * Then use RemoveSupportedContactStoreUriL to remove the store from - * supported configuration if desired. - * - * @param aURI The URI to remove. - */ - void CPbk2StoreConfiguration::RemoveContactStoreURIL( - TVPbkContactStoreUriPtr aURI ){ } - -/** - * Adds a new configuration observer. - * - * @param aObserver The observer to add. - */ - void CPbk2StoreConfiguration::AddObserverL( - MPbk2StoreConfigurationObserver& aObserver ){ } - -/** - * Removes a configuration observer. - * - * @param aObserver The observer to remove. - */ - void CPbk2StoreConfiguration::RemoveObserver( - MPbk2StoreConfigurationObserver& aObserver ){ } - -/** - * Adds a default saving store observer. - * - * @param aObserver The observer to add. - */ - void CPbk2StoreConfiguration::AddDefaultSavingStoreObserverL( - MPbk2DefaultSavingStoreObserver& aObserver ){ } - -/** - * Removes a default saving store observer. - * - * @param aObserver The observer to remove. - */ - void CPbk2StoreConfiguration::RemoveDefaultSavingStoreObserver( - MPbk2DefaultSavingStoreObserver& aObserver ){ } - -/** - * Adds a new contact store URI to supported configuration. - * Use AddContactStoreURIL to add the store to current - * configuration if desired. - * - * @param aURI The URI to add. - */ - void CPbk2StoreConfiguration::AddSupportedContactStoreURIL( - TVPbkContactStoreUriPtr aURI ){ } - -/** - * Removes a contact store URI from supported configuration. - * Use RemoveContactStoreUriL to remove the store from - * current configuration if desired. - * - * @param aURI The URI to remove. - */ - void CPbk2StoreConfiguration::RemoveSupportedContactStoreURIL( - TVPbkContactStoreUriPtr aURI ){ } - - - CPbk2StoreConfiguration::CPbk2StoreConfiguration(){ } -void CPbk2StoreConfiguration::ConstructL(){ } - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CPbk2SortOrderManager.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CPbk2SortOrderManager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2005-2007 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 FILES -#include - - -/** - * Creates a new instance of this class. - * - * @param aMasterFieldTypeList Master field type list. - * Can be retrieved from Virtual - * Phonebook contact manager. - * @param aFs A file system session - * reference for resource file - * handling. If NULL then - * an own session is created. - * @return A new instance of this class. - */ -EXPORT_C CPbk2SortOrderManager* CPbk2SortOrderManager::NewL( - const MVPbkFieldTypeList& /*aMasterFieldTypeList*/, - RFs* /*aFs = NULL*/ ) - { - return new (ELeave) CPbk2SortOrderManager; - } - -/** - * Destructor. - */ -CPbk2SortOrderManager::~CPbk2SortOrderManager(){ } - -/** - * Sets the contact view that this manager manages. - * Takes in use the sort order from the given view. - * - * @param aContactView The contact view to manage. - */ -EXPORT_C void CPbk2SortOrderManager::SetContactViewL( - MVPbkContactViewBase& /*aContactView*/ ){ } - -/** - * Adds an observer. - * - * @param aObserver The observer to add. - */ -EXPORT_C void CPbk2SortOrderManager::AddObserverL( - MPbk2SortOrderObserver& /*aObserver*/ ){ } - -/** - * Removes an observer. - * - * @param aObserver The observer to remove. - */ -EXPORT_C void CPbk2SortOrderManager::RemoveObserver( - MPbk2SortOrderObserver& /*aObserver*/ ){ } - -/** - * Sets the name displaying order for the managed contact view. - * - * @param aNameDisplayOrder New name display order for - * the managed contact view. - * @param aSeparator Custom separator to be used between - * lastname and firstname if it exists. - * If KNullDesC is given, space is used - * as separator. - */ -EXPORT_C void CPbk2SortOrderManager::SetNameDisplayOrderL( - TPbk2NameDisplayOrder /*aNameDisplayOrder*/, - const TDesC& /*aSeparator = KNullDesC*/ ) -{ - -} - -/** - * Returns the current name display order. - * - * @return Current name display order. - */ -EXPORT_C CPbk2SortOrderManager::TPbk2NameDisplayOrder CPbk2SortOrderManager::NameDisplayOrder() const -{ - -return EPbk2NameDisplayOrderLastNameFirstName; -} - -/** - * Returns the current sort order. - * - * @return Current sort order. - */ -EXPORT_C const MVPbkFieldTypeList& CPbk2SortOrderManager::SortOrder() const -{ -MVPbkFieldTypeList* ret = NULL; -return *ret; -} - -/** - * Returns the language specific default separator. - * This can not be changed run time. - * - * @return the language specific default separator. - */ -EXPORT_C const TDesC& CPbk2SortOrderManager::DefaultSeparator(){ return KNullDesC(); } - -/** - * Returns the current separator. This the separator that - * can be changed run time and saved to Central Repository. - * - * @return A current separator. - */ -EXPORT_C const TDesC& CPbk2SortOrderManager::CurrentSeparator() const{ return KNullDesC(); } - - -void CPbk2SortOrderManager::ConstructL( - const MVPbkFieldTypeList& /*aMasterFieldTypeList*/, - RFs* /*aFs*/ ){ } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkBaseContactFieldCollection.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkBaseContactFieldCollection.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - - -// INCLUDES -#include "s_CVPbkBaseContactFieldCollection.h" -#include "s_CVPbkStoreContactField.h" - -TInt gGiveFieldCount = 0; -CVPbkStoreContactFieldStub gField0(0); -CVPbkStoreContactFieldStub gField1(1); -CVPbkStoreContactFieldStub gField2(2); -CVPbkStoreContactFieldStub gJunkField(-1); - - -CVPbkBaseContactFieldCollectionStub::CVPbkBaseContactFieldCollectionStub(){} - -/** - * Destructor. - */ -CVPbkBaseContactFieldCollectionStub::~CVPbkBaseContactFieldCollectionStub(){} - - - const MVPbkStoreContactField& CVPbkBaseContactFieldCollectionStub::FieldAt(TInt /*aIndex*/) const - { - MVPbkStoreContactField* ret = NULL; - return *ret; - } - - -/** - * Returns a field in this collection. - * - * @param aIndex A zero-based index of the field to return. - * @return A reference to the field at aIndex. Reference is valid until - * FieldAt is called again. If you need a permanent copy, - * call MVPbkStoreContactField::CloneLC to the returned - * field. - * @see MVPbkStoreContactField::CloneLC - * @precond aIndex >= 0 && aIndex < FieldCount() - * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised - * if the precondition does not hold. - */ -MVPbkStoreContactField& CVPbkBaseContactFieldCollectionStub::FieldAt( TInt aIndex ) - { - if (aIndex == 0) - { - return gField0; - } - - if (aIndex == 1) - { - return gField1; - } - - if (aIndex == 2) - { - return gField2; - } - - return gJunkField; - } - -/** - * Returns a copy of the field in this collection. - * - * Client gets the ownership of the field. - * - * @param aIndex A zero-based index of the field to return. - * @return A new instance to the field at aIndex. The field is valid - * as long as the parent contact is valid - * @precond aIndex >= 0 && aIndex < FieldCount() - * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised - * if the precondition does not hold. - */ -MVPbkStoreContactField* CVPbkBaseContactFieldCollectionStub::FieldAtLC( TInt /*aIndex*/ ) const { return NULL; } - -/** - * Returns the parent contact of the field collection - * - * @return the parent contact of the field collection - */ -MVPbkStoreContact& CVPbkBaseContactFieldCollectionStub::ParentStoreContact() const -{ -MVPbkStoreContact* ret = NULL; -return *ret; -} - -/** - * Returns a field in this collection identified by a contact field - * link. - * - * A contact field link can be created using the MVPbkStoreContactField - * interface. The same link works then as a contact link and - * a field link. - * - * NOTE: implementations of stores are possibly using an index - * of the field as an identifier so clients should prefer not - * to save field links permanently. E.g modifying the contact - * can invalidate the link in some store implementations. - * A field link is practical in use cases where the link is - * created and immediately given to another component. - * - * @param aContactLink A valid contact field link. - * @return A field in this collection identified by aContactLink or NULL - * if the link does not contain field information or if the - * link does not refer to the parent contact of this field collection. - */ -MVPbkStoreContactField* CVPbkBaseContactFieldCollectionStub::RetrieveField( - const MVPbkContactLink& /*aContactLink*/ ) const { return NULL; } - - - -/** - * Returns the parent contact of this field set. - * @return The parent contact of this field set. - */ -MVPbkBaseContact& CVPbkBaseContactFieldCollectionStub::ParentContact() const -{ -MVPbkBaseContact* ret=NULL; -return *ret; -} - -/** - * Returns the number of fields in this collection. - * @return The number of fields in this collection. - */ -TInt CVPbkBaseContactFieldCollectionStub::FieldCount() const { return gGiveFieldCount; } - -/** - * Returns a read-only field in this collection. - * - * @param aIndex Zero-based index of the field to return. - * @return Reference to a field at aIndex. Reference is - * valid until FieldAt is called again. - * @see MVPbkBaseContactFieldCollection::ConstFieldAt - * @precond aIndex >= 0 && aIndex < FieldCount() - * Panic VPbkError::EInvalidFieldIndex is raised if the - * precondition does not hold. - */ -//const MVPbkBaseContactField& CVPbkBaseContactFieldCollectionStub::FieldAt( - // TInt aIndex) const { } -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactLinkArray.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactLinkArray.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - - -// INCLUDES -#include -/** - * Creates an empty link array. - * - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewL(){ return new (ELeave) CVPbkContactLinkArray; } - -/** - * Creates an empty link array. Leaves the created array object on - * the cleanup stack. - * - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC() -{ -CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; -CleanupStack::PushL(self); -return self; -} - -/** - * Creates a link array from a packed descriptor of links. - * - * @param aPackedLinks a buffer that was created using PackLC - * of MVPbkContactLinkArray or MVPbkContactLink - * @param aStoreList the list of stores that contain the - * stores that links belong. - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC( - const TDesC8& /*aPackedLinks*/, - const MVPbkContactStoreList& /*aStoreList*/) - { - CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; - CleanupStack::PushL(self); - return self; - } - -/** - * Creates a link array from a stream of links. - * - * @param aStream a stream of contact link that was created - * using MVPbkStreamable interface of - * MVPbkContactLink - * @param aStoreList the list of stores that contain the - * stores that links belong. - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC( - RReadStream& /*aStream*/, - const MVPbkContactStoreList& /*aStoreList*/) - { - CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; - CleanupStack::PushL(self); - return self; - } - -/** - * Creates a link array from a stream of links. Uses aLoader - * to find and load stores. - * aLoader must exist the life time of this object. - * - * @param aStream a stream of contact link that was created - * using MVPbkStreamable interface of - * MVPbkContactLink - * @param aLoader the contact store loader for internalization. - * @return A new instance of this class - */ - CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC( - RReadStream& /*aStream*/, - MVPbkContactStoreLoader& /*aLoader*/ ) - { - CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; - CleanupStack::PushL(self); - return self; - } - -/** - * Destructor. - */ -CVPbkContactLinkArray::~CVPbkContactLinkArray(){ } - - -/** - * Appends a link to this array. - * - * @param aLink the link object to append. This array takes ownership - * of the link if append is succesful. - * @pre aLink != NULL - * @post Array count is increased by one and the link is in the last - * element of the array. - */ -EXPORT_C void CVPbkContactLinkArray::AppendL(MVPbkContactLink* /*aLink*/){ } - -/** - * Inserts a link to this array. - * - * @param aLink the link object to insert. This array takes ownership - * of the link if insertion is succesful. - * @param aIndex position where to insert the link. - * @exception KErrNoMemory if out of memory. - * @pre aLink != NULL - * @pre aIndex >= 0 && aIndex <= Count() - * @post Array count is increased by one and the link is in the position - * marked by the aIndex element of the array. - */ -EXPORT_C void CVPbkContactLinkArray::InsertL(MVPbkContactLink* /*aLink*/, TInt /*aIndex*/){ } - -/** - * Removes a link at aIndex from this array. - * - * @pre aIndex >= 0 && aIndex <= Count() - * @post The array count is decreased by one. - */ -EXPORT_C void CVPbkContactLinkArray::Remove(TInt /*aIndex*/){ } - -/** - * Removes and deletes a link at aIndex from this array. - * - * @pre aIndex >= 0 && aIndex <= Count() - * @post The array count is decreased by one. - */ -EXPORT_C void CVPbkContactLinkArray::Delete(TInt /*aIndex*/){ } - -/** - * Resets the array and destroys the links - */ -EXPORT_C void CVPbkContactLinkArray::ResetAndDestroy(){ } - -/** - * Resets this array but doesn't destroy links - * - * @post Count() == 0 - */ -EXPORT_C void CVPbkContactLinkArray::Reset(){ } - -/** - * Returns the size of the packed link array - */ -EXPORT_C TInt CVPbkContactLinkArray::PackedBufferSize() const{ return 0; } - - -TInt CVPbkContactLinkArray::Count() const{ return 0; } -const MVPbkContactLink& CVPbkContactLinkArray::At(TInt /*aIndex*/) const - { - MVPbkContactLink* ret = NULL; - return *ret; - } - -TInt CVPbkContactLinkArray::Find(const MVPbkContactLink& /*aLink*/) const{ return 0; } -HBufC8* CVPbkContactLinkArray::PackLC() const -{ - HBufC8* temp = HBufC8::NewLC( 10 ); - //CleanupStack::PushL( temp ); - return temp; -} -const MVPbkStreamable* CVPbkContactLinkArray::Streamable() const -{ -return NULL; -} - - -CVPbkContactLinkArray::CVPbkContactLinkArray(){ } -void CVPbkContactLinkArray::ConstructL(){ } -void CVPbkContactLinkArray::ConstructL(const TDesC8& /*aPackedLinks*/, - const MVPbkContactStoreList& /*aOperations*/){ } -void CVPbkContactLinkArray::ConstructL(RReadStream& /*aStream*/, - const MVPbkContactStoreList& /*aOperations*/){ } -TInt CVPbkContactLinkArray::DoCalculatePackedBufferSizeV2() const{ return 0; } -void CVPbkContactLinkArray::DoFillPackedBufferV2L(RWriteStream& /*aWriteStream*/) const{ } -void CVPbkContactLinkArray::InternalizeFromBufferL( RReadStream& /*aReadStream*/, - const MVPbkContactStoreList& /*aStoreList*/ ){ } -void CVPbkContactLinkArray::DoInternalizeFromBufferL( RReadStream& /*aReadStream*/, - const MVPbkContactStoreList& /*aStoreList*/){ } -void CVPbkContactLinkArray::DoInternalizeFromBufferV2L(RReadStream& /*aReadStream*/, - const MVPbkContactStoreList& /*aStoreList*/){ } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactManager.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactManager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,380 +0,0 @@ -/* -* Copyright (c) 2002-2007 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 - -#include "CVPbkContactOperationBaseStub.h" -#include "s_CVPbkContactStoreList.h" - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook Contact Manager. Contact Manager is the root access point - * to Virtual Phonebook engine functionality. The client can specify the list - * of stores in the constructor he/she is interested in or load additional - * plug-ins later on. In addition to loading the implementing plug-ins the - * client must open the stores. Clients should share the contact manager - * instance within their context, otherwise e.g. field types from two - * different instances will not produce the matches as the matching is - * based on pointer comparison. - * - * Examples of absolute URI stores: - * Default contact database: "cntdb://contacts.cdb" - * LDAP store: "ldap://www.telnumbers.com/" - * The URI scheme name is used to resolve a store capable of supporting - * this type of store. The actual store implementations are ECom plugins. - * - * @lib VPbkEng.lib - */ - -TSecurityInfo gTSecurityInfo; -CVPbkContactOperationBaseStub* gOperationStub; -CVPbkContactStoreListStub gStoreList; - -/** - * Creates a contact manager instance and loads the plug-ins that can - * handle the stores corresponding to the aURIList. - * @param aURIList Universal Resource Identifier list of the stores - * to be loaded initially. - * @param aFs File system handle. NULL opens a new connection. - * @return Contact manager instance. - */ -EXPORT_C CVPbkContactManager* CVPbkContactManager::NewL( - const CVPbkContactStoreUriArray& /*aURIList*/, - RFs* aFs /*= NULL*/) - { - return new( ELeave ) CVPbkContactManager( gTSecurityInfo, aFs); - } - -/** - * Creates a contact manager instance and loads the plug-ins that can - * handle the stores corresponding to the aURIList. - * @param aSecurityInfo Security info from caller to be passed for stores. - * Stores can check security info and deside - * if client can use service. - * @param aURIList Universal Resource Identifier list of the stores - * to be loaded initially. - * @param aFs File system handle. NULL opens a new connection. - * @return Contact manager instance. - */ -EXPORT_C CVPbkContactManager* CVPbkContactManager::NewL( - TSecurityInfo aSecurityInfo, - const CVPbkContactStoreUriArray& /*aURIList*/, - RFs* aFs /*= NULL*/) - { - return new( ELeave ) CVPbkContactManager( aSecurityInfo, aFs); - } - -/** - * Destructor. - */ -CVPbkContactManager::~CVPbkContactManager(){ } - - -/** - * The contact manager owns a master list of field types that clients - * use. The store implementation then maps their native types - * to Virtual Phonebook types. Clients don't create field type objects - * themselves but use always references to types offered - * by this function. - * - * @return The global list of field types. - */ -EXPORT_C const MVPbkFieldTypeList& CVPbkContactManager::FieldTypes() const - { - MVPbkFieldTypeList* retValue = NULL; - return *retValue; - - } - -/** - * The contact store list is used to handle a set of stores. - * After creation of manager the client can use the list to open - * all stores. - * - * @return The list of available contact stores. - */ -EXPORT_C MVPbkContactStoreList& CVPbkContactManager::ContactStoresL(){ return gStoreList; } - -/** - * Loads a store plug-in for given URI and adds aURI - * to the list of stores handled by this manager. - * If there is no store plug-in for the aURI then nothing changes. - * - * @param aURI the store URI to be loaded. - */ -EXPORT_C void CVPbkContactManager::LoadContactStoreL(const TVPbkContactStoreUriPtr& /*aURI*/){ } - -/** - * Attribute manager is used for handling contact attributes like - * speed dialing or defaults. - * - * @returns The contact attribute manager. - */ -EXPORT_C MVPbkContactAttributeManager& CVPbkContactManager::ContactAttributeManagerL() - { - MVPbkContactAttributeManager* ret = NULL; - return *ret; - } - -/** - * Creates a new contact view specified by the view definition. - * The view can not be used before it has notified the observer - * that it is ready. - * - * @param aObserver the observer for view events. - * @param aViewDefinition Definition of the view to create - * @param aSortOrder a list of field types that defines fields - * that are used in sorting. View contacts - * have these fields. However, the store can have restrictions - * for types that can be used in the sort order. - * The sort order has no effect for shared views that have - * already been created. - * - * @see CVPbkSortOrder - * @return Newly created view. - * If NULL CleanupStack pop is still needed - */ -EXPORT_C MVPbkContactViewBase* CVPbkContactManager::CreateContactViewLC( - MVPbkContactViewObserver& /*aObserver*/, - const CVPbkContactViewDefinition& /*aViewDefinition*/, - const MVPbkFieldTypeList& /*aSortOrder*/) const - { - return NULL; - } - -/** - * Retrieves asynchronously a contact that is individualized by - * a contact link. Delete the operation for canceling. - * - * @param aLink a link to the contact - * @param aObserver operation observer - * @return New handle to the operation - * @Asynchronous - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::RetrieveContactL( - const MVPbkContactLink& /*aLink*/, - MVPbkSingleContactOperationObserver& /*aObserver*/) const - { - gOperationStub = new( ELeave ) CVPbkContactOperationBaseStub(); - return gOperationStub; - } - -/** - * Creates an array of links corresponding to a packaged link or links. - * Packed links have been obtained by packing a link or a link array - * and they can be used for example for IPC but not for saving links. - * Loads the store plug-ins that are capable of creating the - * appropriate links. - * - * @param aPackedLinks packed links - * @return A link array. - * @see MVPbkContactLink::PackLC - * @see MVPbkContactLinkArray::PackLC - */ -EXPORT_C MVPbkContactLinkArray* CVPbkContactManager::CreateLinksLC( - const TDesC8& /*aPackedLinks*/) const{ return NULL; } - -/** - * Internalizes a permanent link or links. An externalized link - * has been created using MVPbkStreamable interface from - * MVPbkContactLink. - * Loads the store plug-ins that are capable of creating the - * appropriate links. - * - * @param aStream a stream that contains a link or links. - * @return A link array - * @see MVPbkContactLink::Streamable - */ -EXPORT_C MVPbkContactLinkArray* CVPbkContactManager::CreateLinksLC( - RReadStream& /*aStream*/) const{ return NULL; } - -/** - * Deletes contacts defined in link array asynchronously. - * - * @param aContactLinks Contacts to delete - * @param aObserver Operation observer - * @return New handle to the operation - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::DeleteContactsL( - const MVPbkContactLinkArray& /*aContactLinks*/, - MVPbkBatchOperationObserver& /*aObserver*/){ return NULL; } - -/** - * Commits all contacts in aContacts asynchronously. - * - * @see MVPbkStoreContact::CommitL - * @param aContacts Contacts to commit. - * @param aObserver Operation observer. - * @return New handle to the operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::CommitContactsL( - const TArray& /*aContacts*/, - MVPbkBatchOperationObserver& /*aObserver*/){ return NULL; } - -/** - * Copies all contacts in aContactLinks to aTargetStore asynchronously. - * If aTargetStore is NULL, contacts are copied to the store where - * they already are, ie. the contacts are duplicated. - * - * @param aContactLinks Array of contact links to duplicate. - * @param aTargetStore Target store to copy contacts to. - * If NULL this behaves like duplicate. - * @param aObserver Observer for the copying process. - * @return New handle to the operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::CopyContactsL( - const MVPbkContactLinkArray& /*aContactLinks*/, - MVPbkContactStore* /*aTargetStore*/, - MVPbkBatchOperationObserver& /*aObserver*/){ return NULL; } - -/** - * Searches the contact stores for a phone number using - * defined amount of digits from the end of the number asynchronously. - * The store implementations determine, which field types are included - * in the search. - * - * @param aPhoneNumber Phone number to search for. - * @param aMaxMatchDigits Maximum number of digits to match - * from the end of the number. - * @param aObserver Observer for the find process. - * @return New handle to the find operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::MatchPhoneNumberL( - const TDesC& /*aPhoneNumber*/, - TInt /*aMaxMatchDigits*/, - MVPbkContactFindObserver& /*aObserver*/){ return NULL; } - -/** - * Searches the contact stores for a contact that contains - * the given string in one of the field defined by given - * field type list asynchronously. - * NOTE: In some cases the find matches also other fields than - * those specified in aFieldTypes. Always loop through the - * results to check match in the required fields. - * - * @param aSearchString String to search for. - * @param aFieldTypes List of field types that the search will include. - * a field type list: use CVPbkFieldTypeRefsList and - * append the types that are needed from - * the master field type list (FieldTypes()) - * to the reference list. Selection can be done - * in a dynamic way using CVPbkFieldTypeSelector or - * static way using resource ids of the field types. - * @param aObserver Observer for the find process. - * @return New handle to the find operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::FindL( - const TDesC& /*aSearchString*/, - const MVPbkFieldTypeList& /*aFieldTypes*/, - MVPbkContactFindObserver& /*aObserver*/){ return NULL; } - -/** - * Finds a string containing text that is stored in one or more - * fields asynchronously. Client can give multiple find words. - * All the words must match to separated data. E.g. if there are - * two find words: "Jo" and "Jo" then field data "John Johnson" - * matches but "John Doe" doesn't if the word parser uses - * white space as a word separator. - * - * NOTE: The accuracy of the results depends on the implementation - * of the store to carry out the find operation. The performance - * can also vary depending on the store. - * - * @param aSearchStrings strings that are compared to field data. - * @param aFieldTypes types of the fields that are used. Constructing - * a fieldtype list: use CVPbkFieldTypeRefsList and - * append the types that are needed from - * the master fieldtype list (FieldTypes()) - * to the reference list. Selection can be done - * in a dynamic way using CVPbkFieldTypeSelector or - * static way using resource ids of the fieldtypes. - * - * @param aObserver an observer for asynchronous operation. - * @param aWordParserCallBack a client implementation of word parser - * function that separates the field data - * into words. Parameter to function is - * TVPbkWordParserParam. - * @return New handle to the find operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::FindL( - const MDesC16Array& /*aSearchStrings*/, - const MVPbkFieldTypeList& /*aFieldTypes*/, - MVPbkContactFindFromStoresObserver& /*aObserver*/, - const TCallBack& /*aWordParserCallBack*/ ){ return NULL; } - -/** - * Compresses all stores asynchronously. - * NOTE: Not all stores are able to implement compression to their - * repositories. - * - * @param aObserver Operation observer. - * @return New handle to the operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::CompressStoresL( - MVPbkBatchOperationObserver& /*aObserver*/){ return NULL; } - -/** - * Returns the file server session of the contact manager. - * - * @return File server session of the contact manager. - */ -EXPORT_C RFs& CVPbkContactManager::FsSession() - { - RFs* rfs = NULL; - return *rfs; - } - - -CVPbkContactManager::CVPbkContactManager( TSecurityInfo /*aSecurityInfo*/, RFs* /*aFs*/ ) - { - - } - - -void CVPbkContactManager::ConstructL(const CVPbkContactStoreUriArray& /*aURIList*/) - { - - } - - -MVPbkContactStore* CVPbkContactManager::FindStore(const TVPbkContactStoreUriPtr& /*aURI*/) const - { - return NULL; - } - - -MVPbkContactViewBase* CVPbkContactManager::CreateOptimizedCompositeViewLC( - MVPbkContactViewObserver& /*aObserver*/, - const CVPbkContactViewDefinition& /*aViewDefinition*/, - const MVPbkFieldTypeList& /*aSortOrder*/) const - { - return NULL; - } - -MVPbkContactViewBase* CVPbkContactManager::CreateCompositeViewLC( - MVPbkContactViewObserver& /*aObserver*/, - const CVPbkContactViewDefinition& /*aViewDefinition*/, - const MVPbkFieldTypeList& /*aSortOrder*/) const -{ -return NULL; -} - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactOperationBase.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactOperationBase.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef STUBVPBKCONTACTOPERATIONBASE_H -#define STUBVPBKCONTACTOPERATIONBASE_H - -// INCLUDES -#include -#include - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook abtract asynchronous contact operation. - * This interface is used as a handle to asynchronous contact operations. - * Clients should keep a reference to the handle during the asynchronous - * operation to be able to delete and cancel the operation before it - * completes. - */ -class CVPbkContactOperationBaseStub : public CBase, public MVPbkContactOperationBase - { - public: // Interface - /** - * Destructor. Cancels this operation and releases any - * resources held by it. - */ - ~CVPbkContactOperationBaseStub() {} - - CVPbkContactOperationBaseStub() - { - - } - - - }; - -#endif // STUBVPBKCONTACTOPERATIONBASE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactStoreList.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactStoreList.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,388 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - - -// INCLUDES -#include -#include "s_CVPbkContactStoreList.h" -#include "CVPbkStoreContactStub.h" -#include "s_CVPbkContactView.h" - -CVPbkContactStoreStub gLocalStore; -CVPbkContactStoreStub gXSPStore; - -// FORWARD DECLARATIONS - -/** - * Returns fixed properties of this contact store. - * - * Fixed properties do not change when the store is open. - * The store must be opened before retrieving the properties. - * - * @return Store properties. - */ -const MVPbkContactStoreProperties& CVPbkContactStoreStub::StoreProperties() const -{ -MVPbkContactStoreProperties* ret = NULL; -return *ret; -} - -/** - * Opens this contact store asynchronously. - * - * Calls back the observer when the opening completes. Notice - * that the same store instance can be opened by several observers. - * - * @param aObserver An observer for the store. - * @exception KErrInUse If another asynchronous operation - * is already in progress. - */ -void CVPbkContactStoreStub::OpenL( - MVPbkContactStoreObserver& /*aObserver*/ ) { } - -/** - * Replaces an existing store and opens it asynchronously. - * - * E.g. If the database is a file then this replaces the database if - * it's not locked by other clients. If the store - * implementation can not implment replacing then this behaves - * like OpenL. - * - * If the store does not exist, it is created if possible. - * Calls back the observer when the opening completes. - * - * @param aObserver An observer for the store. - */ -void CVPbkContactStoreStub::ReplaceL( - MVPbkContactStoreObserver& /*aObserver*/ ) { } - -/** - * Closes this contact store from a single observer. - * - * This can be always called safely even if OpenL or ReplaceL - * hasn't been called. - * If the client calls OpenL it must also call this after usage, - * The observer will no longer receive events from this store. - * If there are other observers for the store then the store - * will remain open for them. - * - * @param aObserver An observer that was given in OpenL or ReplaceL. - */ -void CVPbkContactStoreStub::Close( - MVPbkContactStoreObserver& /*aObserver*/ ) { } - -/** - * Creates a new contact associated to this store. - * - * The contact can be edited and then it must be committed by - * calling MVPbkStoreContact::CommitL for actually saving - * it to the store. - * - * @return A new contact associated to this store. Caller takes - * ownership of the returned contact. - * @see MVPbkStoreContact - * @see MVPbkStoreContact::CommitL - */ -MVPbkStoreContact* CVPbkContactStoreStub::CreateNewContactLC() -{ -return new (ELeave) CVPbkStoreContactStub; -} - -/** - * Creates a new contact group associated to this store. - * - * MVPbkContactStoreProperties::SupportsContactGroups must be - * true if this is used. - * The contact group might be saved to the store immeadiately - * depending on the store implementation. - * It is left open for editing. Use CommitL to commit - * the creation of the group and its content. - * - * @return A new contact group associated to this store. Caller takes - * the ownership of the returned contact group. - * @exception KErrNotSupported if the store doesn't support groups. - * Client should check store properties before - * calling this. - * @see MVPbkContactStoreProperties - * @see MVPbkContactGroup - * @see MVPbkStoreContact - * @see MVPbkStoreContact::CommitL - */ -MVPbkContactGroup* CVPbkContactStoreStub::CreateNewContactGroupLC() { return NULL; } - -/** - * Creates a new contact view from the store asynchronously. - * - * Client gets the ownership of the view. The content of - * the view depends on the CVPbkContactViewDefinition. The - * client must wait the observer event before using the view. - * - * @param aViewDefinition Defines the properties of the new view. - * @param aObserver An observer for the view events. - * @param aSortOrder Field types that are used in the view contact - * in the same order as in this list. Notice that - * stores may not support all possible field types - * in a view contact. The implementation - * of the view contact must have as many fields as - * the sort order. If the store doesn't support the - * field type in a view contact then it sets empty - * data to the field. - * @return A new contact view object. Caller takes ownership of the - * returned contact. - * @see MVPbkContactView - * @see CVPbkContactViewDefinition - */ -MVPbkContactView* CVPbkContactStoreStub::CreateViewLC( - const CVPbkContactViewDefinition& /*aViewDefinition*/, - MVPbkContactViewObserver& /*aObserver*/, - const MVPbkFieldTypeList& /*aSortOrder*/ ) - { - CVPbkContactViewStub* some = new (ELeave) CVPbkContactViewStub; - CleanupStack::PushL(some); - return some; - } - -/** - * Returns contact groups contained in this store. - * - * MVPbkContactStoreProperties::SupportsContactGroups must be - * true if this is used. Implementation should return an empty - * link array and not NULL. - * - * @return Contact group identifiers contained in this store. - */ -MVPbkContactLinkArray* CVPbkContactStoreStub::ContactGroupsLC() const { return NULL; } - -/** - * Returns a contact store information. Information can vary - * runtime. - * - * @return Contact store information. - */ -const MVPbkContactStoreInfo& CVPbkContactStoreStub::StoreInfo() const -{ -MVPbkContactStoreInfo* ret = NULL; -return *ret; -} - -/** - * This is part of Virtual Phonebook internal framefork and not - * usable for clients. Clients use CVPbkContactManager - * for creating links from a stream. - * - * Creates a link array from a stream. Stream contains the internals - * of the contact link. Internals are the contact store implementation - * specific part of the package format. - * - * NOTE: this must work wheter the OpenL has been called or not. This - * means that a link can not contain any data that would need - * an open store before internalizing. - * - * @param aStream A stream containing the link internals. - * @return A new contact link. - * @internal - */ -MVPbkContactLink* CVPbkContactStoreStub::CreateLinkFromInternalsLC( - RReadStream& /*aStream*/ ) const { return NULL; } - -/** -* Returns own contact link asynchronously. -* -* @params aObserver Operation observer -* @return operation handle -* @Asynchronous -*/ -MVPbkContactOperationBase* CVPbkContactStoreStub::OwnContactLinkL( - MVPbkSingleContactLinkOperationObserver& /*aObserver*/) const { return NULL; } - - -/** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ -MVPbkObjectHierarchy& CVPbkContactStoreStub::ParentObject() const -{ -MVPbkObjectHierarchy* ret=NULL; -return *ret; -} - - -/** - * Creates an operation for contact retrieval. - * - * @param aLink A link to the contact - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL if the factory - * doesn't have reference to the store of the link. - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateContactRetrieverL( - const MVPbkContactLink& /*aLink*/, - MVPbkSingleContactOperationObserver& /*aObserver*/) { return NULL; } - -/** - * Creates an operation for deleting multiple contacts. - * - * @param aContactLinks An array of contact links that specify - * the contacts. - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateDeleteContactsOperationL( - const MVPbkContactLinkArray& /*aContactLinks*/, - MVPbkBatchOperationObserver& /*aObserver*/ ) { return NULL; } - -/** - * Creates an operation for committing multiple contacts. - * - * @param aContacts An array of contact links that specify - * the contacts - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateCommitContactsOperationL( - const TArray& /*aContacts*/, - MVPbkBatchOperationObserver& /*aObserver*/) { return NULL; } - -/** - * Creates an operation for asynchronous phone number matching. - * - * @param aPhoneNumber A phone number to search for. - * @param aMaxMatchDigits Maximum number of digits to match from - * the end of the number. - * @param aObserver Observer for the find process. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateMatchPhoneNumberOperationL( - const TDesC& /*aPhoneNumber*/, - TInt /*aMaxMatchDigits*/, - MVPbkContactFindObserver& /*aObserver*/) { return NULL; } - -/** - * Creates an operation for asynchronous contact finding. - * - * @param aSearchString String to search for. - * @param aFieldTypes List of field types that the search will include. - * @param aObserver Observer for the find process. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateFindOperationL( - const TDesC& /*aSearchString*/, - const MVPbkFieldTypeList& /*aFieldTypes*/, - MVPbkContactFindObserver& /*aObserver*/) { return NULL; } - -/** - * Creates an operation for asynchronous contact finding. - * Finds a string containing text that is stored in one or more fields. - * Client can give multiple find words. All the words must match to separated - * data. E.g if there are two find words: "Jo" and "Jo" then field data - * "John Johnson" matches but "John Doe" doesn't if the word parser uses - * white space as a word separator. - * - * NOTE: The accuracy of the results depends on the ability of the store - * implementation to implement the find. The performance can vary - * too depending on the store. - * - * @param aSearchStrings Words that are compared to field data. - * @param aFieldTypes Types of the fields that are used. - * @param aObserver An observer for asynchronous operation. - * @param aWordParserCallBack a client implementation of word parser - * function that separates the field data - * into words. Parameter to function is - * TVPbkWordParserParam. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateFindOperationL( - const MDesC16Array& /*aSearchStrings*/, - const MVPbkFieldTypeList& /*aFieldTypes*/, - MVPbkContactFindFromStoresObserver& /*aObserver*/, - const TCallBack& /*aWordParserCallBack*/ ) { return NULL ;} - -/** - * Creates an operation for compressing the store. - * - * @param aObserver An observer for the compress operation. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateCompressStoresOperationL( - MVPbkBatchOperationObserver& /*aObserver*/) { return NULL; } - - -/** - * Returns the number of stores in the list. - * - * @return The number of stores in the list. - */ -TInt CVPbkContactStoreListStub::Count() const { return 0; } - -/** - * Returns the store in given index in the list. - * - * @param aIndex the index of the store in the list - * @precond aIndex > && aIndex < Count() - * VPbkError::Panic(VPbkError::EInvalidStoreIndex) - * is raised if the precondition does not hold. - * @return The store in the specified index. - */ -MVPbkContactStore& CVPbkContactStoreListStub::At(TInt /*aIndex*/) const -{ -MVPbkContactStore* ret =NULL; -return *ret; -} - -/** - * Finds the contact store corresponding to the aUri. - * - * @param aUri the store URI to search for. - * @return The contact store corresponding to the aUri or NULL. - */ -MVPbkContactStore* CVPbkContactStoreListStub::Find( - const TVPbkContactStoreUriPtr& /*aUri*/) const - { - return &gXSPStore; - } - -/** - * Opens all stores in the list asynchronously. - * - * A client can not use stores before it has successfully opened - * them. CloseAll must be always called by the same observer that has - * opened stores. - * - * NOTE: There can be only one observer for one store list at a time. - * - * @param aObserver An observer for the stores. - * @exception KErrInUse If one observer is currently opening this list. - */ -void CVPbkContactStoreListStub::OpenAllL(MVPbkContactStoreListObserver& /*aObserver*/) { } - -/** - * Closes all stores in the list. - * - * This is safe to call in all circumstances. Implementations - * can not trust that OpenAllL has been called before. - * - * @param aObserver An observer for the close process. - */ -void CVPbkContactStoreListStub::CloseAll(MVPbkContactStoreListObserver& /*aObserver*/) { } - - - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactStoreList.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactStoreList.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,400 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef SCVPBKCONTACTSTORELIST_H -#define SCVPBKCONTACTSTORELIST_H - -// INCLUDES -#include -#include -#include -#include -#include - -// FORWARD DECLARATIONS - - - -class CVPbkContactStoreStub : public CBase, public MVPbkContactStore - { - public: // Destructor - - /** - * Clients don't destroy the stores directly because they don't - * own them. The ownerships are managed by CVPbkContactManager. - */ - ~CVPbkContactStoreStub() { }; - - CVPbkContactStoreStub() { }; - - public: // New functions - /** - * Returns fixed properties of this contact store. - * - * Fixed properties do not change when the store is open. - * The store must be opened before retrieving the properties. - * - * @return Store properties. - */ - const MVPbkContactStoreProperties& StoreProperties() const ; - - /** - * Opens this contact store asynchronously. - * - * Calls back the observer when the opening completes. Notice - * that the same store instance can be opened by several observers. - * - * @param aObserver An observer for the store. - * @exception KErrInUse If another asynchronous operation - * is already in progress. - */ - void OpenL( - MVPbkContactStoreObserver& aObserver ) ; - - /** - * Replaces an existing store and opens it asynchronously. - * - * E.g. If the database is a file then this replaces the database if - * it's not locked by other clients. If the store - * implementation can not implment replacing then this behaves - * like OpenL. - * - * If the store does not exist, it is created if possible. - * Calls back the observer when the opening completes. - * - * @param aObserver An observer for the store. - */ - void ReplaceL( - MVPbkContactStoreObserver& aObserver ) ; - - /** - * Closes this contact store from a single observer. - * - * This can be always called safely even if OpenL or ReplaceL - * hasn't been called. - * If the client calls OpenL it must also call this after usage, - * The observer will no longer receive events from this store. - * If there are other observers for the store then the store - * will remain open for them. - * - * @param aObserver An observer that was given in OpenL or ReplaceL. - */ - void Close( - MVPbkContactStoreObserver& aObserver ) ; - - /** - * Creates a new contact associated to this store. - * - * The contact can be edited and then it must be committed by - * calling MVPbkStoreContact::CommitL for actually saving - * it to the store. - * - * @return A new contact associated to this store. Caller takes - * ownership of the returned contact. - * @see MVPbkStoreContact - * @see MVPbkStoreContact::CommitL - */ - MVPbkStoreContact* CreateNewContactLC() ; - - /** - * Creates a new contact group associated to this store. - * - * MVPbkContactStoreProperties::SupportsContactGroups must be - * true if this is used. - * The contact group might be saved to the store immeadiately - * depending on the store implementation. - * It is left open for editing. Use CommitL to commit - * the creation of the group and its content. - * - * @return A new contact group associated to this store. Caller takes - * the ownership of the returned contact group. - * @exception KErrNotSupported if the store doesn't support groups. - * Client should check store properties before - * calling this. - * @see MVPbkContactStoreProperties - * @see MVPbkContactGroup - * @see MVPbkStoreContact - * @see MVPbkStoreContact::CommitL - */ - MVPbkContactGroup* CreateNewContactGroupLC() ; - - /** - * Creates a new contact view from the store asynchronously. - * - * Client gets the ownership of the view. The content of - * the view depends on the CVPbkContactViewDefinition. The - * client must wait the observer event before using the view. - * - * @param aViewDefinition Defines the properties of the new view. - * @param aObserver An observer for the view events. - * @param aSortOrder Field types that are used in the view contact - * in the same order as in this list. Notice that - * stores may not support all possible field types - * in a view contact. The implementation - * of the view contact must have as many fields as - * the sort order. If the store doesn't support the - * field type in a view contact then it sets empty - * data to the field. - * @return A new contact view object. Caller takes ownership of the - * returned contact. - * @see MVPbkContactView - * @see CVPbkContactViewDefinition - */ - MVPbkContactView* CreateViewLC( - const CVPbkContactViewDefinition& aViewDefinition, - MVPbkContactViewObserver& aObserver, - const MVPbkFieldTypeList& aSortOrder ) ; - - /** - * Returns contact groups contained in this store. - * - * MVPbkContactStoreProperties::SupportsContactGroups must be - * true if this is used. Implementation should return an empty - * link array and not NULL. - * - * @return Contact group identifiers contained in this store. - */ - MVPbkContactLinkArray* ContactGroupsLC() const ; - - /** - * Returns a contact store information. Information can vary - * runtime. - * - * @return Contact store information. - */ - const MVPbkContactStoreInfo& StoreInfo() const ; - - /** - * This is part of Virtual Phonebook internal framefork and not - * usable for clients. Clients use CVPbkContactManager - * for creating links from a stream. - * - * Creates a link array from a stream. Stream contains the internals - * of the contact link. Internals are the contact store implementation - * specific part of the package format. - * - * NOTE: this must work wheter the OpenL has been called or not. This - * means that a link can not contain any data that would need - * an open store before internalizing. - * - * @param aStream A stream containing the link internals. - * @return A new contact link. - * @internal - */ - MVPbkContactLink* CreateLinkFromInternalsLC( - RReadStream& aStream ) const ; - - /** - * Returns own contact link asynchronously. - * - * @params aObserver Operation observer - * @return operation handle - * @Asynchronous - */ - MVPbkContactOperationBase* OwnContactLinkL( - MVPbkSingleContactLinkOperationObserver& aObserver) const ; - - - /** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ - MVPbkObjectHierarchy& ParentObject() const ; - - - /** - * Creates an operation for contact retrieval. - * - * @param aLink A link to the contact - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL if the factory - * doesn't have reference to the store of the link. - */ - MVPbkContactOperation* CreateContactRetrieverL( - const MVPbkContactLink& aLink, - MVPbkSingleContactOperationObserver& aObserver) ; - - /** - * Creates an operation for deleting multiple contacts. - * - * @param aContactLinks An array of contact links that specify - * the contacts. - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateDeleteContactsOperationL( - const MVPbkContactLinkArray& aContactLinks, - MVPbkBatchOperationObserver& aObserver ) ; - - /** - * Creates an operation for committing multiple contacts. - * - * @param aContacts An array of contact links that specify - * the contacts - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateCommitContactsOperationL( - const TArray& aContacts, - MVPbkBatchOperationObserver& aObserver) ; - - /** - * Creates an operation for asynchronous phone number matching. - * - * @param aPhoneNumber A phone number to search for. - * @param aMaxMatchDigits Maximum number of digits to match from - * the end of the number. - * @param aObserver Observer for the find process. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateMatchPhoneNumberOperationL( - const TDesC& aPhoneNumber, - TInt aMaxMatchDigits, - MVPbkContactFindObserver& aObserver) ; - - /** - * Creates an operation for asynchronous contact finding. - * - * @param aSearchString String to search for. - * @param aFieldTypes List of field types that the search will include. - * @param aObserver Observer for the find process. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateFindOperationL( - const TDesC& aSearchString, - const MVPbkFieldTypeList& aFieldTypes, - MVPbkContactFindObserver& aObserver) ; - - /** - * Creates an operation for asynchronous contact finding. - * Finds a string containing text that is stored in one or more fields. - * Client can give multiple find words. All the words must match to separated - * data. E.g if there are two find words: "Jo" and "Jo" then field data - * "John Johnson" matches but "John Doe" doesn't if the word parser uses - * white space as a word separator. - * - * NOTE: The accuracy of the results depends on the ability of the store - * implementation to implement the find. The performance can vary - * too depending on the store. - * - * @param aSearchStrings Words that are compared to field data. - * @param aFieldTypes Types of the fields that are used. - * @param aObserver An observer for asynchronous operation. - * @param aWordParserCallBack a client implementation of word parser - * function that separates the field data - * into words. Parameter to function is - * TVPbkWordParserParam. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateFindOperationL( - const MDesC16Array& aSearchStrings, - const MVPbkFieldTypeList& aFieldTypes, - MVPbkContactFindFromStoresObserver& aObserver, - const TCallBack& aWordParserCallBack ) ; - - /** - * Creates an operation for compressing the store. - * - * @param aObserver An observer for the compress operation. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateCompressStoresOperationL( - MVPbkBatchOperationObserver& aObserver) ; - - }; - - - -// CLASS DECLARATIONS -/** - * An interface for a list of contact stores. - * - * The interface provides an access to multiple stores. It's possible to open - * and close all stores in single call using this interface. When client calls - * OpenAllL it must also calls CloseAll after usage. - * - * @see CVPbkContactManager::ContactStoresL - */ -class CVPbkContactStoreListStub : public CBase, public MVPbkContactStoreList - { - public: // interface - ~CVPbkContactStoreListStub() { }; - - CVPbkContactStoreListStub() { }; - - /** - * Returns the number of stores in the list. - * - * @return The number of stores in the list. - */ - TInt Count() const ; - - /** - * Returns the store in given index in the list. - * - * @param aIndex the index of the store in the list - * @precond aIndex >= && aIndex < Count() - * VPbkError::Panic(VPbkError::EInvalidStoreIndex) - * is raised if the precondition does not hold. - * @return The store in the specified index. - */ - MVPbkContactStore& At(TInt aIndex) const ; - - /** - * Finds the contact store corresponding to the aUri. - * - * @param aUri the store URI to search for. - * @return The contact store corresponding to the aUri or NULL. - */ - MVPbkContactStore* Find( - const TVPbkContactStoreUriPtr& aUri) const ; - - /** - * Opens all stores in the list asynchronously. - * - * A client can not use stores before it has successfully opened - * them. CloseAll must be always called by the same observer that has - * opened stores. - * - * NOTE: There can be only one observer for one store list at a time. - * - * @param aObserver An observer for the stores. - * @exception KErrInUse If one observer is currently opening this list. - */ - void OpenAllL(MVPbkContactStoreListObserver& aObserver) ; - - /** - * Closes all stores in the list. - * - * This is safe to call in all circumstances. Implementations - * can not trust that OpenAllL has been called before. - * - * @param aObserver An observer for the close process. - */ - void CloseAll(MVPbkContactStoreListObserver& aObserver) ; - - - - }; - -#endif // SCVPBKCONTACTSTORELIST_H - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactView.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactView.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,254 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -// INCLUDES -#include -#include "s_CVPbkContactView.h" -#include "CVPbkStoreContactStub.h" - - -/** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ -MVPbkObjectHierarchy& CVPbkContactViewStub::ParentObject() const -{ -MVPbkObjectHierarchy* ret = NULL; -return *ret; -} - - -/** - * Returns type of this contact view. - * - * @return A contact view type. - */ -TVPbkContactViewType CVPbkContactViewStub::Type() const { return EVPbkContactsView; } - -/** - * Changes sort order of the view asynchronously. - * - * Clients of this view will get an event via MVPbkContactViewObserver - * interface when the order has been updated. The leaf view sends - * a pair of events. First it sends ContactViewUnavailable and then - * after the order has been changed ContactViewReady. However if - * the view is of type EVPbkCompositeView the client doesn't necessary - * receive ContactViewUnavailable at all because it might be that - * there is always some subview ready in the composite. - * - * @param aSortOrder A new sort order for this view. - * @exception KErrArgument Possible reasons: a client tries to change - * a sort order of platform defined shared - * view against the platform setting. - * @see CVPbkSortOrder - */ -void CVPbkContactViewStub::ChangeSortOrderL( - const MVPbkFieldTypeList& /*aSortOrder*/ ) { } - -/** - * Returns the current sort order of the view. - * - * The sort order is a sub set of master field types from - * CVPbkContactManager. - * - * @return The sort order of the view. - */ -const MVPbkFieldTypeList& CVPbkContactViewStub::SortOrder() const -{ -MVPbkFieldTypeList* ret = NULL; -return *ret; -} - -/** - * Refreshes the view contents asynchronously. - * - * All handles to this view's contacts are invalidated. - * Clients of this view will get an event via MVPbkContactViewObserver - * interface when the view has been refreshed. - */ -void CVPbkContactViewStub::RefreshL() { } - -/** - * Returns the number of contacts in this view. - * - * @return The number of contacts. - */ -TInt CVPbkContactViewStub::ContactCountL() const { return 0; } - -/** - * Returns a contact in this view. - * - * The returned reference may be invalidated when this - * function is called again. For that reason clients should prefer - * not to save references to the contacts retrieved from this function. - * - * @param aIndex An index of the contact in this view. - * @return A reference to a contact in this view at aIndex. - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - * @exception KErrArgument if aIndex >= ContactCountL() - */ -const MVPbkViewContact& CVPbkContactViewStub::ContactAtL( - TInt /*aIndex*/ ) const - { - MVPbkViewContact* ret = NULL; - return *ret; - } - -/** - * Creates and returns a link that points to contact at aIndex. - * - * NOTE: If the view contact is not from any store it can return - * also NULL. E.g. if the view contact is a folding - * contact view that it's not saved to any store. - * The NULL is not pushed onto the cleanup stack. - * - * @param aIndex An index of the contact for which the link - * is created. - * @return A new link object pointing to contact at aIndex or NULL if - * the link can't be created (e.g. a folder). - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - * @exception KErrArgument if aIndex >= ContactCountL() - */ -MVPbkContactLink* CVPbkContactViewStub::CreateLinkLC( - TInt /*aIndex*/ ) const { return NULL; } - -/** - * Returns The index of the aContactLink in this view. - * - * If the identifier is not found from the view then - * KErrNotFound is returned. If the view is not from - * any store (e.g. a folding view) then it will also - * return KErrNotFound. - * - * NOTE: the implementation of this function probably - * must loop the view which means that calling - * this function frequently or in a loop can - * be slow when there are lots of contacts. - * - * @param aContactLink A link whose index is searched for. - * @return The index of the link or KErrNotFound. - */ -TInt CVPbkContactViewStub::IndexOfLinkL( - const MVPbkContactLink& /*aContactLink*/ ) const { return 0; } - -/** - * Adds an observer to this contact view asynchronously. - * - * The observer will be notified after it has been added - * to the view. - * - * @param aObserver A new observer for the view. - */ -void CVPbkContactViewStub::AddObserverL( - MVPbkContactViewObserver& /*aObserver*/ ) { } - -/** - * Removes an observer from this contact view. - * - * This method can be called even if aObserver has not been - * previously added. In that case, no observers are removed. - * - * @param aObserver The observer to be removed. - */ -void CVPbkContactViewStub::RemoveObserver( - MVPbkContactViewObserver& /*aObserver*/ ) { } - -/** - * Returns ETrue if this view is from a store identified - * by aContactStoreUri. - * - * @param aContactStoreUri The whole URI of the contact store. - * @return ETrue if the view was from the given store. - * - * @see TVPbkContactStoreUriPtr::UriDes - */ -TBool CVPbkContactViewStub::MatchContactStore( - const TDesC& /*aContactStoreUri*/ ) const { return EFalse; } - -/** - * Returns ETrue if this view is from a store domain identified - * by aContactStoreDomain. - * - * @param aContactStoreDomain The domain part of the contact store URI. - * The domain can be retrieved from the - * whole contact store URI using class - * TVPbkContactStoreUriPtr and - * EContactStoreUriStoreType. - * An implementation compares the - * EContactStoreUriStoreType part of - * its own URI to aContactStoreDomain. - * - * @return ETrue if the view was from the same store domain. - * @see TVPbkContactStoreUriPtr - */ -TBool CVPbkContactViewStub::MatchContactStoreDomain( - const TDesC& /*aContactStoreDomain*/ ) const { return EFalse; } - -/** - * Creates and returns a bookmark that points to the - * view contact at aIndex. - * - * @param aIndex An index of the contact in the view. - * @return A new bookmark to the view item. - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - */ -MVPbkContactBookmark* CVPbkContactViewStub::CreateBookmarkLC( - TInt /*aIndex*/ ) const { return NULL; } - -/** - * Returns an index of the contact in the view. - * - * If the identifier is not found from the view then - * KErrNotFound is returned. - * - * NOTE: the implementation of this function probably - * must loop the view which means that calling - * this function frequently or in a loop can - * be slow when there are lots of contacts. - * - * @param aContactBookmark A bookmark that identifies - * a contact in the view. - * @return An index of the contact in the view or KErrNotFound. - */ -TInt CVPbkContactViewStub::IndexOfBookmarkL( - const MVPbkContactBookmark& /*aContactBookmark*/ ) const { return 0; } - -/** - * Returns an interface for text based contact filtering support. - * - * If the view doesn't support filtering then this returns NULL. - * Filtering must be supported in all views created from a contact - * store. However, it's possible to implement a view that doesn't - * need a filtering support and therefore clients must always check - * the returned pointer. - * - * @return A filtering interface or NULL - */ -MVPbkContactViewFiltering* CVPbkContactViewStub::ViewFiltering() { return NULL; } - - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactView.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactView.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,268 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef SCVPBKCONTACTVIEW_H -#define SCVPBKCONTACTVIEW_H - -// INCLUDES -#include -#include - - -// CLASS DECLARATIONS - -/** - * An interface for contact store views. - * - * The view contains contacts from a single contact store. - * MVPbkObjectHierarchy interface can be used to navigate to the store. - */ -class CVPbkContactViewStub : public CBase, - public MVPbkContactView - { - public: // Destructor - /** - * Destructor. - */ - ~CVPbkContactViewStub() { }; - - CVPbkContactViewStub() { }; - - /** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ - MVPbkObjectHierarchy& ParentObject() const; - - - /** - * Returns type of this contact view. - * - * @return A contact view type. - */ - TVPbkContactViewType Type() const ; - - /** - * Changes sort order of the view asynchronously. - * - * Clients of this view will get an event via MVPbkContactViewObserver - * interface when the order has been updated. The leaf view sends - * a pair of events. First it sends ContactViewUnavailable and then - * after the order has been changed ContactViewReady. However if - * the view is of type EVPbkCompositeView the client doesn't necessary - * receive ContactViewUnavailable at all because it might be that - * there is always some subview ready in the composite. - * - * @param aSortOrder A new sort order for this view. - * @exception KErrArgument Possible reasons: a client tries to change - * a sort order of platform defined shared - * view against the platform setting. - * @see CVPbkSortOrder - */ - void ChangeSortOrderL( - const MVPbkFieldTypeList& aSortOrder ) ; - - /** - * Returns the current sort order of the view. - * - * The sort order is a sub set of master field types from - * CVPbkContactManager. - * - * @return The sort order of the view. - */ - const MVPbkFieldTypeList& SortOrder() const ; - - /** - * Refreshes the view contents asynchronously. - * - * All handles to this view's contacts are invalidated. - * Clients of this view will get an event via MVPbkContactViewObserver - * interface when the view has been refreshed. - */ - void RefreshL() ; - - /** - * Returns the number of contacts in this view. - * - * @return The number of contacts. - */ - TInt ContactCountL() const ; - - /** - * Returns a contact in this view. - * - * The returned reference may be invalidated when this - * function is called again. For that reason clients should prefer - * not to save references to the contacts retrieved from this function. - * - * @param aIndex An index of the contact in this view. - * @return A reference to a contact in this view at aIndex. - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - * @exception KErrArgument if aIndex >= ContactCountL() - */ - const MVPbkViewContact& ContactAtL( - TInt aIndex ) const ; - - /** - * Creates and returns a link that points to contact at aIndex. - * - * NOTE: If the view contact is not from any store it can return - * also NULL. E.g. if the view contact is a folding - * contact view that it's not saved to any store. - * The NULL is not pushed onto the cleanup stack. - * - * @param aIndex An index of the contact for which the link - * is created. - * @return A new link object pointing to contact at aIndex or NULL if - * the link can't be created (e.g. a folder). - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - * @exception KErrArgument if aIndex >= ContactCountL() - */ - MVPbkContactLink* CreateLinkLC( - TInt aIndex ) const ; - - /** - * Returns The index of the aContactLink in this view. - * - * If the identifier is not found from the view then - * KErrNotFound is returned. If the view is not from - * any store (e.g. a folding view) then it will also - * return KErrNotFound. - * - * NOTE: the implementation of this function probably - * must loop the view which means that calling - * this function frequently or in a loop can - * be slow when there are lots of contacts. - * - * @param aContactLink A link whose index is searched for. - * @return The index of the link or KErrNotFound. - */ - TInt IndexOfLinkL( - const MVPbkContactLink& aContactLink ) const ; - - /** - * Adds an observer to this contact view asynchronously. - * - * The observer will be notified after it has been added - * to the view. - * - * @param aObserver A new observer for the view. - */ - void AddObserverL( - MVPbkContactViewObserver& aObserver ) ; - - /** - * Removes an observer from this contact view. - * - * This method can be called even if aObserver has not been - * previously added. In that case, no observers are removed. - * - * @param aObserver The observer to be removed. - */ - void RemoveObserver( - MVPbkContactViewObserver& aObserver ) ; - - /** - * Returns ETrue if this view is from a store identified - * by aContactStoreUri. - * - * @param aContactStoreUri The whole URI of the contact store. - * @return ETrue if the view was from the given store. - * - * @see TVPbkContactStoreUriPtr::UriDes - */ - TBool MatchContactStore( - const TDesC& aContactStoreUri ) const ; - - /** - * Returns ETrue if this view is from a store domain identified - * by aContactStoreDomain. - * - * @param aContactStoreDomain The domain part of the contact store URI. - * The domain can be retrieved from the - * whole contact store URI using class - * TVPbkContactStoreUriPtr and - * EContactStoreUriStoreType. - * An implementation compares the - * EContactStoreUriStoreType part of - * its own URI to aContactStoreDomain. - * - * @return ETrue if the view was from the same store domain. - * @see TVPbkContactStoreUriPtr - */ - TBool MatchContactStoreDomain( - const TDesC& aContactStoreDomain ) const ; - - /** - * Creates and returns a bookmark that points to the - * view contact at aIndex. - * - * @param aIndex An index of the contact in the view. - * @return A new bookmark to the view item. - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - */ - MVPbkContactBookmark* CreateBookmarkLC( - TInt aIndex ) const ; - - /** - * Returns an index of the contact in the view. - * - * If the identifier is not found from the view then - * KErrNotFound is returned. - * - * NOTE: the implementation of this function probably - * must loop the view which means that calling - * this function frequently or in a loop can - * be slow when there are lots of contacts. - * - * @param aContactBookmark A bookmark that identifies - * a contact in the view. - * @return An index of the contact in the view or KErrNotFound. - */ - TInt IndexOfBookmarkL( - const MVPbkContactBookmark& aContactBookmark ) const ; - - /** - * Returns an interface for text based contact filtering support. - * - * If the view doesn't support filtering then this returns NULL. - * Filtering must be supported in all views created from a contact - * store. However, it's possible to implement a view that doesn't - * need a filtering support and therefore clients must always check - * the returned pointer. - * - * @return A filtering interface or NULL - */ - MVPbkContactViewFiltering* ViewFiltering() ; - - - - }; - -#endif // SCVPBKCONTACTVIEW_H - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactViewDefinition.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkContactViewDefinition.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,299 +0,0 @@ -/* -* Copyright (c) 2004-2007 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 - -/** - * Creates a new contact view definition and initializes - * it from resource. Takes a VPBK_CONTACT_VIEW resource - * structure as a parameter. - * - * @param aReader A resource reader to a VPBK_CONTACT_VIEW - * structure. - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewL( - TResourceReader& /*aReader*/ ){ return new (ELeave) CVPbkContactViewDefinition; } - -/** - * Creates a new empty contact view definition. - * Client must then set the needed information. - * - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewL(){ return new (ELeave) CVPbkContactViewDefinition; } - -/** - * Constructs a new contact view definition from an existing one - * by copying the data. - * - * @param aViewDef A view definition to copy. - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewL( - const CVPbkContactViewDefinition& /*aViewDef*/ ){ return new (ELeave) CVPbkContactViewDefinition; } - -/** - * Creates a new contact view definition and initializes - * it from resource. Takes a VPBK_CONTACT_VIEW resource - * structure as a parameter. - * - * @param aReader A resource reader to a VPBK_CONTACT_VIEW - * structure. - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewLC( - TResourceReader& /*aReader*/ ){ return new (ELeave) CVPbkContactViewDefinition; } - -/** - * Creates a new empty contact view definition. - * Client must then set the needed information. - * - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewLC() -{ -CVPbkContactViewDefinition* self = new (ELeave) CVPbkContactViewDefinition; -CleanupStack::PushL(self); -return self; - -} - -/** - * Constructs a new contact view definition from an existing one - * by copying the data. - * - * @param aViewDef A view definition to copy. - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewLC( - const CVPbkContactViewDefinition& /*aViewDef*/ ) - { - CVPbkContactViewDefinition* self = new (ELeave) CVPbkContactViewDefinition; - CleanupStack::PushL(self); - return self; - } - -/** - * Destructor. - */ -CVPbkContactViewDefinition::~CVPbkContactViewDefinition(){ } - -/** - * Returns the number of sub views owned by this view. - * - * @return The number of sub views. - */ -EXPORT_C TInt CVPbkContactViewDefinition::SubViewCount() const{ return 0; } - -/** - * Returns the sub view definition at aIndex. - * - * @param aIndex The index of the sub view definition. - * @return The sub view definition at aIndex. - */ -EXPORT_C const CVPbkContactViewDefinition& CVPbkContactViewDefinition::SubViewAt( - TInt /*aIndex*/ ) const{ return *this; } - -/** - * Returns the sub view definition at aIndex. - * - * @param aIndex The index to query. - * @return The sub view definition. - */ -EXPORT_C CVPbkContactViewDefinition& CVPbkContactViewDefinition::SubViewAt( TInt /*aIndex*/ ){ return *this; } - -/** - * Returns the type of this view. - * - * @return The type of this view. - */ -EXPORT_C TVPbkContactViewType CVPbkContactViewDefinition::Type() const{ return EVPbkContactsView; } - -/** - * Returns ETrue if aFlag is on, otherwise EFalse. - * - * @param aFlag The flag to check. - * @return A flag state. - */ -EXPORT_C TBool CVPbkContactViewDefinition::FlagIsOn( TVPbkContactViewFlag /*aFlag*/ ) const{ return EFalse;} - -/** - * Returns the URI of this view. KNullDesC if this is not a leaf node. - * - * @return The URI of this view or KNullDesC. - */ -EXPORT_C const TDesC& CVPbkContactViewDefinition::Uri() const{ return KNullDesC(); } - -/** - * Returns the sorting policy of this view. - * - * @return The sorting policy of this view. - */ -EXPORT_C TVPbkContactViewSortPolicy CVPbkContactViewDefinition::SortPolicy() const{ return EVPbkOrderedContactView; } - -/** - * Returns the name of the view. Default is KNullDesC. - * - * In view types EVPbkContactsView and EVPbkGroupsView - * the name can be used as a shared view identifier by the - * store. Shared view creation is indicated by - * TVPbkContactViewSharing. If the name is empty for shared - * view then store implementation uses its default name. - * This is a preferred way to use shared views in the platform. - * - * In view type EVPbkFoldingView the name is the label - * of the only contact in the view. - * - * In view type EVPbkCompositeView the name has no meaning. - * - * @return The name of the view. - */ -EXPORT_C const TDesC& CVPbkContactViewDefinition::Name() const{ return KNullDesC(); } - -/** - * Returns the view sharing type. The store can support - * a shared view creation for saving RAM. - * - * Default value for types EVPbkContactsView and EVPbkGroupsView - * is EVPbkSharedView. Store implementation creates - * then a shared view if it's possible for the store. - * Prefer using the default values for saving resources. - * - * For view types EVPbkFoldingView and EVPbkCompositeView the - * sharing has no effect. - * - * See also the documentation of Name() - * - * @return The view sharing type. - * - */ -EXPORT_C TVPbkContactViewSharing CVPbkContactViewDefinition::Sharing() const{ return EVPbkViewSharingUndefined; } - -/** - * Returns the field type selector used to filter the view or NULL. - * - * The view contains only contacts having the fields defined - * by the field type filter. - * - * @return The field type filter. - */ -EXPORT_C CVPbkFieldTypeSelector* CVPbkContactViewDefinition::FieldTypeFilter() const{ return NULL; } - -/** - * Returns the id of this view. - * - * @return the id of this view. - */ -EXPORT_C TInt CVPbkContactViewDefinition::Id() const{ return 1; } -/** - * Adds new view as a subview. This object takes ownership - * of the subview. If this function leaves ownership is not taken. - * - * @param aSubView The new subview to add. - */ -EXPORT_C void CVPbkContactViewDefinition::AddSubViewL( CVPbkContactViewDefinition* /*aSubView*/ ){ } - -/** - * Sets aType as this views type. - * - * @param aType The type to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetType( TVPbkContactViewType /*aType*/ ){ } - -/** - * Sets aId as this views id. - * - * @param aId the id to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetId( TInt /*aId*/ ){ } -/** - * Sets the saFlag's state as aState. - * - * @param aFlag The flag to modify. - * @param aState The state to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetFlag( TVPbkContactViewFlag /*aFlag*/, TBool /*aState*/ ){ } - -/** - * Sets aUri as this views URI. This function takes a copy of aUri. - * - * @param aUri The URI to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetUriL( const TDesC& /*aUri*/ ){ } - -/** - * Sets aSortPolicy as this views sorting policy. - * - * @param aSortPolicy The sort policy to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetSortPolicy( TVPbkContactViewSortPolicy /*aSortPolicy*/ ){ } - -/** - * Sets aName as this views Name. This function takes a copy of aName. - * - * @param aName The name to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetNameL( const TDesC& /*aName*/ ){ } - -/** - * Sets the view sharing type. - * - * @param aViewSharing One of the values defined in - * VPbkContactView.hrh. - */ -EXPORT_C void CVPbkContactViewDefinition::SetSharing( TVPbkContactViewSharing /*aViewSharing*/ ){ } - -/** - * Sets the field type selector used to filter the view. - * - * The view contains only contacts having the fields defined - * by the field type filter. - * - * @param aFilter The field type filter. Use NULL to - * filter nothing. - */ -EXPORT_C void CVPbkContactViewDefinition::SetFieldTypeFilterL( CVPbkFieldTypeSelector* /*aFilter*/ ){ } - -/** - * Sets the contact selector used to filter the view. - * - * The view contains only contacts accepted by the selector. - * - * @param aContactSelector The contact selector. Use NULL to - * filter nothing. Ownership not transferred. - */ -EXPORT_C void CVPbkContactViewDefinition::SetContactSelector( MVPbkContactSelector* /*aContactSelector*/ ){ } - -/** - * Gives either the contact selector or NULL. Ownership is not transferred. - */ -EXPORT_C MVPbkContactSelector* CVPbkContactViewDefinition::ContactSelector() const{ return NULL; } - -CVPbkContactViewDefinition::CVPbkContactViewDefinition(){ } -void CVPbkContactViewDefinition::ConstructL(){ } -void CVPbkContactViewDefinition::ConstructL( - const CVPbkContactViewDefinition& /*aViewDef*/ ){ } -void CVPbkContactViewDefinition::ConstructFromResourceL( - TResourceReader& /*aReader*/ ){ } -void CVPbkContactViewDefinition::InitializeSharing(){ } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkStoreContactField.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkStoreContactField.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,325 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -// INCLUDES -#include "s_CVPbkStoreContactField.h" -#include -#include "CVPbkContactFieldTextData_stub.h" -#include "s_MVPbkContactFieldUriData_stub.h" -#include "s_MVPbkContactFieldBinaryDatastub.h" - -CVPbkContactFieldTextData_stub gTextFieldData; -CVPbkContactFieldUriData_Stub gUriFieldData; -CVPbkContactFieldBinaryDataStub gBinaryFieldData; -CVPbkContactFieldTextData_stub gJunkFieldData; -TBool gBestMatchingFieldType; - -// CONSTANTS - -//ctor -CVPbkStoreContactFieldStub::CVPbkStoreContactFieldStub( TInt aIndex) -: iIndex(aIndex) -{ - -} -/** - * Destructor - */ -CVPbkStoreContactFieldStub::~CVPbkStoreContactFieldStub(){ } - -const MVPbkContactFieldData& CVPbkStoreContactFieldStub::FieldData() const - { - if (iIndex == 0) - { - return gTextFieldData; - } - - if (iIndex == 1) - { - return gUriFieldData; - } - - if (iIndex == 2) - { - return gBinaryFieldData; - } - - return gJunkFieldData; //some junk - - } - - -/** - * Returns ETrue if the field supports label. - * - * Overwrites the global setting in MVPbkContactStoreProperties. - * This must be confirmed before using SetFieldLabelL or - * MaxLabelLength. - * - * @return ETrue if the field supports label. Otherwise EFalse. - */ -TBool CVPbkStoreContactFieldStub::SupportsLabel() const { return EFalse; } - -/** - * Returns the label of the field or KNullDesC if there is no field - * label. - * - * @return The label of the field or KNullDesC - */ -TPtrC CVPbkStoreContactFieldStub::FieldLabel() const { return KNullDesC(); } - -/** - * Sets this field's label. - * - * SupportsLabel must be true for using this. - * - * @param aText The label for the field. - */ -void CVPbkStoreContactFieldStub::SetFieldLabelL( const TDesC& /*aText*/ ) { } - -/** - * Gets the maximum length of the label. - * - * SupportsLabel must be true for using this. - * - * @return The maximum length of the label or KVPbkUnlimitedLabelLength - * if the store has no limits. Zero should be returned in other - * cases though this shouldn't be called if labels are - * not supported. - */ -TInt CVPbkStoreContactFieldStub::MaxLabelLength() const { return 0; } - -/** - * Returns the data storage (read-write) of the field. - * - * The data type depends on the field and it's client's responsibility - * to check the type before casting the type. - * - * @return The data storage of the field. - * @see MVPbkContactFieldTextData::Cast - * @see MVPbkContactFieldDateTimeData::Cast - * @see MVPbkContactFieldBinaryData::Cast - */ -MVPbkContactFieldData& CVPbkStoreContactFieldStub::FieldData() - { - - - if (iIndex == 0) - { - return gTextFieldData; - } - - if (iIndex == 1) - { - return gUriFieldData; - } - - if (iIndex == 2) - { - return gBinaryFieldData; - } - - return gJunkFieldData; //some junk - } - - -/** - * Clones the field. - * - * Pushes the created copy to the cleanup stack. - * - * @return A copy of the field. - * @see MVPbkStoreContactFieldCollection::FieldAt - */ -MVPbkStoreContactField* CVPbkStoreContactFieldStub::CloneLC() const { return NULL; } - -/** - * Creates a link representing the contact and the field. - * - * The field can be later retrieved using the RetrieveField of - * MVPbkStoreContactFieldCollection interface. - * - * NOTE: implementations of stores are possibly using an index - * of the field as an identifier so clients should prefer not - * to save field links permanently. E.g modifying the contact - * can invalidate the link in some store implementations. - * A field link is practical in use cases where the link is - * created and immediately given to another component. - * - * @return A link representing the contact and the field or NULL - * if the contact doesn't exist in the store. E.g a new - * contact that hasn't been committed has no unique - * identifier yet. - * NULL is not put into the CleanupStack. - */ -MVPbkContactLink* CVPbkStoreContactFieldStub::CreateLinkLC() const { return NULL; } - - -/** - * Returns the parent contact where this field is from. - * - * @return The parent contact where this field is from. - */ -MVPbkBaseContact& CVPbkStoreContactFieldStub::ParentContact() const -{ -MVPbkBaseContact* ret=NULL; -return *ret; -} - -/** - * Returns this field's type or NULL if no mapping exists - * between the native type and phonebook type. - * - * @param aMatchPriority matching priority to use. - * @return The field type or NULL - * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list)) - */ -const MVPbkFieldType* CVPbkStoreContactFieldStub::MatchFieldType( - TInt /*aMatchPriority*/) const { return NULL; } - -/** - * Returns the best matching type of the field or NULL - * if no mapping exists between the native type and - * phonebook type. This is the same as looping - * MatchFieldType from priority 0 and getting the first - * matched type. - * - * @return The field type or NULL - * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list)) - */ -const MVPbkFieldType* CVPbkStoreContactFieldStub::BestMatchingFieldType() const - { - if (gBestMatchingFieldType) - { - return this; - } - return NULL; - } - - - -/** - * Returns true if this field is the same as another field in the - * contact instance. - * Doesn't work for fields from different contact instances. - * Always use this method instead of direct pointer comparison. - * - * @param aOther another field inside the contact - * @return ETrue if contact is same - */ -TBool CVPbkStoreContactFieldStub::IsSame(const MVPbkBaseContactField& /*aOther*/) const { return EFalse;} - - -/** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ -MVPbkObjectHierarchy& CVPbkStoreContactFieldStub::ParentObject() const -{ -MVPbkObjectHierarchy* ret =NULL; -return *ret; -} - - -/** - * Returns the Versit properties mapped to this field type. - * - * @return Versit properties. - */ -TArray CVPbkStoreContactFieldStub::VersitProperties() const -{ - -} - -/** - * Returns the Versit parameters fields of this type should not have. - * - * @return Excluded parameters. - */ -const TVPbkFieldTypeParameters& CVPbkStoreContactFieldStub::ExcludedParameters() const -{ -TVPbkFieldTypeParameters* ret = NULL; -return *ret; -} - -/** - * Type name for field types not supported by the Versit 2.1 standard. - * - * @return A non-Versit type. - */ -TVPbkNonVersitFieldType CVPbkStoreContactFieldStub::NonVersitType() const -{ -return EVPbkNonVersitTypeNone; -} - -/** - * Returns true if this field type is the same as aOtherType. - * - * @param aOtherType The type to compare. - * @return ETrue if the field types are the same. - */ -TBool CVPbkStoreContactFieldStub::IsSame( - const MVPbkFieldType& /*aOtherType*/ ) const { return EFalse; } - -/** - * Returns true if this field type matches a Versit property. - * - * @param aMatchProperty A versit property to match against. - * @param aMatchPriority A matching priority. Priorities start - * from zero which is the highest priority. - * Priority is also a direct index to - * VersitProperties() array. - * @return ETrue if this field type matches aMatchProperty at - * aMatchPriority. Returns always false if - * aMatchPriority >= VersitProperties().Count(). - */ -TBool CVPbkStoreContactFieldStub::Matches( - const TVPbkFieldVersitProperty& /*aMatchProperty*/, - TInt /*aMatchPriority*/ ) const { return EFalse; } - -/** - * Returns the field type resource id from VPbkEng.rsg - * that be used to identify a type. - * - * @return A field type resource id. - */ -TInt CVPbkStoreContactFieldStub::FieldTypeResId() const - { - - if (iIndex == 0) - { - return R_VPBK_FIELD_TYPE_VOIPHOME; - } - - if (iIndex == 1) - { - return R_VPBK_FIELD_TYPE_IMPP; - } - - if (iIndex == 2) - { - return R_VPBK_FIELD_TYPE_THUMBNAILPIC; - } - - return R_VPBK_FIELD_TYPE_JOBTITLE; //some junk - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkStoreContactField.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_CVPbkStoreContactField.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,262 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef SCVPBKSTORECONTACTFIELD_H -#define SCVPBKSTORECONTACTFIELD_H - - -// INCLUDES -#include -#include -#include - -// CONSTANTS - - -// CLASS DECLARATIONS - -/** - * An interface for the field of the store contact. - * - * Client can access the contact field using this interface. The field - * can have a label and a data. - * - * A new field can be created using the MVPbkStoreContact interface. - * For looping the contact fields see MVPbkStoreContactFieldCollection. - * The parent of the field in the object hierarchy is the store contact. - * - * @see CVPbkContactFieldTypeIterator - * @see CVPbkFieldTypeSelector - */ -class CVPbkStoreContactFieldStub : public CBase, - public MVPbkStoreContactField, - public MVPbkFieldType - { - public: // ctor - CVPbkStoreContactFieldStub(TInt aIndex); - /** - * Destructor - */ - ~CVPbkStoreContactFieldStub(); - - public: // From MVPbkBaseContactField - const MVPbkContactFieldData& FieldData() const ; - - public: // New functions - /** - * Returns ETrue if the field supports label. - * - * Overwrites the global setting in MVPbkContactStoreProperties. - * This must be confirmed before using SetFieldLabelL or - * MaxLabelLength. - * - * @return ETrue if the field supports label. Otherwise EFalse. - */ - TBool SupportsLabel() const ; - - /** - * Returns the label of the field or KNullDesC if there is no field - * label. - * - * @return The label of the field or KNullDesC - */ - TPtrC FieldLabel() const ; - - /** - * Sets this field's label. - * - * SupportsLabel must be true for using this. - * - * @param aText The label for the field. - */ - void SetFieldLabelL( const TDesC& aText ) ; - - /** - * Gets the maximum length of the label. - * - * SupportsLabel must be true for using this. - * - * @return The maximum length of the label or KVPbkUnlimitedLabelLength - * if the store has no limits. Zero should be returned in other - * cases though this shouldn't be called if labels are - * not supported. - */ - TInt MaxLabelLength() const ; - - /** - * Returns the data storage (read-write) of the field. - * - * The data type depends on the field and it's client's responsibility - * to check the type before casting the type. - * - * @return The data storage of the field. - * @see MVPbkContactFieldTextData::Cast - * @see MVPbkContactFieldDateTimeData::Cast - * @see MVPbkContactFieldBinaryData::Cast - */ - MVPbkContactFieldData& FieldData() ; - - /** - * Clones the field. - * - * Pushes the created copy to the cleanup stack. - * - * @return A copy of the field. - * @see MVPbkStoreContactFieldCollection::FieldAt - */ - MVPbkStoreContactField* CloneLC() const ; - - /** - * Creates a link representing the contact and the field. - * - * The field can be later retrieved using the RetrieveField of - * MVPbkStoreContactFieldCollection interface. - * - * NOTE: implementations of stores are possibly using an index - * of the field as an identifier so clients should prefer not - * to save field links permanently. E.g modifying the contact - * can invalidate the link in some store implementations. - * A field link is practical in use cases where the link is - * created and immediately given to another component. - * - * @return A link representing the contact and the field or NULL - * if the contact doesn't exist in the store. E.g a new - * contact that hasn't been committed has no unique - * identifier yet. - * NULL is not put into the CleanupStack. - */ - MVPbkContactLink* CreateLinkLC() const ; - - - public: // Interface - /** - * Returns the parent contact where this field is from. - * - * @return The parent contact where this field is from. - */ - MVPbkBaseContact& ParentContact() const ; - - /** - * Returns this field's type or NULL if no mapping exists - * between the native type and phonebook type. - * - * @param aMatchPriority matching priority to use. - * @return The field type or NULL - * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list)) - */ - const MVPbkFieldType* MatchFieldType( - TInt aMatchPriority) const ; - - /** - * Returns the best matching type of the field or NULL - * if no mapping exists between the native type and - * phonebook type. This is the same as looping - * MatchFieldType from priority 0 and getting the first - * matched type. - * - * @return The field type or NULL - * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list)) - */ - const MVPbkFieldType* BestMatchingFieldType() const ; - - - - /** - * Returns true if this field is the same as another field in the - * contact instance. - * Doesn't work for fields from different contact instances. - * Always use this method instead of direct pointer comparison. - * - * @param aOther another field inside the contact - * @return ETrue if contact is same - */ - TBool IsSame(const MVPbkBaseContactField& aOther) const ; - - -public: // New functions - /** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ - MVPbkObjectHierarchy& ParentObject() const ; - - /** - * Returns the Versit properties mapped to this field type. - * - * @return Versit properties. - */ - TArray VersitProperties() const ; - - /** - * Returns the Versit parameters fields of this type should not have. - * - * @return Excluded parameters. - */ - const TVPbkFieldTypeParameters& ExcludedParameters() const ; - - /** - * Type name for field types not supported by the Versit 2.1 standard. - * - * @return A non-Versit type. - */ - TVPbkNonVersitFieldType NonVersitType() const ; - - /** - * Returns true if this field type is the same as aOtherType. - * - * @param aOtherType The type to compare. - * @return ETrue if the field types are the same. - */ - TBool IsSame( - const MVPbkFieldType& aOtherType ) const ; - - /** - * Returns true if this field type matches a Versit property. - * - * @param aMatchProperty A versit property to match against. - * @param aMatchPriority A matching priority. Priorities start - * from zero which is the highest priority. - * Priority is also a direct index to - * VersitProperties() array. - * @return ETrue if this field type matches aMatchProperty at - * aMatchPriority. Returns always false if - * aMatchPriority >= VersitProperties().Count(). - */ - TBool Matches( - const TVPbkFieldVersitProperty& aMatchProperty, - TInt aMatchPriority ) const ; - - /** - * Returns the field type resource id from VPbkEng.rsg - * that be used to identify a type. - * - * @return A field type resource id. - */ - TInt FieldTypeResId() const ; - - private: - TInt iIndex ; - - }; - -#endif // SCVPBKSTORECONTACTFIELD_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldBinaryData.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldBinaryData.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2002-2007 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 "s_MVPbkContactFieldBinaryDatastub.h" - -_LIT8(KTestBinaryData, "some binary dataJunk"); - -/** - * Casts MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the binary field data. - */ -EXPORT_C MVPbkContactFieldBinaryData& MVPbkContactFieldBinaryData::Cast( - MVPbkContactFieldData& aFieldData ) -{ -return static_cast(aFieldData); -}; - -/** - * Casts const MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the binary field data. - */ -EXPORT_C const MVPbkContactFieldBinaryData& MVPbkContactFieldBinaryData::Cast( - const MVPbkContactFieldData& aFieldData ) -{ -return static_cast(aFieldData); -}; -/** - * Returns the binary data pointer. - * @return Pointer to binary data. - */ -TPtrC8 CVPbkContactFieldBinaryDataStub::BinaryData() const -{ -return KTestBinaryData(); -} -/** - * Sets the binary data. - * @exception KErrOverflow if (aBinaryData.Length() > MaxLength()) - * @param aBinaryData Binary data to be set. - */ -void CVPbkContactFieldBinaryDataStub::SetBinaryDataL( const TDesC8& /*aBinaryData*/ ) -{ - -} - -/** - * Returns the derived data type id. - * @return Contact field storage type. - */ -TVPbkFieldStorageType CVPbkContactFieldBinaryDataStub::DataType() const -{ -return EVPbkFieldStorageTypeBinary; -} - -/** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ -TBool CVPbkContactFieldBinaryDataStub::IsEmpty() const -{ -return EFalse; -} - -/** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ -void CVPbkContactFieldBinaryDataStub::CopyL(const MVPbkContactFieldData& /*aFieldData*/) -{ - -} - -CVPbkContactFieldBinaryDataStub::CVPbkContactFieldBinaryDataStub() -{ - -} - -CVPbkContactFieldBinaryDataStub::~CVPbkContactFieldBinaryDataStub() -{ - -} -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldBinaryDatastub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldBinaryDatastub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPBKCONTACTFIELDBINARYDATASTUB_H -#define CVPBKCONTACTFIELDBINARYDATASTUB_H - -// INCLUDES -#include - - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook binary field data. - * This interface is used to manipulate binary contact field data. - */ -class CVPbkContactFieldBinaryDataStub : public MVPbkContactFieldBinaryData - { - public: // Destructor - /** - * Destructor. - */ - ~CVPbkContactFieldBinaryDataStub(); - - CVPbkContactFieldBinaryDataStub(); - - - - public: // Interface - - /** - * Returns the binary data pointer. - * @return Pointer to binary data. - */ - TPtrC8 BinaryData() const ; - - /** - * Sets the binary data. - * @exception KErrOverflow if (aBinaryData.Length() > MaxLength()) - * @param aBinaryData Binary data to be set. - */ - void SetBinaryDataL( const TDesC8& aBinaryData ) ; - - /** - * Returns the derived data type id. - * @return Contact field storage type. - */ - TVPbkFieldStorageType DataType() const; - - /** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ - TBool IsEmpty() const; - - /** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ - void CopyL(const MVPbkContactFieldData& aFieldData) ; - }; - -#endif // CVPBKCONTACTFIELDBINARYDATASTUB_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldTextData.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldTextData.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -// INCLUDES - -#include "CVPbkContactFieldTextData_stub.h" - -_LIT(KTestData, "123@voip"); - -/** - * Casts MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the text field data. - */ -EXPORT_C MVPbkContactFieldTextData& MVPbkContactFieldTextData::Cast( - MVPbkContactFieldData& aFieldData) -{ -return static_cast(aFieldData); -}; - -/** - * Casts const MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the text field data. - */ -EXPORT_C const MVPbkContactFieldTextData& MVPbkContactFieldTextData::Cast( - const MVPbkContactFieldData& aFieldData) -{ -return static_cast(aFieldData); -}; - -/** - * Returns the string data. - * @return Pointer to the text data. - */ -TPtrC CVPbkContactFieldTextData_stub::Text() const -{ -return KTestData(); -} - -/** - * Sets the string data. - * @exception KErrOverflow if (aText.Length() > MaxLength()) - */ -void CVPbkContactFieldTextData_stub::SetTextL( const TDesC& /*aText*/ ) -{ - -} - -/** - * Returns maximum length of the field. - * @return Maximum length of the field or KVPbkUnlimitedFieldLength - * if length is only limited by available memory. - */ -TInt CVPbkContactFieldTextData_stub::MaxLength() const -{ -return KTestData().Length(); -} - -CVPbkContactFieldTextData_stub::~CVPbkContactFieldTextData_stub() -{ - -} - -CVPbkContactFieldTextData_stub::CVPbkContactFieldTextData_stub() -{ - -} -/** - * Returns the derived data type id. - * @return Contact field storage type. - */ -TVPbkFieldStorageType CVPbkContactFieldTextData_stub::DataType() const - { - return EVPbkFieldStorageTypeText; - } - -/** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ -TBool CVPbkContactFieldTextData_stub::IsEmpty() const -{ -return EFalse; -} - -/** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ -void CVPbkContactFieldTextData_stub::CopyL(const MVPbkContactFieldData& /*aFieldData*/) -{ - -} - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldUriData.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldUriData.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2002-2007 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 "s_MVPbkContactFieldUriData_stub.h" - -_LIT(KTestUriData, "gizmo:someuser@gizmo.com"); - -/** - * Casts MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeUri - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the text field data. - */ -EXPORT_C MVPbkContactFieldUriData& MVPbkContactFieldUriData::Cast( - MVPbkContactFieldData& aFieldData) -{ -return static_cast(aFieldData); -}; - -/** - * Casts const MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the text field data. - */ -EXPORT_C const MVPbkContactFieldUriData& MVPbkContactFieldUriData::Cast( - const MVPbkContactFieldData& aFieldData) -{ -return static_cast(aFieldData); -}; - -/** - * Returns the URI scheme. - * @return Pointer to the URI scheme. - */ -TPtrC CVPbkContactFieldUriData_Stub::Scheme() const -{ -return KNullDesC(); -} - -/** - * Returns the URI . - * @return Pointer to the URI text. - */ -TPtrC CVPbkContactFieldUriData_Stub::Text() const -{ -return KTestUriData(); -} - -/** - * Returns the string data. - * @return Pointer to the whole URI. - */ -TPtrC CVPbkContactFieldUriData_Stub::Uri() const -{ -return KNullDesC(); -} - -/** - * Sets the URI data. - * @exception KErrOverflow if (aUri.Length() > MaxLength()) - */ -void CVPbkContactFieldUriData_Stub::SetUriL(const TDesC& /*aUri*/) -{ - -} - -/** - * Sets the URI data. - * @exception KErrOverflow if (aScheme.Length() + aText.Length() - * + 1 > MaxLength()) - */ -void CVPbkContactFieldUriData_Stub::SetUriL(const TDesC& /*aScheme*/, const TDesC& /*aText*/) -{ - -} - -/** - * Returns maximum length of the field. - * @return Maximum length of the field or KVPbkUnlimitedFieldLength - * if length is only limited by available memory. - */ -TInt CVPbkContactFieldUriData_Stub::MaxLength() const -{ -return 1; -} - - -/** - * Returns the derived data type id. - * @return Contact field storage type. - */ -TVPbkFieldStorageType CVPbkContactFieldUriData_Stub::DataType() const - { - return EVPbkFieldStorageTypeUri; - } - -/** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ -TBool CVPbkContactFieldUriData_Stub::IsEmpty() const -{ -return EFalse; -} - -/** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ -void CVPbkContactFieldUriData_Stub::CopyL(const MVPbkContactFieldData& /*aFieldData*/) -{ - -} - -CVPbkContactFieldUriData_Stub::CVPbkContactFieldUriData_Stub() -{ - -} - -CVPbkContactFieldUriData_Stub::~CVPbkContactFieldUriData_Stub() -{ - -} - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldUriData_stub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldUriData_stub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPBKCONTACTFIELDURIDATASTUB_H -#define CVPBKCONTACTFIELDURIDATASTUB_H - - -// INCLUDES -#include - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook Contact field URI data. - * This interface is used to manipulate URI contact field data. - */ -class CVPbkContactFieldUriData_Stub : public MVPbkContactFieldUriData - { - public: // Destructor - /** - * Destructor. - */ - ~CVPbkContactFieldUriData_Stub(); - - CVPbkContactFieldUriData_Stub(); - - public: // Interface - - /** - * Returns the URI scheme. - * @return Pointer to the URI scheme. - */ - TPtrC Scheme() const ; - - /** - * Returns the URI . - * @return Pointer to the URI text. - */ - TPtrC Text() const ; - - /** - * Returns the string data. - * @return Pointer to the whole URI. - */ - TPtrC Uri() const ; - - /** - * Sets the URI data. - * @exception KErrOverflow if (aUri.Length() > MaxLength()) - */ - void SetUriL(const TDesC& aUri) ; - - /** - * Sets the URI data. - * @exception KErrOverflow if (aScheme.Length() + aText.Length() - * + 1 > MaxLength()) - */ - void SetUriL(const TDesC& aScheme, const TDesC& aText) ; - - /** - * Returns maximum length of the field. - * @return Maximum length of the field or KVPbkUnlimitedFieldLength - * if length is only limited by available memory. - */ - TInt MaxLength() const ; - - /** - * Returns the derived data type id. - * @return Contact field storage type. - */ - TVPbkFieldStorageType DataType() const; - - /** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ - TBool IsEmpty() const; - - /** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ - void CopyL(const MVPbkContactFieldData& aFieldData) ; - - - }; - -#endif // CVPBKCONTACTFIELDURIDATASTUB_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactLinkstub.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactLinkstub.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -// INCLUDES -#include "s_MVPbkContactLinkstub.h" - -CVPbkContactLinkStub::CVPbkContactLinkStub() -{ - -} - -/** - * Returns the contact store which this link belongs to. - * @return Contact store associated with this link. - */ -MVPbkContactStore& CVPbkContactLinkStub::ContactStore() const -{ -MVPbkContactStore* ret=NULL; -return *ret; -} - -/** - * Returns ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - * @param aOther Contact to check equality for. - * @return ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - */ -TBool CVPbkContactLinkStub::IsSame(const MVPbkContactLink& aOther) const -{ -if (this == &aOther) -return ETrue; - -return EFalse; -} - -/** - * Checks if this link refers to the contact aContact. - * @param aContact Contact to check. - * @return ETrue if this link refers to aContact, EFalse otherwise. - */ -TBool CVPbkContactLinkStub::RefersTo(const MVPbkBaseContact& /*aContact*/) const -{ -return ETrue; -} - -/** - * Returns persistent streaming interface for this object, or NULL - * if persistent streaming is not supported. - * @return Persistent streaming object or NULL if not supported. - */ -const MVPbkStreamable* CVPbkContactLinkStub::Streamable() const -{ -return NULL; -}; - -/** - * Returns a packing interface for this link. - * @see CVPbkContactLinkArray - * @internal - * @return Link packing object. - */ -const MVPbkContactLinkPacking& CVPbkContactLinkStub::Packing() const -{ -MVPbkContactLinkPacking* ret = NULL; -return *ret; -}; - -/** - * Returns a clone of this contact link. - * @return Contact link copy. - */ -MVPbkContactLink* CVPbkContactLinkStub::CloneLC() const -{ - MVPbkContactLink* temp = NULL; - CleanupStack::PushL( temp ); - return temp; -} - -CVPbkContactLinkStub::~CVPbkContactLinkStub() -{ - -} - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactLinkstub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactLinkstub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPBKCONTACTLINKSTUB_H -#define CVPBKCONTACTLINKSTUB_H - -// INCLUDES -#include - - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook Contact link. - * An object that uniquely identifies a single Contact and its ContactStore. - */ -class CVPbkContactLinkStub : public CBase, public MVPbkContactLink - { - public: // destructor - /** - * Destructor. - */ - ~CVPbkContactLinkStub(); - - CVPbkContactLinkStub(); - public: // interface - - /** - * Returns the contact store which this link belongs to. - * @return Contact store associated with this link. - */ - MVPbkContactStore& ContactStore() const ; - - /** - * Returns ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - * @param aOther Contact to check equality for. - * @return ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - */ - TBool IsSame(const MVPbkContactLink& aOther) const ; - - /** - * Checks if this link refers to the contact aContact. - * @param aContact Contact to check. - * @return ETrue if this link refers to aContact, EFalse otherwise. - */ - TBool RefersTo(const MVPbkBaseContact& aContact) const ; - - /** - * Returns persistent streaming interface for this object, or NULL - * if persistent streaming is not supported. - * @return Persistent streaming object or NULL if not supported. - */ - const MVPbkStreamable* Streamable() const ; - - /** - * Returns a packing interface for this link. - * @see CVPbkContactLinkArray - * @internal - * @return Link packing object. - */ - const MVPbkContactLinkPacking& Packing() const ; - - /** - * Returns a clone of this contact link. - * @return Contact link copy. - */ - MVPbkContactLink* CloneLC() const ; - - - }; - - - -#endif // CVPBKCONTACTLINKSTUB_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_TVPbkContactStoreUriPtr.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_TVPbkContactStoreUriPtr.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2004-2007 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 - -/** - * Constructs a URI pointer to aStoreUri. - * - * @param aStoreUri A reference to the contact store URI. - */ -EXPORT_C TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(const TDesC& /*aStoreUri*/){ } - -/** - * Constructor. - */ -EXPORT_C TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(){ } - - -/** - * Returns a descriptor that holds the whole Uri. - * - * @return A descriptor that holds the whole Uri. - */ -EXPORT_C const TDesC& TVPbkContactStoreUriPtr::UriDes() const{ return KNullDesC(); } - -/** - * Compares this URI's component to aUri's component. - * - * @param aUri The URI whose component is compared. - * @param aComponent Defines the component that are compared. - * @return Zero if the URIs are the same. - */ -EXPORT_C TInt TVPbkContactStoreUriPtr::Compare(const TVPbkContactStoreUriPtr& /*aUri*/, - TVPbkContactStoreUriComponent /*aComponent*/) const{ return 0; } - -/** - * Compares this URI's component to aUriComponent. - * - * @param aUriComponent A descriptor that contains the component data. - * @param aComponent Defines the component of this URI that is compared - * to aUriComponent. - * @return Zero if components matched. - */ -EXPORT_C TInt TVPbkContactStoreUriPtr::Compare(const TDesC& /*aUriComponent*/, - TVPbkContactStoreUriComponent /*aComponent*/) const{ return 0; } - -/** - * Returns a pointer to the aComponent part of URI. - * - * @param aComponent Defines the component that is returned. - * @return a pointer to the aComponent part of URI. - */ -EXPORT_C const TPtrC TVPbkContactStoreUriPtr::Component( - TVPbkContactStoreUriComponent /*aComponent*/) const{ return KNullDesC(); } - -/** - * Sets this URI pointer to point to the same URI as aUri. - * - * @param aUri The URI that will be pointed to. - */ -EXPORT_C void TVPbkContactStoreUriPtr::Set(const TVPbkContactStoreUriPtr& /*aUri*/){ } - -/** - * Returns the length of the URI. - * - * @return The length of the URI. - */ -EXPORT_C TInt TVPbkContactStoreUriPtr::Length() const{ return 0; } - - -EXPORT_C void TVPbkContactStoreUriPtr::ExternalizeL(RWriteStream& /*aStream*/) const{ } -EXPORT_C TInt TVPbkContactStoreUriPtr::ExternalizedSize() const{ return 0; } - - -TInt TVPbkContactStoreUriPtr::CompareC(const TDesC& /*aLhsUri*/, const TDesC& /*aRhsUri*/) const{ return 0; } - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_VPbkContactStoreUris.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_VPbkContactStoreUris.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - - -// INCLUDES -#include - -_LIT( KPhoneBookDbURI, "cntdb://c:contacts.cdb"); - -/** - * Returns the default Contacts Model database store URI. - * - * @return The default Contacts Model database store URI. - */ -EXPORT_C const TDesC& VPbkContactStoreUris::DefaultCntDbUri(){ return KPhoneBookDbURI(); } - -/** - * Returns the global ADN SIM store URI. - * - * Global means the ADN store that can be accessed by both GSM and 3G phone. - * - * @return The global ADN SIM store URI - */ -EXPORT_C const TDesC& VPbkContactStoreUris::SimGlobalAdnUri(){ return KPhoneBookDbURI(); } - -/** - * Returns the global FDN SIM store URI. - * - * Global means the FDN store that can be accessed by both GSM and 3G phone. - * - * @return The global FDN SIM store URI - */ -EXPORT_C const TDesC& VPbkContactStoreUris::SimGlobalFdnUri(){ return KPhoneBookDbURI(); } - -/** - * Returns the global SDN SIM store URI. - * - * Global means the SDN store that can be accessed by both GSM and 3G phone. - * - * @return The global SDN SIM store URI - */ -EXPORT_C const TDesC& VPbkContactStoreUris::SimGlobalSdnUri(){ return KPhoneBookDbURI(); } - -/** - * Returns the MSISDN SIM store URI. - * - * Global means the MSISDN store that can be accessed by both GSM and - * 3G phone. - * - * NOTE: Though the name of the store suggests that the store will contain - * the caller's own phone number it's not exactly the case. It can - * contain the number but only if it has been set. - * - * @return The MSISDN SIM store URI. - */ -EXPORT_C const TDesC& VPbkContactStoreUris::SimGlobalOwnNumberUri(){ return KPhoneBookDbURI(); } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_cVPbkBaseContactFieldCollection.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_cVPbkBaseContactFieldCollection.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef SCVPBKBASECONTACTFIELDCOLLECTION_H -#define SCVPBKBASECONTACTFIELDCOLLECTION_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook base contact field collection interface. - * An abstract collection of read-only Virtual Phonebook contact fields. - */ -class CVPbkBaseContactFieldCollectionStub : public CBase, - public MVPbkStoreContactFieldCollection - { - public: // Destructor - CVPbkBaseContactFieldCollectionStub(); - - /** - * Destructor. - */ - ~CVPbkBaseContactFieldCollectionStub(); - - public: // From MVPbkBaseContactFieldCollection (covariant return types)) - const MVPbkStoreContactField& FieldAt(TInt aIndex) const ; - - public: // New functions - /** - * Returns a field in this collection. - * - * @param aIndex A zero-based index of the field to return. - * @return A reference to the field at aIndex. Reference is valid until - * FieldAt is called again. If you need a permanent copy, - * call MVPbkStoreContactField::CloneLC to the returned - * field. - * @see MVPbkStoreContactField::CloneLC - * @precond aIndex >= 0 && aIndex < FieldCount() - * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised - * if the precondition does not hold. - */ - MVPbkStoreContactField& FieldAt( TInt aIndex ) ; - - /** - * Returns a copy of the field in this collection. - * - * Client gets the ownership of the field. - * - * @param aIndex A zero-based index of the field to return. - * @return A new instance to the field at aIndex. The field is valid - * as long as the parent contact is valid - * @precond aIndex >= 0 && aIndex < FieldCount() - * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised - * if the precondition does not hold. - */ - MVPbkStoreContactField* FieldAtLC( TInt aIndex ) const ; - - /** - * Returns the parent contact of the field collection - * - * @return the parent contact of the field collection - */ - MVPbkStoreContact& ParentStoreContact() const ; - - /** - * Returns a field in this collection identified by a contact field - * link. - * - * A contact field link can be created using the MVPbkStoreContactField - * interface. The same link works then as a contact link and - * a field link. - * - * NOTE: implementations of stores are possibly using an index - * of the field as an identifier so clients should prefer not - * to save field links permanently. E.g modifying the contact - * can invalidate the link in some store implementations. - * A field link is practical in use cases where the link is - * created and immediately given to another component. - * - * @param aContactLink A valid contact field link. - * @return A field in this collection identified by aContactLink or NULL - * if the link does not contain field information or if the - * link does not refer to the parent contact of this field collection. - */ - MVPbkStoreContactField* RetrieveField( - const MVPbkContactLink& aContactLink ) const ; - - - public: // Interface - /** - * Returns the parent contact of this field set. - * @return The parent contact of this field set. - */ - MVPbkBaseContact& ParentContact() const ; - - /** - * Returns the number of fields in this collection. - * @return The number of fields in this collection. - */ - TInt FieldCount() const ; - - /** - * Returns a read-only field in this collection. - * - * @param aIndex Zero-based index of the field to return. - * @return Reference to a field at aIndex. Reference is - * valid until FieldAt is called again. - * @see MVPbkBaseContactFieldCollection::ConstFieldAt - * @precond aIndex >= 0 && aIndex < FieldCount() - * Panic VPbkError::EInvalidFieldIndex is raised if the - * precondition does not hold. - */ - //const MVPbkBaseContactField& FieldAt( - // TInt aIndex) const ; - - }; - - -#endif // SCVPBKBASECONTACTFIELDCOLLECTION_H - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_cactive.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_cactive.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2007 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 - -CActiveScheduler::TLoopOwner gTLoop ; - -TBool gSetActive = EFalse; -/* - IMPORT_C ~CActive(); - IMPORT_C void Deque(); - IMPORT_C void SetPriority(TInt aPriority); - inline TBool IsAdded() const; - inline TInt Priority() const; - IMPORT_C virtual TInt RunError(TInt aError); - IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); -*/ - -void CActive::Cancel() - { - iStatus.iFlags = 0; - } - -CActive::CActive(TInt /*aPriority*/) - { - } - -void CActive::SetActive() - { - iStatus.iFlags = TRequestStatus::EActive; - } - -CActive::~CActive() - { - } - -void CActive::Deque() - { - } - -void CActive::SetPriority(TInt /*aPriority*/) - { - } - -TInt CActive::RunError(TInt /*aError*/) - { - return KErrNone; - } - -TInt CActive::Extension_(TUint /*aExtensionId*/, TAny*& /*a0*/, TAny* /*a1*/) - { - return KErrNone; - } - -void CActiveScheduler::Add(CActive* /*aActive*/) - { - } - - -void CPeriodic::Start(TTimeIntervalMicroSeconds32 /*aDelay*/, - TTimeIntervalMicroSeconds32 /*anInterval*/, - TCallBack /*aCallBack*/) - { - } - - -CActiveSchedulerWait::CActiveSchedulerWait() - { - } -CActiveSchedulerWait::~CActiveSchedulerWait() - { - } - -void CActiveSchedulerWait::Start() - { - CActiveScheduler::TLoopOwner temp = NULL; - iLoop = temp; //assign some local variable with junk value - } - -void CActiveSchedulerWait::AsyncStop() - { - iLoop = NULL; - } - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/vimpststorage_test.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/vimpststorage_test.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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 FILES -#include -#include "vimpststorage_test.h" -#include -#include -#include -#include -#include - -// CONSTANTS - - - -// ============================= LOCAL FUNCTIONS =============================== - - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// Cvimpststorage_test::Cvimpststorage_test -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -Cvimpststorage_test::Cvimpststorage_test( - CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// Cvimpststorage_test::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void Cvimpststorage_test::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - TInt ret = settingServer.Connect(); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Struct to StifLogger settigs. - TLoggerSettings loggerSettings; - // Parse StifLogger defaults from STIF initialization file. - ret = settingServer.GetLoggerSettings(loggerSettings); - if(ret != KErrNone) - { - User::Leave(ret); - } - // Close Setting server session - settingServer.Close(); - - TFileName logFileName; - - if(loggerSettings.iAddTestCaseTitle) - { - TName title; - TestModuleIf().GetTestCaseTitleL(title); - logFileName.Format(Kvimpststorage_testLogFileWithTitle, &title); - } - else - { - logFileName.Copy(Kvimpststorage_testLogFile); - } - - iLog = CStifLogger::NewL( Kvimpststorage_testLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - - CActiveScheduler* activeexist =CActiveScheduler::Current(); - if( !activeexist ) - { - iActive = new (ELeave) CActiveScheduler(); - CActiveScheduler::Install(iActive); - } - - } - -// ----------------------------------------------------------------------------- -// Cvimpststorage_test::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -Cvimpststorage_test* Cvimpststorage_test::NewL( - CTestModuleIf& aTestModuleIf ) - { - Cvimpststorage_test* self = new (ELeave) Cvimpststorage_test( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); - - return self; - - } - -// Destructor -Cvimpststorage_test::~Cvimpststorage_test() - { - - - - // Delete resources allocated from test methods - Delete(); - - // Delete logger - delete iLog; - - if(iActive) - { - delete iActive; - } - - } - -// ========================== OTHER EXPORTED FUNCTIONS ========================= - -// ----------------------------------------------------------------------------- -// LibEntryL is a polymorphic Dll entry point. -// Returns: CScriptBase: New CScriptBase derived object -// ----------------------------------------------------------------------------- -// -EXPORT_C CScriptBase* LibEntryL( - CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework - { - - return ( CScriptBase* ) Cvimpststorage_test::NewL( aTestModuleIf ); - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/vimpststorage_testBlocks.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/vimpststorage_testBlocks.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1215 +0,0 @@ -/* -* Copyright (c) 2002 - 2007 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 FILES] - do not remove -#include -#include -#include -#include -#include -//#include -#include -#include -//#include - -#include "vimpststorage_test.h" - -#include "cvimpststoragemanager.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststoragecontacts.h" -#include "mvimpststorageitemmodel.h" -#include "cvimpststoragecontact.h" -#include "cvimpststoragecontactlist.h" -#include "bamdesca.h" -#include "cvimpststoragevpbkstorehandler.h" -#include "CVIMPSTStorageViewId.h" -#include "CVIMPSTStorageContactSorter.h" -#include "MVIMPSTStorageContact.h" - -#include "s_MVPbkContactLinkstub.h" -#include -#include -#include "CVPbkStoreContactStub.h" -#include "CVPbkContactOperationBaseStub.h" - -_LIT( KIMContactListId,"IMContacts" ); -//_LIT( KVPContactListId,"VPContacts" ); -_LIT( KStoreName, "TestStore.cdb" ); -_LIT( KServiceName, "TestService" ) ; -_LIT( KDisplayname, "my contact list" ); -//_LIT( KVPDisplayname, "Voip list" ); -_LIT( KUserId, "id3@dummydomain.com" ); -const TUint32 serviceId(3); - -const TInt KNumberGranularity( 12 ); - -const TInt ProcessInterval = 10000000; //10 seconds - -//extern -extern TInt gGiveFieldCount; -extern TBool gBestMatchingFieldType; - -extern CVPbkContactOperationBaseStub* gOperationStub; - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// Cvimpststorage_test::Delete -// Delete here all resources allocated and opened from test methods. -// Called from destructor. -// ----------------------------------------------------------------------------- -// -void Cvimpststorage_test::Delete() - { - - } - -// ----------------------------------------------------------------------------- -// Cvimpststorage_test::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt Cvimpststorage_test::RunMethodL( - CStifItemParser& aItem ) - { - - //first of all create database. - static TStifFunctionInfo const KFunctions[] = - { - // Copy this line for every implemented function. - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - ENTRY( "InitialiseLibraryTest", Cvimpststorage_test::InitialiseLibraryTestL ), - ENTRY( "InitialiseViewTest", Cvimpststorage_test::InitialiseViewTestL ), - ENTRY( "CVIMPSTStorageContactTestCase1L", Cvimpststorage_test::CVIMPSTStorageContactTestCase1L ), - ENTRY( "CVIMPSTStorageContactTestCase2L", Cvimpststorage_test::CVIMPSTStorageContactTestCase2L ), - ENTRY( "CVIMPSTStorageContactTestCase3L", Cvimpststorage_test::CVIMPSTStorageContactTestCase3L ), - ENTRY( "CVIMPSTStorageContactTestCase4L", Cvimpststorage_test::CVIMPSTStorageContactTestCase4L ), - ENTRY( "CVIMPSTStorageContactTestCase6L", Cvimpststorage_test::CVIMPSTStorageContactTestCase6L ), - ENTRY( "CVIMPSTStorageContactTestCase7L", Cvimpststorage_test::CVIMPSTStorageContactTestCase7L ), - ENTRY( "CVIMPSTStorageContactTestCase8L", Cvimpststorage_test::CVIMPSTStorageContactTestCase8L ), - ENTRY( "CVIMPSTStorageContactTestCase9L", Cvimpststorage_test::CVIMPSTStorageContactTestCase9L ), - ENTRY( "CVIMPSTStorageContactTestCase10L", Cvimpststorage_test::CVIMPSTStorageContactTestCase10L ), - - ENTRY( "CVIMPSTStorageContactTestCase11L", Cvimpststorage_test::CVIMPSTStorageContactTestCase11L ), - ENTRY( "CVIMPSTStorageContactTestCase12L", Cvimpststorage_test::CVIMPSTStorageContactTestCase12L ), - ENTRY( "CVIMPSTStorageContactTestCase13L", Cvimpststorage_test::CVIMPSTStorageContactTestCase13L ), - ENTRY( "CVIMPSTStorageContactTestCase14L", Cvimpststorage_test::CVIMPSTStorageContactTestCase14L ), - ENTRY( "CVIMPSTStorageContactTestCase15L", Cvimpststorage_test::CVIMPSTStorageContactTestCase15L ), - - ENTRY( "CVIMPSTStorageContactListTestCase16L", Cvimpststorage_test::CVIMPSTStorageContactListTestCase16L ), - ENTRY( "CVIMPSTStorageContactListTestCase17L", Cvimpststorage_test::CVIMPSTStorageContactListTestCase17L ), - ENTRY( "CVIMPSTStorageContactListTestCase18L", Cvimpststorage_test::CVIMPSTStorageContactListTestCase18L ), - ENTRY( "CVIMPSTStorageContactListTestCase19L", Cvimpststorage_test::CVIMPSTStorageContactListTestCase19L ), - ENTRY( "CVIMPSTStorageContactListTestCase20L", Cvimpststorage_test::CVIMPSTStorageContactListTestCase20L ), - ENTRY( "CVIMPSTStorageContactListTestCase21L", Cvimpststorage_test::CVIMPSTStorageContactListTestCase21L ), - - ENTRY( "CVIMPSTStorageXSPStoreHandlerTestCase01L", Cvimpststorage_test::CVIMPSTStorageXSPStoreHandlerTestCase01L ), - - - - - - - //ADD NEW ENTRY HERE - // [test cases entries] - Do not remove - - }; - - const TInt count = sizeof( KFunctions ) / - sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - -/** - * Called when a contact is deleted. - * @param aId The ID of the deleted contact - * @param aFromPEC, ETrue, if event is coming from PEC - */ - void Cvimpststorage_test::HandleContactDeleteL( const TDesC& /*aContactId*/ ) - { - iObserverReceivedNotification = ETrue; - } - - -/** - * Called when a contact is added. - * @param aList. List for contact that was added. - * @param aContact The contact which was added - * @param aFromPEC, ETrue, if event is coming from PEC - */ - void Cvimpststorage_test::HandleAdditionL( MVIMPSTStorageContactList& /*aList*/, MVIMPSTStorageContact& /*aContact*/ ) - { - iObserverReceivedNotification = ETrue; - } - - -/** - * Called when a contact or list is about to change, or has been changed. - * @param aList List that is changed. Can be NULL if contact is changed. - * @param aContact Contact that is changed. Can be NULL if list is changed - * @param aEventType The type of event: EStorageEventPreChange before - * the change (contact still has the old information), or - * EStorageEventPostChange after the change took place - * (contact has new information) - */ - void Cvimpststorage_test::HandleChangeL( MVIMPSTStorageContactList* /*aList*/, MVIMPSTStorageContact* /*aContact*/, - TVIMPSTEnums::TCAObserverEventType /*aEventType*/, - TBool /*aUserIdChanged*/ ) - { - iObserverReceivedNotification = ETrue; - } - -// ----------------------------------------------------------------------------- -// Cvimpststorage_test::InitialiseLibraryTestL -// ----------------------------------------------------------------------------- -// - -TInt Cvimpststorage_test::InitialiseLibraryTestL( CStifItemParser& /*aItem*/ ) - { - _LIT( KState, "State" ); - _LIT( KResult, "Initialisation successful" ); -/* - CVIMPSTStorageManagerFactory::InitialiseLibraryL(); - CVIMPSTStorageManagerFactory::Release(); -*/ - // Test case passed - TestModuleIf().Printf( 1, KState, KResult ); - - // Case was executed - return KErrNone; - } - - - - -// ----------------------------------------------------------------------------- -// Cvimpststorage_test::InitialiseViewTestL -// ----------------------------------------------------------------------------- -// -TInt Cvimpststorage_test::InitialiseViewTestL( CStifItemParser& /*aItem*/ ) - { - /*CVIMPSTStorageManagerFactory::InitialiseLibraryL(); - - CVIMPSTStorageManagerFactory::InitialiseViewL(serviceId,KStoreName, KServiceName); - - CVIMPSTStorageManagerFactory::Release(); - */ - // Case was executed - return KErrNone; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase1L() - { - - - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - NULL, - NULL, - NULL, - NULL); - - if (contact) - { - delete contact; - return KErrNone ; - } - - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase2L() - { - //Ownership of contactLink is transferred to CVIMPSTStorageContact - //hence dont delete - MVPbkContactLink* contactLink = new (ELeave) CVPbkContactLinkStub(); - CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewL(); - CVPbkContactManager* contactMgr = CVPbkContactManager::NewL(*uriArray); - - - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - contactLink, - NULL, - contactMgr, - NULL); - - if (contact) - { - if (contactLink == contact->ContactLink()) - { - delete contact; - delete contactMgr; - delete uriArray; - return KErrNone ; - } - } - - delete contactMgr; - delete uriArray; - delete contactLink; - return KErrGeneral; - } - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase3L() - { - //Ownership of contactLink is transferred to CVIMPSTStorageContact - //hence dont delete - MVPbkContactLink* contactLink = new (ELeave) CVPbkContactLinkStub(); - - - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - contactLink, - NULL, - NULL, - NULL); - - if (contact) - { - delete contact; - return KErrNone ; - } - - delete contactLink; - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase4L() - { - //TestCase for when there is no service field for a contact - gGiveFieldCount = 0; - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - NULL, - NULL, - NULL, - NULL); - - if (contact) - { - CVPbkStoreContactStub* storedContact = new (ELeave) CVPbkStoreContactStub(); - CleanupStack::PushL( storedContact ); - - // Read all necessary data from contact and store to - // own type - CDesCArray* arrayForService = new (ELeave) CDesCArrayFlat( - KNumberGranularity ); - CleanupStack::PushL( arrayForService ); - - TInt err = contact->GetServiceFieldsL(storedContact, *arrayForService); - - contact->SetServiceFieldsL(*arrayForService); - - RPointerArray serviceDetails = contact->ServiceDetails(); - - CleanupStack::PopAndDestroy(2); //storedContact, arrayForService - - if ((err == KErrNotFound) && (0 == serviceDetails.Count())) - { - delete contact; - return KErrNone ; - } - - } - delete contact; - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase6L() - { - //TestCase for when there are some service field for a contact - //but the BestMatchingFieldType() function returns NULL - //Our code should not crash as this returns a Ptr value - gGiveFieldCount = 4; - gBestMatchingFieldType = EFalse; - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - NULL, - NULL, - NULL, - NULL); - - if (contact) - { - CVPbkStoreContactStub* storedContact = new (ELeave) CVPbkStoreContactStub(); - CleanupStack::PushL( storedContact ); - - // Read all necessary data from contact and store to - // own type - CDesCArray* arrayForService = new (ELeave) CDesCArrayFlat( - KNumberGranularity ); - CleanupStack::PushL( arrayForService ); - - TInt err = contact->GetServiceFieldsL(storedContact, *arrayForService); - contact->SetServiceFieldsL(*arrayForService); - - RPointerArray serviceDetails = contact->ServiceDetails(); - - - if ((0 == arrayForService->MdcaCount()) && (arrayForService->MdcaCount() == serviceDetails.Count())) - { - delete contact; - CleanupStack::PopAndDestroy(2); //storedContact, arrayForService - return KErrNone ; - } - - CleanupStack::PopAndDestroy(2); //storedContact, arrayForService - } - delete contact; - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase7L() - { - _LIT(KTestCaseUserId, "testUser"); - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - NULL, - NULL, - NULL, - NULL); - - if (contact) - { - contact->SetUserIdL(KTestCaseUserId()); - - if (0 == KTestCaseUserId().Compare(contact->UserId())) - { - delete contact; - return KErrNone; - } - } - - delete contact; - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase8L() - { - _LIT(KTestCaseUserId, "testUser"); - - iObserverReceivedNotification = EFalse; - - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( this, - NULL, - NULL, - NULL, - NULL); - - if (contact) - { - //Initial Presence - if (TVIMPSTEnums::EOffline != contact->OnlineStatus()) - { - delete contact; - return KErrGeneral; - } - - contact->SignalChanges(); - //Set the presence - contact->SetOnlineStatus(TVIMPSTEnums::EOnline); - if (TVIMPSTEnums::EOnline != contact->OnlineStatus()) - { - delete contact; - return KErrGeneral; - } - contact->SignalChanges(); - contact->SetOnlineStatus(TVIMPSTEnums::EOnline); - if (TVIMPSTEnums::EOnline != contact->OnlineStatus()) - { - delete contact; - return KErrGeneral; - } - - contact->SignalChanges(); - delete contact; - - if (!iObserverReceivedNotification) - { - return KErrGeneral; - } - - return KErrNone; - } - - delete contact; - return KErrGeneral; - } - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase9L() - { - _LIT(KTestCaseStatusTestId, "status"); - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - NULL, - NULL, - NULL, - NULL); - - if (contact) - { - if (contact->StatusText().Length()) - { - delete contact; - return KErrGeneral; - } - - contact->SetStatusTextL(KTestCaseStatusTestId()); - - if (0 == KTestCaseStatusTestId().Compare(contact->StatusText())) - { - delete contact; - return KErrNone; - } - } - - delete contact; - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase10L() - { - _LIT8(KTestCaseAvatarId, "avatar"); - iObserverReceivedNotification = EFalse; - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( this, - NULL, - NULL, - NULL, - NULL); - - if (contact) - { - if (!contact->AvatarContent().Length()) - { - - contact->SetAvatarIndex(3); - - if (3 == contact->AvatarIndex()) - { - contact->iAvatarContent = KTestCaseAvatarId().AllocL(); - if (0 == KTestCaseAvatarId().Compare(contact->AvatarContent())) - { - contact->SignalAvatarChange(); - if (iObserverReceivedNotification) - { - delete contact; - return KErrNone; - } - } - } - } - } - - delete contact; - return KErrGeneral; - } - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase11L() - { - iObserverReceivedNotification = EFalse; - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( this, - NULL, - NULL, - NULL, - NULL); - CVPbkStoreContactStub* storedContact = new (ELeave) CVPbkStoreContactStub(); - CleanupStack::PushL( storedContact ); - CVPbkContactOperationBaseStub* operationBaseStub = NULL; - if (contact) - { - TRAPD(err,contact->VPbkSingleContactOperationComplete(*operationBaseStub, storedContact)); - - if ((KErrNone == err) && (storedContact==contact->VPbkStoreContact())) - { - CleanupStack::PopAndDestroy(); //storedContact - delete contact; - return KErrNone; - } - } - CleanupStack::PopAndDestroy(); //storedContact - delete contact; - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase12L() - { - iObserverReceivedNotification = EFalse; - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( this, - NULL, - NULL, - NULL, - this); - - CVPbkStoreContactStub* storedContact = new (ELeave) CVPbkStoreContactStub(); - CleanupStack::PushL( storedContact ); - - if (contact) - { - TRAPD(err,contact->DoHandleVPbkSingleContactOperationCompleteL(storedContact)); - - if (KErrNone == err) - { - CleanupStack::PopAndDestroy(); //storedContact - delete contact; - return KErrNone; - } - } - - CleanupStack::PopAndDestroy(); //storedContact - delete contact; - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase13L() - { - iObserverReceivedNotification = EFalse; - CVPbkStoreContactStub* storedContact = new (ELeave) CVPbkStoreContactStub(); - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( this, - NULL, - storedContact, - NULL, - this); - if (contact) - { - contact->Commit(); - - TContactOpResult opResult; - opResult.iOpCode = EContactCommit; - opResult.iStoreContact = storedContact; - opResult.iExtension = NULL; - - contact->ContactOperationCompleted(opResult); - - opResult.iOpCode = EContactLock; - contact->ContactOperationCompleted(opResult); - contact->ContactOperationFailed( - opResult.iOpCode, KErrArgument, EFalse ); - - contact->Commit(this, this); - contact->ContactOperationCompleted(opResult); - contact->ContactOperationFailed( - opResult.iOpCode, KErrArgument, EFalse ); - - } - - - delete contact; - return KErrNone; - } - - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase14L() - { - iObserverReceivedNotification = EFalse; - CVPbkStoreContactStub* storedContact = new (ELeave) CVPbkStoreContactStub(); - MVPbkContactLink* contactLink = new (ELeave) CVPbkContactLinkStub(); - CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewL(); - CVPbkContactManager* contactMgr = CVPbkContactManager::NewL(*uriArray); - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( this, - contactLink, - storedContact, - contactMgr, - this); - if (contact) - { - contact->Commit(); - - TContactOpResult opResult; - opResult.iOpCode = EContactCommit; - opResult.iStoreContact = storedContact; - opResult.iExtension = NULL; - - contact->ContactOperationCompleted(opResult); - - opResult.iOpCode = EContactLock; - contact->ContactOperationCompleted(opResult); - contact->ContactOperationFailed( - opResult.iOpCode, KErrArgument, EFalse ); - - contact->Commit(this, this); - contact->ContactOperationCompleted(opResult); - contact->ContactOperationFailed( - opResult.iOpCode, KErrArgument, EFalse ); - - } - delete uriArray; - delete contactMgr; - delete contact; - return KErrNone; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactTestCase15L() - { - - CVPbkStoreContactStub* storedContact = new (ELeave) CVPbkStoreContactStub(); - MVPbkContactLink* contactLink = new (ELeave) CVPbkContactLinkStub(); - CVPbkContactStoreUriArray* uriArray = CVPbkContactStoreUriArray::NewL(); - CVPbkContactManager* contactMgr = CVPbkContactManager::NewL(*uriArray); - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( this, - contactLink, - storedContact, - contactMgr, - this); - - CVPbkContactOperationBaseStub* operationBaseStub = NULL; - if (contact) - { - - contact->VPbkSingleContactOperationFailed(*operationBaseStub, KErrArgument); - - contact->iContactOperationObserver = this; - - contact->VPbkSingleContactOperationFailed(*gOperationStub, KErrArgument); - - } - delete uriArray; - delete contactMgr; - delete contact; - return KErrNone; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactListTestCase16L() - { - _LIT(KContactListId, "listid"); - _LIT(KContactListName, "listName"); - _LIT(KContactName, "contact"); - _LIT(KContactName1, "contact1"); - _LIT(KContactName2, "contact2"); - _LIT(KContactName3, "contact3"); - _LIT(KContactNotFound, "contactNotFound"); - - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - NULL, - NULL, - NULL, - NULL); - contact->SetUserIdL(KContactName()); - - - CVIMPSTStorageContact* contact1 = CVIMPSTStorageContact::NewL( NULL, - NULL, - NULL, - NULL, - NULL); - contact1->SetUserIdL(KContactName1()); - - CVIMPSTStorageContact* contact2 = CVIMPSTStorageContact::NewL( NULL, - NULL, - NULL, - NULL, - NULL); - contact2->SetUserIdL(KContactName2()); - - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL() ; - CleanupStack::PushL(sorter); - - sorter->SetSortAlgorithm(MVIMPSTStorageContact::ECompareAlphabetically); - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *this, - *sorter, - KContactListId(), - KContactListName() ); - if (list) - { - MVIMPSTStorageContact* cnt = NULL; - cnt = list->AddContactL(contact); - if (cnt) - { - //add same contact - cnt = list->AddContactL(contact) ; - if (cnt == contact) - { - cnt = list->AddContactL(contact1); - cnt = list->AddContactL(contact2); - - //search for contacts based on Id - cnt = list->FindContact(KContactName()); - MVIMPSTStorageContact* cnt1(list->FindContact(KContactName1())); - MVIMPSTStorageContact* cnt2(list->FindContact(KContactName2())); - MVIMPSTStorageContact* cnt3(list->FindContact(KContactNotFound())); - - sorter->SetSortAlgorithm(MVIMPSTStorageContact::ECompareByPresence); - - if ( (cnt == contact) && - (cnt1 == contact1) && - (cnt2 == contact2) && - (NULL == cnt3) ) - { - TInt err = list->RemoveContact(KContactNotFound()); - TInt err1 = list->RemoveContact(KContactName2()); - TInt err2 = list->RemoveContact(KContactName1()); - TInt err3 = list->RemoveContact(KContactName()); - - if ( (KErrNotFound == err) && - (KErrNone == err1) && - (KErrNone == err2) && - (KErrNone == err3) - ) - { - delete list; - CleanupStack::PopAndDestroy(1); - return KErrNone; - } - - } - } - - } - } - CleanupStack::PopAndDestroy(1); - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactListTestCase17L() - { - _LIT(KContactListId, "listid"); - _LIT(KContactListName, "listName"); - _LIT(KContactName, "contact"); - _LIT(KContactName1, "contact1"); - _LIT(KContactName2, "contact2"); - _LIT(KContactName3, "contact3"); - _LIT(KContactNotFound, "contactNotFound"); - - MVPbkContactLink* contactLink = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - contactLink, - NULL, - NULL, - NULL); - contact->SetUserIdL(KContactName()); - - MVPbkContactLink* contactLink1 = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact1 = CVIMPSTStorageContact::NewL( NULL, - contactLink1, - NULL, - NULL, - NULL); - contact1->SetUserIdL(KContactName1()); - - MVPbkContactLink* contactLink2 = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact2 = CVIMPSTStorageContact::NewL( NULL, - contactLink2, - NULL, - NULL, - NULL); - contact2->SetUserIdL(KContactName2()); - - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL() ; - CleanupStack::PushL(sorter); - - MVPbkContactLink* contactLinkNotFound = new (ELeave) CVPbkContactLinkStub(); - - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *this, - *sorter, - KContactListId(), - KContactListName() ); - if (list) - { - MVIMPSTStorageContact* cnt = NULL; - cnt = list->AddContactL(contact); - if (cnt) - { - //add same contact - cnt = list->AddContactL(contact) ; - if (cnt == contact) - { - cnt = list->AddContactL(contact1); - cnt = list->AddContactL(contact2); - - //search for contacts based on Id - cnt = list->FindContact(*contactLink); - MVIMPSTStorageContact* cnt1(list->FindContact(*contactLink1)); - MVIMPSTStorageContact* cnt2(list->FindContact(*contactLink2)); - MVIMPSTStorageContact* cnt3(list->FindContact(*contactLinkNotFound)); - - if ( (cnt == contact) && - (cnt1 == contact1) && - (cnt2 == contact2) && - (NULL == cnt3) ) - { - TInt err = list->RemoveContact(*contactLinkNotFound); - TInt err1 = list->RemoveContact(*contactLink2); - TInt err2 = list->RemoveContact(*contactLink1); - TInt err3 = list->RemoveContact(*contactLink); - - if ( (KErrNotFound == err) && - (KErrNone == err1) && - (KErrNone == err2) && - (KErrNone == err3) - ) - { - delete list; - CleanupStack::PopAndDestroy(1); - return KErrNone; - } - - } - } - - } - } - CleanupStack::PopAndDestroy(1); - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactListTestCase18L() - { - _LIT(KContactListId, "listid"); - _LIT(KContactListName, "listName"); - _LIT(KContactName, "contact"); - _LIT(KContactName1, "contact1"); - _LIT(KContactName2, "contact2"); - _LIT(KContactName3, "contact3"); - _LIT(KContactNotFound, "contactNotFound"); - - MVPbkContactLink* contactLink = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - contactLink, - NULL, - NULL, - NULL); - - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL() ; - CleanupStack::PushL(sorter); - - MVPbkContactLink* contactLinkNotFound = new (ELeave) CVPbkContactLinkStub(); - - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *this, - *sorter, - KContactListId(), - KContactListName() ); - if (list) - { - MVIMPSTStorageContact* cnt = NULL; - cnt = list->AddContactL(contact); - if (cnt) - { - //Pop the contact - cnt = list->PopContact(*contactLink) ; - if (cnt == contact) - { - MVIMPSTStorageContact* cnt3(list->PopContact(*contactLinkNotFound)); - - if ( (cnt == contact) && - (NULL == cnt3) ) - { - delete list; - delete contact; - CleanupStack::PopAndDestroy(1); - return KErrNone; - } - } - - } - } - CleanupStack::PopAndDestroy(1); - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactListTestCase19L() - { - _LIT(KContactListId, "listid"); - _LIT(KContactListName, "listName"); - _LIT(KContactName, "contact"); - _LIT(KContactName1, "contact1"); - _LIT(KContactName2, "contact2"); - _LIT(KContactName3, "contact3"); - _LIT(KContactNotFound, "contactNotFound"); - - MVPbkContactLink* contactLink = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - contactLink, - NULL, - NULL, - NULL); - contact->SetUserIdL(KContactName()); - contact->SetOnlineStatus(TVIMPSTEnums::EOnline); - - MVPbkContactLink* contactLink1 = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact1 = CVIMPSTStorageContact::NewL( NULL, - contactLink1, - NULL, - NULL, - NULL); - contact1->SetUserIdL(KContactName1()); - contact1->SetOnlineStatus(TVIMPSTEnums::EOffline); - - MVPbkContactLink* contactLink2 = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact2 = CVIMPSTStorageContact::NewL( NULL, - contactLink2, - NULL, - NULL, - NULL); - contact2->SetUserIdL(KContactName2()); - contact2->SetOnlineStatus(TVIMPSTEnums::EBusy); - - MVPbkContactLink* contactLink3 = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact3 = CVIMPSTStorageContact::NewL( NULL, - contactLink3, - NULL, - NULL, - NULL); - contact3->SetUserIdL(KContactName3()); - contact3->SetOnlineStatus(TVIMPSTEnums::EAway); - - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL() ; - CleanupStack::PushL(sorter); - - MVPbkContactLink* contactLinkNotFound = new (ELeave) CVPbkContactLinkStub(); - - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *this, - *sorter, - KContactListId(), - KContactListName() ); - if (list) - { - - list->AddContactL(contact); - list->AddContactL(contact1); - list->AddContactL(contact2); - list->AddContactL(contact3);; - - MVIMPSTStorageContact* test = &list->operator[](0); - if ( test && list->Count() == 4) - { - if (list->OnlineCount() == 3) - { - delete list; - CleanupStack::PopAndDestroy(1); - return KErrNone; - } - } - } - CleanupStack::PopAndDestroy(1); - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactListTestCase20L() - { - _LIT(KContactListId, "listid"); - _LIT(KContactListName, "listName"); - _LIT(KTestCase20ListId, "meco"); - _LIT(KTestCase20ListName, "Meco display"); - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL() ; - CleanupStack::PushL(sorter); - - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *this, - *sorter, - KContactListId(), - KContactListName() ); - if (list) - { - - if (0 == KContactListId().Compare(list->ListId())) - { - if (0 == KContactListName().Compare(list->DisplayName())) - { - - list->SetDisplayNameL(KTestCase20ListName()); - list->SetListIdL(KTestCase20ListId()); - - if ( (0 == KTestCase20ListId().Compare(list->ListId())) && - (0 == KTestCase20ListName().Compare(list->DisplayName())) ) - { - CleanupStack::PopAndDestroy(1); - delete list; - return KErrNone; - } - } - } - } - CleanupStack::PopAndDestroy(1); - return KErrGeneral; - } - - -TInt Cvimpststorage_test::CVIMPSTStorageContactListTestCase21L() - { - _LIT(KContactListId, "listid"); - _LIT(KContactListName, "listName"); - _LIT(KContactName, "contact"); - _LIT(KContactName1, "contact1"); - _LIT(KContactName2, "contact2"); - _LIT(KContactName3, "contact3"); - _LIT(KContactNotFound, "contactNotFound"); - - MVPbkContactLink* contactLink = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact = CVIMPSTStorageContact::NewL( NULL, - contactLink, - NULL, - NULL, - NULL); - contact->SetUserIdL(KContactName()); - contact->SetOnlineStatus(TVIMPSTEnums::EOnline); - - MVPbkContactLink* contactLink1 = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact1 = CVIMPSTStorageContact::NewL( NULL, - contactLink1, - NULL, - NULL, - NULL); - contact1->SetUserIdL(KContactName1()); - contact1->SetOnlineStatus(TVIMPSTEnums::EOffline); - - MVPbkContactLink* contactLink2 = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact2 = CVIMPSTStorageContact::NewL( NULL, - contactLink2, - NULL, - NULL, - NULL); - contact2->SetUserIdL(KContactName2()); - contact2->SetOnlineStatus(TVIMPSTEnums::EBusy); - - MVPbkContactLink* contactLink3 = new (ELeave) CVPbkContactLinkStub(); - CVIMPSTStorageContact* contact3 = CVIMPSTStorageContact::NewL( NULL, - contactLink3, - NULL, - NULL, - NULL); - contact3->SetUserIdL(KContactName3()); - contact3->SetOnlineStatus(TVIMPSTEnums::EAway); - - CVIMPSTStorageContactSorter* sorter = CVIMPSTStorageContactSorter::NewL() ; - CleanupStack::PushL(sorter); - - MVPbkContactLink* contactLinkNotFound = new (ELeave) CVPbkContactLinkStub(); - - CVIMPSTStorageContactList* list = CVIMPSTStorageContactList::NewL( *this, - *sorter, - KContactListId(), - KContactListName() ); - if (list) - { - - list->AddContactL(contact); - list->AddContactL(contact1); - list->AddContactL(contact2); - - list->Sort(); - contact1->SetOnlineStatus(TVIMPSTEnums::EOnline); - list->ResortContact(contact1); - contact1->SetOnlineStatus(TVIMPSTEnums::EAway); - list->ResortUnKnownContact(contact1); - - MVIMPSTStorageContact* cnt = &(list->OnlineContact( 1 )); - TInt index = list->FindIndexOfContact( cnt, TVIMPSTEnums::EFilterAll ); - - if (index == 1) - { - delete list; - CleanupStack::PopAndDestroy(1); - return KErrNone; - } - } - delete list; - CleanupStack::PopAndDestroy(1); - return KErrGeneral; - } - - - -TInt Cvimpststorage_test::CVIMPSTStorageXSPStoreHandlerTestCase01L() - { - _LIT(KStoreName, "MecoStore"); - _LIT(KServiceName, "MecoService"); - - CVIMPSTStorageViewId* store = CVIMPSTStorageViewId::NewL(1, - KStoreName(), - KServiceName()); - //Create XSP Store Handler - CVIMPSTStorageVPbkStoreHandler* contactStoreHandler = - CVIMPSTStorageVPbkStoreHandler::NewL( - KStoreName(), KIMContactListId, 1, KServiceName(), - *store); - - if (contactStoreHandler) - { - - delete contactStoreHandler; - delete store; - return KErrNone; - } - delete contactStoreHandler; - delete store; - return KErrGeneral; - } - - - - -/** - * Called when all the contacts are fetched - */ -void Cvimpststorage_test::HandleContactAddedL(RPointerArray& /*aServiceDetails*/) - { - - } - -/** - * Called when all the contacts are fetched - */ -void Cvimpststorage_test::HandleContactDeletedL(RPointerArray& /*aServiceDetails*/) - { - - } - - - -void Cvimpststorage_test::HandleContactOperationCompleteL( MVIMPSTStorageContact& /*aContact*/, TInt /*aError = KErrNone*/ ) - { - - } - -/** - * From MVPbkContactObserver - */ -void Cvimpststorage_test::ContactOperationCompleted(TContactOpResult /*aResult*/) - { - - } - -/** - * From MVPbkContactObserver - */ -void Cvimpststorage_test::ContactOperationFailed - (TContactOp /*aOpCode*/, TInt /*aErrorCode*/, TBool /*aErrorNotified*/) - { - - } - - - -// [End of File] - Do not remove - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkContactFieldTextData_stub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkContactFieldTextData_stub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPBKCONTACTFIELDTEXTDATASTUB_H -#define CVPBKCONTACTFIELDTEXTDATASTUB_H - - -// INCLUDES -#include - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook Contact field text data. - * This interface is used to manipulate text contact field data. - */ -class CVPbkContactFieldTextData_stub : public MVPbkContactFieldTextData - { - public: // Destructor - /** - * Destructor. - */ - ~CVPbkContactFieldTextData_stub(); - CVPbkContactFieldTextData_stub(); - - - public: // Interface - - /** - * Returns the string data. - * @return Pointer to the text data. - */ - TPtrC Text() const; - - /** - * Sets the string data. - * @exception KErrOverflow if (aText.Length() > MaxLength()) - */ - void SetTextL( const TDesC& aText ) ; - - /** - * Returns maximum length of the field. - * @return Maximum length of the field or KVPbkUnlimitedFieldLength - * if length is only limited by available memory. - */ - TInt MaxLength() const ; - - - /** - * Returns the derived data type id. - * @return Contact field storage type. - */ - TVPbkFieldStorageType DataType() const; - - /** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ - TBool IsEmpty() const; - - /** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ - void CopyL(const MVPbkContactFieldData& aFieldData) ; - }; - -#endif // CVPBKCONTACTFIELDTEXTDATASTUB_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkContactOperationBaseStub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkContactOperationBaseStub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPbkContactOperationBaseStub_H -#define CVPbkContactOperationBaseStub_H - -// INCLUDES -#include - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook abtract asynchronous contact operation. - * This interface is used as a handle to asynchronous contact operations. - * Clients should keep a reference to the handle during the asynchronous - * operation to be able to delete and cancel the operation before it - * completes. - */ -class CVPbkContactOperationBaseStub : public CBase , - public MVPbkContactOperationBase - { - public: // Interface - /** - * Destructor. Cancels this operation and releases any - * resources held by it. - */ - ~CVPbkContactOperationBaseStub() - { - - } - - }; - -#endif // CVPbkContactOperationBaseStub_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkContactStoreUriArrayStub.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkContactStoreUriArrayStub.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,121 +0,0 @@ -/* -* Copyright (c) 2002-2007 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 - -#include -/** - * Creates a new instance of this class. - * @return Newly created instance of this class. - */ -EXPORT_C CVPbkContactStoreUriArray* CVPbkContactStoreUriArray::NewL() -{ -return new (ELeave) CVPbkContactStoreUriArray(); -} - -/** - * Creates a new instance of this class. Leaves - * the instance to the cleanup stack. - * @return Newly created instance of this class. - */ -EXPORT_C CVPbkContactStoreUriArray* CVPbkContactStoreUriArray::NewLC() - { - CVPbkContactStoreUriArray *temp = new (ELeave) CVPbkContactStoreUriArray(); - CleanupStack::PushL(temp); - return temp; - } - -/** - * Creates a new instance of this class internalizing the - * contents of the descriptor. - * @param aPackedUris Packed URIs created by using the - * PackLC functionality of this class. - * @return Newly created instance of this class. - */ -EXPORT_C CVPbkContactStoreUriArray* CVPbkContactStoreUriArray::NewLC(const TDesC8& /*aPackedUris*/){ return NULL; } - -/** - * Destructor. - */ -CVPbkContactStoreUriArray::~CVPbkContactStoreUriArray(){} - - -/** - * Appends StoreUriPtr to this array. - * - * @param aStoreUri Store URI to add array. - */ -EXPORT_C void CVPbkContactStoreUriArray::AppendL(const TVPbkContactStoreUriPtr& /*aStoreUri*/){} - -/** - * Appends array of StoreUriPtr to this array. - * - * @param aUriArray Array of Store URIs to add array. - */ -EXPORT_C void CVPbkContactStoreUriArray::AppendAllL(const CVPbkContactStoreUriArray& /*aUriArray*/){} - -/** - * Removes StoreUriPtr from this array. - * - * @param aStoreUri Store Uri to add array. - */ -EXPORT_C void CVPbkContactStoreUriArray::Remove(const TVPbkContactStoreUriPtr& /*aStoreUri*/){} - -/** - * Returns the count of Store URIs in this array. - * - * @return Count of Store URIs in array. - */ -EXPORT_C TInt CVPbkContactStoreUriArray::Count() const{ return 0; } - -/** - * Gets the URI pointer descriptor from this array at - * the given index. - * - * @param aIndex Index which URI Ptr is needed - * @return URI pointer descriptor. - */ -EXPORT_C TVPbkContactStoreUriPtr CVPbkContactStoreUriArray::operator[](TInt /*aIndex*/) const -{ -TVPbkContactStoreUriPtr ret; -return ret; -} - -/** - * Packs this URI array to a heap descriptor. - * - * @return Packed URI array in a heap descriptor. - */ -EXPORT_C HBufC8* CVPbkContactStoreUriArray::PackLC() const{ return NULL; } - -/** - * Checks whether the given URI is already in this array. - * - * @param aStoreUri Store URI to check. - * @return ETrue if Store URI is in this array, EFalse if not. - */ -EXPORT_C TBool CVPbkContactStoreUriArray::IsIncluded(const TVPbkContactStoreUriPtr& /*aStoreUri*/) const{ return EFalse; } - -CVPbkContactStoreUriArray::CVPbkContactStoreUriArray(){} -void CVPbkContactStoreUriArray::ConstructL(){} -void CVPbkContactStoreUriArray::ConstructL(const TDesC8& /*aPackedUris*/){} -TInt CVPbkContactStoreUriArray::CalculateExternalizedSize() const{ return 0; } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkStoreContactStub.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkStoreContactStub.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ -/* -* Copyright (c) 2007 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 "CVPbkStoreContactStub.h" -#include "s_cVPbkBaseContactFieldCollection.h" -#include -#include "s_MVPbkContactLinkstub.h" - -CVPbkBaseContactFieldCollectionStub gFeildCollection; - -CVPbkStoreContactStub::CVPbkStoreContactStub() -{ - -} - - -MVPbkStoreContactFieldCollection& CVPbkStoreContactStub::Fields() - { - return gFeildCollection; - } -/** - * Returns this contact's fields (read only). - * @return This contact's fields in read only mode. - */ -const MVPbkStoreContactFieldCollection& CVPbkStoreContactStub::Fields() const - { - return gFeildCollection; - } - -/** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ -TBool CVPbkStoreContactStub::IsSame(const MVPbkBaseContact& /*aOtherContact*/) const {return ETrue;} - -/** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ -TBool CVPbkStoreContactStub::IsSame(const MVPbkStoreContact& /*aOtherContact*/) const { return ETrue; } - -/** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ -TBool CVPbkStoreContactStub::IsSame(const MVPbkViewContact& /*aOtherContact*/) const { return ETrue; } - -/** - * Creates link representing this contact. - * - * @return A link or NULL if the contact doesn't exist in the store, - * e.g. a folding contact in the view could be that kind or - * a new contact that hasn't been committed to the store. - * NULL is not put into the CleanupStack. - */ -MVPbkContactLink* CVPbkStoreContactStub::CreateLinkLC() const - { - CVPbkContactLinkStub* contactLink = new (ELeave) CVPbkContactLinkStub(); - CleanupStack::PushL(contactLink); - - return contactLink; - - } - -/** - * Deletes this contact from store asynchronously. - * - * @param aObserver The observer to call back when this operation - * completes. The observer will not be called - * if this function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if the contact can not be modified. - */ -void CVPbkStoreContactStub::DeleteL(MVPbkContactObserver& /*aObserver*/) const {} - -/** - * Returns ETrue if this view contact is from given store - * - * @param aContactStoreUri the URI of the store to compare - * @return ETrue if the view contact was from the given store - */ -TBool CVPbkStoreContactStub::MatchContactStore( - const TDesC& /*aContactStoreUri*/) const { return EFalse; } - -/** - * Returns ETrue if this contact is from the same store - * domain as the given one. - * - * @param aContactStoreDomain the the store domain - * @return ETrue if the contact was from the same store domain. - */ -TBool CVPbkStoreContactStub::MatchContactStoreDomain( - const TDesC& /*aContactStoreDomain*/) const { return EFalse; } - -/** - * Creates and returns a bookmark that points to the contact. - * Bookmark can be used to retrieve an index of the contact in - * the view. - * - * @return A new bookmark to the contact - */ -MVPbkContactBookmark* CVPbkStoreContactStub::CreateBookmarkLC() const { return NULL; } - -/** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ -MVPbkObjectHierarchy& CVPbkStoreContactStub::ParentObject() const -{ -MVPbkObjectHierarchy* ret = NULL; - -return *ret; -} - -/** - * Returns the parent view of the contact. - * - * @return The parent view of the contact. - */ -MVPbkContactViewBase& CVPbkStoreContactStub::ParentView() const -{ -MVPbkContactViewBase* ret=NULL; -return *ret; -} - -/** - * Reads the whole contact from the store asynchronously. - * - * A client can use this if it has a reference of the view contact but - * it needs all the data fields instead of only those that are included - * in the view contact. - * - * The contact is returned in a call back. - * - * @param aObserver An observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - */ -void CVPbkStoreContactStub::ReadL( MVPbkContactObserver& /*aObserver*/ ) const -{ - -} - -/** - * Reads the whole contact and locks it for modification - * asynchronously. - * - * A client can use this if it has a reference of the view contact and - * it needs to modify the contact. - * - * The contact is returned in a call back. - * - * @param aObserver An observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if contact is read-only - */ -void CVPbkStoreContactStub::ReadAndLockL( MVPbkContactObserver& /*aObserver*/ ) const -{ - -} - -/** - * Returns expandable interface for this object or NULL if expanding is - * not supported. - * - * Examples are a contact group that can be expanded to its members view - * or a folding view that can be extended to its internals. Client can - * get the type of the view from MVPbkContactViewBase::Type which is useful - * for knowing the type of expansion. - * - * @return An expansion or NULL. - */ -MVPbkExpandable* CVPbkStoreContactStub::Expandable() const -{ -return NULL; -}; - -/** - * Returns ETrue if two contacts are same. - * - * @param aOtherContact A contact to be compared. - * @param aContactStore The store of the aOtherContact. - * @return ETrue if two contacts are same. - */ -TBool CVPbkStoreContactStub::IsSame( const MVPbkViewContact& /*aOtherContact*/, - const MVPbkContactStore* /*aContactStore*/ ) const - { - return EFalse; - } - -/** - * Returns ETrue if two contacts are same. - * - * @param aOtherContact A contact to be compared. - * @param aContactStore The store of the aOtherContact. - * @return ETrue if two contacts are same. - */ -TBool CVPbkStoreContactStub::IsSame( const MVPbkStoreContact& /*aOtherContact*/, - const MVPbkContactStore* /*aContactStore*/ ) const - { - return EFalse; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkStoreContactStub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/CVPbkStoreContactStub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,393 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef CVPbkStoreContactStub_H -#define CVPbkStoreContactStub_H - - -// INCLUDES -#include -#include - -// CLASS DECLARATIONS - -/** - * An interface for store contacts. - * - * A store contact is a contact that includes all the fields of - * the contact. For this reason it usually contains more data compared - * to the corresponding view contact. It can contain all types of fields that - * are supported by the its parent store. - * - * The store contact can be edited if it's not read-only. The client must - * first lock the existing contact then edit it and finally commit the changes. - * - * @see MVPbkContactStore - * @see MVPbkViewContact - */ -class CVPbkStoreContactStub : public CBase, - public MVPbkStoreContact, - public MVPbkViewContact - { - public: // Destructor - CVPbkStoreContactStub() ; - - ~CVPbkStoreContactStub() { } - - public: // From MVPbkBaseContact (covariant return types) - const MVPbkStoreContactFieldCollection& Fields() const ; - - - - /** - * Returns the parent view of the contact. - * - * @return The parent view of the contact. - */ - MVPbkContactViewBase& ParentView() const ; - - /** - * Reads the whole contact from the store asynchronously. - * - * A client can use this if it has a reference of the view contact but - * it needs all the data fields instead of only those that are included - * in the view contact. - * - * The contact is returned in a call back. - * - * @param aObserver An observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - */ - void ReadL( MVPbkContactObserver& aObserver ) const ; - - /** - * Reads the whole contact and locks it for modification - * asynchronously. - * - * A client can use this if it has a reference of the view contact and - * it needs to modify the contact. - * - * The contact is returned in a call back. - * - * @param aObserver An observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if contact is read-only - */ - void ReadAndLockL( MVPbkContactObserver& aObserver ) const ; - - /** - * Returns expandable interface for this object or NULL if expanding is - * not supported. - * - * Examples are a contact group that can be expanded to its members view - * or a folding view that can be extended to its internals. Client can - * get the type of the view from MVPbkContactViewBase::Type which is useful - * for knowing the type of expansion. - * - * @return An expansion or NULL. - */ - MVPbkExpandable* Expandable() const ; - - /** - * Returns ETrue if two contacts are same. - * - * @param aOtherContact A contact to be compared. - * @param aContactStore The store of the aOtherContact. - * @return ETrue if two contacts are same. - */ - TBool IsSame( const MVPbkViewContact& aOtherContact, - const MVPbkContactStore* aContactStore ) const ; - - /** - * Returns ETrue if two contacts are same. - * - * @param aOtherContact A contact to be compared. - * @param aContactStore The store of the aOtherContact. - * @return ETrue if two contacts are same. - */ - TBool IsSame( const MVPbkStoreContact& aOtherContact, - const MVPbkContactStore* aContactStore ) const ; - - public: // New functions - - - /** - * Returns this contact's parent store. - * - * @return The parent store of the contact. - */ - MVPbkContactStore& ParentStore() const - { - MVPbkContactStore* ret=NULL; - return *ret; - }; - - /** - * Returns this contact's fields (read-write). - * - * @return A collection of contact fields. - */ - MVPbkStoreContactFieldCollection& Fields(); - - /** - * Creates a new field for this contact. - * - * The new field must be added to the contact using AddFieldL. - * - * @param aFieldType A type of the field to create. Must be found in - * ParentStore().SupportedFieldTypes(). - * @return A new field object. The returned object is left on the - * cleanup stack. - * @exception KErrNotSupported if the field type is not supported. - * @exception KErrAccessDenied if the contact can not be modified. - */ - MVPbkStoreContactField* CreateFieldLC( - const MVPbkFieldType& /*aFieldType*/) const { return NULL; }; - - /** - * Adds a new field to the contact. - * - * The field must be previously created with CreateFieldLC and - * it must NOT be used after adding. - * - * If the client needs the field after adding it must be retrieved - * using Fields(). - * - * @param aField A new field that was created using CreateFieldLC. - * This object takes ownership of the field. - * @precond aField must not be NULL or - * VPbkError::Panic(VPbkError::ENullContactField) is raised. - * @precond aField must be returned from this->CreateFieldLC or - * VPbkError::Panic(VPbkError::EInvalidContactField) panic is raised. - * @postcond this->Fields().FieldCount() == - * old(this->Fields().FieldCount()) + 1 - * @return The index of the new field in the field collection. - * @exception KErrAccessDenied if the contact can not be modified. - */ - TInt AddFieldL(MVPbkStoreContactField* /*aField*/) { return 0; }; - - /** - * Removes a field from the contact. - * - * @param aIndex A zero-based index of the field to remove. - * @precond aIndex >= 0 && aIndex < FieldCount(). - * Panics with VPbkError::EInvalidFieldIndex. - * @precond The contact is not read-only otherwise panics with - * VPbkError::EInvalidAccessToReadOnlyContact. - * @postcond this->Fields().FieldCount() == - * old(this->Fields().FieldCount()) - 1 - */ - void RemoveField(TInt /*aIndex*/) {}; - - /** - * Removes all the fields from the contact. - * - * @precond The contact is not read-only otherwise panics with - * VPbkError::EInvalidAccessToReadOnlyContact. - * @postcond this->Fields().FieldCount() = - */ - void RemoveAllFields() {}; - - /** - * Locks this contact for modification asynchronously. - * - * Once the observer is notified this contact is locked and cab - * be modified. - * - * @param aObserver The observer to call back when the operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is - * already in progress. - * @exception KErrAccessDenied if the contact can not be modified. - */ - void LockL(MVPbkContactObserver& /*aObserver*/) const {}; - - /** - * Saves the contact to its associated store asynchronously. - * - * LockL must have been called before commit if this is - * an existing contact. Otherwise ContactOperationFailed is called - * with KErrAccessDenied. - * - * @param aObserver The observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if the contact can not be modified. - */ - void CommitL(MVPbkContactObserver& /*aObserver*/) const {}; - - /** - * Returns the identifiers of the groups that the contact - * belongs to. - * - * @return The groups that this contact belongs to. - */ - MVPbkContactLinkArray* GroupsJoinedLC() const { return NULL; }; - - /** - * Returns the group interface of the store contact if this contact - * is a group. - * If this contact is not a group, NULL is returned. - * - * @return The group interface or NULL. - */ - MVPbkContactGroup* Group() { return NULL; }; - - /** - * Returns the maximum amount of fields of given type that can be - * inserted to the contact. - * - * E.g. A USIM ADN contact can have 1 or more phone numbers but there - * is a limit that the store in USIM defines. - * On the other hand the contact in the Contacts Model data base - * doesn't have limits. - * - * @param aType The field type of the field - * @return The maximum amount fields of given type in the contact - * or KVPbkStoreContactUnlimitedNumber it there is no limit - * set by the store contact - */ - TInt MaxNumberOfFieldL(const MVPbkFieldType& /*aType*/) const { return 0; }; - - /** - * Returns auxiliary properties. - * Can return NULL if underlying store doesn't support any - * of MVPbkStoreContactProperties functions. - * - * @return A properties object - */ - MVPbkStoreContactProperties* PropertiesL() const { return NULL; }; - - /** - * Set the contact as the store's current own contact asynchronously. - * - * @param aObserver The observer to call back when this operation - * completes. The observer will not be called if this - * function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrNotSupported If store does not support own contact - */ - void SetAsOwnL(MVPbkContactObserver& /*aObserver*/) const {}; - - - - /** - * Returns this contact's fields (read only). - * @return This contact's fields in read only mode. - */ - // const MVPbkBaseContactFieldCollection& Fields() const ; - - /** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ - TBool IsSame(const MVPbkBaseContact& aOtherContact) const ; - - /** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ - TBool IsSame(const MVPbkStoreContact& aOtherContact) const ; - - /** - * Returns true if this a representation of the same contact. - * - * @param aOtherContact a contact this contact is compared against. - * @return ETrue if this and aOtherContact represent the same contact. - */ - TBool IsSame(const MVPbkViewContact& aOtherContact) const ; - - /** - * Creates link representing this contact. - * - * @return A link or NULL if the contact doesn't exist in the store, - * e.g. a folding contact in the view could be that kind or - * a new contact that hasn't been committed to the store. - * NULL is not put into the CleanupStack. - */ - MVPbkContactLink* CreateLinkLC() const ; - - /** - * Deletes this contact from store asynchronously. - * - * @param aObserver The observer to call back when this operation - * completes. The observer will not be called - * if this function leaves. - * @exception KErrInUse If another asynchronous operation is already - * in progress. - * @exception KErrAccessDenied if the contact can not be modified. - */ - void DeleteL(MVPbkContactObserver& aObserver) const ; - - /** - * Returns ETrue if this view contact is from given store - * - * @param aContactStoreUri the URI of the store to compare - * @return ETrue if the view contact was from the given store - */ - TBool MatchContactStore( - const TDesC& aContactStoreUri) const ; - - /** - * Returns ETrue if this contact is from the same store - * domain as the given one. - * - * @param aContactStoreDomain the the store domain - * @return ETrue if the contact was from the same store domain. - */ - TBool MatchContactStoreDomain( - const TDesC& aContactStoreDomain) const ; - - /** - * Creates and returns a bookmark that points to the contact. - * Bookmark can be used to retrieve an index of the contact in - * the view. - * - * @return A new bookmark to the contact - */ - MVPbkContactBookmark* CreateBookmarkLC() const ; - - /** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ - MVPbkObjectHierarchy& ParentObject() const; - - }; - - -#endif // CVPbkStoreContactStub - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/pbkuistubs.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/pbkuistubs.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,367 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: -: -* -*/ - - - - - -// INCLUDES -#include "pbkuistubs.h" - - -/** - * Returns Phonebook 2 application UI interface. - * Usage: MPbk2AppUi* appUi = Phonebook2::Pbk2AppUi(); - * - * @return Phonebook 2 application UI interface. - */ -EXPORT_C MPbk2AppUi* Phonebook2::Pbk2AppUi() -{ -return NULL; -}; - -CPbk2AppUiStub::CPbk2AppUiStub(){ } - -CPbk2AppUiStub::~CPbk2AppUiStub(){ } - -/** - * Returns the currently active view. - * - * @return Active view. - */ -CPbk2AppViewBase* CPbk2AppUiStub::ActiveView() const { return NULL; } - -/** - * Returns the Phonebook 2 view explorer if it exists. - * - * @return View explorer. - */ -MPbk2ViewExplorer* CPbk2AppUiStub::Pbk2ViewExplorer() const { return NULL; } - -/** - * Returns the Phonebook 2 startup monitor. - * - * @return Startup monitor. - */ -MPbk2StartupMonitor* CPbk2AppUiStub::Pbk2StartupMonitor() const { return NULL; } - -/** - * Returns Phonebook 2 tab group container. - * - * @return Tab group container. - */ -CPbk2TabGroupContainer* CPbk2AppUiStub::TabGroups() const { return NULL; } - -/** - * Returns Phonebook 2 key event handler. - * - * @return Key event handler. - */ -MPbk2KeyEventHandler& CPbk2AppUiStub::KeyEventHandler() -{ -MPbk2KeyEventHandler* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 application services. - * - * @return Application services. - */ -MPbk2ApplicationServices& CPbk2AppUiStub::ApplicationServices() const -{ -MPbk2ApplicationServices* ret = NULL; -return *ret; -} - -/** - * Handles a command. If Phonebook 2 command handler does not - * handle a command it can then be passed to application UI - * command handler which ultimately handles it. - * For example, exit command is handled by - * application UI not by command handler. - * - * @return Id of the command to handle. - */ -void CPbk2AppUiStub::HandleCommandL( - TInt /*aCommand*/ ) { } - -/** - * Exits application. - */ -void CPbk2AppUiStub::ExitApplication() { } - -CPbk2ApplicationServicesStub::CPbk2ApplicationServicesStub(){ } - -CPbk2ApplicationServicesStub::~CPbk2ApplicationServicesStub(){ } - -/** - * Returns Virtual Phonebook contact manager. - * - * @return Virtual Phonebook contact manager. - */ -CVPbkContactManager& CPbk2ApplicationServicesStub::ContactManager() const -{ -CVPbkContactManager* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 command handler, which handles - * all the commands. - * - * @return Phonebook 2 command handler. - */ -MPbk2CommandHandler* CPbk2ApplicationServicesStub::CommandHandlerL() -{ -return NULL; -} - -/** - * Returns the name formatter object. - * - * @return Phonebook 2 name formatter. - */ -MPbk2ContactNameFormatter& CPbk2ApplicationServicesStub::NameFormatter() const -{ -MPbk2ContactNameFormatter* ret = NULL; -return *ret; -} - -/** - * Returns the sort order manager. - * - * @return Sort order manager. - */ -CPbk2SortOrderManager& CPbk2ApplicationServicesStub::SortOrderManager() const -{ -CPbk2SortOrderManager* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 global send UI. - * - * @return SendUi instance. - */ -CSendUi* CPbk2ApplicationServicesStub::SendUiL() { return NULL; } - -/** - * Returns store property array. - * - * @return Store property array. - */ -CPbk2StorePropertyArray& CPbk2ApplicationServicesStub::StoreProperties() const -{ -CPbk2StorePropertyArray* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 field properties. - * - * @return Phonebook 2 field properties. - */ -CPbk2FieldPropertyArray& CPbk2ApplicationServicesStub::FieldProperties() const -{ -CPbk2FieldPropertyArray* ret = NULL; -return *ret; -} - -/** - * Returns Phonebook 2 store configuration. - * - * @return Phonebook 2 store configuration. - */ -CPbk2StoreConfiguration& CPbk2ApplicationServicesStub::StoreConfiguration() const -{ -CPbk2StoreConfiguration* ret=NULL; -return *ret; -} - -/** - * Returns Phonebook 2 contact store observation register. - * - * @return Phonebook 2 store observation register. - */ -MPbk2StoreObservationRegister& CPbk2ApplicationServicesStub:: - StoreObservationRegister() const - { - MPbk2StoreObservationRegister* ret = NULL; - return *ret; - } - - -/** - * Returns Phonebook 2 contact store validity informer. - * - * @return Phonebook 2 store validity informer. - */ -MPbk2StoreValidityInformer& CPbk2ApplicationServicesStub:: - StoreValidityInformer() const - { - MPbk2StoreValidityInformer* ret = NULL; - return *ret; - } - -/** - * Returns Phonebook 2 view supplier. - * - * @return Phonebook 2 view supplier. - */ -MPbk2ContactViewSupplier& CPbk2ApplicationServicesStub::ViewSupplier() const -{ -MPbk2ContactViewSupplier* ret = NULL; -return *ret; -} - -/** - * Returns global menu filtering flags. - * - * @return Global menu filtering flags. - */ -TInt CPbk2ApplicationServicesStub::GlobalMenuFilteringFlagsL() const { return 0; } - -/** - * Returns service manager. - * - * @return Service manager. - */ -CPbk2ServiceManager& CPbk2ApplicationServicesStub::ServiceManager() const -{ -CPbk2ServiceManager* ret = NULL; -return *ret; -} - -CPbk2CommandHandlerStub::CPbk2CommandHandlerStub(){ } - -CPbk2CommandHandlerStub::~CPbk2CommandHandlerStub(){ } -/** - * Handles Phonebook 2 commands. - * - * @param aCommandId The id of the command to handle. - * @param aControl The UI control of the calling view. - * @param aAppView Application view from where - * the command is launched. - * @return ETrue if the command was handled, EFalse otherwise. - */ -TBool CPbk2CommandHandlerStub::HandleCommandL( - const TInt /*aCommandId*/, - MPbk2ContactUiControl& /*aControl*/, - const CPbk2AppViewBase* /*aAppView*/ ) { return EFalse; } - -/** - * Performs Phonebook 2 menu filtering. - * - * @param aResourceId Resource id of the filtered menu pane. - * @param aMenuPane Menu pane to be filtered. - * @param aViewBase Application view where the filtering - * takes place. - * @param aControl The UI control of the calling view. - */ -void CPbk2CommandHandlerStub::DynInitMenuPaneL( - TInt /*aResourceId*/, - CEikMenuPane* /*aMenuPane*/, - CPbk2AppViewBase& /*aViewBase*/, - MPbk2ContactUiControl& /*aControl*/ ) { } - -/** - * Registers (attaches) to an AIW service. - * - * @param aInterestId Id of the AIW interest. - * @param aMenuResourceId Resource id of the menu to - * attach to the AIW interest. - * @param aInterestResourceId Resource id of the AIW interest. - * @param aAttachBaseService If ETrue, attaches the AIW - * resource id to the AIW base - * service also. This enables command - * handling via AIW without menus. - */ -void CPbk2CommandHandlerStub::RegisterAiwInterestL( - const TInt /*aInterestId*/, - const TInt /*aMenuResourceId*/, - const TInt /*aInterestResourceId*/, - const TBool /*aAttachBaseService*/ ) { } - -/** - * Returns the AIW service command id associated to - * given menu command. If found, it means that there is a - * provider which can handle the menu command. - * - * @see CAiwServiceHandler::ServiceCmdByMenuCmd - * @param aMenuCmdId Menu command id to inspect. - * @return Service command id or KAiwCmdNone. - */ -TInt CPbk2CommandHandlerStub::ServiceCmdByMenuCmd( - TInt /*aMenuCmdId*/ ) const { return 0; } - -/** - * Adds the command into the Phonebook 2 command store and executes it. - * Takes the ownership of the command. - * - * @param aCommand The command to be executed. - */ -void CPbk2CommandHandlerStub::AddAndExecuteCommandL( - MPbk2Command* /*aCommand*/ ) { } - -/** - * Adds a menu command observer. - * - * @param aObserver Menu command observer to add. - */ -void CPbk2CommandHandlerStub::AddMenuCommandObserver( - MPbk2MenuCommandObserver& /*aObserver*/ ) { } - -/** - * Removes a menu command observer. - * - * @param aObserver Menu command observer to remove. - */ -void CPbk2CommandHandlerStub::RemoveMenuCommandObserver( - MPbk2MenuCommandObserver& /*aObserver*/ ) { } - -/** - * Initialises toolbar before it is drawn. - * - * @param aResourceId The resource id of the toolbar. - * @param aToolbar The toolbar object. - * @param aAppView Application view from where - * the command is launched. - * @param aControl The UI control of the calling view. - */ -void CPbk2CommandHandlerStub::DynInitToolbarL( - TInt /*aResourceId*/, - CAknToolbar* /*aToolbar*/, - const CPbk2AppViewBase& /*aAppView*/, - MPbk2ContactUiControl& /*aControl*/ ) { } - -/** - * Handles toolbar events for a certain toolbar item. - * - * @param aCommand The command id of the toolbar item. - * @param aControl The UI control of the calling view. - * @param aAppView Application view from where - * the command is launched. - */ -void CPbk2CommandHandlerStub::OfferToolbarEventL( - TInt /*aCommand*/, - MPbk2ContactUiControl& /*aControl*/, - const CPbk2AppViewBase* /*aAppView*/ ) { } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/pbkuistubs.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/pbkuistubs.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,346 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: -: -* -*/ - - - -#ifndef STUBPBK2APPUI_H -#define STUBPBK2APPUI_H - -// INCLUDES -#include -#include -#include -#include - -// CLASS DECLARATION -class CPbk2ServiceManager; - -/** - * Phonebook 2 application UI interface. - */ -class CPbk2AppUiStub : public CBase, public MPbk2AppUi - { - public: // Interface - - CPbk2AppUiStub(); - - ~CPbk2AppUiStub(); - - /** - * Returns the currently active view. - * - * @return Active view. - */ - CPbk2AppViewBase* ActiveView() const ; - - /** - * Returns the Phonebook 2 view explorer if it exists. - * - * @return View explorer. - */ - MPbk2ViewExplorer* Pbk2ViewExplorer() const ; - - /** - * Returns the Phonebook 2 startup monitor. - * - * @return Startup monitor. - */ - MPbk2StartupMonitor* Pbk2StartupMonitor() const ; - - /** - * Returns Phonebook 2 tab group container. - * - * @return Tab group container. - */ - CPbk2TabGroupContainer* TabGroups() const ; - - /** - * Returns Phonebook 2 key event handler. - * - * @return Key event handler. - */ - MPbk2KeyEventHandler& KeyEventHandler() ; - - /** - * Returns Phonebook 2 application services. - * - * @return Application services. - */ - MPbk2ApplicationServices& ApplicationServices() const ; - - /** - * Handles a command. If Phonebook 2 command handler does not - * handle a command it can then be passed to application UI - * command handler which ultimately handles it. - * For example, exit command is handled by - * application UI not by command handler. - * - * @return Id of the command to handle. - */ - void HandleCommandL( - TInt aCommand ) ; - - /** - * Exits application. - */ - void ExitApplication() ; - }; - - - -// CLASS DECLARATION - -/** - * Phonebook 2 application services interface. - * Shares commonly used objects. - */ -class CPbk2ApplicationServicesStub : public MPbk2ApplicationServices - { - public: // Interface - - CPbk2ApplicationServicesStub(); - - ~CPbk2ApplicationServicesStub(); - - /** - * Returns Virtual Phonebook contact manager. - * - * @return Virtual Phonebook contact manager. - */ - CVPbkContactManager& ContactManager() const ; - - /** - * Returns Phonebook 2 command handler, which handles - * all the commands. - * - * @return Phonebook 2 command handler. - */ - MPbk2CommandHandler* CommandHandlerL() ; - - /** - * Returns the name formatter object. - * - * @return Phonebook 2 name formatter. - */ - MPbk2ContactNameFormatter& NameFormatter() const ; - - /** - * Returns the sort order manager. - * - * @return Sort order manager. - */ - CPbk2SortOrderManager& SortOrderManager() const ; - - /** - * Returns Phonebook 2 global send UI. - * - * @return SendUi instance. - */ - CSendUi* SendUiL() ; - - /** - * Returns store property array. - * - * @return Store property array. - */ - CPbk2StorePropertyArray& StoreProperties() const ; - - /** - * Returns Phonebook 2 field properties. - * - * @return Phonebook 2 field properties. - */ - CPbk2FieldPropertyArray& FieldProperties() const ; - - /** - * Returns Phonebook 2 store configuration. - * - * @return Phonebook 2 store configuration. - */ - CPbk2StoreConfiguration& StoreConfiguration() const ; - - /** - * Returns Phonebook 2 contact store observation register. - * - * @return Phonebook 2 store observation register. - */ - MPbk2StoreObservationRegister& - StoreObservationRegister() const ; - - /** - * Returns Phonebook 2 contact store validity informer. - * - * @return Phonebook 2 store validity informer. - */ - MPbk2StoreValidityInformer& - StoreValidityInformer() const ; - - /** - * Returns Phonebook 2 view supplier. - * - * @return Phonebook 2 view supplier. - */ - MPbk2ContactViewSupplier& ViewSupplier() const ; - - /** - * Returns global menu filtering flags. - * - * @return Global menu filtering flags. - */ - TInt GlobalMenuFilteringFlagsL() const ; - - /** - * Returns service manager. - * - * @return Service manager. - */ - CPbk2ServiceManager& ServiceManager() const ; - - - }; - - -/** - * Phonebook 2 command handler interface. - */ -class CPbk2CommandHandlerStub : public MPbk2CommandHandler - { - public: // Interface - - CPbk2CommandHandlerStub(); - - ~CPbk2CommandHandlerStub(); - /** - * Handles Phonebook 2 commands. - * - * @param aCommandId The id of the command to handle. - * @param aControl The UI control of the calling view. - * @param aAppView Application view from where - * the command is launched. - * @return ETrue if the command was handled, EFalse otherwise. - */ - TBool HandleCommandL( - const TInt aCommandId, - MPbk2ContactUiControl& aControl, - const CPbk2AppViewBase* aAppView ) ; - - /** - * Performs Phonebook 2 menu filtering. - * - * @param aResourceId Resource id of the filtered menu pane. - * @param aMenuPane Menu pane to be filtered. - * @param aViewBase Application view where the filtering - * takes place. - * @param aControl The UI control of the calling view. - */ - void DynInitMenuPaneL( - TInt aResourceId, - CEikMenuPane* aMenuPane, - CPbk2AppViewBase& aViewBase, - MPbk2ContactUiControl& aControl ) ; - - /** - * Registers (attaches) to an AIW service. - * - * @param aInterestId Id of the AIW interest. - * @param aMenuResourceId Resource id of the menu to - * attach to the AIW interest. - * @param aInterestResourceId Resource id of the AIW interest. - * @param aAttachBaseService If ETrue, attaches the AIW - * resource id to the AIW base - * service also. This enables command - * handling via AIW without menus. - */ - void RegisterAiwInterestL( - const TInt aInterestId, - const TInt aMenuResourceId, - const TInt aInterestResourceId, - const TBool aAttachBaseService ) ; - - /** - * Returns the AIW service command id associated to - * given menu command. If found, it means that there is a - * provider which can handle the menu command. - * - * @see CAiwServiceHandler::ServiceCmdByMenuCmd - * @param aMenuCmdId Menu command id to inspect. - * @return Service command id or KAiwCmdNone. - */ - TInt ServiceCmdByMenuCmd( - TInt aMenuCmdId ) const ; - - /** - * Adds the command into the Phonebook 2 command store and executes it. - * Takes the ownership of the command. - * - * @param aCommand The command to be executed. - */ - void AddAndExecuteCommandL( - MPbk2Command* aCommand ) ; - - /** - * Adds a menu command observer. - * - * @param aObserver Menu command observer to add. - */ - void AddMenuCommandObserver( - MPbk2MenuCommandObserver& aObserver ) ; - - /** - * Removes a menu command observer. - * - * @param aObserver Menu command observer to remove. - */ - void RemoveMenuCommandObserver( - MPbk2MenuCommandObserver& aObserver ) ; - - /** - * Initialises toolbar before it is drawn. - * - * @param aResourceId The resource id of the toolbar. - * @param aToolbar The toolbar object. - * @param aAppView Application view from where - * the command is launched. - * @param aControl The UI control of the calling view. - */ - void DynInitToolbarL( - TInt aResourceId, - CAknToolbar* aToolbar, - const CPbk2AppViewBase& aAppView, - MPbk2ContactUiControl& aControl ) ; - - /** - * Handles toolbar events for a certain toolbar item. - * - * @param aCommand The command id of the toolbar item. - * @param aControl The UI control of the calling view. - * @param aAppView Application view from where - * the command is launched. - */ - void OfferToolbarEventL( - TInt aCommand, - MPbk2ContactUiControl& aControl, - const CPbk2AppViewBase* aAppView ) ; - - - }; - -#endif // STUBPBK2APPUI_H - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CPBK2StoreConfiguration.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CPBK2StoreConfiguration.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2005-2007 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 -#include -/** - * Creates a new instance of this class. - * - * @return A new instance of this class. - */ - EXPORT_C /*static*/ CPbk2StoreConfiguration* CPbk2StoreConfiguration::NewL() - { - CPbk2StoreConfiguration* self = new ( ELeave ) CPbk2StoreConfiguration; - return self; - } - -/** - * Destructor. - */ - CPbk2StoreConfiguration::~CPbk2StoreConfiguration(){ } - - - -/** - * Fetches an array of configured contact store URIs. - * - * @return Array of URIs that is the current configuration. - */ - CVPbkContactStoreUriArray* CPbk2StoreConfiguration::CurrentConfigurationL() const{ } - -/** - * Fetches an array of contact store URIs to be used - * in searching, for example in phone number matching. - * - * @return Array of URIs to be used for searching. - */ - CVPbkContactStoreUriArray* CPbk2StoreConfiguration::SearchStoreConfigurationL(){ } - -/** - * Fetches an array of supported contact stores URIs. - * NOTE: All returned stores are not necessarily supported by - * the current HW / SW configuration of the phone. - * - * @return Array of URIs that is the supported store configuration. - */ - CVPbkContactStoreUriArray* CPbk2StoreConfiguration::SupportedStoreConfigurationL() const{ } - -/** - * Returns the URI of the default store for saving contacts. - * - * @return URI of the default store. - */ - TVPbkContactStoreUriPtr CPbk2StoreConfiguration::DefaultSavingStoreL() const{ } - -/** - * Adds a new contact store URI to current configuration. - * Then use AddSupportedContactStoreUriL to add the store to - * supported configuration if desired. - * - * @param aURI The URI to add. - */ - void CPbk2StoreConfiguration::AddContactStoreURIL( - TVPbkContactStoreUriPtr aURI ){ } - -/** - * Removes a contact store URI from current configuration. - * Then use RemoveSupportedContactStoreUriL to remove the store from - * supported configuration if desired. - * - * @param aURI The URI to remove. - */ - void CPbk2StoreConfiguration::RemoveContactStoreURIL( - TVPbkContactStoreUriPtr aURI ){ } - -/** - * Adds a new configuration observer. - * - * @param aObserver The observer to add. - */ - void CPbk2StoreConfiguration::AddObserverL( - MPbk2StoreConfigurationObserver& aObserver ){ } - -/** - * Removes a configuration observer. - * - * @param aObserver The observer to remove. - */ - void CPbk2StoreConfiguration::RemoveObserver( - MPbk2StoreConfigurationObserver& aObserver ){ } - -/** - * Adds a default saving store observer. - * - * @param aObserver The observer to add. - */ - void CPbk2StoreConfiguration::AddDefaultSavingStoreObserverL( - MPbk2DefaultSavingStoreObserver& aObserver ){ } - -/** - * Removes a default saving store observer. - * - * @param aObserver The observer to remove. - */ - void CPbk2StoreConfiguration::RemoveDefaultSavingStoreObserver( - MPbk2DefaultSavingStoreObserver& aObserver ){ } - -/** - * Adds a new contact store URI to supported configuration. - * Use AddContactStoreURIL to add the store to current - * configuration if desired. - * - * @param aURI The URI to add. - */ - void CPbk2StoreConfiguration::AddSupportedContactStoreURIL( - TVPbkContactStoreUriPtr aURI ){ } - -/** - * Removes a contact store URI from supported configuration. - * Use RemoveContactStoreUriL to remove the store from - * current configuration if desired. - * - * @param aURI The URI to remove. - */ - void CPbk2StoreConfiguration::RemoveSupportedContactStoreURIL( - TVPbkContactStoreUriPtr aURI ){ } - - - CPbk2StoreConfiguration::CPbk2StoreConfiguration(){ } -void CPbk2StoreConfiguration::ConstructL(){ } - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CPbk2SortOrderManager.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CPbk2SortOrderManager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2005-2007 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 FILES -#include - - -/** - * Creates a new instance of this class. - * - * @param aMasterFieldTypeList Master field type list. - * Can be retrieved from Virtual - * Phonebook contact manager. - * @param aFs A file system session - * reference for resource file - * handling. If NULL then - * an own session is created. - * @return A new instance of this class. - */ -EXPORT_C CPbk2SortOrderManager* CPbk2SortOrderManager::NewL( - const MVPbkFieldTypeList& /*aMasterFieldTypeList*/, - RFs* /*aFs = NULL*/ ) - { - return new (ELeave) CPbk2SortOrderManager; - } - -/** - * Destructor. - */ -CPbk2SortOrderManager::~CPbk2SortOrderManager(){ } - -/** - * Sets the contact view that this manager manages. - * Takes in use the sort order from the given view. - * - * @param aContactView The contact view to manage. - */ -EXPORT_C void CPbk2SortOrderManager::SetContactViewL( - MVPbkContactViewBase& /*aContactView*/ ){ } - -/** - * Adds an observer. - * - * @param aObserver The observer to add. - */ -EXPORT_C void CPbk2SortOrderManager::AddObserverL( - MPbk2SortOrderObserver& /*aObserver*/ ){ } - -/** - * Removes an observer. - * - * @param aObserver The observer to remove. - */ -EXPORT_C void CPbk2SortOrderManager::RemoveObserver( - MPbk2SortOrderObserver& /*aObserver*/ ){ } - -/** - * Sets the name displaying order for the managed contact view. - * - * @param aNameDisplayOrder New name display order for - * the managed contact view. - * @param aSeparator Custom separator to be used between - * lastname and firstname if it exists. - * If KNullDesC is given, space is used - * as separator. - */ -EXPORT_C void CPbk2SortOrderManager::SetNameDisplayOrderL( - TPbk2NameDisplayOrder /*aNameDisplayOrder*/, - const TDesC& /*aSeparator = KNullDesC*/ ) -{ - -} - -/** - * Returns the current name display order. - * - * @return Current name display order. - */ -EXPORT_C CPbk2SortOrderManager::TPbk2NameDisplayOrder CPbk2SortOrderManager::NameDisplayOrder() const -{ - -return EPbk2NameDisplayOrderLastNameFirstName; -} - -/** - * Returns the current sort order. - * - * @return Current sort order. - */ -EXPORT_C const MVPbkFieldTypeList& CPbk2SortOrderManager::SortOrder() const -{ -MVPbkFieldTypeList* ret = NULL; -return *ret; -} - -/** - * Returns the language specific default separator. - * This can not be changed run time. - * - * @return the language specific default separator. - */ -EXPORT_C const TDesC& CPbk2SortOrderManager::DefaultSeparator(){ return KNullDesC(); } - -/** - * Returns the current separator. This the separator that - * can be changed run time and saved to Central Repository. - * - * @return A current separator. - */ -EXPORT_C const TDesC& CPbk2SortOrderManager::CurrentSeparator() const{ return KNullDesC(); } - - -void CPbk2SortOrderManager::ConstructL( - const MVPbkFieldTypeList& /*aMasterFieldTypeList*/, - RFs* /*aFs*/ ){ } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkBaseContactFieldCollection.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkBaseContactFieldCollection.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - - -// INCLUDES -#include "s_cVPbkBaseContactFieldCollection.h" -#include "s_CVPbkStoreContactField.h" - -TInt gGiveFieldCount = 0; -CVPbkStoreContactFieldStub gField0(0); -CVPbkStoreContactFieldStub gField1(1); -CVPbkStoreContactFieldStub gField2(2); -CVPbkStoreContactFieldStub gJunkField(-1); - - -CVPbkBaseContactFieldCollectionStub::CVPbkBaseContactFieldCollectionStub(){} - -/** - * Destructor. - */ -CVPbkBaseContactFieldCollectionStub::~CVPbkBaseContactFieldCollectionStub(){} - - - const MVPbkStoreContactField& CVPbkBaseContactFieldCollectionStub::FieldAt(TInt /*aIndex*/) const - { - MVPbkStoreContactField* ret = NULL; - return *ret; - } - - -/** - * Returns a field in this collection. - * - * @param aIndex A zero-based index of the field to return. - * @return A reference to the field at aIndex. Reference is valid until - * FieldAt is called again. If you need a permanent copy, - * call MVPbkStoreContactField::CloneLC to the returned - * field. - * @see MVPbkStoreContactField::CloneLC - * @precond aIndex >= 0 && aIndex < FieldCount() - * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised - * if the precondition does not hold. - */ -MVPbkStoreContactField& CVPbkBaseContactFieldCollectionStub::FieldAt( TInt aIndex ) - { - if (aIndex == 0) - { - return gField0; - } - - if (aIndex == 1) - { - return gField1; - } - - if (aIndex == 2) - { - return gField2; - } - - return gJunkField; - } - -/** - * Returns a copy of the field in this collection. - * - * Client gets the ownership of the field. - * - * @param aIndex A zero-based index of the field to return. - * @return A new instance to the field at aIndex. The field is valid - * as long as the parent contact is valid - * @precond aIndex >= 0 && aIndex < FieldCount() - * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised - * if the precondition does not hold. - */ -MVPbkStoreContactField* CVPbkBaseContactFieldCollectionStub::FieldAtLC( TInt /*aIndex*/ ) const { return NULL; } - -/** - * Returns the parent contact of the field collection - * - * @return the parent contact of the field collection - */ -MVPbkStoreContact& CVPbkBaseContactFieldCollectionStub::ParentStoreContact() const -{ -MVPbkStoreContact* ret = NULL; -return *ret; -} - -/** - * Returns a field in this collection identified by a contact field - * link. - * - * A contact field link can be created using the MVPbkStoreContactField - * interface. The same link works then as a contact link and - * a field link. - * - * NOTE: implementations of stores are possibly using an index - * of the field as an identifier so clients should prefer not - * to save field links permanently. E.g modifying the contact - * can invalidate the link in some store implementations. - * A field link is practical in use cases where the link is - * created and immediately given to another component. - * - * @param aContactLink A valid contact field link. - * @return A field in this collection identified by aContactLink or NULL - * if the link does not contain field information or if the - * link does not refer to the parent contact of this field collection. - */ -MVPbkStoreContactField* CVPbkBaseContactFieldCollectionStub::RetrieveField( - const MVPbkContactLink& /*aContactLink*/ ) const { return NULL; } - - - -/** - * Returns the parent contact of this field set. - * @return The parent contact of this field set. - */ -MVPbkBaseContact& CVPbkBaseContactFieldCollectionStub::ParentContact() const -{ -MVPbkBaseContact* ret=NULL; -return *ret; -} - -/** - * Returns the number of fields in this collection. - * @return The number of fields in this collection. - */ -TInt CVPbkBaseContactFieldCollectionStub::FieldCount() const { return gGiveFieldCount; } - -/** - * Returns a read-only field in this collection. - * - * @param aIndex Zero-based index of the field to return. - * @return Reference to a field at aIndex. Reference is - * valid until FieldAt is called again. - * @see MVPbkBaseContactFieldCollection::ConstFieldAt - * @precond aIndex >= 0 && aIndex < FieldCount() - * Panic VPbkError::EInvalidFieldIndex is raised if the - * precondition does not hold. - */ -//const MVPbkBaseContactField& CVPbkBaseContactFieldCollectionStub::FieldAt( - // TInt aIndex) const { } -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactLinkArray.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactLinkArray.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,202 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - - -// INCLUDES -#include -/** - * Creates an empty link array. - * - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewL(){ return new (ELeave) CVPbkContactLinkArray; } - -/** - * Creates an empty link array. Leaves the created array object on - * the cleanup stack. - * - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC() -{ -CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; -CleanupStack::PushL(self); -return self; -} - -/** - * Creates a link array from a packed descriptor of links. - * - * @param aPackedLinks a buffer that was created using PackLC - * of MVPbkContactLinkArray or MVPbkContactLink - * @param aStoreList the list of stores that contain the - * stores that links belong. - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC( - const TDesC8& /*aPackedLinks*/, - const MVPbkContactStoreList& /*aStoreList*/) - { - CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; - CleanupStack::PushL(self); - return self; - } - -/** - * Creates a link array from a stream of links. - * - * @param aStream a stream of contact link that was created - * using MVPbkStreamable interface of - * MVPbkContactLink - * @param aStoreList the list of stores that contain the - * stores that links belong. - * @return A new instance of this class - */ -EXPORT_C CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC( - RReadStream& /*aStream*/, - const MVPbkContactStoreList& /*aStoreList*/) - { - CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; - CleanupStack::PushL(self); - return self; - } - -/** - * Creates a link array from a stream of links. Uses aLoader - * to find and load stores. - * aLoader must exist the life time of this object. - * - * @param aStream a stream of contact link that was created - * using MVPbkStreamable interface of - * MVPbkContactLink - * @param aLoader the contact store loader for internalization. - * @return A new instance of this class - */ - CVPbkContactLinkArray* CVPbkContactLinkArray::NewLC( - RReadStream& /*aStream*/, - MVPbkContactStoreLoader& /*aLoader*/ ) - { - CVPbkContactLinkArray* self = new (ELeave) CVPbkContactLinkArray; - CleanupStack::PushL(self); - return self; - } - -/** - * Destructor. - */ -CVPbkContactLinkArray::~CVPbkContactLinkArray(){ } - - -/** - * Appends a link to this array. - * - * @param aLink the link object to append. This array takes ownership - * of the link if append is succesful. - * @pre aLink != NULL - * @post Array count is increased by one and the link is in the last - * element of the array. - */ -EXPORT_C void CVPbkContactLinkArray::AppendL(MVPbkContactLink* /*aLink*/){ } - -/** - * Inserts a link to this array. - * - * @param aLink the link object to insert. This array takes ownership - * of the link if insertion is succesful. - * @param aIndex position where to insert the link. - * @exception KErrNoMemory if out of memory. - * @pre aLink != NULL - * @pre aIndex >= 0 && aIndex <= Count() - * @post Array count is increased by one and the link is in the position - * marked by the aIndex element of the array. - */ -EXPORT_C void CVPbkContactLinkArray::InsertL(MVPbkContactLink* /*aLink*/, TInt /*aIndex*/){ } - -/** - * Removes a link at aIndex from this array. - * - * @pre aIndex >= 0 && aIndex <= Count() - * @post The array count is decreased by one. - */ -EXPORT_C void CVPbkContactLinkArray::Remove(TInt /*aIndex*/){ } - -/** - * Removes and deletes a link at aIndex from this array. - * - * @pre aIndex >= 0 && aIndex <= Count() - * @post The array count is decreased by one. - */ -EXPORT_C void CVPbkContactLinkArray::Delete(TInt /*aIndex*/){ } - -/** - * Resets the array and destroys the links - */ -EXPORT_C void CVPbkContactLinkArray::ResetAndDestroy(){ } - -/** - * Resets this array but doesn't destroy links - * - * @post Count() == 0 - */ -EXPORT_C void CVPbkContactLinkArray::Reset(){ } - -/** - * Returns the size of the packed link array - */ -EXPORT_C TInt CVPbkContactLinkArray::PackedBufferSize() const{ return 0; } - - -TInt CVPbkContactLinkArray::Count() const{ return 0; } -const MVPbkContactLink& CVPbkContactLinkArray::At(TInt /*aIndex*/) const - { - MVPbkContactLink* ret = NULL; - return *ret; - } - -TInt CVPbkContactLinkArray::Find(const MVPbkContactLink& /*aLink*/) const{ return 0; } -HBufC8* CVPbkContactLinkArray::PackLC() const -{ - HBufC8* temp = HBufC8::NewLC( 10 ); - //CleanupStack::PushL( temp ); - return temp; -} -const MVPbkStreamable* CVPbkContactLinkArray::Streamable() const -{ -return NULL; -} - - -CVPbkContactLinkArray::CVPbkContactLinkArray(){ } -void CVPbkContactLinkArray::ConstructL(){ } -void CVPbkContactLinkArray::ConstructL(const TDesC8& /*aPackedLinks*/, - const MVPbkContactStoreList& /*aOperations*/){ } -void CVPbkContactLinkArray::ConstructL(RReadStream& /*aStream*/, - const MVPbkContactStoreList& /*aOperations*/){ } -TInt CVPbkContactLinkArray::DoCalculatePackedBufferSizeV2() const{ return 0; } -void CVPbkContactLinkArray::DoFillPackedBufferV2L(RWriteStream& /*aWriteStream*/) const{ } -void CVPbkContactLinkArray::InternalizeFromBufferL( RReadStream& /*aReadStream*/, - const MVPbkContactStoreList& /*aStoreList*/ ){ } -void CVPbkContactLinkArray::DoInternalizeFromBufferL( RReadStream& /*aReadStream*/, - const MVPbkContactStoreList& /*aStoreList*/){ } -void CVPbkContactLinkArray::DoInternalizeFromBufferV2L(RReadStream& /*aReadStream*/, - const MVPbkContactStoreList& /*aStoreList*/){ } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactManager.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactManager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,380 +0,0 @@ -/* -* Copyright (c) 2002-2007 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 - -#include "CVPbkContactOperationBaseStub.h" -#include "s_CVPbkContactStoreList.h" - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook Contact Manager. Contact Manager is the root access point - * to Virtual Phonebook engine functionality. The client can specify the list - * of stores in the constructor he/she is interested in or load additional - * plug-ins later on. In addition to loading the implementing plug-ins the - * client must open the stores. Clients should share the contact manager - * instance within their context, otherwise e.g. field types from two - * different instances will not produce the matches as the matching is - * based on pointer comparison. - * - * Examples of absolute URI stores: - * Default contact database: "cntdb://contacts.cdb" - * LDAP store: "ldap://www.telnumbers.com/" - * The URI scheme name is used to resolve a store capable of supporting - * this type of store. The actual store implementations are ECom plugins. - * - * @lib VPbkEng.lib - */ - -TSecurityInfo gTSecurityInfo; -CVPbkContactOperationBaseStub* gOperationStub; -CVPbkContactStoreListStub gStoreList; - -/** - * Creates a contact manager instance and loads the plug-ins that can - * handle the stores corresponding to the aURIList. - * @param aURIList Universal Resource Identifier list of the stores - * to be loaded initially. - * @param aFs File system handle. NULL opens a new connection. - * @return Contact manager instance. - */ -EXPORT_C CVPbkContactManager* CVPbkContactManager::NewL( - const CVPbkContactStoreUriArray& /*aURIList*/, - RFs* aFs /*= NULL*/) - { - return new( ELeave ) CVPbkContactManager( gTSecurityInfo, aFs); - } - -/** - * Creates a contact manager instance and loads the plug-ins that can - * handle the stores corresponding to the aURIList. - * @param aSecurityInfo Security info from caller to be passed for stores. - * Stores can check security info and deside - * if client can use service. - * @param aURIList Universal Resource Identifier list of the stores - * to be loaded initially. - * @param aFs File system handle. NULL opens a new connection. - * @return Contact manager instance. - */ -EXPORT_C CVPbkContactManager* CVPbkContactManager::NewL( - TSecurityInfo aSecurityInfo, - const CVPbkContactStoreUriArray& /*aURIList*/, - RFs* aFs /*= NULL*/) - { - return new( ELeave ) CVPbkContactManager( aSecurityInfo, aFs); - } - -/** - * Destructor. - */ -CVPbkContactManager::~CVPbkContactManager(){ } - - -/** - * The contact manager owns a master list of field types that clients - * use. The store implementation then maps their native types - * to Virtual Phonebook types. Clients don't create field type objects - * themselves but use always references to types offered - * by this function. - * - * @return The global list of field types. - */ -EXPORT_C const MVPbkFieldTypeList& CVPbkContactManager::FieldTypes() const - { - MVPbkFieldTypeList* retValue = NULL; - return *retValue; - - } - -/** - * The contact store list is used to handle a set of stores. - * After creation of manager the client can use the list to open - * all stores. - * - * @return The list of available contact stores. - */ -EXPORT_C MVPbkContactStoreList& CVPbkContactManager::ContactStoresL(){ return gStoreList; } - -/** - * Loads a store plug-in for given URI and adds aURI - * to the list of stores handled by this manager. - * If there is no store plug-in for the aURI then nothing changes. - * - * @param aURI the store URI to be loaded. - */ -EXPORT_C void CVPbkContactManager::LoadContactStoreL(const TVPbkContactStoreUriPtr& /*aURI*/){ } - -/** - * Attribute manager is used for handling contact attributes like - * speed dialing or defaults. - * - * @returns The contact attribute manager. - */ -EXPORT_C MVPbkContactAttributeManager& CVPbkContactManager::ContactAttributeManagerL() - { - MVPbkContactAttributeManager* ret = NULL; - return *ret; - } - -/** - * Creates a new contact view specified by the view definition. - * The view can not be used before it has notified the observer - * that it is ready. - * - * @param aObserver the observer for view events. - * @param aViewDefinition Definition of the view to create - * @param aSortOrder a list of field types that defines fields - * that are used in sorting. View contacts - * have these fields. However, the store can have restrictions - * for types that can be used in the sort order. - * The sort order has no effect for shared views that have - * already been created. - * - * @see CVPbkSortOrder - * @return Newly created view. - * If NULL CleanupStack pop is still needed - */ -EXPORT_C MVPbkContactViewBase* CVPbkContactManager::CreateContactViewLC( - MVPbkContactViewObserver& /*aObserver*/, - const CVPbkContactViewDefinition& /*aViewDefinition*/, - const MVPbkFieldTypeList& /*aSortOrder*/) const - { - return NULL; - } - -/** - * Retrieves asynchronously a contact that is individualized by - * a contact link. Delete the operation for canceling. - * - * @param aLink a link to the contact - * @param aObserver operation observer - * @return New handle to the operation - * @Asynchronous - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::RetrieveContactL( - const MVPbkContactLink& /*aLink*/, - MVPbkSingleContactOperationObserver& /*aObserver*/) const - { - gOperationStub = new( ELeave ) CVPbkContactOperationBaseStub(); - return gOperationStub; - } - -/** - * Creates an array of links corresponding to a packaged link or links. - * Packed links have been obtained by packing a link or a link array - * and they can be used for example for IPC but not for saving links. - * Loads the store plug-ins that are capable of creating the - * appropriate links. - * - * @param aPackedLinks packed links - * @return A link array. - * @see MVPbkContactLink::PackLC - * @see MVPbkContactLinkArray::PackLC - */ -EXPORT_C MVPbkContactLinkArray* CVPbkContactManager::CreateLinksLC( - const TDesC8& /*aPackedLinks*/) const{ return NULL; } - -/** - * Internalizes a permanent link or links. An externalized link - * has been created using MVPbkStreamable interface from - * MVPbkContactLink. - * Loads the store plug-ins that are capable of creating the - * appropriate links. - * - * @param aStream a stream that contains a link or links. - * @return A link array - * @see MVPbkContactLink::Streamable - */ -EXPORT_C MVPbkContactLinkArray* CVPbkContactManager::CreateLinksLC( - RReadStream& /*aStream*/) const{ return NULL; } - -/** - * Deletes contacts defined in link array asynchronously. - * - * @param aContactLinks Contacts to delete - * @param aObserver Operation observer - * @return New handle to the operation - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::DeleteContactsL( - const MVPbkContactLinkArray& /*aContactLinks*/, - MVPbkBatchOperationObserver& /*aObserver*/){ return NULL; } - -/** - * Commits all contacts in aContacts asynchronously. - * - * @see MVPbkStoreContact::CommitL - * @param aContacts Contacts to commit. - * @param aObserver Operation observer. - * @return New handle to the operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::CommitContactsL( - const TArray& /*aContacts*/, - MVPbkBatchOperationObserver& /*aObserver*/){ return NULL; } - -/** - * Copies all contacts in aContactLinks to aTargetStore asynchronously. - * If aTargetStore is NULL, contacts are copied to the store where - * they already are, ie. the contacts are duplicated. - * - * @param aContactLinks Array of contact links to duplicate. - * @param aTargetStore Target store to copy contacts to. - * If NULL this behaves like duplicate. - * @param aObserver Observer for the copying process. - * @return New handle to the operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::CopyContactsL( - const MVPbkContactLinkArray& /*aContactLinks*/, - MVPbkContactStore* /*aTargetStore*/, - MVPbkBatchOperationObserver& /*aObserver*/){ return NULL; } - -/** - * Searches the contact stores for a phone number using - * defined amount of digits from the end of the number asynchronously. - * The store implementations determine, which field types are included - * in the search. - * - * @param aPhoneNumber Phone number to search for. - * @param aMaxMatchDigits Maximum number of digits to match - * from the end of the number. - * @param aObserver Observer for the find process. - * @return New handle to the find operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::MatchPhoneNumberL( - const TDesC& /*aPhoneNumber*/, - TInt /*aMaxMatchDigits*/, - MVPbkContactFindObserver& /*aObserver*/){ return NULL; } - -/** - * Searches the contact stores for a contact that contains - * the given string in one of the field defined by given - * field type list asynchronously. - * NOTE: In some cases the find matches also other fields than - * those specified in aFieldTypes. Always loop through the - * results to check match in the required fields. - * - * @param aSearchString String to search for. - * @param aFieldTypes List of field types that the search will include. - * a field type list: use CVPbkFieldTypeRefsList and - * append the types that are needed from - * the master field type list (FieldTypes()) - * to the reference list. Selection can be done - * in a dynamic way using CVPbkFieldTypeSelector or - * static way using resource ids of the field types. - * @param aObserver Observer for the find process. - * @return New handle to the find operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::FindL( - const TDesC& /*aSearchString*/, - const MVPbkFieldTypeList& /*aFieldTypes*/, - MVPbkContactFindObserver& /*aObserver*/){ return NULL; } - -/** - * Finds a string containing text that is stored in one or more - * fields asynchronously. Client can give multiple find words. - * All the words must match to separated data. E.g. if there are - * two find words: "Jo" and "Jo" then field data "John Johnson" - * matches but "John Doe" doesn't if the word parser uses - * white space as a word separator. - * - * NOTE: The accuracy of the results depends on the implementation - * of the store to carry out the find operation. The performance - * can also vary depending on the store. - * - * @param aSearchStrings strings that are compared to field data. - * @param aFieldTypes types of the fields that are used. Constructing - * a fieldtype list: use CVPbkFieldTypeRefsList and - * append the types that are needed from - * the master fieldtype list (FieldTypes()) - * to the reference list. Selection can be done - * in a dynamic way using CVPbkFieldTypeSelector or - * static way using resource ids of the fieldtypes. - * - * @param aObserver an observer for asynchronous operation. - * @param aWordParserCallBack a client implementation of word parser - * function that separates the field data - * into words. Parameter to function is - * TVPbkWordParserParam. - * @return New handle to the find operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::FindL( - const MDesC16Array& /*aSearchStrings*/, - const MVPbkFieldTypeList& /*aFieldTypes*/, - MVPbkContactFindFromStoresObserver& /*aObserver*/, - const TCallBack& /*aWordParserCallBack*/ ){ return NULL; } - -/** - * Compresses all stores asynchronously. - * NOTE: Not all stores are able to implement compression to their - * repositories. - * - * @param aObserver Operation observer. - * @return New handle to the operation. - */ -EXPORT_C MVPbkContactOperationBase* CVPbkContactManager::CompressStoresL( - MVPbkBatchOperationObserver& /*aObserver*/){ return NULL; } - -/** - * Returns the file server session of the contact manager. - * - * @return File server session of the contact manager. - */ -EXPORT_C RFs& CVPbkContactManager::FsSession() - { - RFs* rfs = NULL; - return *rfs; - } - - -CVPbkContactManager::CVPbkContactManager( TSecurityInfo /*aSecurityInfo*/, RFs* /*aFs*/ ) - { - - } - - -void CVPbkContactManager::ConstructL(const CVPbkContactStoreUriArray& /*aURIList*/) - { - - } - - -MVPbkContactStore* CVPbkContactManager::FindStore(const TVPbkContactStoreUriPtr& /*aURI*/) const - { - return NULL; - } - - -MVPbkContactViewBase* CVPbkContactManager::CreateOptimizedCompositeViewLC( - MVPbkContactViewObserver& /*aObserver*/, - const CVPbkContactViewDefinition& /*aViewDefinition*/, - const MVPbkFieldTypeList& /*aSortOrder*/) const - { - return NULL; - } - -MVPbkContactViewBase* CVPbkContactManager::CreateCompositeViewLC( - MVPbkContactViewObserver& /*aObserver*/, - const CVPbkContactViewDefinition& /*aViewDefinition*/, - const MVPbkFieldTypeList& /*aSortOrder*/) const -{ -return NULL; -} - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactOperationBase.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactOperationBase.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef STUBVPBKCONTACTOPERATIONBASE_H -#define STUBVPBKCONTACTOPERATIONBASE_H - -// INCLUDES -#include -#include - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook abtract asynchronous contact operation. - * This interface is used as a handle to asynchronous contact operations. - * Clients should keep a reference to the handle during the asynchronous - * operation to be able to delete and cancel the operation before it - * completes. - */ -class CVPbkContactOperationBaseStub : public CBase, public MVPbkContactOperationBase - { - public: // Interface - /** - * Destructor. Cancels this operation and releases any - * resources held by it. - */ - ~CVPbkContactOperationBaseStub() {} - - CVPbkContactOperationBaseStub() - { - - } - - - }; - -#endif // STUBVPBKCONTACTOPERATIONBASE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactStoreList.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactStoreList.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,388 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - - -// INCLUDES -#include -#include "s_CVPbkContactStoreList.h" -#include "CVPbkStoreContactStub.h" -#include "s_CVPbkContactView.h" - -CVPbkContactStoreStub gLocalStore; -CVPbkContactStoreStub gXSPStore; - -// FORWARD DECLARATIONS - -/** - * Returns fixed properties of this contact store. - * - * Fixed properties do not change when the store is open. - * The store must be opened before retrieving the properties. - * - * @return Store properties. - */ -const MVPbkContactStoreProperties& CVPbkContactStoreStub::StoreProperties() const -{ -MVPbkContactStoreProperties* ret = NULL; -return *ret; -} - -/** - * Opens this contact store asynchronously. - * - * Calls back the observer when the opening completes. Notice - * that the same store instance can be opened by several observers. - * - * @param aObserver An observer for the store. - * @exception KErrInUse If another asynchronous operation - * is already in progress. - */ -void CVPbkContactStoreStub::OpenL( - MVPbkContactStoreObserver& /*aObserver*/ ) { } - -/** - * Replaces an existing store and opens it asynchronously. - * - * E.g. If the database is a file then this replaces the database if - * it's not locked by other clients. If the store - * implementation can not implment replacing then this behaves - * like OpenL. - * - * If the store does not exist, it is created if possible. - * Calls back the observer when the opening completes. - * - * @param aObserver An observer for the store. - */ -void CVPbkContactStoreStub::ReplaceL( - MVPbkContactStoreObserver& /*aObserver*/ ) { } - -/** - * Closes this contact store from a single observer. - * - * This can be always called safely even if OpenL or ReplaceL - * hasn't been called. - * If the client calls OpenL it must also call this after usage, - * The observer will no longer receive events from this store. - * If there are other observers for the store then the store - * will remain open for them. - * - * @param aObserver An observer that was given in OpenL or ReplaceL. - */ -void CVPbkContactStoreStub::Close( - MVPbkContactStoreObserver& /*aObserver*/ ) { } - -/** - * Creates a new contact associated to this store. - * - * The contact can be edited and then it must be committed by - * calling MVPbkStoreContact::CommitL for actually saving - * it to the store. - * - * @return A new contact associated to this store. Caller takes - * ownership of the returned contact. - * @see MVPbkStoreContact - * @see MVPbkStoreContact::CommitL - */ -MVPbkStoreContact* CVPbkContactStoreStub::CreateNewContactLC() -{ -return new (ELeave) CVPbkStoreContactStub; -} - -/** - * Creates a new contact group associated to this store. - * - * MVPbkContactStoreProperties::SupportsContactGroups must be - * true if this is used. - * The contact group might be saved to the store immeadiately - * depending on the store implementation. - * It is left open for editing. Use CommitL to commit - * the creation of the group and its content. - * - * @return A new contact group associated to this store. Caller takes - * the ownership of the returned contact group. - * @exception KErrNotSupported if the store doesn't support groups. - * Client should check store properties before - * calling this. - * @see MVPbkContactStoreProperties - * @see MVPbkContactGroup - * @see MVPbkStoreContact - * @see MVPbkStoreContact::CommitL - */ -MVPbkContactGroup* CVPbkContactStoreStub::CreateNewContactGroupLC() { return NULL; } - -/** - * Creates a new contact view from the store asynchronously. - * - * Client gets the ownership of the view. The content of - * the view depends on the CVPbkContactViewDefinition. The - * client must wait the observer event before using the view. - * - * @param aViewDefinition Defines the properties of the new view. - * @param aObserver An observer for the view events. - * @param aSortOrder Field types that are used in the view contact - * in the same order as in this list. Notice that - * stores may not support all possible field types - * in a view contact. The implementation - * of the view contact must have as many fields as - * the sort order. If the store doesn't support the - * field type in a view contact then it sets empty - * data to the field. - * @return A new contact view object. Caller takes ownership of the - * returned contact. - * @see MVPbkContactView - * @see CVPbkContactViewDefinition - */ -MVPbkContactView* CVPbkContactStoreStub::CreateViewLC( - const CVPbkContactViewDefinition& /*aViewDefinition*/, - MVPbkContactViewObserver& /*aObserver*/, - const MVPbkFieldTypeList& /*aSortOrder*/ ) - { - CVPbkContactViewStub* some = new (ELeave) CVPbkContactViewStub; - CleanupStack::PushL(some); - return some; - } - -/** - * Returns contact groups contained in this store. - * - * MVPbkContactStoreProperties::SupportsContactGroups must be - * true if this is used. Implementation should return an empty - * link array and not NULL. - * - * @return Contact group identifiers contained in this store. - */ -MVPbkContactLinkArray* CVPbkContactStoreStub::ContactGroupsLC() const { return NULL; } - -/** - * Returns a contact store information. Information can vary - * runtime. - * - * @return Contact store information. - */ -const MVPbkContactStoreInfo& CVPbkContactStoreStub::StoreInfo() const -{ -MVPbkContactStoreInfo* ret = NULL; -return *ret; -} - -/** - * This is part of Virtual Phonebook internal framefork and not - * usable for clients. Clients use CVPbkContactManager - * for creating links from a stream. - * - * Creates a link array from a stream. Stream contains the internals - * of the contact link. Internals are the contact store implementation - * specific part of the package format. - * - * NOTE: this must work wheter the OpenL has been called or not. This - * means that a link can not contain any data that would need - * an open store before internalizing. - * - * @param aStream A stream containing the link internals. - * @return A new contact link. - * @internal - */ -MVPbkContactLink* CVPbkContactStoreStub::CreateLinkFromInternalsLC( - RReadStream& /*aStream*/ ) const { return NULL; } - -/** -* Returns own contact link asynchronously. -* -* @params aObserver Operation observer -* @return operation handle -* @Asynchronous -*/ -MVPbkContactOperationBase* CVPbkContactStoreStub::OwnContactLinkL( - MVPbkSingleContactLinkOperationObserver& /*aObserver*/) const { return NULL; } - - -/** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ -MVPbkObjectHierarchy& CVPbkContactStoreStub::ParentObject() const -{ -MVPbkObjectHierarchy* ret=NULL; -return *ret; -} - - -/** - * Creates an operation for contact retrieval. - * - * @param aLink A link to the contact - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL if the factory - * doesn't have reference to the store of the link. - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateContactRetrieverL( - const MVPbkContactLink& /*aLink*/, - MVPbkSingleContactOperationObserver& /*aObserver*/) { return NULL; } - -/** - * Creates an operation for deleting multiple contacts. - * - * @param aContactLinks An array of contact links that specify - * the contacts. - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateDeleteContactsOperationL( - const MVPbkContactLinkArray& /*aContactLinks*/, - MVPbkBatchOperationObserver& /*aObserver*/ ) { return NULL; } - -/** - * Creates an operation for committing multiple contacts. - * - * @param aContacts An array of contact links that specify - * the contacts - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateCommitContactsOperationL( - const TArray& /*aContacts*/, - MVPbkBatchOperationObserver& /*aObserver*/) { return NULL; } - -/** - * Creates an operation for asynchronous phone number matching. - * - * @param aPhoneNumber A phone number to search for. - * @param aMaxMatchDigits Maximum number of digits to match from - * the end of the number. - * @param aObserver Observer for the find process. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateMatchPhoneNumberOperationL( - const TDesC& /*aPhoneNumber*/, - TInt /*aMaxMatchDigits*/, - MVPbkContactFindObserver& /*aObserver*/) { return NULL; } - -/** - * Creates an operation for asynchronous contact finding. - * - * @param aSearchString String to search for. - * @param aFieldTypes List of field types that the search will include. - * @param aObserver Observer for the find process. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateFindOperationL( - const TDesC& /*aSearchString*/, - const MVPbkFieldTypeList& /*aFieldTypes*/, - MVPbkContactFindObserver& /*aObserver*/) { return NULL; } - -/** - * Creates an operation for asynchronous contact finding. - * Finds a string containing text that is stored in one or more fields. - * Client can give multiple find words. All the words must match to separated - * data. E.g if there are two find words: "Jo" and "Jo" then field data - * "John Johnson" matches but "John Doe" doesn't if the word parser uses - * white space as a word separator. - * - * NOTE: The accuracy of the results depends on the ability of the store - * implementation to implement the find. The performance can vary - * too depending on the store. - * - * @param aSearchStrings Words that are compared to field data. - * @param aFieldTypes Types of the fields that are used. - * @param aObserver An observer for asynchronous operation. - * @param aWordParserCallBack a client implementation of word parser - * function that separates the field data - * into words. Parameter to function is - * TVPbkWordParserParam. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateFindOperationL( - const MDesC16Array& /*aSearchStrings*/, - const MVPbkFieldTypeList& /*aFieldTypes*/, - MVPbkContactFindFromStoresObserver& /*aObserver*/, - const TCallBack& /*aWordParserCallBack*/ ) { return NULL ;} - -/** - * Creates an operation for compressing the store. - * - * @param aObserver An observer for the compress operation. - * @return A handle to the operation or NULL - */ -MVPbkContactOperation* CVPbkContactStoreStub::CreateCompressStoresOperationL( - MVPbkBatchOperationObserver& /*aObserver*/) { return NULL; } - - -/** - * Returns the number of stores in the list. - * - * @return The number of stores in the list. - */ -TInt CVPbkContactStoreListStub::Count() const { return 0; } - -/** - * Returns the store in given index in the list. - * - * @param aIndex the index of the store in the list - * @precond aIndex > && aIndex < Count() - * VPbkError::Panic(VPbkError::EInvalidStoreIndex) - * is raised if the precondition does not hold. - * @return The store in the specified index. - */ -MVPbkContactStore& CVPbkContactStoreListStub::At(TInt /*aIndex*/) const -{ -MVPbkContactStore* ret =NULL; -return *ret; -} - -/** - * Finds the contact store corresponding to the aUri. - * - * @param aUri the store URI to search for. - * @return The contact store corresponding to the aUri or NULL. - */ -MVPbkContactStore* CVPbkContactStoreListStub::Find( - const TVPbkContactStoreUriPtr& /*aUri*/) const - { - return &gXSPStore; - } - -/** - * Opens all stores in the list asynchronously. - * - * A client can not use stores before it has successfully opened - * them. CloseAll must be always called by the same observer that has - * opened stores. - * - * NOTE: There can be only one observer for one store list at a time. - * - * @param aObserver An observer for the stores. - * @exception KErrInUse If one observer is currently opening this list. - */ -void CVPbkContactStoreListStub::OpenAllL(MVPbkContactStoreListObserver& /*aObserver*/) { } - -/** - * Closes all stores in the list. - * - * This is safe to call in all circumstances. Implementations - * can not trust that OpenAllL has been called before. - * - * @param aObserver An observer for the close process. - */ -void CVPbkContactStoreListStub::CloseAll(MVPbkContactStoreListObserver& /*aObserver*/) { } - - - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactStoreList.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactStoreList.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,400 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef SCVPBKCONTACTSTORELIST_H -#define SCVPBKCONTACTSTORELIST_H - -// INCLUDES -#include -#include -#include -#include -#include - -// FORWARD DECLARATIONS - - - -class CVPbkContactStoreStub : public CBase, public MVPbkContactStore - { - public: // Destructor - - /** - * Clients don't destroy the stores directly because they don't - * own them. The ownerships are managed by CVPbkContactManager. - */ - ~CVPbkContactStoreStub() { }; - - CVPbkContactStoreStub() { }; - - public: // New functions - /** - * Returns fixed properties of this contact store. - * - * Fixed properties do not change when the store is open. - * The store must be opened before retrieving the properties. - * - * @return Store properties. - */ - const MVPbkContactStoreProperties& StoreProperties() const ; - - /** - * Opens this contact store asynchronously. - * - * Calls back the observer when the opening completes. Notice - * that the same store instance can be opened by several observers. - * - * @param aObserver An observer for the store. - * @exception KErrInUse If another asynchronous operation - * is already in progress. - */ - void OpenL( - MVPbkContactStoreObserver& aObserver ) ; - - /** - * Replaces an existing store and opens it asynchronously. - * - * E.g. If the database is a file then this replaces the database if - * it's not locked by other clients. If the store - * implementation can not implment replacing then this behaves - * like OpenL. - * - * If the store does not exist, it is created if possible. - * Calls back the observer when the opening completes. - * - * @param aObserver An observer for the store. - */ - void ReplaceL( - MVPbkContactStoreObserver& aObserver ) ; - - /** - * Closes this contact store from a single observer. - * - * This can be always called safely even if OpenL or ReplaceL - * hasn't been called. - * If the client calls OpenL it must also call this after usage, - * The observer will no longer receive events from this store. - * If there are other observers for the store then the store - * will remain open for them. - * - * @param aObserver An observer that was given in OpenL or ReplaceL. - */ - void Close( - MVPbkContactStoreObserver& aObserver ) ; - - /** - * Creates a new contact associated to this store. - * - * The contact can be edited and then it must be committed by - * calling MVPbkStoreContact::CommitL for actually saving - * it to the store. - * - * @return A new contact associated to this store. Caller takes - * ownership of the returned contact. - * @see MVPbkStoreContact - * @see MVPbkStoreContact::CommitL - */ - MVPbkStoreContact* CreateNewContactLC() ; - - /** - * Creates a new contact group associated to this store. - * - * MVPbkContactStoreProperties::SupportsContactGroups must be - * true if this is used. - * The contact group might be saved to the store immeadiately - * depending on the store implementation. - * It is left open for editing. Use CommitL to commit - * the creation of the group and its content. - * - * @return A new contact group associated to this store. Caller takes - * the ownership of the returned contact group. - * @exception KErrNotSupported if the store doesn't support groups. - * Client should check store properties before - * calling this. - * @see MVPbkContactStoreProperties - * @see MVPbkContactGroup - * @see MVPbkStoreContact - * @see MVPbkStoreContact::CommitL - */ - MVPbkContactGroup* CreateNewContactGroupLC() ; - - /** - * Creates a new contact view from the store asynchronously. - * - * Client gets the ownership of the view. The content of - * the view depends on the CVPbkContactViewDefinition. The - * client must wait the observer event before using the view. - * - * @param aViewDefinition Defines the properties of the new view. - * @param aObserver An observer for the view events. - * @param aSortOrder Field types that are used in the view contact - * in the same order as in this list. Notice that - * stores may not support all possible field types - * in a view contact. The implementation - * of the view contact must have as many fields as - * the sort order. If the store doesn't support the - * field type in a view contact then it sets empty - * data to the field. - * @return A new contact view object. Caller takes ownership of the - * returned contact. - * @see MVPbkContactView - * @see CVPbkContactViewDefinition - */ - MVPbkContactView* CreateViewLC( - const CVPbkContactViewDefinition& aViewDefinition, - MVPbkContactViewObserver& aObserver, - const MVPbkFieldTypeList& aSortOrder ) ; - - /** - * Returns contact groups contained in this store. - * - * MVPbkContactStoreProperties::SupportsContactGroups must be - * true if this is used. Implementation should return an empty - * link array and not NULL. - * - * @return Contact group identifiers contained in this store. - */ - MVPbkContactLinkArray* ContactGroupsLC() const ; - - /** - * Returns a contact store information. Information can vary - * runtime. - * - * @return Contact store information. - */ - const MVPbkContactStoreInfo& StoreInfo() const ; - - /** - * This is part of Virtual Phonebook internal framefork and not - * usable for clients. Clients use CVPbkContactManager - * for creating links from a stream. - * - * Creates a link array from a stream. Stream contains the internals - * of the contact link. Internals are the contact store implementation - * specific part of the package format. - * - * NOTE: this must work wheter the OpenL has been called or not. This - * means that a link can not contain any data that would need - * an open store before internalizing. - * - * @param aStream A stream containing the link internals. - * @return A new contact link. - * @internal - */ - MVPbkContactLink* CreateLinkFromInternalsLC( - RReadStream& aStream ) const ; - - /** - * Returns own contact link asynchronously. - * - * @params aObserver Operation observer - * @return operation handle - * @Asynchronous - */ - MVPbkContactOperationBase* OwnContactLinkL( - MVPbkSingleContactLinkOperationObserver& aObserver) const ; - - - /** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ - MVPbkObjectHierarchy& ParentObject() const ; - - - /** - * Creates an operation for contact retrieval. - * - * @param aLink A link to the contact - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL if the factory - * doesn't have reference to the store of the link. - */ - MVPbkContactOperation* CreateContactRetrieverL( - const MVPbkContactLink& aLink, - MVPbkSingleContactOperationObserver& aObserver) ; - - /** - * Creates an operation for deleting multiple contacts. - * - * @param aContactLinks An array of contact links that specify - * the contacts. - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateDeleteContactsOperationL( - const MVPbkContactLinkArray& aContactLinks, - MVPbkBatchOperationObserver& aObserver ) ; - - /** - * Creates an operation for committing multiple contacts. - * - * @param aContacts An array of contact links that specify - * the contacts - * @param aObserver An observer for the operation. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateCommitContactsOperationL( - const TArray& aContacts, - MVPbkBatchOperationObserver& aObserver) ; - - /** - * Creates an operation for asynchronous phone number matching. - * - * @param aPhoneNumber A phone number to search for. - * @param aMaxMatchDigits Maximum number of digits to match from - * the end of the number. - * @param aObserver Observer for the find process. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateMatchPhoneNumberOperationL( - const TDesC& aPhoneNumber, - TInt aMaxMatchDigits, - MVPbkContactFindObserver& aObserver) ; - - /** - * Creates an operation for asynchronous contact finding. - * - * @param aSearchString String to search for. - * @param aFieldTypes List of field types that the search will include. - * @param aObserver Observer for the find process. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateFindOperationL( - const TDesC& aSearchString, - const MVPbkFieldTypeList& aFieldTypes, - MVPbkContactFindObserver& aObserver) ; - - /** - * Creates an operation for asynchronous contact finding. - * Finds a string containing text that is stored in one or more fields. - * Client can give multiple find words. All the words must match to separated - * data. E.g if there are two find words: "Jo" and "Jo" then field data - * "John Johnson" matches but "John Doe" doesn't if the word parser uses - * white space as a word separator. - * - * NOTE: The accuracy of the results depends on the ability of the store - * implementation to implement the find. The performance can vary - * too depending on the store. - * - * @param aSearchStrings Words that are compared to field data. - * @param aFieldTypes Types of the fields that are used. - * @param aObserver An observer for asynchronous operation. - * @param aWordParserCallBack a client implementation of word parser - * function that separates the field data - * into words. Parameter to function is - * TVPbkWordParserParam. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateFindOperationL( - const MDesC16Array& aSearchStrings, - const MVPbkFieldTypeList& aFieldTypes, - MVPbkContactFindFromStoresObserver& aObserver, - const TCallBack& aWordParserCallBack ) ; - - /** - * Creates an operation for compressing the store. - * - * @param aObserver An observer for the compress operation. - * @return A handle to the operation or NULL - */ - MVPbkContactOperation* CreateCompressStoresOperationL( - MVPbkBatchOperationObserver& aObserver) ; - - }; - - - -// CLASS DECLARATIONS -/** - * An interface for a list of contact stores. - * - * The interface provides an access to multiple stores. It's possible to open - * and close all stores in single call using this interface. When client calls - * OpenAllL it must also calls CloseAll after usage. - * - * @see CVPbkContactManager::ContactStoresL - */ -class CVPbkContactStoreListStub : public CBase, public MVPbkContactStoreList - { - public: // interface - ~CVPbkContactStoreListStub() { }; - - CVPbkContactStoreListStub() { }; - - /** - * Returns the number of stores in the list. - * - * @return The number of stores in the list. - */ - TInt Count() const ; - - /** - * Returns the store in given index in the list. - * - * @param aIndex the index of the store in the list - * @precond aIndex >= && aIndex < Count() - * VPbkError::Panic(VPbkError::EInvalidStoreIndex) - * is raised if the precondition does not hold. - * @return The store in the specified index. - */ - MVPbkContactStore& At(TInt aIndex) const ; - - /** - * Finds the contact store corresponding to the aUri. - * - * @param aUri the store URI to search for. - * @return The contact store corresponding to the aUri or NULL. - */ - MVPbkContactStore* Find( - const TVPbkContactStoreUriPtr& aUri) const ; - - /** - * Opens all stores in the list asynchronously. - * - * A client can not use stores before it has successfully opened - * them. CloseAll must be always called by the same observer that has - * opened stores. - * - * NOTE: There can be only one observer for one store list at a time. - * - * @param aObserver An observer for the stores. - * @exception KErrInUse If one observer is currently opening this list. - */ - void OpenAllL(MVPbkContactStoreListObserver& aObserver) ; - - /** - * Closes all stores in the list. - * - * This is safe to call in all circumstances. Implementations - * can not trust that OpenAllL has been called before. - * - * @param aObserver An observer for the close process. - */ - void CloseAll(MVPbkContactStoreListObserver& aObserver) ; - - - - }; - -#endif // SCVPBKCONTACTSTORELIST_H - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactView.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactView.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,254 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -// INCLUDES -#include -#include "s_CVPbkContactView.h" -#include "CVPbkStoreContactStub.h" - - -/** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ -MVPbkObjectHierarchy& CVPbkContactViewStub::ParentObject() const -{ -MVPbkObjectHierarchy* ret = NULL; -return *ret; -} - - -/** - * Returns type of this contact view. - * - * @return A contact view type. - */ -TVPbkContactViewType CVPbkContactViewStub::Type() const { return EVPbkContactsView; } - -/** - * Changes sort order of the view asynchronously. - * - * Clients of this view will get an event via MVPbkContactViewObserver - * interface when the order has been updated. The leaf view sends - * a pair of events. First it sends ContactViewUnavailable and then - * after the order has been changed ContactViewReady. However if - * the view is of type EVPbkCompositeView the client doesn't necessary - * receive ContactViewUnavailable at all because it might be that - * there is always some subview ready in the composite. - * - * @param aSortOrder A new sort order for this view. - * @exception KErrArgument Possible reasons: a client tries to change - * a sort order of platform defined shared - * view against the platform setting. - * @see CVPbkSortOrder - */ -void CVPbkContactViewStub::ChangeSortOrderL( - const MVPbkFieldTypeList& /*aSortOrder*/ ) { } - -/** - * Returns the current sort order of the view. - * - * The sort order is a sub set of master field types from - * CVPbkContactManager. - * - * @return The sort order of the view. - */ -const MVPbkFieldTypeList& CVPbkContactViewStub::SortOrder() const -{ -MVPbkFieldTypeList* ret = NULL; -return *ret; -} - -/** - * Refreshes the view contents asynchronously. - * - * All handles to this view's contacts are invalidated. - * Clients of this view will get an event via MVPbkContactViewObserver - * interface when the view has been refreshed. - */ -void CVPbkContactViewStub::RefreshL() { } - -/** - * Returns the number of contacts in this view. - * - * @return The number of contacts. - */ -TInt CVPbkContactViewStub::ContactCountL() const { return 0; } - -/** - * Returns a contact in this view. - * - * The returned reference may be invalidated when this - * function is called again. For that reason clients should prefer - * not to save references to the contacts retrieved from this function. - * - * @param aIndex An index of the contact in this view. - * @return A reference to a contact in this view at aIndex. - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - * @exception KErrArgument if aIndex >= ContactCountL() - */ -const MVPbkViewContact& CVPbkContactViewStub::ContactAtL( - TInt /*aIndex*/ ) const - { - MVPbkViewContact* ret = NULL; - return *ret; - } - -/** - * Creates and returns a link that points to contact at aIndex. - * - * NOTE: If the view contact is not from any store it can return - * also NULL. E.g. if the view contact is a folding - * contact view that it's not saved to any store. - * The NULL is not pushed onto the cleanup stack. - * - * @param aIndex An index of the contact for which the link - * is created. - * @return A new link object pointing to contact at aIndex or NULL if - * the link can't be created (e.g. a folder). - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - * @exception KErrArgument if aIndex >= ContactCountL() - */ -MVPbkContactLink* CVPbkContactViewStub::CreateLinkLC( - TInt /*aIndex*/ ) const { return NULL; } - -/** - * Returns The index of the aContactLink in this view. - * - * If the identifier is not found from the view then - * KErrNotFound is returned. If the view is not from - * any store (e.g. a folding view) then it will also - * return KErrNotFound. - * - * NOTE: the implementation of this function probably - * must loop the view which means that calling - * this function frequently or in a loop can - * be slow when there are lots of contacts. - * - * @param aContactLink A link whose index is searched for. - * @return The index of the link or KErrNotFound. - */ -TInt CVPbkContactViewStub::IndexOfLinkL( - const MVPbkContactLink& /*aContactLink*/ ) const { return 0; } - -/** - * Adds an observer to this contact view asynchronously. - * - * The observer will be notified after it has been added - * to the view. - * - * @param aObserver A new observer for the view. - */ -void CVPbkContactViewStub::AddObserverL( - MVPbkContactViewObserver& /*aObserver*/ ) { } - -/** - * Removes an observer from this contact view. - * - * This method can be called even if aObserver has not been - * previously added. In that case, no observers are removed. - * - * @param aObserver The observer to be removed. - */ -void CVPbkContactViewStub::RemoveObserver( - MVPbkContactViewObserver& /*aObserver*/ ) { } - -/** - * Returns ETrue if this view is from a store identified - * by aContactStoreUri. - * - * @param aContactStoreUri The whole URI of the contact store. - * @return ETrue if the view was from the given store. - * - * @see TVPbkContactStoreUriPtr::UriDes - */ -TBool CVPbkContactViewStub::MatchContactStore( - const TDesC& /*aContactStoreUri*/ ) const { return EFalse; } - -/** - * Returns ETrue if this view is from a store domain identified - * by aContactStoreDomain. - * - * @param aContactStoreDomain The domain part of the contact store URI. - * The domain can be retrieved from the - * whole contact store URI using class - * TVPbkContactStoreUriPtr and - * EContactStoreUriStoreType. - * An implementation compares the - * EContactStoreUriStoreType part of - * its own URI to aContactStoreDomain. - * - * @return ETrue if the view was from the same store domain. - * @see TVPbkContactStoreUriPtr - */ -TBool CVPbkContactViewStub::MatchContactStoreDomain( - const TDesC& /*aContactStoreDomain*/ ) const { return EFalse; } - -/** - * Creates and returns a bookmark that points to the - * view contact at aIndex. - * - * @param aIndex An index of the contact in the view. - * @return A new bookmark to the view item. - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - */ -MVPbkContactBookmark* CVPbkContactViewStub::CreateBookmarkLC( - TInt /*aIndex*/ ) const { return NULL; } - -/** - * Returns an index of the contact in the view. - * - * If the identifier is not found from the view then - * KErrNotFound is returned. - * - * NOTE: the implementation of this function probably - * must loop the view which means that calling - * this function frequently or in a loop can - * be slow when there are lots of contacts. - * - * @param aContactBookmark A bookmark that identifies - * a contact in the view. - * @return An index of the contact in the view or KErrNotFound. - */ -TInt CVPbkContactViewStub::IndexOfBookmarkL( - const MVPbkContactBookmark& /*aContactBookmark*/ ) const { return 0; } - -/** - * Returns an interface for text based contact filtering support. - * - * If the view doesn't support filtering then this returns NULL. - * Filtering must be supported in all views created from a contact - * store. However, it's possible to implement a view that doesn't - * need a filtering support and therefore clients must always check - * the returned pointer. - * - * @return A filtering interface or NULL - */ -MVPbkContactViewFiltering* CVPbkContactViewStub::ViewFiltering() { return NULL; } - - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactView.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactView.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,268 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef SCVPBKCONTACTVIEW_H -#define SCVPBKCONTACTVIEW_H - -// INCLUDES -#include -#include - - -// CLASS DECLARATIONS - -/** - * An interface for contact store views. - * - * The view contains contacts from a single contact store. - * MVPbkObjectHierarchy interface can be used to navigate to the store. - */ -class CVPbkContactViewStub : public CBase, - public MVPbkContactView - { - public: // Destructor - /** - * Destructor. - */ - ~CVPbkContactViewStub() { }; - - CVPbkContactViewStub() { }; - - /** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ - MVPbkObjectHierarchy& ParentObject() const; - - - /** - * Returns type of this contact view. - * - * @return A contact view type. - */ - TVPbkContactViewType Type() const ; - - /** - * Changes sort order of the view asynchronously. - * - * Clients of this view will get an event via MVPbkContactViewObserver - * interface when the order has been updated. The leaf view sends - * a pair of events. First it sends ContactViewUnavailable and then - * after the order has been changed ContactViewReady. However if - * the view is of type EVPbkCompositeView the client doesn't necessary - * receive ContactViewUnavailable at all because it might be that - * there is always some subview ready in the composite. - * - * @param aSortOrder A new sort order for this view. - * @exception KErrArgument Possible reasons: a client tries to change - * a sort order of platform defined shared - * view against the platform setting. - * @see CVPbkSortOrder - */ - void ChangeSortOrderL( - const MVPbkFieldTypeList& aSortOrder ) ; - - /** - * Returns the current sort order of the view. - * - * The sort order is a sub set of master field types from - * CVPbkContactManager. - * - * @return The sort order of the view. - */ - const MVPbkFieldTypeList& SortOrder() const ; - - /** - * Refreshes the view contents asynchronously. - * - * All handles to this view's contacts are invalidated. - * Clients of this view will get an event via MVPbkContactViewObserver - * interface when the view has been refreshed. - */ - void RefreshL() ; - - /** - * Returns the number of contacts in this view. - * - * @return The number of contacts. - */ - TInt ContactCountL() const ; - - /** - * Returns a contact in this view. - * - * The returned reference may be invalidated when this - * function is called again. For that reason clients should prefer - * not to save references to the contacts retrieved from this function. - * - * @param aIndex An index of the contact in this view. - * @return A reference to a contact in this view at aIndex. - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - * @exception KErrArgument if aIndex >= ContactCountL() - */ - const MVPbkViewContact& ContactAtL( - TInt aIndex ) const ; - - /** - * Creates and returns a link that points to contact at aIndex. - * - * NOTE: If the view contact is not from any store it can return - * also NULL. E.g. if the view contact is a folding - * contact view that it's not saved to any store. - * The NULL is not pushed onto the cleanup stack. - * - * @param aIndex An index of the contact for which the link - * is created. - * @return A new link object pointing to contact at aIndex or NULL if - * the link can't be created (e.g. a folder). - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - * @exception KErrArgument if aIndex >= ContactCountL() - */ - MVPbkContactLink* CreateLinkLC( - TInt aIndex ) const ; - - /** - * Returns The index of the aContactLink in this view. - * - * If the identifier is not found from the view then - * KErrNotFound is returned. If the view is not from - * any store (e.g. a folding view) then it will also - * return KErrNotFound. - * - * NOTE: the implementation of this function probably - * must loop the view which means that calling - * this function frequently or in a loop can - * be slow when there are lots of contacts. - * - * @param aContactLink A link whose index is searched for. - * @return The index of the link or KErrNotFound. - */ - TInt IndexOfLinkL( - const MVPbkContactLink& aContactLink ) const ; - - /** - * Adds an observer to this contact view asynchronously. - * - * The observer will be notified after it has been added - * to the view. - * - * @param aObserver A new observer for the view. - */ - void AddObserverL( - MVPbkContactViewObserver& aObserver ) ; - - /** - * Removes an observer from this contact view. - * - * This method can be called even if aObserver has not been - * previously added. In that case, no observers are removed. - * - * @param aObserver The observer to be removed. - */ - void RemoveObserver( - MVPbkContactViewObserver& aObserver ) ; - - /** - * Returns ETrue if this view is from a store identified - * by aContactStoreUri. - * - * @param aContactStoreUri The whole URI of the contact store. - * @return ETrue if the view was from the given store. - * - * @see TVPbkContactStoreUriPtr::UriDes - */ - TBool MatchContactStore( - const TDesC& aContactStoreUri ) const ; - - /** - * Returns ETrue if this view is from a store domain identified - * by aContactStoreDomain. - * - * @param aContactStoreDomain The domain part of the contact store URI. - * The domain can be retrieved from the - * whole contact store URI using class - * TVPbkContactStoreUriPtr and - * EContactStoreUriStoreType. - * An implementation compares the - * EContactStoreUriStoreType part of - * its own URI to aContactStoreDomain. - * - * @return ETrue if the view was from the same store domain. - * @see TVPbkContactStoreUriPtr - */ - TBool MatchContactStoreDomain( - const TDesC& aContactStoreDomain ) const ; - - /** - * Creates and returns a bookmark that points to the - * view contact at aIndex. - * - * @param aIndex An index of the contact in the view. - * @return A new bookmark to the view item. - * @precond aIndex > - * VPbkError::Panic(VPbkError::EInvalidContactIndex) - * is raised if the precondition does not hold. - */ - MVPbkContactBookmark* CreateBookmarkLC( - TInt aIndex ) const ; - - /** - * Returns an index of the contact in the view. - * - * If the identifier is not found from the view then - * KErrNotFound is returned. - * - * NOTE: the implementation of this function probably - * must loop the view which means that calling - * this function frequently or in a loop can - * be slow when there are lots of contacts. - * - * @param aContactBookmark A bookmark that identifies - * a contact in the view. - * @return An index of the contact in the view or KErrNotFound. - */ - TInt IndexOfBookmarkL( - const MVPbkContactBookmark& aContactBookmark ) const ; - - /** - * Returns an interface for text based contact filtering support. - * - * If the view doesn't support filtering then this returns NULL. - * Filtering must be supported in all views created from a contact - * store. However, it's possible to implement a view that doesn't - * need a filtering support and therefore clients must always check - * the returned pointer. - * - * @return A filtering interface or NULL - */ - MVPbkContactViewFiltering* ViewFiltering() ; - - - - }; - -#endif // SCVPBKCONTACTVIEW_H - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactViewDefinition.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkContactViewDefinition.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,299 +0,0 @@ -/* -* Copyright (c) 2004-2007 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 - -/** - * Creates a new contact view definition and initializes - * it from resource. Takes a VPBK_CONTACT_VIEW resource - * structure as a parameter. - * - * @param aReader A resource reader to a VPBK_CONTACT_VIEW - * structure. - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewL( - TResourceReader& /*aReader*/ ){ return new (ELeave) CVPbkContactViewDefinition; } - -/** - * Creates a new empty contact view definition. - * Client must then set the needed information. - * - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewL(){ return new (ELeave) CVPbkContactViewDefinition; } - -/** - * Constructs a new contact view definition from an existing one - * by copying the data. - * - * @param aViewDef A view definition to copy. - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewL( - const CVPbkContactViewDefinition& /*aViewDef*/ ){ return new (ELeave) CVPbkContactViewDefinition; } - -/** - * Creates a new contact view definition and initializes - * it from resource. Takes a VPBK_CONTACT_VIEW resource - * structure as a parameter. - * - * @param aReader A resource reader to a VPBK_CONTACT_VIEW - * structure. - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewLC( - TResourceReader& /*aReader*/ ){ return new (ELeave) CVPbkContactViewDefinition; } - -/** - * Creates a new empty contact view definition. - * Client must then set the needed information. - * - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewLC() -{ -CVPbkContactViewDefinition* self = new (ELeave) CVPbkContactViewDefinition; -CleanupStack::PushL(self); -return self; - -} - -/** - * Constructs a new contact view definition from an existing one - * by copying the data. - * - * @param aViewDef A view definition to copy. - * @return A new instance of this class. - */ -EXPORT_C CVPbkContactViewDefinition* CVPbkContactViewDefinition::NewLC( - const CVPbkContactViewDefinition& /*aViewDef*/ ) - { - CVPbkContactViewDefinition* self = new (ELeave) CVPbkContactViewDefinition; - CleanupStack::PushL(self); - return self; - } - -/** - * Destructor. - */ -CVPbkContactViewDefinition::~CVPbkContactViewDefinition(){ } - -/** - * Returns the number of sub views owned by this view. - * - * @return The number of sub views. - */ -EXPORT_C TInt CVPbkContactViewDefinition::SubViewCount() const{ return 0; } - -/** - * Returns the sub view definition at aIndex. - * - * @param aIndex The index of the sub view definition. - * @return The sub view definition at aIndex. - */ -EXPORT_C const CVPbkContactViewDefinition& CVPbkContactViewDefinition::SubViewAt( - TInt /*aIndex*/ ) const{ return *this; } - -/** - * Returns the sub view definition at aIndex. - * - * @param aIndex The index to query. - * @return The sub view definition. - */ -EXPORT_C CVPbkContactViewDefinition& CVPbkContactViewDefinition::SubViewAt( TInt /*aIndex*/ ){ return *this; } - -/** - * Returns the type of this view. - * - * @return The type of this view. - */ -EXPORT_C TVPbkContactViewType CVPbkContactViewDefinition::Type() const{ return EVPbkContactsView; } - -/** - * Returns ETrue if aFlag is on, otherwise EFalse. - * - * @param aFlag The flag to check. - * @return A flag state. - */ -EXPORT_C TBool CVPbkContactViewDefinition::FlagIsOn( TVPbkContactViewFlag /*aFlag*/ ) const{ return EFalse;} - -/** - * Returns the URI of this view. KNullDesC if this is not a leaf node. - * - * @return The URI of this view or KNullDesC. - */ -EXPORT_C const TDesC& CVPbkContactViewDefinition::Uri() const{ return KNullDesC(); } - -/** - * Returns the sorting policy of this view. - * - * @return The sorting policy of this view. - */ -EXPORT_C TVPbkContactViewSortPolicy CVPbkContactViewDefinition::SortPolicy() const{ return EVPbkOrderedContactView; } - -/** - * Returns the name of the view. Default is KNullDesC. - * - * In view types EVPbkContactsView and EVPbkGroupsView - * the name can be used as a shared view identifier by the - * store. Shared view creation is indicated by - * TVPbkContactViewSharing. If the name is empty for shared - * view then store implementation uses its default name. - * This is a preferred way to use shared views in the platform. - * - * In view type EVPbkFoldingView the name is the label - * of the only contact in the view. - * - * In view type EVPbkCompositeView the name has no meaning. - * - * @return The name of the view. - */ -EXPORT_C const TDesC& CVPbkContactViewDefinition::Name() const{ return KNullDesC(); } - -/** - * Returns the view sharing type. The store can support - * a shared view creation for saving RAM. - * - * Default value for types EVPbkContactsView and EVPbkGroupsView - * is EVPbkSharedView. Store implementation creates - * then a shared view if it's possible for the store. - * Prefer using the default values for saving resources. - * - * For view types EVPbkFoldingView and EVPbkCompositeView the - * sharing has no effect. - * - * See also the documentation of Name() - * - * @return The view sharing type. - * - */ -EXPORT_C TVPbkContactViewSharing CVPbkContactViewDefinition::Sharing() const{ return EVPbkViewSharingUndefined; } - -/** - * Returns the field type selector used to filter the view or NULL. - * - * The view contains only contacts having the fields defined - * by the field type filter. - * - * @return The field type filter. - */ -EXPORT_C CVPbkFieldTypeSelector* CVPbkContactViewDefinition::FieldTypeFilter() const{ return NULL; } - -/** - * Returns the id of this view. - * - * @return the id of this view. - */ -EXPORT_C TInt CVPbkContactViewDefinition::Id() const{ return 1; } -/** - * Adds new view as a subview. This object takes ownership - * of the subview. If this function leaves ownership is not taken. - * - * @param aSubView The new subview to add. - */ -EXPORT_C void CVPbkContactViewDefinition::AddSubViewL( CVPbkContactViewDefinition* /*aSubView*/ ){ } - -/** - * Sets aType as this views type. - * - * @param aType The type to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetType( TVPbkContactViewType /*aType*/ ){ } - -/** - * Sets aId as this views id. - * - * @param aId the id to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetId( TInt /*aId*/ ){ } -/** - * Sets the saFlag's state as aState. - * - * @param aFlag The flag to modify. - * @param aState The state to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetFlag( TVPbkContactViewFlag /*aFlag*/, TBool /*aState*/ ){ } - -/** - * Sets aUri as this views URI. This function takes a copy of aUri. - * - * @param aUri The URI to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetUriL( const TDesC& /*aUri*/ ){ } - -/** - * Sets aSortPolicy as this views sorting policy. - * - * @param aSortPolicy The sort policy to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetSortPolicy( TVPbkContactViewSortPolicy /*aSortPolicy*/ ){ } - -/** - * Sets aName as this views Name. This function takes a copy of aName. - * - * @param aName The name to set. - */ -EXPORT_C void CVPbkContactViewDefinition::SetNameL( const TDesC& /*aName*/ ){ } - -/** - * Sets the view sharing type. - * - * @param aViewSharing One of the values defined in - * VPbkContactView.hrh. - */ -EXPORT_C void CVPbkContactViewDefinition::SetSharing( TVPbkContactViewSharing /*aViewSharing*/ ){ } - -/** - * Sets the field type selector used to filter the view. - * - * The view contains only contacts having the fields defined - * by the field type filter. - * - * @param aFilter The field type filter. Use NULL to - * filter nothing. - */ -EXPORT_C void CVPbkContactViewDefinition::SetFieldTypeFilterL( CVPbkFieldTypeSelector* /*aFilter*/ ){ } - -/** - * Sets the contact selector used to filter the view. - * - * The view contains only contacts accepted by the selector. - * - * @param aContactSelector The contact selector. Use NULL to - * filter nothing. Ownership not transferred. - */ -EXPORT_C void CVPbkContactViewDefinition::SetContactSelector( MVPbkContactSelector* /*aContactSelector*/ ){ } - -/** - * Gives either the contact selector or NULL. Ownership is not transferred. - */ -EXPORT_C MVPbkContactSelector* CVPbkContactViewDefinition::ContactSelector() const{ return NULL; } - -CVPbkContactViewDefinition::CVPbkContactViewDefinition(){ } -void CVPbkContactViewDefinition::ConstructL(){ } -void CVPbkContactViewDefinition::ConstructL( - const CVPbkContactViewDefinition& /*aViewDef*/ ){ } -void CVPbkContactViewDefinition::ConstructFromResourceL( - TResourceReader& /*aReader*/ ){ } -void CVPbkContactViewDefinition::InitializeSharing(){ } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkStoreContactField.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkStoreContactField.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,325 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -// INCLUDES -#include "s_CVPbkStoreContactField.h" -#include -#include "CVPbkContactFieldTextData_stub.h" -#include "s_MVPbkContactFieldUriData_stub.h" -#include "s_MVPbkContactFieldBinaryDatastub.h" - -CVPbkContactFieldTextData_stub gTextFieldData; -CVPbkContactFieldUriData_Stub gUriFieldData; -CVPbkContactFieldBinaryDataStub gBinaryFieldData; -CVPbkContactFieldTextData_stub gJunkFieldData; -TBool gBestMatchingFieldType; - -// CONSTANTS - -//ctor -CVPbkStoreContactFieldStub::CVPbkStoreContactFieldStub( TInt aIndex) -: iIndex(aIndex) -{ - -} -/** - * Destructor - */ -CVPbkStoreContactFieldStub::~CVPbkStoreContactFieldStub(){ } - -const MVPbkContactFieldData& CVPbkStoreContactFieldStub::FieldData() const - { - if (iIndex == 0) - { - return gTextFieldData; - } - - if (iIndex == 1) - { - return gUriFieldData; - } - - if (iIndex == 2) - { - return gBinaryFieldData; - } - - return gJunkFieldData; //some junk - - } - - -/** - * Returns ETrue if the field supports label. - * - * Overwrites the global setting in MVPbkContactStoreProperties. - * This must be confirmed before using SetFieldLabelL or - * MaxLabelLength. - * - * @return ETrue if the field supports label. Otherwise EFalse. - */ -TBool CVPbkStoreContactFieldStub::SupportsLabel() const { return EFalse; } - -/** - * Returns the label of the field or KNullDesC if there is no field - * label. - * - * @return The label of the field or KNullDesC - */ -TPtrC CVPbkStoreContactFieldStub::FieldLabel() const { return KNullDesC(); } - -/** - * Sets this field's label. - * - * SupportsLabel must be true for using this. - * - * @param aText The label for the field. - */ -void CVPbkStoreContactFieldStub::SetFieldLabelL( const TDesC& /*aText*/ ) { } - -/** - * Gets the maximum length of the label. - * - * SupportsLabel must be true for using this. - * - * @return The maximum length of the label or KVPbkUnlimitedLabelLength - * if the store has no limits. Zero should be returned in other - * cases though this shouldn't be called if labels are - * not supported. - */ -TInt CVPbkStoreContactFieldStub::MaxLabelLength() const { return 0; } - -/** - * Returns the data storage (read-write) of the field. - * - * The data type depends on the field and it's client's responsibility - * to check the type before casting the type. - * - * @return The data storage of the field. - * @see MVPbkContactFieldTextData::Cast - * @see MVPbkContactFieldDateTimeData::Cast - * @see MVPbkContactFieldBinaryData::Cast - */ -MVPbkContactFieldData& CVPbkStoreContactFieldStub::FieldData() - { - - - if (iIndex == 0) - { - return gTextFieldData; - } - - if (iIndex == 1) - { - return gUriFieldData; - } - - if (iIndex == 2) - { - return gBinaryFieldData; - } - - return gJunkFieldData; //some junk - } - - -/** - * Clones the field. - * - * Pushes the created copy to the cleanup stack. - * - * @return A copy of the field. - * @see MVPbkStoreContactFieldCollection::FieldAt - */ -MVPbkStoreContactField* CVPbkStoreContactFieldStub::CloneLC() const { return NULL; } - -/** - * Creates a link representing the contact and the field. - * - * The field can be later retrieved using the RetrieveField of - * MVPbkStoreContactFieldCollection interface. - * - * NOTE: implementations of stores are possibly using an index - * of the field as an identifier so clients should prefer not - * to save field links permanently. E.g modifying the contact - * can invalidate the link in some store implementations. - * A field link is practical in use cases where the link is - * created and immediately given to another component. - * - * @return A link representing the contact and the field or NULL - * if the contact doesn't exist in the store. E.g a new - * contact that hasn't been committed has no unique - * identifier yet. - * NULL is not put into the CleanupStack. - */ -MVPbkContactLink* CVPbkStoreContactFieldStub::CreateLinkLC() const { return NULL; } - - -/** - * Returns the parent contact where this field is from. - * - * @return The parent contact where this field is from. - */ -MVPbkBaseContact& CVPbkStoreContactFieldStub::ParentContact() const -{ -MVPbkBaseContact* ret=NULL; -return *ret; -} - -/** - * Returns this field's type or NULL if no mapping exists - * between the native type and phonebook type. - * - * @param aMatchPriority matching priority to use. - * @return The field type or NULL - * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list)) - */ -const MVPbkFieldType* CVPbkStoreContactFieldStub::MatchFieldType( - TInt /*aMatchPriority*/) const { return NULL; } - -/** - * Returns the best matching type of the field or NULL - * if no mapping exists between the native type and - * phonebook type. This is the same as looping - * MatchFieldType from priority 0 and getting the first - * matched type. - * - * @return The field type or NULL - * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list)) - */ -const MVPbkFieldType* CVPbkStoreContactFieldStub::BestMatchingFieldType() const - { - if (gBestMatchingFieldType) - { - return this; - } - return NULL; - } - - - -/** - * Returns true if this field is the same as another field in the - * contact instance. - * Doesn't work for fields from different contact instances. - * Always use this method instead of direct pointer comparison. - * - * @param aOther another field inside the contact - * @return ETrue if contact is same - */ -TBool CVPbkStoreContactFieldStub::IsSame(const MVPbkBaseContactField& /*aOther*/) const { return EFalse;} - - -/** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ -MVPbkObjectHierarchy& CVPbkStoreContactFieldStub::ParentObject() const -{ -MVPbkObjectHierarchy* ret =NULL; -return *ret; -} - - -/** - * Returns the Versit properties mapped to this field type. - * - * @return Versit properties. - */ -TArray CVPbkStoreContactFieldStub::VersitProperties() const -{ - -} - -/** - * Returns the Versit parameters fields of this type should not have. - * - * @return Excluded parameters. - */ -const TVPbkFieldTypeParameters& CVPbkStoreContactFieldStub::ExcludedParameters() const -{ -TVPbkFieldTypeParameters* ret = NULL; -return *ret; -} - -/** - * Type name for field types not supported by the Versit 2.1 standard. - * - * @return A non-Versit type. - */ -TVPbkNonVersitFieldType CVPbkStoreContactFieldStub::NonVersitType() const -{ -return EVPbkNonVersitTypeNone; -} - -/** - * Returns true if this field type is the same as aOtherType. - * - * @param aOtherType The type to compare. - * @return ETrue if the field types are the same. - */ -TBool CVPbkStoreContactFieldStub::IsSame( - const MVPbkFieldType& /*aOtherType*/ ) const { return EFalse; } - -/** - * Returns true if this field type matches a Versit property. - * - * @param aMatchProperty A versit property to match against. - * @param aMatchPriority A matching priority. Priorities start - * from zero which is the highest priority. - * Priority is also a direct index to - * VersitProperties() array. - * @return ETrue if this field type matches aMatchProperty at - * aMatchPriority. Returns always false if - * aMatchPriority >= VersitProperties().Count(). - */ -TBool CVPbkStoreContactFieldStub::Matches( - const TVPbkFieldVersitProperty& /*aMatchProperty*/, - TInt /*aMatchPriority*/ ) const { return EFalse; } - -/** - * Returns the field type resource id from VPbkEng.rsg - * that be used to identify a type. - * - * @return A field type resource id. - */ -TInt CVPbkStoreContactFieldStub::FieldTypeResId() const - { - - if (iIndex == 0) - { - return R_VPBK_FIELD_TYPE_VOIPHOME; - } - - if (iIndex == 1) - { - return R_VPBK_FIELD_TYPE_IMPP; - } - - if (iIndex == 2) - { - return R_VPBK_FIELD_TYPE_THUMBNAILPIC; - } - - return R_VPBK_FIELD_TYPE_JOBTITLE; //some junk - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkStoreContactField.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_CVPbkStoreContactField.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,262 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef SCVPBKSTORECONTACTFIELD_H -#define SCVPBKSTORECONTACTFIELD_H - - -// INCLUDES -#include -#include -#include - -// CONSTANTS - - -// CLASS DECLARATIONS - -/** - * An interface for the field of the store contact. - * - * Client can access the contact field using this interface. The field - * can have a label and a data. - * - * A new field can be created using the MVPbkStoreContact interface. - * For looping the contact fields see MVPbkStoreContactFieldCollection. - * The parent of the field in the object hierarchy is the store contact. - * - * @see CVPbkContactFieldTypeIterator - * @see CVPbkFieldTypeSelector - */ -class CVPbkStoreContactFieldStub : public CBase, - public MVPbkStoreContactField, - public MVPbkFieldType - { - public: // ctor - CVPbkStoreContactFieldStub(TInt aIndex); - /** - * Destructor - */ - ~CVPbkStoreContactFieldStub(); - - public: // From MVPbkBaseContactField - const MVPbkContactFieldData& FieldData() const ; - - public: // New functions - /** - * Returns ETrue if the field supports label. - * - * Overwrites the global setting in MVPbkContactStoreProperties. - * This must be confirmed before using SetFieldLabelL or - * MaxLabelLength. - * - * @return ETrue if the field supports label. Otherwise EFalse. - */ - TBool SupportsLabel() const ; - - /** - * Returns the label of the field or KNullDesC if there is no field - * label. - * - * @return The label of the field or KNullDesC - */ - TPtrC FieldLabel() const ; - - /** - * Sets this field's label. - * - * SupportsLabel must be true for using this. - * - * @param aText The label for the field. - */ - void SetFieldLabelL( const TDesC& aText ) ; - - /** - * Gets the maximum length of the label. - * - * SupportsLabel must be true for using this. - * - * @return The maximum length of the label or KVPbkUnlimitedLabelLength - * if the store has no limits. Zero should be returned in other - * cases though this shouldn't be called if labels are - * not supported. - */ - TInt MaxLabelLength() const ; - - /** - * Returns the data storage (read-write) of the field. - * - * The data type depends on the field and it's client's responsibility - * to check the type before casting the type. - * - * @return The data storage of the field. - * @see MVPbkContactFieldTextData::Cast - * @see MVPbkContactFieldDateTimeData::Cast - * @see MVPbkContactFieldBinaryData::Cast - */ - MVPbkContactFieldData& FieldData() ; - - /** - * Clones the field. - * - * Pushes the created copy to the cleanup stack. - * - * @return A copy of the field. - * @see MVPbkStoreContactFieldCollection::FieldAt - */ - MVPbkStoreContactField* CloneLC() const ; - - /** - * Creates a link representing the contact and the field. - * - * The field can be later retrieved using the RetrieveField of - * MVPbkStoreContactFieldCollection interface. - * - * NOTE: implementations of stores are possibly using an index - * of the field as an identifier so clients should prefer not - * to save field links permanently. E.g modifying the contact - * can invalidate the link in some store implementations. - * A field link is practical in use cases where the link is - * created and immediately given to another component. - * - * @return A link representing the contact and the field or NULL - * if the contact doesn't exist in the store. E.g a new - * contact that hasn't been committed has no unique - * identifier yet. - * NULL is not put into the CleanupStack. - */ - MVPbkContactLink* CreateLinkLC() const ; - - - public: // Interface - /** - * Returns the parent contact where this field is from. - * - * @return The parent contact where this field is from. - */ - MVPbkBaseContact& ParentContact() const ; - - /** - * Returns this field's type or NULL if no mapping exists - * between the native type and phonebook type. - * - * @param aMatchPriority matching priority to use. - * @return The field type or NULL - * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list)) - */ - const MVPbkFieldType* MatchFieldType( - TInt aMatchPriority) const ; - - /** - * Returns the best matching type of the field or NULL - * if no mapping exists between the native type and - * phonebook type. This is the same as looping - * MatchFieldType from priority 0 and getting the first - * matched type. - * - * @return The field type or NULL - * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list)) - */ - const MVPbkFieldType* BestMatchingFieldType() const ; - - - - /** - * Returns true if this field is the same as another field in the - * contact instance. - * Doesn't work for fields from different contact instances. - * Always use this method instead of direct pointer comparison. - * - * @param aOther another field inside the contact - * @return ETrue if contact is same - */ - TBool IsSame(const MVPbkBaseContactField& aOther) const ; - - -public: // New functions - /** - * Returns the parent object of this object. For the root of the - * hierarchy returns self. - * @return The parent object. - */ - MVPbkObjectHierarchy& ParentObject() const ; - - /** - * Returns the Versit properties mapped to this field type. - * - * @return Versit properties. - */ - TArray VersitProperties() const ; - - /** - * Returns the Versit parameters fields of this type should not have. - * - * @return Excluded parameters. - */ - const TVPbkFieldTypeParameters& ExcludedParameters() const ; - - /** - * Type name for field types not supported by the Versit 2.1 standard. - * - * @return A non-Versit type. - */ - TVPbkNonVersitFieldType NonVersitType() const ; - - /** - * Returns true if this field type is the same as aOtherType. - * - * @param aOtherType The type to compare. - * @return ETrue if the field types are the same. - */ - TBool IsSame( - const MVPbkFieldType& aOtherType ) const ; - - /** - * Returns true if this field type matches a Versit property. - * - * @param aMatchProperty A versit property to match against. - * @param aMatchPriority A matching priority. Priorities start - * from zero which is the highest priority. - * Priority is also a direct index to - * VersitProperties() array. - * @return ETrue if this field type matches aMatchProperty at - * aMatchPriority. Returns always false if - * aMatchPriority >= VersitProperties().Count(). - */ - TBool Matches( - const TVPbkFieldVersitProperty& aMatchProperty, - TInt aMatchPriority ) const ; - - /** - * Returns the field type resource id from VPbkEng.rsg - * that be used to identify a type. - * - * @return A field type resource id. - */ - TInt FieldTypeResId() const ; - - private: - TInt iIndex ; - - }; - -#endif // SCVPBKSTORECONTACTFIELD_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldBinaryData.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldBinaryData.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2002-2007 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 "s_MVPbkContactFieldBinaryDatastub.h" - -_LIT8(KTestBinaryData, "some binary dataJunk"); - -/** - * Casts MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the binary field data. - */ -EXPORT_C MVPbkContactFieldBinaryData& MVPbkContactFieldBinaryData::Cast( - MVPbkContactFieldData& aFieldData ) -{ -return static_cast(aFieldData); -}; - -/** - * Casts const MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the binary field data. - */ -EXPORT_C const MVPbkContactFieldBinaryData& MVPbkContactFieldBinaryData::Cast( - const MVPbkContactFieldData& aFieldData ) -{ -return static_cast(aFieldData); -}; -/** - * Returns the binary data pointer. - * @return Pointer to binary data. - */ -TPtrC8 CVPbkContactFieldBinaryDataStub::BinaryData() const -{ -return KTestBinaryData(); -} -/** - * Sets the binary data. - * @exception KErrOverflow if (aBinaryData.Length() > MaxLength()) - * @param aBinaryData Binary data to be set. - */ -void CVPbkContactFieldBinaryDataStub::SetBinaryDataL( const TDesC8& /*aBinaryData*/ ) -{ - -} - -/** - * Returns the derived data type id. - * @return Contact field storage type. - */ -TVPbkFieldStorageType CVPbkContactFieldBinaryDataStub::DataType() const -{ -return EVPbkFieldStorageTypeBinary; -} - -/** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ -TBool CVPbkContactFieldBinaryDataStub::IsEmpty() const -{ -return EFalse; -} - -/** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ -void CVPbkContactFieldBinaryDataStub::CopyL(const MVPbkContactFieldData& /*aFieldData*/) -{ - -} - -CVPbkContactFieldBinaryDataStub::CVPbkContactFieldBinaryDataStub() -{ - -} - -CVPbkContactFieldBinaryDataStub::~CVPbkContactFieldBinaryDataStub() -{ - -} -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldBinaryDatastub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldBinaryDatastub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPBKCONTACTFIELDBINARYDATASTUB_H -#define CVPBKCONTACTFIELDBINARYDATASTUB_H - -// INCLUDES -#include - - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook binary field data. - * This interface is used to manipulate binary contact field data. - */ -class CVPbkContactFieldBinaryDataStub : public MVPbkContactFieldBinaryData - { - public: // Destructor - /** - * Destructor. - */ - ~CVPbkContactFieldBinaryDataStub(); - - CVPbkContactFieldBinaryDataStub(); - - - - public: // Interface - - /** - * Returns the binary data pointer. - * @return Pointer to binary data. - */ - TPtrC8 BinaryData() const ; - - /** - * Sets the binary data. - * @exception KErrOverflow if (aBinaryData.Length() > MaxLength()) - * @param aBinaryData Binary data to be set. - */ - void SetBinaryDataL( const TDesC8& aBinaryData ) ; - - /** - * Returns the derived data type id. - * @return Contact field storage type. - */ - TVPbkFieldStorageType DataType() const; - - /** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ - TBool IsEmpty() const; - - /** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ - void CopyL(const MVPbkContactFieldData& aFieldData) ; - }; - -#endif // CVPBKCONTACTFIELDBINARYDATASTUB_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldTextData.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldTextData.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -// INCLUDES - -#include "CVPbkContactFieldTextData_stub.h" - -_LIT(KTestData, "123@voip"); - -/** - * Casts MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the text field data. - */ -EXPORT_C MVPbkContactFieldTextData& MVPbkContactFieldTextData::Cast( - MVPbkContactFieldData& aFieldData) -{ -return static_cast(aFieldData); -}; - -/** - * Casts const MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the text field data. - */ -EXPORT_C const MVPbkContactFieldTextData& MVPbkContactFieldTextData::Cast( - const MVPbkContactFieldData& aFieldData) -{ -return static_cast(aFieldData); -}; - -/** - * Returns the string data. - * @return Pointer to the text data. - */ -TPtrC CVPbkContactFieldTextData_stub::Text() const -{ -return KTestData(); -} - -/** - * Sets the string data. - * @exception KErrOverflow if (aText.Length() > MaxLength()) - */ -void CVPbkContactFieldTextData_stub::SetTextL( const TDesC& /*aText*/ ) -{ - -} - -/** - * Returns maximum length of the field. - * @return Maximum length of the field or KVPbkUnlimitedFieldLength - * if length is only limited by available memory. - */ -TInt CVPbkContactFieldTextData_stub::MaxLength() const -{ -return KTestData().Length(); -} - -CVPbkContactFieldTextData_stub::~CVPbkContactFieldTextData_stub() -{ - -} - -CVPbkContactFieldTextData_stub::CVPbkContactFieldTextData_stub() -{ - -} -/** - * Returns the derived data type id. - * @return Contact field storage type. - */ -TVPbkFieldStorageType CVPbkContactFieldTextData_stub::DataType() const - { - return EVPbkFieldStorageTypeText; - } - -/** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ -TBool CVPbkContactFieldTextData_stub::IsEmpty() const -{ -return EFalse; -} - -/** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ -void CVPbkContactFieldTextData_stub::CopyL(const MVPbkContactFieldData& /*aFieldData*/) -{ - -} - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldUriData.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldUriData.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2002-2007 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 "s_MVPbkContactFieldUriData_stub.h" - -_LIT(KTestUriData, "gizmo:someuser@gizmo.com"); - -/** - * Casts MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeUri - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the text field data. - */ -EXPORT_C MVPbkContactFieldUriData& MVPbkContactFieldUriData::Cast( - MVPbkContactFieldData& aFieldData) -{ -return static_cast(aFieldData); -}; - -/** - * Casts const MVPbkContactFieldData to this interface. - * - * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText - * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) - * is raised if the precondition does not hold. - * @param aFieldData Data of the field. - * @return Casted inteface for the text field data. - */ -EXPORT_C const MVPbkContactFieldUriData& MVPbkContactFieldUriData::Cast( - const MVPbkContactFieldData& aFieldData) -{ -return static_cast(aFieldData); -}; - -/** - * Returns the URI scheme. - * @return Pointer to the URI scheme. - */ -TPtrC CVPbkContactFieldUriData_Stub::Scheme() const -{ -return KNullDesC(); -} - -/** - * Returns the URI . - * @return Pointer to the URI text. - */ -TPtrC CVPbkContactFieldUriData_Stub::Text() const -{ -return KTestUriData(); -} - -/** - * Returns the string data. - * @return Pointer to the whole URI. - */ -TPtrC CVPbkContactFieldUriData_Stub::Uri() const -{ -return KNullDesC(); -} - -/** - * Sets the URI data. - * @exception KErrOverflow if (aUri.Length() > MaxLength()) - */ -void CVPbkContactFieldUriData_Stub::SetUriL(const TDesC& /*aUri*/) -{ - -} - -/** - * Sets the URI data. - * @exception KErrOverflow if (aScheme.Length() + aText.Length() - * + 1 > MaxLength()) - */ -void CVPbkContactFieldUriData_Stub::SetUriL(const TDesC& /*aScheme*/, const TDesC& /*aText*/) -{ - -} - -/** - * Returns maximum length of the field. - * @return Maximum length of the field or KVPbkUnlimitedFieldLength - * if length is only limited by available memory. - */ -TInt CVPbkContactFieldUriData_Stub::MaxLength() const -{ -return 1; -} - - -/** - * Returns the derived data type id. - * @return Contact field storage type. - */ -TVPbkFieldStorageType CVPbkContactFieldUriData_Stub::DataType() const - { - return EVPbkFieldStorageTypeUri; - } - -/** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ -TBool CVPbkContactFieldUriData_Stub::IsEmpty() const -{ -return EFalse; -} - -/** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ -void CVPbkContactFieldUriData_Stub::CopyL(const MVPbkContactFieldData& /*aFieldData*/) -{ - -} - -CVPbkContactFieldUriData_Stub::CVPbkContactFieldUriData_Stub() -{ - -} - -CVPbkContactFieldUriData_Stub::~CVPbkContactFieldUriData_Stub() -{ - -} - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldUriData_stub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactFieldUriData_stub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPBKCONTACTFIELDURIDATASTUB_H -#define CVPBKCONTACTFIELDURIDATASTUB_H - - -// INCLUDES -#include - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook Contact field URI data. - * This interface is used to manipulate URI contact field data. - */ -class CVPbkContactFieldUriData_Stub : public MVPbkContactFieldUriData - { - public: // Destructor - /** - * Destructor. - */ - ~CVPbkContactFieldUriData_Stub(); - - CVPbkContactFieldUriData_Stub(); - - public: // Interface - - /** - * Returns the URI scheme. - * @return Pointer to the URI scheme. - */ - TPtrC Scheme() const ; - - /** - * Returns the URI . - * @return Pointer to the URI text. - */ - TPtrC Text() const ; - - /** - * Returns the string data. - * @return Pointer to the whole URI. - */ - TPtrC Uri() const ; - - /** - * Sets the URI data. - * @exception KErrOverflow if (aUri.Length() > MaxLength()) - */ - void SetUriL(const TDesC& aUri) ; - - /** - * Sets the URI data. - * @exception KErrOverflow if (aScheme.Length() + aText.Length() - * + 1 > MaxLength()) - */ - void SetUriL(const TDesC& aScheme, const TDesC& aText) ; - - /** - * Returns maximum length of the field. - * @return Maximum length of the field or KVPbkUnlimitedFieldLength - * if length is only limited by available memory. - */ - TInt MaxLength() const ; - - /** - * Returns the derived data type id. - * @return Contact field storage type. - */ - TVPbkFieldStorageType DataType() const; - - /** - * Returns true if the storage is empty. - * @return ETrue if the data field is empty. - */ - TBool IsEmpty() const; - - /** - * Copies data from given field data. - * @param aFieldData Data that is copied to this object. - * @precond aFieldData.DataType() == this->DataType() - */ - void CopyL(const MVPbkContactFieldData& aFieldData) ; - - - }; - -#endif // CVPBKCONTACTFIELDURIDATASTUB_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactLinkstub.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactLinkstub.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -// INCLUDES -#include "s_MVPbkContactLinkstub.h" - -CVPbkContactLinkStub::CVPbkContactLinkStub() -{ - -} - -/** - * Returns the contact store which this link belongs to. - * @return Contact store associated with this link. - */ -MVPbkContactStore& CVPbkContactLinkStub::ContactStore() const -{ -MVPbkContactStore* ret=NULL; -return *ret; -} - -/** - * Returns ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - * @param aOther Contact to check equality for. - * @return ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - */ -TBool CVPbkContactLinkStub::IsSame(const MVPbkContactLink& aOther) const -{ -if (this == &aOther) -return ETrue; - -return EFalse; -} - -/** - * Checks if this link refers to the contact aContact. - * @param aContact Contact to check. - * @return ETrue if this link refers to aContact, EFalse otherwise. - */ -TBool CVPbkContactLinkStub::RefersTo(const MVPbkBaseContact& /*aContact*/) const -{ -return ETrue; -} - -/** - * Returns persistent streaming interface for this object, or NULL - * if persistent streaming is not supported. - * @return Persistent streaming object or NULL if not supported. - */ -const MVPbkStreamable* CVPbkContactLinkStub::Streamable() const -{ -return NULL; -}; - -/** - * Returns a packing interface for this link. - * @see CVPbkContactLinkArray - * @internal - * @return Link packing object. - */ -const MVPbkContactLinkPacking& CVPbkContactLinkStub::Packing() const -{ -MVPbkContactLinkPacking* ret = NULL; -return *ret; -}; - -/** - * Returns a clone of this contact link. - * @return Contact link copy. - */ -MVPbkContactLink* CVPbkContactLinkStub::CloneLC() const -{ - MVPbkContactLink* temp = NULL; - CleanupStack::PushL( temp ); - return temp; -} - -CVPbkContactLinkStub::~CVPbkContactLinkStub() -{ - -} - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactLinkstub.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_MVPbkContactLinkstub.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2002-2007 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: -: -* -*/ - - - -#ifndef CVPBKCONTACTLINKSTUB_H -#define CVPBKCONTACTLINKSTUB_H - -// INCLUDES -#include - - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook Contact link. - * An object that uniquely identifies a single Contact and its ContactStore. - */ -class CVPbkContactLinkStub : public CBase, public MVPbkContactLink - { - public: // destructor - /** - * Destructor. - */ - ~CVPbkContactLinkStub(); - - CVPbkContactLinkStub(); - public: // interface - - /** - * Returns the contact store which this link belongs to. - * @return Contact store associated with this link. - */ - MVPbkContactStore& ContactStore() const ; - - /** - * Returns ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - * @param aOther Contact to check equality for. - * @return ETrue if this link refers to the same contact than - * aOther, EFalse otherwise. - */ - TBool IsSame(const MVPbkContactLink& aOther) const ; - - /** - * Checks if this link refers to the contact aContact. - * @param aContact Contact to check. - * @return ETrue if this link refers to aContact, EFalse otherwise. - */ - TBool RefersTo(const MVPbkBaseContact& aContact) const ; - - /** - * Returns persistent streaming interface for this object, or NULL - * if persistent streaming is not supported. - * @return Persistent streaming object or NULL if not supported. - */ - const MVPbkStreamable* Streamable() const ; - - /** - * Returns a packing interface for this link. - * @see CVPbkContactLinkArray - * @internal - * @return Link packing object. - */ - const MVPbkContactLinkPacking& Packing() const ; - - /** - * Returns a clone of this contact link. - * @return Contact link copy. - */ - MVPbkContactLink* CloneLC() const ; - - - }; - - - -#endif // CVPBKCONTACTLINKSTUB_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_TVPbkContactStoreUriPtr.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_TVPbkContactStoreUriPtr.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -/* -* Copyright (c) 2004-2007 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 - -/** - * Constructs a URI pointer to aStoreUri. - * - * @param aStoreUri A reference to the contact store URI. - */ -EXPORT_C TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(const TDesC& /*aStoreUri*/){ } - -/** - * Constructor. - */ -EXPORT_C TVPbkContactStoreUriPtr::TVPbkContactStoreUriPtr(){ } - - -/** - * Returns a descriptor that holds the whole Uri. - * - * @return A descriptor that holds the whole Uri. - */ -EXPORT_C const TDesC& TVPbkContactStoreUriPtr::UriDes() const{ return KNullDesC(); } - -/** - * Compares this URI's component to aUri's component. - * - * @param aUri The URI whose component is compared. - * @param aComponent Defines the component that are compared. - * @return Zero if the URIs are the same. - */ -EXPORT_C TInt TVPbkContactStoreUriPtr::Compare(const TVPbkContactStoreUriPtr& /*aUri*/, - TVPbkContactStoreUriComponent /*aComponent*/) const{ return 0; } - -/** - * Compares this URI's component to aUriComponent. - * - * @param aUriComponent A descriptor that contains the component data. - * @param aComponent Defines the component of this URI that is compared - * to aUriComponent. - * @return Zero if components matched. - */ -EXPORT_C TInt TVPbkContactStoreUriPtr::Compare(const TDesC& /*aUriComponent*/, - TVPbkContactStoreUriComponent /*aComponent*/) const{ return 0; } - -/** - * Returns a pointer to the aComponent part of URI. - * - * @param aComponent Defines the component that is returned. - * @return a pointer to the aComponent part of URI. - */ -EXPORT_C const TPtrC TVPbkContactStoreUriPtr::Component( - TVPbkContactStoreUriComponent /*aComponent*/) const{ return KNullDesC(); } - -/** - * Sets this URI pointer to point to the same URI as aUri. - * - * @param aUri The URI that will be pointed to. - */ -EXPORT_C void TVPbkContactStoreUriPtr::Set(const TVPbkContactStoreUriPtr& /*aUri*/){ } - -/** - * Returns the length of the URI. - * - * @return The length of the URI. - */ -EXPORT_C TInt TVPbkContactStoreUriPtr::Length() const{ return 0; } - - -EXPORT_C void TVPbkContactStoreUriPtr::ExternalizeL(RWriteStream& /*aStream*/) const{ } -EXPORT_C TInt TVPbkContactStoreUriPtr::ExternalizedSize() const{ return 0; } - - - - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_VPbkContactStoreUris.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_VPbkContactStoreUris.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - - -// INCLUDES -#include - -_LIT( KPhoneBookDbURI, "cntdb://c:contacts.cdb"); - -/** - * Returns the default Contacts Model database store URI. - * - * @return The default Contacts Model database store URI. - */ -EXPORT_C const TDesC& VPbkContactStoreUris::DefaultCntDbUri(){ return KPhoneBookDbURI(); } - -/** - * Returns the global ADN SIM store URI. - * - * Global means the ADN store that can be accessed by both GSM and 3G phone. - * - * @return The global ADN SIM store URI - */ -EXPORT_C const TDesC& VPbkContactStoreUris::SimGlobalAdnUri(){ return KPhoneBookDbURI(); } - -/** - * Returns the global FDN SIM store URI. - * - * Global means the FDN store that can be accessed by both GSM and 3G phone. - * - * @return The global FDN SIM store URI - */ -EXPORT_C const TDesC& VPbkContactStoreUris::SimGlobalFdnUri(){ return KPhoneBookDbURI(); } - -/** - * Returns the global SDN SIM store URI. - * - * Global means the SDN store that can be accessed by both GSM and 3G phone. - * - * @return The global SDN SIM store URI - */ -EXPORT_C const TDesC& VPbkContactStoreUris::SimGlobalSdnUri(){ return KPhoneBookDbURI(); } - -/** - * Returns the MSISDN SIM store URI. - * - * Global means the MSISDN store that can be accessed by both GSM and - * 3G phone. - * - * NOTE: Though the name of the store suggests that the store will contain - * the caller's own phone number it's not exactly the case. It can - * contain the number but only if it has been set. - * - * @return The MSISDN SIM store URI. - */ -EXPORT_C const TDesC& VPbkContactStoreUris::SimGlobalOwnNumberUri(){ return KPhoneBookDbURI(); } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_cVPbkBaseContactFieldCollection.h --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_cVPbkBaseContactFieldCollection.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2004-2007 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: -: -* -*/ - - - -#ifndef SCVPBKBASECONTACTFIELDCOLLECTION_H -#define SCVPBKBASECONTACTFIELDCOLLECTION_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS - -// CLASS DECLARATIONS - -/** - * Virtual Phonebook base contact field collection interface. - * An abstract collection of read-only Virtual Phonebook contact fields. - */ -class CVPbkBaseContactFieldCollectionStub : public CBase, - public MVPbkStoreContactFieldCollection - { - public: // Destructor - CVPbkBaseContactFieldCollectionStub(); - - /** - * Destructor. - */ - ~CVPbkBaseContactFieldCollectionStub(); - - public: // From MVPbkBaseContactFieldCollection (covariant return types)) - const MVPbkStoreContactField& FieldAt(TInt aIndex) const ; - - public: // New functions - /** - * Returns a field in this collection. - * - * @param aIndex A zero-based index of the field to return. - * @return A reference to the field at aIndex. Reference is valid until - * FieldAt is called again. If you need a permanent copy, - * call MVPbkStoreContactField::CloneLC to the returned - * field. - * @see MVPbkStoreContactField::CloneLC - * @precond aIndex >= 0 && aIndex < FieldCount() - * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised - * if the precondition does not hold. - */ - MVPbkStoreContactField& FieldAt( TInt aIndex ) ; - - /** - * Returns a copy of the field in this collection. - * - * Client gets the ownership of the field. - * - * @param aIndex A zero-based index of the field to return. - * @return A new instance to the field at aIndex. The field is valid - * as long as the parent contact is valid - * @precond aIndex >= 0 && aIndex < FieldCount() - * VPbkError::Panic(VPbkError::EInvalidFieldIndex) is raised - * if the precondition does not hold. - */ - MVPbkStoreContactField* FieldAtLC( TInt aIndex ) const ; - - /** - * Returns the parent contact of the field collection - * - * @return the parent contact of the field collection - */ - MVPbkStoreContact& ParentStoreContact() const ; - - /** - * Returns a field in this collection identified by a contact field - * link. - * - * A contact field link can be created using the MVPbkStoreContactField - * interface. The same link works then as a contact link and - * a field link. - * - * NOTE: implementations of stores are possibly using an index - * of the field as an identifier so clients should prefer not - * to save field links permanently. E.g modifying the contact - * can invalidate the link in some store implementations. - * A field link is practical in use cases where the link is - * created and immediately given to another component. - * - * @param aContactLink A valid contact field link. - * @return A field in this collection identified by aContactLink or NULL - * if the link does not contain field information or if the - * link does not refer to the parent contact of this field collection. - */ - MVPbkStoreContactField* RetrieveField( - const MVPbkContactLink& aContactLink ) const ; - - - public: // Interface - /** - * Returns the parent contact of this field set. - * @return The parent contact of this field set. - */ - MVPbkBaseContact& ParentContact() const ; - - /** - * Returns the number of fields in this collection. - * @return The number of fields in this collection. - */ - TInt FieldCount() const ; - - /** - * Returns a read-only field in this collection. - * - * @param aIndex Zero-based index of the field to return. - * @return Reference to a field at aIndex. Reference is - * valid until FieldAt is called again. - * @see MVPbkBaseContactFieldCollection::ConstFieldAt - * @precond aIndex >= 0 && aIndex < FieldCount() - * Panic VPbkError::EInvalidFieldIndex is raised if the - * precondition does not hold. - */ - //const MVPbkBaseContactField& FieldAt( - // TInt aIndex) const ; - - }; - - -#endif // SCVPBKBASECONTACTFIELDCOLLECTION_H - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_cactive.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_cactive.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2007 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 - -CActiveScheduler::TLoopOwner gTLoop ; - -TBool gSetActive = EFalse; -/* - IMPORT_C ~CActive(); - IMPORT_C void Deque(); - IMPORT_C void SetPriority(TInt aPriority); - inline TBool IsAdded() const; - inline TInt Priority() const; - IMPORT_C virtual TInt RunError(TInt aError); - IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); -*/ - -void CActive::Cancel() - { - iStatus.iFlags = 0; - } - -CActive::CActive(TInt /*aPriority*/) - { - } - -void CActive::SetActive() - { - iStatus.iFlags = TRequestStatus::EActive; - } - -CActive::~CActive() - { - } - -void CActive::Deque() - { - } - -void CActive::SetPriority(TInt /*aPriority*/) - { - } - -TInt CActive::RunError(TInt /*aError*/) - { - return KErrNone; - } - -TInt CActive::Extension_(TUint /*aExtensionId*/, TAny*& /*a0*/, TAny* /*a1*/) - { - return KErrNone; - } - -void CActiveScheduler::Add(CActive* /*aActive*/) - { - } - - -void CPeriodic::Start(TTimeIntervalMicroSeconds32 /*aDelay*/, - TTimeIntervalMicroSeconds32 /*anInterval*/, - TCallBack /*aCallBack*/) - { - } - - -CActiveSchedulerWait::CActiveSchedulerWait() - { - } -CActiveSchedulerWait::~CActiveSchedulerWait() - { - } - -void CActiveSchedulerWait::Start() - { - CActiveScheduler::TLoopOwner temp = NULL; - iLoop = temp; //assign some local variable with junk value - } - -void CActiveSchedulerWait::AsyncStop() - { - iLoop = NULL; - } - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_vimpstutils.cpp --- a/uiservicetab/vimpststorage/tsrc/vimpststorage_ut/stubs/s_vimpstutils.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* -* Copyright (c) 2008 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: -: -* -*/ - - - -// INCLUDES -#include "vimpstutils.h" -#include "stringloader.h" -#include - - -// CONSTANTS -// TODO: For later use -// general colon needed in various places -//_LIT( KColon, ":" ); -// general slash needed in various places -//_LIT( KSlash, "/" ); -// general slash needed in various places -_LIT( KAt, "@" ); - -// ----------------------------------------------------------------------------- -// VIMPSTUtils::LoadResourceL -// give ownership to caller -// ----------------------------------------------------------------------------- -// - HBufC* VIMPSTUtils::LoadResourceL( TInt aResourceId ) - { - CCoeEnv* env = CCoeEnv::Static(); - HBufC* ret = NULL; - if(env) - { - ret = env->AllocReadResourceL(aResourceId); - return ret; - } - else - { - return ret; - } - - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_away.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_away.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_busy.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_busy.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_invisible.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_invisible.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_off.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_off.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_on.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_on.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_on_mobile.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_on_mobile.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_voip.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_friend_voip.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_imsg.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_imsg.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_imsg_new.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_prop_im_imsg_new.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/Brand/qgn_servtab_avatar_blocked.svg --- a/uiservicetab/vimpstui/bitmaps/Brand/qgn_servtab_avatar_blocked.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/example_msn_tab.svg --- a/uiservicetab/vimpstui/bitmaps/example_msn_tab.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/example_tab.bmp Binary file uiservicetab/vimpstui/bitmaps/example_tab.bmp has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/example_tab_mask.bmp Binary file uiservicetab/vimpstui/bitmaps/example_tab_mask.bmp has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/example_yahoo_tab.svg --- a/uiservicetab/vimpstui/bitmaps/example_yahoo_tab.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_away.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_away.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_busy.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_busy.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_invisible.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_invisible.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_off.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_off.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_on.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_on.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_on_mobile.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_on_mobile.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_voip.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_friend_voip.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_imsg.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_imsg.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_imsg_new.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_imsg_new.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_im_user_blocked.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_im_user_blocked.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_service_default_avatar.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_service_default_avatar.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_service_friend_request_received.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_service_friend_request_received.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_service_friend_request_sent.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_service_friend_request_sent.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_service_off_friend_request_received.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_service_off_friend_request_received.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_prop_service_off_friend_request_sent.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_prop_service_off_friend_request_sent.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/bitmaps/qgn_servtab_avatar_blocked.svg --- a/uiservicetab/vimpstui/bitmaps/qgn_servtab_avatar_blocked.svg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/group/bld.inf --- a/uiservicetab/vimpstui/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2008 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: build info file for vimpstui xSP extension -* -*/ - - -// -// Platforms -// -PRJ_PLATFORMS -DEFAULT - -// -// Exports -// -PRJ_EXPORTS - - -../bitmaps/example_tab.bmp /epoc32/s60/bitmaps/example_tab.bmp -../bitmaps/example_tab_mask.bmp /epoc32/s60/bitmaps/example_tab_mask.bmp -../bitmaps/example_msn_tab.svg /epoc32/s60/icons/example_msn_tab.svg -../bitmaps/qgn_prop_im_friend_voip.svg /epoc32/s60/icons/qgn_prop_im_friend_voip.svg -../bitmaps/qgn_prop_im_friend_off.svg /epoc32/s60/icons/qgn_prop_im_friend_off.svg -../bitmaps/qgn_prop_im_friend_on.svg /epoc32/s60/icons/qgn_prop_im_friend_on.svg -../bitmaps/qgn_prop_im_friend_away.svg /epoc32/s60/icons/qgn_prop_im_friend_away.svg -../bitmaps/qgn_prop_im_friend_busy.svg /epoc32/s60/icons/qgn_prop_im_friend_busy.svg -../bitmaps/qgn_prop_im_friend_invisible.svg /epoc32/s60/icons/qgn_prop_im_friend_invisible.svg -../bitmaps/qgn_prop_im_imsg.svg /epoc32/s60/icons/qgn_prop_im_imsg.svg -../bitmaps/qgn_prop_im_imsg_new.svg /epoc32/s60/icons/qgn_prop_im_imsg_new.svg -../bitmaps/qgn_prop_im_friend_on_mobile.svg /epoc32/s60/icons/qgn_prop_im_friend_on_mobile.svg - -// avatar files -../bitmaps/qgn_prop_service_default_avatar.svg /epoc32/s60/icons/qgn_prop_service_default_avatar.svg -../bitmaps/qgn_prop_service_friend_request_received.svg /epoc32/s60/icons/qgn_prop_service_friend_request_received.svg -../bitmaps/qgn_prop_service_friend_request_sent.svg /epoc32/s60/icons/qgn_prop_service_friend_request_sent.svg -../bitmaps/qgn_prop_service_off_friend_request_received.svg /epoc32/s60/icons/qgn_prop_service_off_friend_request_received.svg -../bitmaps/qgn_prop_service_off_friend_request_sent.svg /epoc32/s60/icons/qgn_prop_service_off_friend_request_sent.svg -../bitmaps/qgn_servtab_avatar_blocked.svg /epoc32/s60/icons/qgn_servtab_avatar_blocked.svg - - - -// -// IMExtentionUi components -// - -PRJ_MMPFILES - -vimpstui.mmp - -PRJ_EXTENSIONS - -// Using mifconv_ext tool ( replacing gnu make to create icons ) To know more about mifconv tool go to the below link: -// http://s60wiki.nokia.com/S60Wiki/Mifconv_extension#Use_of_Iconlist_-_Icon_sources_are_fetched_from_.5Cepoc32.5Cs60.5Cicons - -START EXTENSION s60/mifconv -OPTION TARGETFILE vimpstui.mif -OPTION HEADERFILE vimpstui.mbg -OPTION SOURCES -c8,1 qgn_stat_im_uni \ - -c8,1 qgn_prop_im_friend_voip \ - -c8,8 example_msn_tab \ - -c8,1 qgn_prop_im_friend_off \ - -c8,1 qgn_prop_im_friend_on \ - -c8,1 qgn_prop_im_friend_away \ - -c8,1 qgn_prop_im_friend_busy \ - -c8,1 qgn_prop_im_friend_invisible \ - -c8,1 qgn_prop_im_imsg \ - -c8,1 qgn_prop_im_imsg_new \ - -c8,1 qgn_indi_tb_voip \ - -c8,1 qgn_indi_tb_conversation \ - -c8,1 qgn_indi_tb_business_card \ - -c8,1 qgn_indi_tb_add_recipient \ - -c8,1 qgn_prop_service_default_avatar \ - -c8,1 qgn_prop_service_friend_request_received \ - -c8,1 qgn_prop_service_friend_request_sent \ - -c8,1 qgn_prop_service_off_friend_request_received \ - -c8,1 qgn_prop_service_off_friend_request_sent\ - -c8,1 qgn_prop_im_friend_on_mobile\ - -c8,1 qgn_servtab_avatar_blocked -END - -PRJ_EXTENSIONS -START EXTENSION s60/mifconv -OPTION TARGETFILE vimpst_servicetab_default.mif -OPTION HEADERFILE vimpst_servicetab_default.mbg -OPTION SOURCES -c8,1 qgn_prop_im_imsg - -END diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/group/vimpstui.mmp --- a/uiservicetab/vimpstui/group/vimpstui.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -/* -* Copyright (c) 2008 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: mmp file for VIMSTUI -* -*/ - -#include -#include -#include "../../inc/vimpstextentionuiuid.h" -#include "../../inc/vimpstbuilddefinitions.h" - -TARGET vimpstui.dll -TARGETTYPE PLUGIN -UID KECOMRECOGNITIONUID2 KIMCONTACTSEXTNIMPLEMENTATIONUID - -CAPABILITY ALL -TCB -VENDORID VID_DEFAULT - -VERSION 10.0 - -USERINCLUDE ../../inc -USERINCLUDE ../../Group - -USERINCLUDE ../inc -USERINCLUDE ../src -USERINCLUDE ../rss -USERINCLUDE ../../../inc -USERINCLUDE ../../vimpstutils/inc -USERINCLUDE ../../vimpstengine/inc -USERINCLUDE ../../vimpstcmdprocess/inc -USERINCLUDE ../../vimpststorage/inc -USERINCLUDE ../../../imstutils/imconversationview/inc -USERINCLUDE ../../../group - - -// For context sensitive help includes -USERINCLUDE ../../../imstutils/help/inc -APP_LAYER_SYSTEMINCLUDE - - -//APP_LAYER_PLATFORM_EXPORT_PATH - -SYSTEMINCLUDE /epoc32/include/ecom - - - -SOURCEPATH ../src - -SOURCE dllmain.cpp -SOURCE cvimpstuimenuextension.cpp -SOURCE ccommandinfo.cpp -SOURCE cvimpstuiextensionfactory.cpp -SOURCE cvimpstuitabbedview.cpp - -SOURCE cvimpstuidoublelistboxtabviewcontrol.cpp -SOURCE cvimpstuisinglelistboxtabviewcontrol.cpp -SOURCE cvimpstuisearchview.cpp -SOURCE cvimpstuisearchviewcontrol.cpp - - -SOURCE cvimpstuisinglelistboxarray.cpp -SOURCE cvimpstuidoublelistboxarray.cpp -SOURCE cvimpstuidoublestylelistbox.cpp -SOURCE cvimpstuisinglestylelistbox.cpp -SOURCE cvimpstuilistboxmodel.cpp -SOURCE cvimpstuiviewmanager.cpp -SOURCE cvimpstuiextensionservice.cpp -SOURCE cvimpstuiextensionviewinfo.cpp -SOURCE cvimpstuibranddata.cpp -// search dialog -SOURCE cvimpstuisearchquerydialog.cpp -SOURCE cvimpstuisearchfieldarray.cpp -SOURCE cvimpstuisearchfield.cpp -SOURCE cvimpstuiavatarselectionhandler.cpp - -//tou dialog -SOURCE cvimpstuitermsofusedlg.cpp -SOURCE cvimpstuitermsofusedialoghandler.cpp -SOURCE cvimpstuistatuspanehandler.cpp - -//blocked contact view -SOURCE cvimpstuiblockview.cpp -SOURCE cvimpstuiblockviewcontrol.cpp -SOURCE cvimpstuicontactselection.cpp -// Resources - -START RESOURCE ../rss/vimpstuires.rss -DEPENDS aknfep.rsg -HEADER -TARGET vimpstuires -TARGETPATH RESOURCE_FILES_DIR -LANGUAGE_IDS -END - - -START RESOURCE ../rss/20012423.rss -TARGET vimpstui -TARGETPATH ECOM_RESOURCE_DIR -END - - -LIBRARY ecom.lib -LIBRARY euser.lib -LIBRARY avkon.lib -LIBRARY aknnotify.lib -LIBRARY eikcore.lib -LIBRARY eikdlg.lib -LIBRARY eikcoctl.lib -LIBRARY bafl.lib -LIBRARY commonengine.lib -LIBRARY efsrv.lib -LIBRARY apengine.lib //AP engine -LIBRARY estor.lib -LIBRARY aknlayout.lib -LIBRARY sysutil.lib // For disk space checking -LIBRARY aknskins.lib -LIBRARY eikctl.lib -LIBRARY etext.lib // -LIBRARY commonui.lib -LIBRARY cone.lib -LIBRARY egul.lib -LIBRARY aknskinsrv.lib -LIBRARY aknicon.lib - -LIBRARY fbscli.lib -LIBRARY uiklaf.lib -LIBRARY gdi.lib -LIBRARY ws32.lib -LIBRARY form.lib // CTextView -LIBRARY caf.lib -LIBRARY featmgr.lib -LIBRARY apgrfx.lib // aptasklist - -// Dependencies to phonebook2 -LIBRARY Pbk2CommonUi.lib -LIBRARY ExtensionManager.lib -LIBRARY pbk2uicontrols.lib -LIBRARY pbk2presentation.lib - -LIBRARY vimpstcmdprocess.lib //command manager of IM -LIBRARY vimpstutils.lib -LIBRARY hlplch.lib - -LIBRARY vimpstengine.lib -LIBRARY vimpststorage.lib -LIBRARY vimpstsettings.lib -// branding server -LIBRARY bsclient.lib -//CCA -LIBRARY ccaclient.lib -// imcvlauncher -LIBRARY imcvlauncher.lib - -LIBRARY aiwdialdata.lib -LIBRARY ServiceHandler.lib - -LIBRARY charconv.lib - -LIBRARY browserlauncher.lib //browser launch -LIBRARY MGFetch.lib // MGFetch for avatar -LIBRARY NewService.lib // NewFileService for avatar -LIBRARY servicehandler.lib // CAiwGenericParamList for avatar -LIBRARY imageconversion.lib //image decoder for avatar -LIBRARY apparc.lib // for serverexit functionality avatar -LIBRARY apmime.lib -LIBRARY cscsettingsui.lib //settings library to launch settings view. -LIBRARY AknLayout2Scalable.lib // scalable avkon layout - -// Dependencies to other Phonebook 2 components -LIBRARY VPbkEng.lib //Pbk2Presentation.lib - -//#ifdef CHAT_ENABLE_DEBUG_PRINT -LIBRARY flogger.lib -//#endif - -LANG SC -// end of file - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/ccommandinfo.h --- a/uiservicetab/vimpstui/inc/ccommandinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/* -* Copyright (c) 2008 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: ccomandinfo.h - * -*/ - -#ifndef __CCOMMANDINFO_H__ -#define __CCOMMANDINFO_H__ - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class TResourceReader; - -/** - * command info - */ -class CCommandInfo : public CBase - { - - public: - /** - * Static factory function that performs the 2-phased construction. - * - * @param aReader Reference to resource reader to be used - * @param aId Id of the component owning the command IDs - * @param anewCommandIds New command IDs - * @return New instance of this class - */ - static CCommandInfo* NewLC( TResourceReader& aReader, - TInt32 aPluginId, - TInt& aNewCommandIds ); - - /** - * Destructor. - */ - ~CCommandInfo(); - - public: - - /** - * Gets the ID related to this command ID - * - * @return The ID related to this command ID - */ - TInt32 PliginId() const; - - /** - * Gets the new command ID - * - * @return The new command ID - */ - TInt32 NewCommandId() const; - - /** - * Gets the old/original command ID - * - * @return The old/original command ID - */ - TInt32 OldCommandId() const; - - private: - - /** - * Constructor. - */ - CCommandInfo( TInt32 aPluginId ); - - /** - * 2nd phase constructor. - */ - void ConstructL( TResourceReader& aReader, - TInt& aNewCommandIds ); - - private: // Data - // plugin id - TInt32 iPluginId; - - //new command id form the command pool - TInt32 iNewCommandId; - - //old command id from the plugin - TInt32 iOldCommandId; - }; - - -#endif // __CCOMMANDINFO_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuiavatarselectionhandler.h --- a/uiservicetab/vimpstui/inc/cvimpstuiavatarselectionhandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/* -* Copyright (c) 2008 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: avatar selection handler - * -*/ - - - -#ifndef CVIMPSTUIAVATARSELECTIONHANDLER_H -#define CVIMPSTUIAVATARSELECTIONHANDLER_H - -// INCLUDES -#include -#include -#include // RApaLsSession -#include // MAknServerAppExitObserver -#include // TNewServiceFileType - -#include "tvimpstenums.h" -// FORWARD DECLARATIONS - -class CDocumentHandler; -class CImageDecoder; - - -// CLASS DECLARATION - -/** - * avatar selection handler - * - */ -class CAvatarSelectionHandler : public CActive, - public MAknServerAppExitObserver - { -public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CAvatarSelectionHandler* NewLC(); - - /** - * Destructor. - */ - virtual ~CAvatarSelectionHandler(); - - - - - -public: - /** - * funtion to select the avatar image file , and allocates memory for - * selected filename if any file gets selected lese returns NULL - * - * @param aCommand , command value , which says - * image should be selected from gallery or camera. - * - * @return allocated value for filename if image is selected else NULL - * ownership is transfered to the caller - */ - HBufC* HandleAvatarSelectionL(TInt aCommand ); - - /** - * Gives the mimetype for the selected file - * The return value is valid if its called aftter - * calling HandleAvatarSelectionL - * else the returns NULL - * - * - * @return allocated value for mimetype if image is selected else NULL - * - */ - const TDesC8& MimeTypeL(); - -protected: // Functions from base classes - - /** - * @see MAknServerAppExitObserver - * - */ - void HandleServerAppExit( TInt aReason ); - - -protected: // From CActive - - /** - * @see CActive - */ - void RunL(); - - /** - * @see CActive - */ - void DoCancel(); - - /** - * @see CActive. - */ - TInt RunError( TInt aError ); - -private: - /** - * funtion to show the errors based on the param passed - * - * @param aErrorType : TErrorType enum value - */ - void ShowErrorL(TErrorType aErrorType); - /** - * C++ default constructor. - */ - CAvatarSelectionHandler(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - /** - * Retrieves the optimal decode size (as small as possible) - * for validating the image - */ - TSize DecodeSize( const TSize& aSize ); - - /** - * Retrieves the mime type from the file - * - * @param filename for which the mimetype to be find - */ - void StoreMimeTypeL(const TDesC& aFilename); - - /** - * Verifies selected files - * - * @param aSelectedFiles Array of files to be verified - */ - TBool VerifySelectedFilesL( const MDesCArray* aSelectedFiles ); - - -private: // Data - - // Exit reason for server apps - TInt iServerAppExitReason; - - // Activescheduler wait - CActiveSchedulerWait iWait; - - // apa session owns - RApaLsSession iApaSession; - - // owns, document handler - CDocumentHandler* iDocHandler; - - // owns - CImageDecoder* iDecoder; - - //owns - HBufC8* iMimeType; - }; - -#endif // CVIMPSTUIAVATARSELECTIONHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuiblockview.h --- a/uiservicetab/vimpstui/inc/cvimpstuiblockview.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,189 +0,0 @@ -/* -* Copyright (c) 2008 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: Block view declaration - * -*/ - - -#ifndef CVIMPSTUIBLOCKVIEW_H -#define CVIMPSTUIBLOCKVIEW_H - - -// INCLUDES -#include // CBase - -#include "CxSPBaseView.h" -#include "mvimpstcmdobserver.h" -#include "mvimpstengineblockedlistfetcheventobserver.h" - -// FORWARD DECLARATIONS -class CVIMPSTUiBlockViewControl; -class CVIMPSTUIExtensionService; -class MVIMPSTEngine; -class CAknNavigationDecorator; -class MVIMPSTEnginePresenceSubService; -class MVIMPSTCmdHandler; - -// CLASS DECLARATION -/** - * Search view implementation - * @lib vimpstui.lib - * @since S60 v5.0 - */ - // codescanner warnings can be ignored as CxSPBaseView derived from CBsse - -class CVIMPSTUiBlockView :public CxSPBaseView, - public MVIMPSTCmdObserver, - public MVIMPSTEngineBlockedListFetchEventObserver - { - public: // Constructors and destructor - - - /** - * Creates a new CVIMPSTUiSearchView. - * - * @param aMapper Reference to view mapper object - * @param aContactManager Reference to contact manager object - * @param aBlockViewId Block view id - * @param aView Reference to Phonebook2-created view instance - * @param aServiceData Reference to ui extension service - * @param aEngine Reference to engine object - * @return New instance of this class - */ - static CVIMPSTUiBlockView* NewL( MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aBlockViewId, - CPbk2UIExtensionView& aView, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler ); - - - - public: // From MPbk2UIExtensionView through CxSPBaseView - - /** - * @see MPbk2UIExtensionView - */ - void DoDeactivate(); - - /** - * @see MPbk2UIExtensionView - */ - void HandleCommandL( TInt aCommand ); - /** - * @see MPbk2UIExtensionView - */ - void DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ); - - /** - * @see MPbk2UIExtensionView - */ - void HandleStatusPaneSizeChange(); - - //From MVIMPSTCmdObserver - - /** - *@see MVIMPSTCmdObserver - */ - void CommandFinishedL( const MVIMPSTCmd& aCommand ); - - /** - *@see MVIMPSTCmdObserver - */ - void HandleCommandEventL( TVIMPSTEnums::TVIMPSTRegistrationState aState, - TInt aServiceError) ; - - //from MVIMPSTEngineBlockedListFetchEventObserver. - /** - *@see MVIMPSTEngineBlockedListFetchEventObserver - */ - void HandleBlockedListFetchCompleteL() ; - private: // From CxSPBaseView - - /** - * @see CxSPBaseView - */ - void DoActivateViewL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - - /** - * This function updates text to navi pane - */ - void UpdateNaviPaneTextL( ); - - void FetchBlockedListFromServerL(); - - private: - - /** - * Standard C++ constructor - * @param aMapper Reference to view mapper object - * @param aContactManager Reference to contact manager object - * @param aBlockViewId Block view id - * @param aView Reference to Phonebook2-created view instance - * @param aServiceData Reference to ui extension service - * @param aEngine Reference to engine object - */ - CVIMPSTUiBlockView( MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aBlockViewId, - CPbk2UIExtensionView& aView, - CVIMPSTUIExtensionService& aServiceData , - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - /** - * Standard C++ destructor. - */ - ~CVIMPSTUiBlockView(); - - private: // Data - - // Own: This view's control container - CVIMPSTUiBlockViewControl* iContainer; - - // Stores view id - TUint iBlockViewId; - - //Doesnt own - reference to engine for this service - MVIMPSTEngine& iEngine; - - // Own: Used for navigation pane text - CAknNavigationDecorator* iNaviDecorator; - - //doesnt own, refernec to extension service - CVIMPSTUIExtensionService& iExtensionService; - - //Not owned; pointer to instance of prsece sub service - MVIMPSTEnginePresenceSubService* iPresenceSubService; - - //Not owned; blocked list array pointer - RPointerArray* iBlockedList; - - //Doesnt own - reference to Command handler for this service - MVIMPSTCmdHandler& iCommandHandler; - }; - -#endif // CVIMPSTUIBLOCKVIEW_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuiblockviewcontrol.h --- a/uiservicetab/vimpstui/inc/cvimpstuiblockviewcontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -/* -* Copyright (c) 2008 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 : block view control. - * -*/ - -#ifndef __CVIMPSTUIBLOCKVIEWCONTROL_H -#define __CVIMPSTUIBLOCKVIEWCONTROL_H - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CAknSingleGraphicStyleListBox; -class MVIMPSTEngine; -class MPbk2KeyEventHandler; -class MVIMPSTCmdHandler; -class CVIMPSTUiBlockView; -// CLASS DECLARATION -/** - * Search view control. Shows search results - * @lib vimpstui.lib - * @since S60 v5.0 - */ -class CVIMPSTUiBlockViewControl : public CCoeControl, - public MEikListBoxObserver, - public MCoeControlObserver - { - - public: // Constructor and destructor - /** - * Creates a new CVIMPSTUiBlockViewControl. - * @param aBlockedView, reference to blocked view. - * @param aKeyEventHandler, reference to keyeventhandler. - * @param aEngine reference to engine. - * @param aBlockedList pointer to block list. - */ - static CVIMPSTUiBlockViewControl* NewL( CVIMPSTUiBlockView& aBlockedView, - MPbk2KeyEventHandler& aKeyEventHandler, - MVIMPSTEngine& aEngine, - RPointerArray* aBlockedList ); - - /** - * Creates a new CVIMPSTUiBlockViewControl and leaves it to - * cleanup stack. - * @see NewL - */ - static CVIMPSTUiBlockViewControl* NewLC( CVIMPSTUiBlockView& aBlockedView, - MPbk2KeyEventHandler& aKeyEventHandler, - MVIMPSTEngine& aEngine, - RPointerArray* aBlockedList ); - - /** - * Destructor. - */ - ~CVIMPSTUiBlockViewControl(); - - - private: - - /** - * Standard C++ constructor - * see NewL. - */ - CVIMPSTUiBlockViewControl( CVIMPSTUiBlockView& aBlockedView, - MPbk2KeyEventHandler& aKeyEventHandler, - MVIMPSTEngine& aEngine, - RPointerArray* aBlockedList); - - /** - * Performs the 2nd phase of construction. - * - */ - void ConstructL(); - - public: // New functions - - /** - * sets the primary and secondary text of this view - */ - void SetEmptyTextsToListboxL(); - - /** - * Updates the list box with blocked contact data - */ - void UpdateBlockedListL(); - - - /** - * returns the list box - */ - CEikListBox* ListBox() const; - - /** - * extracts the contactId ,allocates memory for contactId and returns - * Owership of the contactId is transfered to caller - * - * @return contactId : Owenership to caller - */ - HBufC* GetFocusedContactLC() const; - - /** - * Updates Softkeys according to current focus - * Default value is false. - */ - void UpdateCbaL(); - - /** - * @return,return current list box item index. - */ - TInt GetCurrentIndex() const; - - /** - * set focus on aIndex item. - * @param aIndex, Index of item.on which focus will set. - */ - void SetCurrentIndex(TInt aIndex); - - /** - * set the background text to indicate that retriving list from server.. - */ - void SetUpdatingTextsToListboxL(); - - private: // Functions MCoeControlObserver - - /** - * Handles events from findpane and forwards them to listbox filter. - * @see MCoeControlObserver - */ - void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ); - - /** - * From MEikListBoxObserver, Handles event's generated by listbox - * @param aListBox Pointer to listbox from where this event originated - * @param aEventType Type of event received. - */ - void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); - - - /** - * From CoeControl, Returns the number of control contained by this class. - * @return Number of controls contained - */ - TInt CountComponentControls() const; - - /** - * From CCoeControl, Returns handle to control pointed by aIndex - * @param aIndex Wanted control's index [0..n] - * @return Handle to wanted control - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * From CCoeControl,respond to size chnaged - */ - void SizeChanged(); - - /** - * From CCoeControl, Handles key-events - * @param aEvent Event that occured - * @param aType Type of key-event (EEventKey, EEventKeyUp or EEventKeyDown) - * @return Containers response to event (EKeyWasNotConsumed/ EKeyWasConsumed) - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); - - private: // Data - - //Not owned: reference to blocked view. - CVIMPSTUiBlockView& iBlockedView; - - // Not owned: key event handler - MPbk2KeyEventHandler& iKeyEventHandler; - - //Owns - CAknSingleGraphicStyleListBox* iListBox; - - //Owns - CDesCArray* iItemArray; - - //Doesnt own - reference to engine for this service - MVIMPSTEngine& iEngine; - - // CBA. not owned - CEikButtonGroupContainer* iCba; - - //pointer to blocked list - RPointerArray* iBlockedList;//does not own.. - - //store the focused list box item index. - TInt iCurrentItemIndex; - }; - -#endif // __CVIMPSTUIBLOCKVIEWCONTROL_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuibranddata.h --- a/uiservicetab/vimpstui/inc/cvimpstuibranddata.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -/* -* Copyright (c) 2008 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: Brand handler -* -*/ - - - -#ifndef _CVIMPSTUIBRANDDATA_H -#define _CVIMPSTUIBRANDDATA_H - -// INCLUDES -#include -#include // MDesCArray -#include -#include -#include -#include - -//Forward Declarations -class CBSFactory; -class MBSAccess; -class MVIMPSTEngine; - - -// CLASS DECLARATION - -/** - * Brand handler - * - * @lib vimpstui.dll - * @since 5.0 - */ -class CVIMPSTUiBrandData : public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aAppId : application Id - * @param aBrandId : Brand Id - * @param aLanguageId : Language Id - **/ - static CVIMPSTUiBrandData* NewL(MVIMPSTEngine& aEngine); - - - /** - * Destructor. - **/ - virtual ~CVIMPSTUiBrandData(); - public: // New Functions - - /** - * Loads necessary icons for this decorator - * @return Icon array. Ownership is transferred. - **/ - CAknIconArray* LoadIconsLC( ); - - - /** - * Loads necessary icons for Own status decorator - * @return Icon array. Ownership is transferred. - **/ - CAknIconArray* LoadOwnStatusIconsLC( ); - /** - * Gets you bitmaps to construct branded icons - * @param aBitmap bitmap id to be fetched from Branding server - * @param aMask bitmap id to be fetched from Branding server - * @return error code. - **/ - TInt GetBrandBitmapsL(CFbsBitmap **aBitmap, CFbsBitmap **aMask); - - /** - * helper function to check branding is supported or not - **/ - TBool IsBrandingSupported(); - /** - * Get the string, To be shown as terms of use befor login. - * ownership is transfered - * @return ToU String.If does not find then return NULL. - **/ - HBufC* GetToUStringL(); - - - private: - - /** - * Loads necessary icons for this decorator - * @return Icon array. - **/ - CAknIconArray* LoadIconsL( ); - - /** - * Loads brand icons for this decorator - * @return Icon array. Ownership is transferred. - **/ - CAknIconArray* LoadBrandIconsL( ); - - - - /** - * Loads brand icons for ownstatus - * @return Icon array. Ownership is transferred. - **/ - CAknIconArray* LoadBrandOwnStatusIconsLC( ); - - - - /** - * Loads default icons for ownstatus - * @param aMbmFile Bitmap file - * @return Icon array. Ownership is transferred. - **/ - CAknIconArray* LoadDefaultOwnStatusIconsLC(const TDesC& aMbmFile ); - - /** - * constructs necessary icons for this decorator - * @param aBitmapId bitmapId - * @param aMaskId maskId - * @param aFullPath Bitmap path - * @return Icon. - **/ - CGulIcon* LoadDefaultBitmapL( TInt aBitmapId, - TInt aMaskId, - const TDesC& aFullPath ); - - /** - * constructs branded icons for this decorator - * @param aId id of the bitmap to be fetchec from the Branding server. - * @return Icon. - **/ - CGulIcon* LoadBrandBitmapL( const TDesC8& aId ); - - - private: - - /** - * C++ default constructor. - * @param aContacts Pointer to contacts-API - */ - CVIMPSTUiBrandData(); - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(MVIMPSTEngine& aEngine); - - /** - * Prepares branding access - * @return KErrNone if sucessfull, else the Error. - * @since S60 5.0 - */ - TInt PrepareBrandingAccess(); - - /** - * get branded string. - * @return Branded string - * ownership is transfered - * @since S60 5.0 - */ - HBufC* GetToUBrandedStringL(); - - /* - * Concatenates the two descriptors. - */ - HBufC* ConcatLC( TDesC& aDesc1, TDesC& aDesc2 ); - - private: // Data - - // Not own. Settings id of the service.. - const TDesC8& iAppId; - - // Not own. Settings id of the service.. - HBufC8* iBrandId; - - // Not own. Settings id of the service.. - TLanguage iLanguageId; - - //Owns, handle to brnadingfactory. - CBSFactory* iBrandingFactory; - - //Owns, handle to brandaccessor - MBSAccess* iBrandingAccess; - - //stores the default MBM path - TFileName iDefaultMbmPath; - // owns : list of availabe icons - CAknIconArray* iIconsArray; - - }; - -#endif // _CVIMPSTUIBRANDDATA_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuicontactselection.h --- a/uiservicetab/vimpstui/inc/cvimpstuicontactselection.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for cvimpstuicontactselection ,a contact selection class from pbk -* -*/ - - -// INCLUDE FILES - -#ifndef CVIMPSTUICONTACTSELECTION_H_ -#define CVIMPSTUICONTACTSELECTION_H_ - -#include - -//forward declaration. -class CVIMPSTUiTabbedView; - -// CLASS DECLARATION -/** - * contacselection implementation - * @lib vimpstui.lib - * @since S60 v5.0 - */ - -class CVIMPSTUiContactSelection : public CActive -{ -public: - /** - * Creates a new instance of this class. - * @param iViewObserver ,reference to tabbed view caller class - * @return A new instance of this class. - */ - static CVIMPSTUiContactSelection* NewL(CVIMPSTUiTabbedView& iViewObserver ); - /** - * destructor - */ - ~CVIMPSTUiContactSelection(); - - /** - * helper method to issue request. - */ - void IssueRequest(); - - -private: - - /** - * default constructor. - * @param iViewObserver ,reference to tabbed view caller class - */ - CVIMPSTUiContactSelection(CVIMPSTUiTabbedView& iViewObserver ); - -private: // From CActive - void RunL(); - void DoCancel(); - TInt RunError( TInt aError ); - -private://member variables - - //doesnt own - reference to tabbed view - // for notification about request completion - CVIMPSTUiTabbedView& iViewObserver; - -}; - - -#endif /* CVIMPSTUICONTACTSELECTION_H_ */ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuicveventlistener.h --- a/uiservicetab/vimpstui/inc/cvimpstuicveventlistener.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2008 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: Defines the corresponding TAknsItemIds for bitmaps -* Description : Handles statuspane, context pane, navi pane -* -*/ - -#ifndef CVIMPSTUICVEVENTLISTENER_H_ -#define CVIMPSTUICVEVENTLISTENER_H_ - -#include -#include - -// FORWARD DECLARATION -class CVIMPSTUiTabbedView; - -//CLASS DECLARATION -/** - * Conversation view event listner. - * - * @lib vimpstui.dll - * @since 5.0 - */ -class CVIMPSTUICvEventListener : public CActive - { -public : - // Constructor - /** - * Creates a new CVIMPSTUICvEventListener. - * @param aTabbedView, reference to tabbedview - * @return New instance of this class - */ - static CVIMPSTUICvEventListener* NewL(CVIMPSTUiTabbedView& aTabbedView ); - - /** - * Standard C++ destructor. - */ - ~CVIMPSTUICvEventListener(); - - /** - * start listening - */ - void StartListening(); - -private : // From CActive - - /** - * RunL - */ - void RunL(); - - /** - * DoCancel - */ - void DoCancel(); - - -private: // Implementation - /** - * Standard C++ constructor - * @param aTabbedView, reference to tabbedview - */ - CVIMPSTUICvEventListener( CVIMPSTUiTabbedView& aTabbedView); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - -private : - - // owns , property to use - RProperty iProperty; - // not owned, reference to tabbedview - CVIMPSTUiTabbedView& iTabbedView; - - }; - -#endif /*CVIMPSTUICVEVENTLISTENER_H_*/ diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuidoublelistboxarray.h --- a/uiservicetab/vimpstui/inc/cvimpstuidoublelistboxarray.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* Copyright (c) 2008 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: CVIMPSTUiDoubleListboxArray-array decorator -* -*/ - - - -#ifndef _CVIMPSTUIDIUBLELISTBOXARRAY_H -#define _CVIMPSTUIDIUBLELISTBOXARRAY_H - -// INCLUDES -#include -#include // MDesCArray -#include -#include - -// FORWARD DECLARATIONS -class CFormattedCellListBoxData; -class CColumnListBoxData; -class CVIMPSTUiListBoxModel; -class CVIMPSTUiDoubleStyleListBox; -class MVIMPSTProcessArray; -class CFont; -class CVIMPSTUiDoubleListBoxTabViewControl; - -// CLASS DECLARATION - -/** - * Friends-array decorator. - * Decorates the array for listbox - * - * @lib vimpstui.dll - * @since 5.0 - */ -class CVIMPSTUiDoubleListboxArray : public CBase, public MDesCArray - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aItemModel that contains the data. - * @param aListBoxData Listbox data for setting row properties, - * can be NULL. - * @param aListBox Listbox - */ - static CVIMPSTUiDoubleListboxArray* NewL( - MVIMPSTProcessArray& aItemModel, - CFormattedCellListBoxData* aListboxData, - CVIMPSTUiDoubleStyleListBox& aListBox, - CVIMPSTUiDoubleListBoxTabViewControl& aTabbedviewControl); - - /** - * Destructor. - */ - virtual ~CVIMPSTUiDoubleListboxArray(); - - - public: // Functions from MDesCArray - - /** - * From MDesCArray, Returns the number of descriptor elements in - * a descriptor array. - * @see MDesCArray - */ - TInt MdcaCount() const; - - /** - * From MDesCArray, Indexes into a descriptor array. - * @see MDesCArray - */ - TPtrC16 MdcaPoint( TInt aIndex ) const; - - - private: // new functions - - void AppendOwnDataL( TPtr& aBuffer, - TInt aIndex ) const; - - - - private: - - /** - * C++ default constructor. - * @param aItemModel that contains the data. - * @param aListBoxData Listbox data for setting row properties, can be NULL. - * @param aListBox Listbox - */ - CVIMPSTUiDoubleListboxArray( MVIMPSTProcessArray& aItemModel, - CFormattedCellListBoxData* aListboxData ,CVIMPSTUiDoubleStyleListBox& aListBox, - CVIMPSTUiDoubleListBoxTabViewControl& aTabbedviewControl); - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(); - - private: // Data - - // wrapper array on engine side arrays - MVIMPSTProcessArray& iItemArray; - - // Doesn't own. Pointer to listbox data for setting row properties - CFormattedCellListBoxData* iListboxData; - - //Ref. to Contact List Box - CVIMPSTUiDoubleStyleListBox& iListBox; - - // Owns. Buffer that hold's information about fetched item - HBufC* iData; - - // maxmimun length of icon strings added to formatted text - TInt iMaxLengthOfIcons; - - // pointers to listbox fonts, contained objects are not owned - RPointerArray iFonts; - // Not own. Model to check the real location of items. - CVIMPSTUiListBoxModel* iContactListBoxModel; - CVIMPSTUiDoubleListBoxTabViewControl& iTabbedviewControl; - - // to hold the value whether presence is supported or not for the service - TBool iPresenceSupported; - // to hold the value whether im is supported or not for the service - TBool iIMSupported; - - }; - -#endif // _CVIMPSTUIDIUBLELISTBOXARRAY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuidoublelistboxtabviewcontrol.h --- a/uiservicetab/vimpstui/inc/cvimpstuidoublelistboxtabviewcontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,382 +0,0 @@ -/* -* Copyright (c) 2008 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: tabbed view control implementation class with doublestyle listbox -* -*/ - -#ifndef __CVIMPSTUIDOUBLELISTBOXTABVIEWCONTROL_H -#define __CVIMPSTUIDOUBLELISTBOXTABVIEWCONTROL_H - -#include "mvimpstuitabbedviewcontrol.h" -#include "mvimpstprocessArrayobserver.h" -#include "cvimpstuidoublestylelistbox.h" - -class CVIMPSTUiDoubleStyleListBox; - -// CLASS DECLARATION -/** - * Tabbed view control. Shows list of contacts. - * @lib vimpstui.lib - * @since S60 v5.0 - */ -class CVIMPSTUiDoubleListBoxTabViewControl :public CCoeControl, - public MVIMPSTProcessArrayObserver, - public MEikListBoxObserver, - public MCoeControlObserver, - public MVIMPSTUiTabbedViewControl - { - public: // Constructor and destructor - /** - * Creates a new CImContactsTabbedViewControl. - * - * @param aTabbedView reference to view. - * @param aKeyEventHandler Key event handler to be used - * @param aCommandHandler reference to commandhandler - * @param aServiceId Id of the service - * @param aBrandHandler reference to brandhandler - * @param aEngine reference to engine - */ - static CVIMPSTUiDoubleListBoxTabViewControl* NewL( CVIMPSTUiTabbedView& aTabbedView, MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, - TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba); - - /** - * Creates a new CImContactsTabbedViewControl and leaves it to - * cleanup stack. - * @see NewL - * - * @param aTabbedView reference to view. - * @param aKeyEventHandler Key event handler to be used - * @param aCommandHandler reference to commandhandler - * @param aServiceId Id of the service - * @param aBrandHandler reference to brandhandler - * @param aEngine reference to engine - */ - static CVIMPSTUiDoubleListBoxTabViewControl* NewLC( CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, - TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba); - - /** - * Destructor. - */ - ~CVIMPSTUiDoubleListBoxTabViewControl(); - - public : // from MIMArrayProcessObserver - /** - * @see MIMArrayProcessObserver. - */ - void HandleAdditionL(TVIMPSTEnums::TItem type, TInt aIndex); - - /** - * @see MIMArrayProcessObserver. - */ - void HandleDeletionL(TVIMPSTEnums::TItem type, TInt aIndex); - /** - * @see MIMArrayProcessObserver. - */ - void HandleAvatarChangeL( const TDesC& aUserId ); - - public://from MEikListBoxObserver - - /** - * From MEikListBoxObserver, Handles event's generated by listbox - * @see MEikListBoxObserver - */ - void HandleListBoxEventL( CEikListBox* aListBox, - TListBoxEvent aEventType ); - - public: //from MCoeControlObserver - /** - * Handles events from findpane and forwards them to listbox filter. - * @see MCoeControlObserver - */ - void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ); - - - /** - * Get access to listbox model's filter - * @return model's filter - */ - CAknListBoxFilterItems* ListFilter(); - - - public: // New functions - - /** - * Returns the currently focused item's index. - * @return TInt, current item index. - */ - TInt CurrentItemIndex() const; - - /** - * Sets the currently focused item's index. - * - * @param aIndex new currently focused index - */ - void SetCurrentItemIndex( TInt aIndex ); - - /** - * Sets the currently focused item's index and updates the control - * on the display. - * - * @param aIndex new currently focused index - */ - void SetCurrentItemIndexAndDraw( TInt aIndex ); - - /** - * Handles item addition for this control. - */ - void HandleItemAdditionL(); - - /** - * Handles item removal for this control. - */ - void HandleItemRemovalL(); - - /** - * Sets list box empty text. - * - * @param aResourceId resource id of a empty text - */ - void SetListEmptyTextL( TInt aResourceId ); - - /** - * send the message using selected item - * this will launch the conversation view if im is enabled. - */ - void SendMessageL(); - - /** - * Updates view after edit. - * @param aIndex is the index of item that has changed. - * @param aType is list item type. - */ - void UpdateViewL( TInt aIndex, TVIMPSTEnums::TItem aType); - - - /** - * @see MVIMPSTUiTabbedViewControl. - */ - void HandleAvatarRefreshL( const TDesC& aUserId,TBool aBlock); - - - - /** - * LoadsBitmap array. - */ - void LoadBitmapsL(); - - - - /** - * Gets the owned listbox control - * - * @return the owned list box - */ - CVIMPSTUiDoubleStyleListBox& ListBox() const; - - /** - * Activates find-pane - */ - void ActivateFindPaneL(); - - /** - * De-activates find-pane - */ - void DeactivateFindPaneL(); - - /** - *Handle the avatar deletion in UI - */ - void SetFocussedId(const TDesC& aContact) ; - - /** - * the avatar deletion in UI - */ - TPtrC GetFocussedId() ; - - private: // From CCoeControl, standard control functionality - - /** - * @see CCoeControl - */ - TKeyResponse OfferKeyEventL - ( const TKeyEvent& aKeyEvent, TEventCode aType ); - - /** - * @see CCoeControl - */ - void SizeChanged(); - - /** - * @see CCoeControl - */ - TInt CountComponentControls() const; - - /** - * @see CCoeControl - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * @see CCoeControl - */ - void FocusChanged( TDrawNow aDrawNow ); - - - private: // Implementation - /** - * Standard C++ constructor - * - * @param aTabbedView reference to view. - * @param aKeyEventHandler Key event handler to be used - * @param aCommandHandler reference to commandhandler - * @param aServiceId Id of the service - * @param aBrandHandler reference to brandhandler - * @param aEngine reference to engine - */ - CVIMPSTUiDoubleListBoxTabViewControl( CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, - TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba); - - /** - * Performs the 2nd phase of construction. - * - */ - void ConstructL(); - - /** - * Layouts current components according to AVKON LAF - */ - void SetLayout(); - - /** - * NOTE : PASSING NULL DESCRIPTOR IS NOT ALLOWED - * NO CHECK FOR THE NULL DESCPRIPTOR - * - * Utility function to create Icons from - * image data using Image processor - * - * @param aAvatarContent : avatar content - * - * @return CGulIcon icon created , returns NULL in case of errors - */ - CGulIcon* AvatarToIconL( const TDesC8& aAvatarContent ); - - - void SetFocusAndMakeItemVisible(); - - public: - - /** - * Sets the iClrFindPaneFlag - */ - void SetClrFindPaneFlag(TBool aFlag); - - /** - * Checks if the last contact is focused and Sets the iLastItemFlag - */ - void CheckAndSetLastItemFlag(); - - /** - * returns the CCoeControl* pointer - */ - CCoeControl* CoeControl(); - - /** - * Sets the lock status of softkeys - * @param aLock new status of lock (ETrue: locked, EFalse: Unlocked) - */ - void SetCbaLockL( TBool aLock ); - - /** - * Updates Softkeys according to current focus - * @param aUseDefaultCba Flag to force the default sofkeys for view. - * Default value is false. - */ - void UpdateCbaL( TBool aUseDefaultCba = EFalse ); - - - private: // Data - - // not owned - CVIMPSTUiTabbedView& iTabbedView; - - // Not owned: key event handler - MPbk2KeyEventHandler* iKeyEventHandler; - - //Holds the Ref to CMd Handler - Doesnt Own - MVIMPSTCmdHandler& iCommandHandler; - - //Doesnt Own - MVIMPSTProcessArray& iArrayProcess; - - //Service Id - TUint32 iServiceId ; - - //doesnt own - Brand Handler - CVIMPSTUiBrandData& iBrandHandler; - - //doesnt own - Engine Handler - MVIMPSTEngine& iEngine; - - // Owns. Listbox to view friends-list data - CVIMPSTUiDoubleStyleListBox* iListBox; - - // Owns. Search field. - CAknSearchField* iFindbox; - - // is find pane visible. - TBool iFindPaneIsVisible; - - //current state - TBool iCurrentState; - - // Owns: Flag to check whether the last contact was selected - TBool iLastItemFlag; - - CFbsBitmap* iBitmap; - - TInt iAvatarError; - - // CBA. not owned - CEikButtonGroupContainer* iCba; - - // Lock status foc softkeys - TBool iCbaLock; - - // Storage for previous focus - TVIMPSTEnums::TItem iLastFocusedItemType; - - //flag to check to clear find pane - TBool iClrFindPaneFlag; - - //indicate command to be executed on enter key Event. - TInt iCurrentCmdToExe; - - - }; - -#endif // __CVIMPSTUIDOUBLELISTBOXTABVIEWCONTROL_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuidoublestylelistbox.h --- a/uiservicetab/vimpstui/inc/cvimpstuidoublestylelistbox.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2008 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: Custom listbox component for the contact list -* -*/ - - -#ifndef _CVIMPSTUIDOUBLESTYLELISTBOX_H -#define _CVIMPSTUIDOUBLESTYLELISTBOX_H - -#include - -// FORWARD DECLARATIONS -class MVIMPSTProcessArray; -class CVIMPSTUiListBoxModel; - -//CLASS DECLARATION -/** - * double style / 2 line Custom listbox component for the contact list - * - * Allows to change the model for the listbox. - * This is done because we have to customize the behaviour of the find pane, - * so that filtered list shows also the contact lists where the searched - * contacts exist. - * - * @lib vimpstui.dll - * @since S60 v5.0 - */ -class CVIMPSTUiDoubleStyleListBox : public CAknDoubleLargeStyleListBox - - { - -public: - - /** - * Creates the model - * - */ - void CreateModelL(); - - ~CVIMPSTUiDoubleStyleListBox(); - -public: // New functions - - /** - * Give listbox a direct access to contact list model. - * @param aContactListModel Model of this listbox - */ - void SetContactListModelL(MVIMPSTProcessArray& aItemModel ); -private: - CVIMPSTUiListBoxModel* iListBoxModel; - - }; - - -#endif // _CVIMPSTUIDOUBLESTYLELISTBOX_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuiextensionfactory.h --- a/uiservicetab/vimpstui/inc/cvimpstuiextensionfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* -* Copyright (c) 2008 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: Header for Extension factory for VIMPSTUI -* -*/ - - -#ifndef __CVIMPSTUIEXTENSIONFACTORY_H__ -#define __CVIMPSTUIEXTENSIONFACTORY_H__ - -// INCLUDES -#include -#include - -class MxSPViewMapper; -class MxSPContactManager; -class CxSPBaseView; -class CPbk2UIExtensionView; -class CCoeEnv; -class CxSPViewInfo; -class MVIMPSTEngineServiceTableFetcher; -class CVIMPSTUIViewManager; -class MVIMPSTEngineFactory; -class CVIMPSTUIMenuExtension; - -// CLASS DECLARATION -/** - * Implementation of the MxSPFactory. - * Creates instances of the extension classes. - */ -// codescanner warnings can be ignored as CxSPFactory derived from CBase - -class CVIMPSTUiExtensionFactory : public CxSPFactory // CSI: 51 # - { - public: // Construction and destruction - /** - * Static factory function that performs the 2-phased construction. - * @return Newly created CVIMPSTUiExtensionFactory. - */ - static CVIMPSTUiExtensionFactory* NewL(); - - /** - * Standard C++ destructor. - */ - ~CVIMPSTUiExtensionFactory(); - - private: // from MxSPFactory - - /** - * @see MxSPFactory - */ - CxSPBaseView* CreateViewL( TUid aViewId, CPbk2UIExtensionView& aView ); - - /** - * @see MxSPFactory - */ - void RegisterViewMapper( MxSPViewMapper& aMapper ); - - /** - * @see MxSPFactory - */ - TInt ViewInfoResource() const; - - /** - * @see MxSPFactory - */ - TUint32 Id() const; - - /** - * @see MxSPFactory - */ - const TDesC& Name() const; - - /** - * @see MxSPFactory - */ - void RegisterContactManager( MxSPContactManager& aManager ); - - /** - * @see MxSPFactory - */ - void SetVPbkContactManager( CVPbkContactManager& aVPbkContactManager ); - - /** - * @see MxSPFactory - */ - void UpdateStorePropertiesL( CPbk2StorePropertyArray& aPropertyArray ); - private: - /** - * Gets view count of this extension. - * This is alternative B for providing view information. - * Alternative A is to use ViewInfoResource method. If - * this alternative B is used, ViewInfoResource method - * must return KErrNotFound - * - * @return view count - */ - TInt ViewInfoCount() const ; - - /** - * Gets view info at specified index. - * This is alternative B for providing view information. - * Alternative A is to use ViewInfoResource method. If - * this alternative B is used, ViewInfoResource method - * must return KErrNotFound - * - * @param aIndex index - * @return view info at specified index - */ - const MxSPViewInfo* ViewInfo( TInt aIndex ) const ; - - private: - /** - * Finds the total number of services and creates different views for - * different services - * @param None - * @return None - */ - void CreateServicesL(); - /** - * Tells if it is search view's id - * @param aId - */ - - TBool IsSearchId( TUint aId ); - - /** - * Tells if it is block view's id - * @param aId - */ - TBool IsBlockeId( TUint aId ); - - /** - * Tells if it is tabbed view's id - * @param aId, if its a tabbed view - */ - TBool IsTabbedId( TUint aId ); - - private: // Implementation - /** - * Standard C++ constructor. - */ - CVIMPSTUiExtensionFactory(); - - /** - * Performs the 2nd phase of the construction. - */ - void ConstructL(); - - private: // Data - // environment - CCoeEnv& iCoeEnv; - - // offset index for resource file - TInt iResourceOffset; - - // Owns, view id mapper - MxSPViewMapper* iMapper; - - //Owns, contact manager - MxSPContactManager* iContactManager; - - // Owns, engine for all services - CVIMPSTUIViewManager* iEngine; - - //Doesnt Own. Need to call CVIMPSTEngineFactory::Release for Releasing this memory - MVIMPSTEngineFactory* iEngineFactoryInstance; - - //own's. menuextension. - CVIMPSTUIMenuExtension* iMenuExtension; - - }; - -#endif // _CVIMPSTUiExtensionFactory_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuiextensionservice.h --- a/uiservicetab/vimpstui/inc/cvimpstuiextensionservice.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,352 +0,0 @@ -/* -* Copyright (c) 2008 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: Header for extension service -* -*/ - - -#ifndef C_CVIMPSTUIEXTENSIONSERVICE_H -#define C_CVIMPSTUIEXTENSIONSERVICE_H - -// INCLUDES -#include -#include -#include "tvimpstenums.h" - -// FORWARD DECLARATINS -class CVIMPSTUiTabbedView; -class CVIMPSTUiSearchView; -class CVIMPSTUIExtensionViewInfo; -class MxSPViewMapper; -class CPbk2UIExtensionView; -class MxSPContactManager; -class MVIMPSTEngine; -class CVIMPSTUiBrandData; -class MVIMPSTCmdHandler; -class CVIMPSTUiSearchFieldArray; -class CVIMPSTUiBlockView; -class CVIMPSTUIMenuExtension; - -// CLASS DECLARATION - -/** - * Extension Service - * This class represents one service - * - * @lib vimpstui.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTUIExtensionService ) : public CBase - { - public: // Constructor and destructor - - /** - * Two-phased constructor. - * - * @param aServiceId, service id - * @param aTabbedViewId, tabbed view id for this service - * @param aSearchViewId, Search view id for this service - * @param aServiceName, - * @param aEngine, engine for logic handling - */ - static CVIMPSTUIExtensionService* NewL( - TUint aServiceId, - TInt aTabbedViewId, - TInt aSearchViewId, - TInt aBlockedViewId, - const TDesC& aServiceName, - CVIMPSTUIMenuExtension& aMenuExtension, - MVIMPSTEngine& aEngine ); - - /** - * Two-phased constructor. - * - * @param aService, service id - * @param aTabbedViewId, tabbed view id for this service - * @param aSearchViewId, Search view id for this service - * @param aServiceName, - * @param aEngine, engine for logic handling - */ - static CVIMPSTUIExtensionService* NewLC( - TUint aServiceId, - TInt aTabbedViewId, - TInt aSearchViewId, - TInt aBlockedViewId, - const TDesC& aServiceName, - CVIMPSTUIMenuExtension& aMenuExtension, - MVIMPSTEngine& aEngine ); - - /** - * Standard C++ destructor - */ - ~CVIMPSTUIExtensionService(); - - - - public: - - /** - * Returns pointer to tabbed view of this service. - * Ownership is passed - * - * @param aMapper, view mapper - * @param aContactManager, contact manager - * @param aView, view - * @param aTabbedViewId, tabbed view id - * @param aId, id - * @return CVIMPSTUiTabbedView*, pointer - * to tabbed view. Ownership is passed. - */ - CVIMPSTUiTabbedView* TabbedViewL( - MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - CPbk2UIExtensionView& aView, - TInt aTabbedViewId, - TUid aId, - MVIMPSTEngine& aEngine ); - - /** - * Returns pointer to Search view of this service. - * Ownership is passed - * - * @param aMapper, view mapper - * @param aContactManager, contact manager - * @param aView, view - * @param aSearchViewId, search view id - * @param aId, old view id for search view - * @return CVIMPSTUiSearchView*, pointer - * to tabbed view. Ownership is passed. - */ - CVIMPSTUiSearchView* SearchViewL( - MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - CPbk2UIExtensionView& aView, - TInt aSearchViewId, - TUid aId, - MVIMPSTEngine& aEngine ); - - /** - * Returns pointer to Block view of this service. - * Ownership is passed - * - * @param aMapper, view mapper - * @param aContactManager, contact manager - * @param aView, view - * @param aSearchViewId, search view id - * @return CVIMPSTUiSearchView*, pointer - * to tabbed view. Ownership is passed. - */ - CVIMPSTUiBlockView* BlockViewL( - MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - CPbk2UIExtensionView& aView, - TInt aSearchViewId, - MVIMPSTEngine& aEngine ); - - /** - * Returns tabbed view id assigned to this service - * - * @return TInt, tabbed view id of this service - */ - TInt TabbedViewId(); - - /** - * Returns Search view id assigned to this service - * - * @return TInt, details view id of this service - */ - TInt SearchViewId(); - - /** - * Returns Block view id assigned to this service - * - * @return TInt, details view id of this service - */ - TInt BlockViewId(); - - /** - * Returns service id - * - * @return TInt, service id - */ - TUint32 ServiceId(); - - - /** - * Returns pointer of tabbed view info. Ownership is passed. - * - * @return CVIMPSTUIExtensionViewInfo, view info data - */ - CVIMPSTUIExtensionViewInfo* TabbedViewInfoL(); - - /** - * Returns pointer of Search view info. Ownership is passed. - * - * @return CVIMPSTUIExtensionViewInfo, view info data - */ - CVIMPSTUIExtensionViewInfo* SearchViewInfo(); - - /** - * Returns pointer of Blocked view info. Ownership is passed. - * - * @return CVIMPSTUIExtensionViewInfo, view info data - */ - CVIMPSTUIExtensionViewInfo* BlockedViewInfo(); - - - - /** - * Returns service name - * - * @return TDesC&, service name - */ - const TDesC& ServiceName(); - - - /** - * Returns search string - * - * @return TDesC&, search string - */ - const TDesC& SearchString(); - - /** - * Sets search string - * - * @param aSearchString, search string used in search view for navi pane text - */ - void SetSearchStringL( const TDesC& aSearchString ); - - /** - * Checks if this service has aViewId in use. - * - * @since S60 5.0 - * @param aViewId, view id to check - * @return ETrue if aViewId belongs to this service - */ - TBool HasViewId( TInt aViewId ); - - /** - * Returns service Engine - * - * @return Ref to the Engine - */ - MVIMPSTEngine& ServiceEngine (); - - /** - * set all search field found from server - * @param aEnumKeysArray, array of enums key field - * @param aLebelKeysArray, array of label key field - */ - void SetSearchFieldsDataL( RArray& aEnumKeysArray, RPointerArray& aLebelKeysArray ) ; - - /** - * @returns search field array refernce - */ - CVIMPSTUiSearchFieldArray& GetSearchFieldArray() ; - - private : - /** - * get label of given search key - * - * @returns HBufC* lable of the given search key. - */ - HBufC* GetSearchKeyLabelL(TVIMPSTEnums::TVIMPSTSearchKey aSearchKey ,TBool& aBasicField ) ; - - /** - * sort the basic field in order of - * first name , last name and user - */ - void SortBasicFields() ; - - private: // Implementation - - /** - * Standard C++ constructor - * @param aServiceId, service id - * @param aTabbedViewId, tabbedview id - * @param aSearchViewId, search view id - * @param aEngine, reference to engine. - */ - CVIMPSTUIExtensionService( - TUint aServiceId, - TInt aTabbedViewId, - TInt aSearchViewId, - TInt aBlockedViewId, - CVIMPSTUIMenuExtension& aMenuExtension, - MVIMPSTEngine& aEngine ); - - /** - * Performs the 2nd phase of construction. - * @param aServiceName, name of the installed service. - */ - void ConstructL(const TDesC& aServiceName); - - private: // Data - - // Service id of this service - TUint32 iServiceId; - - // tabbed view id for this service - TInt iTabbedViewId; - - // search view id for this service - TInt iSearchViewId; - - // blocked view id for this service - TInt iBlockedViewId; - - //does not own, reference to menu extension - CVIMPSTUIMenuExtension& iMenuExtension; - - // Own Service name - HBufC* iServiceName; - - // Not own, tabbed view class for this service - CVIMPSTUiTabbedView* iTabbedView; - - //Not own,search view class for this subservice if supported - CVIMPSTUiSearchView* iSearchView; - - CVIMPSTUiBlockView* iBlockedView; - - // Not own, tabbed view info of this service - CVIMPSTUIExtensionViewInfo* iTabbedViewInfo; - - // Not own, search view info of this service - CVIMPSTUIExtensionViewInfo* iSearchViewInfo; - - // Not own, search view info of this service - CVIMPSTUIExtensionViewInfo* iBlockViewInfo; - - //not owned - MVIMPSTEngine& iEngine; - - //Owns command Handler for this view - MVIMPSTCmdHandler* iCommandHandler; - - /** Owns Search string - * used to show the string in search view's navi pane - * remove if there any other way to do the same - */ - HBufC* iSearchString; - - // owns , collection of all supported fields - CVIMPSTUiSearchFieldArray* iUiFieldsArray; - - }; - -#endif // C_CVIMPSTUIEXTENSIONSERVICE_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuiextensionviewinfo.h --- a/uiservicetab/vimpstui/inc/cvimpstuiextensionviewinfo.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ -/* -* Copyright (c) 2008 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: Header for Extension View info -* -*/ - - -#ifndef C_VIMPSTUIEXTENSIONVIEWINFO_H -#define C_VIMPSTUIEXTENSIONVIEWINFO_H - -#include -#include - -/** - * Extension View Info - * - * This class encapsulates xSP Extension View Info data - * - * @lib vimpstui.lib - * @since S60 v5.0 - */ -class CVIMPSTUIExtensionViewInfo : public CBase, - public MxSPViewInfo - { - -public: - - /** - * Two-phased constructor. - * @param aViewId, view id. - * @param aIsTabbedView, ETrue if its a tabbed view, else EFlase. - * @param aIconFile, reference to icon file used to display icon in the tab. - * @param aIconId, icon id. - * @param aMaskId, mask id. - * @param aServiceName, name of the service. - */ - static CVIMPSTUIExtensionViewInfo* NewL( - TUint32 aViewId, - TBool aIsTabbedView, - const TDesC& aIconFile, - TUint aIconId, - TUint aMaskId, - const TDesC& aServiceName ); - - /** - * Two-phased constructor. - * @param aViewId, view id. - * @param aIsTabbedView, ETrue if its a tabbed view, else EFlase. - * @param aIconFile, reference to icon file used to display icon in the tab. - * @param aIconId, icon id. - * @param aMaskId, mask id. - * @param aServiceName, name of the service. - */ - static CVIMPSTUIExtensionViewInfo* NewLC( - TUint32 aViewId, - TBool aIsTabbedView, - const TDesC& aIconFile, - TUint aIconId, - TUint aMaskId, - const TDesC& aServiceName ); - - /** - * Standard C++ destructor - */ - ~CVIMPSTUIExtensionViewInfo(); - -public: //MxSPViewInfo - - /** - * @see MxSPViewInfo - * Returns old view id. - * - * @return, TInt32, old view id - */ - TInt32 OldViewId() const; - - /** - * @see MxSPViewInfo - * Returns ETrue if this is tabbed view - * - * @return, TBool, tabbed or not - */ - TBool TabView() const; - - /** - * @see MxSPViewInfo - * Returns tab icon id - * - * @return, TInt32, tab icon id - */ - TInt32 TabIconId() const; - - /** - * @see MxSPViewInfo - * Returns tab mask id - * - * @return, TInt32, tab mask id - */ - TInt32 TabMaskId() const; - - /** - * @see MxSPViewInfo - * Returns tab icon file - * - * @return, TDesC&, file and path of icon file - */ - const TDesC& TabIconFile() const; - - /** - * @see MxSPViewInfo - * Returns tab/service name - * - * @return, TDesC&, tab/service name - */ - const TDesC& Name() const; - - /** - * @see MxSPViewInfo - * Returns sort icon id - * - * @return, TInt32, sort icon id - */ - TInt32 SortIconId() const; - - /** - * @see MxSPViewInfo - * Returns sort mask id - * - * @return, TInt32, sort mask id - */ - TInt32 SortMaskId() const; - - /** - * @see MxSPViewInfo - * Returns sort icon file. - * - * @return, TDesC&, sort icon file name/path - */ - const TDesC& SortIconFile() const; - -private: // Implementation - - /** - * Standard C++ constructor. - * @param aViewId, view id. - * @param aIsTabbedView, ETrue if ita a tabbed view, else EFalse. - * @parma aIconId, icon id. - * @parma aMaskId, mask id. - */ - CVIMPSTUIExtensionViewInfo( TUint32 aViewId, - TBool aIsTabbedView, TUint aIconId, TUint aMaskId ); - - /** - * Performs the 2nd phase of construction. - * @param aIconFile, icon file path - * @param aServiceName, name of the service - */ - void ConstructL( const TDesC& aIconFile, - const TDesC& aServiceName ); - -private: // data - - // own, icon file path - HBufC* iIconFile; - - // Own, service name - HBufC* iServiceName; - - // View id - TUint32 iViewId; - - // Is tabbed view info or not - TBool iIsTabbedView; - - // Icon id - TUint iIconId; - - // Mask id - TUint iMaskId; - }; - -#endif // C_VIMPSTUIEXTENSIONVIEWINFO_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuiiconfileprovider.h --- a/uiservicetab/vimpstui/inc/cvimpstuiiconfileprovider.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2008 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: Friends-array decorator -* -*/ - - - -#ifndef _CVIMPSTUIICONFILEPROVIDER_H -#define _CVIMPSTUIICONFILEPROVIDER_H - -#include - -#include -#include - -#include -#include - - - class CVIMPSTUiIconFileProvider : public CBase, public MAknIconFileProvider - { - public: - /** - * Constructor - * @param aFile File handle to use - */ - CVIMPSTUiIconFileProvider( RFile& aFile ); - public: - - /** - * Destructor. - */ - virtual ~CVIMPSTUiIconFileProvider(); - - - // from base class MAknIconFileProvider - - /** - * Returns an open file handle to the icon file. - * This method should leave if an icon file with specified type does - * not exist. That may be the case e.g. with MBM file, - * if there are no bitmap icons. - * - * Note! RFs::ShareProtected must be called to the RFs instance used - * for opening the file. - * - * @param aFile Icon file should be opened in this file handle, which - * is an empty file handle, when the AknIcon framework calls this method. - * The AknIcon framework takes care of closing the file handle after - * having used it. - * @param aType Icon file type. - */ - virtual void RetrieveIconFileHandleL( - RFile& aFile, const TIconFileType /*aType*/ ); - - /** - * With this method, AknIcon framework informs that it does not use - * this MAknIconFileProvider instance any more. After this call, - * it is ok to delete the object. This can be implemented simply - * e.g. by deleting self in this callback. - * Normally, this callback is invoked when the icon in question - * is deleted. - * Note, however, that if the same MAknIconFileProvider instance is - * supplied in multiple CreateIcon calls, then it must be accessible - * by AknIcon framework until it has signalled a matching amount - * of these callbacks. - */ - virtual void Finished(); - - private: - /** - * File to use. - * Own. - */ - RFile iFile; - };//_CVIMPSTUIICONFILEPROVIDER_H - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuilistboxmodel.h --- a/uiservicetab/vimpstui/inc/cvimpstuilistboxmodel.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* Copyright (c) 2008 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: Custom listbox component for the contact list -* -*/ - - -#ifndef _CVIMPSTUILISTBOXMODEL_H -#define _CVIMPSTUILISTBOXMODEL_H - -#include - -//FORWARD DECLARATONS -class MVIMPSTProcessArray; - -//CLASS DECLARATON -/** - * Custom listbox model for the contact list - * - * Enables custom filtering (with find box) for the listbox, - * so it's possible to show also contact list names for the - * filtered contacts. - * - * @lib vimpstui.lib - * @since S60 v5.0 - */ -class CVIMPSTUiListBoxModel : public CAknFilteredTextListBoxModel - { - -public: // Constructor and Destructor - - - /** - * Default C++ constructor - */ - CVIMPSTUiListBoxModel(); - - /** - * Default C++ destructor - */ - ~CVIMPSTUiListBoxModel(); - - -public: // from CTextListBoxModel - - /** - * Returns the amount of filtered (searched) - * contacts and their contact lists - * @return Total amount of filtered (searched) contacts and their contact lists - */ - TInt NumberOfItems() const; - - /** - * Returns the text of the specified item. - * @param aItemIndex Index to the item. - * @return The text of item in given index. - */ - TPtrC ItemText(TInt aItemIndex) const; - - -public: // from MEikTextListBoxModel - - /** - * Provides the text array for the find box to search for. - * @return Pointer to the text array. - */ - const MDesCArray* MatchableTextArray() const; - - -public: // From MDesCArray - - /** - * @see MDesCArray - */ - TInt MdcaCount() const; - - /** - * @see MDesCArray - */ - TPtrC MdcaPoint( TInt aIndex ) const; - - -public: // New methods - - /** - * For setting the contactlist model to have a direct access to real model - * @param aContactListModel Model - */ - void SetContactListModel( MVIMPSTProcessArray& aItemModel ); - - /** - * Return the real index of item which is currently visible - * @param aVisibleItemIndex Currently visible item index - * @return index of the item in the non-filtered list - */ - TInt FilteredItemIndex( TInt aVisibleItemIndex ) const; - - /** - * Return the current index of item in the non-filtered list - * @param aOriginalIndex Index of the item in non-filtered list - * @return Index of the item in filtered list. KErrNotFound if not visible - */ - TInt VisibleItemIndex( TInt aOriginalIndex ) const; - -protected: // New methods - - /** - * Calculates the currently visible items. - * @return count of visible items - */ - TInt CountItems() const; - - /** - * Fetch the item text a given position - * @param aIndex Position of the item - * @return Item text - */ - TPtrC ItemAt( TInt aIndex ) const; - - /** - * Check if filter is active. - * @return ETrue: active, EFalse: deactive - */ - TBool IsFilterActive() const; - - /** - * Check if item at given index should be visible contact list. - * Meaning that it has to be a contact list and it needs - * to have at least 1 visible contact in it. - * @param aIndex Position on item - * @param aPosArray array of contacts lists positions - * @return ETrue: visible contact list, EFalse: something else - */ - TBool IsContactList( TInt aIndex, RArray& aPosArray ) const; - - -private: // Data - - // Not own. Contact list model - MVIMPSTProcessArray* iItemModel; - }; - - -#endif // _CVIMPSTUILISTBOXMODEL_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuimenuextension.h --- a/uiservicetab/vimpstui/inc/cvimpstuimenuextension.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,210 +0,0 @@ -/* -* Copyright (c) 2008 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: cvimpstuimenuextension.h - * -*/ - -#ifndef CVIMPSUIMENUEXTENSION_H -#define CVIMPSUIMENUEXTENSION_H - -// INCLUDES -#include -#include -#include "mcommandmapper.h" -#include "cmenuextension.h" -#include - -// CONSTANTS - -// FORWARD DECLARATIONS -class CEikMenuPane; -class CCommandInfo; - - -// CLASS DECLARATION - -/** - * - * This class provides extensions to options menu. - * - * @lib vimpstui.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTUIMenuExtension ) : public CBase, - public MCommandMapper, - public MVIMPSTUiAIWControl - { - public: // Constructor and destructor - - /** - * Two-phased constructor. - * - * @param aServiceName, service name. - * @param aExtensionFactory, extension factory - */ - static CVIMPSTUIMenuExtension* NewL( ); - - /** - * Two-phased constructor. - * - * @param aServiceName, service name. - * @param aExtensionFactory, extension factory - */ - static CVIMPSTUIMenuExtension* NewLC(); - - /** - * Standard C++ destructor - */ - ~CVIMPSTUIMenuExtension(); - public: // fomr MCommandMapper - /** - * Gets old original "Service Tab" command ID which corresponds - * to the given new one - * - * @param aPluginId implementation ID for identification - * @param aNewCommand New mapped command ID - * @param aOldCommand On return old/original command ID - * @return KErrNone if mapping exist, otherwise KErrNotFound - */ - TInt GetOldCommand( TInt32 aPluginId, TInt aNewCommand, - TInt& aOldCommand ) const; - - /** - * Gets new mapped "ServiceTab" command ID which corresponds - * to the given old one - * - * @param aPluginId implementation ID for identification - * @param aOldCommand Old/original command ID - * @param aNewCommand On return new mapped command ID - * @return KErrNone if mapping exist, otherwise KErrNotFound - */ - TInt GetNewCommand( TInt32 aPluginId,TInt aOldCommand, - TInt& aNewCommand ) const; - public: - /** - * offers the menu pane of the servicetab view connected to this - * extension. - * - * @param aPreviousId Menu command id after which the plugins menu - * should come. - * @param aMenuPane Menu pane which will be filtered. - * @param aServiceid service id - */ - void OfferMenuPaneToPlugins - (TInt aPreviousId, CEikMenuPane& aMenuPane,TUint aServiceId); - - /** - * Handles servicetab extension commands. - * - * @param aCommandId Command ID. - * - * @return ETrue if command was handled, otherwise EFalse. - */ - TBool OfferHandleCommandToPlugins(TInt aCommandId); - - /** - * Loads all the plugins - */ - void LoadPluginL( ); - - /** - * Map the plugin command to servicetab command - */ - void MapCommandL(CMenuExtension& aMenuExtension, TInt32 aPluginId); - - /** - * Add the entry to the map table - */ - void AddToAIWCommandMap(TInt aOriginalCommand, TInt aNewCommand); - - /** - * Finds the entry from the map table - */ - TInt GetNewAIWCommand(TInt aOriginalCommand); - - /** - * Resets the AIW Command Map - */ - void ResetAIWCommandMap(); - - public: //from interface - MVIMPSTUiAIWControl - - /** - * called by plugins to hide/unhide the AIW menu item - */ - void SetAIWItemDimmed(TInt aCommand, TBool aHide); - - private: // Implementation - - /** - * Standard C++ constructor - * @param aServiceName, service name. - * @param aExtensionFactory, extension factory - */ - CVIMPSTUIMenuExtension( ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - private: - /** - * Internal class used as a wrapper around a plugin - * and its uid. - */ - class CPluginInfo : public CBase - { - public: // Constructor & Destructor - CPluginInfo( CMenuExtension* aPlugin, TUid aUid ); - ~CPluginInfo(); - - public: // New functions - CMenuExtension& Plugin(); - private: // Data - CMenuExtension* iPlugin; - TUid iPluginUid; - }; - - private: - /** - *Internal structure used as a item in the AIW command map table - */ - struct TAIWCommandMapTableItem - { - TInt iOriginalCmd; //is used as the primary key in the table - TInt iNewCmd; //Mapped Command - }; - - private: // Data - - // New commands pool - TInt iNewCommands; - - // takes ownership of the plugins - RPointerArray iPlugins; - - // Array of command id mappings,Owned - RPointerArray iCommandIdMap; - - // AIW map table - keeps the ownership of the items - RPointerArray iAIWCommandMap; - - //doesnt owns - CEikMenuPane* iMenuPane; - - }; - -#endif // C_CVIMPSTUIVIEWMANAGER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuisearchfield.h --- a/uiservicetab/vimpstui/inc/cvimpstuisearchfield.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,173 +0,0 @@ -/* -* Copyright (c) 2008 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: search field class declaration. -* -*/ - - -#ifndef CVIMPSTUISEARCHFIELD_H -#define CVIMPSTUISEARCHFIELD_H - -// INCLUDES -#include - -#include "mvimpstuisearchfield.h" -#include "tvimpstenums.h" - -// FORWARD DECLARATIONS -class CEikCaptionedControl; - -// CLASS DECLARATION -/** - * search editor field class declaration . - * @lib vimpstui.lib - * @since S60 v5.0 - */ - -class CVIMPSTUiSearchField : public CBase, - public MVIMPSTUiSearchField - { - - public: // Constructors and destructor - - /** - * Creates a new instance of this class. - * Creates editor fields - * append the field into array from last - * @param aLebal, label of field - * @param aFieldDataType, field data type - * @param aFieldType, field type basic or advanced - * @param aSearchKey, search key - * @return A new instance of this class. - */ - static CVIMPSTUiSearchField* NewL(const TDesC& aLebal, - TVIMPSTSearchDataFieldType aFieldDataType, - TIMPSTSearchFieldTypes aFieldType, - TVIMPSTEnums::TVIMPSTSearchKey aSearchKey ); - - /** - * Destructor. - */ - ~CVIMPSTUiSearchField(); - - public: // from MVIMPSTUiSearchField - - /** - * @see MVIMPSTUiSearchField - */ - TInt ControlId() const; - - /** - * @see MVIMPSTUiSearchField - */ - HBufC* ControlTextL() const; - - /** - * @see MVIMPSTUiSearchField - */ - CEikEdwin* Control() const; - - /** - * @see MVIMPSTUiSearchField - */ - void SetControl(CEikEdwin* aControl, CEikCaptionedControl* aCaptionedCtrl) ; - - /** - * @see MVIMPSTUiSearchField - */ - void ActivateL() ; - - /** - * @see MVIMPSTUiSearchField - */ - void SetFieldDataL( const TDesC& aData ); - - /** - * @see MVIMPSTUiSearchField - */ - TPtrC FieldLabel() ; - - /** - * @see MVIMPSTUiSearchField - */ - TVIMPSTSearchDataFieldType FieldDataType() const ; - - /** - * @see MVIMPSTUiSearchField - */ - TPtrC FieldData() ; - - /** - * @see MVIMPSTUiSearchField - */ - void ResetFieldData() ; - - /** - * @see MVIMPSTUiSearchField - */ - TBool IsBasicField() const; - - /** - * @see MVIMPSTUiSearchField - */ - TVIMPSTEnums::TVIMPSTSearchKey GetSearchKey() const ; - - private : - - /** - * C++ constructor. - * @param aFieldDataType , field data type eg text ,number - * @param aFieldType, field type eg basic or advanced - * @param aSearchKey, a search key - */ - CVIMPSTUiSearchField(TVIMPSTSearchDataFieldType aFieldDataType, - TIMPSTSearchFieldTypes aFieldType , - TVIMPSTEnums::TVIMPSTSearchKey aSearchKey ); - - /** - * ConstructL - * @param aLebal, a field label - */ - void ConstructL(const TDesC& aLebal ); - - - private : - - // owns : a field data type - TVIMPSTSearchDataFieldType iFieldDataType; - - // owns : field type - HBufC* iFieldLabel; - - // owns : field saved data - HBufC* iFieldData; - - // owns : field type - TIMPSTSearchFieldTypes iFieldType; - - // owns : search key - TVIMPSTEnums::TVIMPSTSearchKey iSearchKey; - - protected: // Data - // Ref: Editor control - CEikEdwin* iControl; - // Ref: Fields captioned control - CEikCaptionedControl* iCaptionedCtrl; - - }; - -#endif // CVIMPSTUISEARCHFIELD_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuisearchfieldaray.h --- a/uiservicetab/vimpstui/inc/cvimpstuisearchfieldaray.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,228 +0,0 @@ -/* -* Copyright (c) 2008 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: search fields array declaration. -* -*/ - - -#ifndef CVIMPSTUISEARCHFIELDARAY_H -#define CVIMPSTUISEARCHFIELDARAY_H - -// INCLUDES -#include - -#include "mvimpstuisearchfield.h" - -// FORWARD DECLARATIONS -class MVIMPSTSearchUiBuilder; -class CEikCaptionedControl; - -// CLASS DECLARATION -/** - * An array of search editor fields. - * @lib vimpstui.lib - * @since S60 v5.0 - */ -NONSHARABLE_CLASS(CVIMPSTUiSearchFieldArray) : public CBase - { - public: // Constructors and destructor - - /** - * Creates a new instance of this class. - * @return A new instance of this class. - */ - static CVIMPSTUiSearchFieldArray* NewL(); - - /** - * Destructor. - */ - ~CVIMPSTUiSearchFieldArray(); - - public: // Interface - - /** - * Creates editor fields - * append the field into array from last - * @param aLebal, label of field - * @param aFieldDataType, field data type - * @param aFieldType, field type basic or advanced - * @param aSearchKey, search key - */ - TInt CreateFieldsL(const TDesC& aLebal, TVIMPSTSearchDataFieldType aFieldDataType , - TIMPSTSearchFieldTypes aFieldType = EIMAdvancedSearch, - TVIMPSTEnums::TVIMPSTSearchKey aSearchKey = TVIMPSTEnums::EVIMPSTSearchKeyUknown ); - - /** - * Creates editor fields - * insert into array at given index - * @param aIndex, index where field to inserted - * @param aLebal, label of field - * @param aFieldDataType, field data type - * @param aFieldType, field type basic or advanced - * @param aSearchKey, search key - */ - TInt InsertFieldsL(TInt aIndex, const TDesC& aLebal, - TVIMPSTSearchDataFieldType aFieldDataType , - TIMPSTSearchFieldTypes aFieldType = EIMAdvancedSearch, - TVIMPSTEnums::TVIMPSTSearchKey aSearchKey = TVIMPSTEnums::EVIMPSTSearchKeyUknown ) ; - - /** - * Creates editor fields from the array - * @param aUiBuilder, reference to builder class - */ - void CreateUiFieldsFromArrayL(MVIMPSTSearchUiBuilder& aUiBuilder ); - - - public: // new implementations - - - /** - * count no of fields in array - * @return no of fields in array - */ - inline TInt Count() const; - - - /** - * find and return the field store at given index - * @param aIndex ,index of field - * @return Base class reference of field - */ - inline MVIMPSTUiSearchField& At( TInt aIndex ); - - - /** - * AreAllUiFieldsEmpty check the all field are empty - * @return ETrue if empty else EFalse - */ - TBool AreAllUiFieldsEmpty() const; - - /** - * AreAllControlsEmptyL check the all control text are empty - * @return ETrue if empty else EFalse - */ - TBool AreAllUiControlsEmptyL() const; - - /** - * set the focus to selected field - * @param aFieldIndex, index of field - */ - void SetFocusL(TInt aFieldIndex ); - - /** - * get the first field data which is entered by user - * @return text of field - */ - TPtrC GetFirstEnteredFieldDataL(); - - /** - * GetSearchKeyDataL fill the data into array for lower layer to use - */ - void GetSearchKeyDataL(RArray& aKeyDataArray ); - - /** - * reset field data text - */ - void ResetFieldData(); - - /** - * RemoveField remove field from array - * @param aIndex, index to use - */ - void RemoveField(TInt aIndex ); - - /** - * insert a field at given location into array - * @param aField, field to insert - * @param aIndex, index to use - */ - void InsertField(MVIMPSTUiSearchField* aField , TInt aIndex ); - - - /** - * @return selected search type - */ - TIMPSTSearchFieldTypes GetSearchType(); - - /** - * insert a field at given location into array - * @param aType, selected search type - */ - void SetSearchType(TIMPSTSearchFieldTypes aType); - - - private: // new Implementation - - /** - * CVIMPSTUiSearchFieldArray default constructor - */ - CVIMPSTUiSearchFieldArray(); - - /** - * ConstructL - */ - void ConstructL(); - - /** - * create the field control of a field - * set the control id to given field - * @param aField, field to insert - */ - void CreateUiFieldsL( MVIMPSTUiSearchField& aField ); - - private: // Data - - // Own: An array of dialog fields - RPointerArray iFieldArray; - - // not owns, reference to ui builder class ,dialog - MVIMPSTSearchUiBuilder* iUiBuilder; - - // Ref: Editor control - CEikEdwin* iControl; - - // Ref: Fields captioned control - CEikCaptionedControl* iCaptionedCtrl; - - // owns : selelected search type - TIMPSTSearchFieldTypes iSelectedSearchType; - - - }; - -// INLINE FUNCTIONS - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::Count -// -------------------------------------------------------------------------- -// -inline TInt CVIMPSTUiSearchFieldArray::Count() const - { - return iFieldArray.Count(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::At -// -------------------------------------------------------------------------- -// -inline MVIMPSTUiSearchField& CVIMPSTUiSearchFieldArray::At - ( TInt aIndex ) - { - return *iFieldArray[aIndex]; - } - -#endif // CVIMPSTUISEARCHFIELDARAY_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuisearchquerydialog.h --- a/uiservicetab/vimpstui/inc/cvimpstuisearchquerydialog.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,258 +0,0 @@ -/* -* Copyright (c) 2008 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: search fields editor class declaration -* -*/ - - -#ifndef CVIMPSTUISEARCHQUERYDIALOG_H -#define CVIMPSTUISEARCHQUERYDIALOG_H - -// INCLUDES -#include -#include - -#include "mvimpstsearchuibuilder.h" -#include "cvimpstuisearchfieldaray.h" - -// FORWARD DECLARATIONS - -class CAknTitlePane; -class CVIMPSTUiSearchFieldArray; -class CAknNavigationControlContainer; -class MVIMPSTSearchUiBuilder; -class CAknTitlePane; - -// CLASS DECLARATION -/** - * search dialog implementation. - * @lib vimpstui.lib - * @since S60 v5.0 - */ -class CVIMPSTUiSearchQueryDialog : public CAknForm, - public MVIMPSTSearchUiBuilder - { - public: // Constructors and destructor - - /** - * Creates a new instance of this class. - * @param aUiFieldArray, reference to field array class - * @return A new instance of this class. - */ - static CVIMPSTUiSearchQueryDialog* NewL( CVIMPSTUiSearchFieldArray& aUiFieldArray ); - - /** - * Destructor. - */ - virtual ~CVIMPSTUiSearchQueryDialog(); - - public: // Interface - - /** - * Executes the dialog. - */ - void ExecuteLD(); - - public: // From CAknForm - - /** - * see @ base class CAknForm - */ - void PreLayoutDynInitL(); - - /** - * see @ base class CAknForm - */ - void PostLayoutDynInitL(); - - /** - * see @ base class CAknForm - */ - void SetInitialCurrentLineL(); - - /** - * see @ base class CAknForm - */ - TBool OkToExitL(TInt aKeycode ); - - /** - * see @ base class CAknForm - */ - TKeyResponse OfferKeyEventL ( const TKeyEvent& aKeyEvent, TEventCode aType ); - - - public: // From MVIMPSTSearchUiBuilder - - /** - * see @ base class MVIMPSTSearchUiBuilder - * @param aCaption, caption of field line - * @param aControlId, control id - * @param aControlType, control type - * @return A new instance of CCoeControl. - */ - CCoeControl* CreateLineL( - const TDesC& aCaption, - TInt aControlId, - TInt aControlType ); - - /** - * see @ base class MVIMPSTSearchUiBuilder - * @param aControlId, control id - * @return A new instance of CEikCaptionedControl. - */ - CEikCaptionedControl* LineControl( - TInt aControlId ) const; - - /** - * see @ base class MVIMPSTSearchUiBuilder - * @param aControlId, control id - */ - void TryChangeFocusL(TInt aControlId ); - - /** - * see @ base class MVIMPSTSearchUiBuilder - * @param aText, caption text - */ - void SetCurrentLineCaptionL( const TDesC& aText ); - - /** - * see @ base class MVIMPSTSearchUiBuilder - * @param aControlId, control id - */ - CCoeControl* Control( TInt aControlId ) const; - - /** - * see @ base class MVIMPSTSearchUiBuilder - * @param aState, ETrue or EFalse - */ - void SetEditableL( TBool aState ); - - /** - * see @ base class MVIMPSTSearchUiBuilder - * @param aControlId, control id - * @param aDimmed, ETrue if hide or EFalse - */ - void SetLineDimmed( TInt aControlId , TBool aDimmed ) ; - - - public: // new implementation - - /** - * AreAllControlsEmptyL check the all control text are empty - * @return ETrue if empty else EFalse - */ - TBool AreAllControlsEmptyL() const; - - /** - *IsEndKeyPressed check to find if End Key was pressed - * @return ETrue if End Key Pressed - */ - TBool IsEndKeyPressed(); - - - private: // new Implementation - - /** - * constructor - * @param aUiFieldArray, reference to ui fields array - */ - CVIMPSTUiSearchQueryDialog(CVIMPSTUiSearchFieldArray& aUiFieldArray); - - /** - * ConstructL - */ - void ConstructL(); - - /** - * Construct the context menu - */ - void ConstructContextMenuL(); - - /** - * Construct the navi pane for dialog - */ - void ConstructNaviPaneL(); - - /** - * call to update the title pane - */ - void UpdateTitleL(); - - /** - * ok or done has been press - * perform the saving operation - */ - void CmdDoneL( ); - - /** - * StoreTitlePaneTextL, - * store the previous title text - */ - inline void StoreTitlePaneTextL(); - - /** - * UpdateCbasL, - * to update the rsk, lsk - */ - void UpdateCbasL(); - - /** - * show ui fields into form, - */ - void ShowSearchUiFieldsL(); - - /** - * check if basic field are supported or not - * @retrun ETrue if Supported else EFalse - */ - TBool IsBasicFieldAvailableL(); - - /** - * set the cba with resource - * @param aResourceId , resource to use - */ - void SetCbaCommandSetL( TInt aResourceId ) ; - - private: // Data - - // not Own: Manages dialog fields - CVIMPSTUiSearchFieldArray& iUiFieldArray; - - // own : last cba resource set - TInt iCbaCommandSet; - - // Own: Title pane text to restore on exit - HBufC* iStoredTitlePaneText; - - // owns : search field type - TIMPSTSearchFieldTypes iSearchType; - - // Own: Context menu bar - CEikMenuBar* iContextMenuBar; - - // Ref: Status pane handle - CAknNavigationControlContainer* iNaviContainer; - - // Ref: Application's title pane - CAknTitlePane* iTitlePane; - - //own: Is End Key Pressed - TBool isEndKeyPressed; - - }; - -#endif // CVIMPSTUISEARCHQUERYDIALOG_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuisearchview.h --- a/uiservicetab/vimpstui/inc/cvimpstuisearchview.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,274 +0,0 @@ -/* -* Copyright (c) 2008 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: Search view declaration -* -*/ - - - -#ifndef CVIMPSTUISEARCHVIEW_H -#define CVIMPSTUISEARCHVIEW_H - - -// INCLUDES -#include // CBase -#include -#include - -#include "CxSPBaseView.h" -#include "tvimpstenums.h" -#include "mvimpstcmdobserver.h" -#include "mvimpstenginesearchextentioneventobserver.h" - -// FORWARD DECLARATIONS -class CVIMPSTUiSearchViewControl; -class CVIMPSTUIExtensionService; -class MVIMPSTEngine; -class MVIMPSTCmdHandler; -class CAknNavigationDecorator; -class CVIMPSTUtilsWaitNote; -class CAsyncCallBack; - - -// CLASS DECLARATION -/** - * Search view implementation - * @lib vimpstui.lib - * @since S60 v5.0 - */ - // codescanner warnings can be ignored as CxSPBaseView derived from CBsse - -class CVIMPSTUiSearchView :public CxSPBaseView, - public MVIMPSTCmdObserver, - public MVIMPSTEngineSearchExtentionEventObserver - { - public: // Constructors and destructor - - - /** - * Creates a new CVIMPSTUiSearchView. - * - * @param aMapper Reference to view mapper object - * @param aContactManager Reference to contact manager object - * @param aSearchViewId search view id - * @param aServiceId service id - * @param aView Reference to Phonebook2-created view instance - * @param aId native view id - * @param aServiceData Reference to ui extension service - * @param aEngine Reference to engine object - * @param aCommandHandler Reference to commnad handler object - * @return New instance of this class - */ - static CVIMPSTUiSearchView* NewL( MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aSearchViewId, - TUint aServiceId, - CPbk2UIExtensionView& aView, - TUid aId, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler ); - - - - public: // From MPbk2UIExtensionView through CxSPBaseView - - /** - * @see MPbk2UIExtensionView - */ - TBool HandleCommandKeyL( - const TKeyEvent& aKeyEvent, - TEventCode aType ); - - /** - * @see MPbk2UIExtensionView - */ - void DoDeactivate(); - - /** - * @see MPbk2UIExtensionView - */ - void HandleCommandL( TInt aCommand ); - - /** - * @see MPbk2UIExtensionView - */ - void DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ); - - /** - * @see MPbk2UIExtensionView - */ - void HandleStatusPaneSizeChange(); - - /** - * Function to launch help - */ - void LaunchHelpL( const TDesC& aContext); - - /** - * Search CallBack function - * This is used to call the search functionality when its called form the - * Tabbed view - * - * @param aInstance : Search view pointer is passed in our case - * @return Error to call back function - */ - static TInt SearchCallbackL(TAny* aInstance); - - private: // From CxSPBaseView - - /** - * @see CxSPBaseView - */ - void DoActivateViewL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - - private : //From MImCommandObserver - - /** - * @see MImCommandObserver - */ - void CommandFinishedL( - const MVIMPSTCmd& aCommand ); - - /** - * @see MImCommandObserver - */ - void HandleCommandEventL(TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt aServiceError) ; - - private: - - /** - * Used to search for contacts matched against entered string - */ - void SearchContactsL(); - - - /** - * This function updates text to navi pane - */ - void UpdateNaviPaneTextL( ); - - - private: // Functions from MVIMPSTEngineSearchExtentionEventObserver - - /** - * @see MVIMPSTEngineSearchExtentionEventObserver - */ - void HandleSearchResultL(RArray aSerachData) ; - - /** - * @see MVIMPSTEngineSearchExtentionEventObserver - */ - void HandleSearchFinishedL(TInt aError); - - - /** - * @see MVIMPSTEngineSearchExtentionEventObserver - */ - void HandleSearchKeysEventL( RArray& aEnumKeysArray, RPointerArray& aLebelKeysArray ) ; - - - private: - - /** - * Standard C++ constructor - * @param aMapper Reference to view mapper object - * @param aContactManager Reference to contact manager object - * @param aSearchViewId search view id - * @param aServiceId service id - * @param aView Reference to Phonebook2-created view instance - * @param aId native view id - * @param aServiceData Reference to ui extension service - * @param aEngine Reference to engine object - * @param aCommandHandler Reference to commnad handler object - */ - CVIMPSTUiSearchView( MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aSearchViewId, - TUint aServiceId, - CPbk2UIExtensionView& aView, - TUid aId, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - /** - * Standard C++ destructor. - */ - ~CVIMPSTUiSearchView(); - - public: - - /** - * returns ETrue if the contact is already in the contact list - * else returns EFalse - * Based on this option "add to contacts " is shown - * - * @return whether the contact is already in the contact list or not - */ - TBool HideAddToContactsL() const; - - - private: // Data - - // Own: This view's control container - CVIMPSTUiSearchViewControl* iContainer; - - // Stores view id - TUint iSearchViewId; - - //service id - TUint32 iServiceId; - - //Doesnt own - reference to engine for this service - MVIMPSTEngine& iEngine; - - // Own: Used for navigation pane text - CAknNavigationDecorator* iNaviDecorator; - - //doesnt own, refernec to extension service - CVIMPSTUIExtensionService& iExtensionService; - - //Owns command Handler for this view - MVIMPSTCmdHandler& iCommandHandler; - - // owned - CVIMPSTUtilsWaitNote* iWaitNote; - - // this flag is to check whether the search id initiated - // from the search view or not - // At the first time its EFalse since search is always initiated from tabview - TBool iSearchInitiated; - - //flag to check if End Key was pressed - TBool iEndKeyPressed; - /** - * Active object for async calls. - */ - CAsyncCallBack* iCallBack; - - }; - -#endif // CVIMPSTUISEARCHVIEW_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuisearchviewcontrol.h --- a/uiservicetab/vimpstui/inc/cvimpstuisearchviewcontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,250 +0,0 @@ -/* -* Copyright (c) 2008 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: Search view control. -* -*/ - - -#ifndef __CVIMPSTUISEARCHVIEWCONTROL_H -#define __CVIMPSTUISEARCHVIEWCONTROL_H - -// INCLUDES -#include -#include -#include -#include -#include "tvimpstenums.h" - -// FORWARD DECLARATIONS -class CAknDoubleStyleListBox; -class MPbk2KeyEventHandler; -class MVIMPSTEngine; -class MVIMPSTEngineSearchExtentionEventObserver; -class MVIMPSTCmdHandler; -class CVIMPSTUiSearchView; - - - -// CLASS DECLARATION - -/** - * Search view control. Shows search results - * @lib vimpstui.lib - * @since S60 v5.0 - */ -class CVIMPSTUiSearchViewControl : public CCoeControl, - public MEikListBoxObserver, - public MCoeControlObserver - { - - public: // Constructor and destructor - /** - * Creates a new CVIMPSTUiSearchViewControl. - * @param aKeyEventHandler Key event handler to be used - * @param aServiceId service id - * @param aEngine reference to engine. - * @param aCommandHandler reference to commandhandler - * @param aSearchView reference to search view. - */ - static CVIMPSTUiSearchViewControl* NewL(MPbk2KeyEventHandler* aKeyEventHandler, - TUint32 aServiceId, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler, - CVIMPSTUiSearchView& aSearchView ); - - /** - * Creates a new CVIMPSTUiSearchViewControl and leaves it to - * cleanup stack. - * @see NewL - */ - static CVIMPSTUiSearchViewControl* NewLC( MPbk2KeyEventHandler* aKeyEventHandler, - TUint32 aServiceId, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler, - CVIMPSTUiSearchView& aSearchView ); - - /** - * Destructor. - */ - ~CVIMPSTUiSearchViewControl(); - - - private: - - /** - * Standard C++ constructor - * @param aKeyEventHandler Key event handler to be used - * @param aServiceId service id - * @param aEngine reference to engine - * @param aCommandHandler reference to commandhandler - * @param aSearchView reference to search view. - * - */ - CVIMPSTUiSearchViewControl( MPbk2KeyEventHandler* aKeyEventHandler, - TUint32 aServiceId, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler, - CVIMPSTUiSearchView& aSearchView ); - - /** - * Performs the 2nd phase of construction. - * - */ - void ConstructL(); - - public: // New functions - - /** - * sets the primary and secondary text of this view - */ - void SetEmptyTextsToListboxL(); - - /** - * sets the searching text text of this view - */ - void SetSearchingTextToListboxL(); - - /** - * Updates the list box with search data - * @param aSerachData - search data for listbox to be updated with - */ - void UpdateListBoxL(RArray aSerachData); - - - /** - * returns the list box - */ - CEikListBox* ListBox() const; - - /** - * extracts the contactId ,allocates memory for contactId and returns - * Owership of the contactId is transfered to caller - * - * @return contactId : Owenership to caller - */ - HBufC* GetFocusedContactLC() const; - - /** - * Clears list box contents. I.e. item array. - */ - void ClearListBoxContents(); - - /** - * Starts the conversation with the selected contact - * @param aContact : id of the contact - */ - void OpenConversationL(const TDesC& aContactId ); - - - /** - * SearchResultL - * @param aSerachData, search data - */ - void SearchResultL(RArray aSerachData) ; - - /** - * SearchFinishedL - * @param aError, error any - */ - void SearchFinishedL(TInt aError); - - /** - * Updates Softkeys according to current focus - * @param aUseDefaultCba Flag to force the default sofkeys for view. - * Default value is false. - */ - void UpdateCbaL( TBool aUseDefaultCba = EFalse ); - - - private: // Functions MCoeControlObserver - - /** - * Handles events from findpane and forwards them to listbox filter. - * @see MCoeControlObserver - */ - void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ); - - /** - * From MEikListBoxObserver, Handles event's generated by listbox - * @param aListBox Pointer to listbox from where this event originated - * @param aEventType Type of event received. - */ - void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); - - - /** - * From CoeControl, Returns the number of control contained by this class. - * @return Number of controls contained - */ - TInt CountComponentControls() const; - - /** - * From CCoeControl, Returns handle to control pointed by aIndex - * @param aIndex Wanted control's index [0..n] - * @return Handle to wanted control - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * From CCoeControl, Handles key-events - * @param aEvent Event that occured - * @param aType Type of key-event (EEventKey, EEventKeyUp or EEventKeyDown) - * @return Containers response to event (EKeyWasNotConsumed/ EKeyWasConsumed) - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aEvent, TEventCode aType ); - - /** - * From CCoeControl,respond to size chnaged - */ - void SizeChanged(); - - - - private: // Data - - // Not owned: key event handler - MPbk2KeyEventHandler* iKeyEventHandler; - - //Service Id - TUint32 iServiceId ; - - //Owns - CAknDoubleStyleListBox* iListBox; - - //Owns - CDesCArray* iItemArray; - - //Doesnt own - reference to engine for this service - MVIMPSTEngine& iEngine; - - //Doesnt own - reference to Command handler for this service - MVIMPSTCmdHandler& iCommandHandler; - - //doesn't own - reference to Searh View - CVIMPSTUiSearchView& iSearchView; - - // CBA. not owned - CEikButtonGroupContainer* iCba; - - // Storage for previous focus - TVIMPSTEnums::TItem iLastFocusedItemType; - - //indicate command to be executed on enter key event. - TInt iCurrentCmdToExe; - - }; - -#endif // __CVIMPSTUISEARCHVIEWCONTROL_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuisinglelistboxarray.h --- a/uiservicetab/vimpstui/inc/cvimpstuisinglelistboxarray.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/* -* Copyright (c) 2008 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: CVIMPSTUiArray-array decorator -* -*/ - - - -#ifndef _CVIMPSTUISINGLELISTBOXARRAY_H -#define _CVIMPSTUISINGLELISTBOXARRAY_H - -// INCLUDES -#include -#include // MDesCArray -#include -#include - -// FORWARD DECLARATIONS -class CColumnListBoxData; -class CVIMPSTUiListBoxModel; -class CVIMPSTUiSingleStyleListBox; -class MVIMPSTProcessArray; - -// CLASS DECLARATION - -/** - * Friends-array decorator. - * Decorates the array for listbox - * - * @lib vimpstui.dll - * @since 5.0 - */ -class CVIMPSTUiSingleListboxArray : public CBase, public MDesCArray - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aItemModel that contains the data. - * @param aListBoxData Listbox data for setting row properties, - * can be NULL. - * @param aListBox Listbox - */ - static CVIMPSTUiSingleListboxArray* NewL( - MVIMPSTProcessArray& aItemModel, - CColumnListBoxData* aListboxData, - CVIMPSTUiSingleStyleListBox& aListBox ); - - /** - * Destructor. - */ - virtual ~CVIMPSTUiSingleListboxArray(); - - - public: // Functions from MDesCArray - - /** - * From MDesCArray, Returns the number of descriptor elements in - * a descriptor array. - * @see MDesCArray - */ - TInt MdcaCount() const; - - /** - * From MDesCArray, Indexes into a descriptor array. - * @see MDesCArray - */ - TPtrC16 MdcaPoint( TInt aIndex ) const; - - - private: // new functions - - /** - * Append formatted contact identification to buffer - * @param aBuffer Buffer where identification will be appended - * @param aContact Contact - * @param aContactList Contact list - */ - void AppendContactL( TPtr& aBuffer, TInt aIndex ) const; - - /** - * Append formatted contact list identification to buffer - * @param aBuffer Buffer where identification will be appended - * @param aContactList Contact list - */ - void AppendContactListL( TPtr& aBuffer, - TInt aIndex ) const; - - /** - * Append formatted owndata identification to buffer - * @param aBuffer Buffer where identification will be appended - * @param aContactList Contact list - */ - void AppendOwnDataL( TPtr& aBuffer, - TInt aIndex ) const; - - private: - - /** - * C++ default constructor. - * @param aItemModel that contains the data. - * @param aListBoxData Listbox data for setting row properties, can be NULL. - * @param aListBox Listbox - */ - CVIMPSTUiSingleListboxArray( MVIMPSTProcessArray& aItemModel, - CColumnListBoxData* aListboxData ,CVIMPSTUiSingleStyleListBox& aListBox ); - - /** - * By default Symbian OS constructor is private. - */ - void ConstructL(); - - private: // Data - - // wrapper array on engine side arrays - MVIMPSTProcessArray& iItemArray; - - // Doesn't own. Pointer to listbox data for setting row properties - CColumnListBoxData* iListboxData; - - //Ref. to Contact List Box - CVIMPSTUiSingleStyleListBox& iListBox; - - // Owns. Buffer that hold's information about fetched item - HBufC* iData; - - // maxmimun length of icon strings added to formatted text - TInt iMaxLengthOfIcons; - - - // Not own. Model to check the real location of items. - CVIMPSTUiListBoxModel* iContactListBoxModel; - - }; - -#endif // _CVIMPSTUISINGLELISTBOXARRAY_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuisinglelistboxtabviewcontrol.h --- a/uiservicetab/vimpstui/inc/cvimpstuisinglelistboxtabviewcontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,352 +0,0 @@ -/* -* Copyright (c) 2008 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: tabbed view control implementation class with doublestyle listbox -* -*/ - -#ifndef __CVIMPSTUISINGLELISTBOXTABVIEWCONTROL_H -#define __CVIMPSTUISINGLELISTBOXTABVIEWCONTROL_H - -#include "mvimpstuitabbedviewcontrol.h" -#include "cvimpstuisinglestylelistbox.h" - -class CVIMPSTUiSingleStyleListBox; -// CLASS DECLARATION -/** - * Tabbed view control. Shows list of contacts. - * @lib vimpstui.lib - * @since S60 v5.0 - */ -class CVIMPSTUiSingleListBoxTabViewControl : public CCoeControl, - public MVIMPSTProcessArrayObserver, - public MEikListBoxObserver, - public MCoeControlObserver, - public MVIMPSTUiTabbedViewControl - { - public: // Constructor and destructor - void HandleAvatarChangeL( const TDesC& aUserId ); - /** - * Creates a new CImContactsTabbedViewControl. - * - * @param aTabbedView reference to view. - * @param aKeyEventHandler Key event handler to be used - * @param aCommandHandler reference to commandhandler - * @param aServiceId Id of the service - * @param aBrandHandler reference to brandhandler - * @param aEngine reference to engine - */ - static CVIMPSTUiSingleListBoxTabViewControl* NewL( CVIMPSTUiTabbedView& aTabbedView, MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, - TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba); - - /** - * Creates a new CImContactsTabbedViewControl and leaves it to - * cleanup stack. - * @see NewL - * - * @param aTabbedView reference to view. - * @param aKeyEventHandler Key event handler to be used - * @param aCommandHandler reference to commandhandler - * @param aServiceId Id of the service - * @param aBrandHandler reference to brandhandler - * @param aEngine reference to engine - */ - static CVIMPSTUiSingleListBoxTabViewControl* NewLC( CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, - TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba); - - /** - * Destructor. - */ - ~CVIMPSTUiSingleListBoxTabViewControl(); - - public : // from MIMArrayProcessObserver - /** - * @see MIMArrayProcessObserver. - */ - void HandleAdditionL(TVIMPSTEnums::TItem type, TInt aIndex); - - - /** - * @see MIMArrayProcessObserver. - */ - void HandleDeletionL(TVIMPSTEnums::TItem type, TInt aIndex); - - public://from MEikListBoxObserver - - /** - * From MEikListBoxObserver, Handles event's generated by listbox - * @see MEikListBoxObserver - */ - void HandleListBoxEventL( CEikListBox* aListBox, - TListBoxEvent aEventType ); - - public: //from MCoeControlObserver - /** - * Handles events from findpane and forwards them to listbox filter. - * @see MCoeControlObserver - */ - void HandleControlEventL( CCoeControl* aControl,TCoeEvent aEventType ); - - /** - - /** - * Get access to listbox model's filter - * @return model's filter - */ - CAknListBoxFilterItems* ListFilter(); - - - public: // New functions - - /** - * Returns the currently focused item's index. - * @return TInt, current item index. - */ - TInt CurrentItemIndex() const; - - /** - * Sets the currently focused item's index. - * - * @param aIndex new currently focused index - */ - void SetCurrentItemIndex( TInt aIndex ); - - /** - * Sets the currently focused item's index and updates the control - * on the display. - * - * @param aIndex new currently focused index - */ - void SetCurrentItemIndexAndDraw( TInt aIndex ); - - /** - * Handles item addition for this control. - */ - void HandleItemAdditionL(); - /** - * Handles item removal for this control. - */ - void HandleItemRemovalL(); - - /** - * Sets list box empty text. - * - * @param aResourceId resource id of a empty text - */ - void SetListEmptyTextL( TInt aResourceId ); - - /** - * send the message using selected item - * this will launch the conversation view if im is enabled. - */ - void SendMessageL(); - - /** - * Updates view after edit. - * @param aIndex is the index of item that has changed. - * @param aType is list item type. - */ - void UpdateViewL( TInt aIndex, TVIMPSTEnums::TItem aType); - - /** - * @see MVIMPSTUiTabbedViewControl. - */ - void HandleAvatarRefreshL( const TDesC& aUserId,TBool aBlock ); - - - /** - * LoadsBitmap array. - */ - void LoadBitmapsL(); - - - - /** - * Activates find-pane - */ - void ActivateFindPaneL(); - - /** - * De-activates find-pane - */ - void DeactivateFindPaneL(); - - /** - * Sets the lock status of softkeys - * @param aLock new status of lock (ETrue: locked, EFalse: Unlocked) - */ - void SetCbaLockL( TBool aLock ); - - - /** - * Updates Softkeys according to current focus - * @param aUseDefaultCba Flag to force the default sofkeys for view. - * Default value is false. - */ - void UpdateCbaL( TBool aUseDefaultCba = EFalse ); - - /** - *Handle the avatar deletion in UI - */ - void SetFocussedId(const TDesC& aContact) ; - - /** - * the avatar deletion in UI - */ - TPtrC GetFocussedId() ; - - private: // From CCoeControl, standard control functionality - - /** - * @see CCoeControl - */ - TKeyResponse OfferKeyEventL - ( const TKeyEvent& aKeyEvent, TEventCode aType ); - - /** - * @see CCoeControl - */ - void SizeChanged(); - - /** - * @see CCoeControl - */ - TInt CountComponentControls() const; - - /** - * @see CCoeControl - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * @see CCoeControl - */ - void FocusChanged( TDrawNow aDrawNow ); - - private: // Implementation - /** - * Standard C++ constructor - * - * @param aTabbedView reference to view. - * @param aKeyEventHandler Key event handler to be used - * @param aCommandHandler reference to commandhandler - * @param aServiceId Id of the service - * @param aBrandHandler reference to brandhandler - * @param aEngine reference to engine - */ - CVIMPSTUiSingleListBoxTabViewControl( CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, - TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba); - - /** - * Performs the 2nd phase of construction. - * - */ - void ConstructL(); - - /** - * Layouts current components according to AVKON LAF - */ - void SetLayout(); - - - void SetFocusAndMakeItemVisible(); - - public: - - /** - * Sets the iClrFindPaneFlag - */ - void SetClrFindPaneFlag(TBool aFlag); - - /** - * Checks if the last contact is focused and Sets the iLastItemFlag - */ - void CheckAndSetLastItemFlag(); - - /** - * returns the CCoeControl* pointer - */ - CCoeControl* CoeControl(); - - - - private: // Data - - // not owned - CVIMPSTUiTabbedView& iTabbedView; - - // Not owned: key event handler - MPbk2KeyEventHandler* iKeyEventHandler; - - //Holds the Ref to CMd Handler - Doesnt Own - MVIMPSTCmdHandler& iCommandHandler; - - //Doesnt Own - MVIMPSTProcessArray& iArrayProcess; - - //Service Id - TUint32 iServiceId ; - - //doesnt own - Brand Handler - CVIMPSTUiBrandData& iBrandHandler; - - //doesnt own - Engine Handler - MVIMPSTEngine& iEngine; - - - // Owns. Listbox to view friends-list data - CVIMPSTUiSingleStyleListBox* iListBox; - - // Owns. Search field. - CAknSearchField* iFindbox; - - // is find pane visible. - TBool iFindPaneIsVisible; - - //current state - TBool iCurrentState; - - // Owns: Flag to check whether the last contact was selected - TBool iLastItemFlag; - - // CBA. not owned - CEikButtonGroupContainer* iCba; - - // Lock status foc softkeys - TBool iCbaLock; - - // Storage for previous focus - TVIMPSTEnums::TItem iLastFocusedItemType; - - //flag to check to clear find pane - TBool iClrFindPaneFlag; - - //indicate command to be executed on enter key event - TInt iCurrentCmdToExe; - }; - -#endif // __CVIMPSTUISINGLELISTBOXTABVIEWCONTROL_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuisinglestylelistbox.h --- a/uiservicetab/vimpstui/inc/cvimpstuisinglestylelistbox.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* Copyright (c) 2008 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: Custom listbox component for the contact list -* -*/ - - -#ifndef _CVIMPSTUISINGLESTYLELISTBOX_H -#define _CVIMPSTUISINGLESTYLELISTBOX_H - - -#include - -// FORWARD DECLARATIONS -class MVIMPSTProcessArray; -class CVIMPSTUiListBoxModel; - -//CLASS DECLARATION -/** - * single style /1 line Custom listbox component for the contact list - * - * Allows to change the model for the listbox. - * This is done because we have to customize the behaviour of the find pane, - * so that filtered list shows also the contact lists where the searched - * contacts exist. - * - * @lib vimpstui.dll - * @since S60 v5.0 - */ -class CVIMPSTUiSingleStyleListBox : public CAknSingleGraphicStyleListBox - - { - -public://CAknColumnListBox - - /** - * Creates the model - * @see CAknColumnListBox - */ - void CreateModelL(); - - -public: // New functions - - /** - * Give listbox a direct access to contact list model. - * @param aContactListModel Model of this listbox - */ - void SetContactListModelL(MVIMPSTProcessArray& aItemModel ); - - - }; - - -#endif // _CVIMPSTUISINGLESTYLELISTBOX_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuisinglestylelistboxmodel.h --- a/uiservicetab/vimpstui/inc/cvimpstuisinglestylelistboxmodel.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -/* -* Copyright (c) 2008 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: Custom listbox component for the contact list -* -*/ - - -#ifndef _CVIMPSTUILISTBOXMODEL_H -#define _CVIMPSTUILISTBOXMODEL_H - -#include - -//FORWARD DECLARATONS -class MVIMPSTProcessArray; - -//CLASS DECLARATON -/** - * Custom listbox model for the contact list - * - * Enables custom filtering (with find box) for the listbox, - * so it's possible to show also contact list names for the - * filtered contacts. - * - * @lib vimpstui.lib - * @since S60 v5.0 - */ -class CVIMPSTUiListBoxModel : public CAknFilteredTextListBoxModel - { - -public: // Constructor and Destructor - - - /** - * Default C++ constructor - */ - CVIMPSTUiListBoxModel(); - - /** - * Default C++ destructor - */ - ~CVIMPSTUiListBoxModel(); - - -public: // from CTextListBoxModel - - /** - * Returns the amount of filtered (searched) - * contacts and their contact lists - * @return Total amount of filtered (searched) contacts and their contact lists - */ - TInt NumberOfItems() const; - - /** - * Returns the text of the specified item. - * @param aItemIndex Index to the item. - * @return The text of item in given index. - */ - TPtrC ItemText(TInt aItemIndex) const; - - -public: // from MEikTextListBoxModel - - /** - * Provides the text array for the find box to search for. - * @return Pointer to the text array. - */ - const MDesCArray* MatchableTextArray() const; - - -public: // From MDesCArray - - /** - * @see MDesCArray - */ - TInt MdcaCount() const; - - /** - * @see MDesCArray - */ - TPtrC MdcaPoint( TInt aIndex ) const; - - -public: // New methods - - /** - * For setting the contactlist model to have a direct access to real model - * @param aContactListModel Model - */ - void SetContactListModel( MVIMPSTProcessArray& aItemModel ); - - /** - * Return the real index of item which is currently visible - * @param aVisibleItemIndex Currently visible item index - * @return index of the item in the non-filtered list - */ - TInt FilteredItemIndex( TInt aVisibleItemIndex ) const; - - /** - * Return the current index of item in the non-filtered list - * @param aOriginalIndex Index of the item in non-filtered list - * @return Index of the item in filtered list. KErrNotFound if not visible - */ - TInt VisibleItemIndex( TInt aOriginalIndex ) const; - -protected: // New methods - - /** - * Calculates the currently visible items. - * @return count of visible items - */ - TInt CountItems() const; - - /** - * Fetch the item text a given position - * @param aIndex Position of the item - * @return Item text - */ - TPtrC ItemAt( TInt aIndex ) const; - - /** - * Check if filter is active. - * @return ETrue: active, EFalse: deactive - */ - TBool IsFilterActive() const; - - /** - * Check if item at given index should be visible contact list. - * Meaning that it has to be a contact list and it needs - * to have at least 1 visible contact in it. - * @param aIndex Position on item - * @param aPosArray array of contacts lists positions - * @return ETrue: visible contact list, EFalse: something else - */ - TBool IsContactList( TInt aIndex, RArray& aPosArray ) const; - - -private: // Data - - // Not own. Contact list model - MVIMPSTProcessArray* iItemModel; - }; - - -#endif // _CVIMPSTUILISTBOXMODEL_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuistatuspanehandler.h --- a/uiservicetab/vimpstui/inc/cvimpstuistatuspanehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* Copyright (c) 2008 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: Tabbed view declaration -* -*/ - -#ifndef CVIMPSTUISTATUSPANEHANDLER_H -#define CVIMPSTUISTATUSPANEHANDLER_H - -// INCLUDES -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -// CLASS DECLARATION - -/** - * CCVIMPSTUiStatusPaneHandler - * - */ -class CCVIMPSTUiStatusPaneHandler : public CBase - { -public: - // Constructors and destructor - - /** - * Destructor. - */ - ~CCVIMPSTUiStatusPaneHandler(); - - /** - * Two-phased constructor. - */ - static CCVIMPSTUiStatusPaneHandler* NewL(); - - /** - * Two-phased constructor. - */ - static CCVIMPSTUiStatusPaneHandler* NewLC(); - - /** - * Function to set picture on the status pane - */ - void SetPictureL( CFbsBitmap *aBitmap, CFbsBitmap *aMask, TBool aNaviPush = EFalse); - - /** - * Function to set text on the status pane - */ - void SetTextL( const TDesC& aText ); - - /** - * Function to clear the icon on the Status Pane. - */ - void ClearPaneL(); - -private: - - /** - * Constructor for performing 1st stage construction - */ - CCVIMPSTUiStatusPaneHandler(); - - /** - * EPOC default constructor for performing 2nd stage construction - */ - void ConstructL(); - - - -private: - - /** - * not owned. Handle to the environment - */ - CEikonEnv* iEnv; - - /** - * not owned, Handle to the environment - */ - CEikStatusPane* iStatusPane; - - /** - * not owned Handle to the environment - */ - CAknTitlePane* iTitlePane; - - /** - * not owned. Handle to the environment - */ - CAknContextPane* iContextPane; - - /** - * not owned. Handle to the environment - */ - CAknNavigationControlContainer* iNaviPane; - - /** - * Decorator pointer to decorate the navi pane. - */ - CAknNavigationDecorator* iNaviDeco; - - /** - * Variable to know if the iNaviDeco is pushed on the navi pane. - */ - TBool iNaviPush; - }; -#endif // CVIMPSTUISTATUSPANEHANDLER_H - -//END OF FILE. - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuitabbedview.h --- a/uiservicetab/vimpstui/inc/cvimpstuitabbedview.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,709 +0,0 @@ -/* -* Copyright (c) 2008 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: Tabbed view declaration -* -*/ - - -#ifndef __CVIMPSTUITABBEDVIEW_H__ -#define __CVIMPSTUITABBEDVIEW_H__ - -// INCLUDES -#include // CBase -#include - -#include -#include // Toolbar - -#include -#include -#include -// CBase -#include -#include -#include "tvimpstenums.h" - -//command observer -#include "mvimpstcmdobserver.h" -//auth event observer. -#include "mvimpstenginesearchextentioneventobserver.h" - -#include -// FORWARD DECLARATIONS -class CEikMenuPane; -class MVIMPSTUiTabbedViewControl; -class CPbk2UIExtensionView; -class MVIMPSTCmdHandler; -class CVIMPSTUIExtensionService; -class MVIMPSTEngine; -class MCCAParameter; -class MCCAConnection; -class MVIMPSTCmd; -class CVIMPSTUiBrandData; -class CVIMPSTUtilsWaitNote; -class CAiwServiceHandler; -class CAknToolbar; -class MVPbkStoreContact; -class CBrowserLauncher; -class MVPbkStoreContact; -class MVIMPSTSettingsStore; -class CCVIMPSTUiStatusPaneHandler; -class CVIMPSTUIMenuExtension; -class CVIMPSTUiContactSelection; -class TAiwSingleEntrySelectionDataV2; -class TAiwMultipleEntrySelectionDataV2; - -class CCoeAppUi; -// CLASS DECLARATION -/** - * Tabbed view implementation - * @lib vimpstui.lib - * @since S60 v5.0 - */ - // codescanner warnings can be ignored as CxSPBaseView derived from CBsse - -class CVIMPSTUiTabbedView : public CxSPBaseView, // CSI: 51 # - public MVIMPSTCmdObserver, - public MAknToolbarObserver, // Toolbar - public MVIMPSTEngineSearchExtentionEventObserver, - public MDownloadedContentHandler, - public MAknServerAppExitObserver, - public MAiwNotifyCallback, - public MPbk2UIExtensionView2 - - - - - { - public: // Constructor - - enum TXmppMenuValues - { - EXmppMenuValuesUseExisting = 0, - EXmppMenuValuesCreateNew = 1 - }; - - enum TMenuSelection - { - EInvitAcceptCreateNew = 0, - EInvitAcceptUpdateExisting = 1, - EContactCreateNew, - EContactAddFromContacts, - ECreateXSPCall - }; - - /** - * Creates a new CVIMPSTUiTabbedView. - * - * @param aMapper Reference to view mapper object - * @param aContactManager Reference to contact manager object - * @param aTabbedViewId, view i. - * @param aServiceId, service id. - * @param aView, reference to the view. - * @param aId, uid - * @param aServiceData, service info. - * @param aEngine, reference to engine. - * @param aCommandHandler, reference to commandhandler. - * @return New instance of this class - */ - static CVIMPSTUiTabbedView* NewL( MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aTabbedViewId, - TUint aServiceId, - CPbk2UIExtensionView& aView, - TUid aId, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler, - CVIMPSTUIMenuExtension& aMenuExtension); - - public: // From MDownloadedContentHandler - - /** - * Handle downloaded content that has been saved to a file, - * and return ETrue if it was handled successfully. - * @param aFileName File name with path. - * @param aParamList Generic parameter list. - * @param aContinue Output parameter: It must be ETrue if the caller wants - * Browser not to terminate after the content is handled. - * @return ETrue if the implementer has processed the content. If it is - * EFalse, BrowserLauncher opens that content in an - * appropriate viewer application. - */ - TBool HandleContentL( const TDesC& aFileName, - const CAiwGenericParamList& aParamList, - TBool& aContinue ); - - /** - * Reserved for future use. - */ - TAny* DownloadedContentHandlerReserved1( TAny* aAnyParam ); - public: // from MApaServerAppExitObserver - /** - * Handle the exit of a connected server app. - * This implementation provides Series 60 default behavior - * for handling of the EAknCmdExit exit code. Derived classes - * should base-call this implementation if they override this - * function. - * @param aReason The reason that the server application exited. - * This will either be an error code, or the command id that caused - * the server app to exit. - */ - void HandleServerAppExit(TInt aReason); - - - public: // From MPbk2UIExtensionView through CxSPBaseView - - /** - * @see MPbk2UIExtensionView - */ - TBool HandleCommandKeyL( - const TKeyEvent& aKeyEvent, - TEventCode aType ); - - /** - * @see MPbk2UIExtensionView - */ - void DoDeactivate(); - - /** - * @see MPbk2UIExtensionView - */ - void HandleCommandL( TInt aCommand ); - - /** - * @see MPbk2UIExtensionView - */ - void DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ); - - /** - * @see MPbk2UIExtensionView - */ - void HandleStatusPaneSizeChange(); - - /** - * @see MPbk2UIExtensionView - */ - TAny* UIExtensionViewExtension( TUid aExtensionUid ); - - /** - * @see MPbk2UIExtensionView2 - */ - void HandleForegroundEventL(TBool aForeground); - - - public: // new functions - - /** - * Changes current status message - * @param aStatus Status which message is needed. - * @param aUpdateToNetwork ETrue update, EFalse do not update. - * @return KErrCancel if canceled. - */ - TInt AskStatusMessageL( TVIMPSTEnums::TOnlineStatus aStatus, - TBool aUpdateToNetwork ); - - /** - * Get status old status messages from file. - * @param aArray. Array of messages. Don't clear before filling. - * @param aStatus Status which message is needed. - */ - void ReadStatusMessagesL( CDesCArray& aArray, TVIMPSTEnums::TOnlineStatus aStatus ); - - /** - * Write status messages to file. - * @param aArray. Array of messages to write. Newest in top. Do not write duplicates. - * @param aStatus Status which message is needed. - */ - void WriteStatusMessagesL( MDesCArray& aArray, TVIMPSTEnums::TOnlineStatus aStatus ); - - /** - * Loads status icons for own status. - * @returns iconarray,ownership is transfered. - **/ - CAknIconArray* LoadOwnStatusIconsL(); - - /** - * Changes ownstatus - **/ - void ChangeStatusProcessL(); - - /** - * Adds a contact. - * @param aUserId id of contact to be added. - * @param aResourceId resource for query. - **/ - void AddContactL( const TInt aResouceId, const TDesC& aUserId = KNullDesC ); - - /** - * Deletes a contact. - **/ - void DeleteContactL(); - - /** - * @retunrs currentitemindex. - **/ - TInt CurrentItemIndex(); - - /** - * @retunrs current state. - **/ - TVIMPSTEnums::TVIMPSTRegistrationState GetServiceState(); - - - - /** - * Makes a internet call form send key and toolbar butotn - * if applicable. - **/ - void MakeVoipCallL(); - - - /** - * close conversation from service tab. - **/ - void CloseConversationL(); - - /* - *handles the completion of create new/update existing selection dialog - */ - void HandleContactSelectionCompleteL(); - - - - - public: //Toolbar - /** - * From MAknToolbarObserver - */ - void DynInitToolbarL( TInt aResourceId, CAknToolbar* aToolbar ); - - /** - * From MAknToolbarObserver - */ - void OfferToolbarEventL( TInt aCommand ); - - /** - * Create Fixed Toolbar - * Since 5.0 - */ - void CreateToolBarL(); - - /** - * Handle Fixed Toolbar command updating - * Since 5.0 - */ - void UpdateToolbarL(); - - - - /** - * Show or hide the toolbar - * Since 5.0 - * @aShow if ETrue, show toolbar, otherwise, Don't show the toolbar. - */ - void ShowHideFixedToolbarL(TBool aShow); - - /** - * Function to launch help - */ - void LaunchHelpL( const TDesC& aContext); - - /** - * returns the MVIMPSTSettingsStore pointer. - * Its created at the ConstructL of the view, so it stays till view is destructed - * - * @return MVIMPSTSettingsStore pointer : no ownership is transferred - **/ - MVIMPSTSettingsStore* SettingsStore(); - - /** - * returns whether the cancel login is supported or not - * - * @return TBool, ETrue if cancel login is supported else EFasle - */ - TBool CancelLoginSupportedL(); - - - private: // Functions from MVIMPSTEngineSearchExtentionEventObserver - - /** - * @see MVIMPSTEngineSearchExtentionEventObserver - */ - void HandleSearchResultL(RArray aSerachData) ; - - /** - * @see MVIMPSTEngineSearchExtentionEventObserver - */ - void HandleSearchFinishedL(TInt aError); - - - /** - * @see MVIMPSTEngineSearchExtentionEventObserver - */ - void HandleSearchKeysEventL( RArray& aEnumKeysArray, RPointerArray& aLebelKeysArray ) ; - - - private: // From CxSPBaseView - - /** - * @see CxSPBaseView - **/ - void DoActivateViewL( const TVwsViewId& aPrevViewId, - TUid aCustomMessageId, - const TDesC8& aCustomMessage ); - - - - private : //From MImCommandObserver - - /** - * @see MImCommandObserver - **/ - void CommandFinishedL( - const MVIMPSTCmd& aCommand ); - - /** - * @see MImCommandObserver - **/ - void HandleCommandEventL(TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt aServiceError) ; - - - /** - * BlockContactL - * @param Block if ETrue then call block else call unblock - */ - void BlockContactL(TBool aBlock = EFalse ); - - /** - * Show error note - * @param aError, error type - */ - void ShowErrorNoteL(TInt aError ); - - private: // Implementation - /** - * Standard C++ constructor - * @param aMapper Reference to view mapper object - * @param aContactManager Reference to contact manager object - * @param aTabbedViewId, view i. - * @param aServiceId, service id. - * @param aView, reference to the view. - * @param aId, uid - * @param aServiceData, service info. - * @param aEngine, reference to engine. - * @param aCommandHandler, reference to commandhandler. - */ - CVIMPSTUiTabbedView( MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aTabbedViewId, - TUint aServiceId, - CPbk2UIExtensionView& aView, - TUid aId, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler, - CVIMPSTUIMenuExtension& aMenuExtension); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - /** - * Standard C++ destructor. - */ - ~CVIMPSTUiTabbedView(); - - - /** - * Gets the reference to commandhandler. - * @returns MVIMPSTCmdHandler&, reference to CommandHandlerL. - */ - MVIMPSTCmdHandler& CommandHandlerL(); - - /** - * change own status message - */ - void ChangeOwnStatusMessageL(); - - /** - * change own avatar - * @param aFileName - a file name - * @param aMimeType - a mime type - */ - void ChangeOwnAvatarL(const TDesC& aFileName, const TDesC8& aMimeType ); - - /** - * search a given string - */ - void SearchContactsL() ; - - /** - * Used to launch search view - * @param aViewId - id of view to be launched - */ - void LaunchViewL( TInt aViewId ) ; - - /** - * processes friend request,when user opens friend request item - */ - void ProcessFriendRequestL(); - /** - * do login realted operations, tou, url - */ - void LoginL(); - /** - * shows URL to register for the First time users. - */ - void ShowURLQueryL(); - - /** - * opens broswer - * @param TDesC& aUrl - url to be opened - */ - void OpenWebBrowserL( const TDesC& aUrl ); - - /** - * shows poplist with Create New account, login with the existing userid. - * - * @since S60 5.0 - * @param aMenuChoise, will return the selected poplist item - */ - void ShowUseExistingOrCreateNewMenuL( TInt& aMenuChoise ); - - /** - * shows poplist with Create New account, login with the existing userid. - * - * @since S60 5.0 - * @return, will return the selected poplist item - */ - TInt ShowNewUpdateQueryL(); - - /** - * shows user name and password query dialog - * - * @since S60 5.0 - * @param aUserName, user name - * @param aPassword, password - */ - void ShowLoginDialogL( TDes& aUserName, TDes& aPassword ); - - /** - * Adds a phonebook contact. - **/ - void LaunchPhoneBookAddContactL(); - - /** - * launches selection dialog. - **/ - void LaunchPbkSelectionDlgL(); - - /** - * Adds all selected contact in aContacts. - **/ - void AddContactL(RPointerArray aContacts); - - - /** - * copies selected contact to phone book. - **/ - void CopyToPhoneBookL(); - - /** - * shows terms of use and logs in if userid and password is provided. - * - * @since S60 5.0 - * @return TInt, error if any. - */ - TInt ShowTermsofuseL(); - - - - /** - * returns whether the Change Connection is supported or not - * - * @return TBool, ETrue if Change Connection is supported else EFasle - */ - TBool ChangeConnectionSupportedL(); - - /* - *Shows the list of blocked contacts. - */ - void ShowBlockedContactListL(); - - /* - *Launches the setting view - */ - void LaunchSettingsViewL(); - - /* - *helper method for add or link to contacts - */ - void CreateOrLinkToPhoneBookL(TInt aCommand ); - - /* - *Launches the setting view - */ - void EditContactL(); - /* - *return true if URL query to be shown at login time, - * other wise false. - */ - TBool IsURLQueryToBeShownL(); - - - /* - * helper method for executing the call - */ - void ExecuteAiwCallL( const TDesC& aSelectedAddress ); - - /* - * helper method for checking and setting if user id is changed - */ - void ReadAndSetOwnUserIdL(); - /* - * launch the phonebook dialog for add from contacts depending on - * whether it is localstore or not - */ - void LaunchFetchDialogL(); - - /* - * Launch single contact selection dialog in case of local contacts for - * add from phonebook - */ - void ExecuteSingleItemFetchL( TAiwSingleEntrySelectionDataV2 aData ); - - /* - * Launch multiple contact selection dialog in case of server contacts for - * add from phonebook - */ - void ExecuteMultipleItemFetchL( TAiwMultipleEntrySelectionDataV2 aData ); - - /* - * Check and Create the servicehandler if it is NULL - */ - void ReInitializeServiceHandlerL(); - - public://from MAiwNotifyCallback. - TInt HandleNotifyL( - TInt aCmdId, - TInt aEventId, - CAiwGenericParamList& aEventParamList, - const CAiwGenericParamList& aInParamList); - - private: - enum TAssignmentState - { - EInvalid = 0, - EXSPAssign, - EDefaultAssign - }; - - private: // Data - - // Stores view id - TUint iViewId; - - //service id - TInt iServiceId; - - //Doesnt own - reference to engine for this service - MVIMPSTEngine& iEngine; - - //doesnt own - CVIMPSTUiBrandData* iBrandHandler; - - // Own: This view's control container - MVIMPSTUiTabbedViewControl* iContainer; - - // previous state. - TVIMPSTEnums::TVIMPSTRegistrationState iPreviousState; - - //CCA Param - Owns - MCCAParameter* iParameter; - - // Own: to connect CCA - //it is member variable because it is needed during the HideInBackground event - MCCAConnection* iConnection; - - //Owns. status message. - HBufC* iStatusMessage; - - //owns. object of aiwservicehandler. - CAiwServiceHandler *iServiceHandler; - - // not owned, reference to extension service - CVIMPSTUIExtensionService& iExtensionService; - - //Owns command Handler for this view - MVIMPSTCmdHandler& iCommandHandler; - - //doew not own, reference to menu extension - CVIMPSTUIMenuExtension& iMenuExtension; - - // owned, wait note. - CVIMPSTUtilsWaitNote* iWaitNote; - - //owned. Pointer to toolbar object. - CAknToolbar* iFixedToolbar; - - - //owns. object of MVPbkStoreContact - MVPbkStoreContact* iContact; - //Owns: Stores the focused contact ID from iContainer before it gets destroyed - HBufC* iFocussedIDHistory; - //handle to customize status pane - CCVIMPSTUiStatusPaneHandler* iStatusPaneHandler; - - //Owns Browser launcher - CBrowserLauncher* iBrLauncher; - - //Owns, username - HBufC* iUserId; - - // owns, retrive settings from cenrep store - MVIMPSTSettingsStore* iSettingsStore; - //in param list for aiw generic options, owns - CAiwGenericParamList* iAiwParamList; - // selected data - TVPbkSelectedData iSelectedData; - // Friend request accept,method index - TInt iSelectedAction; - // Owns : selected friendrequest id - HBufC* iFriendRequestId; - // owns : contact selection - CVIMPSTUiContactSelection* iContactSelection; - //to know whether to hide the add contact button on the toolbar - TBool iAddContact; - // owns : selected result from aiw call query - HBufC* iQueryResult; - - //iIsToolBarHidden, if ETrue: tool bar is already hidded - // no need to call again hidetoolbar. - TBool iIsToolBarHidden; - // NOT OWNS - CCoeAppUi* iAppUi; - - //Keep track, if iServiceHandler has been reset or not. - TBool iIsServiceHandleReSet; - - TBool iContainerCreationStarted; - - }; - -#endif // __CVIMPSTUITABBEDVIEW_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuitermsofusedialoghandler.h --- a/uiservicetab/vimpstui/inc/cvimpstuitermsofusedialoghandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/* -* Copyright (c) 2006 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: helper class for handling terms of use dialog. -* -*/ - - -#ifndef _CVIMPSTUITERMSOFUSEDIALOGHANDLER_H -#define _CVIMPSTUITERMSOFUSEDIALOGHANDLER_H - -#include - -class MVIMPSTSettingsStore; - - -/** - * Static helper class for handling terms of use dialog. - * - * @lib vimpstui.lib - * @since S60 v3.1 - */ -NONSHARABLE_CLASS( CVIMPSTUiTermsOfUseDialogHandler ) - { - -public: - - /** - * Method used to handle terms of use (ToU) dialog. - * Checks if current user id in aSap has - * already accepted ToU or not. If not shows - * ToU. Shows also "Login cancelled" note if user does not - * accept ToU. - * ownership is transfered. - * - * @param aSapStore Current SAP settings. - * @param aUserName current user name to login - * @return KErrCancel if user cancels ToU dialog, KErrNone if - * user accepts or has previously accepted ToU. - */ - TInt static HandleTermsOfUseDialogLD( MVIMPSTSettingsStore& aSettingsStore, - const TDesC& aUserName, - TInt& aServiceId, - HBufC* aToUMsg = NULL); - - TBool static DisplayTermsOfUseAndQueryLD(HBufC* aToUMsg = NULL); - -protected: - - // Prohibited constructor / destructor - CVIMPSTUiTermsOfUseDialogHandler(); - ~CVIMPSTUiTermsOfUseDialogHandler(); - - }; - -#endif // _CVIMPSTUITERMSOFUSEDIALOGHANDLER_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuitermsofusedlg.h --- a/uiservicetab/vimpstui/inc/cvimpstuitermsofusedlg.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ -/* -* Copyright (c) 2006 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: Dialog for showing the Terms of Use for a chat server -* -* -*/ - - -#ifndef CVIMPSTUITERMSOFUSEDLG_H -#define CVIMPSTUITERMSOFUSEDLG_H - -#include -#include -#include - -class CEikRichTextEditor; -class CParaFormatLayer; -class CCharFormatLayer; -class CAknsBasicBackgroundControlContext; -class CAknTitlePane; -class CEikScrollBar; - - -/** - * Dialog for showing the Terms of use -text - * - * @lib vimpstui.lib - * @since S60 3.1u - */ -NONSHARABLE_CLASS( CVIMPSTUiTermsOfUseDlg ) : public CAknDialog, - public MItemFinderObserver, - public MEikScrollBarObserver - { - public: - - /** - * Executes the dialog and destroys it before returning - * @since 3.1u - * @return EAknSoftkeyOk if user accepted. - * EAknSoftkeyCancel if user cancelled - */ - TInt RunDialogLD( TInt aResourceId ); - - static CVIMPSTUiTermsOfUseDlg* NewL( ); - - static CVIMPSTUiTermsOfUseDlg* NewLC( ); - - virtual ~CVIMPSTUiTermsOfUseDlg(); - - public: // from MObjectProvider - - TTypeUid::Ptr MopSupplyObject(TTypeUid aId); - - /* - *to set ToUString - *owner-ship transfered - */ - void SetToUMsgL(HBufC* aToUMsg); - - - public: //MEikScrollBarObserver - void HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType); - - protected: // from CEikDialog - - /** - * @see CEikDialog - */ - void PreLayoutDynInitL(); - - /** - * @see CEikDialog - */ - void PostLayoutDynInitL(); - - /** - * @see CEikDialog - */ - TBool OkToExitL( TInt aButtonId ); - - /** - * @see CEikDialog - */ - void SetSizeAndPosition( const TSize& aSize ); - - /** - * @see CEikDialog - */ - void SizeChanged(); - - protected: // From MItemFinderObserver - - /** - * @see MItemFinderObserver - */ - void HandleParsingComplete(); - - protected: //from base class CCoeControl - - /** - * @see CCoeControl - */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ); - - - /** - * @see CCoeControl - */ - void HandleResourceChange( TInt aType ); - - - private: - - CVIMPSTUiTermsOfUseDlg(); - - void ConstructL( ); - - private: // new functions - - /** - * Inserts line to rich text object - * @since 3.1u - * @param aTextResourceId Resource for text in line - * @param aBold Should text be bolded - */ - void InsertLineL( TInt aTextResourceId, TBool aBold = EFalse ); - - /** - * Inserts line to rich text object - * @since 3.1u - * @param aText Text for line - * @param aBold Should text be bolded - */ - void InsertLineL( const TDesC& aText, TBool aBold = EFalse ); - - /** - * Search the LAF specified font for invite dialog - * @since 3.1u - * @return LAF specified font - */ - const CFont* GetLayoutFont(); - - /** - * Gets the instance of the title pane - * @return Title pane pointer - * @since 3.1u - */ - CAknTitlePane* GetTitlePaneInstanceL() const; - - /** - * Stores the old title pane text and sets a custom one - * @since 3.1u - */ - void SetNewTitleTextL(); - - /** - * Retores the old title pane text - * @since 3.1u - */ - void RestoreTitlePaneTextL() const; - - /** - * Updates CBA. - * @since S60 v3.2 - */ - void UpdateCbaL(); - - /** - * Helper method to update TOU message text color according to - * current skin. - * Note! This will not update text control - * @since S60 v3.1u - */ - void UpdateTextColorL(); - - - private: // data - - // not own - CEikRichTextEditor* iEditor; - - // own - CItemFinder* iItemFinder; - - // Return value of this dialog - TInt iReturnVal; - - // Not Own. Paragraph formatter - CParaFormatLayer* iParaFormatLayer; - - // Not Own. Character formatter - CCharFormatLayer* iCharFormatLayer; - - // Own. For controlling the background image - CAknsBasicBackgroundControlContext* iBgContext; - - // Own. - HBufC* iOldTitleText; - - TInt* iRetVal; // Not own, return value of the dialog, - - HBufC* iToUText; - - // Own - stores the maximum position of the vertical scrollbar thumb - TInt iThumbMaxPos; - }; - -#endif // CVIMPSTUITERMSOFUSEDLG_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/cvimpstuiviewmanager.h --- a/uiservicetab/vimpstui/inc/cvimpstuiviewmanager.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that provides centralized access for UI classes -* to logic handling -* -*/ - - -#ifndef C_CVIMPSTUIVIEWMANAGER_H -#define C_CVIMPSTUIVIEWMANAGER_H - -// INCLUDES -#include -#include -#include "mvimpstengine.h" - -// FORWARD DECLARATIONS -class MxSPViewInfo; -class CVIMPSTUIExtensionViewInfo; -class CEikonEnv; -class CVIMPSTUiExtensionFactory; -class CVIMPSTUIExtensionService; -class CVIMPSTUIMenuExtension; - -// CLASS DECLARATION - -/** - * - * This class provides access to logic handling behind UI. - * - * @lib vimpstui.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTUIViewManager ) : public CBase - { - public: // Constructor and destructor - - /** - * Two-phased constructor. - * - * @param aServiceName, service name. - * @param aExtensionFactory, extension factory - */ - static CVIMPSTUIViewManager* NewL( - const TDesC& aServiceName, - CVIMPSTUiExtensionFactory& aExtensionFactory ); - - /** - * Two-phased constructor. - * - * @param aServiceName, service name. - * @param aExtensionFactory, extension factory - */ - static CVIMPSTUIViewManager* NewLC( - const TDesC& aServiceName, - CVIMPSTUiExtensionFactory& aExtensionFactory ); - - /** - * Standard C++ destructor - */ - ~CVIMPSTUIViewManager(); - - - public: - - /** - * Adds new client to use engine - * - * @param aServiceId, service id of the client - * @param aEngine, reference to engine. - * @param aTabbedViewId, tabbed view id for this service - * @param aSearchViewId, details view id for this service - */ - void AddNewClientL( - TUint aServiceId, - MVIMPSTEngine& aEngine, - TInt aTabbedViewId, - TInt aSearchViewId, - TInt aBlockedViewId , - CVIMPSTUIMenuExtension& aMenuExtension); - - - - /** - * Returns reference to shared eik env instance. - * - * @since S60 5.0 - * @return CEikonEnv&, eik env reference - */ - CEikonEnv& EikEnv(); - - - /** - * Returns view info count. - * - * @since S60 5.0 - * @return Count of view info items - */ - TInt ViewInfoCount() const; - - /** - * Returns specific view info object - * - * @since S60 5.0 - * @param aIndex, index of view info object. - * @return View info object, ownerhsip is not passed. - */ - const MxSPViewInfo* ViewInfo( TInt aIndex ) const; - - /** - * Returns service count - * - * @since S60 5.0 - * @return TInt, service count - */ - TInt ServiceCount() const; - - CVIMPSTUIExtensionService& Service( TInt aIndex ) const ; - - MVIMPSTEngine& Engine( TInt aIndex ) const; - - private: - - - /** - * Resolves service data object by service id. If service object - * can not be found, leaves with KErrNotFound; - * - * @since S60 5.0 - * @param aServiceId, service id - * @return CVIMPSTUIExtensionService, reference to service - */ - CVIMPSTUIExtensionService& ResolveServiceL( - TUint aServiceId ); - - - private: // Implementation - - /** - * Standard C++ constructor - * @param aServiceName, service name. - * @param aExtensionFactory, extension factory - */ - CVIMPSTUIViewManager( - const TDesC& aServiceName, - CVIMPSTUiExtensionFactory& aExtensionFactory ); - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - private: // Data - - // Service provider settings handler - const TDesC& iServiceName; - - // Not own, shared eik env instance - CEikonEnv* iEikEnv; - - // Own, services - RPointerArray iServices; - - // Own, Array of view infos to be informed to xSP Extension Manager - RPointerArray iViewInfos; - - // Extension factory - CVIMPSTUiExtensionFactory& iExtensionFactory; - - - - }; - -#endif // C_CVIMPSTUIVIEWMANAGER_H - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/mvimpstsearchuibuilder.h --- a/uiservicetab/vimpstui/inc/mvimpstsearchuibuilder.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2008 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: base class for search ui builder -* -*/ - - -#ifndef MVIMPSTSEARCHUIBUILDER_H -#define MVIMPSTSEARCHUIBUILDER_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CCoeControl; -class CEikCaptionedControl; -// CLASS DECLARATION - -/** - * search field UI builder interface. - */ -class MVIMPSTSearchUiBuilder - { - public: // Interface - - /** - * create a new line - * @param aCaption, caption of field line - * @param aControlId, control id - * @param aControlType, control type - * @return A new instance of CCoeControl. - */ - virtual CCoeControl* CreateLineL( - const TDesC& aCaption, - TInt aControlId, - TInt aControlType ) = 0; - - - /** - * Return the control corresponding to given id. - * @param aControlId Id of the control. - * @return The control or NULL if the control does not exist. - */ - virtual CCoeControl* Control( - TInt aControlId ) const = 0; - - /** - * Returns the control line corresponding to given id. - * @param aControlId Id of the control. - * @return Line control. - */ - virtual CEikCaptionedControl* LineControl( - TInt aControlId ) const = 0; - - - /** - * Try to change the focus to given control. - * @param aControlId Id of the control. - */ - virtual void TryChangeFocusL( - TInt aControlId ) = 0; - - /** - * Change the line controls caption in the UI. - * @param aText The caption to set. - */ - virtual void SetCurrentLineCaptionL( - const TDesC& aText ) = 0; - - /** - * Sets the field to editable state. - * @param aState ETrue to set editable, EFalse otherwise. - */ - virtual void SetEditableL( - TBool aState ) = 0; - - - protected: // Disabled functions - - virtual ~MVIMPSTSearchUiBuilder() - {}; - }; - -#endif // MVIMPSTSEARCHUIBUILDER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/mvimpstuisearchfield.h --- a/uiservicetab/vimpstui/inc/mvimpstuisearchfield.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* Copyright (c) 2008 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: search fields interface. -* -*/ - - -#ifndef MVIMPSTUISEARCHFIELD_H -#define MVIMPSTUISEARCHFIELD_H - -// INCLUDES -#include -#include "tvimpstenums.h" - -// FORWARD DECLARATIONS -class CEikEdwin; -class CEikCaptionedControl; - -enum TVIMPSTSearchDataFieldType - { - EVIMPSTEdwinText, - EVIMPSTEdwinNumber, - EVIMPSTEdwinEmail, - EVIMPSTEdwinMobile - }; - -enum TIMPSTSearchFieldTypes - { - EIMBasicSearch = 0 , - EIMAdvancedSearch - }; - - -// CLASS DECLARATION -/** - * search field interface. - */ - -class MVIMPSTUiSearchField - { - - public: // Interface - - /** - * virtual Destructor. - */ - virtual ~MVIMPSTUiSearchField() - { - } - - /** - * control id - * @return Dialog control id. - */ - virtual TInt ControlId() const = 0; - - - /** - * Returns the CEikEdwin. - * @return Field label. - */ - - virtual CEikEdwin* Control() const = 0 ; - - /** - * SetControl and captured control - * @param aControl, a control to set - * @param aCaptionedCtrl, a captured control to set - */ - virtual void SetControl(CEikEdwin* aControl, - CEikCaptionedControl* aCaptionedCtrl) = 0 ; - - - /** - * activate the field - * before calling must call SetControl - */ - virtual void ActivateL() = 0 ; - - - /** - * Returns the Control Text. - * @return Field data. - */ - virtual HBufC* ControlTextL() const = 0 ; - - /** - * Returns the field label. - * @return field label. - */ - virtual TPtrC FieldLabel() = 0; - - - /** - * Returns the field data. - * @return field data. - */ - virtual TPtrC FieldData() = 0; - - - /** - * Sets given data as the field - * @param aData, data to set - */ - virtual void SetFieldDataL( - const TDesC& aData ) = 0; - - - /** - * @return the field data type - */ - virtual TVIMPSTSearchDataFieldType FieldDataType() const = 0 ; - - /** - * @return ETrue if basic field - */ - virtual TBool IsBasicField() const = 0 ; - - /** - * @return field search key - */ - virtual TVIMPSTEnums::TVIMPSTSearchKey GetSearchKey() const = 0 ; - - /** - * reset the field data. - */ - virtual void ResetFieldData() = 0; - - }; - -#endif // MVIMPSTUISEARCHFIELD_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/mvimpstuitabbedviewcontrol.h --- a/uiservicetab/vimpstui/inc/mvimpstuitabbedviewcontrol.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2008 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: parent class for tabbed view control -* -*/ - - -#ifndef _MVIMPSTUITABBEDVIEWCONTROL_H -#define _MVIMPSTUITABBEDVIEWCONTROL_H - -// INCLUDES -#include -#include "mvimpstprocessArrayobserver.h" - -#include // MEikListBoxObserver -#include -#include - -#include -#include -#include // for phonebook2 -#include - - -// FORWARD DECLARATIONS - -class MPbk2KeyEventHandler; -class MVIMPSTCmdHandler; -class MVIMPSTProcessArray; -class CVIMPSTUiBrandData; -class CAknSearchField; -class MVIMPSTEngine; -class CVIMPSTUiTabbedView; -class CVPbkFieldTypeSelector; -class CVPbkContactManager; -class CAiwServiceHandler; -class CPbk2SortOrderManager; -class MPbk2ContactNameFormatter; -class MVPbkContactStore; -class TVPbkContactStoreEvent; -class CCAStatusPaneHandler; - -//CLASS DECLARATION -/** - * parent class for tabbed view control - * - * there are two implementations of this class for single style/line and double style/line listboxes - * container holds the corresponding type of listbox and array. - * The common methods accessed from view( tabbed view ) are here which has to be - * implemented by the concrete class containers. - * - * @lib vimpstui.dll - * @since S60 v5.0 - */ -class MVIMPSTUiTabbedViewControl - { -public: - /** - * Public destructor - */ - virtual ~MVIMPSTUiTabbedViewControl() {}; -public: - /* - * Returns the coecontrol pointer from the aControl - * - * @return the pointer to CCoeControl - */ - virtual CCoeControl* CoeControl() = 0; - /** - * Returns the currently focused item's index. - * @return TInt, current item index. - */ - virtual TInt CurrentItemIndex() const = 0; - - /** - * send the message using selected item - * this will launch the conversation view if im is enabled. - */ - virtual void SendMessageL()= 0; - - - /** - * Activates find-pane - */ - virtual void ActivateFindPaneL() = 0 ; - - /** - * De-activates find-pane - */ - virtual void DeactivateFindPaneL() = 0; - - /** - * Checks if the last contact is focused and Sets the iLastItemFlag - */ - virtual void CheckAndSetLastItemFlag()= 0 ; - /** - * Sets the flag to clear the find pane - */ - virtual void SetClrFindPaneFlag(TBool aFlag) = 0; - - /** - * Updates view after edit. - * @param aIndex is the index of item that has changed. - * @param aType is list item type. - */ - virtual void UpdateViewL( TInt aIndex, TVIMPSTEnums::TItem aType)= 0; - - /** - * Handles item addition for this control. - */ - virtual void HandleItemAdditionL()= 0; - - /** - *Handle the avatar deletion,updation in UI - */ - virtual void HandleAvatarRefreshL( const TDesC& aUserId,TBool aBlock)= 0; - - /** - *Handle the avatar deletion in UI - */ - virtual void SetFocussedId(const TDesC& aContact) = 0 ; - - /** - *Handle the avatar deletion in UI - */ - virtual TPtrC GetFocussedId() = 0 ; - - - }; - - -#endif // _MVIMPSTUITABBEDVIEWCONTROL_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/inc/mvimpstuitabcontrolfactory.h --- a/uiservicetab/vimpstui/inc/mvimpstuitabcontrolfactory.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2008 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: Factory implementation of the tabbed view controls -* -*/ - - -#include "cvimpstuidoublelistboxtabviewcontrol.h" // container with double line listbox -#include "cvimpstuisinglelistboxtabviewcontrol.h" // container with single line listbox -#include "mvimpstengine.h" - - -class MVIMPSTUiTabbedViewControlFactory - { -public: - - /** - * creates the MVIMPSTUiTabbedViewControl implementations based on the - * presence availability of the service : OWNERSHIP TO THE CALLER - * - * it checks from aEngine.IsPresenceEnabled() ; the presence availability - * then it creates the corresponding container - * - * @param aTabbedView reference to view. - * @param aKeyEventHandler Key event handler to be used - * @param aCommandHandler reference to commandhandler - * @param aServiceId Id of the service - * @param aBrandHandler reference to brandhandler - * @param aEngine reference to engine - * - * @return MVIMPSTUiTabbedViewControl object based on the presence availability - * : OWNERSHIP TO THE CALLER - */ - static MVIMPSTUiTabbedViewControl* NewTabControlL( CVIMPSTUiTabbedView& aTabbedView, - MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, - TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba) - - { - // LOGIC : IF presence is enabled for that service then - // it creates double listbox control - // if presencxe is NOT Enabled creates single listbox control - if( aEngine.SubService( TVIMPSTEnums::EPresence) ) - { - return CVIMPSTUiDoubleListBoxTabViewControl::NewL( aTabbedView, - aKeyEventHandler, - aCommandHandler, - aServiceId, - aBrandHandler , - aEngine, - aCba); - - } - else - { - return CVIMPSTUiSingleListBoxTabViewControl::NewL( aTabbedView, - aKeyEventHandler, - aCommandHandler, - aServiceId, - aBrandHandler , - aEngine, - aCba); - } - } - - }; diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/rss/20012423.rss --- a/uiservicetab/vimpstui/rss/20012423.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* -* Copyright (c) 2008 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: ECom resource. -* -*/ - - -// INCLUDES -#include -#include -#include "../inc/vimpstextentionuiuid.h" - -/** - * The registry information. - */ -RESOURCE REGISTRY_INFO theInfo - { - // use resource format version 2 to enable ROM only plugins - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = KIMCONTACTSEXTNIMPLEMENTATIONUID; - interfaces = - { - INTERFACE_INFO - { - interface_uid = KPBKXSPINTERFACEDEFINITIONUID; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KIMCONTACTSEXTNIMPLEMENTATIONUID; - version_no = 1; - display_name = ""; - default_data = KPBKXSPDEFAULTDATASTRING; - opaque_data = ""; - rom_only = 0; // This is not a ROM only plugin - } - }; - } - }; - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/rss/vimpsterrornotes.rss --- a/uiservicetab/vimpstui/rss/vimpsterrornotes.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2002 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: Resource file of error notes -* -*/ - - -RESOURCE TBUF r_im_error_service_err { buf = qtn_im_error_service_err; } -RESOURCE TBUF r_im_error_serv_busy { buf = qtn_im_error_serv_busy; } -RESOURCE TBUF r_im_error_gen_error { buf = qtn_im_error_gen_error; } -RESOURCE TBUF r_im_error_wrong_wvid { buf = qtn_im_error_wrong_wvid; } -RESOURCE TBUF r_im_login_passer_note { buf = qtn_im_login_passer_note; } -RESOURCE TBUF r_qtn_chat_error_not_sup_functions { buf = qtn_chat_error_not_sup_functions; } -RESOURCE TBUF r_qtn_servtab_saving_contact_failed { buf = qtn_servtab_saving_contact_failed;} -RESOURCE TBUF r_qtn_servtab_error_addown { buf = qtn_servtab_error_addown; } -RESOURCE TBUF r_qtn_servtab_noxsp_error { buf = qtn_servtab_noxsp_error; } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/rss/vimpstui.hrh --- a/uiservicetab/vimpstui/rss/vimpstui.hrh Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ -/* -* Copyright (c) 2008 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: -* id definitions for Example. -* -*/ - - -#ifndef __VIMPSTUI_HRH__ -#define __VIMPSTUI_HRH__ - - - -/** - * Control IDs. - * - * NOTE! Control IDs can't start from zero. - */ -enum TControlIds - { - EGeneralWaitNoteId = 1, - ETOURichEditorId - }; - - -// CONSTANTS -// First available command id for example extension -#define KFirstCommandId 10100 - -/** - * Commands for the Example component. - */ -enum TImContactsExtentionCommands - { - //common commands - ECmdLogin = KFirstCommandId, - ECmdLogout, - ECmdChangeConnectioninWaitingState, - ECmdChangeConnectioninOnlineState, - ECmdCancelLogin, - ECmdSettings, - ECmdContactEdit, - ECmdOpenFriendRequest, - ECmdChangeStatus, - ECmdOpenConversation, - ECmdCloseConversation, - ECmdContactOption, - ECmdCreateNewOption, - ECmdBlock, - ECmdUnBlock, - ECmdGetBlockedList, - - //contact option submneu commands - ECmdContactDetails, - ECmdContactDelete, - - //create new submenu option commands - ECmdAddContact, - ECmdAddFromPhoneBook, - ECmdSearch, - - ESearchAddFriends, - ESearchOpenConversation, - ESearchMore, - ESearchPrev, - ESearchNew, - - //tool bar - ECmdToolbarVoipCall, - ECmdToolbarChat, - ECmdToolbarNewContact, - ECmdToolbarDetails, - - EBasicSearch, - EAdvancedSearch, - ESearchWaitNote, - EImCmdHelp, - ECmdExit, - - //avatar - ECmdMyAvatar, - ECmdDefaultAvatar, - ECmdAvatarGallery, - ECmdAvatarNewPhoto, - - // unknown contacts related command - ECmdContactAddAsFriend, - - // aiw assin commands - ECmdAIWAddToContact , - ECmdAIWLinkToContact, - - // reserve range for AIW commands - ECmdAIWRangeStart - - - }; - - -enum TIMPSCommonUIMenuCommands - { - EIMPSCommonUIFindMenuPlaceHolder = 1, - EIMPSCommonUITOUContinue - }; - -/** - * Client group remote UI query messages. - * - * Enumeration defining different client group confirmation - * queries and their responses. - */ -enum TCnUiRemoteUiMessages - { - ERemoteCancelAllActivity = KErrCancel, - ERemoteQueryAccepted = ETrue, - ERemoteQueryDeclined = EFalse, - - ECGQActiveConnectionScheduledClose = 100, /// - -// MACROS - -#define qgn_gc_service_tab EMbmImextentionuiExample_msn_tab //EMbmExampleExample_tab -#define qgn_gc_service_tab_mask EMbmImextentionuiExample_msn_tab_mask //EMbmExampleExample_tab_mask -#define qgn_gc_service_icon EMbmImextentionuiExample_yahoo_tab -#define qgn_gc_service_icon_mask EMbmImextentionuiExample_yahoo_tab_mask - -#endif // __VIMPSTUIICONS_HRH__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/rss/vimpstuires.rss --- a/uiservicetab/vimpstui/rss/vimpstuires.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1363 +0,0 @@ -/* -* Copyright (c) 2008 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: This file contains all the resources for Example module. -* -*/ - - -// RESOURCE IDENTIFIER -NAME VIPT // 4 letter ID VIPT-voip im presence tab -to make it unique - -#include - -#include -#include - - -#include -#include "eikon.rsg" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include "vimpstui.hrh" -#include "vimpstuiicons.hrh" - -#include - -// RESOURCE DEFINITIONS -// DEFINES - -// --------------------------------------------------------- -// Standard resource signature -// --------------------------------------------------------- -// -RESOURCE RSS_SIGNATURE { } - -//---------------------------------------------------- -// -// r_chatclient_general_menu -// Items for general menu -// -//---------------------------------------------------- -// - -RESOURCE TBUF r_qtn_chat_deleting_contact - { - buf = qtn_chat_deleting_contact; - } - -RESOURCE TBUF r_qtn_use_existing - { - buf = qtn_servtab_query_use_existing; - } - -RESOURCE TBUF r_qtn_update_existing - { - buf = qtn_servtab_query_update_existing; - } -RESOURCE TBUF r_qtn_create_new - { - buf = qtn_servtab_query_register_new; - } -RESOURCE TBUF r_qtn_create_new_contact - { - buf = qtn_servtab_query_create_new; - } - -RESOURCE TBUF r_qtn_select_action - { - buf = qtn_servtab_acc_creation_title; - } - -//common option menu for both Voip and IM -RESOURCE MENU_PANE r_tabbed_view_general_menu - { - items= - { - MENU_ITEM { command = ECmdLogin; txt = qtn_chat_main_om_login; }, - MENU_ITEM { command = ECmdChangeConnectioninWaitingState; txt = qtn_servtab_change_connection; }, - MENU_ITEM { command = ECmdGetBlockedList; txt = qtn_servtab_option_blockedlist;}, - MENU_ITEM { command = ECmdLogout; txt = qtn_chat_main_om_logout;}, - MENU_ITEM { command = ECmdChangeConnectioninOnlineState; txt = qtn_servtab_change_connection; }, - MENU_ITEM { command = ECmdCancelLogin; txt = qtn_servtab_cancel_login;}, - MENU_ITEM { command = ECmdSettings; txt = qtn_chat_settings;}, - MENU_ITEM { command = EAknCmdHelp; txt = qtn_options_help; }, - MENU_ITEM { command = EAknSoftkeyExit; txt = qtn_options_exit; } - }; - } - -RESOURCE MENU_PANE r_servtab_createnew_option_submenu - { - items= - { - MENU_ITEM { command=ECmdAddContact; txt = qtn_servtab_add_manually; }, - MENU_ITEM { command=ECmdAddFromPhoneBook; txt = qtn_servtab_add_from_phonebook; }, - MENU_ITEM { command=ECmdSearch; txt = qtn_servtab_search; } - }; - } - -RESOURCE MENU_PANE r_servtab_changeavatar_submenu - { - items= - { - MENU_ITEM { command=ECmdAvatarGallery; txt = qtn_servtab_avatar_from_gallery; }, - MENU_ITEM { command=ECmdAvatarNewPhoto; txt = qtn_servtab_avatar_new_photo; }, - MENU_ITEM { command=ECmdDefaultAvatar; txt = qtn_servtab_avatar_default; } - }; - } - -/** - * tab view IM service specific menu pane. - */ -RESOURCE MENU_PANE r_servtab_tabbed_view_menu - { - items = - { - MENU_ITEM // Open conversation - { - command = ECmdOpenConversation; - txt = qtn_servtab_open_conversation; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command = ECmdContactAddAsFriend; - txt = qtn_servtab_add_as_friend; - flags = EEikMenuItemSpecific; - }, - - MENU_ITEM - { - command = KAiwCmdCall; // The same ID than in interest. - txt = ""; // Will be replaced by AIW (plugin). - cascade=AIW_CASCADE_ID; - //cascade = AIW_INTELLIGENT_CASCADE_ID; - flags = EEikMenuItemSpecific; - - }, - - MENU_ITEM - { - command = ECmdCloseConversation; - txt = qtn_servtab_close_conversation; - flags = EEikMenuItemSpecific; - }, - - MENU_ITEM - { - command = ECmdCreateNewOption; - cascade = r_servtab_createnew_option_submenu; - txt = qtn_servtab_new_contact; - }, - - MENU_ITEM - { - command=ECmdContactDetails; - txt = qtn_servtab_contact_details; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command=ECmdOpenFriendRequest; - txt = qtn_servtab_open; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command=ECmdContactEdit; - txt = qtn_chat_friend_om_edit; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command=ECmdAIWAddToContact; - txt = qtn_servtab_add_to_phonebook_new; - flags = EEikMenuItemSpecific; - },//AIW - MENU_ITEM - { - command=ECmdAIWLinkToContact; - txt = qtn_servtab_add_to_phonebook_update; - - flags = EEikMenuItemSpecific; - - },//AIW - MENU_ITEM - { - command=ECmdBlock; - txt = qtn_servtab_block_presence; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command=ECmdUnBlock; - txt = qtn_servtab_unblock_presence; - flags = EEikMenuItemSpecific; - }, - MENU_ITEM - { - command=ECmdContactDelete; - txt = qtn_servtab_delete; - flags = EEikMenuItemSpecific; - }, - - MENU_ITEM - { - command = ECmdChangeStatus; - txt = qtn_chat_friend_change_status; - }, - MENU_ITEM - { - command=ECmdMyAvatar; - cascade = r_servtab_changeavatar_submenu; - txt = qtn_servtab_avatar_set; - } - }; - } - - - -/** - * tab view cba. - */ -RESOURCE CBA r_im_contacts_tabbed_view_softkeys - { - flags = 0; - buttons = - { - CBA_BUTTON {id=EAknSoftkeyOptions; txt=text_softkey_option;}, - CBA_BUTTON {id=EAknSoftkeyExit; txt= text_softkey_exit;} - }; - } - - -RESOURCE XSP_VIEW_INFO_ARRAY r_im_contacts_view_info - { - items = - { - - }; - } - -// Empty Tabbed View Message -RESOURCE TBUF r_qtn_servtab_swupdate_restart { buf = qtn_servtab_swupdate_restart; } -// these are used with double line listbox -RESOURCE TBUF r_qtn_servtab_login_list_item { buf = qtn_servtab_login_list_item; } -RESOURCE TBUF r_qtn_servtab_logging_list_item { buf = qtn_servtab_logging_list_item; } -RESOURCE TBUF r_qtn_servtab_loggingout_list_item { buf = qtn_servtab_loggingout_list_item; } -RESOURCE TBUF r_qtn_servtab_updating_list_item { buf = qtn_servtab_updating_list_item; } -RESOURCE TBUF r_qtn_servtab_login_list_item_name { buf = qtn_servtab_login_list_item_name; } -RESOURCE TBUF r_qtn_servtab_waiting_list_item { buf = qtn_servtab_waiting_list_item; } - -// these are used with single line listbox -RESOURCE TBUF r_qtn_servtab_single_line_login_list_item { buf = qtn_servtab_single_line_login_list_item; } -RESOURCE TBUF r_qtn_servtab_single_line_login_list_item_with_username { buf = qtn_servtab_single_line_login_list_item_with_username; } -RESOURCE TBUF r_qtn_servtab_single_line_logging_list_item { buf = qtn_servtab_single_line_logging_list_item; } -RESOURCE TBUF r_qtn_servtab_single_line_updating_list_item { buf = qtn_servtab_single_line_updating_list_item; } -RESOURCE TBUF r_qtn_servtab_single_line_waiting_list_item { buf = qtn_servtab_single_line_waiting_list_item; } -RESOURCE TBUF r_qtn_servtab_single_line_loggingout_list_item { buf = qtn_servtab_single_line_loggingout_list_item; } - -RESOURCE TBUF r_servtab_unnamed { buf = qtn_servtab_unnamed; } -RESOURCE TBUF r_servtab_unknown_buddy { buf = qtn_servtab_unknown_buddy ; } -// avatar related - -RESOURCE TBUF r_qtn_servtab_gallery_error_drmfile { buf = qtn_servtab_gallery_error_drmfile; } -RESOURCE TBUF r_qtn_servtab_gallery_error_badfile { buf = qtn_servtab_gallery_error_badfile; } -RESOURCE TBUF r_qtn_servtab_gallery_lsk_select { buf = qtn_servtab_gallery_lsk_select; } -RESOURCE TBUF r_qtn_servtab_gallery_title_avatar { buf = qtn_servtab_gallery_title_avatar; } -RESOURCE TBUF r_qtn_servtab_error_update_avatar { buf = qtn_servtab_error_update_avatar ; } -RESOURCE TBUF r_qtn_servtab_change_avatar_changing { buf = qtn_servtab_change_avatar_changing ; } -RESOURCE TBUF r_qtn_servtab_change_avatar_changed { buf = qtn_servtab_change_avatar_changed ; } - -RESOURCE DIALOG r_im_error_note_template - { - flags = EAknErrorNoteFlags | EEikDialogFlagWait; - buttons=R_AVKON_SOFTKEYS_EMPTY; - items= - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control= AVKON_NOTE - { - layout = EGeneralLayout; - animation = R_QGN_NOTE_ERROR_ANIM; - }; - } - }; - } -RESOURCE DIALOG r_im_error_note_template_with_ok - { - flags = EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_OK_EMPTY__OK; - items= - { - DLG_LINE - { - type = EAknCtQuery; - id = EGeneralQuery; - control= AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - animation = R_QGN_NOTE_ERROR_ANIM; - }; - } - }; - } -RESOURCE DIALOG r_im_add_contact_manual_query - { - flags = EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - //itemflags=EEikDlgItemTakesEnterKey; - control= AVKON_DATA_QUERY - { - layout = EDataLayout; - label = qtn_servtab_add_userid; - control=EDWIN - { - flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; - maxlength=100; - width=16; - lines=1; - default_case = EAknEditorLowerCase; - avkon_flags = EAknEditorFlagLatinInputModesOnly; - }; - }; - } - }; - } - -RESOURCE TBUF r_qtn_servtab_searching { buf = qtn_servtab_searching; } -RESOURCE TBUF r_qtn_chat_empty_search_primary { buf = qtn_chat_empty_search_primary; } -RESOURCE TBUF r_qtn_chat_empty_search { buf = qtn_chat_empty_search; } -RESOURCE TBUF r_qtn_servtab_search_results { buf = qtn_servtab_search_results; } -RESOURCE TBUF r_qtn_servtab_blocking { buf = qtn_servtab_blocking; } -RESOURCE TBUF r_qtn_chat_unblocking { buf = qtn_chat_unblocking; } -RESOURCE TBUF r_qtn_servtab_title_blockedlist { buf = qtn_servtab_title_blockedlist; } - -RESOURCE DIALOG r_im_search_contacts_query - { - flags = EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - control= AVKON_DATA_QUERY - { - layout = EDataLayout; - label = qtn_chat_search_data_prtx; - control=EDWIN - { - flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; - maxlength=100; - width=16; - lines=1; - default_case = EAknEditorLowerCase; - avkon_flags = EAknEditorFlagLatinInputModesOnly; - }; - }; - } - }; - } - - -//---------------------------------------------------- -// -// Items for menupane in search view -// -//---------------------------------------------------- -// -RESOURCE MENU_PANE r_servtab_search_view_menu -{ - items= - { - - MENU_ITEM { command = ESearchAddFriends; - txt = qtn_servtab_add_to_contacts; - - flags = EEikMenuItemSpecific; - - }, - - MENU_ITEM { command = ESearchMore; - txt = qtn_chat_search_om_more; - }, - MENU_ITEM { command = ESearchPrev; - txt = qtn_chat_search_om_prev; - }, - - - MENU_ITEM { command = ESearchOpenConversation; - txt = qtn_servtab_open_conversation; - - flags = EEikMenuItemSpecific; - - } - , - - MENU_ITEM { command = ESearchNew; - txt = qtn_chat_search_om_new; - } - - - }; -} -RESOURCE DIALOG r_im_info_note_template - { - flags = EAknInformationNoteFlags | EEikDialogFlagWait; - buttons=R_AVKON_SOFTKEYS_EMPTY; - items= - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control= AVKON_NOTE - { - layout = EGeneralLayout; - animation = R_QGN_NOTE_INFO_ANIM; - }; - } - }; - } - - -RESOURCE TBUF r_qtn_im_contact_remove_note { buf = qtn_im_contact_remove_note; } - -RESOURCE TBUF r_qtn_servtab_delete_contact { buf = qtn_servtab_delete_contact; } - -RESOURCE TBUF r_qtn_servtab_saving_contact { buf = qtn_servtab_saving_contact; } -RESOURCE TBUF r_qtn_servtab_add_to_contacts { buf = qtn_servtab_add_to_contacts; } -RESOURCE TBUF r_qtn_servtab_close_conv { buf = qtn_chat_cquery_close_conv; } -RESOURCE TBUF r_qtn_sertab_contact_already_exists_error_note { buf = qtn_sertab_contact_already_exists_error_note; } - -RESOURCE TBUF r_qtn_servtab_select_user { buf = qtn_servtab_add_contact_select_username; } - -RESOURCE TBUF r_qtn_servtab_declining_invite { buf = qtn_servtab_declining_invite; } - -RESOURCE TBUF r_qtn_servtab_add_friend_blocked { buf = qtn_servtab_add_friend_blocked; } - - -RESOURCE DIALOG r_generic_yes_no_confirmation_query - { - flags=EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_YES_NO__YES; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - control= AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - }; - } - }; - } - -// --------------------------------------------------------- -// -// r_message_query -// -// --------------------------------------------------------- -// - -RESOURCE DIALOG r_message_query - { - flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow; - buttons = R_AVKON_SOFTKEYS_OK_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtPopupHeadingPane; - id = EAknMessageQueryHeaderId; - itemflags = EEikDlgItemNonFocusing; - control = AVKON_HEADING - { - label = KNullDesC; - headinglayout=R_AVKON_LIST_HEADING_PANE_POPUPS; - }; - }, - DLG_LINE - { - type = EAknCtMessageQuery; - id = EAknMessageQueryContentId; - control = AVKON_MESSAGE_QUERY - { - }; - } - }; - } -// Own status change -RESOURCE TBUF r_qtn_chat_change_own_online { buf = qtn_chat_change_own_online; } -RESOURCE TBUF r_qtn_chat_change_own_away { buf = qtn_chat_change_own_away; } -RESOURCE TBUF r_qtn_servtab_change_own_dnd { buf = qtn_servtab_change_own_dnd; } -RESOURCE TBUF r_qtn_chat_change_own_appear_offline { buf = qtn_chat_change_own_appear_offline; } -RESOURCE TBUF r_qtn_chat_change_status_message { buf = qtn_chat_change_status_message; } -RESOURCE TBUF r_qtn_chat_change_status_changing { buf = qtn_chat_change_status_changing; } -RESOURCE TBUF r_qtn_chat_change_status_changed { buf = qtn_chat_change_status_changed; } -RESOURCE TBUF r_qtn_chat_change_status_failed { buf = qtn_chat_change_status_failed; } -RESOURCE TBUF r_qtn_chat_change_message_failed { buf = qtn_chat_change_message_failed; } -RESOURCE TBUF r_qtn_chat_change_message_changed { buf = qtn_chat_change_message_changed; } -RESOURCE TBUF r_qtn_chat_change_message_changing { buf = qtn_chat_change_message_changing; } -RESOURCE TBUF r_qtn_im_change_status_not_changed { buf = qtn_im_change_status_not_changed; } -RESOURCE TBUF r_qtn_chat_change_new_message { buf = qtn_chat_change_new_message; } -RESOURCE TBUF r_qtn_chat_change_select_message { buf = qtn_chat_change_select_message; } - -// search related resources -RESOURCE TBUF r_qtn_servtab_search_firstname { buf = qtn_servtab_search_firstname; } -RESOURCE TBUF r_qtn_servtab_search_lastname { buf = qtn_servtab_search_lastname; } -RESOURCE TBUF r_qtn_servtab_search_nickname { buf = qtn_servtab_search_nickname; } -RESOURCE TBUF r_qtn_servtab_search_fullname { buf = qtn_servtab_search_fullname; } -RESOURCE TBUF r_qtn_servtab_search_city { buf = qtn_servtab_search_city; } -RESOURCE TBUF r_qtn_servtab_search_state { buf = qtn_servtab_search_state; } -RESOURCE TBUF r_qtn_servtab_search_org { buf = qtn_servtab_search_org; } -RESOURCE TBUF r_qtn_servtab_search_orgunit { buf = qtn_servtab_search_orgunit; } -RESOURCE TBUF r_qtn_servtab_search_email { buf = qtn_servtab_search_email; } -RESOURCE TBUF r_qtn_servtab_search_birthday { buf = qtn_servtab_search_birthday; } -RESOURCE TBUF r_qtn_servtab_search_country { buf = qtn_servtab_search_country; } -RESOURCE TBUF r_qtn_servtab_search_user { buf = qtn_servtab_search_user; } -RESOURCE TBUF r_qtn_servtab_search_middlename { buf = qtn_servtab_search_middlename; } - -RESOURCE TBUF r_qtn_servtab_search_basic { buf = qtn_servtab_search_title; } -RESOURCE TBUF r_qtn_servtab_search_advanced { buf = qtn_servtab_search_adv_title; } - -// status message query -RESOURCE DIALOG r_chatclient_enter_status_message_query - { - flags = EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - control= AVKON_DATA_QUERY - { - layout = EDataLayout; - //label = "--"; - control=EDWIN - { - flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; - maxlength=40; - width=16; - lines=4; - default_case = EAknEditorLowerCase; - }; - }; - } - }; - } - - - -RESOURCE AVKON_LIST_QUERY r_im_status_change_dlg - { - softkeys = R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT; - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtSingleGraphicPopupMenuListBox; - listbox = AVKON_LIST_QUERY_LIST; - heading = qtn_servtab_set_my_status; - }; - } - }; - } - - RESOURCE AVKON_LIST_QUERY r_im_list_select_status_message_dlg - { - items = - { - AVKON_LIST_QUERY_DLG_LINE - { - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtSinglePopupMenuListBox; - listbox = AVKON_LIST_QUERY_LIST - { - - }; - heading = qtn_chat_change_status_message; - }; - } - }; - } - -RESOURCE DIALOG r_im_wait_note_template - { - - flags = EAknWaitNoteFlags; - buttons=R_AVKON_SOFTKEYS_EMPTY; - items= - { - DLG_LINE - { - type = EAknCtNote; - id = ESearchWaitNote; - control= AVKON_NOTE - { - layout = EWaitLayout; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - -RESOURCE DIALOG r_im_wait_note_template_with_cancel - { - flags = EAknWaitNoteFlags; - buttons = R_AVKON_SOFTKEYS_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = ESearchWaitNote; - control = AVKON_NOTE - { - layout = EWaitLayout; - animation = R_QGN_GRAF_WAIT_BAR_ANIM; - }; - } - }; - } - -RESOURCE DIALOG r_im_enter_status_message_query - { - flags = EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - control= AVKON_DATA_QUERY - { - layout = EDataLayout; - //label = "--"; - control=EDWIN - { - flags= EEikEdwinNoHorizScrolling | EEikEdwinResizable; - maxlength=40; - width=16; - lines=4; - default_case = EAknEditorLowerCase; - }; - }; - } - }; - } - -RESOURCE DIALOG r_chat_contact_may_not_receive_message_dialog - { - flags=EGeneralQueryFlags; - buttons=R_AVKON_SOFTKEYS_OK_CANCEL__OK; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - control= AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - }; - } - }; - } - -// query text for reactive authorization request -RESOURCE TBUF r_qtn_servtab_contact_request_conf { buf = qtn_servtab_contact_request_conf; } - -// adding user to contacts -RESOURCE TBUF r_qtn_chat_reactive_add_list { buf = qtn_chat_reactive_add_list; } - -// adding to blocked contacts -RESOURCE TBUF r_qtn_chat_reactive_block { buf = qtn_chat_reactive_block; } - -// user did not allow to show status -RESOURCE TBUF r_qtn_chat_reactive_not_authorized { buf = qtn_chat_reactive_not_authorized; } - -RESOURCE TBUF r_qtn_chat_contact_may_not_receive_message { buf = qtn_chat_contact_may_not_receive_message; } - -// -------------------------------------------------------------------------- -// Selector for VoIP fields -// -------------------------------------------------------------------------- -// -RESOURCE VPBK_FIELD_TYPE_SELECTOR r_phonebook2_voip_selector - { - versitProperties = - { - VBK_FIELD_VERSIT_PROPERTY - { - name = EVPbkVersitNameX; - parameters = - { - EVPbkVersitParamVOIP - }; - extensionName = "X-SIP"; - } - }; - } - -// --------------------------------------------------------------------------- -// r_im_app_interest -// AIW app interest for calling -// --------------------------------------------------------------------------- -// -RESOURCE AIW_INTEREST r_im_app_interest - { - items= - { - // This application is interested in calling from menu. - AIW_CRITERIA_ITEM - { - id = KAiwCmdCall; - serviceCmd = KAiwCmdCall; - serviceClass = KAiwClassMenu; - contentType = "*"; - defaultProvider = 0x101F868E; - maxProviders = 1; - } - }; - } -// --------------------------------------------------------------------------- -// r_aiwselect_interest -// AIW app interest for calling -// --------------------------------------------------------------------------- -// -RESOURCE AIW_INTEREST r_aiwselect_interest - { - items = - { - AIW_CRITERIA_ITEM - { - id = KAiwCmdSelect; - serviceCmd = KAiwCmdSelect; - contentType = EGenericParamContactLinkArrayStr; - // Here is a base class - serviceClass = KAiwClassBase; - } - }; - } - - -// -------------------------------------------------------------------------- -// AIW_INTEREST -// Contact assignment interest. -// -------------------------------------------------------------------------- -// -RESOURCE AIW_INTEREST r_aiwassignment_interest - { - items= - { - AIW_CRITERIA_ITEM - { - id = KAiwCmdAssign; // serviceCmd used here also as ID - serviceCmd = KAiwCmdAssign; - contentType = EGenericParamContactLinkArrayStr; - serviceClass = KAiwClassMenu; - maxProviders = 1; - } - }; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_im_app_toolbar_indi_tb_voip_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbVoip; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_im_app_toolbar_indi_tb_conversation_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbConversation; - } - -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_im_app_toolbar_indi_tb_business_card_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbBusinessCard; - } -RESOURCE AVKON_BUTTON_STATE_EXTENSION r_im_app_toolbar_indi_tb_add_recipient_extension - { - bmbSkinIdMajor= EAknsMajorGeneric; - bmbSkinIdMinor= EAknsMinorGenericQgnIndiTbAddRecipient; - } - -//---------------------------------------------------- -// -// r_im_app_toolbar -// -// -// -//---------------------------------------------------- -// -RESOURCE AVKON_TOOLBAR r_im_app_toolbar - { - flags = KAknToolbarFixed; - items = - { - /* TBAR_CTRL - { - type = EAknCtButton; - id = ECmdToolbarChat; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_im; - bmpfile = RESOURCE_FILES_DIR"\\vimpstui.mif"; - bmpid = EMbmVimpstuiQgn_indi_tb_conversation; - bmpmask = EMbmVimpstuiQgn_indi_tb_conversation_mask; - extension = r_im_app_toolbar_indi_tb_conversation_extension; - } - }; - }; - }, - - TBAR_CTRL - { - type = EAknCtButton; - id = ECmdToolbarNewContact; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_newcontact; - bmpfile = RESOURCE_FILES_DIR"\\vimpstui.mif"; - bmpid = EMbmVimpstuiQgn_indi_tb_add_recipient; - bmpmask = EMbmVimpstuiQgn_indi_tb_add_recipient_mask; - extension = r_im_app_toolbar_indi_tb_add_recipient_extension; - } - }; - }; - }, - TBAR_CTRL - { - type = EAknCtButton; - id = ECmdToolbarDetails; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_details; - bmpfile = RESOURCE_FILES_DIR"\\vimpstui.mif"; - bmpid = EMbmVimpstuiQgn_indi_tb_business_card; - bmpmask = EMbmVimpstuiQgn_indi_tb_business_card_mask; - extension = r_im_app_toolbar_indi_tb_business_card_extension; - } - }; - }; - }*/ - }; - } -//---------------------------------------------------- -// -// r_voip_app_toolbar -// -// -// -//---------------------------------------------------- -// -RESOURCE AVKON_TOOLBAR r_voip_app_toolbar - { - flags = KAknToolbarFixed; - items = - { - /* TBAR_CTRL - { - type = EAknCtButton; - id = ECmdToolbarVoipCall; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_voip; - bmpfile = RESOURCE_FILES_DIR"\\vimpstui.mif"; - bmpid = EMbmVimpstuiQgn_indi_tb_voip; - bmpmask = EMbmVimpstuiQgn_indi_tb_voip_mask; - extension = r_im_app_toolbar_indi_tb_voip_extension; - } - }; - }; - }, //End of ECmdToolbarVoipCall - - TBAR_CTRL - { - type = EAknCtButton; - id = ECmdToolbarNewContact; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_newcontact; - bmpfile = RESOURCE_FILES_DIR"\\vimpstui.mif"; - bmpid = EMbmVimpstuiQgn_indi_tb_add_recipient; - bmpmask = EMbmVimpstuiQgn_indi_tb_add_recipient_mask; - extension = r_im_app_toolbar_indi_tb_add_recipient_extension; - } - }; - }; - }, //end of ECmdToolbarNewContact - - TBAR_CTRL - { - type = EAknCtButton; - id = ECmdToolbarDetails; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_details; - bmpfile = RESOURCE_FILES_DIR"\\vimpstui.mif"; - bmpid = EMbmVimpstuiQgn_indi_tb_business_card; - bmpmask = EMbmVimpstuiQgn_indi_tb_business_card_mask; - extension = r_im_app_toolbar_indi_tb_business_card_extension; - } - }; - }; - } //end of ECmdToolbarDetails*/ - }; - } - -//---------------------------------------------------- -// -// r_im_voip_app_toolbar -// -// -// -//---------------------------------------------------- -// -RESOURCE AVKON_TOOLBAR r_im_voip_app_toolbar - { - flags = KAknToolbarFixed; - items = - { - /* TBAR_CTRL - { - type = EAknCtButton; - id = ECmdToolbarVoipCall; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_voip; - bmpfile = RESOURCE_FILES_DIR"\\vimpstui.mif"; - bmpid = EMbmVimpstuiQgn_indi_tb_voip; - bmpmask = EMbmVimpstuiQgn_indi_tb_voip_mask; - extension = r_im_app_toolbar_indi_tb_voip_extension; - } - }; - }; - }, - TBAR_CTRL - { - type = EAknCtButton; - id = ECmdToolbarChat; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_im; - bmpfile = RESOURCE_FILES_DIR"\\vimpstui.mif"; - bmpid = EMbmVimpstuiQgn_indi_tb_conversation; - bmpmask = EMbmVimpstuiQgn_indi_tb_conversation_mask; - extension = r_im_app_toolbar_indi_tb_conversation_extension; - } - }; - }; - }, - TBAR_CTRL - { - type = EAknCtButton; - id = ECmdToolbarDetails; - control = AVKON_BUTTON - { - flags = KAknButtonSizeFitText; - states = - { - AVKON_BUTTON_STATE - { - helptxt = qtn_servtab_toolbar_details; - bmpfile = RESOURCE_FILES_DIR"\\vimpstui.mif"; - bmpid = EMbmVimpstuiQgn_indi_tb_business_card; - bmpmask = EMbmVimpstuiQgn_indi_tb_business_card_mask; - extension = r_im_app_toolbar_indi_tb_business_card_extension; - } - }; - }; - } */ - }; - } - -//add request. -RESOURCE TBUF r_servtab_friend_request { buf = qtn_servtab_friend_request;} -//confirmation message. -RESOURCE TBUF r_servtab_friend_request_conf { buf = qtn_servtab_contact_request_conf;} - - -// default status text mesassges - -RESOURCE TBUF r_qtn_servtab_default_statustext_online { buf = qtn_servtab_default_statustext_online;} -RESOURCE TBUF r_qtn_servtab_default_statustext_offline { buf = qtn_servtab_default_statustext_offline;} -RESOURCE TBUF r_qtn_servtab_default_statustext_invisible { buf = qtn_servtab_default_statustext_invisible;} -RESOURCE TBUF r_qtn_servtab_default_statustext_dnd { buf = qtn_servtab_default_statustext_dnd;} -RESOURCE TBUF r_qtn_servtab_default_statustext_away { buf = qtn_servtab_default_statustext_away;} -RESOURCE TBUF r_qtn_servtab_default_statustext_blocked { buf = qtn_servtab_default_statustext_blocked;} -RESOURCE TBUF r_qtn_servtab_default_statustext_callforward { buf = qtn_servtab_default_statustext_callforward;} - -//blocking/unblocking failed notes. -RESOURCE TBUF r_qtn_chat_blocking_failed { buf = qtn_chat_blocking_failed;} -RESOURCE TBUF r_qtn_chat_unblocking_failed { buf = qtn_chat_unblocking_failed;} - - -RESOURCE TBUF r_servdetail_statustext_offline { buf = qtn_servdetail_statustext_offline; } -RESOURCE TBUF r_servdetail_statustext_online { buf = qtn_servdetail_statustext_online; } -RESOURCE TBUF r_servdetail_statustext_dnd { buf = qtn_servdetail_statustext_dnd; } -RESOURCE TBUF r_servdetail_statustext_away { buf = qtn_servdetail_statustext_away; } -RESOURCE TBUF r_servdetail_statustext_busy { buf = qtn_servdetail_statustext_busy; } -RESOURCE TBUF r_servdetail_statustext_Onthephone { buf = qtn_servdetail_statustext_onthephone; } -RESOURCE TBUF r_servdetail_statustext_Unknown { buf = qtn_servdetail_statustext_unknown; } -RESOURCE TBUF r_remotepending_statustext { buf = qtn_servtab_invitationsent; } - -RESOURCE TBUF r_servtab_blocklist_bkgd { buf = qtn_servtab_blocklist_bkgd; } - -RESOURCE TBUF r_servtab_blocklist_bkgdto { buf = qtn_servtab_blocklist_bkgdto; } - -//CBA buttions Accept,Decline,Accept. -RESOURCE CBA r_servtab_softkeys_accept_decline__accept - { - flags = 0; - buttons = - { - CBA_BUTTON {id= EAknSoftkeyYes; txt=qtn_servtab_sk_accept;}, // left softkey - CBA_BUTTON {id=EAknSoftkeyNo; txt= qtn_servtab_sk_decline;}, // right - CBA_BUTTON {id=EAknSoftkeyYes; txt=qtn_servtab_sk_accept;} // MSK - }; - } - -RESOURCE CBA r_servtab_softkeys_option_login__exit - { - flags = 0; - buttons = - { - CBA_BUTTON {id= EAknSoftkeyOptions; txt=text_softkey_option;}, // left softkey - CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_exit; }, // right - CBA_BUTTON {id=ECmdLogin; txt= qtn_msk_login;} // MSK - }; - } - -RESOURCE CBA r_servtab_softkeys_option_changeconn__exit - { - flags = 0; - buttons = - { - CBA_BUTTON {id= EAknSoftkeyOptions; txt=text_softkey_option;}, // left softkey - CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_exit; }, // right - CBA_BUTTON {id=ECmdChangeConnectioninWaitingState; txt= qtn_msk_change_conn;} // MSK - }; - } - -RESOURCE CBA r_servtab_softkeys_option_cancel__exit - { - flags = 0; - buttons = - { - CBA_BUTTON {id= EAknSoftkeyOptions; txt=text_softkey_option;}, // left softkey - CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_exit; }, // right - CBA_BUTTON {id=ECmdCancelLogin; txt= text_softkey_cancel;} // MSK - }; - } - -RESOURCE CBA r_servtab_softkeys_option_add_to_contacts__back - { - flags = 0; - buttons = - { - CBA_BUTTON {id= EAknSoftkeyOptions; txt=text_softkey_option;}, // left softkey - CBA_BUTTON {id=EAknSoftkeyBack; txt=text_softkey_back; }, // right - CBA_BUTTON {id=ESearchAddFriends; txt= qtn_msk_add_contacts;} // MSK - }; - } - -RESOURCE CBA r_servtab_softkeys_option_new_search__back - { - flags = 0; - buttons = - { - CBA_BUTTON {id= EAknSoftkeyOptions; txt=text_softkey_option;}, // left softkey - CBA_BUTTON {id=EAknSoftkeyBack; txt=text_softkey_back; }, // right - CBA_BUTTON {id=ESearchNew; txt= qtn_msk_new_search;} // MSK - }; - } -RESOURCE CBA r_servtab_softkeys_option_search_openconv__back - { - flags = 0; - buttons = - { - CBA_BUTTON {id= EAknSoftkeyOptions; txt=text_softkey_option;}, // left softkey - CBA_BUTTON {id=EAknSoftkeyBack; txt=text_softkey_back; }, // right - CBA_BUTTON {id=ESearchOpenConversation; txt= qtn_msk_chat;} // MSK - }; - } - -RESOURCE CBA r_servtab_softkeys_option_openconv__exit - { - flags = 0; - buttons = - { - CBA_BUTTON {id= EAknSoftkeyOptions; txt=text_softkey_option;}, // left softkey - CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_exit; }, // right - CBA_BUTTON {id=ECmdOpenConversation; txt= qtn_msk_chat;} // MSK - }; - } - -RESOURCE CBA r_servtab_softkeys_option_openfrndreq__exit - { - flags = 0; - buttons = - { - CBA_BUTTON {id= EAknSoftkeyOptions; txt=text_softkey_option;}, // left softkey - CBA_BUTTON {id=EAknSoftkeyExit; txt=text_softkey_exit; }, // right - CBA_BUTTON {id=ECmdOpenFriendRequest; txt= text_softkey_open;} // MSK - }; - } -//---------------------------------------------------------- -// -// r_servtab_softkeys_options_details__exit -// -//---------------------------------------------------------- -// -RESOURCE CBA r_servtab_softkeys_options_details__exit - { - flags = 0; - buttons = - { - CBA_BUTTON { id= EAknSoftkeyOptions; txt=text_softkey_option; }, - CBA_BUTTON { id= EAknSoftkeyExit; txt=text_softkey_exit; }, - CBA_BUTTON { id = ECmdContactDetails; txt = text_softkey_open; } - }; - } -//---------------------------------------------------------- -// -// r_servtab_softkeys_options_exit__empty -// -//---------------------------------------------------------- -// - -RESOURCE CBA r_servtab_softkeys_options_exit__empty - { - flags = 0; - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyExit; txt = text_softkey_exit; }, - CBA_BUTTON { id = EAknSoftkeyEmpty; txt = text_softkey_empty; } - }; - } - - //---------------------------------------------------------- -// -// r_servtab_softkeys_options_back__empty -// -//---------------------------------------------------------- -// - -RESOURCE CBA r_servtab_softkeys_options_back__empty - { - flags = 0; - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyBack; txt= text_softkey_back; }, // right - CBA_BUTTON { id = EAknSoftkeyEmpty; txt = text_softkey_empty; } - }; - } - -//---------------------------------------------------------- -// -// r_servtab_softkeys_options_exit__changestatus -// -//---------------------------------------------------------- -// -RESOURCE CBA r_servtab_softkeys_options_exit__changestatus - { - flags = 0; - buttons = - { - CBA_BUTTON { id = EAknSoftkeyOptions; txt = text_softkey_option; }, - CBA_BUTTON { id = EAknSoftkeyExit; txt = text_softkey_exit; }, - CBA_BUTTON { id = ECmdChangeStatus; txt = qtn_msk_change_status; } - }; - } - -//---------------------------------------------------------- -// -// r_servtab_softkeys_options_empty__back -// -//---------------------------------------------------------- -// -RESOURCE CBA r_servtab_softkeys_options_empty__back - { - flags = 0; - buttons = - { - CBA_BUTTON { id = ECmdUnBlock; txt = qtn_servtab_unblock_presence; }, - CBA_BUTTON { id = EAknSoftkeyBack; txt=text_softkey_back; }, // right - CBA_BUTTON { id = ECmdUnBlock; txt = qgn_prop_msk_select; } - }; - } - -//---------------------------------------------------------- -// -// r_servtab_softkeys_empty_empty__back -// -//---------------------------------------------------------- -// -RESOURCE CBA r_servtab_softkeys_empty_empty__back - { - flags = 0; - buttons = - { - CBA_BUTTON { id = EAknSoftkeyEmpty; txt = text_softkey_empty; }, - CBA_BUTTON { id = EAknSoftkeyBack; txt=text_softkey_back; }, // right - CBA_BUTTON { id = EAknSoftkeyEmpty; txt = text_softkey_empty; } - }; - } - -//confirmation querry dialog. -RESOURCE DIALOG r_servtab_generic_accept_decline_confirmation_query - { - flags=EGeneralQueryFlags; - buttons=r_servtab_softkeys_accept_decline__accept; - items= - { - DLG_LINE - { - type=EAknCtQuery; - id=EGeneralQuery; - control= AVKON_CONFIRMATION_QUERY - { - layout = EConfirmationQueryLayout; - }; - } - }; - } -//no profile login dialog RESOURCES \|/ -RESOURCE DIALOG r_login_dialog - { - title = qtn_chat_acc_creation_create_new; - buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - flags = EEikDialogFlagWait; - items = - { - DLG_LINE - { - type = EAknCtMultilineQuery; - id = EMultilineFirstLine; - control = AVKON_DATA_QUERY - { - layout = EMultiDataFirstEdwin; - label = qtn_servtab_add_userid; - control = EDWIN - { - default_case = EAknEditorLowerCase; - allowed_case_modes = EAknEditorAllCaseModes; - flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable; - width = 25; - lines = 1; - maxlength = 100; - }; - }; - }, - DLG_LINE - { - type = EAknCtMultilineQuery; - id = EMultilineSecondLine; - control = AVKON_DATA_QUERY - { - layout = EMultiDataSecondSecEd; - label = qtn_servtab_add_password; - control = SECRETED - { - num_letters = 50; - }; - }; - } - }; - } - -//no profile login dialog RESOURCES /|\ - -#include "vimpsterrornotes.rss" -#include "vimpstuisearchdlg.rss" -#include "vimpstuitoudlg.rss" -#include "vimpstuiurldlg.rss" -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/rss/vimpstuisearchdlg.rss --- a/uiservicetab/vimpstui/rss/vimpstuisearchdlg.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,131 +0,0 @@ -/* -* Copyright (c) 2008 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: search dialog fields resources. -* -*/ - - -// -------------------------------------------------------------------------- -// search dialog menu pane -// -------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_search_editor_menupane - { - items= - { - - }; - } - -// -------------------------------------------------------------------------- -// search dialog menu bar -// -------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_search_editor_menubar - { - titles = - { - MENU_TITLE - { - menu_pane = r_search_editor_menupane; - } - }; - } - - -// -------------------------------------------------------------------------- -// search dialog context menu bar -// -------------------------------------------------------------------------- -// -RESOURCE MENU_BAR r_search_editor_context_menubar - { - titles = - { - MENU_TITLE - { - menu_pane = r_search_editor_context_menupane; - } - }; - } - -// -------------------------------------------------------------------------- -// search dialog context menu pane -// -------------------------------------------------------------------------- -// -RESOURCE MENU_PANE r_search_editor_context_menupane - { - items= - { - - }; - } - -// -------------------------------------------------------------------------- -// Memory entry editor dialog template -// -------------------------------------------------------------------------- -// -RESOURCE DIALOG r_search_entry_dialog - { - title = qtn_servtab_search_title; - flags = EEikDialogFlagNoDrag | EEikDialogFlagNoTitleBar | - EEikDialogFlagFillAppClientRect | EEikDialogFlagCbaButtons | - EEikDialogFlagWait | EEikDialogFlagNotifyEsc|EEikDialogFlagCbaButtons; - buttons = R_AVKON_SOFTKEYS_OK_CANCEL__OK; - form = r_search_entry_form; - } -// -------------------------------------------------------------------------- -// Dynamic form resource -// -------------------------------------------------------------------------- -// -RESOURCE FORM r_search_entry_form - { - flags = EEikFormShowBitmaps | EEikFormUseDoubleSpacedFormat; - } - -//---------------------------------------------------------- -// -// r_search_softkeys_basic_cancel__basic -// -//---------------------------------------------------------- -// -RESOURCE CBA r_search_softkeys_basic_cancel__edit - { - flags = 0; - buttons = - { - CBA_BUTTON { id = EBasicSearch; txt = qtn_servtab_basic_search; }, - CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_cancel; }, - CBA_BUTTON { id = EAknSoftkeyEdit; txt = text_softkey_edit; } - }; - } - -//---------------------------------------------------------- -// -// r_search_softkeys_advanced_cancel__advanced -// -//---------------------------------------------------------- -// -RESOURCE CBA r_search_softkeys_advanced_cancel__edit - { - flags = 0; - buttons = - { - CBA_BUTTON { id = EAdvancedSearch; txt = qtn_servtab_advanced_search; }, - CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_cancel; }, - CBA_BUTTON { id = EAknSoftkeyEdit; txt = text_softkey_edit; } - }; - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/rss/vimpstuitoudlg.rss --- a/uiservicetab/vimpstui/rss/vimpstuitoudlg.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,103 +0,0 @@ -/* -* Copyright (c) 2005 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: vimpstui resource. -* -*/ - - - - -// Terms of Use - - -RESOURCE TBUF r_qtn_servtab_tou_title { buf = qtn_servtab_tou_title; } - - -// --------------------------------------------------------- -// -// r_cnui_terms_of_use_dialog_cba -// -// --------------------------------------------------------- -// -RESOURCE CBA r_cnui_terms_of_use_dialog_cba - { - buttons = - { - CBA_BUTTON { id = EIMPSCommonUITOUContinue; txt = qtn_servtab_sk_accept; }, - CBA_BUTTON { id = EAknSoftkeyCancel; txt = qtn_servtab_sk_decline; }, - CBA_BUTTON { id = EIMPSCommonUITOUContinue; txt = qtn_servtab_sk_accept; } - }; - } -// --------------------------------------------------------- -// -// r_cnui_terms_of_use_dialog_cba -// -// --------------------------------------------------------- -// -RESOURCE CBA r_cnui_terms_of_use_dialog_initial_cba - { - buttons = - { - CBA_BUTTON { id = EAknSoftkeyEmpty; txt = text_softkey_empty; }, - CBA_BUTTON { id = EAknSoftkeyCancel; txt = text_softkey_cancel; }, - CBA_BUTTON { id = EAknSoftkeyEmpty; txt = text_softkey_empty; } - }; - } -// --------------------------------------------------------- -// -// r_cnui_terms_of_use_dialog -// -// --------------------------------------------------------- -// -RESOURCE DIALOG r_cnui_terms_of_use_dialog - { - flags=EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect | - EEikDialogFlagCbaButtons | EEikDialogFlagNotifyEsc | EEikDialogFlagWait; - buttons=r_cnui_terms_of_use_dialog_initial_cba; - title= qtn_chat_tou_title; - items= - { - DLG_LINE - { - type=EEikCtRichTextEditor; - id= ETOURichEditorId; - itemflags = EEikDlgItemCtlMinWidthOrLess; - control= RTXTED - { - //width=200; - //height=200; - //textlimit=200; - flags= KMultiLineExpandingEditorFlags | - EEikEdwinReadOnly | EEikEdwinAvkonDisableCursor | - EEikEdwinNoAutoSelection; - //max_view_height_in_lines=3; - avkon_flags = EAknEditorFlagEnableScrollBars; - }; - } - }; - } - -//---------------------------------------------------- -// -// Terms of Use richtext editor -// -//---------------------------------------------------- -RESOURCE RTXTED r_cnui_terms_of_use_editor - { - flags = EEikEdwinReadOnly | EEikEdwinAvkonDisableCursor; - avkon_flags = EAknEditorFlagDefault; - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/rss/vimpstuiurldlg.rss --- a/uiservicetab/vimpstui/rss/vimpstuiurldlg.rss Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2008 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: url resource. -* -*/ - - - - -// Left softkey for URL registration dialog -RESOURCE TBUF r_qtn_servtab_sk_register { buf = qtn_servtab_sk_register; } - -// Right softkey for URL registration dialog -RESOURCE TBUF r_qtn_servtab_sk_ignnore { buf = qtn_servtab_sk_ignnore; } - -// Note for URL registration dialog -RESOURCE TBUF r_qtn_servtab_note_url { buf = qtn_servtab_note_url; } - -// Title for URL registration dialog -RESOURCE TBUF r_qtn_servtab_title_url { buf = qtn_servtab_title_url; } - -RESOURCE TBUF r_servtab_qtn_ovi_url { buf = qtn_servtab_ovi_url; } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/ccommandinfo.cpp --- a/uiservicetab/vimpstui/src/ccommandinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpstui.dll - * -*/ - -// INCLUDE FILES -#include -#include "ccommandinfo.h" -#include "uiservicetabtracer.h" - - -// CONSTANTS - -// ==================== MEMBER FUNCTIONS ==================== -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::CCommandInfo -// ---------------------------------------------------------------------------- -// -CCommandInfo::CCommandInfo( TInt32 aPluginId ) : iPluginId( aPluginId ) - { - } -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::~CCommandInfo -// ---------------------------------------------------------------------------- -// -CCommandInfo::~CCommandInfo() - { - } -// ---------------------------------------------------------------------------- -// CCommandInfo::NewLC -// ---------------------------------------------------------------------------- -// -CCommandInfo* CCommandInfo::NewLC( TResourceReader& aReader, - TInt32 aPluginId, - TInt& aNewCommandIds ) - { - TRACER_AUTO; - CCommandInfo* self = new (ELeave) CCommandInfo( aPluginId ); - CleanupStack::PushL(self); - self->ConstructL( aReader, aNewCommandIds ); - return self; - } -// ---------------------------------------------------------------------------- -// CCommandInfo::ConstructL -// ---------------------------------------------------------------------------- -// -void CCommandInfo::ConstructL( TResourceReader& aReader, - TInt& aNewCommandIds ) - { - iOldCommandId = aReader.ReadInt32(); - iNewCommandId = aNewCommandIds++; - } -// ---------------------------------------------------------------------------- -// CCommandInfo::Id -// ---------------------------------------------------------------------------- -// -TInt32 CCommandInfo::PliginId() const - { - return iPluginId; - } -// ---------------------------------------------------------------------------- -// CCommandInfo::NewCommandId -// ---------------------------------------------------------------------------- -// -TInt32 CCommandInfo::NewCommandId() const - { - TRACER_AUTO; - return iNewCommandId; - } -// ---------------------------------------------------------------------------- -// CCommandInfo::OldCommandId -// ---------------------------------------------------------------------------- -// -TInt32 CCommandInfo::OldCommandId() const - { - TRACER_AUTO; - return iOldCommandId; - } - - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuiavatarselectionhandler.cpp --- a/uiservicetab/vimpstui/src/cvimpstuiavatarselectionhandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,408 +0,0 @@ -/* -* Copyright (c) 2008 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: avatar selection handler - * -*/ - - - - -// INCLUDE FILES -#include "cvimpstuiavatarselectionhandler.h" -#include "vimpstui.hrh" -#include "vimpstutilsdialog.h" -#include "tvimpstconsts.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // content access -#include "uiservicetabtracer.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CAvatarSelectionHandler::CAvatarSelectionHandler -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CAvatarSelectionHandler::CAvatarSelectionHandler() -: CActive( CActive::EPriorityLow ) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CAvatarSelectionHandler::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CAvatarSelectionHandler::ConstructL() - { - TRACER_AUTO; - User::LeaveIfError(iApaSession.Connect() ); - - // create dochandler - iDocHandler = CDocumentHandler::NewL(); - iDocHandler->SetExitObserver( this); - } - -// ----------------------------------------------------------------------------- -// CAvatarSelectionHandler::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CAvatarSelectionHandler* CAvatarSelectionHandler::NewLC() - - { - TRACER_AUTO; - CAvatarSelectionHandler* self = new( ELeave ) CAvatarSelectionHandler(); - - CleanupStack::PushL(self); - self->ConstructL(); - - return self; - } - -// Destructor -CAvatarSelectionHandler::~CAvatarSelectionHandler() - { - Cancel(); - - delete iDecoder; - iDecoder = NULL; - - delete iDocHandler; - iDocHandler = NULL; - - iApaSession.Close(); - if (iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - delete iMimeType; - } - -//----------------------------------------------------------------------------- -// CAvatarSelectionHandler::RunL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CAvatarSelectionHandler::RunL() - { - if (iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - } - -//----------------------------------------------------------------------------- -// CAvatarSelectionHandler::DoCancel -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CAvatarSelectionHandler::DoCancel() - { - iDecoder->Cancel(); - } - -//----------------------------------------------------------------------------- -// CAvatarSelectionHandler::RunError -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CAvatarSelectionHandler::RunError(TInt aError) - { - if (IsActive() ) - { - iStatus = aError; - Cancel(); - } - - if (aError == KErrNoMemory) - { - CActiveScheduler::Current()->Error(KErrNoMemory); - } - - return KErrNone; - } - -// --------------------------------------------------------- -// CAvatarSelectionHandler::HandleServerAppExit -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CAvatarSelectionHandler::HandleServerAppExit(TInt aReason) - { - TRACER_AUTO; - iServerAppExitReason = aReason; - if (iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - } - -// --------------------------------------------------------- -// CAvatarSelectionHandler::VerifySelectedFilesL -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CAvatarSelectionHandler::VerifySelectedFilesL( const MDesCArray* aSelectedFiles ) - - { - TRACER_AUTO; - if( aSelectedFiles && aSelectedFiles->MdcaCount() ) - { - TPtrC filename( aSelectedFiles->MdcaPoint(0) ); // since muliselection is not allowed - //take the only file in the array - TInt value( KErrNone ); - ContentAccess::CContent* content = ContentAccess::CContent::NewL( filename ); - // check for protetected image - TInt err( content->GetAttribute( ContentAccess::EIsProtected, value ) ); - delete content; - - if( err == KErrNone && value ) // protected - { - // show note - ShowErrorL(EProtected); - } - else // not protected - { - delete iDecoder; // delete decoder if there is any - iDecoder = NULL; - - TInt params(CImageDecoder::EPreferFastDecode); - TRAPD( err, iDecoder = CImageDecoder::FileNewL( - CEikonEnv::Static()->FsSession(),filename, - static_cast(params) )); - if( err == KErrNone ) - { - // file seems ok, try to decode image - CFbsBitmap* bitmap = new (ELeave) CFbsBitmap(); - CleanupStack::PushL( bitmap ); - - TFrameInfo frame = iDecoder->FrameInfo(); - TSize decodeSize( 60,60 ); - - TInt bitmaperr = bitmap->Create( decodeSize, frame.iFrameDisplayMode ); - - if( bitmaperr ) - { // any bit mapp error throw error and return EFalse - CActiveScheduler::Current()->Error( bitmaperr ); - CleanupStack::PopAndDestroy( bitmap ); - return EFalse; - } - // start converting - iDecoder->Convert( &iStatus, *bitmap ); - if( !IsActive() ) - { - SetActive(); - } - - // and wait until it's finished - if( !iWait.IsStarted() ) - { - iWait.Start(); // iWait is not an active object - } - - TInt statuscode = iStatus.Int(); - CleanupStack::PopAndDestroy( bitmap ); - - if( statuscode == KErrCorrupt ) // image corrupted - { - // show note - ShowErrorL( ECorrupted ); - return EFalse; - } - - return ETrue; // selected file is ok ,return ETrue - } - else - { - ShowErrorL( ECorrupted ); - } - - } - - } - return EFalse; // no files or protected file return EFalse - } - -// --------------------------------------------------------- -// CAvatarSelectionHandler::DecodeSize -// (other items were commented in a header). -// --------------------------------------------------------- -// -TSize CAvatarSelectionHandler::DecodeSize(const TSize& aSize) - { - TRACER_AUTO; - // 1:1 is always valid ratio for decode scaling - TInt lastValidRatio( 1); - for (TInt ratio(KDecodeScaleRatioMin); ratio <= KDecodeScaleRatioMax; ratio<<= 1) - { - if (aSize.iWidth % ratio + aSize.iHeight % ratio == 0) - { - // this ratio is valid - lastValidRatio = ratio; - } - } - - // return the size scaled with correct ratio - return TSize(aSize.iWidth / lastValidRatio, aSize.iHeight - / lastValidRatio); - } - -// --------------------------------------------------------- -// CAvatarSelectionHandler::HandleAvatarSelectionL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -HBufC* CAvatarSelectionHandler::HandleAvatarSelectionL(TInt aCommand ) - { - TRACER_AUTO; - HBufC* selectedFile = NULL; - switch (aCommand) - { - case ECmdAvatarGallery: - { - CDesCArray* files = new( ELeave )CDesCArrayFlat(1); - CleanupStack::PushL(files); - CDesCArray* mimeTypes = new ( ELeave ) CDesCArrayFlat(1 ); - CleanupStack::PushL( mimeTypes ); - - mimeTypes->AppendL( KJPegType ); - mimeTypes->AppendL( KGifType ); - mimeTypes->AppendL( KPngType ); - - HBufC* softkey = CCoeEnv::Static()->AllocReadResourceLC( - R_QTN_SERVTAB_GALLERY_LSK_SELECT); - - HBufC* title = CCoeEnv::Static()->AllocReadResourceLC( - R_QTN_SERVTAB_GALLERY_TITLE_AVATAR); - // This is to clear the NaviPane(Pane where Service Tabs are displayed) - // before launching the avatar selection dialogue from photos fetcher. - // since photos fetcher does't take care of clearing the Navi pane. - CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()->StatusPane(); // Get the StatusPane - CAknNavigationControlContainer* naviPane = static_cast(statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - CAknNavigationDecorator* naviDecoration = naviPane->Top(); // Get the current NaviPane - naviPane->PushDefaultL( EFalse ); // Clear the NaviPane - // Launching Avatar Selection - if (MGFetch::RunL( *files, EImageFile, EFalse, *softkey, - *title, mimeTypes , NULL) ) - { - if(VerifySelectedFilesL(files)) - { - selectedFile = (files->MdcaPoint(0)).AllocL(); // alloclate for first filename - StoreMimeTypeL(*selectedFile); // get the mime type and store - } - } - CleanupStack::PopAndDestroy( 4); // title, softkey ,mimeTypes ,files - naviPane->PushL(*naviDecoration); // Restoring the previous Navipane - break; - } - case ECmdAvatarNewPhoto: - { - CDesCArray* fileNames = new( ELeave )CDesCArrayFlat(1); - CleanupStack::PushL(fileNames); - CNewFileServiceClient* newFile = NewFileServiceFactory::NewClientL(); - CleanupStack::PushL(newFile); - - CAiwGenericParamList* params = CAiwGenericParamList::NewLC(); - - - TBool okToSend = EFalse; - TRAPD( err, okToSend = - newFile->NewFileL( *fileNames, params, ENewFileServiceImage, EFalse ) ); - - if (err) - { - // restore state - User::LeaveIfError(err); - } - - if (okToSend) - { - selectedFile = ( fileNames->MdcaPoint(0)).AllocL(); // alloclate for first filename - StoreMimeTypeL(*selectedFile); // get the mime type and store - } - - CleanupStack::PopAndDestroy( 3, fileNames); // params, newFile, fileNames - - break; - } - } - return selectedFile; - } -// --------------------------------------------------------- -// CAvatarSelectionHandler::ShowErrorL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CAvatarSelectionHandler::ShowErrorL(TErrorType aErrorType) - { - TRACER_AUTO; - switch( aErrorType ) - { - case EProtected: - { - HBufC* prompt = StringLoader::LoadLC( R_QTN_SERVTAB_GALLERY_ERROR_DRMFILE ); - VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ; - CleanupStack::PopAndDestroy(prompt); - break; - } - case ECorrupted: - { - HBufC* prompt = StringLoader::LoadLC( R_QTN_SERVTAB_GALLERY_ERROR_BADFILE ); - VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ; - CleanupStack::PopAndDestroy(prompt); - break; - } - } - - } - -// --------------------------------------------------------- -// CAvatarSelectionHandler::MimeTypeL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CAvatarSelectionHandler::StoreMimeTypeL(const TDesC& aFilename) - { - TRACER_AUTO; - TUid dummyUid( KNullUid ); - TDataType dataType; - User::LeaveIfError( iApaSession.AppForDocument( - aFilename, - dummyUid, dataType ) ); - - iMimeType = dataType.Des8().AllocL(); - } - -// --------------------------------------------------------- -// CAvatarSelectionHandler::MimeTypeL -// (other items were commented in a header). -// --------------------------------------------------------- -// -const TDesC8& CAvatarSelectionHandler::MimeTypeL() - { - return *iMimeType; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuiblockview.cpp --- a/uiservicetab/vimpstui/src/cvimpstuiblockview.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for CVIMPSTUiBlockView. - * -*/ - -// INCLUDE FILES - -#include "cvimpstuiblockview.h" -#include "cvimpstuiblockviewcontrol.h" -#include "cvimpstenginepresencesubservice.h" -#include "vimpstutilswaitnote.h" -#include "mvimpstengine.h" -#include "vimpstextentionuiuid.h" -#include "cvimpstuiextensionservice.h" -#include "vimpstui.hrh" -#include "cvimpstuistatuspanehandler.h" -#include "cvimpstcmdhandler.h" -// System includes -#include -// Pbk2 -#include -#include -#include -#include -#include -#include -#include -//resource -#include -#include -#include "uiservicetabtracer.h" - -using namespace Phonebook2; - -// ================= MEMBER FUNCTIONS ======================= - -// -------------------------------------------------------------------------- -// CVIMPSTUiBlockView::CVIMPSTUiBlockView -// -------------------------------------------------------------------------- -// -CVIMPSTUiBlockView::CVIMPSTUiBlockView( - MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aBlockViewId, - CPbk2UIExtensionView& aView, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine , - MVIMPSTCmdHandler& aCommandHandler) : - CxSPBaseView( aMapper, aContactManager, aView ), - iBlockViewId( aBlockViewId ), - iEngine(aEngine), - iExtensionService( aServiceData ), - iCommandHandler( aCommandHandler ) - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiBlockView::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiBlockView::ConstructL() - { - TRACER_AUTO; - ViewBaseConstructL( KIMCONTACTSEXTNIMPLEMENTATIONUID, iBlockViewId ); - - iPresenceSubService = iEngine.GetPreseceSubService(); - if(iPresenceSubService) - { - iBlockedList = iPresenceSubService->GetBlockedList(); - } - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiBlockView::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiBlockView* CVIMPSTUiBlockView::NewL( MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aBlockViewId, - CPbk2UIExtensionView& aView, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine , - MVIMPSTCmdHandler& aCommandHandler) - { - TRACER_AUTO; - CVIMPSTUiBlockView* self = new(ELeave) CVIMPSTUiBlockView( aMapper, - aContactManager, - aBlockViewId, - aView, - aServiceData, - aEngine, - aCommandHandler ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - - - -// --------------------------------------------------------- -// CVIMPSTUiBlockView::~CVIMPSTUiBlockView() -// C++ Destructor -// --------------------------------------------------------- -// -CVIMPSTUiBlockView::~CVIMPSTUiBlockView() - { - delete iNaviDecorator; - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockView::HandleCommandL( TInt aCommand ) -// This class handles all commands from menu -// --------------------------------------------------------- -// -void CVIMPSTUiBlockView::HandleCommandL( TInt aCommand ) - { - TRACER_AUTO; - switch ( aCommand ) - { - //Next two commands have same function - case EAknSoftkeyBack: - { - - // this might get called when the view is not active - // back key pressed, activate tabbed view. - // CPbk2ViewState is not utilized here, but here the - // focused contact info could be delivered to next view, if required later - CPbk2ViewState* state = NULL; - - TInt tabViewId; - TInt err = iMapper.GetNewView( KIMCONTACTSEXTNIMPLEMENTATIONUID, - iExtensionService.TabbedViewId(), - tabViewId ); - User::LeaveIfError( err ); - Pbk2AppUi()->Pbk2ViewExplorer()->ActivatePhonebook2ViewL( - TUid::Uid(tabViewId), - state ); - - break; - } - case ECmdUnBlock: - { - //show wait note - // load, format and show confirmation note - HBufC* unblockContact = iContainer->GetFocusedContactLC(); - if(unblockContact) - { - HBufC* prompt = StringLoader::LoadLC( R_QTN_CHAT_UNBLOCKING, *unblockContact ); - CVIMPSTUtilsWaitNote* note = CVIMPSTUtilsWaitNote::ShowWaitNoteLC( *prompt ); - iCommandHandler.HandleCommandL(ECmdUnBlockContact, this, unblockContact ); - CleanupStack::PopAndDestroy( 3,unblockContact );//note;prompt;unblockContact. - } - break; - } - default: - { - Pbk2AppUi()->HandleCommandL( aCommand ); - break; - } - - } - } - - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::DynInitMenuPaneL() -// Initialises menu pane when needed -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiBlockView::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - TRACER_AUTO; - //using the existing menu resource as it contains unblock item - if( aResourceId == R_EXTENSION_MANAGER_MENU) - { - //add search view menu items - aMenuPane->AddMenuItemsL( R_SERVTAB_TABBED_VIEW_MENU ); - aMenuPane->SetItemDimmed(ECmdOpenConversation, ETrue); - aMenuPane->SetItemDimmed(ECmdContactAddAsFriend,ETrue); - aMenuPane->SetItemDimmed(KAiwCmdCall,ETrue); - aMenuPane->SetItemDimmed(ECmdCloseConversation,ETrue); - aMenuPane->SetItemDimmed(ECmdCreateNewOption,ETrue); - aMenuPane->SetItemDimmed(ECmdContactDetails,ETrue); - aMenuPane->SetItemDimmed(ECmdOpenFriendRequest,ETrue); - aMenuPane->SetItemDimmed(ECmdContactEdit,ETrue); - aMenuPane->SetItemDimmed(ECmdAIWAddToContact,ETrue); - aMenuPane->SetItemDimmed(ECmdAIWLinkToContact,ETrue); - aMenuPane->SetItemDimmed(ECmdBlock,ETrue); - aMenuPane->SetItemDimmed(ECmdContactDelete,ETrue); - aMenuPane->SetItemDimmed(ECmdMyAvatar,ETrue); - aMenuPane->SetItemDimmed(ECmdChangeStatus,ETrue); - if(0==iBlockedList->Count()) - { - aMenuPane->SetItemDimmed(ECmdUnBlock,ETrue); - } - } - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockView::DoActivateViewL() -// Activates view -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiBlockView::DoActivateViewL( const TVwsViewId& aPrevViewId, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/ ) - { - TRACER_AUTO; - HBufC* titleText = StringLoader::LoadLC( R_QTN_SERVTAB_TITLE_BLOCKEDLIST ); - - //to set the icon ( context pane image) as in tabbed view - MPbk2ViewActivationTransaction* viewActivationTransaction = - Pbk2AppUi()->Pbk2ViewExplorer()->HandleViewActivationLC( - iView.Id(), - aPrevViewId, - titleText, - NULL, - EUpdateAll ); - - // Notifies startup monitor of view activation - if( Pbk2AppUi()->Pbk2StartupMonitor() ) - { - Pbk2AppUi()->Pbk2StartupMonitor()-> - NotifyViewActivationL( iView.Id() ); - } - - if (!iContainer) - { - iContainer = CVIMPSTUiBlockViewControl::NewL(*this,iView, iEngine, iBlockedList ); - CCoeEnv::Static()->AppUi()->AddToStackL( iView, iContainer ); - iContainer->SetMopParent( &iView ); - iContainer->SetRect( iView.ClientRect() ); - iContainer->ActivateL(); - iContainer->UpdateCbaL(); - } - - // Commit application-wide state changes - viewActivationTransaction->Commit(); - CleanupStack::PopAndDestroy(); //viewActivationTransaction - CleanupStack::PopAndDestroy( titleText ); - // Change the navigation pane from tabs to text label - UpdateNaviPaneTextL(); - //resetting the blocked list to empty.and show it in blocked view. - iBlockedList->ResetAndDestroy(); - iContainer->UpdateBlockedListL(); - //set the text as updating blocked list while fetching blocked list - iContainer->SetUpdatingTextsToListboxL(); - //fetch the fresh blocked list from server.. - FetchBlockedListFromServerL(); - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockView::DoDeactivate() -// Deactivates the view -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiBlockView::DoDeactivate() - { - if (iContainer) - { - CCoeEnv::Static()->AppUi()->RemoveFromStack(iContainer); - delete iContainer; - iContainer = NULL; - } - } - - -// --------------------------------------------------------- -// CVIMPSTUiBlockView::UpdateNaviPaneTextL() -// --------------------------------------------------------- -// -void CVIMPSTUiBlockView::UpdateNaviPaneTextL( ) - { - TRACER_AUTO; - // Change the navigation pane from tabs to text label - CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CAknNavigationControlContainer* np = - static_cast( - sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - delete iNaviDecorator; - iNaviDecorator = NULL; - //fix for disableing navigation search string text, makeing it null - iNaviDecorator = np->CreateNavigationLabelL( iEngine.ServiceName()); - - np->PushL( *iNaviDecorator ); - sp->DrawNow(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::HandleStatusPaneSizeChange -// -------------------------------------------------------------------------- -// -void CVIMPSTUiBlockView::HandleStatusPaneSizeChange() - { - // Resize the container to fill the client rectangle - if (iContainer) - { - iContainer->SetRect( iView.ClientRect() ); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::FetchBlockedListFromServerL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiBlockView::FetchBlockedListFromServerL() - { - iEngine.RegisterBlockedListObserver(this); - iCommandHandler.HandleCommandL(EFetchBlockedList, this, NULL ); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::HandleBlockedListFetchCompleteL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiBlockView::HandleBlockedListFetchCompleteL() - { - if(iContainer) - { - iContainer->UpdateBlockedListL(); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::CommandFinishedL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiBlockView::CommandFinishedL( const MVIMPSTCmd& /*aCommand */) - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::HandleCommandEventL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiBlockView::HandleCommandEventL( TVIMPSTEnums::TVIMPSTRegistrationState /*aState*/, - TInt /*aServiceError*/) - { - - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuiblockviewcontrol.cpp --- a/uiservicetab/vimpstui/src/cvimpstuiblockviewcontrol.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,441 +0,0 @@ -/* -* Copyright (c) 2008 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 : Implementation for cvimpstuiblockviewcontrol. - * -*/ - -// INCLUDE FILES -#include "cvimpstuiblockviewcontrol.h" -#include "cvimpstuiblockview.h" -#include "vimpstutils.h" -#include "tvimpstconsts.h" -#include "vimpstui.hrh" - -// system include -#include -#include -#include - -#include -#include "uiservicetabtracer.h" - - -// ================= MEMBER FUNCTIONS ======================= - - -// -------------------------------------------------------------------------- -// CVIMPSTUiBlockViewControl::CVIMPSTUiBlockViewControl -// -------------------------------------------------------------------------- -// -CVIMPSTUiBlockViewControl::CVIMPSTUiBlockViewControl( CVIMPSTUiBlockView& aBlockedView,MPbk2KeyEventHandler& aKeyEventHandler, - MVIMPSTEngine& aEngine, - RPointerArray* aBlockedList) - :iBlockedView(aBlockedView), - iKeyEventHandler(aKeyEventHandler), - iEngine( aEngine ), - iBlockedList(aBlockedList) - { - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiBlockViewControl::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiBlockViewControl::ConstructL() - { - TRACER_AUTO; - CreateWindowL(); - iItemArray = new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); - // Create listbox - iListBox = new ( ELeave ) CAknSingleGraphicStyleListBox; - iListBox->ConstructL( this, EAknListBoxSelectionList ); - - iListBox->SetContainerWindowL(*this); - iListBox->CreateScrollBarFrameL(ETrue); - iListBox->ScrollBarFrame()->SetScrollBarVisibilityL - (CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); - - // set marquee on - iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue ); - iListBox->Model()->SetItemTextArray( iItemArray ); - iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); - - iListBox->SetListBoxObserver( this ); - - iCurrentItemIndex = 0; - UpdateBlockedListL(); - ActivateL(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiBlockViewControl::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiBlockViewControl* CVIMPSTUiBlockViewControl::NewL( CVIMPSTUiBlockView& aBlockedView, - MPbk2KeyEventHandler& aKeyEventHandler, - MVIMPSTEngine& aEngine, - RPointerArray* aBlockedList ) - { - CVIMPSTUiBlockViewControl* self = NewLC(aBlockedView,aKeyEventHandler,aEngine, aBlockedList ); - CleanupStack::Pop(self); - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiBlockViewControl::NewLC -// -------------------------------------------------------------------------- -// -CVIMPSTUiBlockViewControl* CVIMPSTUiBlockViewControl::NewLC( CVIMPSTUiBlockView& aBlockedView, - MPbk2KeyEventHandler& aKeyEventHandler, - MVIMPSTEngine& aEngine, - RPointerArray* aBlockedList ) - { - CVIMPSTUiBlockViewControl* self = - new (ELeave) CVIMPSTUiBlockViewControl(aBlockedView,aKeyEventHandler, aEngine, aBlockedList ); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiBlockViewControl::Destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTUiBlockViewControl::~CVIMPSTUiBlockViewControl() - { - - delete iItemArray; - iItemArray = NULL; - delete iListBox; - iListBox = NULL; - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::HandleControlEventL -// --------------------------------------------------------- -// -void CVIMPSTUiBlockViewControl::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/) - { - } - - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::HandleListBoxEventL -// Handles list box events -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiBlockViewControl::HandleListBoxEventL( CEikListBox* /*aListBox*/, - TListBoxEvent aEventType ) - { - iCurrentItemIndex = iListBox->CurrentItemIndex(); - if(aEventType == EEventEnterKeyPressed) - { - iBlockedView.HandleCommandL(ECmdUnBlock); - } - } - - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::SizeChanged() -// Called by framework -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiBlockViewControl::SizeChanged() - { - if ( iListBox ) - { - iListBox->SetRect(Rect()); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::CountComponentControls() -// Returns number of controls -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CVIMPSTUiBlockViewControl::CountComponentControls() const - { - //Only one compound control so returning 1 - return 1; - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::ComponentControl( TInt aIndex ) -// Returns control for given index -// (other items were commented in a header). -// --------------------------------------------------------- -// -CCoeControl* CVIMPSTUiBlockViewControl::ComponentControl( TInt aIndex ) const - { - if( aIndex == 0 ) - { - return iListBox; - } - else - { - return NULL; - } - } - - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::UpdateBlockedListL() -// --------------------------------------------------------- -// -void CVIMPSTUiBlockViewControl::UpdateBlockedListL() - { - TRACER_AUTO; - iItemArray->Reset(); - - TInt granularity( iItemArray->Count() ); - ++granularity; - - CDesCArray* tempArray = new ( ELeave ) CDesCArrayFlat( granularity ); - CleanupStack::PushL( tempArray ); - - iListBox->Model()->SetItemTextArray( tempArray ); - iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); - iListBox->HandleItemAdditionL(); - for ( TInt i =0; i < iBlockedList->Count() ; ++ i) - { - TInt sizeOfItemText; - // Calculating the size of the text that will be entered into listbox. - // 3 * KTab().Length() calculates the length of the tabs that is - // appended to the actual text. - sizeOfItemText = (*iBlockedList)[i]->Length() + 3 * KTab().Length(); - HBufC* itemText = HBufC::NewLC( sizeOfItemText ); // changing stuff.. - TPtr itemTextPtr( itemText->Des() ); - itemTextPtr.Append( KTab ); - itemTextPtr.Append( (*iBlockedList)[i]->Des()); - itemTextPtr.Append( KTab ); - itemTextPtr.Append( KTab ); - - iItemArray->AppendL( itemTextPtr ); - CleanupStack::PopAndDestroy( itemText ); - } - CleanupStack::PopAndDestroy(tempArray ); // tempArray - - iItemArray->Sort(); - iListBox->Model()->SetItemTextArray( iItemArray ); - iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); - - iListBox->HandleItemAdditionL(); - - if(0==iBlockedList->Count()) - { - SetEmptyTextsToListboxL(); - } - - if ( iItemArray->MdcaCount() > 0 ) - { - iListBox->SetCurrentItemIndexAndDraw( 0 ); - } - iListBox->UpdateScrollBarsL(); - SetCurrentIndex(iCurrentItemIndex); - UpdateCbaL(); - } - - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::ListBox() -// (other items were commented in a header). -// --------------------------------------------------------- -// -CEikListBox* CVIMPSTUiBlockViewControl::ListBox() const - { - return iListBox; - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::GetFocusedItemText -// (other items were commented in a header). -// --------------------------------------------------------- -// -HBufC* CVIMPSTUiBlockViewControl::GetFocusedContactLC() const - { - TRACER_AUTO; - HBufC* retText = NULL; - TInt curIndex = iListBox->CurrentItemIndex(); - if(KErrNotFound != curIndex) - { - TPtrC ptr= iItemArray->MdcaPoint(curIndex); - ptr.Set(ptr.Mid(1)); // set pointer from next char :since first char is KTab - TInt pos=ptr.FindC(KTab); - if( pos !=KErrNotFound && (pos != ptr.Length()-1)) - { - ptr.Set(ptr.Mid( 0, pos)); - retText = ptr.AllocLC(); - } - } - return retText; - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::GetCurrentIndex -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CVIMPSTUiBlockViewControl::GetCurrentIndex() const - { - return iCurrentItemIndex ; - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::GetCurrentIndex -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiBlockViewControl::SetCurrentIndex(TInt aIndex) - { - TRACER_AUTO; - if(aIndex>0) - { - TInt blockedCount = iListBox->Model()->NumberOfItems(); - if(blockedCount > 0) - { - TInt itemIndex = aIndex % blockedCount; - iListBox->SetCurrentItemIndex(itemIndex); - } - } - } - - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::UpdateCbaL() -// Updates Softkeys according to current focus. -// --------------------------------------------------------- -// -void CVIMPSTUiBlockViewControl::UpdateCbaL() - { - TRACER_AUTO; - TInt cbaRes = R_SERVTAB_SOFTKEYS_EMPTY_EMPTY__BACK; - if ( !iCba ) - { - iCba = CEikButtonGroupContainer::Current(); - } - - if( iCba ) - { - iCba->SetCommandSetL( cbaRes ); - iCba->DrawNow(); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiBlockViewControl::OfferKeyEventL() -// Handles user key inputs -// (other items were commented in a header). -// --------------------------------------------------------- -// -TKeyResponse CVIMPSTUiBlockViewControl::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - TRACER_AUTO; - if ( !aKeyEvent.iCode ) - { - //The character code generated - //for an EEventKey, or 0 for a down or up event. - //For down or up key return key consumed.. handle only the events - - if((EEventKeyDown == aType) && (EStdKeyDevice3 == aKeyEvent.iScanCode)) - { - //for setting the command to be executed for the "Selection key" - //in case of selection key, container's OfferKeyEventL() is called only for EEventKeyDown and EEventKeyUp - //and not for EEventKey - UpdateCbaL(); - } - return EKeyWasConsumed; - } - TKeyResponse result = EKeyWasNotConsumed; - if (iListBox) - { - iCurrentItemIndex = iListBox->CurrentItemIndex(); - } - // Offer key event first to the key event handler - if ( (&iKeyEventHandler ) && iKeyEventHandler.Pbk2ProcessKeyEventL - ( aKeyEvent, aType ) ) - { - result = EKeyWasConsumed; - } - switch(aKeyEvent.iCode ) - { - /* case EKeyEnter: - { - iBlockedView.HandleCommandL(ECmdUnBlock); - result = EKeyWasConsumed; - break; - } */ - default: - { - break; - } - } - if( result == EKeyWasConsumed ) - { - // user might has choosen back/end key/application key etc - // application might switch to background - // return from here - return result; - } - // Not consumed by the key handler, offer to the control next - if ( result == EKeyWasNotConsumed ) - { - if ( iListBox ) - { - result = iListBox->OfferKeyEventL(aKeyEvent, aType); - } - } - UpdateCbaL(); - return result; - - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiBlockViewControl::SetEmptyTextsToListboxL() -// See header for details. -// --------------------------------------------------------------------------- -// -void CVIMPSTUiBlockViewControl::SetEmptyTextsToListboxL() - { - TRACER_AUTO; - HBufC* emptyFinal = VIMPSTUtils::LoadResourceL(R_SERVTAB_BLOCKLIST_BKGD); - CleanupStack::PushL(emptyFinal); - iListBox->View()->SetListEmptyTextL( *emptyFinal ); - CleanupStack::PopAndDestroy(emptyFinal); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiBlockViewControl::SetUpdatingTextsToListboxL() -// See header for details. -// --------------------------------------------------------------------------- -// -void CVIMPSTUiBlockViewControl::SetUpdatingTextsToListboxL() - { - TRACER_AUTO; - HBufC* updating = VIMPSTUtils::LoadResourceL(R_SERVTAB_BLOCKLIST_BKGDTO); - CleanupStack::PushL(updating); - iListBox->View()->SetListEmptyTextL( *updating ); - CleanupStack::PopAndDestroy(updating); - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuibranddata.cpp --- a/uiservicetab/vimpstui/src/cvimpstuibranddata.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,552 +0,0 @@ -/* -* Copyright (c) 2008 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: Brand handler -* -*/ - - -// INCLUDE FILES -#include "cvimpstuibranddata.h" -#include "conversations.h" -#include -#include -#include -#include -#include -#include "uiservicetabtracer.h" - -#include -#include -#include -#include - -#include -#include - -#include "mvimpstengine.h" -#include "tvimpstconsts.h" -#include -#include -#include -#include - - -//App Id is used by MeCo and ece to access branding icons and this name should be generic to both applications, so it needs to be changed later. -_LIT8(KAppIdForBrand,"xsp"); -_LIT8(KDefaultBrandIdForBrand,"xsp"); -_LIT(KZDrive,"Z:\\resource\\"); -_LIT(KCDrive,"C:\\resource\\"); -_LIT(KTOU,"TOU.r"); -_LIT(KUnderScore,"_"); - -// ================= MEMBER FUNCTIONS ======================= - -// Two-phased constructor. -CVIMPSTUiBrandData* CVIMPSTUiBrandData::NewL(MVIMPSTEngine& aEngine) - { - TRACER_AUTO; - CVIMPSTUiBrandData* self = new (ELeave) CVIMPSTUiBrandData; - CleanupStack::PushL( self ); - self->ConstructL(aEngine); - CleanupStack::Pop( self ); - return self; - } - -// Destructor -CVIMPSTUiBrandData::~CVIMPSTUiBrandData() - { - delete iIconsArray; - if(iBrandingAccess) - { - iBrandingAccess->Close(); - } - - delete iBrandingFactory; - iBrandingFactory = NULL; - - delete iBrandId; - } - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CVIMPSTUiBrandData::CVIMPSTUiBrandData() : -iAppId(KAppIdForBrand) - { - } - -// Symbian OS default constructor can leave. -void CVIMPSTUiBrandData::ConstructL(MVIMPSTEngine& aEngine) - { - TRACER_AUTO; - - iBrandId = HBufC8::NewL( 100 ); - TPtr8 brandIdPtr( iBrandId->Des() ); - - TInt version; - - aEngine.GetBrandInfoL(iLanguageId, version, brandIdPtr); - - iBrandingFactory = CBSFactory::NewL( KDefaultBrandIdForBrand, iAppId ); - - - //Get the default MBM path - Dll::FileName(iDefaultMbmPath); //get the location of the dll - - TDriveName drive( TParsePtrC( iDefaultMbmPath ).Drive( ) ); // solve drive - - // leave to stack, LC method - HBufC* resourceFilePath = HBufC::NewLC( KMaxResourcePathLength ); - TPtr ptr( resourceFilePath->Des() ); - ptr.Append( KDefaultIconFile() ); // without drive - ptr.Insert( 0, drive ); // insert drive - - // NearestLanguageFile takes only TFileName - iDefaultMbmPath.Zero(); - iDefaultMbmPath.Append( *resourceFilePath ); - - CleanupStack::PopAndDestroy(); - - TRACE(" prepare branding access" ); - // Leaves if no brand for service, therefore trap - PrepareBrandingAccess(); - - - LoadIconsL();// load the existing icons - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiBrandData::PrepareBrandingAccess() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUiBrandData::PrepareBrandingAccess() - { - TRACER_AUTO; - TRAPD(err, iBrandingAccess = iBrandingFactory->CreateAccessL( *iBrandId, iLanguageId )); - - return err; - } - - -// --------------------------------------------------------- -// CVIMPSTUiBrandData::LoadIconsLC -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTUiBrandData::LoadIconsLC( ) - { - TRACER_AUTO; - CAknIconArray* copyArray = new( ELeave )CAknIconArray( 4); - CleanupStack::PushL( copyArray ); - - TInt count = iIconsArray->Count(); - CGulIcon* newIcon = NULL; - CGulIcon* icon = NULL; - - for( TInt i=0; iBitmap(),icon->Mask() ); - newIcon->SetBitmapsOwnedExternally( ETrue ); - copyArray->AppendL( newIcon ); // takes the ownership of newIcon - } - - return copyArray; // on cleanup stack - } - -// --------------------------------------------------------- -// CVIMPSTUiBrandData::LoadIconsL -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTUiBrandData::LoadIconsL() - { - TRACER_AUTO; - //brand data is available - TRACE("do load" ); - return LoadBrandIconsL(); - } - -// --------------------------------------------------------- -// CVIMPSTUiBrandData::LoadBrandIconsLC -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTUiBrandData::LoadBrandIconsL( ) - { - TRACER_AUTO; - delete iIconsArray; - iIconsArray = NULL; - - iIconsArray = new( ELeave )CAknIconArray( 4); - // array granularity is 3, because 3 icons are added to array - - TRACE(" KEMbmConversationsQgnpropimfriendoff" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendoff) );//0 - - TRACE("KEMbmConversationsQgnpropimfriendon" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendon) );//1 - - TRACE(" KEMbmConversationsQgnpropimfriendaway" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendaway ) );//2 - - TRACE("KEMbmConversationsQgnpropimfriendbusy" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendbusy ) );//3 - - TRACE(" KEMbmConversationsQgnpropimfriendinvisible" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendinvisible ) );//4 - - TRACE(" KEMbmConversationsQgnpropimimsg" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimimsg ) );//5 - - TRACE(" KEMbmConversationsQgnpropimimsgnew" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimimsgnew ) );//6 - - TRACE(" KEMbmConversationsQgnpropservicedefaultavatar" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropservicedefaultavatar ) );//7 - - TRACE(" KEMbmConversationsQgnpropservicefriendrequestreceived" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropservicefriendrequestreceived ) );//8 - - TRACE(" KEMbmConversationsQgnpropservicefriendrequestsent" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropservicefriendrequestsent ) );//9 - - TRACE(" KEMbmConversationsQgnpropserviceofffriendrequestreceived" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropserviceofffriendrequestreceived ) );//10 - - TRACE(" KEMbmConversationsQgnpropserviceofffriendrequestsent" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropserviceofffriendrequestsent ) );//11 - - TRACE(" KEMbmConversationsQgnpropimfriendonmobile" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendonmobile ) );//12 - - TRACE(" KEMbmConversationsQgnservtabavatarblocked" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimuserblocked ) );//13 - - TRACE(" KEMbmConversationsQgnservtabavatarblocked" ); - iIconsArray->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimusercallforward ) );//14 - - - return iIconsArray; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiBrandData::LoadBrandBitmapL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CGulIcon* CVIMPSTUiBrandData::LoadBrandBitmapL( const TDesC8& aId ) - { - TRACER_AUTO; - - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - //EASY WAY TO DO THINGS.. :) - //Fetching bitmaps from the server. - if(!iBrandingAccess) - { - TRACE("create access" ); - PrepareBrandingAccess(); - } - TRAPD(err_bitmap, iBrandingAccess->GetBitmapL( aId, bitmap, mask )); - if(KErrNone != err_bitmap) - { - TRACE(" err" ); - User::Leave( err_bitmap ); - } - TRACE("create icon" ); - CGulIcon* icon = CGulIcon::NewL(bitmap, mask); - icon->SetBitmapsOwnedExternally( EFalse ); - TRACE(" return icon" ); - return icon; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiBrandData::LoadDefaultBitmapL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CGulIcon* CVIMPSTUiBrandData::LoadDefaultBitmapL( TInt aBitmapId, TInt aMaskId, - const TDesC& aFullPath ) - { - TRACER_AUTO; - - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - AknIconUtils::CreateIconLC( bitmap,mask, aFullPath,aBitmapId,aMaskId ); - CGulIcon* gulIcon = CGulIcon::NewL( bitmap, mask ); - CleanupStack::Pop( 2 ); // bitmap, mask - return gulIcon; - } - -// --------------------------------------------------------- -// CVIMPSTUiBrandData::LoadOwnStatusIconsLC -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTUiBrandData::LoadOwnStatusIconsLC( ) - { - TRACER_AUTO; - //EASY WAY TO DO THINGS.. :) - //Fetching bitmaps from the server. - if(!iBrandingAccess) - { - if (KErrNone != PrepareBrandingAccess()) - //brand was not found so load the default data - { - return LoadDefaultOwnStatusIconsLC(iDefaultMbmPath); - } - } - //brand data is available - return LoadBrandOwnStatusIconsLC(); - } -// --------------------------------------------------------- -// CVIMPSTUiBrandData::LoadBrandOwnStatusIconsLC -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTUiBrandData::LoadBrandOwnStatusIconsLC( ) - { - TRACER_AUTO; - // array granularity is 3, because 3 icons are added to array - CAknIconArray* icons = new( ELeave )CAknIconArray( 5); - CleanupStack::PushL( icons ); - - // online - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendon) );//0 - - //away - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendaway) );//1 - - //busy - icons->AppendL( LoadBrandBitmapL( KEMbmConversationsQgnpropimfriendbusy) );//2 - - //invisible - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendinvisible) );//3 - - //invisible - icons->AppendL( LoadBrandBitmapL(KEMbmConversationsQgnpropimfriendoff) );//4 - - return icons; - } - - // --------------------------------------------------------- -// CVIMPSTUiBrandData::LoadDefaultOwnStatusIconsLC -// Loads necessary icons -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTUiBrandData::LoadDefaultOwnStatusIconsLC( const TDesC& aMbmFile) - { - TRACER_AUTO; - // array granularity is 4, because 4 icons are added to array - CAknIconArray* icons = new( ELeave )CAknIconArray( 5); - CleanupStack::PushL( icons ); - - - icons->AppendL( LoadDefaultBitmapL( // 0 - EMbmVimpstuiQgn_prop_im_friend_on, - EMbmVimpstuiQgn_prop_im_friend_on_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 1 - EMbmVimpstuiQgn_prop_im_friend_away, - EMbmVimpstuiQgn_prop_im_friend_away_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 2 - EMbmVimpstuiQgn_prop_im_friend_busy, - EMbmVimpstuiQgn_prop_im_friend_busy_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 3 - EMbmVimpstuiQgn_prop_im_friend_invisible, - EMbmVimpstuiQgn_prop_im_friend_invisible_mask, - aMbmFile ) ); - icons->AppendL( LoadDefaultBitmapL( // 4 - EMbmVimpstuiQgn_prop_im_friend_off, - EMbmVimpstuiQgn_prop_im_friend_off_mask, - aMbmFile ) ); - return icons; - } -// --------------------------------------------------------- -// CVIMPSTUiBrandData::GetTitlePaneBrandBitmapL -// (other items were commented in a header). -// --------------------------------------------------------- -// - -TInt CVIMPSTUiBrandData::GetBrandBitmapsL( CFbsBitmap **aBitmap, CFbsBitmap **aMask) - { - TRACER_AUTO; - - TInt error =KErrNone; - if ( !iBrandingAccess && KErrNone != PrepareBrandingAccess()) - { - //load default icon - AknIconUtils::CreateIconLC( *aBitmap, *aMask, - iDefaultMbmPath, EMbmVimpstuiQgn_prop_im_friend_off, - EMbmVimpstuiQgn_prop_im_friend_off_mask ); - CleanupStack::Pop(2);//aBitmap,aMask. - } - else - { - TRAP(error, iBrandingAccess->GetBitmapL( KEMbmConversationsQgnpropimfriendon, *aBitmap, *aMask )); - } - TRACE("returns: %d", error ); - return error; - } - -// --------------------------------------------------------- -// --------------------------------------------------------- -// CVIMPSTUiBrandData::GetToUBrandedStringL -// (other items were commented in a header). -// --------------------------------------------------------- -// -HBufC* CVIMPSTUiBrandData::GetToUBrandedStringL() - { - TRACER_AUTO; - HBufC* prompt= NULL; - if(iBrandingAccess || KErrNone == PrepareBrandingAccess()) - { - TRAP_IGNORE(prompt = iBrandingAccess->GetTextL( KToumessage )); - } - return prompt; - } - -// --------------------------------------------------------- -// CVIMPSTUiBrandData::IsBrandingSupported -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CVIMPSTUiBrandData::IsBrandingSupported() - { - TBool ret = EFalse; - if(iBrandingAccess) - { - ret = ETrue; - } - return ret; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiBrandData::GetToUStringL() -// ----------------------------------------------------------------------------- -// -HBufC* CVIMPSTUiBrandData::GetToUStringL() - { - TRACER_AUTO; - HBufC* TouDes = NULL; - const TInt KLangBufLength = 2; - const TInt KLeadingZero = 0; - TBuf langBuf; - - // To get two or more digit language id. - if( iLanguageId < 10 ) - { - langBuf.AppendNum( KLeadingZero ); - } - langBuf.AppendNum( iLanguageId ); - - // Number 2 is used in the below equation because - // it is multiplied with the length of the underscore - // to calculate the over all length of the string. - TInt length = KCDrive().Length() + iAppId.Length() + iBrandId->Length() - + KTOU().Length() + langBuf.Length() + 2 * KUnderScore().Length(); - - HBufC* fileName = HBufC::NewLC( length ); - TPtr brandFileName( fileName->Des() ); - - // Converting the HBufC8 iAppId to HBufC appId - HBufC* appId = HBufC::NewL( iAppId.Length() ); - appId->Des().Copy( iAppId ); - - // Converting the HBufC8 iBrandId to HBufC brandId - HBufC* brandId = HBufC::NewL( iBrandId->Length() ); - brandId->Des().Copy( *iBrandId ); - - //Formation of filename. - brandFileName.Append( *appId ); - brandFileName.Append( KUnderScore ); - brandFileName.Append( *brandId ); - brandFileName.Append( KUnderScore ); - brandFileName.Append( KTOU ); - brandFileName.Append( langBuf ); - - TFileName temp(KCDrive); - - HBufC* targetFile = ConcatLC( temp, brandFileName ); - - // for getting the access to the file. - RFs fsSession; - RFile file; - User::LeaveIfError(fsSession.Connect()); - - TFileName fullPtr( targetFile->Des() ); - BaflUtils::NearestLanguageFile( fsSession, fullPtr ); - TInt err = file.Open(fsSession, fullPtr, EFileRead); - CleanupStack::PopAndDestroy(); // targetFile - - if( KErrNone != err ) - { - temp = KZDrive; - targetFile = ConcatLC( temp, brandFileName ); - //brandFileName = targetFile->Des(); - fullPtr = targetFile->Des(); - BaflUtils::NearestLanguageFile( fsSession, fullPtr ); - err = file.Open(fsSession, fullPtr, EFileRead); - CleanupStack::PopAndDestroy(); // targetFile - } - - // Calculates the size of the file. - if( !err ) - { - err = file.Size( length ); - } - - if( ! err ) - { - HBufC8* readBuf = HBufC8::NewL( length ); - TPtr8 readBufPtr = readBuf->Des(); - file.Read( readBufPtr ); - TouDes = HBufC::NewL( readBuf->Length() ); - TouDes->Des().Copy( *readBuf ); - delete readBuf; - } - file.Close(); - fsSession.Close(); - CleanupStack::PopAndDestroy(); // fileName - delete appId; - delete brandId; - return TouDes; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiBrandData::GetToUStringL() -// ----------------------------------------------------------------------------- -// -HBufC* CVIMPSTUiBrandData::ConcatLC( TDesC& aDesc1, TDesC& aDesc2 ) - { - TRACER_AUTO; - HBufC* resultDesc = HBufC::NewLC( aDesc1.Length() + aDesc2.Length() ); - resultDesc->Des().Append( aDesc1 ); - resultDesc->Des().Append( aDesc2 ); - return resultDesc; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuicontactselection.cpp --- a/uiservicetab/vimpstui/src/cvimpstuicontactselection.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for cvimpstuicontactselection ,a contact selection class from pbk -* -*/ - -// INCLUDE FILES -#include "cvimpstuicontactselection.h" -#include "cvimpstuitabbedview.h" -#include "uiservicetabtracer.h" - -#include - -// ================= MEMBER FUNCTIONS ======================= - -// -------------------------------------------------------------------------- -// CVIMPSTUiContactSelection::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiContactSelection* CVIMPSTUiContactSelection::NewL(CVIMPSTUiTabbedView& iViewObserver ) - { - CVIMPSTUiContactSelection* self = new (ELeave) CVIMPSTUiContactSelection( iViewObserver ); - return self; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiContactSelection::~CVIMPSTUiContactSelection -// -------------------------------------------------------------------------- -// -CVIMPSTUiContactSelection::~CVIMPSTUiContactSelection() - { - Cancel(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiContactSelection::CVIMPSTUiContactSelection -// -------------------------------------------------------------------------- -// -CVIMPSTUiContactSelection::CVIMPSTUiContactSelection(CVIMPSTUiTabbedView& iViewObserver ) -: CActive( CActive::EPriorityStandard ), - iViewObserver( iViewObserver ) - { - CActiveScheduler::Add( this ); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiContactSelection::IssueRequest -// -------------------------------------------------------------------------- -// -void CVIMPSTUiContactSelection::IssueRequest() - { - TRACER_AUTO; - if( IsActive() ) - { - Cancel(); - } - if( !IsActive() ) - { - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone ); - SetActive(); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiContactSelection::RunL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiContactSelection::RunL() - { - if( iStatus.Int() == 0 ) - { - iViewObserver.HandleContactSelectionCompleteL(); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiContactSelection::DoCancel -// -------------------------------------------------------------------------- -// -void CVIMPSTUiContactSelection::DoCancel() - { - if( IsActive() ) - { - Cancel(); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiContactSelection::RunError -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiContactSelection::RunError( TInt aError ) - { - return aError; - } - -//end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuicveventlistener.cpp --- a/uiservicetab/vimpstui/src/cvimpstuicveventlistener.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for RProperty where conversation view event handled. -* -*/ - - -// INCLUDE FILES - -#include "cvimpstuicveventlistener.h" -#include "cvimpstuitabbedview.h" -#include "imcvuiliterals.h" -#include "vimpstui.hrh" -#include "uiservicetabtracer.h" - -//system includes -#include - -// ================= MEMBER FUNCTIONS ======================= - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::CVIMPSTUiSearchView -// -------------------------------------------------------------------------- -// -CVIMPSTUICvEventListener::CVIMPSTUICvEventListener( CVIMPSTUiTabbedView& aTabbedView ) - : CActive( CActive::EPriorityStandard ), - iTabbedView( aTabbedView ) - { - CActiveScheduler::Add( this ); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUICvEventListener::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUICvEventListener::ConstructL() - { - TRACER_AUTO; - RProperty::Define(KIMCVPropertyUid, KIMCVConnectedKey, RProperty::EInt ); - RProperty::Set(KIMCVPropertyUid, KIMCVConnectedKey, EIMCVUiEventNone ); //0 reset property - User::LeaveIfError( iProperty.Attach(KIMCVPropertyUid, KIMCVConnectedKey) ); - iProperty.Subscribe(iStatus); - SetActive(); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUICvEventListener::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUICvEventListener* CVIMPSTUICvEventListener::NewL(CVIMPSTUiTabbedView& aTabbedView ) - { - TRACER_AUTO; - CVIMPSTUICvEventListener* self = new(ELeave) CVIMPSTUICvEventListener( aTabbedView ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } -// --------------------------------------------------------- -// CVIMPSTUICvEventListener::~CVIMPSTUICvEventListener() -// C++ Destructor -// --------------------------------------------------------- -// -CVIMPSTUICvEventListener::~CVIMPSTUICvEventListener() - { - Cancel (); // Cancel any request, if outstanding - iProperty.Close (); // Destroy the property object - } -// --------------------------------------------------------- -// CVIMPSTUICvEventListener::RunL() -// --------------------------------------------------------- -// -void CVIMPSTUICvEventListener::RunL() - { - TRACER_AUTO; - TInt eventValue = KErrNone; - - TInt error = RProperty::Get(KIMCVPropertyUid,KIMCVConnectedKey, eventValue ); - - if( eventValue == static_cast( EIMCVUiEventExitOnly ) ) - { - // do service tab exit and keep connection open - iTabbedView.HandleCommandL( EAknCmdExit ); - } - else if( eventValue == static_cast( EIMCVUiEventLogoutExit ) ) - { - // do logout and exit - iTabbedView.HandleCommandL( EIMCmdLogoutExit ); - } - // reset property to zero - RProperty::Set(KIMCVPropertyUid, KIMCVConnectedKey, EIMCVUiEventNone ); - } -// --------------------------------------------------------- -// CVIMPSTUICvEventListener::RunL() -// --------------------------------------------------------- -// -void CVIMPSTUICvEventListener::DoCancel() - { - iProperty.Cancel(); - } -// --------------------------------------------------------- -// CVIMPSTUICvEventListener::StartListening() -// --------------------------------------------------------- -// -void CVIMPSTUICvEventListener::StartListening() - { - if(!IsActive() ) - { - iProperty.Subscribe(iStatus); - SetActive(); // Tell scheduler a request is active - } - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuidoublelistboxarray.cpp --- a/uiservicetab/vimpstui/src/cvimpstuidoublelistboxarray.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,333 +0,0 @@ -/* -* Copyright (c) 2008 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: CVIMPSTUiDoubleListboxArray-array decorator -* -*/ - - -// INCLUDE FILES -#include "cvimpstuidoublelistboxarray.h" -#include "tvimpstconsts.h" -#include "vimpstutils.h" -#include "mvimpstprocessarray.h" -#include "cvimpstuidoublelistboxtabviewcontrol.h" // tab control -#include -#include "tvimpstenums.h" -#include "uiservicetabtracer.h" -// platform includes - -#include -#include -#include -#include -#include -#include - -#include - -const TInt KAvtarLength = 3; - _LIT( KAvatarString , "%d\t" ); -// ================= MEMBER FUNCTIONS ======================= - -// Two-phased constructor. -CVIMPSTUiDoubleListboxArray* CVIMPSTUiDoubleListboxArray::NewL(MVIMPSTProcessArray& aItemModel, - CFormattedCellListBoxData* aListboxData, - CVIMPSTUiDoubleStyleListBox& aListBox, - CVIMPSTUiDoubleListBoxTabViewControl& aTabbedviewControl - ) - { - TRACER_AUTO; - CVIMPSTUiDoubleListboxArray* self = new (ELeave) CVIMPSTUiDoubleListboxArray( aItemModel, - aListboxData, aListBox,aTabbedviewControl); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// Destructor -CVIMPSTUiDoubleListboxArray::~CVIMPSTUiDoubleListboxArray() - { - delete iData; - } - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CVIMPSTUiDoubleListboxArray::CVIMPSTUiDoubleListboxArray( MVIMPSTProcessArray& aItemModel, - CFormattedCellListBoxData* aListboxData, CVIMPSTUiDoubleStyleListBox& aListBox /*= NULL*/, - CVIMPSTUiDoubleListBoxTabViewControl& aTabbedviewControl) - : - iItemArray(aItemModel), - iListboxData( aListboxData ), - iListBox(aListBox), - iTabbedviewControl(aTabbedviewControl) - { - } - -// Symbian OS default constructor can leave. -void CVIMPSTUiDoubleListboxArray::ConstructL() - { - TRACER_AUTO; - // maximum length of icons appended to identification - // There can be four icons (A+B and two on D-column) - iMaxLengthOfIcons = - KDefaultAvatar().Length()+ // longest A-Column icon - (KTab().Length() * 2)+ // length of tabs between items - KContactOnlineIconA().Length(); // longest D-Column icon - - // Reserve enough memory to handle maximum size item - iData = HBufC::NewL( KFriendsListMaxIdentificationLength + - KStatusMsgMaxLength + - iMaxLengthOfIcons ); - - iPresenceSupported = iItemArray.IsSubServiceSupportedL(TVIMPSTEnums::EPresence); - iIMSupported = iItemArray.IsSubServiceSupportedL(TVIMPSTEnums::EIM ); - } - - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListboxArray::MdcaCount -// Returns the number of descriptor elements in a descriptor array. -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CVIMPSTUiDoubleListboxArray::MdcaCount() const - { - return iItemArray.Count(); - } - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListboxArray::MdcaCount -// Return pointer to descriptor data in given index of an array -// (other items were commented in a header). -// --------------------------------------------------------- -// -TPtrC16 CVIMPSTUiDoubleListboxArray::MdcaPoint( TInt aIndex ) const - { - TRACER_AUTO; - TRACE(" aIndex: %d", aIndex ); - // Although this is a const method, we do change the member data. - // This is done because of performance - // -> no need to create new buffer every time. - TPtr dataPtr( iData->Des() ); - dataPtr.Zero(); - - - // fetch the item and process correct type - TVIMPSTEnums::TItem type = iItemArray.GetType(aIndex); - TRACE(" item type: %d", type ); - - switch( type ) - { - case TVIMPSTEnums::EOwnStatusItem: - { - TRACE(" own data" ); - TRAP_IGNORE( AppendOwnDataL(dataPtr,aIndex ) ); - break; - } - case TVIMPSTEnums::EContactItem: - case TVIMPSTEnums::EUnknonContactItem: - case TVIMPSTEnums::EFriendRequestItem: - { - return iItemArray.GetFormattedString(aIndex); - } - default: - { - // shouldn't be here - TRACE(" -> default" ); - break; - } - } //end outer switch - - - return dataPtr; - } - - - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListboxArray::AppendContact -// Append formatted contact identification to buffer -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListboxArray::AppendOwnDataL( TPtr& aBuffer, - TInt aIndex - ) const - { - TRACER_AUTO; - TVIMPSTEnums::TVIMPSTRegistrationState loginstate = iItemArray.GetLoginState(); - TRACE("login state: %d" , loginstate ); - TInt avtarIndex = iItemArray.OwnAvatarIndexL(); - - if( avtarIndex ) - { - TBuf buf; - buf.Format( KAvatarString, avtarIndex); - aBuffer.Append( buf); - } - else - { - // append default avatar for column A - aBuffer.Append( KDefaultAvatar ); - } - // B-column append dispplay id - - - // append only max length of the user id allowed : extra check - - TPtrC identification(VIMPSTUtils::DisplayId(iItemArray.GetItemUserId(aIndex))); - aBuffer.Append( identification.Left( KFriendsListMaxIdentificationLength ) ); - - - - // append \t before second line text - aBuffer.Append( KTab ); - - // append status text for second line and Icon for column D based on conditions - if ( TVIMPSTEnums::ESVCERegistered == loginstate ) - { - TVIMPSTEnums::TOnlineStatus status = iItemArray.GetOnlineStatusL(aIndex); - TRACE(" status: %d" , status ); - TPtrC statusText = iItemArray.StatusTextL( aIndex ); - if( statusText.Length() > 0) // if status text show it - { - // append only KStatusMsgMaxLenght of status masg - aBuffer.Append( statusText.Left( KStatusMsgMaxLength ) ); - } - else - { // show default if no status text based on status - switch(status) // no need to handle the serviceout case as its not applicable here in case of own data - { - case TVIMPSTEnums::EOnline: - { - HBufC* onlineText = StringLoader::LoadLC( R_QTN_SERVTAB_DEFAULT_STATUSTEXT_ONLINE ); - aBuffer.Append( onlineText->Des()); - CleanupStack::PopAndDestroy(); //onlineText - break; - } - case TVIMPSTEnums::EBusy: - { - HBufC* busyText = StringLoader::LoadLC( R_SERVDETAIL_STATUSTEXT_BUSY ) ; - aBuffer.Append( busyText->Des()); - CleanupStack::PopAndDestroy(); //busyText - break; - } - case TVIMPSTEnums::EAway: - { - HBufC* awayText = StringLoader::LoadLC( R_QTN_SERVTAB_DEFAULT_STATUSTEXT_AWAY ); - aBuffer.Append( awayText->Des()); - CleanupStack::PopAndDestroy(); //awayText - break; - } - case TVIMPSTEnums::EOnPhone: - { - HBufC* onphoneText = StringLoader::LoadLC( R_SERVDETAIL_STATUSTEXT_ONTHEPHONE ); - aBuffer.Append( onphoneText->Des()); - CleanupStack::PopAndDestroy(); //onphone text - break; - } - case TVIMPSTEnums::EDoNotDisturb: - { - HBufC* dndText = StringLoader::LoadLC( R_SERVDETAIL_STATUSTEXT_DND ); - aBuffer.Append( dndText->Des()); - CleanupStack::PopAndDestroy(); //dnd Text - break; - } - case TVIMPSTEnums::EInvisible: - { - HBufC* invisibleText = StringLoader::LoadLC( R_QTN_SERVTAB_DEFAULT_STATUSTEXT_INVISIBLE ); - aBuffer.Append( invisibleText->Des()); - CleanupStack::PopAndDestroy(); //invisible text - break; - } - case TVIMPSTEnums::EOffline: - default: - { - HBufC* offlineText = StringLoader::LoadLC( R_QTN_SERVTAB_DEFAULT_STATUSTEXT_OFFLINE ); - aBuffer.Append( offlineText->Des()); - CleanupStack::PopAndDestroy(); //offlineText - break; - } - }// end case for status text - } - // append tab before appending icon - aBuffer.Append( KTab ); - - TRACE(" handle status enum: %d" , status ); - switch(status) - { - case TVIMPSTEnums::EOnline: - { - aBuffer.Append( KContactOnlineIconA ); - break; - } - case TVIMPSTEnums::EInvisible: - { - aBuffer.Append( KListInvisibleIcon ); - break; - } - case TVIMPSTEnums::EBusy: - case TVIMPSTEnums::EDoNotDisturb: - { - aBuffer.Append( KListBusyIcon ); - break; - } - case TVIMPSTEnums::EAway: - { - aBuffer.Append( KListAwayIcon ); - break; - } - case TVIMPSTEnums::EOnPhone: - { - aBuffer.Append( KFrndOnMobileIcon ); - break; - } - case TVIMPSTEnums::EOffline: //Flowthrough - { - aBuffer.Append( KContactOfflineIconA ); - break; - } - case TVIMPSTEnums::EBlocked: - case TVIMPSTEnums::EPending: - default: - { - aBuffer.Append( KEmptyIconA ); - break; - } - }//end switch - - } - else - { - // except in disconnecting state show username - if(TVIMPSTEnums::ESVCENetworkDisConnecting != loginstate ) - { - TRACE(" offline state" ); - TPtrC userId = iItemArray.LoginUserIdFromStoreL(); - aBuffer.Append( VIMPSTUtils::DisplayId( userId )); - } - aBuffer.Append( KTab ); // append tab - aBuffer.Append( KEmptyIconC ); // no icon - } - -} - - - - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuidoublelistboxtabviewcontrol.cpp --- a/uiservicetab/vimpstui/src/cvimpstuidoublelistboxtabviewcontrol.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1439 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for CVIMPSTUiDoubleListBoxTabViewControl. -* -*/ - -// INCLUDE FILES -#include "cvimpstuidoublelistboxtabviewcontrol.h" - -#include "cvimpstuidoublelistboxarray.h" -#include "tvimpstenums.h" -#include "mvimpstcmdhandler.h" -#include "cvimpstuibranddata.h" -#include "imcvuiliterals.h" -#include "cvimpstuilistboxmodel.h" -#include "vimpstutilsdialog.h" -#include "vimpstui.hrh" -#include "cvimpstuitabbedview.h" -#include "mvimpstengine.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" -#include "cvimpstsettingsstore.h" // settings store in cenrep used for own avatar data -#include "cvimpstengineimagehandler.h" -// system include -#include -#include -#include -#include -#include -#include -#include -#include -// Pbk2 -#include -#include - -#include -#include "uiservicetabtracer.h" -// imlauncher -#include -const TInt KTextLimit( 40 ); // Text-limit for find-field - -const TInt KMinContact(1); // minmimum number of contacts to show findpane - -// ================= MEMBER FUNCTIONS ======================= - -inline CVIMPSTUiDoubleStyleListBox& CVIMPSTUiDoubleListBoxTabViewControl::ListBox() const - { - return(*iListBox); - } -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::CVIMPSTUiDoubleListBoxTabViewControl -// -------------------------------------------------------------------------- -// -CVIMPSTUiDoubleListBoxTabViewControl::CVIMPSTUiDoubleListBoxTabViewControl(CVIMPSTUiTabbedView& aTabbedView, MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, - TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba) - :iTabbedView(aTabbedView), - iKeyEventHandler(aKeyEventHandler), - iCommandHandler(aCommandHandler), - iArrayProcess(iCommandHandler.GetProcessInterface()), - iServiceId(aServiceId), - iBrandHandler(aBrandHandler), - iEngine(aEngine), - iCba(aCba) - { - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::ConstructL() - { - TRACER_AUTO; - CreateWindowL(); - // register to get the call back for any array data change - iArrayProcess.AddObserver(this); - // this to make sure that if user id changed storage should be refresh with new user id - // Initialize the listbox - // Create and construct listbox - iListBox = new ( ELeave ) CVIMPSTUiDoubleStyleListBox; - - iListBox->ConstructL(this , EAknListBoxSelectionList); - - iListBox->SetContactListModelL(iArrayProcess); - - iListBox->SetListBoxObserver( this ); - - iListBox->SetContainerWindowL(*this); - iListBox->CreateScrollBarFrameL(ETrue); - iListBox->ScrollBarFrame()->SetScrollBarVisibilityL - (CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); - // set marquee on - iListBox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue ); - // If engine is uninstalled, do not construct the list view. - // Display empty message - if (iEngine.IsUnInstalled()) - { - SetListEmptyTextL( R_QTN_SERVTAB_SWUPDATE_RESTART ); - return; - } - else - { - // Construction of the listbox view. Engine is not uninstalled. - CVIMPSTUiDoubleListboxArray* friendsArray = - CVIMPSTUiDoubleListboxArray::NewL(iArrayProcess, - iListBox->ItemDrawer()->ColumnData(), *iListBox, - *this); - // now set the array - iListBox->Model()->SetItemTextArray(friendsArray); - - iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray); - // if there is any contact other than owndata , show findpane - if (iListBox->Model()->NumberOfItems() > KMinContact) - { - // Create find-pane - ActivateFindPaneL(); - } - LoadBitmapsL(); - SetCbaLockL(EFalse); - } - - } -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiDoubleListBoxTabViewControl* CVIMPSTUiDoubleListBoxTabViewControl::NewL - (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba) - { - TRACER_AUTO; - CVIMPSTUiDoubleListBoxTabViewControl* self = NewLC(aTabbedView,aKeyEventHandler, - aCommandHandler, aServiceId, aBrandHandler,aEngine,aCba); - CleanupStack::Pop(self); - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::NewLC -// -------------------------------------------------------------------------- -// -CVIMPSTUiDoubleListBoxTabViewControl* CVIMPSTUiDoubleListBoxTabViewControl::NewLC - (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba) - { - TRACER_AUTO; - CVIMPSTUiDoubleListBoxTabViewControl* self = - new (ELeave) CVIMPSTUiDoubleListBoxTabViewControl(aTabbedView,aKeyEventHandler, - aCommandHandler, aServiceId, aBrandHandler,aEngine,aCba); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::~CVIMPSTUiDoubleListBoxTabViewControl -// -------------------------------------------------------------------------- -// -CVIMPSTUiDoubleListBoxTabViewControl::~CVIMPSTUiDoubleListBoxTabViewControl() - { - delete iListBox; - iArrayProcess.RemoveObserver(); - if( iFindbox ) - { - delete iFindbox; - iFindbox = NULL; - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL( const TDesC& aUserId ) - { - TRACER_AUTO; - TRACE( "aUserId = %S ", &aUserId ); - CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData(); - TPtrC loginUserId = iArrayProcess.LoginUserIdFromStoreL(); - TInt Avindex = 0; - CGulIcon* newIcon = NULL; - TRACE( "loginUserId = %S ", &loginUserId ); - if( KErrNone == loginUserId.Compare( aUserId ) ) - { - TRACE( "inside if ownuserid" ); - TPtrC8 avatardata = iArrayProcess.OwnAvatarContentL(); - TRACE( "after iArrayProcess.OwnAvatarContentL()" ); - Avindex = iArrayProcess.OwnAvatarIndexL(); - if( avatardata.Length() ) - { - TRACE( "avatardata.Length()" ); - newIcon = AvatarToIconL( avatardata ); - } - if( newIcon ) // there is a new avatar icon - { - TRACE("newIcon" ); - CArrayPtr* currentIconArray = listBoxData->IconArray(); - if( Avindex ) // if there is old icon already - { - TRACE( "Avindex " ); - // delete the old icon compress the array and insert at the same position - currentIconArray->Delete( Avindex ); - currentIconArray->Compress(); - currentIconArray->InsertL( Avindex , newIcon); - } - else - { - TRACE( "else of Avindex " ); - // if there is no old icon append at the last - currentIconArray->AppendL( newIcon); - // set the index to cenrep - TRACE( " currentIconArray->Count()-1 = %d ",currentIconArray->Count()-1 ); - iArrayProcess.SetOwnAvatarIndexL( currentIconArray->Count()-1 ); - } - } - else - { - TRACE( "else of avatar got cleared." ); - // avatar got cleared just set the icon index to '0' - // icon what was added still remains in the listbox icon array - // dont delete the old icon, because that needs to modify the whole - // indexes of the other contacts. - // "keeping the icon is better than changing all contacts indexes" - // The icons will be deleted by listbox, when list box got destructed. - iArrayProcess.SetOwnAvatarIndexL( KErrNone ); - } - } - else - { - TRACE( " else not own id" ); - TRACE( " else not own id aUserId = %S",&aUserId ); - TInt index = iArrayProcess.GetSelectedItemIndex( aUserId );//Get the index from storage. - - TRACE( " after GetSelectedItemIndex" ); - TPtrC8 avatardata = iArrayProcess.AvatarContent( index ); - TRACE("after iArrayProcess.AvatarContent" ); - Avindex = iArrayProcess.AvatarIndex(index); - TRACE( " after Avindex = %d",Avindex ); - if( avatardata.Length() ) - { - TRACE( "inside if avatardata.Length()" ); - newIcon = AvatarToIconL( avatardata ); - } - if( newIcon ) // there is a new avatar icon - { - TRACE( "inside if newIcon" ); - CArrayPtr* currentIconArray = listBoxData->IconArray(); - if( Avindex ) // if there is old icon already - { - TRACE( " inside Avindex" ); - // delete the old icon compress the array and insert at the same position - currentIconArray->Delete( Avindex ); - currentIconArray->Compress(); - currentIconArray->InsertL( Avindex , newIcon); - } - else - { - TRACE( " inside Avindex else" ); - // if there is no old icon append at the last - currentIconArray->AppendL( newIcon); - // set the index to cenrep - iArrayProcess.SetAvatarIndex(index, currentIconArray->Count()-1 ); - } - } - else - { - TRACE( " avatar got cleared" ); - // avatar got cleared just set the icon index to '0' - // icon what was added still remains in the listbox icon array - // dont delete the old icon, because that needs to modify the whole - // indexes of the other contacts. - // "keeping the icon is better than changing all contacts indexes" - // The icons will be deleted by listbox, when list box got destructed. - iArrayProcess.SetAvatarIndex( index , KErrNone ); - } - } - - iListBox->DrawNow(); - - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::HandleAddition -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::HandleAdditionL(TVIMPSTEnums::TItem aType, TInt aIndex) - { - if(iListBox ) - { - iListBox->HandleItemAdditionL(); - UpdateViewL(aIndex,aType) ; - } - } - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::HandleAddition -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::HandleDeletionL(TVIMPSTEnums::TItem aType , TInt aIndex ) - { - TRACER_AUTO; - if(iListBox) - { - iListBox->HandleItemRemovalL(); - TInt count = iListBox->Model()->NumberOfItems(); - if( count == aIndex ) - { - aIndex = 0; - } - UpdateViewL(aIndex,aType) ; - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::HandleItemAdditionL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::HandleItemAdditionL() - { - TRACER_AUTO; - if(iListBox) - { - iListBox->HandleItemAdditionL(); - TInt index = CurrentItemIndex(); - TVIMPSTEnums::TItem type = iArrayProcess.GetType(index); - UpdateViewL(index,type) ; - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::HandleItemRemovalL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::HandleItemRemovalL() - { - if(iListBox) - { - iListBox->HandleItemRemovalL(); - TInt index = CurrentItemIndex(); - TVIMPSTEnums::TItem type = iArrayProcess.GetType(index); - UpdateViewL(index,type) ; - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SizeChanged -// -------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::SizeChanged() - { - SetLayout(); //layouting controls - if ( iFindbox && iFindPaneIsVisible ) - { - iFindbox->MakeVisible( ETrue ); - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::CountComponentControls -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiDoubleListBoxTabViewControl::CountComponentControls() const - { - // return number of controls inside this container - if( !iFindbox ) - { - // Find-pane does not exist when there is no data in listbox, - // so only one control exists (listbox) - return 1; //Ignore CodeScanner warning - } - else - { - // listbox and findbox exists. that makes it two - return 2; //Ignore CodeScanner warning - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::FocusChanged -// -------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::FocusChanged( TDrawNow aDrawNow ) - { - if ( iFindbox && iFindbox->IsVisible() ) - { - iFindbox->SetFocus( IsFocused(), aDrawNow ); - if ( aDrawNow == EDrawNow && IsFocused() ) - { - iFindbox->DrawDeferred(); - } - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::ComponentControl -// -------------------------------------------------------------------------- -// -CCoeControl* CVIMPSTUiDoubleListBoxTabViewControl::ComponentControl(TInt aIndex) const - { - TRACER_AUTO; - // return iListBox; - switch ( aIndex ) - { - // the caller wants to have the first control - // so it's always listbox - case 0: - { - return iListBox; - } - // the caller wants to have the second control - // so it's always the findbox if it exists - case 1: - { - if( iFindbox ) - { - return iFindbox; - } - return NULL; - } - default: - { - return NULL; - } - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::OfferKeyEventL -// -------------------------------------------------------------------------- -// -TKeyResponse CVIMPSTUiDoubleListBoxTabViewControl::OfferKeyEventL - (const TKeyEvent& aKeyEvent,TEventCode aType) - { - TRACER_AUTO; - if ( !aKeyEvent.iCode ) - { - //The character code generated - //for an EEventKey, or 0 for a down or up event. - //For down or up key return key consumed.. handle only the events - - if((EEventKeyDown == aType) && (EStdKeyDevice3 == aKeyEvent.iScanCode)) - { - //for setting the command to be executed for the "Selection key" - //in case of selection key, container's OfferKeyEventL() is called only for EEventKeyDown and EEventKeyUp - //and not for EEventKey - UpdateCbaL(); - } - return EKeyWasConsumed; - } - UpdateCbaL(); - TKeyResponse ret = EKeyWasNotConsumed; - // Offer key event first to the key event handler - if ( iKeyEventHandler && iKeyEventHandler->Pbk2ProcessKeyEventL - ( aKeyEvent, aType ) ) - { - ret = EKeyWasConsumed; - } - switch ( aKeyEvent.iCode ) - { - case EKeyBackspace: - { - if ( iFindbox ) - { - if( iFindbox->TextLength() == 0 ) - { - TInt index = CurrentItemIndex(); - if( iArrayProcess.IsConversationExist(index) ) - { - iTabbedView.CloseConversationL(); - ret = EKeyWasConsumed; - } - else if(TVIMPSTEnums::EContactItem == iArrayProcess.GetType( index ) ) - { - if( TVIMPSTEnums::ESVCERegistered == iArrayProcess.GetLoginState() ) - { - iTabbedView.DeleteContactL(); - } - ret = EKeyWasConsumed; - } - } - } - break; - } - // Case to handle send key press consumption. - case EKeyYes: - { - TInt index = iListBox->CurrentItemIndex(); - if( TVIMPSTEnums::EOwnStatusItem == iArrayProcess.GetType( index ) ) - { - ret = EKeyWasConsumed; - } - break; - } - default: - break; - } - if( EKeyPhoneSend == aKeyEvent.iCode && ret != EKeyWasConsumed ) - { - if( iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EVoip)) - { - iTabbedView.MakeVoipCallL(); - ret = EKeyWasConsumed; - } - - } - if( ret == EKeyWasConsumed ) - { - // user might has choosen back/end key/application key etc - // application might switch to background - // return from here - return ret; - } - if (iFindPaneIsVisible && iFindbox ) - { - ret = iFindbox->OfferKeyEventL( aKeyEvent, aType ) ; - } - // Not consumed by the key handler and findpane , offer to the control next - if ( ret == EKeyWasNotConsumed ) - { - ret = iListBox->OfferKeyEventL( aKeyEvent, aType ); - } - iTabbedView.UpdateToolbarL(); - return ret; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::CurrentItemIndex -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiDoubleListBoxTabViewControl::CurrentItemIndex() const - { - TRACER_AUTO; - if( !iListBox ) - { - return KErrNotFound; - } - if( !iListBox->View() ) - { - // CurrentItemIndex panics if the listbox has no view - return KErrNotFound; - } - - TInt curIndex( iListBox->CurrentItemIndex() ); - if ( curIndex < 0 ) - { - return KErrNotFound; - } - CVIMPSTUiListBoxModel* model = - static_cast( iListBox->Model() ); - - if( model ) - { - return model->FilteredItemIndex( curIndex ); - } - return KErrNotFound; - } - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SetCurrentItemIndex -// -------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::SetCurrentItemIndex(TInt aIndex) - { - TRACER_AUTO; - if (iListBox->CurrentItemIndex() != aIndex && - aIndex >= 0 && - aIndex < iListBox->Model()->NumberOfItems() ) - { - iListBox->SetCurrentItemIndex(aIndex); - TRAP_IGNORE(UpdateCbaL()); - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SetCurrentItemIndexAndDraw -// -------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::SetCurrentItemIndexAndDraw(TInt aIndex) - { - SetCurrentItemIndex(aIndex); - this->DrawDeferred(); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SetListEmptyTextL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::SetListEmptyTextL(TInt aResourceId) - { - HBufC* msgText; - TRACER_AUTO; - // Get Service Name from Engine , load string from resource and display. - // This text is shown to tell the user to restart phone to get the service again. - TPtrC serviceNamePtr(iEngine.ServiceName()); - msgText = StringLoader::LoadLC(aResourceId, serviceNamePtr, iCoeEnv); - iListBox->View()->SetListEmptyTextL(*msgText); - TRACE("Display Text %S", msgText ); - - CleanupStack::PopAndDestroy(msgText); - } - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::LoadBitmapsL -// Called by framework when the view size is changed -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::LoadBitmapsL() - { - - TRACER_AUTO; - CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData(); - if ( !listBoxData ) - { - //No listbox data - User::Leave( KErrNotFound ); - } - - CAknIconArray* icons = iBrandHandler.LoadIconsLC( ); - - CArrayPtr* oldIconArray = listBoxData->IconArray(); - if( oldIconArray ) - { - oldIconArray->ResetAndDestroy(); - delete oldIconArray; - listBoxData->SetIconArray( NULL ); - } - TPtrC8 avatardata = iArrayProcess.OwnAvatarContentL(); - CGulIcon* newIcon = NULL; - if( avatardata.Length() ) - { - newIcon = AvatarToIconL( avatardata ); - } - if( newIcon ) - { - // if icon creation from avatar is successful then append icon - // set the index - icons->AppendL(newIcon); - iArrayProcess.SetOwnAvatarIndexL( icons->Count()-1 ); - } - else - { // set the index to '0' - // index=0 means default icon - iArrayProcess.SetOwnAvatarIndexL( KErrNone ); - } - - TInt count = iArrayProcess.Count(); - // loop all the items in the array and get the avatar data - for (TInt i=0 ;i< count ;++i) - { - TPtrC8 avatarContent = iArrayProcess.AvatarContent(i); - newIcon = NULL;// make this as NULL since the icon - //ownership will be taken from LIstbox - if( avatarContent.Length()) - { - // if that contact has any avatar data then process and create the icon - newIcon = AvatarToIconL( avatarContent ); - } - if ( newIcon ) - { - // if the icon is created successfully the append to icon array - icons->AppendL(newIcon); - // set the icon index to the storage - iArrayProcess.SetAvatarIndex( i , icons->Count()-1); - } - else - { - //if icon not found. set the default for buddies - iArrayProcess.SetAvatarIndex( i , KErrNone); - } - } - // Set icon-array to listbox's drawer - listBoxData->SetIconArray( icons ); - CleanupStack::Pop( icons ); - } - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::HandleListBoxEventL( -// CEikListBox* /*aListBox*/, TListBoxEvent /*aEventType*/ ) -// From MEikListBoxObserver, Handles event's generated by listbox -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::HandleListBoxEventL( - CEikListBox* /*aListBox*/, TListBoxEvent aEventType ) - { - TRACER_AUTO; - iTabbedView.UpdateToolbarL(); - switch(aEventType) - { - case EEventItemSingleClicked: - - { - TInt index = CurrentItemIndex(); - TVIMPSTEnums::TItem itemType = iArrayProcess.GetType(index); - TBool presenceEnabled = iEngine.IsSubServiceEnabled(TVIMPSTEnums::EPresence); - TBool imEnabled = iEngine.IsSubServiceEnabled(TVIMPSTEnums::EIM); - TBool voipEnabled = iEngine.IsSubServiceEnabled(TVIMPSTEnums::EVoip); - TVIMPSTEnums::TVIMPSTRegistrationState serviceState = iTabbedView.GetServiceState(); - TVIMPSTEnums::TOnlineStatus onlinestatus = iArrayProcess.GetOnlineStatusL(index); - - if(TVIMPSTEnums::EOwnStatusItem == itemType && - TVIMPSTEnums::ESVCENotRegistered == serviceState) - { - iTabbedView.HandleCommandL( ECmdLogin ); - } - else if(TVIMPSTEnums::EOwnStatusItem == itemType && - TVIMPSTEnums::ESVCEWaitingForNetwork == serviceState) - { - iTabbedView.HandleCommandL( ECmdChangeConnectioninWaitingState); - } - else if(TVIMPSTEnums::EOwnStatusItem == itemType - && presenceEnabled && - TVIMPSTEnums::ESVCERegistered == serviceState ) - { - iTabbedView.HandleCommandL( ECmdChangeStatus ); - } - else if( ( TVIMPSTEnums::EContactItem == itemType || - TVIMPSTEnums::EUnknonContactItem == itemType )&& imEnabled && - TVIMPSTEnums::ESVCERegistered == serviceState && - TVIMPSTEnums::EServiceOut != onlinestatus ) - { - iTabbedView.HandleCommandL( ECmdOpenConversation ); - } - else if ( itemType == TVIMPSTEnums::EFriendRequestItem - && TVIMPSTEnums::ESVCERegistered == serviceState) - { - iTabbedView.HandleCommandL( ECmdOpenFriendRequest ); - } - else if( TVIMPSTEnums::EContactItem == itemType ) - { - if((TVIMPSTEnums::EPending != onlinestatus) && - !(TVIMPSTEnums::ESVCEUpdatingContacts == serviceState || - TVIMPSTEnums::ESVCENetworkConnecting == serviceState || - TVIMPSTEnums::ESVCENetworkDisConnecting == serviceState)) - { - iTabbedView.HandleCommandL( ECmdContactDetails ); - } - } - break; - - } - // Add enter key handling - case EEventEnterKeyPressed: - { - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - TInt commandId( iCba->ButtonGroup()->CommandId( CEikButtonGroupContainer::EMiddleSoftkeyPosition)); - - iTabbedView.HandleCommandL(commandId); - break; - } - default: - { - break; - } - } - - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SendMessageL( -// CEikListBox* /*aListBox*/, TListBoxEvent /*aEventType*/ ) -// From MEikListBoxObserver, Handles event's generated by listbox -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::SendMessageL() - { - TRACER_AUTO; -// TInt index = iListBox->CurrentItemIndex(); - TInt index = CurrentItemIndex(); - if( index< 0 ) - { - // return if item not found - return; - } - TPtrC seletctedItem = iArrayProcess.GetItemUserId(index) ; - if(seletctedItem.Length()) - { - TInt result = EAknSoftkeyOk; - //get the status from engine. - TVIMPSTEnums::TOnlineStatus status = iArrayProcess.GetOnlineStatusL(index); - - if( status == TVIMPSTEnums::EOffline ) - { - TBool isConvExist = iArrayProcess.IsConversationExist(index); - if( !isConvExist) - { - // TODO : need to show only once if conversation not exist - // handling of error message need to be done in cv also ,waiting for ximp changes - // Show note about offline contact - HBufC* msg = StringLoader::LoadLC( - R_QTN_CHAT_CONTACT_MAY_NOT_RECEIVE_MESSAGE, - seletctedItem ); - - result = VIMPSTUtilsDialog::DisplayQueryDialogL( - R_CHAT_CONTACT_MAY_NOT_RECEIVE_MESSAGE_DIALOG, - msg->Des() ); - CleanupStack::PopAndDestroy( msg ); - } - } - - if( ( result == EAknSoftkeyOk ) || ( result == EAknSoftkeyYes ) ) - { - TPtrC itemName = iArrayProcess.GetItemNameText(index) ; - // not own this p - MVPbkContactLink* contactLink = iArrayProcess.ContactLink( index ); - - TVwsViewId activeViewId; - CCoeEnv::Static()->AppUi()->GetActiveViewId( activeViewId ); - UpdateCbaL(); - // imlauncher call for luanching the conversationview with seletced user id - IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, seletctedItem, itemName, contactLink); - } - } - else - { - //When there is no XSP Id present it comes to here - //Displaying a note that there is no XSP ID - HBufC* note = NULL; - note = StringLoader::LoadLC( R_QTN_SERVTAB_NOXSP_ERROR ); - VIMPSTUtilsDialog::DisplayNoteDialogL( *note ); - CleanupStack::PopAndDestroy( note ); - } - - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::UpdateViewL( - TInt aIndex, TVIMPSTEnums::TItem aType) - { - TRACER_AUTO; - TInt index = KErrNotFound; - if( aIndex < 0 ) - { - aIndex = CurrentItemIndex()<0?0:CurrentItemIndex(); - } - switch(aType) - { - case TVIMPSTEnums::EContactItem: - case TVIMPSTEnums::EOwnStatusItem: - { - /*Not attempting to get the index of contact because aIndex is the - same as this index and we pass it on to the contactlistboxmodel's - visibleitem method*/ - CVIMPSTUiListBoxModel* list = - static_cast( iListBox->Model() ); - index = list->VisibleItemIndex(aIndex); - if( index != KErrNotFound && iFindbox ) - { - if(iClrFindPaneFlag) - { - iFindbox->SetSearchTextL( KNullDesC ); - iFindbox->DrawNow(); - iClrFindPaneFlag = EFalse; - } - else - { - TBuf temp; - iFindbox->GetSearchText(temp); - if(0 != temp.Compare(KNullDesC)) - { - ((CAknFilteredTextListBoxModel*) iListBox->Model() ) - ->Filter()->HandleOfferkeyEventL(); - } - } - } - break; - } - default: - { - //nothing to do - break; - } - } - iListBox->DrawNow(); - SetCurrentItemIndex(aIndex); - SetFocusAndMakeItemVisible(); - TInt count = iArrayProcess.Count(); - if(count > KMinContact && ! iFindPaneIsVisible) - { - ActivateFindPaneL(); - } - else if(count <= KMinContact && iFindPaneIsVisible) // extra check needed here to improve performance - { - DeactivateFindPaneL(); - } - - //Update the Toolbar after moving the focus to the current item. - iTabbedView.UpdateToolbarL(); - UpdateCbaL(); - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::ActivateFindPaneL() -// Activates find-pane -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::ActivateFindPaneL() - { - TRACER_AUTO; - if( !iFindbox ) - { - // Use EAdaptiveSearch so that we can search according to columns. - iFindbox = CAknSearchField::NewL( *this, - CAknSearchField::EAdaptiveSearch, - NULL, KTextLimit ); - - // This is to filter the presence status from the search - // username(0)/presencestatus(1) - 1 is to filter the presence status - // column out of the search. In this case there are only two columns. - TBitFlags32 columnFilterFlag; - columnFilterFlag.Set(1); - iFindbox->SetListColumnFilterFlags(columnFilterFlag); - static_cast( iListBox->Model() ) - ->CreateFilterL( iListBox, iFindbox ); - } - iFindbox->SetObserver( this ); - iFindbox->ActivateL(); - iFindbox->ResetL(); - iFindbox->SetSearchTextL( KNullDesC ); - - iFindPaneIsVisible = ETrue; - SetLayout(); - - if( IsActivated() ) - { - iFindbox->MakeVisible( ETrue ); - iFindbox->SetFocus( ETrue ); - iListBox->SizeChanged(); - DrawNow(); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::DeactivateFindPaneL() -// De-activates find-pane -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::DeactivateFindPaneL() - { - TRACER_AUTO; - if( !iFindbox ) - { - return; - } - static_cast( iListBox->Model() ) - ->Filter()->ResetFilteringL(); - - - iFindbox->MakeVisible( EFalse ); - iFindbox->SetFocus( EFalse ); - - iFindPaneIsVisible = EFalse; - SetLayout(); - - if( IsActivated() ) - { - DrawNow(); - } - } - - // --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::GetFocussedId() -// To get the pointer to the iFocussedID -// --------------------------------------------------------- -TPtrC CVIMPSTUiDoubleListBoxTabViewControl::GetFocussedId() - { - TInt index = CurrentItemIndex(); - if( index < 0 ) - { - index = 0; - } - return iCommandHandler.GetProcessInterface().GetItemUserId( index ); - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SetFocussedId() -// Saves the Contact ID in iFocussedID -// --------------------------------------------------------- -void CVIMPSTUiDoubleListBoxTabViewControl::SetFocussedId(const TDesC& aContact) - { - TInt index = iCommandHandler.GetProcessInterface().GetSelectedItemIndex( aContact ); - if( index < 0 ) - { - index = 0; - } - SetCurrentItemIndex( index ); - SetFocusAndMakeItemVisible(); - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SetLayout() -// Layouts current components according to AVKON LAF -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::SetLayout() - { - TRACER_AUTO; - const TRect rect( Rect() ); - if( iListBox && iFindPaneIsVisible ) - { - - TAknWindowLineLayout empty; - empty.iC = 0; - empty.il = 0; - empty.it = 0; - empty.ir = 0; - empty.ib = 0; - empty.iW = ELayoutEmpty; - empty.iH = ELayoutEmpty; - - TAknWindowLineLayout findPane = AknLayoutScalable_Avkon::find_pane().LayoutLine(); - TAknWindowLineLayout listPane; - - // listPane should equal to parent's rect - listPane.il = Rect().iTl.iX; - listPane.ir = ELayoutEmpty; - listPane.it = Rect().iTl.iY; - listPane.ib = ELayoutEmpty; - // this check is required since it's not guaranteed that listbox's SetRect - // has been called when this code is executed - if ( Size().iWidth > 0 ) - { - listPane.iW = Size().iWidth; - listPane.ir = ELayoutEmpty; - } - else - { - listPane.iW = ELayoutEmpty; - listPane.ir = 0; - } - // but findpane's height should be subtracted - listPane.iH = Size().iHeight - findPane.iH; - - // findPane's width should equal to listPane's width - findPane.iW = listPane.iW; - CAknFilteredTextListBoxModel* m = static_cast ( iListBox->Model() ); - if ( m->Filter() ) - { - m->Filter()->SetParentControl( this ); - } - TAknLayoutRect lrect; - lrect.LayoutRect( Rect(), empty ); - AknLayoutUtils::LayoutControl( iFindbox, lrect.Rect(), findPane ); - AknLayoutUtils::LayoutControl( iListBox, Rect(), listPane ); - - } - else if( iListBox ) - { - AknLayoutUtils::LayoutControl( iListBox, - rect, - AKN_LAYOUT_WINDOW_list_gen_pane( 0 ) ); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::HandleControlEventL -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent aEventType) - { - // We only observe iFindbox - if( EEventStateChanged == aEventType ) - { - - ((CAknFilteredTextListBoxModel*) iListBox->Model() ) - ->Filter()->HandleOfferkeyEventL(); - - } - iListBox->DrawNow(); - iTabbedView.UpdateToolbarL(); - } - -// --------------------------------------------------------- - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::CheckAndSetLastItemFlag() -// Checks if the last contact is focused and Sets the iLastItemFlag -// --------------------------------------------------------- -void CVIMPSTUiDoubleListBoxTabViewControl::CheckAndSetLastItemFlag() - { - if(iListBox->CurrentItemIndex() == (iArrayProcess.Count() - 1)) - { - iLastItemFlag = ETrue; - } - else - { - iLastItemFlag = EFalse; - } - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible() -// Compares the Saved Contact in iFocussedID with the contacts in the List and focuses if it is found -// --------------------------------------------------------- -void CVIMPSTUiDoubleListBoxTabViewControl::SetFocusAndMakeItemVisible() - { - TRACER_AUTO; - TInt count = iArrayProcess.Count(); - TInt index = CurrentItemIndex(); - if( index == count ) - { - if( iLastItemFlag ) - { - index = count - 1; - iLastItemFlag = EFalse; - } - } - CVIMPSTUiListBoxModel* model = - static_cast( iListBox->Model() ); - - if( model ) - { - index = model->VisibleItemIndex( index ); - } - iListBox->ScrollToMakeItemVisible(index ); - SetCurrentItemIndex(index); - iListBox->DrawDeferred(); - } - -// --------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SetClrFindPaneFlag(TBool aFlag) -// --------------------------------------------------------------------- - -void CVIMPSTUiDoubleListBoxTabViewControl::SetClrFindPaneFlag(TBool aFlag) - { - iClrFindPaneFlag = aFlag; - } - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::CoeControl() -// --------------------------------------------------------- - -CCoeControl* CVIMPSTUiDoubleListBoxTabViewControl::CoeControl() - { - return this; // return this pointer since its a parent class pointer of CCoeControl - } -// ------------------------------------------------------------------------ -// CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL -// -// ------------------------------------------------------------------------ -CGulIcon* CVIMPSTUiDoubleListBoxTabViewControl::AvatarToIconL( const TDesC8& aAvatarContent ) - { - TRACER_AUTO; - CGulIcon* newIcon = NULL; - CVIMPSTEngineImageHandler* imageHandler = CVIMPSTEngineImageHandler::NewL(); - CleanupStack::PushL( imageHandler ); - // pass the avatar content and mimetype as NULL - // mimetype will be recognised by the UTILS class - HBufC8* content = imageHandler->ProcessImageFromDataL( aAvatarContent , KNullDesC8); - if ( iAvatarError == KErrNone) - { - newIcon = CGulIcon ::NewL( &(imageHandler->Bitmap()) ); - newIcon->SetBitmapsOwnedExternally( EFalse ); - } - CleanupStack::PopAndDestroy(); // imageHandler - if(content) - { - delete content; - content = NULL; - } - return newIcon; - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::SetCbaLockL() -// Sets the lock status of cba keys. -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::SetCbaLockL( TBool aLock ) - { - iCbaLock = aLock; - if( !aLock ) - { - UpdateCbaL(); - } - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::UpdateCbaL() -// Updates Softkeys according to current focus. -// --------------------------------------------------------- -// -void CVIMPSTUiDoubleListBoxTabViewControl::UpdateCbaL( TBool aUseDefaultCba /*= EFalse*/ ) - { - TRACER_AUTO; - TInt cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY; - iCurrentCmdToExe = -1; - if( !iCbaLock ) - { - TInt index = CurrentItemIndex(); - //if invalid index then dont set any command - if(KErrNotFound == index) - { - if ( iCba ) - { - iCba->SetCommandSetL( cbaRes ); - iCba->DrawNow(); - } - return; - } - - TVIMPSTEnums::TItem itemtype = iArrayProcess.GetType(index); - TVIMPSTEnums::TOnlineStatus onlinestatus = iCommandHandler.GetProcessInterface().GetOnlineStatusL(index); - TVIMPSTEnums::TVIMPSTRegistrationState servicestate = iEngine.ServiceState(); - TBool updateinvalid( iLastFocusedItemType == TVIMPSTEnums::EInvalid ); -// if ( !iCba ) -// { -// iCba = CEikButtonGroupContainer::Current(); -// } - - // default softkeys - if(iCba) - { - if( aUseDefaultCba || updateinvalid ) - { - if( aUseDefaultCba ) - { - iLastFocusedItemType = TVIMPSTEnums::EOwnStatusItem; - } - else - { - iLastFocusedItemType = itemtype; - } - - if ( itemtype == TVIMPSTEnums::EOwnStatusItem ) - { - // Own status - if(TVIMPSTEnums::ESVCERegistered == servicestate) - { - // Options/Back/Change status - cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__CHANGESTATUS; - iCurrentCmdToExe = ECmdChangeStatus; - } - else if(TVIMPSTEnums::ESVCENetworkConnecting == servicestate) - { - if(iTabbedView.CancelLoginSupportedL()) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_CANCEL__EXIT; - iCurrentCmdToExe = ECmdCancelLogin; - } - else - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY; - iCurrentCmdToExe = -1; - } - } - else if(TVIMPSTEnums::ESVCEWaitingForNetwork == servicestate) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_CHANGECONN__EXIT; - iCurrentCmdToExe = ECmdChangeConnectioninWaitingState; - } - else if(TVIMPSTEnums::ESVCEUpdatingContacts != servicestate) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_LOGIN__EXIT; - iCurrentCmdToExe = ECmdLogin; - } - } - - iCba->SetCommandSetL( cbaRes ); - iCba->DrawNow(); - } - - // collapse softkey ( when focus is on contact ) - else if( itemtype == TVIMPSTEnums::EContactItem ) - { - iLastFocusedItemType = itemtype; - if(TVIMPSTEnums::ESVCERegistered == servicestate) - { - // im is supported - if(iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM)) - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTION_OPENCONV__EXIT ); - iCurrentCmdToExe = ECmdOpenConversation; - } - else //im is not supporteed - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTIONS_DETAILS__EXIT ); - iCurrentCmdToExe = ECmdContactDetails; - } - } - else if(TVIMPSTEnums::ESVCENotRegistered == servicestate) - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTIONS_DETAILS__EXIT ); - iCurrentCmdToExe = ECmdContactDetails; - } - iCba->DrawNow(); - } - else if( itemtype == TVIMPSTEnums::EUnknonContactItem ) - { - iLastFocusedItemType = itemtype; - if(TVIMPSTEnums::ESVCERegistered == servicestate && - iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM)) - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTION_OPENCONV__EXIT ); - iCurrentCmdToExe = ECmdOpenConversation; - } - else //im is not supporteed - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY ); - iCurrentCmdToExe = -1; - } - iCba->DrawNow(); - } - // Focus on own contact item - else if( itemtype == TVIMPSTEnums::EOwnStatusItem ) - { - iLastFocusedItemType = itemtype; - if ( itemtype == TVIMPSTEnums::EOwnStatusItem ) - { - // Own status - if(TVIMPSTEnums::ESVCERegistered == servicestate) - { - // Options/Back/Change status - cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__CHANGESTATUS; - iCurrentCmdToExe = ECmdChangeStatus; - } - else if(TVIMPSTEnums::ESVCENetworkConnecting == servicestate) - { - if(iTabbedView.CancelLoginSupportedL()) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_CANCEL__EXIT; - iCurrentCmdToExe = ECmdCancelLogin; - } - else - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY; - iCurrentCmdToExe = -1; - } - } - else if(TVIMPSTEnums::ESVCEWaitingForNetwork == servicestate) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_CHANGECONN__EXIT; - iCurrentCmdToExe = ECmdChangeConnectioninWaitingState; - } - else if(TVIMPSTEnums::ESVCEUpdatingContacts != servicestate) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_LOGIN__EXIT; - iCurrentCmdToExe = ECmdLogin; - } - } - //add for connecting state and waiting for connection state. - iCba->SetCommandSetL( cbaRes ); - iCba->DrawNow(); - } - // Focus on invitation item - else if( itemtype == TVIMPSTEnums::EFriendRequestItem ) - { - iLastFocusedItemType = itemtype; - if(TVIMPSTEnums::ESVCERegistered == servicestate) - { - iCurrentCmdToExe = ECmdOpenFriendRequest; - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTION_OPENFRNDREQ__EXIT ); - iCba->DrawNow(); - } - - } - } - - } - } - -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarRefreshL() -// Saves the Contact ID in iFocussedID -// --------------------------------------------------------- -void CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarRefreshL( const TDesC& aUserId,TBool aBlock ) - { - TRACER_AUTO; - if(aBlock) - { - TRACE("inside blocking"); - TInt index = iArrayProcess.GetSelectedItemIndex(aUserId );//Get the index from storage. - if(index >= 0) - { - CFormattedCellListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData(); - CArrayPtr* currentIconArray = listBoxData->IconArray(); - TInt avIndex = iArrayProcess.AvatarIndex(index); - - if( avIndex ) // if there is old icon already - { - // delete the old icon compress the array and insert at the same position - currentIconArray->Delete( avIndex ); - currentIconArray->Compress(); - } - - // avatar got cleared just set the icon index to '0' - // icon what was added still remains in the listbox icon array - // dont delete the old icon, because that needs to modify the whole - // indexes of the other contacts. - // "keeping the icon is better than changing all contacts indexes" - // The icons will be deleted by listbox, when list box got destructed. - iArrayProcess.SetAvatarIndex( index , KErrNone ); - - } - } - - else - { - TRACE("inside unblocking calling handleavatarchangel"); - HandleAvatarChangeL(aUserId); - } - - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuidoublestylelistbox.cpp --- a/uiservicetab/vimpstui/src/cvimpstuidoublestylelistbox.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -/* -* Copyright (c) 2008 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: Custom listbox component for the contact list -* -*/ - - -#include "cvimpstuidoublestylelistbox.h" -#include "cvimpstuilistboxmodel.h" -#include - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBox::CreateModelL -// Here we change the listbox model -// --------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleStyleListBox::CreateModelL() - { - // we have to make sure that the model is ours, - // so we can leave if the model creation fails. - // (just make sure that the pointer is NULL) - //delete iModel; - //iModel = NULL; - iListBoxModel = new ( ELeave ) CVIMPSTUiListBoxModel; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBox::SetContactListModel -// ConstructL has to be called before calling this -// --------------------------------------------------------------------------- -// -void CVIMPSTUiDoubleStyleListBox::SetContactListModelL(MVIMPSTProcessArray& aContactListModel ) - { - CreateModelL(); - if ( iListBoxModel ) - { - static_cast(iListBoxModel)->SetContactListModel( aContactListModel ); - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBox::~CVIMPSTUiListBox() -// ConstructL has to be called before calling this -// --------------------------------------------------------------------------- -// -CVIMPSTUiDoubleStyleListBox::~CVIMPSTUiDoubleStyleListBox() - { - delete iListBoxModel; - } diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuiextensionfactory.cpp --- a/uiservicetab/vimpstui/src/cvimpstuiextensionfactory.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ -/* -* Copyright (c) 2008 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: Extension factory for VIMPSTUi -* -*/ - - -// INCLUDE FILES -#include "cvimpstuiextensionfactory.h" - -// System includes -#include -#include -#include -#include -#include - -// Pbk2 -#include -#include - - -// xSP extension manager -#include -#include - - -#include "vimpstextentionuiuid.h" -#include - - -#include "cvimpstuiviewmanager.h" -#include "cvimpstuiextensionservice.h" - -#include "cvimpstenginefactory.h" -#include "cvimpstuitabbedview.h" -#include "cvimpstuisearchview.h" -#include "tvimpstconsts.h" -#include "cvimpstuiblockview.h" - -#include "uiservicetabtracer.h" -#include "cvimpstuimenuextension.h" - -// ================= MEMBER FUNCTIONS ======================= - -inline CVIMPSTUiExtensionFactory::CVIMPSTUiExtensionFactory() : - iCoeEnv( *CCoeEnv::Static() ) - { - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiExtensionFactory::ConstructL() - { - - // Load the Resource File - TRACER_AUTO; - TFileName resPathWithoutDrive; - resPathWithoutDrive.Zero(); - resPathWithoutDrive.Append( KResourceDir() ); - resPathWithoutDrive.Append( KResourceFileName() ); - - TFileName path; - Dll::FileName(path); //get the location of the dll - - TDriveName drive( TParsePtrC( path ).Drive( ) ); // solve drive - - // leave to stack, LC method - HBufC* resourceFilePath = HBufC::NewLC( KMaxResourcePathLength ); - TPtr ptr( resourceFilePath->Des() ); - ptr.Append( resPathWithoutDrive ); // without drive - ptr.Insert( 0, drive ); // insert drive - - // NearestLanguageFile takes only TFileName - path.Zero(); - path.Append( *resourceFilePath ); - - if ( path.Length() != 0 ) - { - BaflUtils::NearestLanguageFile( iCoeEnv.FsSession(), path ); - } - - CleanupStack::PopAndDestroy(); - - iResourceOffset = iCoeEnv.AddResourceFileL(path); - - iEngineFactoryInstance = CVIMPSTEngineFactory::InstanceL(); - - iEngine = CVIMPSTUIViewManager::NewL( - KNullDesC(), *this ); - iMenuExtension = CVIMPSTUIMenuExtension::NewL(); - // Get's all sevices - CreateServicesL(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiExtensionFactory* CVIMPSTUiExtensionFactory::NewL() - { - TRACER_AUTO; - CVIMPSTUiExtensionFactory* self = new (ELeave) CVIMPSTUiExtensionFactory; - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::~CVIMPSTUiExtensionFactory -// -------------------------------------------------------------------------- -// -CVIMPSTUiExtensionFactory::~CVIMPSTUiExtensionFactory() - { - TRACER_AUTO; - delete iEngine; - - iCoeEnv.DeleteResourceFile( iResourceOffset ); - - //for deleting iEngineFactoryInstance - CVIMPSTEngineFactory::Release(); - - delete iMenuExtension; - - } - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::CreateViewL -// -------------------------------------------------------------------------- -// -CxSPBaseView* CVIMPSTUiExtensionFactory::CreateViewL( TUid aViewId, CPbk2UIExtensionView& aView ) - { - TRACER_AUTO; - CxSPBaseView* view = NULL; - - TInt oldView; - TInt err = iMapper->GetOldView( KIMCONTACTSEXTNIMPLEMENTATIONUID, aViewId.iUid, oldView ); - - if( !err ) - { - - for ( TInt index = 0 ; - index < iEngine->ServiceCount() && !view ; - index++ ) - { - if ( iEngine->Service( index ).HasViewId( oldView ) ) - { - if ( IsTabbedId( oldView ) ) - { - view = iEngine->Service( index ).TabbedViewL( - *iMapper, - *iContactManager, - aView, - oldView, - aViewId, - iEngine->Service(index).ServiceEngine() ); - } - else if ( IsSearchId( oldView ) ) - { - view = iEngine->Service( index ).SearchViewL( - *iMapper, - *iContactManager, - aView, - oldView, - aViewId, - iEngine->Service(index).ServiceEngine() ); - } - else if(IsBlockeId( oldView )) - { - view = iEngine->Service( index ).BlockViewL( - *iMapper, - *iContactManager, - aView, - oldView, - iEngine->Service(index).ServiceEngine() ); - } - } - - } - } - - return view; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::RegisterViewMapper -// -------------------------------------------------------------------------- -// -void CVIMPSTUiExtensionFactory::RegisterViewMapper( MxSPViewMapper& aMapper ) - { - iMapper = &aMapper; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::ViewInfoResource -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiExtensionFactory::ViewInfoResource() const - { - TRACER_AUTO; - // Indicate KErrNotFound. This way static resources are not used but - // xSP Extension Manager queries data. Exception: If IM is not - // supported, indicate it via resource for simplicity - TInt ret = KErrNotFound; - - // add the FeatureManager checks for IM here - - // Check for any service - if ( !iEngine->ServiceCount() ) - { - ret = R_IM_CONTACTS_VIEW_INFO; - } - - return ret; - } - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::Id -// -------------------------------------------------------------------------- -// -TUint32 CVIMPSTUiExtensionFactory::Id() const - { - return KIMCONTACTSEXTNIMPLEMENTATIONUID; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::Name() -// -------------------------------------------------------------------------- -// -const TDesC& CVIMPSTUiExtensionFactory::Name() const - { - _LIT(KNull, " "); - return KNull; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::RegisterContactManager -// -------------------------------------------------------------------------- -// -void CVIMPSTUiExtensionFactory::RegisterContactManager( MxSPContactManager& aManager ) - { - iContactManager = &aManager; - } - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::SetVPbkContactManager -// -------------------------------------------------------------------------- -// -void CVIMPSTUiExtensionFactory::SetVPbkContactManager( CVPbkContactManager& /*aVPbkContactManager*/ ) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::UpdateStorePropertiesL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiExtensionFactory::UpdateStorePropertiesL( CPbk2StorePropertyArray& /*aPropertyArray*/ ) - { - } -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::ViewInfoCount -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiExtensionFactory::ViewInfoCount() const - { - return iEngine->ViewInfoCount(); - } -// -------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::ViewInfo -// -------------------------------------------------------------------------- -// -const MxSPViewInfo* CVIMPSTUiExtensionFactory::ViewInfo( TInt aIndex ) const - { - return iEngine->ViewInfo( aIndex ); - } - - -// --------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::CreateServicesL() -// --------------------------------------------------------------------------- -// -void CVIMPSTUiExtensionFactory::CreateServicesL() - { - TRACER_AUTO; - // Get all available services - RPointerArray engines; - - if (iEngineFactoryInstance) - { - iEngineFactoryInstance->GetServiceEnginePtr(engines); - TRACE("CreateServicesL() engines.Count(): %d", engines.Count()); - // iterate the service array - for ( TInt index = 0; index < engines.Count() ; index++ ) - { - //ServiceId is used to create unique view id for each service, to avoid the reuse of view id of existing service to newly installed service - TInt ServiceId = engines[index]->ServiceId(); - iEngine->AddNewClientL( ServiceId, *engines[index], - ( KVIMPSTTabbedViewIdBase + ServiceId ), ( KVIMPSTSearchViewIdBase + ServiceId), (KVIMPSTBlockedViewIdBase +ServiceId ), *iMenuExtension); - } - - engines.Reset(); - engines.Close(); - } - - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::IsSearchId() -// --------------------------------------------------------------------------- -// -TBool CVIMPSTUiExtensionFactory::IsSearchId( TUint aId ) - { - return ( aId >= KVIMPSTSearchViewIdBase && aId= KVIMPSTBlockedViewIdBase ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiExtensionFactory::IsTabbedId() -// --------------------------------------------------------------------------- -// -TBool CVIMPSTUiExtensionFactory::IsTabbedId( TUint aId ) - { - return ( aId >= KVIMPSTTabbedViewIdBase && aId < KVIMPSTSearchViewIdBase ); - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuiextensionservice.cpp --- a/uiservicetab/vimpstui/src/cvimpstuiextensionservice.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,631 +0,0 @@ -/* -* Copyright (c) 2008 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: Extension service for CVIMPSTUI -* -*/ - - -// INCLUDE FILES -#include "cvimpstuiextensionservice.h" - -#include - -// Edit view -#include -#include -#include - -#include "cvimpstuisearchfieldaray.h" -#include "mvimpstuisearchfield.h" -#include "cvimpstuisearchquerydialog.h" - -#include "cvimpstuitabbedview.h" -#include "cvimpstuisearchview.h" -#include "cvimpstuiextensionviewinfo.h" -#include "cvimpstcmdhandler.h" - -#include "mvimpstengine.h" -#include "vimpstutils.h" - -#include "cvimpstuibranddata.h" -#include "tvimpstconsts.h" -#include "cvimpstuiblockview.h" -#include -#include -#include -#include -#include "cvimpstuimenuextension.h" -#include "uiservicetabtracer.h" - -const TInt KDefaultIconId = EMbmVimpstuiExample_msn_tab; -const TInt KDefaultMaskId = EMbmVimpstuiExample_msn_tab_mask; - -const TInt KBrandTabIconId = EMbmVimpst_servicetab_defaultQgn_prop_im_imsg ; -const TInt KBrandTabMaskId = EMbmVimpst_servicetab_defaultQgn_prop_im_imsg_mask; - -_LIT(KDefaultFileLocation,"\\resource\\"); -_LIT(KBrandFileLocation,"C:\\resource\\"); -_LIT(KBrandFileNameDefault_C,"C:\\resource\\vimpst_servicetab_default.mif"); -_LIT(KBrandFileNameDefault_Z,"Z:\\resource\\apps\\vimpst_servicetab_default.mif"); -_LIT(KBrandFileNameHalf, "vimpst_servicetab_"); -_LIT(KBrandFileNameExt, ".mif"); -_LIT(KDefaultFileName, "vimpst_servicetab_default.mif"); -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::CVIMPSTUIExtensionService -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionService::CVIMPSTUIExtensionService( - TUint aServiceId, - TInt aTabbedViewId, - TInt aSearchViewId, - TInt aBlockedViewId, - CVIMPSTUIMenuExtension& aMenuExtension, - MVIMPSTEngine& aEngine ): - iServiceId( aServiceId ), - iTabbedViewId( aTabbedViewId ), - iSearchViewId( aSearchViewId ), - iBlockedViewId( aBlockedViewId ), - iMenuExtension(aMenuExtension), - iEngine( aEngine ) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTUIExtensionService::ConstructL(const TDesC& aServiceName) - { - TRACER_AUTO; - TFileName path; - Dll::FileName(path); //get the location of the dll - - TDriveName drive( TParsePtrC( path ).Drive( ) ); // solve drive - TBuf serviceName(iEngine.ServiceName()); - HBufC* brandFileName = HBufC::NewLC( KMaxResourcePathLength ); - TPtr brandFileNamePtr( brandFileName->Des() ); - brandFileNamePtr.Append( KBrandFileNameHalf() ); - brandFileNamePtr.Append( serviceName ); - brandFileNamePtr.Append( KBrandFileNameExt() ); - - RFs& session = CEikonEnv::Static()->FsSession(); - session.AddFileSystem( brandFileNamePtr ); - TFindFile file_finder(session); - CDir* file_list; - path.Zero(); - TInt err = file_finder.FindWildByDir( brandFileNamePtr,KBrandFileLocation(),file_list); - if( err == KErrNone ) - { - brandFileNamePtr.Insert( 0, KBrandFileLocation()); - } - else - { - err = file_finder.FindWildByDir( KDefaultFileName(), KDefaultFileLocation(), file_list ); - brandFileNamePtr.Zero(); - if( err == KErrNone ) - { - brandFileNamePtr.Insert( 0, KBrandFileNameDefault_C()); - } - else - { - brandFileNamePtr.Insert( 0, KBrandFileNameDefault_Z()); - } - } - path.Append( brandFileNamePtr ); - iServiceName = aServiceName.AllocL(); - // View info's must be created in initial contruct phase - iTabbedViewInfo = CVIMPSTUIExtensionViewInfo::NewL( - iTabbedViewId, ETrue, path, KBrandTabIconId, KBrandTabMaskId, *iServiceName ); - HBufC* resourceFilePath = HBufC::NewLC( KMaxResourcePathLength ); - TPtr ptr( resourceFilePath->Des() ); - ptr.Append( KDefaultIconFile() ); // without drive - ptr.Insert( 0, drive ); // insert drive - - // NearestLanguageFile takes only TFileName - path.Zero(); - path.Append( *resourceFilePath ); - - - - - iSearchViewInfo = CVIMPSTUIExtensionViewInfo::NewL( - iSearchViewId, EFalse, path, KDefaultIconId, - KDefaultMaskId, *iServiceName ); - - iBlockViewInfo = CVIMPSTUIExtensionViewInfo::NewL( - iBlockedViewId, EFalse, path, KDefaultIconId, - KDefaultMaskId, *iServiceName ); - - iCommandHandler = CVIMPSTCmdHandler::NewL(iEngine); - - iUiFieldsArray = CVIMPSTUiSearchFieldArray::NewL(); - CleanupStack::PopAndDestroy(2,brandFileName); //resourceFilePath,brandTabIconFilePath - delete file_list; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionService* CVIMPSTUIExtensionService::NewL( - TUint aServiceId, - TInt aTabbedViewId, - TInt aSearchViewId, - TInt aBlockedViewId, - const TDesC& aServiceName, - CVIMPSTUIMenuExtension& aMenuExtension, - MVIMPSTEngine& aEngine ) - { - CVIMPSTUIExtensionService* self = NewLC( - aServiceId, aTabbedViewId, aSearchViewId, aBlockedViewId, aServiceName, aMenuExtension, aEngine ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::NewLC -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionService* CVIMPSTUIExtensionService::NewLC( - TUint aServiceId, - TInt aTabbedViewId, - TInt aSearchViewId, - TInt aBlockedViewId, - const TDesC& aServiceName, - CVIMPSTUIMenuExtension& aMenuExtension, - MVIMPSTEngine& aEngine ) - { - CVIMPSTUIExtensionService* self = - new (ELeave) CVIMPSTUIExtensionService( - aServiceId, aTabbedViewId, aSearchViewId, aBlockedViewId, aMenuExtension, aEngine ); - CleanupStack::PushL(self); - self->ConstructL(aServiceName); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::~CVIMPSTUIExtensionService -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionService::~CVIMPSTUIExtensionService() - { - delete iUiFieldsArray; - - delete iCommandHandler; - iCommandHandler = NULL; - - delete iServiceName; - iServiceName = NULL; - - delete iSearchString; - iSearchString = NULL; - - //delete iBrandHandler; - - delete iTabbedViewInfo; - iTabbedViewInfo = NULL; - delete iSearchViewInfo; - iSearchViewInfo = NULL; - - delete iBlockViewInfo; - iBlockViewInfo = NULL; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::TabbedViewL -// --------------------------------------------------------------------------- -// -CVIMPSTUiTabbedView* - CVIMPSTUIExtensionService::TabbedViewL( - MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - CPbk2UIExtensionView& aView, - TInt aTabbedViewId, - TUid aId, - MVIMPSTEngine& aEngine ) - { - TRACER_AUTO; - if ( !iTabbedView ) - { - iTabbedView = CVIMPSTUiTabbedView::NewL( - aMapper, - aContactManager, - aTabbedViewId, - iServiceId, - aView, - aId, - *this, - aEngine, - *iCommandHandler, - iMenuExtension); - } - return iTabbedView; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::BlockViewL -// --------------------------------------------------------------------------- -// -CVIMPSTUiBlockView* - CVIMPSTUIExtensionService::BlockViewL( - MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - CPbk2UIExtensionView& aView, - TInt aBlockedViewId, - MVIMPSTEngine& aEngine ) - { - TRACER_AUTO; - if ( !iBlockedView ) - { - iBlockedView = CVIMPSTUiBlockView::NewL( - aMapper, - aContactManager, - aBlockedViewId, - aView, - *this , - aEngine, - *iCommandHandler ); - } - return iBlockedView; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SearchViewL -// --------------------------------------------------------------------------- -// -CVIMPSTUiSearchView* - CVIMPSTUIExtensionService::SearchViewL( - MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - CPbk2UIExtensionView& aView, - TInt aSearchViewId, - TUid aId, - MVIMPSTEngine& aEngine ) - { - TRACER_AUTO; - if ( !iSearchView ) - { - iSearchView = CVIMPSTUiSearchView::NewL( - aMapper, - aContactManager, - aSearchViewId, - iServiceId, - aView, - aId, - *this, - aEngine, - *iCommandHandler ); - } - return iSearchView; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::TabbedViewId -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUIExtensionService::TabbedViewId() - { - return iTabbedViewId; - } -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SearchViewId -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUIExtensionService::SearchViewId() - { - return iSearchViewId; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::BlockViewId -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUIExtensionService::BlockViewId() - { - return iBlockedViewId; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::ServiceId -// --------------------------------------------------------------------------- -// -TUint32 CVIMPSTUIExtensionService::ServiceId() - { - return iServiceId; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::ServiceName -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTUIExtensionService::ServiceName() - { - return *iServiceName; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SearchString -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTUIExtensionService::SearchString() - { - return *iSearchString; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SetSearchStringL -// --------------------------------------------------------------------------- -// -void CVIMPSTUIExtensionService::SetSearchStringL( const TDesC& aSearchString ) - { - if( iSearchString ) - { - delete iSearchString; - iSearchString = NULL; - } - iSearchString = aSearchString.AllocL(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::TabbedViewInfoL -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionViewInfo* - CVIMPSTUIExtensionService::TabbedViewInfoL() - { - return iTabbedViewInfo; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SearchViewInfo -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionViewInfo* - CVIMPSTUIExtensionService::SearchViewInfo() - { - return iSearchViewInfo; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::BlockedViewInfo -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionViewInfo* - CVIMPSTUIExtensionService::BlockedViewInfo() - { - return iBlockViewInfo; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::HasViewId() -// --------------------------------------------------------------------------- -// -TBool CVIMPSTUIExtensionService::HasViewId( TInt aViewId ) - { - return ( iTabbedViewId == aViewId || iSearchViewId == aViewId ||iBlockedViewId == aViewId ); - } - - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::ServiceEngine() -// --------------------------------------------------------------------------- -// - -MVIMPSTEngine& CVIMPSTUIExtensionService::ServiceEngine () - { - return iEngine; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SetSearchFieldsDataL -// --------------------------------------------------------------------------- -// -void CVIMPSTUIExtensionService::SetSearchFieldsDataL( RArray& aEnumKeysArray, RPointerArray& aLebelKeysArray ) - { - TRACER_AUTO; - // reset all old fields and create new fields - if( iUiFieldsArray ) - { - delete iUiFieldsArray; - iUiFieldsArray = NULL; - } - iUiFieldsArray = CVIMPSTUiSearchFieldArray::NewL(); - - TInt enumCount = aEnumKeysArray.Count(); - TInt labelCount = aLebelKeysArray.Count(); - - TBool isBasicField = EFalse ; - TInt basicFieldIndex = 0; - - if( !enumCount && !labelCount ) - { - return; - } - for( TInt i =0; i< enumCount; i++ ) - { - TVIMPSTEnums::TVIMPSTSearchKey enumKey = static_cast( aEnumKeysArray[i] ); - // get the data associaed with key , - // also check if basic field - HBufC* akeyValue = GetSearchKeyLabelL( enumKey, isBasicField ); - if( akeyValue ) - { - if( isBasicField ) - { - if( enumKey == TVIMPSTEnums::EVIMPSTFirstName ) - { - basicFieldIndex = 0 ; // always on top 1st element - } - - iUiFieldsArray->InsertFieldsL(basicFieldIndex , *akeyValue, EVIMPSTEdwinText,EIMBasicSearch ,enumKey); - - basicFieldIndex++ ; - - } - else - { - iUiFieldsArray->CreateFieldsL( *akeyValue, EVIMPSTEdwinText ,EIMAdvancedSearch, enumKey); - } - delete akeyValue; - akeyValue = NULL; - } - - } - - for( TInt i =0; i< labelCount; i++ ) - { - // not owns akeyValue - HBufC* akeyValue = aLebelKeysArray[i]; - if( akeyValue ) - { - iUiFieldsArray->CreateFieldsL( *akeyValue, EVIMPSTEdwinText ); - } - - } - // this will sort only basic fields - SortBasicFields(); - } -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SetSearchFieldsDataL -// --------------------------------------------------------------------------- -// -CVIMPSTUiSearchFieldArray& CVIMPSTUIExtensionService::GetSearchFieldArray() - { - return *iUiFieldsArray; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::GetSearchKeyLabelL -// --------------------------------------------------------------------------- -// -HBufC* CVIMPSTUIExtensionService::GetSearchKeyLabelL(TVIMPSTEnums::TVIMPSTSearchKey aSearchKey ,TBool& aBasicField ) - { - TRACER_AUTO; - HBufC* keyText = NULL; - aBasicField = EFalse; - - switch( aSearchKey ) - { - case TVIMPSTEnums::EVIMPSTMiddleName : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_MIDDLENAME ); - break; - } - case TVIMPSTEnums::EVIMPSTLastName : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_LASTNAME ); - aBasicField = ETrue; - break; - } - case TVIMPSTEnums::EVIMPSTFullName : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_FULLNAME ); - break; - } - case TVIMPSTEnums::EVIMPSTCountry : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_COUNTRY ); - break; - } - case TVIMPSTEnums::EVIMPSTCity : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_CITY ); - break; - } - - case TVIMPSTEnums::EVIMPSTNickName : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_NICKNAME ); - break; - } - case TVIMPSTEnums::EVIMPSTState : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_STATE ); - break; - } - case TVIMPSTEnums::EVIMPSTOrganisationUnit : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_ORGUNIT ); - break; - } - case TVIMPSTEnums::EVIMPSTBirthday : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_BIRTHDAY ); - break; - } - - case TVIMPSTEnums::EVIMPSTEmailAddress : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_EMAIL ); - break; - } - case TVIMPSTEnums::EVIMPSTUser : - { - aBasicField = ETrue; - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_USER ); - break; - } - case TVIMPSTEnums::EVIMPSTOrganisation : - { - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_ORG ); - break; - } - case TVIMPSTEnums::EVIMPSTFirstName: - default: - { - aBasicField = ETrue; - keyText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_FIRSTNAME ); - break; - } - } - - return keyText; - - } - - // --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SortBasicFields -// --------------------------------------------------------------------------- -// -void CVIMPSTUIExtensionService::SortBasicFields() - { - TRACER_AUTO; - TInt count = iUiFieldsArray->Count(); - TInt index = 0; - if( count >2 ) // atleast there has to be 3 item for sort , first name is already on top - { - MVIMPSTUiSearchField& field = iUiFieldsArray->At(1); - if( field.GetSearchKey() != TVIMPSTEnums::EVIMPSTLastName ) - { - for(index =2; index < count; index++ ) - { - field = iUiFieldsArray->At(index); - if( field.GetSearchKey() == TVIMPSTEnums::EVIMPSTLastName ) - { - iUiFieldsArray->RemoveField(index); - iUiFieldsArray->InsertField(&field, 1); // insert at 1st number; - return; - } - } - - } - } - - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuiextensionviewinfo.cpp --- a/uiservicetab/vimpstui/src/cvimpstuiextensionviewinfo.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,187 +0,0 @@ -/* -* Copyright (c) 2008 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: Extension view info for VIMPSTUI -* -*/ - - -#include "cvimpstuiextensionviewinfo.h" - -// ======== LOCAL FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionViewInfo:: -// CVIMPSTUIExtensionViewInfo -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionViewInfo::CVIMPSTUIExtensionViewInfo( - TUint32 aViewId, - TBool aIsTabbedView, - TUint aIconId, - TUint aMaskId ): - iViewId( aViewId ), - iIsTabbedView( aIsTabbedView ), - iIconId( aIconId ), - iMaskId( aMaskId ) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionViewInfo::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTUIExtensionViewInfo::ConstructL( const TDesC& aIconFile, - const TDesC& aServiceName ) - { - iIconFile = aIconFile.AllocL(); - iServiceName = aServiceName.AllocL(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionViewInfo::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionViewInfo* CVIMPSTUIExtensionViewInfo::NewL( - TUint32 aViewId, - TBool aIsTabbedView, - const TDesC& aIconFile, - TUint aIconId, - TUint aMaskId, - const TDesC& aServiceName ) - { - - CVIMPSTUIExtensionViewInfo* self = NewLC( - aViewId, aIsTabbedView, aIconFile, aIconId, aMaskId, aServiceName ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionViewInfo::NewLC -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionViewInfo* CVIMPSTUIExtensionViewInfo::NewLC( - TUint32 aViewId, - TBool aIsTabbedView, - const TDesC& aIconFile, - TUint aIconId, - TUint aMaskId, - const TDesC& aServiceName ) - { - CVIMPSTUIExtensionViewInfo* self = - new (ELeave) CVIMPSTUIExtensionViewInfo( - aViewId, aIsTabbedView, aIconId, aMaskId ); - CleanupStack::PushL(self); - self->ConstructL( aIconFile, aServiceName ); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionViewInfo:: -// ~CVIMPSTUIExtensionViewInfo -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionViewInfo::~CVIMPSTUIExtensionViewInfo() - { - delete iIconFile; - iIconFile = NULL; - - - delete iServiceName; - iServiceName = NULL; - - - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionViewInfo::OldViewId -// --------------------------------------------------------------------------- -// -TInt32 CVIMPSTUIExtensionViewInfo::OldViewId() const - { - return iViewId; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionViewInfo::TabView -// --------------------------------------------------------------------------- -// -TBool CVIMPSTUIExtensionViewInfo::TabView() const - { - return iIsTabbedView; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::TabIconId -// --------------------------------------------------------------------------- -// -TInt32 CVIMPSTUIExtensionViewInfo::TabIconId() const - { - return iIconId; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::TabMaskId -// --------------------------------------------------------------------------- -// -TInt32 CVIMPSTUIExtensionViewInfo::TabMaskId() const - { - return iMaskId; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::TabIconFile -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTUIExtensionViewInfo::TabIconFile() const - { - return *iIconFile; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::Name -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTUIExtensionViewInfo::Name() const - { - return *iServiceName; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SortIconId -// --------------------------------------------------------------------------- -// -TInt32 CVIMPSTUIExtensionViewInfo::SortIconId() const - { - return iIconId; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionService::SortMaskId -// --------------------------------------------------------------------------- -// -TInt32 CVIMPSTUIExtensionViewInfo::SortMaskId() const - { - return iMaskId; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIExtensionViewInfo::SortIconFile -// --------------------------------------------------------------------------- -// -const TDesC& CVIMPSTUIExtensionViewInfo::SortIconFile() const - { - return *iIconFile; - } -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuiiconfileprovider.cpp --- a/uiservicetab/vimpstui/src/cvimpstuiiconfileprovider.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2008 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: Con file provider for VIMPSTUI -* -*/ - -#include "cvimpstuiiconfileprovider.h" - - -// ----------------------------------------------------------------------------- -// CVIMPSTUiconFileProvider::CVIMPSTUiconFileProvider -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// - -CVIMPSTUiconFileProvider::CVIMPSTUiconFileProvider( RFile& aFile ) -: iFile( aFile ) - { - iFile.Duplicate( aFile ); - } -// ----------------------------------------------------------------------------- -// CVIMPSTUiconFileProvider::~CVIMPSTUiconFileProvider -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// - -CVIMPSTUiconFileProvider::~CVIMPSTUiconFileProvider() - { - iFile.Close(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTUiconFileProvider::RetrieveIconFileHandleL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// - -void CVIMPSTUiconFileProvider::RetrieveIconFileHandleL( RFile& aFile, const TIconFileType /*aType*/ ) - { - aFile.Duplicate( iFile ); - } -// ----------------------------------------------------------------------------- -// CVIMPSTUiconFileProvider::Finished -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CImContactsIconFileProvider::Finished() - { - delete this; - } - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuilistboxmodel.cpp --- a/uiservicetab/vimpstui/src/cvimpstuilistboxmodel.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,329 +0,0 @@ -/* -* Copyright (c) 2008 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: Custom listbox model for the contact list -* -*/ - - -#include "cvimpstuilistboxmodel.h" -#include "mvimpstprocessarray.h" -#include "uiservicetabtracer.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::CVIMPSTUiListBoxModel -// --------------------------------------------------------------------------- -// -CVIMPSTUiListBoxModel::CVIMPSTUiListBoxModel() - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::~CVIMPSTUiListBoxModel -// --------------------------------------------------------------------------- -// -CVIMPSTUiListBoxModel::~CVIMPSTUiListBoxModel() - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::NumberOfItems -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUiListBoxModel::NumberOfItems() const - { - TRACER_AUTO; - if( IsFilterActive() ) - { - // Something is filtered - return CountItems(); - } - if( iItemTextArray ) - { - // Fast - return iItemTextArray->MdcaCount(); - } - - return 0; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::ItemText -// --------------------------------------------------------------------------- -// -TPtrC CVIMPSTUiListBoxModel::ItemText( TInt aItemIndex ) const - { - if( IsFilterActive() ) - { - // Slow - return ItemAt( aItemIndex ); - } - - // Fast - return iItemTextArray->MdcaPoint( aItemIndex ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::FilteredItemIndex -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUiListBoxModel::FilteredItemIndex( TInt aVisibleItemIndex ) const - { - TRACER_AUTO; - if( !IsFilterActive() ) - { - // Nothing is filtered - return aVisibleItemIndex; - } - if( Filter() ) - { - // Get positions of lists - RArray pos; - // iItemModel->MapContactListPositions( pos ); - - // Count visible items until we reach the wanted one - TInt itemcount = -1; - TInt count = iItemTextArray->MdcaCount(); - for( TInt i = 0; i < count; ++i ) - { - if( ( pos.Find( i ) != KErrNotFound && - IsContactList( i, pos ) ) || - Filter()->VisibleItemIndex( i ) != KErrNotFound ) - { - // this item is either visible by filter or - // it's our dynamically added contact list - itemcount++; - if( itemcount == aVisibleItemIndex ) - { - pos.Close(); - return i; - } - } - } - pos.Close(); - } - return 0; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::VisibleItemIndex -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUiListBoxModel::VisibleItemIndex( TInt aOriginalIndex ) const - { - TRACER_AUTO; - if( !IsFilterActive() ) - { - // Nothing is filtered - return aOriginalIndex; - } - - // Get positions of contact lists - RArray pos; - //iItemModel->MapContactListPositions( pos ); - - // Check if it's even visible - TInt index = Filter()->VisibleItemIndex( aOriginalIndex ); - TBool visibleList = IsContactList( aOriginalIndex, pos ); - if( index == KErrNotFound && !visibleList ) - { - pos.Close(); - return KErrNotFound; - } - - // Count up to original index to find out the visible position - TInt visibleIndex = -1; - for( TInt i = 0; i <= aOriginalIndex; ++i ) - { - if( ( pos.Find( i ) != KErrNotFound && - IsContactList( i, pos ) ) || - Filter()->VisibleItemIndex( i ) != KErrNotFound ) - { - // this item is either visible by filter or - // it's our dynamically added contact list - visibleIndex++; - } - } - pos.Close(); - return visibleIndex; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::CountItems -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUiListBoxModel::CountItems() const - { - TRACER_AUTO; - TInt itemcount = 0; - if( Filter() ) - { - // Count of visible items by filter - itemcount = Filter()->FilteredNumberOfItems(); - if( itemcount == 0 ) - { - return itemcount; - } - - // Get positions of contact lists - RArray pos; - //iItemModel->MapContactListPositions( pos ); - - // Scan through list positions and count the additional visible items. - TInt count = pos.Count(); - for( TInt i = 0; i < count; ++i ) - { - if( IsContactList( pos[i], pos ) && - Filter()->VisibleItemIndex( pos[i] ) == KErrNotFound ) - { - // List should be visible because it has found contacts in it - // but it's filtered out by searchfield. Add it dynamically. - itemcount++; - } - } - pos.Close(); - } - return itemcount; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::ItemAt -// --------------------------------------------------------------------------- -// -TPtrC CVIMPSTUiListBoxModel::ItemAt( TInt aIndex ) const - { - TRACER_AUTO; - TInt itemcount = -1; - if( Filter() ) - { - // Get positions of contact lists - RArray pos; - - // Scan through visible items until we reach the wanted one - TInt count = iItemTextArray->MdcaCount(); - for( TInt i = 0; i < count; ++i ) - { - if( ( pos.Find( i ) != KErrNotFound && - IsContactList( i, pos ) ) || - Filter()->VisibleItemIndex( i ) != KErrNotFound ) - { - // this item is either visible by filter or - // it's our dynamically added contact list - itemcount++; - if( itemcount == aIndex ) - { - // Found it - pos.Close(); - return iItemTextArray->MdcaPoint( i ); - } - } - } - pos.Close(); - } - return KNullDesC(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::IsContactList -// --------------------------------------------------------------------------- -// -TBool CVIMPSTUiListBoxModel::IsContactList( TInt aIndex, RArray& aPosArray ) const - { - TRACER_AUTO; - TInt startInd = aPosArray.Find( aIndex ); - if( KErrNotFound == startInd ) - { - // aIndex not found in array -> not even list - return EFalse; - } - - TInt count = aPosArray.Count(); - TInt end = 0; - if( startInd >= count - 1 ) - { - // aIndex is the last list: - // Search from aIndex to last item - end = iItemTextArray->MdcaCount(); - } - else - { - // Search from aInded to next item in array - end = aPosArray[ startInd + 1 ]; - } - - // Try to find visible contacts for this list - for ( TInt i = aIndex + 1; i < end; ++i ) - { - if( Filter()->VisibleItemIndex( i ) != KErrNotFound ) - { - // found one - return ETrue; - } - } - // not found - return EFalse; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::IsFilterActive -// --------------------------------------------------------------------------- -// -TBool CVIMPSTUiListBoxModel::IsFilterActive() const - { - if( Filter() ) - { - return iItemTextArray->MdcaCount() != - Filter()->FilteredNumberOfItems(); - } - return EFalse; - } -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::MatchableTextArray -// --------------------------------------------------------------------------- -// -const MDesCArray* CVIMPSTUiListBoxModel::MatchableTextArray() const - { - return this; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::MdcaCount -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUiListBoxModel::MdcaCount() const - { - return iItemModel->Count(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::MdcaPoint -// --------------------------------------------------------------------------- -// -TPtrC CVIMPSTUiListBoxModel::MdcaPoint( TInt aIndex ) const - { - return iItemModel->GetItemNameText( aIndex ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBoxModel::SetContactListModel -// --------------------------------------------------------------------------- -// -void CVIMPSTUiListBoxModel::SetContactListModel( MVIMPSTProcessArray& - aContactListModel ) - { - iItemModel = &aContactListModel; - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuimenuextension.cpp --- a/uiservicetab/vimpstui/src/cvimpstuimenuextension.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,413 +0,0 @@ -/* -* Copyright (c) 2008 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: cvimpstuimenuextension.cpp - * -*/ - -// INCLUDE FILES - -#include -#include -#include -#include -#include -#include "uiservicetabtracer.h" - -#include "cvimpstuimenuextension.h" -#include "ccommandinfo.h" - -#include "servicetabmenucommandinfo.hrh" -#include "vimpstcustomcleanupapi.h" - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::CVIMPSTUIMenuExtension -// --------------------------------------------------------------------------- -// -CVIMPSTUIMenuExtension::CVIMPSTUIMenuExtension( ) -: iNewCommands( EServiceTabMenuExtensionFirstFreeCommand ) - { - TRACER_AUTO; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTUIMenuExtension::ConstructL() - { - TRACER_AUTO; - LoadPluginL( ); - - - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTUIMenuExtension* CVIMPSTUIMenuExtension::NewL( ) - { - TRACER_AUTO; - CVIMPSTUIMenuExtension* self = NewLC( ); - CleanupStack::Pop(self); - - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::NewLC -// --------------------------------------------------------------------------- -// -CVIMPSTUIMenuExtension* CVIMPSTUIMenuExtension::NewLC() - { - TRACER_AUTO; - CVIMPSTUIMenuExtension* self = - new (ELeave) CVIMPSTUIMenuExtension( ); - CleanupStack::PushL( self ); - self->ConstructL(); - - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::~CVIMPSTUIMenuExtension -// --------------------------------------------------------------------------- -// -CVIMPSTUIMenuExtension::~CVIMPSTUIMenuExtension() - { - TRACER_AUTO; - iCommandIdMap.ResetAndDestroy(); - //iCommandIdMap.Close(); - // Reset and destroy the contents of the owned arrays, - // this will delete the plugins. - iPlugins.ResetAndDestroy(); - //iPlugins.Close(); - - iAIWCommandMap.ResetAndDestroy(); - - // Close the ECOM interface - REComSession::FinalClose(); - - } - -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::LoadPluginL -// Loads all plugins -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// -void CVIMPSTUIMenuExtension::LoadPluginL( ) - { - TRACER_AUTO; - // plugininfo array, Owned - RImplInfoPtrArray pluginInfo; - CustomCleanupResetAndDestroyPushL(pluginInfo); - iPlugins.ResetAndDestroy(); - REComSession::ListImplementationsL( KMenuCustomisationInterfaceUid,pluginInfo ); - TInt pluginCount = pluginInfo.Count(); - TRACE("plugincount: %d" ,pluginCount ); - - for ( TInt pluginIndex(0); pluginIndex < pluginCount; ++pluginIndex ) - { - TRACE("Inside for loop" ); - TUid pluginUid = pluginInfo[pluginIndex]->ImplementationUid(); - TRACE("ImplementationUid: %u" ,pluginUid.iUid ); - // Creates the plugin and transfers ownership of the services - // object to the plugin. - CMenuExtension* plugin = NULL; - TRAPD(error, plugin = CMenuExtension::CreateImplementationL( pluginUid )); - - if(KErrNone != error) - { - // handle the error here. - TRACE("error loading the plugin error: %d" ,error ); - } - else - { - TRACE("plugin loaded sucessfully" ); - //if its here its sure that plugin is not null; - CleanupStack::PushL( plugin); - - TRACE("before mapcommandl" ); - //map the plugin commands to servicetab commands, - //assings the command maintained in the commandpool, - //for more details see - MapCommandL(*plugin,pluginUid.iUid); - TRACE("after mapcommandl" ); - - //add the plugin to the array - CPluginInfo* newPlugin = new ( ELeave ) CVIMPSTUIMenuExtension::CPluginInfo( plugin, pluginUid); - CleanupStack::PushL( newPlugin ); - iPlugins.AppendL( newPlugin ); - CleanupStack::Pop( newPlugin ); - - CleanupStack::Pop( plugin ); - } - - } - CleanupStack::PopAndDestroy(); - - - - } - - -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::OfferMenuPaneToPluginsL -// Generates the list of active plugins -// ---------------------------------------------------------------------------- -// -void CVIMPSTUIMenuExtension::OfferMenuPaneToPlugins(TInt aPreviousId, CEikMenuPane& aMenuPane,TUint aServiceId) - { - TRACER_AUTO; - TRACE(" aServiceId : %u" , aServiceId ); - - iMenuPane = &aMenuPane; - // Get the number of plugins - const TInt count = iPlugins.Count(); - TRACE(" count : %d" , count ); - // Loop though all the command handlers, If DynInitMenuPaneL leaves for one plugin, a plugin - // error message will be displayed and the loop will continue with - // the next command handler. If none of the plugins leave, there will - // be only one TRAP used. - for ( TInt index = 0; index < count; ++index ) - { - TRACE("inside for loop" ); - //trap is required if one plugin leaves then it should continue with other plugins. - TRAPD(error,iPlugins[index]->Plugin().DynInitMenuPaneL( aPreviousId, - aMenuPane,aServiceId,*this )); - if(KErrNone != error) - { - //display the appropriate error note for leaving; - TRACE("error by one of plugind dyninitmenupanel" ); - } - - } - - } -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::OfferHandleCommandToPluginsL -// Generates the list of active plugins -// ---------------------------------------------------------------------------- -// -TBool CVIMPSTUIMenuExtension::OfferHandleCommandToPlugins(TInt aCommandId) - { - TRACER_AUTO; - - //Get the number of plugins loaded - const TInt count = iPlugins.Count(); - TRACE("count : %d" ,count ); - - TBool retval = EFalse; - // Loop though all the command handlers, - // If HandleCommandL leaves for one plugin, a plugin - // error message will be displayed and the loop will continue with - // the next plugin. If none of the plugins leave, there will - // be only one TRAP used. - for ( TInt index = 0; index < count; ++index ) - { - TRAPD( error,retval = iPlugins[index]->Plugin().HandleCommandL( aCommandId )); - - if ( KErrNone != error ) - { - // Report a problem with plugin. - } - } - - - return retval; - } - -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::CPluginInfo::CPluginInfo( -// C++ constructor -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// -CVIMPSTUIMenuExtension::CPluginInfo::CPluginInfo( - CMenuExtension* aPlugin, - TUid aPluginUid ) - : iPlugin( aPlugin ), - iPluginUid( aPluginUid ) - { - TRACER_AUTO; - - } -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::CPluginInfo::~CPluginInfo( -// C++ destructor -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// -CVIMPSTUIMenuExtension::CPluginInfo::~CPluginInfo() - { - TRACER_AUTO; - delete iPlugin; - - } - -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::CPluginInfo::Plugin -// returns a reference to the plugin -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// -CMenuExtension& CVIMPSTUIMenuExtension::CPluginInfo::Plugin() - { - TRACER_AUTO; - return *iPlugin; - } - - -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::MapCommandL -// (other items were commented in a header). -// ---------------------------------------------------------------------------- -// -void CVIMPSTUIMenuExtension::MapCommandL( CMenuExtension& aMenuExtension, TInt32 aPluginId ) - { - TRACER_AUTO; - - TInt res = aMenuExtension.CommandInfoResource(); - if( res != KErrNotFound ) - { - TResourceReader reader; - CCoeEnv::Static()->CreateResourceReaderLC( reader, res ); - TInt resCount = reader.ReadInt16(); - for( TInt j = 0; j < resCount; j++ ) - { - CCommandInfo* commandInfo = NULL; - commandInfo = CCommandInfo::NewLC( reader, - aPluginId, - iNewCommands ); - User::LeaveIfError( iCommandIdMap.Append( commandInfo ) ); - CleanupStack::Pop(); // commandInfo - } - CleanupStack::PopAndDestroy(); // reader - aMenuExtension.RegisterCommandMapper( *this ); - - } - - - } -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::GetNewCommand -// from MComandMapper -// ---------------------------------------------------------------------------- -// - -TInt CVIMPSTUIMenuExtension::GetOldCommand( TInt32 aPluginId, TInt aNewCommand, - TInt& aOldCommand ) const - { - TRACER_AUTO; - - TInt mapCount = iCommandIdMap.Count(); - TInt err( KErrNotFound ); - //TODO:: optimize searching. - for( TInt i = 0; i < mapCount && err; i++ ) - { - CCommandInfo* info = iCommandIdMap[i]; - if( info->PliginId() == aPluginId && info->NewCommandId() == aNewCommand ) - { - aOldCommand = info->OldCommandId(); - err = KErrNone; - break; - } - } - - - return err; - } -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::GetNewCommand -// from MComandMapper -// ---------------------------------------------------------------------------- -// - -TInt CVIMPSTUIMenuExtension::GetNewCommand( TInt32 aPluginId, TInt aOldCommand, - TInt& aNewCommand ) const - { - TRACER_AUTO; - - TInt mapCount = iCommandIdMap.Count(); - TInt err( KErrNotFound ); - //TODO:: optimize searching. - for( TInt i = 0; i < mapCount && err; i++ ) - { - CCommandInfo* info = iCommandIdMap[i]; - if( info->PliginId() == aPluginId && info->OldCommandId() == aOldCommand ) - { - aNewCommand = info->NewCommandId(); - err = KErrNone; - break; - } - } - - - return err; - } -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::AddToAIWCommandMap -// ---------------------------------------------------------------------------- -// -void CVIMPSTUIMenuExtension::AddToAIWCommandMap(TInt aOriginalCommand, TInt aNewCommand) - { - TRACER_AUTO; - TAIWCommandMapTableItem *item = new TAIWCommandMapTableItem(); - item->iOriginalCmd = aOriginalCommand; - item->iNewCmd = aNewCommand; - iAIWCommandMap.Append(item); - } -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::GetNewAIWCommand -// ---------------------------------------------------------------------------- -// -TInt CVIMPSTUIMenuExtension::GetNewAIWCommand(TInt aOriginalCommand) - { - TRACER_AUTO; - TInt count = iAIWCommandMap.Count(); - for( TInt i=0 ; iiOriginalCmd == aOriginalCommand) - { - return iAIWCommandMap[i]->iNewCmd; - } - } - return KErrNotFound; - } -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::ResetAIWCommandMap -// ---------------------------------------------------------------------------- -// -void CVIMPSTUIMenuExtension::ResetAIWCommandMap() - { - iAIWCommandMap.ResetAndDestroy(); - } - -// ---------------------------------------------------------------------------- -// CVIMPSTUIMenuExtension::SetAIWItemDimmed -// ---------------------------------------------------------------------------- -// -void CVIMPSTUIMenuExtension::SetAIWItemDimmed(TInt aCommand, TBool aHide) - { - TRACER_AUTO; - TInt cmd = GetNewAIWCommand(aCommand); - if(cmd != KErrNotFound) - iMenuPane->SetItemDimmed(cmd,aHide); - } - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuisearchfield.cpp --- a/uiservicetab/vimpstui/src/cvimpstuisearchfield.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,236 +0,0 @@ -/* -* Copyright (c) 2008 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: search field implemetation -* -*/ - - -#include "cvimpstuisearchfield.h" - -// System includes -#include -#include -#include -#include - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::CVIMPSTUiSearchField -// ----------------------------------------------------------------------------- -// -CVIMPSTUiSearchField::CVIMPSTUiSearchField( TVIMPSTSearchDataFieldType aFieldDataType, - TIMPSTSearchFieldTypes aFieldType, - TVIMPSTEnums::TVIMPSTSearchKey aSearchKey - /* =EVIMPSTSearchKeyUknown*/) - :iFieldDataType( aFieldDataType ), - iFieldType(aFieldType ), - iSearchKey( aSearchKey ) - { - iCaptionedCtrl = NULL; - iControl = NULL; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchField* CVIMPSTUiSearchField::NewL( const TDesC& aLebal, - TVIMPSTSearchDataFieldType aFieldDataType, - TIMPSTSearchFieldTypes aFieldType , - TVIMPSTEnums::TVIMPSTSearchKey aSearchKey ) - { - CVIMPSTUiSearchField* self = - new ( ELeave ) CVIMPSTUiSearchField( aFieldDataType , aFieldType, aSearchKey ); - CleanupStack::PushL( self ); - self->ConstructL(aLebal); - CleanupStack::Pop( self ); - return self; - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchField::ConstructL( const TDesC& aLabel ) - { - iFieldLabel = aLabel.AllocL(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::~CVIMPSTUiSearchField -// ----------------------------------------------------------------------------- -// -CVIMPSTUiSearchField::~CVIMPSTUiSearchField() - { - delete iFieldLabel; - delete iFieldData; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::ControlId -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTUiSearchField::ControlId() const - { - return ( TInt ) this; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::FieldDataType -// ----------------------------------------------------------------------------- -// -TVIMPSTSearchDataFieldType CVIMPSTUiSearchField::FieldDataType() const - { - return iFieldDataType; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::FieldLabel -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTUiSearchField::FieldLabel() - { - if( iFieldLabel ) - { - return iFieldLabel->Des(); - } - return KNullDesC(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::FieldData -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTUiSearchField::FieldData() - { - if( iFieldData ) - { - return iFieldData->Des(); - } - return KNullDesC(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::ResetFieldData -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiSearchField::ResetFieldData() - { - if( iFieldData ) - { - delete iFieldData; - iFieldData = NULL; - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::GetSearchKey -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TVIMPSTSearchKey CVIMPSTUiSearchField::GetSearchKey() const - { - return iSearchKey; - } - // -------------------------------------------------------------------------- -// CVIMPSTUiSearchField::IsBasicField -// -------------------------------------------------------------------------- -// -TBool CVIMPSTUiSearchField::IsBasicField() const - { - return ( iFieldType == EIMBasicSearch ); - } -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::SetFieldDataL -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiSearchField::SetFieldDataL( const TDesC& aFieldData ) - { - if( iFieldData ) - { - delete iFieldData; - iFieldData = NULL; - } - iFieldData = aFieldData.AllocL(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchField::SetControl -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchField::SetControl(CEikEdwin* aControl, CEikCaptionedControl* aCaptionedCtrl ) - { - iControl = NULL; - iControl = aControl ; - - iCaptionedCtrl = NULL; - iCaptionedCtrl = aCaptionedCtrl; - } - // -------------------------------------------------------------------------- -// CVIMPSTUiSearchField::Control -// -------------------------------------------------------------------------- -// -CEikEdwin* CVIMPSTUiSearchField::Control() const - { - return iControl; - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchField::ActivateL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchField::ActivateL() - { - if( !iCaptionedCtrl ) - { - User::Leave( KErrNotReady ); - } - iCaptionedCtrl->ActivateL(); - } -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchField::ControlTextL -// ----------------------------------------------------------------------------- -// -HBufC* CVIMPSTUiSearchField::ControlTextL() const - { - HBufC* textBuf = NULL; - - switch( iFieldDataType ) - { - - case EVIMPSTEdwinNumber : - { - // number field - break; - } - case EVIMPSTEdwinEmail : - { - // email field - break; - } - - case EVIMPSTEdwinMobile: - { - // mobile field - break; - } - case EVIMPSTEdwinText : - { - if ( iControl ) - { - textBuf = iControl->GetTextInHBufL(); - } - break; - } - } - return textBuf; - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuisearchfieldarray.cpp --- a/uiservicetab/vimpstui/src/cvimpstuisearchfieldarray.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,373 +0,0 @@ -/* -* Copyright (c) 2008 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: search fields array implementation. -* -*/ - - -#include "cvimpstuisearchfieldaray.h" - -#include "mvimpstsearchuibuilder.h" -#include "cvimpstuisearchfield.h" - -// System includes -#include -#include -#include -#include -#include -#include "uiservicetabtracer.h" - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::CVIMPSTUiSearchFieldArray -// -------------------------------------------------------------------------- -// -inline CVIMPSTUiSearchFieldArray::CVIMPSTUiSearchFieldArray(): - iSelectedSearchType( EIMBasicSearch ) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::~CVIMPSTUiSearchFieldArray -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchFieldArray::~CVIMPSTUiSearchFieldArray() - { - iFieldArray.ResetAndDestroy(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchFieldArray* CVIMPSTUiSearchFieldArray::NewL() - { - CVIMPSTUiSearchFieldArray* self = - new ( ELeave ) CVIMPSTUiSearchFieldArray( ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::ConstructL -// -------------------------------------------------------------------------- -// -inline void CVIMPSTUiSearchFieldArray::ConstructL() - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::CreateFieldsFromContactL -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiSearchFieldArray::CreateFieldsL( const TDesC& aLebal, - TVIMPSTSearchDataFieldType aFieldDataType , - TIMPSTSearchFieldTypes aFieldType /*= EIMAdvancedSearch*/, - TVIMPSTEnums::TVIMPSTSearchKey aSearchKey/* = EVIMPSTSearchKeyUknown*/ ) - { - TRACER_AUTO; - MVIMPSTUiSearchField* newField = CVIMPSTUiSearchField::NewL( aLebal, aFieldDataType, aFieldType , aSearchKey); - - iFieldArray.Append( newField ); // ownership to array - - return newField->ControlId(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::InsertFieldsL -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiSearchFieldArray::InsertFieldsL(TInt aIndex, const TDesC& aLebal, - TVIMPSTSearchDataFieldType aFieldDataType , - TIMPSTSearchFieldTypes aFieldType /*= EIMAdvancedSearch*/, - TVIMPSTEnums::TVIMPSTSearchKey aSearchKey/* = EVIMPSTSearchKeyUknown*/ ) - { - TRACER_AUTO; - MVIMPSTUiSearchField* newField = CVIMPSTUiSearchField::NewL( aLebal, aFieldDataType, aFieldType, aSearchKey ); - - iFieldArray.InsertL( newField ,aIndex); // ownership to array - - return newField->ControlId(); - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::AreAllUiFieldsEmpty -// -------------------------------------------------------------------------- -// -TBool CVIMPSTUiSearchFieldArray::AreAllUiFieldsEmpty() const - { - TRACER_AUTO; - const TInt count = iFieldArray.Count(); - - for(TInt i = 0; i < count; ++i) - { - TPtrC text = iFieldArray[i]->FieldData() ; - if ( text.Length() > 0) - { - return EFalse; - } - - } - return ETrue; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::AreAllUiControlsEmptyL -// -------------------------------------------------------------------------- -// -TBool CVIMPSTUiSearchFieldArray::AreAllUiControlsEmptyL() const - { - TRACER_AUTO; - const TInt count = iFieldArray.Count(); - - for(TInt i = 0; i < count; ++i) - { - HBufC* text = iFieldArray[i]->ControlTextL() ; - if ( text && text->Length() ) - { - return EFalse; - } - - } - return ETrue; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::ResetFieldData -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchFieldArray::ResetFieldData() - { - TRACER_AUTO; - const TInt count = iFieldArray.Count(); - - for(TInt i = 0; i < count; ++i) - { - TInt len = iFieldArray[i]->FieldData().Length() ; - if ( len > 0) - { - iFieldArray[i]->ResetFieldData(); - } - - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::CreateUiFieldsFromArrayL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchFieldArray::CreateUiFieldsFromArrayL(MVIMPSTSearchUiBuilder& aUiBuilder ) - { - TRACER_AUTO; - iUiBuilder = NULL; - iUiBuilder = &aUiBuilder; - - TInt count = Count(); - - for( TInt i = 0 ; i< count; i++ ) - { - MVIMPSTUiSearchField* field = iFieldArray[i]; - - CreateUiFieldsL( *field ); - - } - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::CreateUiFieldsFromArrayL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchFieldArray::CreateUiFieldsL(MVIMPSTUiSearchField& aField ) - { - TRACER_AUTO; - switch( aField.FieldDataType() ) - { - - case EVIMPSTEdwinNumber : - { - // if number field - break; - } - case EVIMPSTEdwinEmail : - { - // if email field - break; - } - - case EVIMPSTEdwinMobile: - { - // if mobile field - break; - } - case EVIMPSTEdwinText : - default: - { - // default field type is text - // Create and insert a line in the dialog - iControl = NULL; - iCaptionedCtrl = NULL; - - iControl = static_cast(iUiBuilder->CreateLineL( aField.FieldLabel(), aField.ControlId(), EEikCtEdwin) ); - - // Control is now owned by the dialog - TInt maxFieldLength = 100 ; - AknEditUtils::ConstructEditingL(iControl, maxFieldLength, - maxFieldLength, EAknEditorTextCase | EAknEditorCharactersUpperCase - | EAknEditorCharactersLowerCase, EAknEditorAlignLeft, - ETrue, ETrue, EFalse); - - iControl->SetAknEditorCase(EAknEditorTextCase); - - // Place cursor to the end of the line - iControl->AddFlagToUserFlags(CEikEdwin::EJustAutoCurEnd); - - HBufC* previousdata = aField.FieldData().AllocLC(); - iControl->SetTextL( previousdata ); - CleanupStack::PopAndDestroy();// previousdata - aField.ResetFieldData(); - - - // CreateTextViewL() is flagged as deprecated but if it is not - // called here the ActivateL() below crashes sometimes. - iControl->CreateTextViewL(); - iCaptionedCtrl = iUiBuilder->LineControl( aField.ControlId() ); - iCaptionedCtrl->SetTakesEnterKey(ETrue); - aField.SetControl( iControl, iCaptionedCtrl ); // onerhip transferd here to field - - aField.ActivateL(); - break; - } - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::SetFocusL -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiSearchFieldArray::SetFocusL(TInt aFieldIndex ) - { - TRACER_AUTO; - if (aFieldIndex >= 0 && aFieldIndex < iFieldArray.Count() && iUiBuilder ) - { - MVIMPSTUiSearchField& field = At( aFieldIndex); - - iUiBuilder->TryChangeFocusL( field.ControlId() ); - } - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::GetFirstEnteredFieldDataL -// ----------------------------------------------------------------------------- -// -TPtrC CVIMPSTUiSearchFieldArray::GetFirstEnteredFieldDataL() - { - TRACER_AUTO; - const TInt count = iFieldArray.Count(); - - for(TInt i = 0; i < count; ++i) - { - TPtrC text = iFieldArray[i]->FieldData() ; - if ( text.Length() > 0) - { - return iFieldArray[i]->FieldData(); - } - - } - return KNullDesC(); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::GetSearchKeyDataL -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiSearchFieldArray::GetSearchKeyDataL(RArray& aKeyDataArray ) - { - TRACER_AUTO; - const TInt count = iFieldArray.Count(); - TPtrC dataPtr(KNullDesC ); - for(TInt i = 0; i < count; ++i) - { - MVIMPSTUiSearchField* field = iFieldArray[i] ; - TPtrC text = field->FieldData() ; - if ( text.Length() > 0) - { - if(field->GetSearchKey() != TVIMPSTEnums::EVIMPSTSearchKeyUknown ) - { - TVIMPSTSearchKeyData data = { - field->GetSearchKey(), - KNullDesC(), - text - }; - - aKeyDataArray.Append(data); - } - else - { - TPtrC label = field->FieldLabel() ; - TVIMPSTSearchKeyData data = { - field->GetSearchKey(), - label, - text - }; - aKeyDataArray.Append(data ); - - } - } - - } - - } - - // ----------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::RemoveField -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiSearchFieldArray::RemoveField(TInt aIndex ) - { - iFieldArray.Remove(aIndex); - iFieldArray.Compress(); - } - - // ----------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::InsertField -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiSearchFieldArray::InsertField(MVIMPSTUiSearchField* aField , TInt aIndex ) - { - iFieldArray.Insert(aField ,aIndex); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::GetSearchType -// ----------------------------------------------------------------------------- -// -TIMPSTSearchFieldTypes CVIMPSTUiSearchFieldArray::GetSearchType() - { - return iSelectedSearchType; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchFieldArray::SetSearchType -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiSearchFieldArray::SetSearchType(TIMPSTSearchFieldTypes aType) - { - iSelectedSearchType = aType; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuisearchquerydialog.cpp --- a/uiservicetab/vimpstui/src/cvimpstuisearchquerydialog.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,512 +0,0 @@ -/* -* Copyright (c) 2008 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: search fields editor implementation -* -*/ - - -// INCLUDE FILES -#include "cvimpstuisearchquerydialog.h" - -#include "cvimpstuisearchfieldaray.h" -#include "vimpstui.hrh" -#include "vimpstutils.h" -// resource -#include - -// System includes -#include -#include -#include -#include -#include -#include -#include -#include "uiservicetabtracer.h" - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::CVIMPSTUiSearchQueryDialog -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchQueryDialog::CVIMPSTUiSearchQueryDialog(CVIMPSTUiSearchFieldArray& aUiFieldArray ) - : iUiFieldArray( aUiFieldArray ) - { - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::~CVIMPSTUiSearchQueryDialog -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchQueryDialog::~CVIMPSTUiSearchQueryDialog() - { - // Restore the titlepane text - if (iTitlePane && iStoredTitlePaneText) - { - // iTitlePane takes ownership of iStoredTitlePaneText - TRAP_IGNORE( iTitlePane->SetTextL( iStoredTitlePaneText->Des() ) ); - delete iStoredTitlePaneText; - } - // Remove empty status pane - if (iNaviContainer) - { - iNaviContainer->Pop(); - } - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchQueryDialog* CVIMPSTUiSearchQueryDialog::NewL(CVIMPSTUiSearchFieldArray& aUiFieldArray ) - { - CVIMPSTUiSearchQueryDialog* self = - new ( ELeave ) CVIMPSTUiSearchQueryDialog(aUiFieldArray); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::ConstructL() - { - TRACER_AUTO; - CAknDialog::ConstructL(R_SEARCH_EDITOR_MENUBAR); - - StoreTitlePaneTextL(); - - ConstructNaviPaneL(); - - iSearchType = iUiFieldArray.GetSearchType(); - - if( !IsBasicFieldAvailableL() ) - { - iSearchType = EIMAdvancedSearch ; - iUiFieldArray.SetSearchType( EIMAdvancedSearch ); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::ExecuteLD -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::ExecuteLD() - { - TRACER_AUTO; - CleanupStack::PushL( this ); - - // Set status pane layout to the Phonebook 2 one - CEikStatusPane* statusPane = iAvkonAppUi->StatusPane(); - if (statusPane) - { - statusPane->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL); - } - CleanupStack::Pop( this ); - - CAknForm::ExecuteLD(R_SEARCH_ENTRY_DIALOG); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::OfferKeyEventL -// -------------------------------------------------------------------------- -// -TKeyResponse CVIMPSTUiSearchQueryDialog::OfferKeyEventL - ( const TKeyEvent& aKeyEvent, TEventCode aType ) - { - TRACER_AUTO; - TKeyResponse ret(EKeyWasNotConsumed); - - ret = CAknForm::OfferKeyEventL( aKeyEvent, aType ); - isEndKeyPressed = ETrue; - if ( ret == EKeyWasConsumed && aKeyEvent.iCode != EKeyEscape ) - { - isEndKeyPressed = EFalse; - UpdateCbasL(); - } - return ret; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::PreLayoutDynInitL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::PreLayoutDynInitL() - { - SetEditableL(ETrue); - - iUiFieldArray.CreateUiFieldsFromArrayL( *this ); - - ShowSearchUiFieldsL(); - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::PostLayoutDynInitL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::PostLayoutDynInitL() - { - UpdateTitleL(); - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::SetInitialCurrentLineL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::SetInitialCurrentLineL() - { - ActivateFirstPageL(); - - CAknForm::SetInitialCurrentLine(); - - iUiFieldArray.SetFocusL(0); - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::OkToExitL -// -------------------------------------------------------------------------- -// -TBool CVIMPSTUiSearchQueryDialog::OkToExitL( TInt aKeycode ) - { - TRACER_AUTO; - TBool ret = EFalse; - switch( aKeycode ) - { - case EAknSoftkeyEmpty : - { - ret = EFalse; - break; - } - case EEikCmdExit : - case EAknSoftkeyExit : - case EAknSoftkeyCancel : - { - ret = ETrue; - break; - } - case EAknSoftkeyDone : - case EAknSoftkeyOk : - { - CmdDoneL( ); - ret = ETrue; - break; - } - - case EBasicSearch : - { - iSearchType = EIMBasicSearch; - ShowSearchUiFieldsL(); - UpdateTitleL(); - ret = EFalse; - break; - } - case EAdvancedSearch : - { - iSearchType = EIMAdvancedSearch ; - ShowSearchUiFieldsL(); - UpdateTitleL(); - ret = EFalse; - break; - } - default : - { - ret = CAknForm::OkToExitL( aKeycode ) ; - } - } - iUiFieldArray.SetSearchType( iSearchType ); - UpdateCbasL(); - return ret; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::CreateLineL -// -------------------------------------------------------------------------- -// -CCoeControl* CVIMPSTUiSearchQueryDialog::CreateLineL - ( const TDesC& aCaption, TInt aControlId, TInt aControlType ) - { - return CreateLineByTypeL( aCaption, aControlId, aControlType, NULL ); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::LineControl -// -------------------------------------------------------------------------- -// -CEikCaptionedControl* CVIMPSTUiSearchQueryDialog::LineControl - ( TInt aControlId ) const - { - return Line( aControlId ); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::SetEditableL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::SetEditableL( TBool aState ) - { - CAknForm::SetEditableL( aState ); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::AreAllControlsEmptyL -// -------------------------------------------------------------------------- -// -TBool CVIMPSTUiSearchQueryDialog::AreAllControlsEmptyL() const - { - // before saving entered data - return iUiFieldArray.AreAllUiControlsEmptyL(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::ConstructContextMenuL -// -------------------------------------------------------------------------- -// -inline void CVIMPSTUiSearchQueryDialog::ConstructContextMenuL() - { - TRACER_AUTO; - CEikMenuBar* newMenuBar = new ( ELeave ) CEikMenuBar(); - CleanupStack::PushL( newMenuBar ); - newMenuBar->ConstructL - ( this, NULL, R_SEARCH_EDITOR_CONTEXT_MENUBAR ); - iEikonEnv->EikAppUi()->AddToStackL( newMenuBar, ECoeStackPriorityMenu, - ECoeStackFlagRefusesFocus ); - iContextMenuBar = newMenuBar; - CleanupStack::Pop( newMenuBar ); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::ConstructNaviPaneL -// -------------------------------------------------------------------------- -// -inline void CVIMPSTUiSearchQueryDialog::ConstructNaviPaneL() - { - TRACER_AUTO; - CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane(); - if (statusPane && statusPane->PaneCapabilities - ( TUid::Uid( EEikStatusPaneUidNavi ) ).IsPresent() ) - { - // Create a default empty status pane, otherwise sync field will show - iNaviContainer = static_cast - ( statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - iNaviContainer->PushDefaultL(); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::UpdateTitleL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::UpdateTitleL() - { - if (iTitlePane) - { - HBufC* titleText = NULL; - if( iSearchType == EIMBasicSearch ) - { - titleText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_BASIC ); - iTitlePane->SetTextL( *titleText ); - } - else - { - titleText = VIMPSTUtils::LoadResourceL( R_QTN_SERVTAB_SEARCH_ADVANCED ); - iTitlePane->SetTextL( *titleText); - } - delete titleText; - DrawNow(); - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::CmdDoneL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::CmdDoneL( ) - { - TInt count = iUiFieldArray.Count(); - for( TInt i = 0; i< count ; i++ ) - { - HBufC* data = iUiFieldArray.At(i).ControlTextL() ; - if(data) - { - iUiFieldArray.At(i).SetFieldDataL( *data ) ; - delete data; - } - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::TryChangeFocusL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::TryChangeFocusL( - TInt aControlId ) - { - if ( ControlOrNull( aControlId ) ) - { - TryChangeFocusToL( aControlId ); - } - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::SetCurrentLineCaptionL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::SetCurrentLineCaptionL( - const TDesC& aText ) - { - SetControlCaptionL(IdOfFocusControl(), aText); - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::Control -// -------------------------------------------------------------------------- -// -CCoeControl* CVIMPSTUiSearchQueryDialog::Control( - TInt aControlId ) const - { - return ControlOrNull(aControlId); - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::StoreTitlePaneTextL -// -------------------------------------------------------------------------- -// -inline void CVIMPSTUiSearchQueryDialog::StoreTitlePaneTextL() - { - CEikStatusPane* statusPane = iEikonEnv->AppUiFactory()->StatusPane(); - if (statusPane && statusPane->PaneCapabilities( - TUid::Uid(EEikStatusPaneUidTitle)).IsPresent()) - { - iTitlePane = static_cast - (statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle))); - if (iTitlePane->Text()) - { - iStoredTitlePaneText = iTitlePane->Text()->AllocL(); - } - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::UpdateCbasL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::UpdateCbasL() - { - TRACER_AUTO; - if ( !AreAllControlsEmptyL() ) - { - if ( iCbaCommandSet != R_AVKON_SOFTKEYS_OK_CANCEL__OK ) - { - SetCbaCommandSetL( R_AVKON_SOFTKEYS_OK_CANCEL__OK ); - } - } - else - { - if( iSearchType == EIMBasicSearch && iCbaCommandSet != R_SEARCH_SOFTKEYS_ADVANCED_CANCEL__EDIT ) - { - SetCbaCommandSetL( R_SEARCH_SOFTKEYS_ADVANCED_CANCEL__EDIT ); - } - else if( iSearchType == EIMAdvancedSearch && iCbaCommandSet != R_SEARCH_SOFTKEYS_BASIC_CANCEL__EDIT ) - { - SetCbaCommandSetL( R_SEARCH_SOFTKEYS_BASIC_CANCEL__EDIT ); - } - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::SetCbaCommandSetL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::SetCbaCommandSetL( TInt aResourceId ) - { - TRACER_AUTO; - CEikButtonGroupContainer& cba = ButtonGroupContainer(); - cba.SetCommandSetL( aResourceId ); - iCbaCommandSet = aResourceId; - cba.DrawDeferred(); - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::SetLineDimmed -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::SetLineDimmed( - TInt aControlId , TBool aDimmed) - { - SetLineDimmedNow(aControlId, aDimmed); - } -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::ShowSearchUiFieldsL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchQueryDialog::ShowSearchUiFieldsL() - { - TRACER_AUTO; - TInt count = iUiFieldArray.Count(); - for( TInt i = 0; i< count; i++ ) - { - MVIMPSTUiSearchField& field = iUiFieldArray.At(i); - if( iSearchType == EIMBasicSearch ) - { - if( !field.IsBasicField() ) - { - SetLineDimmed( field.ControlId(), ETrue ); - } - } - else - { - SetLineDimmed( field.ControlId(), EFalse ); - } - } - SetInitialCurrentLineL(); - UpdateCbasL(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::IsBasicFieldAvailableL -// -------------------------------------------------------------------------- -// -TBool CVIMPSTUiSearchQueryDialog::IsBasicFieldAvailableL() - { - TRACER_AUTO; - TInt count = iUiFieldArray.Count(); - for( TInt i = 0; i< count; i++ ) - { - MVIMPSTUiSearchField& field = iUiFieldArray.At(i); - if( field.IsBasicField() ) - { - return ETrue; - } - } - return EFalse; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchQueryDialog::IsEndKeyPressed() -// -------------------------------------------------------------------------- -// -TBool CVIMPSTUiSearchQueryDialog::IsEndKeyPressed() - { - return isEndKeyPressed; - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuisearchview.cpp --- a/uiservicetab/vimpstui/src/cvimpstuisearchview.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,737 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for CVIMPSTUiSearchView. -* -*/ - - -// INCLUDE FILES - -#include "cvimpstuisearchview.h" -#include "cvimpstuisearchviewcontrol.h" - -#include "cvimpstuisearchfieldaray.h" -#include "cvimpstuisearchquerydialog.h" - -#include "cvimpstcmdhandler.h" -#include "vimpstcmd.hrh" - -#include "mvimpstengine.h" -#include "vimpstextentionuiuid.h" -#include "tvimpstconsts.h" -#include "cvimpstuiextensionservice.h" -#include "vimpstutilsdialog.h" -#include "vimpstcmd.hrh" -#include "mvimpstcmd.h" -#include "vimpstutilswaitnote.h" -#include "vimpstui.hrh" -#include "tvimpstconsts.h" - -#include "mvimpstengineextentionfeatures.h" -#include "mvimpstenginesearchmgrextention.h" - -#include "cvimpstuistatuspanehandler.h" -// System includes -#include -#include -#include -#include -#include -#include - -// Pbk2 -#include -#include -#include -#include -#include -#include -#include - -// xSP extension manager -#include "MxSPViewMapper.h" -#include "MxSPContactManager.h" - -//resource -#include -#include - -// System includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "uiservicetabtracer.h" - -// help launch -#include -#include -#include "meco.hlp.hrh" -using namespace Phonebook2; - -// ================= MEMBER FUNCTIONS ======================= - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::CVIMPSTUiSearchView -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchView::CVIMPSTUiSearchView( - MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aSearchViewId, - TUint aServiceId, - CPbk2UIExtensionView& aView, - TUid /*aId*/, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler ) : - CxSPBaseView( aMapper, aContactManager, aView ), - iSearchViewId( aSearchViewId ), - iServiceId(aServiceId), - iEngine(aEngine), - iExtensionService( aServiceData ), - iCommandHandler( aCommandHandler ) - - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchView::ConstructL() - { - TRACER_AUTO; - ViewBaseConstructL( KIMCONTACTSEXTNIMPLEMENTATIONUID, iSearchViewId ); - - //Get SearchMgr - MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::ESearch); - if (feature) - { - MVIMPSTEngineSearchMgrExtention& searchMgr = - MVIMPSTEngineSearchMgrExtention::Cast - (*feature); - - searchMgr.RegisterObserver(this); - } - iCallBack = new ( ELeave ) CAsyncCallBack( CActive::EPriorityHigh ); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchView* CVIMPSTUiSearchView::NewL( MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aSearchViewId, - TUint aServiceId, - CPbk2UIExtensionView& aView, - TUid aId, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler ) - { - CVIMPSTUiSearchView* self = new(ELeave) CVIMPSTUiSearchView( aMapper, - aContactManager, - aSearchViewId, - aServiceId, - aView, - aId, - aServiceData, - aEngine, - aCommandHandler); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - - - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::~CVIMPSTUiSearchView() -// C++ Destructor -// --------------------------------------------------------- -// -CVIMPSTUiSearchView::~CVIMPSTUiSearchView() - { - - //Get SearchMgr - MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::ESearch); - if (feature) - { - MVIMPSTEngineSearchMgrExtention& searchMgr = - MVIMPSTEngineSearchMgrExtention::Cast - (*feature); - - searchMgr.UnRegisterObserver(this); - } - - delete iNaviDecorator; - if (iContainer) - { - CCoeEnv::Static()->AppUi()->RemoveFromStack(iContainer); - delete iContainer; - } - delete iCallBack; - } - - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::HandleCommandL( TInt aCommand ) -// This class handles all commands from menu -// --------------------------------------------------------- -// -void CVIMPSTUiSearchView::HandleCommandL( TInt aCommand ) - { - TRACER_AUTO; - switch ( aCommand ) - { - //Next two commands have same function - case EAknSoftkeyBack: - { - - // this might get called when the view is not active - // back key pressed, activate tabbed view. - // CPbk2ViewState is not utilized here, but here the - // focused contact info could be delivered to next view, if required later - CPbk2ViewState* state = NULL; - - TInt tabViewId; - TInt err = iMapper.GetNewView( KIMCONTACTSEXTNIMPLEMENTATIONUID, - iExtensionService.TabbedViewId(), - tabViewId ); - User::LeaveIfError( err ); - Pbk2AppUi()->Pbk2ViewExplorer()->ActivatePhonebook2ViewL( - TUid::Uid(tabViewId), - state ); - - break; - } - - case ESearchNew: - { - SearchContactsL(); - break; - } - case ESearchPrev: - { - CAknInformationNote* informationNote = new (ELeave) CAknInformationNote; - informationNote->ExecuteLD(KNotSupportedMessage); - break; - } - case ESearchMore: - { - CAknInformationNote* informationNote = new (ELeave) CAknInformationNote; - informationNote->ExecuteLD(KNotSupportedMessage); - break; - } - case ESearchAddFriends: - { - - HBufC* userId = iContainer->GetFocusedContactLC() ; - if ( userId->Length() ) - { - CVIMPSTUtilsWaitNote* note = CVIMPSTUtilsWaitNote::ShowWaitNoteLC( R_QTN_SERVTAB_SAVING_CONTACT,ETrue ); - iCommandHandler.HandleCommandL(EAddContact,this,userId); - CleanupStack::PopAndDestroy( note ); - CleanupStack::PopAndDestroy( userId ); - } - - break; - } - - case ESearchOpenConversation: - { - HBufC* userId = iContainer->GetFocusedContactLC() ; - if ( userId->Length() ) - { - iContainer->OpenConversationL( *userId ); - } - CleanupStack::PopAndDestroy( userId ); - break; - } - case EAknCmdHelp: - { - LaunchHelpL( KSERVTAB_HLP_SEARCH ); - break; - } - case EAknSoftkeyExit: - case ECmdExit: - { - Pbk2AppUi()->HandleCommandL( EAknSoftkeyExit ); - break; - } - - default: - { - Pbk2AppUi()->HandleCommandL( aCommand ); - break; - } - - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::DynInitMenuPaneL() -// Initialises menu pane when needed -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSearchView::DynInitMenuPaneL( TInt aResourceId, - CEikMenuPane* aMenuPane ) - { - TRACER_AUTO; - if( aResourceId == R_EXTENSION_MANAGER_MENU) - { - //add search view menu items - aMenuPane->AddMenuItemsL( R_SERVTAB_SEARCH_VIEW_MENU ); - //add general menu items - help and exit - aMenuPane->AddMenuItemsL( R_TABBED_VIEW_GENERAL_MENU ); - - aMenuPane->SetItemDimmed(ECmdChangeConnectioninWaitingState,ETrue); - aMenuPane->SetItemDimmed(ECmdChangeConnectioninOnlineState,ETrue); - - aMenuPane->SetItemDimmed(ECmdLogin,ETrue); - aMenuPane->SetItemDimmed(ECmdLogout,ETrue); - aMenuPane->SetItemDimmed(ECmdCancelLogin,ETrue); - aMenuPane->SetItemDimmed(ECmdSettings,ETrue); - - aMenuPane->SetItemDimmed(ESearchPrev, ETrue); - aMenuPane->SetItemDimmed(ESearchMore, ETrue); - aMenuPane->SetItemDimmed(ECmdGetBlockedList, ETrue); - TInt index = KErrNotFound; - if(iContainer) - { - index = iContainer->ListBox()->CurrentItemIndex(); - } - if( index == KErrNotFound ) - { - aMenuPane->SetItemDimmed( ESearchAddFriends, ETrue ); - aMenuPane->SetItemDimmed( ESearchOpenConversation, ETrue ); - } - else if( HideAddToContactsL()) //contact is there in his contact list - { - HBufC* contactId = iContainer->GetFocusedContactLC() ; - TVIMPSTEnums::TOnlineStatus onlinestatus = TVIMPSTEnums::EUnknown; - if ( contactId->Length() ) - { - TInt index = iCommandHandler.GetProcessInterface().FindContactIndexL(*contactId); - onlinestatus = iCommandHandler.GetProcessInterface().GetOnlineStatusL(index); - CleanupStack::PopAndDestroy(contactId); - } - if( TVIMPSTEnums::EPending == onlinestatus )//contacts pr status is pending hide open convrsation - { - aMenuPane->SetItemDimmed( ESearchOpenConversation, ETrue ); - } - aMenuPane->SetItemDimmed( ESearchAddFriends, ETrue ); - - } - - else //contact is not there in his contactlist - { - aMenuPane->SetItemDimmed( ESearchOpenConversation, ETrue ); - } - - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::DoActivateViewL() -// Activates view -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSearchView::DoActivateViewL( const TVwsViewId& aPrevViewId, - TUid /*aCustomMessageId*/, - const TDesC8& /*aCustomMessage*/ ) - { - TRACER_AUTO; - // the title pane is set to " Basic Search" - // which is same as Search Form s title pane text - - HBufC* titleText = StringLoader::LoadLC( R_QTN_SERVTAB_SEARCH_BASIC ); - - //to set the icon ( context pane image) as in tabbed view - MPbk2ViewActivationTransaction* viewActivationTransaction = - Pbk2AppUi()->Pbk2ViewExplorer()->HandleViewActivationLC( - iView.Id(), - aPrevViewId, - titleText, - NULL, - EUpdateAll ); - - - // Notifies startup monitor of view activation - if( Pbk2AppUi()->Pbk2StartupMonitor() ) - { - Pbk2AppUi()->Pbk2StartupMonitor()-> - NotifyViewActivationL( iView.Id() ); - } - - if (!iContainer) - { - iContainer = CVIMPSTUiSearchViewControl::NewL( - &iView, iServiceId, - iEngine, iCommandHandler, *this ); - CCoeEnv::Static()->AppUi()->AddToStackL( iView, iContainer ); - iContainer->SetMopParent( &iView ); - iContainer->SetSearchingTextToListboxL(); - iContainer->SetRect( iView.ClientRect() ); - iContainer->ActivateL(); - } - - // Commit application-wide state changes - viewActivationTransaction->Commit(); - CleanupStack::PopAndDestroy(2); //viewActivationTransaction ,titleText - - // Change the navigation pane from tabs to text label - UpdateNaviPaneTextL(); - - // this is initiated from tabbed view ; hence call search functionality - if (!iSearchInitiated) - { - // search is called using CAsynCallBack - iCallBack->Set(TCallBack( SearchCallbackL , this)); - iCallBack->CallBack(); - } - - - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::DoDeactivate() -// Deactivates the view -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSearchView::DoDeactivate() - { - TRACER_AUTO; - // set this flag to Efalse because user cant initiate a search from search view - iSearchInitiated = EFalse; - if (iContainer) - { - CCoeEnv::Static()->AppUi()->RemoveFromStack( iContainer ); - delete iContainer; - iContainer = NULL; - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::HandleCommandKeyL -// -------------------------------------------------------------------------- -// -TBool CVIMPSTUiSearchView::HandleCommandKeyL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/) - { - TBool result = EFalse; - switch (aKeyEvent.iCode) - { - default: - { - break; - } - } - return result; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::HandleStatusPaneSizeChange -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchView::HandleStatusPaneSizeChange() - { - // Resize the container to fill the client rectangle - if (iContainer) - { - iContainer->SetRect( iView.ClientRect() ); - } - } - - - // -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::CommandFinishedL -// -------------------------------------------------------------------------- -// - -void CVIMPSTUiSearchView::CommandFinishedL( - const MVIMPSTCmd& aCommand ) -{ - TRACER_AUTO; - //handle the observer for commands issues through HandleCommandL() - - switch (aCommand.CommandId()) - { - - case ESearch: - { - // Search command is complete - //use aCommand.Result() to get the data - //Ownership is not given to the caller - //some error occured. - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - if(aCommand.Result() != KErrNone) - { - HBufC* prompt = NULL; - prompt = StringLoader::LoadLC(R_IM_ERROR_SERVICE_ERR ); - TInt ret( VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ); - CleanupStack::PopAndDestroy(prompt); - } - break; - } - case EAddContact: - { - //addcontact command is complete - //use aCommand.Result() to get the data - //Ownership is not given to the caller - //some error occured. - if(aCommand.Result() != KErrNone) - { - HBufC* prompt = StringLoader::LoadLC( R_QTN_SERVTAB_SAVING_CONTACT_FAILED ); - VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ; - CleanupStack::PopAndDestroy(prompt); - } - - break; - } - default: - { - //should never be here. - break; - } - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::HandleCommandEventL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchView::HandleCommandEventL(TVIMPSTEnums::TVIMPSTRegistrationState /*aState*/, TInt /*aServiceError*/) - { - - } -// --------------------------------------------------------- -// CVIMPSTUiSearchView::ShowAddToContactsL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CVIMPSTUiSearchView::HideAddToContactsL() const - { - TRACER_AUTO; - TBool hide(ETrue); - TInt curIndex = iContainer->ListBox()->CurrentItemIndex(); - if( curIndex >=0) - { - HBufC* contactId = iContainer->GetFocusedContactLC() ; - if ( contactId->Length() ) - { - hide = iCommandHandler.GetProcessInterface().FindAnyContact( *contactId ); - CleanupStack::PopAndDestroy( contactId ); - } - - } - return hide; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchView::SearchContactsL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchView:: SearchContactsL() - { - TRACER_AUTO; - if( iContainer ) - { - iContainer->UpdateCbaL( ETrue ); - } - - CVIMPSTUiSearchFieldArray& fieldArray = iExtensionService.GetSearchFieldArray(); - - if( !fieldArray.Count() ) - { - return; - } - - CVIMPSTUiSearchQueryDialog* querydialog = CVIMPSTUiSearchQueryDialog::NewL( fieldArray ); - - - - if (querydialog) - { - querydialog->ExecuteLD(); - iEndKeyPressed = querydialog->IsEndKeyPressed(); - } - - // we have to set the title pane with " Search results " string - CCVIMPSTUiStatusPaneHandler* StatusPaneHandler = CCVIMPSTUiStatusPaneHandler::NewL(); - CleanupStack::PushL( StatusPaneHandler); - HBufC* titleText = StringLoader::LoadLC( R_QTN_SERVTAB_SEARCH_RESULTS ); - StatusPaneHandler->SetTextL(*titleText); - CleanupStack::PopAndDestroy( 2 ); // - - - if( !fieldArray.AreAllUiFieldsEmpty() ) - { - // make this flag as True - // from now search is initiated from search view - iSearchInitiated = ETrue; - - // if any field is entered - // launch the search view - HBufC* firstDataBuf = fieldArray.GetFirstEnteredFieldDataL().AllocLC(); - TPtr searchStrPtr( firstDataBuf->Des() ); - - iExtensionService.SetSearchStringL( searchStrPtr ); - UpdateNaviPaneTextL(); - if ( iContainer) - { - if ( iContainer->ListBox()->Model()->NumberOfItems() > 0 ) - { - iContainer->ClearListBoxContents(); - } - // set the empty string blank - iContainer->SetSearchingTextToListboxL(); - } - HBufC* searchWaitNoteText = StringLoader::LoadLC( R_QTN_SERVTAB_SEARCHING , searchStrPtr, CCoeEnv::Static() ); - iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( *searchWaitNoteText, EFalse , ETrue ); - CleanupStack::PopAndDestroy(searchWaitNoteText); - //searchWaitNoteText - RArray keyDataArray; - fieldArray.GetSearchKeyDataL( keyDataArray ); - - iCommandHandler.HandleCommandL(ESearch, this, &keyDataArray ); - CleanupStack::PopAndDestroy(); // firstDataBuf - - } - - // if the serach is initiated from tabbed view and User cancels the search - // return to Tabbed view - if ( !iSearchInitiated && !iEndKeyPressed) - { - // return to tabbed view - CPbk2ViewState* state = NULL; - - TInt tabViewId; - TInt err = iMapper.GetNewView( KIMCONTACTSEXTNIMPLEMENTATIONUID, - iExtensionService.TabbedViewId(), - tabViewId ); - User::LeaveIfError( err ); - Pbk2AppUi()->Pbk2ViewExplorer()->ActivatePhonebook2ViewL( - TUid::Uid(tabViewId), - state ); - } - } - - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::UpdateNaviPaneTextL() -// --------------------------------------------------------- -// -void CVIMPSTUiSearchView::UpdateNaviPaneTextL( ) - { - TRACER_AUTO; - // Change the navigation pane from tabs to text label - CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane(); - CAknNavigationControlContainer* np = - static_cast( - sp->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - delete iNaviDecorator; - iNaviDecorator = NULL; - //fix for disableing navigation search string text, makeing it null - iNaviDecorator = np->CreateNavigationLabelL( _L(" ") ); - //previous code commented for reference - //iNaviDecorator = np->CreateNavigationLabelL( iExtensionService.SearchString() ); - - np->PushL( *iNaviDecorator ); - sp->DrawNow(); - } - - // --------------------------------------------------------- -// CVIMPSTUiSearchView::HandleSearchResultL() -// --------------------------------------------------------- -// -void CVIMPSTUiSearchView::HandleSearchResultL(RArray aSearchData ) - { - if( iContainer ) - { - iContainer->SearchResultL( aSearchData ); - } - } - - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::HandleSearchFinishedL() -// --------------------------------------------------------- -// -void CVIMPSTUiSearchView::HandleSearchFinishedL(TInt aError) - { - // if any error show error note - if( iContainer ) - { - iContainer->SearchFinishedL(aError); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::HandleSearchKeysEventL() -// --------------------------------------------------------- -// -void CVIMPSTUiSearchView::HandleSearchKeysEventL( RArray& /*aEnumKeysArray*/, RPointerArray& /*aLebelKeysArray*/ ) - { - // do nothing here - } -// --------------------------------------------------------- -// CVIMPSTUiSearchView::LaunchHelpL() -// Function launches help application using the HlpLauncher. -// @params: Reference to a descriptor, serves as context. -// --------------------------------------------------------- -// -void CVIMPSTUiSearchView::LaunchHelpL( const TDesC& aContext ) - { - TRACER_AUTO; - CArrayFix< TCoeHelpContext >* cntx = new( ELeave ) CArrayFixFlat< TCoeHelpContext >( KHelpContextSize ); - CleanupStack::PushL( cntx ); - - TUid KHelpUid = { KHELPUID }; - cntx->AppendL( TCoeHelpContext( KHelpUid, aContext ) ); - CleanupStack::Pop( cntx ); - - //and launch help - takes ownership of context array - HlpLauncher::LaunchHelpApplicationL( CEikonEnv::Static()->WsSession(), cntx ); - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::SearchCallbackL() -// --------------------------------------------------------- -// -TInt CVIMPSTUiSearchView::SearchCallbackL(TAny* aInstance) - { - TRACER_AUTO; - static_cast (aInstance)->SearchContactsL(); - return 0; // ignored by CAsychCallBack - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuisearchviewcontrol.cpp --- a/uiservicetab/vimpstui/src/cvimpstuisearchviewcontrol.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,589 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for CVIMPSTUiSearchViewControl. -* -*/ - - - -// INCLUDE FILES -#include "cvimpstuisearchviewcontrol.h" - -#include "mvimpstcmdhandler.h" -#include "vimpstutils.h" -#include "tvimpstconsts.h" -#include "mvimpstengine.h" -#include "cvimpstuisearchview.h" -#include "vimpstui.hrh" -#include "vimpstutilsdialog.h" -#include "uiservicetabtracer.h" -// imlauncher -#include - - -// system include -#include -#include -#include -#include -#include - -// Pbk2 -#include -#include - - - -// ================= MEMBER FUNCTIONS ======================= - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchViewControl::CVIMPSTUiSearchViewControl -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchViewControl::CVIMPSTUiSearchViewControl( MPbk2KeyEventHandler* aKeyEventHandler, - TUint32 aServiceId, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler, - CVIMPSTUiSearchView& aSearchView ) - :iKeyEventHandler(aKeyEventHandler), - iServiceId(aServiceId), - iEngine( aEngine ), - iCommandHandler( aCommandHandler ), - iSearchView( aSearchView ) - { - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchViewControl::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::ConstructL() - { - CreateWindowL(); - iItemArray = new ( ELeave ) CDesCArrayFlat( KArrayGranularity ); - // Create listbox - iListBox = new ( ELeave ) CAknDoubleStyleListBox; - iListBox->ConstructL( this, EAknListBoxSelectionList ); - - //iListBox->SetListBoxObserver( this ); - - iListBox->SetContainerWindowL(*this); - iListBox->CreateScrollBarFrameL(ETrue); - iListBox->ScrollBarFrame()->SetScrollBarVisibilityL - (CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); - - // set marquee on - iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue ); - iListBox->Model()->SetItemTextArray( iItemArray ); - iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); - - iListBox->SetListBoxObserver( this ); - - ActivateL(); - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchViewControl::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchViewControl* CVIMPSTUiSearchViewControl::NewL - ( MPbk2KeyEventHandler* aKeyEventHandler, - TUint32 aServiceId, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler, - CVIMPSTUiSearchView& aSearchView ) - { - CVIMPSTUiSearchViewControl* self = NewLC(aKeyEventHandler, - aServiceId, aEngine, - aCommandHandler, aSearchView ); - CleanupStack::Pop(self); - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSearchViewControl::NewLC -// -------------------------------------------------------------------------- -// -CVIMPSTUiSearchViewControl* CVIMPSTUiSearchViewControl::NewLC - ( MPbk2KeyEventHandler* aKeyEventHandler, - TUint32 aServiceId, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler, - CVIMPSTUiSearchView& aSearchView ) - { - CVIMPSTUiSearchViewControl* self = - new (ELeave) CVIMPSTUiSearchViewControl(aKeyEventHandler, - aServiceId, aEngine, - aCommandHandler, aSearchView); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSearchViewControl::Destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTUiSearchViewControl::~CVIMPSTUiSearchViewControl() - { - - delete iItemArray; - delete iListBox; - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::SearchResultL() -// --------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::SearchResultL(RArray aSearchData ) - { - UpdateListBoxL(aSearchData); - } - - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::SearchFinishedL() -// --------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::SearchFinishedL(TInt /*aError*/) - { - // if any error show error note - if( ! iItemArray->Count() ) - { - SetEmptyTextsToListboxL(); - iListBox->DrawNow(); - } - UpdateCbaL(); - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::HandleControlEventL -// --------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent aEventType) - { - // We only observe iFindbox - if( EEventStateChanged == aEventType ) - { - - ((CAknFilteredTextListBoxModel*) iListBox->Model() ) - ->Filter()->HandleOfferkeyEventL(); - - } - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiSearchViewControl::SetEmptyTextsToListboxL() -// See header for details. -// --------------------------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::SetEmptyTextsToListboxL() - { - HBufC* emptyFinal = VIMPSTUtils::CombineStringFromResourceLC - ( R_QTN_CHAT_EMPTY_SEARCH_PRIMARY, - R_QTN_CHAT_EMPTY_SEARCH); - - iListBox->View()->SetListEmptyTextL( *emptyFinal ); - CleanupStack::PopAndDestroy(); // emptyFinal - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiSearchViewControl::SetSearchingTextToListboxL() -// See header for details. -// --------------------------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::SetSearchingTextToListboxL() - { - iListBox->View()->SetListEmptyTextL( KSpace ); - iListBox->DrawNow(); - } - - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::HandleListBoxEventL -// Handles list box events -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::HandleListBoxEventL( CEikListBox* /*aListBox*/, - TListBoxEvent aEventType ) - { - TRACER_AUTO; - switch(aEventType) - { - - case EEventItemSingleClicked: - - { - TInt curIndex = iListBox->CurrentItemIndex(); - if( curIndex >=0) - { - HBufC* contactId = GetFocusedContactLC() ; - - if ( contactId->Length() ) - { - if( iCommandHandler.GetProcessInterface().FindAnyContact( *contactId ) ) - { - //contact is already there in contact list - TInt index = iCommandHandler.GetProcessInterface().FindContactIndexL(*contactId); - TVIMPSTEnums::TOnlineStatus onlinestatus = iCommandHandler.GetProcessInterface().GetOnlineStatusL(index); - if(TVIMPSTEnums::EPending != onlinestatus) //if contact is not remote pending - { - //open conversation view - OpenConversationL( *contactId ); - } - - } - else - { - //ask the query for adding contact - HBufC* queryTxt = StringLoader::LoadLC( R_QTN_CHAT_REACTIVE_ADD_LIST, *contactId ); - TInt response = VIMPSTUtilsDialog::DisplayQueryDialogL( - R_GENERIC_YES_NO_CONFIRMATION_QUERY, - *queryTxt ); - - if ( ( response == EAknSoftkeyOk ) || ( response == EAknSoftkeyYes ) ) - { - iSearchView.HandleCommandL( ESearchAddFriends ); - } - CleanupStack::PopAndDestroy( queryTxt ); - } - } - CleanupStack::PopAndDestroy( contactId ); - } - break; - } - // Add enter key handling - case EEventEnterKeyPressed: - { - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - TInt commandId( iCba->ButtonGroup()->CommandId( CEikButtonGroupContainer::EMiddleSoftkeyPosition)); - - iSearchView.HandleCommandL(commandId); - break; - } - } - UpdateCbaL(); - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::OpenConversationL( -// (other items were commented in a header). -// --------------------------------------------------------- -void CVIMPSTUiSearchViewControl::OpenConversationL(const TDesC& aContactId ) - { - TRACER_AUTO; - MVIMPSTProcessArray& arrayProcess = iCommandHandler.GetProcessInterface(); - TInt indexInTabbedView = arrayProcess.FindContactIndexL( aContactId ); - TInt result = EAknSoftkeyOk; - - //get the status from engine. - TVIMPSTEnums::TOnlineStatus status = arrayProcess.GetOnlineStatusL(indexInTabbedView); - - if( status == TVIMPSTEnums::EOffline ) - { - TBool isConvExist = arrayProcess.IsConversationExistL( aContactId ); - - if( !isConvExist) - { - - HBufC* msg = StringLoader::LoadLC( R_QTN_CHAT_CONTACT_MAY_NOT_RECEIVE_MESSAGE, - aContactId ); - - result = VIMPSTUtilsDialog::DisplayQueryDialogL( - R_CHAT_CONTACT_MAY_NOT_RECEIVE_MESSAGE_DIALOG, - msg->Des() ); - CleanupStack::PopAndDestroy( msg ); - } - } - - if( ( result == EAknSoftkeyOk ) || ( result == EAknSoftkeyYes ) ) - { - TVwsViewId activeViewId; - CCoeEnv::Static()->AppUi()->GetActiveViewId( activeViewId ); - TPtrC itemName = arrayProcess.GetItemNameText(indexInTabbedView) ; - // not own this p - MVPbkContactLink* contactLink = arrayProcess.ContactLink( indexInTabbedView ); - arrayProcess.ResetPendingMsg( indexInTabbedView ); - // imlauncher call for luanching the conversationview with seletced contact - //IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, aContactId ); - // imlauncher call for luanching the conversationview with seletced user id - IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, aContactId, itemName, contactLink); - } - } - - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::SizeChanged() -// Called by framework -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::SizeChanged() - { - TRACER_AUTO; - if ( iListBox ) - { - iListBox->SetRect(Rect()); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::CountComponentControls() -// Returns number of controls -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CVIMPSTUiSearchViewControl::CountComponentControls() const - { - //Only one compound control so returning 1 - return 1; - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::ComponentControl( TInt aIndex ) -// Returns control for given index -// (other items were commented in a header). -// --------------------------------------------------------- -// -CCoeControl* CVIMPSTUiSearchViewControl::ComponentControl( TInt aIndex ) const - { - if( aIndex == 0 ) - { - return iListBox; - } - else - { - return NULL; - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::OfferKeyEventL() -// Handles user key inputs -// (other items were commented in a header). -// --------------------------------------------------------- -// -TKeyResponse CVIMPSTUiSearchViewControl::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - TRACER_AUTO; - TKeyResponse result = EKeyWasNotConsumed; - - // Offer key event first to the key event handler - if ( iKeyEventHandler && iKeyEventHandler->Pbk2ProcessKeyEventL - ( aKeyEvent, aType ) ) - { - result = EKeyWasConsumed; - } - - switch ( aKeyEvent.iCode ) - { - /* case EKeyEnter: - { - iSearchView.HandleCommandL(iCurrentCmdToExe); - result = EKeyWasConsumed; - break; - }*/ - default: - break; - } - - // Not consumed by the key handler, offer to the control next - if ( result == EKeyWasNotConsumed ) - { - if ( iListBox ) - { - result = iListBox->OfferKeyEventL(aKeyEvent, aType); - } - } - UpdateCbaL(); - return result; - - } - - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::UpdateListBoxL() -// --------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::UpdateListBoxL(RArray aSerachData) - { - TRACER_AUTO; - TInt granularity( iItemArray->Count() ); - ++granularity; - - CDesCArray* tempArray = new ( ELeave ) CDesCArrayFlat( granularity ); - CleanupStack::PushL( tempArray ); - - iListBox->Model()->SetItemTextArray( tempArray ); - iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); - iListBox->HandleItemAdditionL(); - for ( TInt i =0; i < aSerachData.Count() ; ++ i) - { - TVIMPSTSearchData data = aSerachData [i]; - HBufC* itemText = HBufC::NewLC( 100 ); - TPtr itemTextPtr( itemText->Des() ); - - itemTextPtr.Append( KTab ); - - itemTextPtr.Append( VIMPSTUtils::DisplayId( data.iEmailId )); - itemTextPtr.Append( KTab ); - - itemTextPtr.Append(data.iEmailId); - itemTextPtr.Append( KTab ); - - iItemArray->AppendL( itemTextPtr ); - CleanupStack::PopAndDestroy( itemText ); - } - - CleanupStack::PopAndDestroy(tempArray ); // tempArray - - - iListBox->Model()->SetItemTextArray( iItemArray ); - iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray ); - - iListBox->HandleItemAdditionL(); - - if ( iItemArray->MdcaCount() > 0 ) - { - iListBox->SetCurrentItemIndexAndDraw( 0 ); - } - - iListBox->UpdateScrollBarsL(); - - UpdateCbaL(); - - } - - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::ListBox() -// (other items were commented in a header). -// --------------------------------------------------------- -// -CEikListBox* CVIMPSTUiSearchViewControl::ListBox() const - { - return iListBox; - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::GetFocusedItemText -// (other items were commented in a header). -// --------------------------------------------------------- -// -HBufC* CVIMPSTUiSearchViewControl::GetFocusedContactLC() const - { - TRACER_AUTO; - HBufC* retText=NULL; - TInt curIndex = iListBox->CurrentItemIndex(); - TPtrC ptr= iItemArray->MdcaPoint(curIndex); - ptr.Set(ptr.Mid(1)); // set pointer from next char :since first char is KTab - - TInt pos=ptr.FindC(KTab); - - if( pos !=KErrNotFound && (pos != ptr.Length()-1)) - { - ptr.Set(ptr.Mid( pos+1, ( ptr.Length()-2-pos ))); - retText = ptr.AllocLC(); - } - return retText; - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::ClearListBoxContents() -// --------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::ClearListBoxContents() - { - TRACER_AUTO; - iItemArray->Reset(); - TRAPD( err, iListBox->HandleItemRemovalL() ); - if( err != KErrNone ) - { - CActiveScheduler::Current()->Error( err ); - } - iListBox->DrawNow(); - } -// --------------------------------------------------------- -// CVIMPSTUiSearchViewControl::UpdateCbaL() -// Updates Softkeys according to current focus. -// --------------------------------------------------------- -// -void CVIMPSTUiSearchViewControl::UpdateCbaL( TBool aUseDefaultCba /*= EFalse*/ ) - { - TRACER_AUTO; - TInt cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_BACK__EMPTY; - iCurrentCmdToExe = -1; - TInt index = KErrNotFound; - if ( !iCba ) - { - iCba = CEikButtonGroupContainer::Current(); - } - if( iListBox ) - { - index = iListBox->CurrentItemIndex(); - } - if( aUseDefaultCba ) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_BACK__EMPTY; - } - else if( KErrNotFound == index ) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_NEW_SEARCH__BACK; - iCurrentCmdToExe = ESearchNew; - } - else //some results are there, hence update it to add to contacts. - { - if(iSearchView.HideAddToContactsL()) - { - TRACE(" after" ); - HBufC* contactId = GetFocusedContactLC(); - TInt curIndex = iCommandHandler.GetProcessInterface().FindContactIndexL(*contactId); - TVIMPSTEnums::TOnlineStatus onlinestatus = iCommandHandler.GetProcessInterface().GetOnlineStatusL(curIndex); - CleanupStack::PopAndDestroy(contactId); - if( TVIMPSTEnums::EPending == onlinestatus ) - { - TRACE(" EPending in" ); - cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_BACK__EMPTY; - iCurrentCmdToExe = -1; - } - else - { - TRACE("ESearchOpenConversation" ); - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_SEARCH_OPENCONV__BACK; - iCurrentCmdToExe = ESearchOpenConversation; - } - - } - else - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_ADD_TO_CONTACTS__BACK; - iCurrentCmdToExe = ESearchAddFriends; - } - } - if( iCba ) - { - iCba->SetCommandSetL( cbaRes ); - iCba->DrawNow(); - } - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuisinglelistboxarray.cpp --- a/uiservicetab/vimpstui/src/cvimpstuisinglelistboxarray.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,212 +0,0 @@ -/* -* Copyright (c) 2008 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: CVIMPSTUiArray-array decorator -* -*/ - - -// INCLUDE FILES -#include "cvimpstuisinglelistboxarray.h" -#include "tvimpstconsts.h" -#include "vimpstutils.h" -#include "mvimpstprocessarray.h" -#include -#include "tvimpstenums.h" - -// platform includes - -#include -#include -#include -#include -#include -#include -#include "uiservicetabtracer.h" - -#include - -// ================= MEMBER FUNCTIONS ======================= - -// Two-phased constructor. -CVIMPSTUiSingleListboxArray* CVIMPSTUiSingleListboxArray::NewL(MVIMPSTProcessArray& aItemModel, - CColumnListBoxData* aListboxData, - CVIMPSTUiSingleStyleListBox& aListBox - ) - { - TRACER_AUTO; - CVIMPSTUiSingleListboxArray* self = new (ELeave) CVIMPSTUiSingleListboxArray( aItemModel, - aListboxData, aListBox); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// Destructor -CVIMPSTUiSingleListboxArray::~CVIMPSTUiSingleListboxArray() - { - delete iData; - } - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CVIMPSTUiSingleListboxArray::CVIMPSTUiSingleListboxArray( MVIMPSTProcessArray& aItemModel, - CColumnListBoxData* aListboxData, CVIMPSTUiSingleStyleListBox& aListBox /*= NULL*/) - : - iItemArray(aItemModel), - iListboxData( aListboxData ), - iListBox(aListBox) - { - } - -// Symbian OS default constructor can leave. -void CVIMPSTUiSingleListboxArray::ConstructL() - { - TRACER_AUTO; - // maximum length of icons appended to identification - // There can be four icons (A+B and two on D-column) - iMaxLengthOfIcons = - KContactOnlineIconA().Length()+ // longest A-Column icon - KEmptyIconC().Length() + // longest C-column icon - KContactNewMsgIcon().Length(); // longest D-Column icon - // Reserve enough memory to handle maximum size item - iData = HBufC::NewL( KFriendsListMaxIdentificationLength + - KStatusMsgMaxLength + - iMaxLengthOfIcons ); - - } - - -// --------------------------------------------------------- -// CVIMPSTUiSingleListboxArray::MdcaCount -// Returns the number of descriptor elements in a descriptor array. -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CVIMPSTUiSingleListboxArray::MdcaCount() const - { - return iItemArray.Count(); - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListboxArray::MdcaCount -// Return pointer to descriptor data in given index of an array -// (other items were commented in a header). -// --------------------------------------------------------- -// -TPtrC16 CVIMPSTUiSingleListboxArray::MdcaPoint( TInt aIndex ) const - { - TRACER_AUTO; - // Although this is a const method, we do change the member data. - // This is done because of performance - // -> no need to create new buffer every time. - TPtr dataPtr( iData->Des() ); - dataPtr.Zero(); - - // fetch the item and process correct type - TVIMPSTEnums::TItem type = iItemArray.GetType(aIndex); - - switch( type ) - { - case TVIMPSTEnums::EOwnStatusItem: - { - TRAP_IGNORE( AppendOwnDataL(dataPtr,aIndex ) ); - break; - } - - case TVIMPSTEnums::EContactItem: - { - // contact item - TRAP_IGNORE( AppendContactL(dataPtr,aIndex ) ); - break; - } - - } //end outer switch - return dataPtr; - } - - -// --------------------------------------------------------- -// CVIMPSTUiSingleListboxArray::AppendContact -// Append formatted contact identification to buffer -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListboxArray::AppendContactL( TPtr& aBuffer, - TInt aIndex - ) const - { - TRACER_AUTO; - // A-column - aBuffer.Append( KEmptyIconA ); - // B-column - TPtrC identification(iItemArray.GetItemNameText(aIndex) ); - aBuffer.Append( identification.Left(KFriendsListMaxIdentificationLength) ); - - //C-Column - aBuffer.Append( KEmptyIconC ); - - // D-Column - if( iItemArray.IsMsgPending( aIndex ) ) - { - aBuffer.Append( KContactNewMsgIcon ); - } - else - { - aBuffer.Append( KEmptyIconC ); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListboxArray::AppendContact -// Append formatted contact identification to buffer -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListboxArray::AppendOwnDataL( TPtr& aBuffer, - TInt aIndex - ) const - { - // no need to append any icon in the a coloum as there is no presence service. - // A-column - aBuffer.Append( KEmptyIconA ); - - // B-column - TPtrC identification(iItemArray.GetItemNameText(aIndex)); - aBuffer.Append( identification.Left( KFriendsListMaxIdentificationLength ) ); - - - //C-Column - aBuffer.Append( KEmptyIconA ); - - //D-Column - aBuffer.Append( KEmptyIconA ); - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListboxArray::AppendContactListL -// Append formatted contact list identification to buffer -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListboxArray::AppendContactListL( TPtr& /*aBuffer*/, - TInt /*aIndex */) const - { - // add functionality when contactlists supported - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuisinglelistboxtabviewcontrol.cpp --- a/uiservicetab/vimpstui/src/cvimpstuisinglelistboxtabviewcontrol.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1191 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for CVIMPSTUiDoubleListBoxTabViewControl. -* -*/ - - -// INCLUDE FILES -#include "cvimpstuisinglelistboxtabviewcontrol.h" - -#include "cvimpstuisinglelistboxarray.h" -#include "tvimpstenums.h" -#include "mvimpstcmdhandler.h" -#include "cvimpstuibranddata.h" -#include "imcvuiliterals.h" -#include "cvimpstuilistboxmodel.h" -#include "vimpstutilsdialog.h" -#include "vimpstui.hrh" -#include "cvimpstuitabbedview.h" -#include "mvimpstengine.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" - -// system include -#include -#include -#include -#include -#include -#include -#include -#include -// Pbk2 -#include -#include - - -#include -#include "mvimpstenginepresencesubservice.h" -#include "uiservicetabtracer.h" - -#include -// imlauncher -#include -const TInt KTextLimit( 40 ); // Text-limit for find-field - -const TInt KMinContact(1); // minmimum number of contacts to show findpane - -// ================= MEMBER FUNCTIONS ======================= -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::HandleAvatarChangeL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::HandleAvatarChangeL( const TDesC& /*aUserId*/ ) - { - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::CVIMPSTUiDoubleListBoxTabViewControl -// -------------------------------------------------------------------------- -// -CVIMPSTUiSingleListBoxTabViewControl::CVIMPSTUiSingleListBoxTabViewControl(CVIMPSTUiTabbedView& aTabbedView, MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, - TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba) - :iTabbedView(aTabbedView), - iKeyEventHandler(aKeyEventHandler), - iCommandHandler(aCommandHandler), - iArrayProcess(iCommandHandler.GetProcessInterface()), - iServiceId(aServiceId), - iBrandHandler(aBrandHandler), - iEngine(aEngine), - iCba(aCba) - { - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::ConstructL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::ConstructL() - { - TRACER_AUTO; - CreateWindowL(); - - // register to get the call back for any array data change - iArrayProcess.AddObserver(this); - - // Create and construct listbox - iListBox = new ( ELeave ) CVIMPSTUiSingleStyleListBox; - - iListBox->ConstructL(this); - - iListBox->SetContactListModelL(iArrayProcess); - - iListBox->SetListBoxObserver( this ); - - iListBox->SetContainerWindowL(*this); - iListBox->CreateScrollBarFrameL(ETrue); - iListBox->ScrollBarFrame()->SetScrollBarVisibilityL - (CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto); - // set marquee on - iListBox->ItemDrawer()->ColumnData()->EnableMarqueeL( ETrue ); - // If engine is uninstalled, do not construct the list view. - // Display empty message - if (iEngine.IsUnInstalled()) - { - SetListEmptyTextL( R_QTN_SERVTAB_SWUPDATE_RESTART ); - return; - } - else - { - // Construction of the listbox view. Engine is not uninstalled. - CVIMPSTUiSingleListboxArray* friendsArray = - CVIMPSTUiSingleListboxArray::NewL(iArrayProcess, - iListBox->ItemDrawer()->ColumnData(), *iListBox); - // now set the array - iListBox->Model()->SetItemTextArray(friendsArray); - - iListBox->Model()->SetOwnershipType(ELbmOwnsItemArray); - // if there is any contact other than owndata , show findpane - if (iListBox->Model()->NumberOfItems() > KMinContact) - { - // Create find-pane - ActivateFindPaneL(); - } - LoadBitmapsL(); - SetCbaLockL(EFalse); - } - - - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiSingleListBoxTabViewControl* CVIMPSTUiSingleListBoxTabViewControl::NewL - (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba) - { - TRACER_AUTO; - CVIMPSTUiSingleListBoxTabViewControl* self = NewLC(aTabbedView,aKeyEventHandler, - aCommandHandler, aServiceId, aBrandHandler,aEngine,aCba); - CleanupStack::Pop(self); - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::NewLC -// -------------------------------------------------------------------------- -// -CVIMPSTUiSingleListBoxTabViewControl* CVIMPSTUiSingleListBoxTabViewControl::NewLC - (CVIMPSTUiTabbedView& aTabbedView,MPbk2KeyEventHandler* aKeyEventHandler, - MVIMPSTCmdHandler& aCommandHandler, TUint32 aServiceId, - CVIMPSTUiBrandData& aBrandHandler, - MVIMPSTEngine& aEngine, - CEikButtonGroupContainer* aCba) - { - TRACER_AUTO; - CVIMPSTUiSingleListBoxTabViewControl* self = - new (ELeave) CVIMPSTUiSingleListBoxTabViewControl(aTabbedView,aKeyEventHandler, - aCommandHandler, aServiceId, aBrandHandler,aEngine,aCba); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::~CVIMPSTUiSingleListBoxTabViewControl -// -------------------------------------------------------------------------- -// -CVIMPSTUiSingleListBoxTabViewControl::~CVIMPSTUiSingleListBoxTabViewControl() - { - - delete iListBox; - iArrayProcess.RemoveObserver(); - if( iFindbox ) - { - delete iFindbox; - iFindbox = NULL; - } - - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::HandleAddition -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::HandleAdditionL(TVIMPSTEnums::TItem aType, TInt aIndex) - { - if(iListBox ) - { - iListBox->HandleItemAdditionL(); - UpdateViewL(aIndex,aType) ; - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::HandleAddition -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::HandleDeletionL(TVIMPSTEnums::TItem aType, TInt aIndex ) - { - if(iListBox) - { - iListBox->HandleItemRemovalL(); - TInt count = iListBox->Model()->NumberOfItems(); - if( count == aIndex ) - { - aIndex = 0; - } - UpdateViewL(aIndex,aType) ; - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::HandleItemAdditionL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::HandleItemAdditionL() - { - if(iListBox) - { - iListBox->HandleItemAdditionL(); - TInt index = CurrentItemIndex(); - TVIMPSTEnums::TItem type = iArrayProcess.GetType(index); - UpdateViewL(index,type) ; - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::HandleItemRemovalL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::HandleItemRemovalL() - { - if(iListBox) - { - iListBox->HandleItemRemovalL(); - TInt index = CurrentItemIndex(); - TVIMPSTEnums::TItem type = iArrayProcess.GetType(index); - UpdateViewL(index,type) ; - } - } - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SizeChanged -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::SizeChanged() - { - SetLayout(); //layouting controls - if ( iFindbox && iFindPaneIsVisible ) - { - iFindbox->MakeVisible( ETrue ); - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::CountComponentControls -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiSingleListBoxTabViewControl::CountComponentControls() const - { - // return number of controls inside this container - if( !iFindbox ) - { - // Find-pane does not exist when there is no data in listbox, - // so only one control exists (listbox) - return 1; //Ignore CodeScanner warning - } - else - { - // listbox and findbox exists. that makes it two - return 2; //Ignore CodeScanner warning - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::FocusChanged -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::FocusChanged( TDrawNow aDrawNow ) - { - if ( iFindbox && iFindbox->IsVisible() ) - { - iFindbox->SetFocus( IsFocused(), aDrawNow ); - if ( aDrawNow == EDrawNow && IsFocused() ) - { - iFindbox->DrawDeferred(); - } - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::ComponentControl -// -------------------------------------------------------------------------- -// -CCoeControl* CVIMPSTUiSingleListBoxTabViewControl::ComponentControl(TInt aIndex) const - { - // return iListBox; - switch ( aIndex ) - { - // the caller wants to have the first control - // so it's always listbox - case 0: - { - return iListBox; - } - // the caller wants to have the second control - // so it's always the findbox if it exists - case 1: - { - if( iFindbox ) - { - return iFindbox; - } - return NULL; - } - default: - { - return NULL; - } - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::OfferKeyEventL -// -------------------------------------------------------------------------- -// -TKeyResponse CVIMPSTUiSingleListBoxTabViewControl::OfferKeyEventL - (const TKeyEvent& aKeyEvent,TEventCode aType) - { - if ( !aKeyEvent.iCode ) - { - //The character code generated - //for an EEventKey, or 0 for a down or up event. - //For down or up key return key consumed.. handle only the events - - if((EEventKeyDown == aType) && (EStdKeyDevice3 == aKeyEvent.iScanCode)) - { - //for setting the command to be executed for the "Selection key" - //in case of selection key, container's OfferKeyEventL() is called only for EEventKeyDown and EEventKeyUp - //and not for EEventKey - UpdateCbaL(); - } - return EKeyWasConsumed; - } - UpdateCbaL(); - TKeyResponse ret = EKeyWasNotConsumed; - // Offer key event first to the key event handler - if ( iKeyEventHandler && iKeyEventHandler->Pbk2ProcessKeyEventL - ( aKeyEvent, aType ) ) - { - ret = EKeyWasConsumed; - } - - switch ( aKeyEvent.iCode ) - { - case EKeyBackspace: - { - if ( iFindbox ) - { - if( iFindbox->TextLength() == 0 ) - { - TVIMPSTEnums::TItem item = iArrayProcess.GetType( CurrentItemIndex() ); - if(TVIMPSTEnums::EContactItem == item) - { - TInt index = CurrentItemIndex(); - if( iArrayProcess.IsConversationExist(index) ) - { - iTabbedView.CloseConversationL(); - ret = EKeyWasConsumed; - } - else if(TVIMPSTEnums::EContactItem == iArrayProcess.GetType( index ) ) - { - if( TVIMPSTEnums::ESVCERegistered == iArrayProcess.GetLoginState() ) - { - iTabbedView.DeleteContactL(); - } - ret = EKeyWasConsumed; - } - } - } - } - break; - } - - // Case to handle send key press consumption. - case EKeyYes: - { - TInt index = iListBox->CurrentItemIndex(); - if( TVIMPSTEnums::EOwnStatusItem == iArrayProcess.GetType( index ) ) - { - ret = EKeyWasConsumed; - } - break; - } - default: - break; - } - - if( EKeyPhoneSend == aKeyEvent.iCode && ret != EKeyWasConsumed ) - { - if( iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EVoip)) - { - iTabbedView.MakeVoipCallL(); - ret = EKeyWasConsumed; - } - - } - if( ret == EKeyWasConsumed ) - { - // user might has choosen back/end key/application key etc - // application might switch to background - // return from here - return ret; - } - if ( iFindPaneIsVisible && iFindbox ) - { - ret = iFindbox->OfferKeyEventL( aKeyEvent, aType ) ; - } - // Not consumed by the key handler and findpane , offer to the control next - if ( ret == EKeyWasNotConsumed ) - { - ret = iListBox->OfferKeyEventL( aKeyEvent, aType ); - } - iTabbedView.UpdateToolbarL(); - return ret; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::CurrentItemIndex -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiSingleListBoxTabViewControl::CurrentItemIndex() const - { - if( !iListBox ) - { - return KErrNotFound; - } - if( !iListBox->View() ) - { - // CurrentItemIndex panics if the listbox has no view - return KErrNotFound; - } - - TInt curIndex( iListBox->CurrentItemIndex() ); - if ( curIndex < 0 ) - { - return KErrNotFound; - } - CVIMPSTUiListBoxModel* model = - static_cast( iListBox->Model() ); - - if( model ) - { - return model->FilteredItemIndex( curIndex ); - } - return KErrNotFound; - } - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SetCurrentItemIndex -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::SetCurrentItemIndex(TInt aIndex) - { - if (iListBox->CurrentItemIndex() != aIndex && - aIndex >= 0 && - aIndex < iListBox->Model()->NumberOfItems() ) - { - iListBox->SetCurrentItemIndex(aIndex); - TRAP_IGNORE(UpdateCbaL()); - } - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SetCurrentItemIndexAndDraw -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::SetCurrentItemIndexAndDraw(TInt aIndex) - { - SetCurrentItemIndex(aIndex); - this->DrawDeferred(); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SetListEmptyTextL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::SetListEmptyTextL(TInt aResourceId) - { - HBufC* msgText; - TRACER_AUTO; - // Get Service Name from Engine , load string from resource and display. - // This text is shown to tell the user to restart phone to get the service again. - TPtrC serviceNamePtr(iEngine.ServiceName()); - msgText = StringLoader::LoadLC(aResourceId, serviceNamePtr, iCoeEnv); - iListBox->View()->SetListEmptyTextL(*msgText); - TRACE( "Display Text %S", msgText ); - - CleanupStack::PopAndDestroy(msgText); - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::LoadBitmapsL -// Called by framework when the view size is changed -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::LoadBitmapsL() - { - - - CColumnListBoxData* listBoxData = iListBox->ItemDrawer()->ColumnData(); - if ( !listBoxData ) - { - //No listbox data - User::Leave( KErrNotFound ); - } - - CAknIconArray* icons = iBrandHandler.LoadIconsLC( ); - - CArrayPtr* oldIconArray = listBoxData->IconArray(); - if( oldIconArray ) - { - oldIconArray->ResetAndDestroy(); - delete oldIconArray; - listBoxData->SetIconArray( NULL ); - } - - // Set icon-array to listbox's drawer - listBoxData->SetIconArray( icons ); - CleanupStack::Pop( icons ); - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::HandleListBoxEventL( -// CEikListBox* /*aListBox*/, TListBoxEvent /*aEventType*/ ) -// From MEikListBoxObserver, Handles event's generated by listbox -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::HandleListBoxEventL( - CEikListBox* /*aListBox*/, TListBoxEvent aEventType ) - { - iTabbedView.UpdateToolbarL(); - UpdateCbaL(); - switch(aEventType) - { - case EEventItemSingleClicked: - { - TBool presenceEnabled = iEngine.IsSubServiceEnabled(TVIMPSTEnums::EPresence); - TBool imEnabled = iEngine.IsSubServiceEnabled(TVIMPSTEnums::EIM); - TBool voipEnabled = iEngine.IsSubServiceEnabled(TVIMPSTEnums::EVoip); - - TInt index = CurrentItemIndex(); - TVIMPSTEnums::TItem itemType = iArrayProcess.GetType(index); - TVIMPSTEnums::TVIMPSTRegistrationState serviceState = iTabbedView.GetServiceState(); - - if(TVIMPSTEnums::EOwnStatusItem == itemType && - TVIMPSTEnums::ESVCENotRegistered == serviceState) - { - iTabbedView.HandleCommandL( ECmdLogin ); - } - else if(TVIMPSTEnums::EOwnStatusItem == itemType - && presenceEnabled && - TVIMPSTEnums::ESVCERegistered == serviceState ) - { - iTabbedView.HandleCommandL( ECmdChangeStatus ); - } - else if( ( TVIMPSTEnums::EContactItem == itemType || - TVIMPSTEnums::EUnknonContactItem == itemType )&& imEnabled && - TVIMPSTEnums::ESVCERegistered == serviceState ) - { - iTabbedView.HandleCommandL( ECmdOpenConversation ); - } - else if ( itemType == TVIMPSTEnums::EFriendRequestItem - && TVIMPSTEnums::ESVCERegistered == serviceState) - { - iTabbedView.HandleCommandL( ECmdOpenFriendRequest ); - } - else if( TVIMPSTEnums::EContactItem == itemType ) - { - if( !(TVIMPSTEnums::ESVCEUpdatingContacts == serviceState || - TVIMPSTEnums::ESVCENetworkConnecting == serviceState || - TVIMPSTEnums::ESVCENetworkDisConnecting == serviceState)) - { - iTabbedView.HandleCommandL( ECmdContactDetails ); - } - } - break; - } - // Add enter key handling - case EEventEnterKeyPressed: - { - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - TInt commandId( iCba->ButtonGroup()->CommandId( CEikButtonGroupContainer::EMiddleSoftkeyPosition)); - - iTabbedView.HandleCommandL(commandId); - break; - } - default: - { - break; - } - } - - } -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SendMessageL( -// CEikListBox* /*aListBox*/, TListBoxEvent /*aEventType*/ ) -// From MEikListBoxObserver, Handles event's generated by listbox -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::SendMessageL() - { - TInt index = CurrentItemIndex(); - TPtrC seletctedItem = iArrayProcess.GetItemUserId(index) ; - if( index< 0 ) - { - // return if item not found. - return; - } - if(seletctedItem.Length()) - { - // No need to check for the presence of the contact as in singleline - // list box there is no presence, hence directly open the ocnversation view. - TVwsViewId activeViewId; - CCoeEnv::Static()->AppUi()->GetActiveViewId( activeViewId ); - - iArrayProcess.ResetPendingMsg( index ); - // imlauncher call for luanching the conversationview with seletced user id - IMCVLauncher::LaunchImConversationViewL(activeViewId, iServiceId, seletctedItem ); - } - else - { - //When there is no XSP Id present it comes to here - //Displaying a note that there is no XSP ID - HBufC* note = NULL; - note = StringLoader::LoadLC( R_QTN_SERVTAB_NOXSP_ERROR ); - VIMPSTUtilsDialog::DisplayNoteDialogL( *note ); - CleanupStack::PopAndDestroy( note ); - } - } -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::UpdateViewL -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::UpdateViewL( - TInt aIndex, TVIMPSTEnums::TItem aType) - { - TRACER_AUTO; - TInt index = KErrNotFound; - if( aIndex < 0 ) - { - aIndex = CurrentItemIndex()<0?0:CurrentItemIndex(); - } - switch(aType) - { - case TVIMPSTEnums::EContactItem: - case TVIMPSTEnums::EOwnStatusItem: - { - /*Not attempting to get the index of contact because aIndex is the - same as this index and we pass it on to the contactlistboxmodel's - visibleitem method*/ - CVIMPSTUiListBoxModel* list = - static_cast( iListBox->Model() ); - index = list->VisibleItemIndex(aIndex); - if( index != KErrNotFound && iFindbox ) - { - if(iClrFindPaneFlag) - { - iFindbox->SetSearchTextL( KNullDesC ); - iFindbox->DrawNow(); - iClrFindPaneFlag = EFalse; - } - else - { - TBuf temp; - iFindbox->GetSearchText(temp); - if(0 != temp.Compare(KNullDesC)) - { - ((CAknFilteredTextListBoxModel*) iListBox->Model() ) - ->Filter()->HandleOfferkeyEventL(); - } - } - } - break; - } - default: - { - //nothing to do - break; - } - } - iListBox->DrawNow(); - SetCurrentItemIndex(aIndex); - SetFocusAndMakeItemVisible(); - TInt count = iArrayProcess.Count(); - if(count > KMinContact && ! iFindPaneIsVisible) - { - ActivateFindPaneL(); - } - else if(count <= KMinContact && iFindPaneIsVisible) // extra check needed here to improve performance - { - DeactivateFindPaneL(); - } - - //Update the Toolbar after moving the focus to the current item. - iTabbedView.UpdateToolbarL(); - UpdateCbaL(); - } -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::ActivateFindPaneL() -// Activates find-pane -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::ActivateFindPaneL() - { - TRACER_AUTO; - if( !iFindbox ) - { - iFindbox = CAknSearchField::NewL( *this, - CAknSearchField::ESearch, - NULL, KTextLimit ); - static_cast( iListBox->Model() ) - ->CreateFilterL( iListBox, iFindbox ); - - } - iFindbox->SetObserver( this ); - iFindbox->ActivateL(); - iFindbox->ResetL(); - iFindbox->SetSearchTextL( KNullDesC ); - - iFindPaneIsVisible = ETrue; - SetLayout(); - - if( IsActivated() ) - { - iFindbox->MakeVisible( ETrue ); - iFindbox->SetFocus( ETrue ); - iListBox->SizeChanged(); - DrawNow(); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::DeactivateFindPaneL() -// De-activates find-pane -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::DeactivateFindPaneL() - { - TRACER_AUTO; - if( !iFindbox ) - { - return; - } - static_cast( iListBox->Model() ) - ->Filter()->ResetFilteringL(); - - - iFindbox->MakeVisible( EFalse ); - iFindbox->SetFocus( EFalse ); - - iFindPaneIsVisible = EFalse; - SetLayout(); - - if( IsActivated() ) - { - DrawNow(); - } - } - - - -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SetLayout() -// Layouts current components according to AVKON LAF -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::SetLayout() - { - const TRect rect( Rect() ); - if( iListBox && iFindPaneIsVisible ) - { - - TAknWindowLineLayout empty; - empty.iC = 0; - empty.il = 0; - empty.it = 0; - empty.ir = 0; - empty.ib = 0; - empty.iW = ELayoutEmpty; - empty.iH = ELayoutEmpty; - - TAknWindowLineLayout findPane = AknLayoutScalable_Avkon::find_pane().LayoutLine(); - TAknWindowLineLayout listPane; - - // listPane should equal to parent's rect - listPane.il = Rect().iTl.iX; - listPane.ir = ELayoutEmpty; - listPane.it = Rect().iTl.iY; - listPane.ib = ELayoutEmpty; - // this check is required since it's not guaranteed that listbox's SetRect - // has been called when this code is executed - if ( Size().iWidth > 0 ) - { - listPane.iW = Size().iWidth; - listPane.ir = ELayoutEmpty; - } - else - { - listPane.iW = ELayoutEmpty; - listPane.ir = 0; - } - // but findpane's height should be subtracted - listPane.iH = Size().iHeight - findPane.iH; - - // findPane's width should equal to listPane's width - findPane.iW = listPane.iW; - CAknFilteredTextListBoxModel* m = static_cast ( iListBox->Model() ); - if ( m->Filter() ) - { - m->Filter()->SetParentControl( this ); - } - TAknLayoutRect lrect; - lrect.LayoutRect( Rect(), empty ); - AknLayoutUtils::LayoutControl( iFindbox, lrect.Rect(), findPane ); - AknLayoutUtils::LayoutControl( iListBox, Rect(), listPane ); - - } - else if( iListBox ) - { - AknLayoutUtils::LayoutControl( iListBox, - rect, - AKN_LAYOUT_WINDOW_list_gen_pane( 0 ) ); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::HandleControlEventL -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent aEventType) - { - // We only observe iFindbox - if( EEventStateChanged == aEventType ) - { - - ((CAknFilteredTextListBoxModel*) iListBox->Model() ) - ->Filter()->HandleOfferkeyEventL(); - - } - iListBox->DrawNow(); - iTabbedView.UpdateToolbarL(); - } - -// --------------------------------------------------------- -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::CheckAndSetLastItemFlag() -// Checks if the last contact is focused and Sets the iLastItemFlag -// --------------------------------------------------------- -void CVIMPSTUiSingleListBoxTabViewControl::CheckAndSetLastItemFlag() - { - if(iListBox->CurrentItemIndex() == (iArrayProcess.Count() - 1)) - { - iLastItemFlag = ETrue; - } - else - { - iLastItemFlag = EFalse; - } - } -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SetFocusAndMakeItemVisible() -// Compares the Saved Contact in iFocussedID with the contacts in the List and focuses if it is found -// --------------------------------------------------------- -void CVIMPSTUiSingleListBoxTabViewControl::SetFocusAndMakeItemVisible() - { - TInt count = iArrayProcess.Count(); - TInt index = CurrentItemIndex(); - if( index == count ) - { - if( iLastItemFlag ) - { - index = count - 1; - iLastItemFlag = EFalse; - } - else - { - return;//do nothing let list box handle this. - } - } - - CVIMPSTUiListBoxModel* model = - static_cast( iListBox->Model() ); - - if( model ) - { - index = model->VisibleItemIndex( index ); - } - - iListBox->ScrollToMakeItemVisible( index ); - SetCurrentItemIndex(index); - iListBox->DrawNow(); - - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::GetFocussedId() -// To get the pointer to the iFocussedID -// --------------------------------------------------------- -TPtrC CVIMPSTUiSingleListBoxTabViewControl::GetFocussedId() - { - TInt index = CurrentItemIndex(); - if( index < 0 ) - { - index = 0; - } - return iCommandHandler.GetProcessInterface().GetItemUserId( index ); - } -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SetFocussedId() -// Saves the Contact ID in iFocussedID -// --------------------------------------------------------- -void CVIMPSTUiSingleListBoxTabViewControl::SetFocussedId(const TDesC& aContact) - { - TInt index = iCommandHandler.GetProcessInterface().GetSelectedItemIndex( aContact ); - if( index < 0 ) - { - index = 0; - } - SetCurrentItemIndex( index ); - SetFocusAndMakeItemVisible(); - } - -// -------------------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SetClrFindPaneFlag(TBool aFlag) -// -------------------------------------------------------------------- - -void CVIMPSTUiSingleListBoxTabViewControl::SetClrFindPaneFlag(TBool aFlag) - { - iClrFindPaneFlag = aFlag; - } -// --------------------------------------------------------- -// CVIMPSTUiDoubleListBoxTabViewControl::CoeControl() -// --------------------------------------------------------- - -CCoeControl* CVIMPSTUiSingleListBoxTabViewControl::CoeControl() - { - return this; // return this pointer since its a parent class pointer of CCoeControl - } -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::SetCbaLockL() -// Sets the lock status of cba keys. -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::SetCbaLockL( TBool aLock ) - { - iCbaLock = aLock; - if( !aLock ) - { - UpdateCbaL(); - } - } -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::UpdateCbaL() -// Updates Softkeys according to current focus. -// --------------------------------------------------------- -// -void CVIMPSTUiSingleListBoxTabViewControl::UpdateCbaL( TBool aUseDefaultCba /*= EFalse*/ ) - { - TRACER_AUTO; - TInt cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY; - iCurrentCmdToExe = -1; - if( !iCbaLock ) - { - TInt index = CurrentItemIndex(); - //if invalid index then dont set any command - if(KErrNotFound == index) - { - if ( iCba ) - { - iCba->SetCommandSetL( cbaRes ); - iCba->DrawNow(); - } - return; - } - - TVIMPSTEnums::TItem itemtype = iArrayProcess.GetType(index); - TVIMPSTEnums::TVIMPSTRegistrationState servicestate = iEngine.ServiceState(); - TBool updateinvalid( iLastFocusedItemType == TVIMPSTEnums::EInvalid ); -// if ( !iCba ) -// { -// iCba = CEikButtonGroupContainer::Current(); -// } - - // default softkeys - if( aUseDefaultCba || updateinvalid ) - { - if( aUseDefaultCba ) - { - iLastFocusedItemType = TVIMPSTEnums::EOwnStatusItem; - } - else - { - iLastFocusedItemType = itemtype; - } - - if( iCba ) - { - if ( itemtype == TVIMPSTEnums::EOwnStatusItem && TVIMPSTEnums::ESVCENetworkConnecting == servicestate ) - { - if(iTabbedView.CancelLoginSupportedL()) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_CANCEL__EXIT; - iCurrentCmdToExe = ECmdCancelLogin; - } - else - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY; - iCurrentCmdToExe = -1; - } - } - else if ( itemtype == TVIMPSTEnums::EOwnStatusItem && TVIMPSTEnums::ESVCEWaitingForNetwork == servicestate ) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_CHANGECONN__EXIT; - iCurrentCmdToExe = ECmdChangeConnectioninOnlineState; - } - else - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_LOGIN__EXIT; - iCurrentCmdToExe = ECmdLogin; - } - iCba->SetCommandSetL( cbaRes ); - iCba->DrawNow(); - } - } - - // collapse softkey ( when focus is on contact ) - else if( updateinvalid || itemtype == TVIMPSTEnums::EContactItem ) - { - iLastFocusedItemType = itemtype; - if( iCba ) - { - // Options/Collapse/Chat - if(TVIMPSTEnums::ESVCERegistered == servicestate) - { - // im is supported - if(iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM)) - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTION_OPENCONV__EXIT ); - iCurrentCmdToExe = ECmdOpenConversation; - } - else //im is not supporteed - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTIONS_DETAILS__EXIT ); - iCurrentCmdToExe = ECmdContactDetails; - } - } - else if(TVIMPSTEnums::ESVCENotRegistered == servicestate) - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTIONS_DETAILS__EXIT ); - iCurrentCmdToExe = ECmdContactDetails; - } - iCba->DrawNow(); - } - } - else if( itemtype == TVIMPSTEnums::EUnknonContactItem ) - { - iLastFocusedItemType = itemtype; - if(TVIMPSTEnums::ESVCERegistered == servicestate && - iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM)) - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTION_OPENCONV__EXIT ); - iCurrentCmdToExe = ECmdOpenConversation; - } - else //im is not supporteed - { - iCba->SetCommandSetL( R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY ); - iCurrentCmdToExe = -1; - } - iCba->DrawNow(); - } - // Focus on own contact item - else if( updateinvalid || itemtype == TVIMPSTEnums::EOwnStatusItem ) - { - iLastFocusedItemType = itemtype; - if( iCba ) - { - if ( itemtype == TVIMPSTEnums::EOwnStatusItem && TVIMPSTEnums::ESVCERegistered == servicestate ) - { - // Own status - // Options/Back/Change status - //Get Presence SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - TBool changeownstatussupported = EFalse; - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - changeownstatussupported = presence.IsChangeOwnStatusSupported(); - } - if(changeownstatussupported) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__CHANGESTATUS; - iCurrentCmdToExe = ECmdChangeStatus; - } - //else its cbres is set to options exit empty - } - else if ( itemtype == TVIMPSTEnums::EOwnStatusItem && TVIMPSTEnums::ESVCENetworkConnecting == servicestate ) - { - if(iTabbedView.CancelLoginSupportedL()) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_CANCEL__EXIT; - iCurrentCmdToExe = ECmdCancelLogin; - } - else - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTIONS_EXIT__EMPTY; - iCurrentCmdToExe = -1; - } - } - else if ( itemtype == TVIMPSTEnums::EOwnStatusItem && TVIMPSTEnums::ESVCEWaitingForNetwork == servicestate ) - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_CHANGECONN__EXIT; - iCurrentCmdToExe = ECmdChangeConnectioninOnlineState; - } - else - { - cbaRes = R_SERVTAB_SOFTKEYS_OPTION_LOGIN__EXIT; - iCurrentCmdToExe = ECmdLogin; - } - //add for connecting state and waiting for connection state. - iCba->SetCommandSetL( cbaRes ); - iCba->DrawNow(); - } - } - } - } - -// --------------------------------------------------------- -// CVIMPSTUiSingleListBoxTabViewControl::HandleAvatarRefreshL() -// --------------------------------------------------------- -void CVIMPSTUiSingleListBoxTabViewControl::HandleAvatarRefreshL( const TDesC&/* aUserId */,TBool /*aBlock*/) - { - //no avatar implementation for single list box. - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuisinglestylelistbox.cpp --- a/uiservicetab/vimpstui/src/cvimpstuisinglestylelistbox.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/* -* Copyright (c) 2008 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: Custom listbox component for the contact list -* -*/ - - -#include "cvimpstuisinglestylelistbox.h" -#include "cvimpstuilistboxmodel.h" -#include -#include "uiservicetabtracer.h" - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBox::CreateModelL -// Here we change the listbox model -// --------------------------------------------------------------------------- -// -void CVIMPSTUiSingleStyleListBox::CreateModelL() - { - // we have to make sure that the model is ours, - // so we can leave if the model creation fails. - // (just make sure that the pointer is NULL) - // in column style listbox , listboxes consturctL() calls this method - delete iModel; - iModel = NULL; - iModel = new ( ELeave ) CVIMPSTUiListBoxModel; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiListBox::SetContactListModel -// ConstructL has to be called before calling this -// --------------------------------------------------------------------------- -// -void CVIMPSTUiSingleStyleListBox::SetContactListModelL(MVIMPSTProcessArray& aContactListModel ) - { - TRACER_AUTO; - if ( iModel ) - { - static_cast(iModel)->SetContactListModel( aContactListModel ); - } - } - - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuistatuspanehandler.cpp --- a/uiservicetab/vimpstui/src/cvimpstuistatuspanehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,129 +0,0 @@ -/* -* Copyright (c) 2008 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: Tabbed view declaration -* -*/ - -#include "cvimpstuistatuspanehandler.h" - -// -------------------------------------------------------------------------- -// CCVIMPSTUiStatusPaneHandler::CCVIMPSTUiStatusPaneHandler -// -------------------------------------------------------------------------- -CCVIMPSTUiStatusPaneHandler::CCVIMPSTUiStatusPaneHandler() - { - // No implementation required - iNaviPush = EFalse; - } - -// -------------------------------------------------------------------------- -// CCVIMPSTUiStatusPaneHandler::~CCVIMPSTUiStatusPaneHandler -// -------------------------------------------------------------------------- -CCVIMPSTUiStatusPaneHandler::~CCVIMPSTUiStatusPaneHandler() - { - if( iNaviPush && iNaviPane ) - { - iNaviPane->Pop( iNaviDeco ); - } - } - -// -------------------------------------------------------------------------- -// CCVIMPSTUiStatusPaneHandler::NewLC() -// -------------------------------------------------------------------------- -CCVIMPSTUiStatusPaneHandler* CCVIMPSTUiStatusPaneHandler::NewLC() - { - CCVIMPSTUiStatusPaneHandler* self = new (ELeave)CCVIMPSTUiStatusPaneHandler(); - CleanupStack::PushL(self); - self->ConstructL(); - return self; - } - -// -------------------------------------------------------------------------- -// CCVIMPSTUiStatusPaneHandler::NewL() -// -------------------------------------------------------------------------- -CCVIMPSTUiStatusPaneHandler* CCVIMPSTUiStatusPaneHandler::NewL() - { - CCVIMPSTUiStatusPaneHandler* self=CCVIMPSTUiStatusPaneHandler::NewLC(); - CleanupStack::Pop(); // self; - return self; - } - -// -------------------------------------------------------------------------- -// CCVIMPSTUiStatusPaneHandler::ConstructL() -// -------------------------------------------------------------------------- -void CCVIMPSTUiStatusPaneHandler::ConstructL() - { - iEnv = CEikonEnv::Static(); - iStatusPane = iEnv->AppUiFactory()->StatusPane(); - - if( iStatusPane->PaneCapabilities( TUid::Uid(EEikStatusPaneUidTitle) ).IsPresent() ) - iTitlePane = static_cast( iStatusPane->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); - - if( iStatusPane->PaneCapabilities( TUid::Uid(EEikStatusPaneUidContext) ).IsPresent() ) - iContextPane = static_cast ( iStatusPane->ControlL( TUid::Uid( EEikStatusPaneUidContext ) ) ); - - if( iStatusPane->PaneCapabilities( TUid::Uid(EEikStatusPaneUidNavi)).IsPresent() ) - iNaviPane = static_cast( iStatusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - - } - -// -------------------------------------------------------------------------- -// CCVIMPSTUiStatusPaneHandler::SetPictureL() -// -------------------------------------------------------------------------- -void CCVIMPSTUiStatusPaneHandler::SetPictureL( CFbsBitmap* aBitmap, CFbsBitmap* aMask, TBool aNaviPush ) - { - if( iContextPane->IsVisible() ) - { - iContextPane->SetPicture( aBitmap, aMask ); - } - else if( aNaviPush ) - { - iNaviDeco = iNaviPane->CreateNavigationImageL( aBitmap, aMask ); - iNaviPane->PushL( *iNaviDeco ); - iNaviPush = aNaviPush; - } - else - { - delete aBitmap; - aBitmap = NULL; - delete aMask; - aMask = NULL; - } - } - -// -------------------------------------------------------------------------- -// CCVIMPSTUiStatusPaneHandler::SetTextL() -// -------------------------------------------------------------------------- -void CCVIMPSTUiStatusPaneHandler::SetTextL( const TDesC& aText ) - { - iTitlePane->SetTextL( aText ); - } - -// -------------------------------------------------------------------------- -// CCVIMPSTUiStatusPaneHandler::ClearPaneL() -// -------------------------------------------------------------------------- -void CCVIMPSTUiStatusPaneHandler::ClearPaneL( ) - { - if( iContextPane->IsVisible() ) - { - iContextPane->SetPicture( NULL, NULL); - } - if( iNaviPush ) - { - iNaviPane->Pop( iNaviDeco ); - iNaviPush = EFalse; - } - } - -//END OF FILE - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuitabbedview.cpp --- a/uiservicetab/vimpstui/src/cvimpstuitabbedview.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3936 +0,0 @@ -/* -* Copyright (c) 2008 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: Implementation for CVIMPSTUiTabbedView - * -*/ - - -// INCLUDE FILES -#include "cvimpstuitabbedview.h" - -#include "cvimpstcmdhandler.h" -#include "mvimpstuitabbedviewcontrol.h" -#include "mvimpstuitabcontrolfactory.h" -#include "vimpstcmd.hrh" -#include "mvimpstcmd.h" -#include "mvimpstengine.h" -#include "mvimpstenginesearchmgrextention.h" - -#include "vimpstui.hrh" -#include "vimpstextentionuiuid.h" -#include "tvimpstconsts.h" -#include "cvimpstuiextensionservice.h" -#include "cvimpstuibranddata.h" -#include "mvimpstprocessarray.h" -#include "vimpstutilsdialog.h" -#include "vimpstutilswaitnote.h" -#include "vimpstcmd.hrh" -#include "cvimpstuisearchfieldaray.h" -#include "mvimpstuisearchfield.h" -#include "cvimpstuisearchquerydialog.h" -#include "cvimpstuiavatarselectionhandler.h" // avatar selection -#include "cvimpstuistatuspanehandler.h" - - -#include "mvimpstengineextentionfeatures.h" -#include "mvimpststoragevpbkstorehandler.h" - -// System includes -#include //CAknToolbar -#include //CEikAppUiFactory - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// Pbk2 -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -// xSP extension manager -#include "MxSPViewMapper.h" -#include "MxSPContactManager.h" -#include "cvimpststoragemanagerfactory.h" -#include "mvimpststorageserviceview.h" -#include "cvimpstuimenuextension.h" - -//resource -#include -#include - -//CCA -#include -#include -#include - -#include "uiservicetabtracer.h" - -//AIW - VOIP -#include -#include -#include -#include -#include -#include - -//browser launch -#include -#include "cvimpstuitermsofusedialoghandler.h" -#include -#include -#include "tvimpstconsts.h" -// avatar -#include "mvimpstenginepresencesubservice.h" -#include "mvimpstenginesubservice.h" -#include "mvimpstengineimsubservice.h" -#include "cvimpstuicontactselection.h" - -#include -// help launch -#include -#include -#include "meco.hlp.hrh" - -#include -#include //KAiwCmdCall -#include -#include - -using namespace AiwContactAssign; -using namespace Phonebook2; - -const TInt KBufLen(512); - - -// ================= MEMBER FUNCTIONS ======================= - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::CVIMPSTUiTabbedView -// -------------------------------------------------------------------------- -// -CVIMPSTUiTabbedView::CVIMPSTUiTabbedView( -MxSPViewMapper& aMapper, -MxSPContactManager& aContactManager, -TUint aTabbedViewId, -TUint aServiceId, -CPbk2UIExtensionView& aView, -TUid /*aId*/, -CVIMPSTUIExtensionService& aServiceData, -MVIMPSTEngine& aEngine, -MVIMPSTCmdHandler& aCommandHandler, -CVIMPSTUIMenuExtension& aMenuExtension) : -CxSPBaseView( aMapper, aContactManager, aView ), -iViewId( aTabbedViewId ), -iServiceId(aServiceId), -iEngine(aEngine), -iExtensionService( aServiceData ), -iCommandHandler( aCommandHandler), -iMenuExtension(aMenuExtension), -iSelectedAction( KErrNotFound ) - - { - iFixedToolbar = NULL; - iIsToolBarHidden = ETrue; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ConstructL -// -------------------------------------------------------------------------- -// -inline void CVIMPSTUiTabbedView::ConstructL() - { - ViewBaseConstructL( KIMCONTACTSEXTNIMPLEMENTATIONUID, iViewId ); - - iCommandHandler.RegisterEventObserverL(this); - - iPreviousState = TVIMPSTEnums::ESVCENotRegistered; - - iServiceHandler = CAiwServiceHandler::NewL(); - - iServiceHandler->AttachL( R_IM_APP_INTEREST ); - iServiceHandler->AttachMenuL( R_SERVTAB_TABBED_VIEW_MENU, - R_IM_APP_INTEREST ); - - iServiceHandler->AttachL( R_AIWASSIGNMENT_INTEREST ); - - iServiceHandler->AttachL( R_AIWSELECT_INTEREST ); - - iStatusMessage = HBufC::NewL( KStatusTextLength ); - - iStatusPaneHandler = CCVIMPSTUiStatusPaneHandler::NewL(); - - //Get SearchMgr - MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::ESearch); - if (feature) - { - MVIMPSTEngineSearchMgrExtention& searchMgr = - MVIMPSTEngineSearchMgrExtention::Cast - (*feature); - - searchMgr.RegisterObserver(this); - } - iSettingsStore = CVIMPSTSettingsStore::NewL(); - - iBrandHandler = CVIMPSTUiBrandData::NewL( iEngine ); - - iAppUi = CCoeEnv::Static()->AppUi(); - - CFbsBitmap *bitmap, *mask; - iBrandHandler->GetBrandBitmapsL( &bitmap, &mask); - iStatusPaneHandler->SetPictureL( bitmap, mask ); - - iIsServiceHandleReSet = EFalse; - - iContainerCreationStarted = EFalse; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::NewL -// -------------------------------------------------------------------------- -// -CVIMPSTUiTabbedView* CVIMPSTUiTabbedView::NewL( MxSPViewMapper& aMapper, - MxSPContactManager& aContactManager, - TUint aTabbedViewId, - TUint aServiceId, - CPbk2UIExtensionView& aView, - TUid aId, - CVIMPSTUIExtensionService& aServiceData, - MVIMPSTEngine& aEngine, - MVIMPSTCmdHandler& aCommandHandler, - CVIMPSTUIMenuExtension& aMenuExtension) - { - CVIMPSTUiTabbedView* self = new(ELeave) CVIMPSTUiTabbedView( aMapper, - aContactManager, - aTabbedViewId, - aServiceId, - aView, - aId, - aServiceData, - aEngine, - aCommandHandler, - aMenuExtension); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::~CVIMPSTUiTabbedView -// -------------------------------------------------------------------------- -// -CVIMPSTUiTabbedView::~CVIMPSTUiTabbedView() - { - delete iContactSelection; - delete iFriendRequestId; - - delete iSelectedData.iPackedLinks; - iSelectedData.iXSPList.ResetAndDestroy(); - - delete iQueryResult; - //Get SearchMgr - MVIMPSTEngineExtentionFeatures* feature = iEngine.ExtentionFeatures(TVIMPSTEnums::ESearch); - if (feature) - { - MVIMPSTEngineSearchMgrExtention& searchMgr = - MVIMPSTEngineSearchMgrExtention::Cast - (*feature); - - searchMgr.UnRegisterObserver(this); - } - - if(iParameter!=NULL) - iParameter->Close(); - if(iConnection!=NULL) - { - iConnection->Close(); - iConnection = NULL; - } - - if (iContainer && iAppUi ) - { - iAppUi->RemoveFromStack( iContainer->CoeControl() ); - delete iContainer; - iContainerCreationStarted = EFalse; - } - delete iBrandHandler; - iCommandHandler.UnRegisterEventObserver(this); - - if ( iFixedToolbar ) - { - iFixedToolbar->SetToolbarObserver( NULL ); - delete iFixedToolbar; - iFixedToolbar = NULL; - } - - if (iServiceHandler) - { - iServiceHandler->Reset(); - delete iServiceHandler; - iServiceHandler = NULL; - } - - delete iContact; - - if(iFocussedIDHistory) - { - delete iFocussedIDHistory; - iFocussedIDHistory = NULL; - } - delete iBrLauncher; - delete iUserId; - - if(iSettingsStore) - { - delete iSettingsStore; - iSettingsStore = NULL; - } - delete iStatusPaneHandler; - - delete iAiwParamList; - - if(iStatusMessage) - { - delete iStatusMessage; - } - - } - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::DynInitMenuPaneL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) - { - - if (iEngine.IsUnInstalled()) - { - // if engine is uninstalled, do not initiate the menu pane. - return; - } - // AIW knows its own submenu hooks, so we can return from - // here if AIW handled this. - ReInitializeServiceHandlerL(); - - iMenuExtension.ResetAIWCommandMap(); - - if ( iServiceHandler->HandleSubmenuL( *aMenuPane ) ) - { - return; - } - - TBool imService = iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM); - TBool voipService = iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EVoip); - TBool presenceService = iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EPresence); - TVIMPSTEnums::TVIMPSTRegistrationState serviceTabState = - iEngine.ServiceState(); - - TInt itemIndex = CurrentItemIndex(); - // fetch the item and process correct type - TVIMPSTEnums::TItem itemType = iCommandHandler.GetProcessInterface().GetType(itemIndex); - TVIMPSTEnums::TOnlineStatus onlinestatus = iCommandHandler.GetProcessInterface().GetOnlineStatusL(itemIndex); - - switch( aResourceId) - { - case R_EXTENSION_MANAGER_MENU: - { - aMenuPane->AddMenuItemsL(R_SERVTAB_TABBED_VIEW_MENU); - aMenuPane->AddMenuItemsL(R_TABBED_VIEW_GENERAL_MENU); - - aMenuPane->SetItemDimmed(ECmdGetBlockedList, ETrue); - //based on sevice states decide what all submenu should be shown - //and main menu's to be shown - switch (serviceTabState) - { - case TVIMPSTEnums::ESVCENotRegistered: - { - aMenuPane->SetItemDimmed(ECmdCreateNewOption, ETrue); - aMenuPane->SetItemDimmed(ECmdMyAvatar, ETrue); - aMenuPane->SetItemDimmed(ECmdChangeStatus, ETrue); - aMenuPane->SetItemDimmed(ECmdLogout, ETrue); - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdChangeConnectioninOnlineState, ETrue); - aMenuPane->SetItemDimmed(ECmdChangeConnectioninWaitingState, ETrue); - break; - } - case TVIMPSTEnums::ESVCERegistered: - { - if (!presenceService) - { - aMenuPane->SetItemDimmed(ECmdMyAvatar, ETrue); - aMenuPane->SetItemDimmed(ECmdChangeStatus, ETrue); - } - else - { - //find whether avatar is supported - //Get Presence SubService - MVIMPSTEngineSubService* subService = - (iEngine.SubService(TVIMPSTEnums::EPresence)); - if(subService) - { - MVIMPSTEnginePresenceSubService& presence = - MVIMPSTEnginePresenceSubService::Cast (*subService); - - aMenuPane->SetItemDimmed(ECmdMyAvatar, !presence.IsAvatarSupported() ); - } - - } - aMenuPane->SetItemDimmed(ECmdLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - - if (!ChangeConnectionSupportedL()) - { - aMenuPane->SetItemDimmed(ECmdChangeConnectioninOnlineState, ETrue); - } - - aMenuPane->SetItemDimmed(ECmdChangeConnectioninWaitingState, ETrue); - if(iEngine.IsBlockSupportedL()) - { - aMenuPane->SetItemDimmed(ECmdGetBlockedList, EFalse); - } - break; - } - case TVIMPSTEnums::ESVCENetworkConnecting: - { - aMenuPane->SetItemDimmed(ECmdChangeStatus, ETrue); - aMenuPane->SetItemDimmed(ECmdCreateNewOption, ETrue); - aMenuPane->SetItemDimmed(ECmdMyAvatar, ETrue); - aMenuPane->SetItemDimmed(ECmdLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdLogout, ETrue); - aMenuPane->SetItemDimmed(ECmdSettings, ETrue); - aMenuPane->SetItemDimmed(ECmdChangeConnectioninOnlineState, ETrue); - aMenuPane->SetItemDimmed(ECmdChangeConnectioninWaitingState, ETrue); - if( !CancelLoginSupportedL()) - { - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - } - break; - } - case TVIMPSTEnums::ESVCEWaitingForNetwork: - case TVIMPSTEnums::ESVCEUpdatingContacts: - { - aMenuPane->SetItemDimmed(ECmdChangeStatus, ETrue); - aMenuPane->SetItemDimmed(ECmdCreateNewOption, ETrue); - aMenuPane->SetItemDimmed(ECmdMyAvatar, ETrue); - aMenuPane->SetItemDimmed(ECmdLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdChangeConnectioninOnlineState, ETrue); - if (!ChangeConnectionSupportedL()) - { - aMenuPane->SetItemDimmed(ECmdChangeConnectioninWaitingState, ETrue); - } - break; - } - case TVIMPSTEnums::ESVCENetworkDisConnecting: - { - aMenuPane->SetItemDimmed(ECmdChangeStatus, ETrue); - aMenuPane->SetItemDimmed(ECmdCreateNewOption, ETrue); - aMenuPane->SetItemDimmed(ECmdMyAvatar, ETrue); - aMenuPane->SetItemDimmed(ECmdLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdSettings, ETrue); - aMenuPane->SetItemDimmed(ECmdLogout, ETrue); - aMenuPane->SetItemDimmed(ECmdChangeConnectioninWaitingState, ETrue); - aMenuPane->SetItemDimmed(ECmdChangeConnectioninOnlineState, ETrue); - break; - } - default: - { - break; - } - } - // common to all - aMenuPane->SetItemDimmed(ECmdOpenConversation, ETrue); - aMenuPane->SetItemDimmed(ECmdContactAddAsFriend, ETrue); - aMenuPane->SetItemDimmed(KAiwCmdCall, ETrue); - aMenuPane->SetItemDimmed(ECmdCloseConversation, ETrue); - aMenuPane->SetItemDimmed(ECmdContactDetails, ETrue); - aMenuPane->SetItemDimmed(ECmdOpenFriendRequest, ETrue); - aMenuPane->SetItemDimmed(ECmdContactEdit, ETrue); - aMenuPane->SetItemDimmed(ECmdAIWAddToContact, ETrue); - aMenuPane->SetItemDimmed(ECmdAIWLinkToContact, ETrue); - aMenuPane->SetItemDimmed(ECmdBlock, ETrue); - aMenuPane->SetItemDimmed(ECmdUnBlock, ETrue); - aMenuPane->SetItemDimmed(ECmdContactDelete, ETrue); - //based on items in focus decide what main menu items needs to be shown - switch(itemType) - { - case TVIMPSTEnums::EOwnStatusItem: - case TVIMPSTEnums::EInvalid: // this case comes when no matched found for findpane characters - { - break; - } - case TVIMPSTEnums::EContactItem: - { - //conversation related menu - MVIMPSTStorageServiceView* storage = - CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - TBool localstore = EFalse; - if (storage) - { - localstore = storage->IsLocalStore(); - } - if (TVIMPSTEnums::ESVCERegistered == serviceTabState) - { - TPtrC selectedItem = iCommandHandler.GetProcessInterface(). - GetItemUserId(itemIndex); - if( selectedItem != KNullDesC ) - { - if (imService) - { - if ( iCommandHandler.GetProcessInterface().IsConversationExist( itemIndex ) ) - { - aMenuPane->SetItemDimmed(ECmdCloseConversation, EFalse); - aMenuPane->SetItemDimmed(ECmdOpenConversation, ETrue); - } - else - { - aMenuPane->SetItemDimmed(ECmdOpenConversation, EFalse); - } - } - } - if(voipService) - { - TInt index; - aMenuPane->MenuItemExists(KAiwCmdCall, index); - aMenuPane->SetItemDimmed(KAiwCmdCall, EFalse); - - CAiwDialDataExt* dialDataExt = CAiwDialDataExt::NewL(); - CleanupStack::PushL( dialDataExt ); - dialDataExt->SetServiceId( iServiceId ); - ReInitializeServiceHandlerL(); - CAiwGenericParamList& paramList = iServiceHandler->InParamListL(); - dialDataExt->FillInParamListL( paramList ); - TAiwVariant variant; - TAiwGenericParam param ( EGenericParamSIPAddress, variant ); - paramList.AppendL( param ); - iServiceHandler->InitializeMenuPaneL( *aMenuPane, - R_SERVTAB_TABBED_VIEW_MENU, - // Must not overlap with the other menu ids! - ECmdAIWRangeStart, - paramList ); - - CleanupStack::PopAndDestroy( dialDataExt ); - - CEikMenuPaneItem::SData& data = aMenuPane->ItemDataByIndexL(index); - //add to AIW command map of the menuextension manager - iMenuExtension.AddToAIWCommandMap(KAiwCmdCall,data.iCommandId); - } - - aMenuPane->SetItemDimmed(ECmdContactDetails, EFalse); - - if (localstore) - { - //ContactEdit is enabled only for localstore - aMenuPane->SetItemDimmed(ECmdContactEdit, EFalse); - } - if(iEngine.IsBlockSupportedL()) - { - TVIMPSTEnums::TOnlineStatus status = iCommandHandler.GetProcessInterface().GetOnlineStatusL(itemIndex); - if(TVIMPSTEnums::EBlocked == status ) - { - aMenuPane->SetItemDimmed(ECmdUnBlock, EFalse); - } - else if( selectedItem .Length() ) - { - aMenuPane->SetItemDimmed(ECmdBlock, EFalse); - } - } - aMenuPane->SetItemDimmed(ECmdContactDelete, EFalse); - - - if (!localstore) - { - aMenuPane->SetItemDimmed(ECmdAIWAddToContact, EFalse); - aMenuPane->SetItemDimmed(ECmdAIWLinkToContact, EFalse); - } - } - else if (TVIMPSTEnums::ESVCENotRegistered == serviceTabState) - { - if(!presenceService) - { - if (localstore) - { - //ContactEdit is enabled only for localstore - aMenuPane->SetItemDimmed(ECmdContactEdit, EFalse); - } - } - } - - break; - } - case TVIMPSTEnums::EUnknonContactItem : - { - aMenuPane->SetItemDimmed(ECmdContactAddAsFriend, EFalse); - aMenuPane->SetItemDimmed(ECmdContactDetails, ETrue); - aMenuPane->SetItemDimmed(ECmdOpenFriendRequest, ETrue); - aMenuPane->SetItemDimmed(ECmdContactEdit, ETrue); - aMenuPane->SetItemDimmed(ECmdAIWAddToContact, ETrue); - aMenuPane->SetItemDimmed(ECmdAIWLinkToContact, ETrue); - aMenuPane->SetItemDimmed(ECmdBlock, ETrue); - aMenuPane->SetItemDimmed(ECmdUnBlock, ETrue); - aMenuPane->SetItemDimmed(ECmdContactDelete, ETrue); - if( iEngine.IsBlockSupportedL() ) - { - aMenuPane->SetItemDimmed(ECmdBlock, EFalse); - } - if (imService) - { - if (iCommandHandler.GetProcessInterface().IsConversationExist( itemIndex )) - { - aMenuPane->SetItemDimmed(ECmdCloseConversation, EFalse); - aMenuPane->SetItemDimmed(ECmdOpenConversation, ETrue); - } - else - { - aMenuPane->SetItemDimmed(ECmdOpenConversation, EFalse); - } - } - if(voipService) - { - TInt index; - aMenuPane->MenuItemExists(KAiwCmdCall, index); - - aMenuPane->SetItemDimmed(KAiwCmdCall, EFalse); - - CAiwDialDataExt* dialDataExt = CAiwDialDataExt::NewL(); - CleanupStack::PushL( dialDataExt ); - dialDataExt->SetServiceId( iServiceId ); - ReInitializeServiceHandlerL(); - CAiwGenericParamList& paramList = iServiceHandler->InParamListL(); - dialDataExt->FillInParamListL( paramList ); - TAiwVariant variant; - TAiwGenericParam param ( EGenericParamSIPAddress, variant ); - paramList.AppendL( param ); - iServiceHandler->InitializeMenuPaneL( *aMenuPane, - R_SERVTAB_TABBED_VIEW_MENU, - // Must not overlap with the other menu ids! - ECmdAIWRangeStart, - paramList ); - CleanupStack::PopAndDestroy( dialDataExt ); - - CEikMenuPaneItem::SData& data = aMenuPane->ItemDataByIndexL(index); - //add to AIW command map of the menuextension manager - iMenuExtension.AddToAIWCommandMap(KAiwCmdCall,data.iCommandId); - - } - break; - } - case TVIMPSTEnums::EFriendRequestItem: - { - aMenuPane->SetItemDimmed(ECmdContactDetails, ETrue); - aMenuPane->SetItemDimmed(ECmdContactEdit, ETrue); - aMenuPane->SetItemDimmed(ECmdAIWAddToContact, ETrue); - aMenuPane->SetItemDimmed(ECmdAIWLinkToContact, ETrue); - aMenuPane->SetItemDimmed(ECmdBlock, ETrue); - aMenuPane->SetItemDimmed(ECmdUnBlock, ETrue); - aMenuPane->SetItemDimmed(ECmdContactDelete, ETrue); - aMenuPane->SetItemDimmed(ECmdOpenFriendRequest, EFalse); - if(iEngine.IsBlockSupportedL()) - { - aMenuPane->SetItemDimmed(ECmdBlock, EFalse); - } - break; - } - default: - { - break; - } - } - // append the servicetab options(R_TABBED_VIEW_OPTIONS_MENU) and tabbed - // viem(R_SERVTAB_TABBED_VIEW_MENU) menu items and the the service - // specific options and then settings,help and exit.(R_TABBED_VIEW_GENERAL_MENU) - iMenuExtension.OfferMenuPaneToPlugins(ECmdCancelLogin,*aMenuPane,iServiceId); - - break; - } - - case R_SERVTAB_CREATENEW_OPTION_SUBMENU: - { - - aMenuPane->SetItemDimmed(ECmdAddContact, ETrue); - aMenuPane->SetItemDimmed(ECmdAddFromPhoneBook, ETrue); - aMenuPane->SetItemDimmed(ECmdSearch, ETrue); - - if (TVIMPSTEnums::ESVCERegistered == serviceTabState) - { - aMenuPane->SetItemDimmed(ECmdAddContact, EFalse); - aMenuPane->SetItemDimmed(ECmdAddFromPhoneBook, EFalse); - - //make search request using search manager in engine - MVIMPSTEngineExtentionFeatures* feature = - iEngine.ExtentionFeatures(TVIMPSTEnums::ESearch); - - if (feature) - { - if ( TVIMPSTEnums::ESupported == feature->IsSupported() ) - { - aMenuPane->SetItemDimmed(ECmdSearch, EFalse);//show if search is supported. - } - } - } - break; - } - - case R_SERVTAB_CHANGEAVATAR_SUBMENU: - { - if ((TVIMPSTEnums::ESVCERegistered != serviceTabState) || - (!presenceService)) - { - aMenuPane->SetItemDimmed(ECmdAvatarGallery, ETrue); - aMenuPane->SetItemDimmed(ECmdAvatarNewPhoto, ETrue); - aMenuPane->SetItemDimmed(ECmdDefaultAvatar, ETrue); - } - break; - } - - case R_TABBED_VIEW_GENERAL_MENU: - { - switch (serviceTabState) - { - case TVIMPSTEnums::ESVCENotRegistered: - { - aMenuPane->SetItemDimmed(ECmdLogout, ETrue); - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdGetBlockedList, ETrue); - break; - } - case TVIMPSTEnums::ESVCERegistered: - { - aMenuPane->SetItemDimmed(ECmdLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - break; - } - case TVIMPSTEnums::ESVCENetworkConnecting: - { - aMenuPane->SetItemDimmed(ECmdLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdGetBlockedList, ETrue); - aMenuPane->SetItemDimmed(ECmdLogout, ETrue); - aMenuPane->SetItemDimmed(ECmdSettings, ETrue); - if( !CancelLoginSupportedL()) - { - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - } - break; - } - case TVIMPSTEnums::ESVCEWaitingForNetwork: - case TVIMPSTEnums::ESVCEUpdatingContacts: - { - aMenuPane->SetItemDimmed(ECmdLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdGetBlockedList, ETrue); - break; - } - case TVIMPSTEnums::ESVCENetworkDisConnecting: - { - aMenuPane->SetItemDimmed(ECmdLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdCancelLogin, ETrue); - aMenuPane->SetItemDimmed(ECmdSettings, ETrue); - aMenuPane->SetItemDimmed(ECmdGetBlockedList, ETrue); - aMenuPane->SetItemDimmed(ECmdLogout, ETrue); - break; - } - default: - { - break; - } - - - } - break; - } - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::HandleCommandL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::HandleCommandL(TInt aCommand) - { - //offer to extensions first, then to aiw. - if(iMenuExtension.OfferHandleCommandToPlugins(aCommand)) - { - //command is executed, hence return. - return; - } - ReInitializeServiceHandlerL(); - if ( iServiceHandler ) - { - TInt serviceCommandId =iServiceHandler->ServiceCmdByMenuCmd(aCommand); - - if ( iContainer && serviceCommandId == KAiwCmdCall ) - { - MakeVoipCallL(); - return; - } - } - if( iContainer ) - { - iContainer->SetClrFindPaneFlag(ETrue); - } - - switch (aCommand) - { - case ECmdLogin: - { - LoginL(); - break; - } - case ECmdSearch: - { - SearchContactsL(); - break; - } - case ECmdAddFromPhoneBook: - { - - LaunchFetchDialogL(); - break; - } - case EAknCmdHelp: - { - TBool imSupported = iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM); - TBool voipSupported = iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EVoip); - if ( imSupported ) - { - if ( voipSupported ) - { // both Im and VOIP are enabled - LaunchHelpL( KSERVTAB_HLP_MAIN_VIEW_VOIPIM ); - } - else - {// only IM is enabled - LaunchHelpL( KSERVTAB_HLP_MAIN_VIEW_IM ); - } - } - else if ( voipSupported ) - { // only VOIP is enabled - LaunchHelpL( KSERVTAB_HLP_MAIN_VIEW_VOIP ); - } - - break; - } - case EAknCmdExit: - case EAknSoftkeyExit: - { - //exit from phone book. - Pbk2AppUi()->HandleCommandL( EAknSoftkeyExit ); - - break; - } - case ECmdSettings: - { - LaunchSettingsViewL(); - break; - } - - case ECmdLogout: - { - // this is for actual network logout - iCommandHandler.HandleCommandL(ELogoutService, this, &iServiceId); - break; - } - - case ECmdContactDetails: - { - TInt index = KErrNotFound; - if (iContainer) - { - index = iContainer->CurrentItemIndex(); - } - if(KErrNotFound != index) - { - TLaunchCCAData data; - data.iIndex = index; - iConnection = TCCAFactory::NewConnectionL(); - data.iConnection = iConnection; - iCommandHandler.HandleCommandL(ELaunchCCA, this, &data ); - } - break; - } - case ECmdOpenConversation: - { - if( iContainer ) - { - iContainer->SendMessageL(); - } - - break; - } - - case ECmdAddContact: - { - AddContactL( R_IM_ADD_CONTACT_MANUAL_QUERY ); - break; - } - - case ECmdContactEdit: - { - EditContactL(); - break; - } - case ECmdContactDelete: - { - if( iContainer ) - { - iContainer->SetClrFindPaneFlag(EFalse); - } - DeleteContactL(); - break; - } - case ECmdChangeStatus: - { - ChangeStatusProcessL(); - break; - } - case ECmdCancelLogin: - { - iCommandHandler.HandleCommandL( ECancelLogin , this , NULL ); - break; - } - - case ECmdOpenFriendRequest: - { - ProcessFriendRequestL(); - break; - } - - case ECmdAvatarGallery: - case ECmdAvatarNewPhoto: - { - CAvatarSelectionHandler* avatarHandler = CAvatarSelectionHandler::NewLC(); - HBufC* avatarFile = avatarHandler->HandleAvatarSelectionL( aCommand ); - if( avatarFile ) // if user selected the image - { - CleanupStack::PushL( avatarFile ); - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_SERVTAB_CHANGE_AVATAR_CHANGING, EFalse , ETrue ); - ChangeOwnAvatarL( *avatarFile , avatarHandler->MimeTypeL() ); - CleanupStack::PopAndDestroy(); //avatarFile - } - CleanupStack::PopAndDestroy(); // avatarHandler - break; - } - case ECmdDefaultAvatar: - { - ChangeOwnAvatarL( KNullDesC , KNullDesC8 ); - break; - } - - case ECmdCloseConversation: - { - CloseConversationL(); - break; - } - case ECmdChangeConnectioninWaitingState: - case ECmdChangeConnectioninOnlineState: - { - iEngine.ChangeConnectionL(); - break; - } - case ECmdBlock: - { - if( iContainer ) - { - iContainer->SetClrFindPaneFlag(EFalse); - } - BlockContactL(ETrue); - break; - } - case ECmdUnBlock: - { - if( iContainer ) - { - iContainer->SetClrFindPaneFlag(EFalse); - } - BlockContactL(); - break; - } - case ECmdGetBlockedList: - { - ShowBlockedContactListL(); - break; - } - case ECmdAIWAddToContact: - case ECmdAIWLinkToContact: - { - CreateOrLinkToPhoneBookL(aCommand); - break; - } - case ECmdContactAddAsFriend: - { - TInt index = KErrNotFound; - if (iContainer) - { - index = iContainer->CurrentItemIndex(); - } - MVIMPSTProcessArray& arrayprocess = iCommandHandler.GetProcessInterface(); - TVIMPSTEnums::TItem itemType = arrayprocess.GetType( index ); - if( itemType == TVIMPSTEnums::EUnknonContactItem ) - { - TPtrC userId = arrayprocess.GetItemUserId( index ); - AddContactL( R_IM_ADD_CONTACT_MANUAL_QUERY , userId ); - } - break; - } - case EAknCmdHideInBackground: - { - //in case of EAknCmdHideInBackground phonebook be in - //background and all the child application should close - - if(iConnection)// close connection to close cca - { - iConnection->Close(); - iConnection = NULL; - } - if (iServiceHandler)//reset selectionhandler so that it closes all the phonebook forms if open - { - iServiceHandler->Reset(); - iIsServiceHandleReSet = ETrue; - } - - Pbk2AppUi()->HandleCommandL( aCommand ); - - break; - } - default: - { - Pbk2AppUi()->HandleCommandL( aCommand ); - break; - } - } - } - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::DoActivateViewL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::DoActivateViewL( const TVwsViewId& aPrevViewId, - TUid /*aCustomMessageId*/, - const TDesC8& aCustomMessage) - { - // When ST is launched from widget or universal indicator plugin - // user clicks twice continuously, then DoActivateL is called - // twice, as iContainer is NULL since construction is not complete - // then it creates two controls (containers), hence to avoid this - // situation, we are checking if construction of iContainer has - // started, then we ignore DoActivateL second time. - MPbk2ViewActivationTransaction* viewActivationTransaction = - Pbk2AppUi()->Pbk2ViewExplorer()->HandleViewActivationLC( - iView.Id(), - aPrevViewId, - &iEngine.ServiceName(), - NULL, - EUpdateAll ); - - // Notifies startup monitor of view activation - if( Pbk2AppUi()->Pbk2StartupMonitor() ) - { - Pbk2AppUi()->Pbk2StartupMonitor()-> - NotifyViewActivationL( iView.Id() ); - } - - if (iEngine.IsUnInstalled()) - { - // engine is uninstalled, disable left softkey i.e options and provide only exit. - iView.Cba()->SetCommandSetL(R_AVKON_SOFTKEYS_EXIT); - } - else - { - // engine is constructed completely, provide tabbed view softkeys. - iView.Cba()->SetCommandSetL(R_IM_CONTACTS_TABBED_VIEW_SOFTKEYS); - } - - - ReadAndSetOwnUserIdL(); - - if (!iContainer&& !iContainerCreationStarted) - { - iContainerCreationStarted = ETrue; - iContainer = MVIMPSTUiTabbedViewControlFactory::NewTabControlL(*this, - &iView,iCommandHandler, iServiceId, - *iBrandHandler, iEngine, iView.Cba()); - // take the control pointer - CCoeControl* cCoeControl = iContainer->CoeControl(); - iAppUi->AddToStackL( iView, cCoeControl ); - cCoeControl->SetMopParent( &iView ); - cCoeControl->SetRect( iView.ClientRect() ); - cCoeControl->ActivateL(); - } - iStatusPaneHandler->SetTextL( iEngine.ServiceName() ); - // Commit application-wide state changes - viewActivationTransaction->Commit(); - CleanupStack::PopAndDestroy(); //viewActivationTransaction - - //CreateToolBarL(); - - if(TVIMPSTEnums::ESVCERegistered == iEngine.ServiceState()) - { - if(iIsToolBarHidden) - { - ShowHideFixedToolbarL(ETrue); - } - } - else - { - if(!iIsToolBarHidden) - { - ShowHideFixedToolbarL(EFalse); - } - } - - if(iContainer && iFocussedIDHistory ) - { - iContainer->SetFocussedId( iFocussedIDHistory->Des() ); - } - - /* - * aCustomMessage has following format if it is coming from Service Widget - * when you click on widget - * we need to unpack data in similar format - * version number --> stream.WriteInt8L(1); - * EEnd --> stream.WriteInt8L( 0 ); - * Service Id --> stream.WriteInt32L( iServiceId ); - * - * If function call is coming from other than service widget then - * aCustomMessage will not have data in above format - */ - - if(aCustomMessage.Length()) - { - RDesReadStream stream( aCustomMessage); - stream.PushL(); - TInt serviceId = KErrNotFound; - TRAP_IGNORE( const TUint versionNumber = stream.ReadUint8L(); //equal to 1 - TInt type = stream.ReadInt8L(); // equal to eend - serviceId = stream.ReadInt32L(); ); - CleanupStack::PopAndDestroy();//stream - if( serviceId == iServiceId ) - { - // this case will get excuted only when there is - // fresh login from service widget for first time only - // uid has been taken for autologin - // if the service id is matches to aCustomMessage - // it is auto login ,called from service widget - // start the login procedure - LoginL(); - } - } - UpdateToolbarL(); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::DoDeactivate -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::DoDeactivate() - { - - if(iFixedToolbar) - { - iIsToolBarHidden = ETrue; - delete iFixedToolbar; - iFixedToolbar = NULL; - } - - if (iContainer) - { - delete iFocussedIDHistory; - iFocussedIDHistory = NULL; - TRAP_IGNORE( iFocussedIDHistory = iContainer->GetFocussedId().AllocL() ); - iAppUi->RemoveFromStack( iContainer->CoeControl() ); - delete iContainer; - iContainer = NULL; - iContainerCreationStarted = EFalse; - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::HandleForegroundEventL -// -------------------------------------------------------------------------- -// -TAny* CVIMPSTUiTabbedView::UIExtensionViewExtension( - TUid aExtensionUid ) - { - if (aExtensionUid == KMPbk2UIExtensionView2Uid) - { - return static_cast(this); - } - return NULL; - } -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::HandleForegroundEventL -// -------------------------------------------------------------------------- -// - - void CVIMPSTUiTabbedView::HandleForegroundEventL(TBool aForeground) - { - if( aForeground && TVIMPSTEnums::ESVCENotRegistered == iEngine.ServiceState() ) - { - // user might has changed the setting read the new and refresh the view - // user can change setting in offline only - ReadAndSetOwnUserIdL(); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::HandleCommandKeyL -// -------------------------------------------------------------------------- -// -TBool CVIMPSTUiTabbedView::HandleCommandKeyL(const TKeyEvent& aKeyEvent, TEventCode /*aType*/) - { - TBool result = EFalse; - switch (aKeyEvent.iCode) - { - default: - { - break; - } - } - return result; - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::HandleStatusPaneSizeChange -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::HandleStatusPaneSizeChange() - { - // Resize the container to fill the client rectangle - if (iContainer) - { - iContainer->CoeControl()->SetRect( iView.ClientRect() ); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::CommandHandlerL -// -------------------------------------------------------------------------- -// -MVIMPSTCmdHandler& CVIMPSTUiTabbedView::CommandHandlerL() - { - return iCommandHandler; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::CommandFinishedL -// -------------------------------------------------------------------------- -// - -void CVIMPSTUiTabbedView::CommandFinishedL( - const MVIMPSTCmd& aCommand ) - { - TRACER_AUTO; - //handle the observer for commands issues thro HandleCommandL() - - switch (aCommand.CommandId()) - { - case ELoginService: - { - //login command is complete - //use aCommand.Result() to get the data - //Ownership is not given to the caller - break; - } - case ELogoutService: - { - //logout command is complete - //use aCommand.Result() to get the data - //Ownership is not given to the caller - break; - } - case ECmdProcessAcceptedContactNew: // accept create new - case ECmdProcessAcceptedContactExist: // update existing - case ECmdProcessSelectedContactNew: - case ECmdProcessSelectedContactExist:// add from phonebook - case EAddContact: - { - //addcontact command is complete - //use aCommand.Result() to get the data - //Ownership is not given to the caller - //some error occured. - if (iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - if(aCommand.Result() != KErrNone) - { - ShowErrorNoteL( aCommand.Result() ); - } - break; - } - case EDeleteContact: - { - //addcontact command is complete - //use aCommand.Result() to get the data - //Ownership is not given to the caller - //some error occured. - if (iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - if(aCommand.Result() != KErrNone) - { - HBufC* prompt = NULL; - prompt = StringLoader::LoadLC( R_IM_ERROR_SERVICE_ERR ); - TInt ret( VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ); - CleanupStack::PopAndDestroy(prompt); - } - break; - } - case EChangeOwnStatus: - { - TInt error = aCommand.Result(); - if( KErrNone == error ) - { - // show confirmation note - HBufC* text = CEikonEnv::Static()->AllocReadResourceLC( R_QTN_CHAT_CHANGE_STATUS_CHANGED ); - CAknConfirmationNote* dlg = new( ELeave )CAknConfirmationNote(); - dlg->ExecuteLD( *text ); - CleanupStack::PopAndDestroy( text ); - //get the status from the engine and update in the ui. - if(iContainer) - { - iContainer->HandleItemAdditionL(); - } - - } - else if( KErrCancel == error ) - { - // user cancelled, status was not updated - HBufC* text = NULL; - text = StringLoader::LoadLC( R_QTN_IM_CHANGE_STATUS_NOT_CHANGED ); - VIMPSTUtilsDialog::DisplayNoteDialogL( *text ); - CleanupStack::PopAndDestroy(); //onlineText - } - else - { - // change status failed - HBufC* failed = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_STATUS_FAILED ); - VIMPSTUtilsDialog::DisplayErrorNoteL( *failed ); - CleanupStack::PopAndDestroy( failed ); - } - break; - } - case EChangeOwnMessage: - { - TInt error = aCommand.Result(); - if( KErrNone == error ) - { - // show note qtn_chat_change_message_changing - HBufC* prompt = NULL; - prompt = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_MESSAGE_CHANGED ); - VIMPSTUtilsDialog::DisplayNoteDialogL( *prompt); - CleanupStack::PopAndDestroy(prompt); - } - else if( KErrCancel == error) - { - HBufC* prompt = NULL; - prompt = StringLoader::LoadLC( R_QTN_IM_CHANGE_STATUS_NOT_CHANGED ); - VIMPSTUtilsDialog::DisplayNoteDialogL( *prompt); - CleanupStack::PopAndDestroy(prompt); - } - else - { - HBufC* prompt = NULL; - prompt = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_MESSAGE_FAILED ); - VIMPSTUtilsDialog::DisplayNoteDialogL(*prompt ); - CleanupStack::PopAndDestroy(prompt); - } - - break; - } - case ESearch: - { - // Search command is complete - //use aCommand.Result() to get the data - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - if(aCommand.Result() != KErrNone) - { - HBufC* prompt = NULL; - prompt = StringLoader::LoadLC(R_QTN_CHAT_ERROR_NOT_SUP_FUNCTIONS ); - VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ; - CleanupStack::PopAndDestroy(prompt); - LaunchViewL(iExtensionService.TabbedViewId()); - } - } - case EFriendRejected: - case EFriendAccpeted: - { - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - if( ( aCommand.Result() != KErrNone ) && ( aCommand.CommandId() == EFriendAccpeted ) ) - { - HBufC* prompt = StringLoader::LoadLC( R_QTN_SERVTAB_SAVING_CONTACT_FAILED ); - VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ; - CleanupStack::PopAndDestroy(prompt); - } - break; - } - case EChangeOwnAvtar: - { - if(aCommand.Result() == KErrNone) // successfull show confirmation note - { - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - } - else // show error note - { - HBufC* prompt = StringLoader::LoadLC( R_QTN_SERVTAB_ERROR_UPDATE_AVATAR ); - VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ; - CleanupStack::PopAndDestroy(prompt); - } - break; - } - case ECmdBlockContact: - { - TRACE("block finished enter"); - //blockcontact command is complete - //use aCommand.Result() to get the data - //Ownership is not given to the caller - //some error occured. - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - if(aCommand.Result() != KErrNone) - { - TRACE( "aCommand result = %d ", aCommand.Result() ); - HBufC* prompt = NULL; - prompt = StringLoader::LoadLC( R_QTN_CHAT_BLOCKING_FAILED ); - TRACE("blocking error prompt displaying"); - TInt ret( VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ); - CleanupStack::PopAndDestroy(prompt); - } - break; - } - case ECmdUnBlockContact: - { - TRACE("unblock finished enter"); - - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - //unblockcontact command is complete - //use aCommand.Result() to get the data - //Ownership is not given to the caller - //some error occured. - if(aCommand.Result() != KErrNone) - { - TRACE( "aCommand result = %d ", aCommand.Result() ); - HBufC* prompt = NULL; - prompt = StringLoader::LoadLC( R_QTN_CHAT_UNBLOCKING_FAILED ); - TRACE("unblocking error prompt displaying"); - TInt ret( VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt ) ); - CleanupStack::PopAndDestroy(prompt); - } - else - { - TRACE("unblocking successful"); - - if(iContainer) - { - TInt index = CurrentItemIndex(); - if( index > 0 ) - { - MVIMPSTProcessArray& arrayprocess = iCommandHandler.GetProcessInterface(); - HBufC* contactId = arrayprocess.GetItemUserId(index).AllocLC(); - if( contactId->Length() ) - { - TRACE("HandleAvatarRefreshl calling for unblock"); - iContainer->HandleAvatarRefreshL(*contactId,EFalse); - - } - } - CleanupStack::PopAndDestroy(); - } - } - break; - } - default: - { - //should never be here. - break; - } - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ShowErrorNoteL -// -------------------------------------------------------------------------- -void CVIMPSTUiTabbedView::ShowErrorNoteL(TInt aError ) - { - TRACER_AUTO; - HBufC* textResource = NULL; - switch( aError) - { - case EErrExistInBlockList: - { - textResource = StringLoader::LoadLC( R_QTN_SERVTAB_ADD_FRIEND_BLOCKED); - break; - } - case KErrAlreadyExists : - case EErrExistInContactList: - { - textResource = StringLoader::LoadLC( R_QTN_SERTAB_CONTACT_ALREADY_EXISTS_ERROR_NOTE); - break; - } - default : - { - textResource = StringLoader::LoadLC( R_QTN_SERVTAB_SAVING_CONTACT_FAILED ); - break; - } - } - if( textResource ) - { - CAknInformationNote* note = new ( ELeave ) CAknInformationNote; - note->ExecuteLD( *textResource ); - CleanupStack::PopAndDestroy( textResource ); - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::HandleCommandEventL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::HandleCommandEventL(TVIMPSTEnums::TVIMPSTRegistrationState aState, TInt /*aServiceError*/) - { - switch (aState) - { - case TVIMPSTEnums::ESVCERegistered: - { - // this is to make sure that it always has the user id - // some services they do not have the user id in offline case - // like skype ,get the user if service is logged in - if( !iUserId || iUserId->Length() == 0 ) - { - // read if user id is empty only - ReadAndSetOwnUserIdL(); - } - TInt isSuccessfulLogin = 0; - iSettingsStore->GetL(iServiceId, EServiceSuccessfullLogin, isSuccessfulLogin); - if(!isSuccessfulLogin) - { - isSuccessfulLogin = 1; - iSettingsStore->SetL(iServiceId, EServiceSuccessfullLogin, isSuccessfulLogin); - } - if(iIsToolBarHidden) - { - ShowHideFixedToolbarL(ETrue); - } - break; - } - case TVIMPSTEnums::ESVCENotRegistered: - { - // might user has choosen some diff user id while login - // set to store and engine etc - ReadAndSetOwnUserIdL(); - - // no need to hide the tool bar here as its already called while in the - // disconnecting state. - // assume in some cornere scenario, where network is lost, and the ui does not - // get a callback for disconnecting state then we need to call hidetoolbar in this case. - // hence the flag iIsToolBarHidden will set it when ever the tool bar is hidden - if(!iIsToolBarHidden) - { - ShowHideFixedToolbarL(EFalse); - } - break; - } - case TVIMPSTEnums::ESVCENetworkConnecting: - { - // might user has choosen some diff user id while login - // set to store and engine etc - ReadAndSetOwnUserIdL(); - break; - } - case TVIMPSTEnums::ESVCEWaitingForNetwork: - { - break; - } - case TVIMPSTEnums::ESVCENetworkDisConnecting: - { - if(!iIsToolBarHidden) - { - ShowHideFixedToolbarL(EFalse); - } - break; - } - case TVIMPSTEnums::ESVCEUpdatingContacts: - { - // might user has choosen some diff user id while login - // set to store and engine etc - // this is to make sure that it always has the user id - // some services they do not have the user id in offline case - // like skype ,get the user if service is logged in - if( !iUserId || iUserId->Length() == 0 ) - { - // read if user id is empty only - ReadAndSetOwnUserIdL(); - } - break; - } - default: - { - //should never be here. - break; - } - - } - if(iContainer) - { - iContainer->HandleItemAdditionL(); - } - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::CurrentItemIndex -// -------------------------------------------------------------------------- -// -TInt CVIMPSTUiTabbedView:: CurrentItemIndex() - { - TInt index = KErrNone; - iContainer?(index = iContainer->CurrentItemIndex()):(index = KErrNotFound); - return index; - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ReadAndSetOwnUserIdL() -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ReadAndSetOwnUserIdL() - { - if( iUserId ) - { - delete iUserId; - iUserId = NULL; - } - iUserId = iEngine.GetOwnUserIdFromCChOrStorageL(); - iEngine.SetOwnUserIdIfChangedL( *iUserId ); - } -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::AddContactL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::AddContactL( const TInt aResouceId, const TDesC& aUserId ) - { - TRACER_AUTO; - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - if (storage) - { - if (!storage->IsLocalStore()) - { - HBufC* userid = HBufC::NewL(KUsernameMaxLength); - CleanupStack::PushL( userid ); - TPtr useridPtr( userid->Des() ); - - useridPtr.Copy( aUserId.Left( KUsernameMaxLength ) ); - TInt result = 0; - if( useridPtr == KNullDesC ) - { - CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( useridPtr, CAknQueryDialog::ENoTone ); - dlg->SetPredictiveTextInputPermitted( ETrue ); // T9 - result = dlg->ExecuteLD( aResouceId ); - } - if( ( result == EAknSoftkeyOk ) || ( result == EAknSoftkeyYes ) || ( useridPtr != KNullDesC ) ) - { - TPtrC ownUserId = storage->OwnContactL().UserId(); - if(useridPtr.Compare( ownUserId ) == 0) //Do not add own data item to contact list - { - //show note "Own Data Item cannot be added" - HBufC* failed = StringLoader::LoadLC( R_QTN_SERVTAB_ERROR_ADDOWN ); - VIMPSTUtilsDialog::DisplayErrorNoteL( *failed ); - CleanupStack::PopAndDestroy( failed ); - } - else - { - CVIMPSTUtilsWaitNote* note = CVIMPSTUtilsWaitNote::ShowWaitNoteLC( R_QTN_SERVTAB_SAVING_CONTACT ,ETrue); - iCommandHandler.HandleCommandL(EAddContact, this, userid ); - CleanupStack::PopAndDestroy( note ); - } - } - CleanupStack::PopAndDestroy(userid); - } - else // server store - - { - //////////////////////////////////////////// - ReInitializeServiceHandlerL(); - TUint assignFlags = 0; - //for unknown item createnew/update existing querry is shown - // check whether the selected contact is unknown - if( iCommandHandler.GetProcessInterface().GetType(iContainer->CurrentItemIndex()) == TVIMPSTEnums::EUnknonContactItem ) - { - iSelectedAction = ShowNewUpdateQueryL(); - if(CVIMPSTUiTabbedView::EInvitAcceptCreateNew == iSelectedAction )//create new - { - assignFlags |= ECreateNewContact; - iSelectedAction = EContactCreateNew; - } - else if(CVIMPSTUiTabbedView::EInvitAcceptUpdateExisting == iSelectedAction ) // update existing - { - iSelectedAction = EContactAddFromContacts; - } - else // selected cancle option - { - return; - } - } - else // not unknown contact - { - iSelectedAction = EContactCreateNew; - assignFlags |= ECreateNewContact; - } - //show the phonebook dialog for create new/update existing option - if(iAiwParamList) - { - delete iAiwParamList; - iAiwParamList = NULL; - } - iAiwParamList = CAiwGenericParamList::NewL(); - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamContactAssignData, - TAiwVariant(TAiwSingleContactAssignDataV1Pckg( - TAiwSingleContactAssignDataV1().SetFlags( assignFlags ))))); - - if( aUserId.Length() > 0 ) - { - // add user id in impp field - TBuf xspId; //xsp max length - xspId.Append(iEngine.ServiceName()); - xspId.Append(KColon); - xspId.Append(aUserId); - - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamXSpId, - TAiwVariant(xspId) ) ); - } - iServiceHandler->ExecuteServiceCmdL( - KAiwCmdAssign, - *iAiwParamList, - iServiceHandler->OutParamListL(), - 0, - this); - } - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::CreateOrLinkToPhoneBookL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::CreateOrLinkToPhoneBookL(TInt aCommand ) - { - TRACER_AUTO; - TInt index = CurrentItemIndex(); - if( index <= 0 ) - { - return; - } - TUint assignFlags = 0; - if(ECmdAIWAddToContact == aCommand )//create new option - { - assignFlags |= ECreateNewContact; - } - TPtrC itemUserId = iCommandHandler.GetProcessInterface().GetItemUserId(index) ; - if(iAiwParamList) - { - delete iAiwParamList; - iAiwParamList = NULL; - } - iAiwParamList = CAiwGenericParamList::NewL(); - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamContactAssignData, - TAiwVariant(TAiwSingleContactAssignDataV1Pckg( - TAiwSingleContactAssignDataV1().SetFlags( assignFlags ))))); - - TBuf xspid; - xspid.Append(iEngine.ServiceName()); - xspid.Append(KColon); - xspid.Append(itemUserId); - ReInitializeServiceHandlerL(); - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamXSpId, - TAiwVariant(xspid)) ); - - iServiceHandler->ExecuteServiceCmdL( KAiwCmdAssign, - *iAiwParamList, - iServiceHandler->OutParamListL(), - 0, - this); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::EditContactL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::EditContactL() - { - TRACER_AUTO; - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId); - if (storage) - { - if( storage->IsLocalStore()) - { - iSelectedAction = KErrNotFound; - TInt index = CurrentItemIndex(); - MVPbkContactLink* contactLink = iCommandHandler.GetProcessInterface().ContactLink(index); - //show the phonebook dialog for edit existing data - if(iAiwParamList) - { - delete iAiwParamList; - iAiwParamList = NULL; - } - iAiwParamList = CAiwGenericParamList::NewL(); - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamContactAssignData, - TAiwVariant(TAiwSingleContactAssignDataV1Pckg( - TAiwSingleContactAssignDataV1().SetFlags( EskipInfoNotes ))))); - - HBufC8* packedLinks = contactLink->PackLC(); - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamContactLinkArray, - TAiwVariant(*packedLinks) ) ); - ReInitializeServiceHandlerL(); - - iServiceHandler->ExecuteServiceCmdL( - KAiwCmdAssign, - *iAiwParamList, - iServiceHandler->OutParamListL(), - 0, - this); - CleanupStack::PopAndDestroy(); // packedLinks - } - } - } - - - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::AddContactL -// -------------------------------------------------------------------------- -void CVIMPSTUiTabbedView::AddContactL(RPointerArray aContacts) - { - TRACER_AUTO; - TInt count = aContacts.Count(); - - switch( count ) - { - case 0://no xsp found. - { - //launch add manually dialog. - AddContactL( R_IM_ADD_CONTACT_MANUAL_QUERY );//to do replace with some thing else. - break; - } - case 1://1 xsp foud. - { - //add new contact. - HBufC* xspId = aContacts[0]; - AddContactL( R_IM_ADD_CONTACT_MANUAL_QUERY, *xspId ); - break; - } - default :// > 1 xsp found. - { - //show single selection dialog - TInt selectionIndex = 0; - CDesCArray* xspIds = new( ELeave )CDesCArrayFlat( count ); - CleanupStack::PushL( xspIds ); - - //add all xsp(s) from aContacts to xspIds. - for( TInt i = 0 ; i < count ; i++ ) - { - xspIds->AppendL( *aContacts[i] ); - } - - HBufC* titleText = StringLoader::LoadLC( R_QTN_SERVTAB_SELECT_USER ); - - TInt ret = VIMPSTUtilsDialog::DisplayListQueryDialogL( &selectionIndex, - xspIds, - R_IM_LIST_SELECT_STATUS_MESSAGE_DLG, - *titleText, - KNullDesC, - ETrue ); - CleanupStack::PopAndDestroy( titleText ); - - - if ( ret == EAknSoftkeyOk || ret == EAknSoftkeyDone || ret == EAknSoftkeySelect ) - { - TPtrC selectedXspid = (*xspIds)[selectionIndex]; - AddContactL( R_IM_ADD_CONTACT_MANUAL_QUERY, selectedXspid ); - } - CleanupStack::PopAndDestroy(xspIds); - break; - } - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::CopyToPhoneBookL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::CopyToPhoneBookL() - { - TRACER_AUTO; - TInt index = CurrentItemIndex(); - - TPtrC name( KNullDesC ); - if( index <= 0 ) - { - // return if item not found - return; - } - - TPtrC seletctedItem = iCommandHandler.GetProcessInterface().GetItemUserId(index) ; - - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL(iServiceId) ; - if(storage) - { - MVIMPSTStorageContact* contact = storage->FindContactByUserId(seletctedItem); - if(contact) - { - CVIMPSTUtilsWaitNote* note = CVIMPSTUtilsWaitNote::ShowWaitNoteLC( R_QTN_SERVTAB_SAVING_CONTACT ,ETrue); - iCommandHandler.HandleCommandL(EAddToPbk, this, contact ); - CleanupStack::PopAndDestroy(note); - } - } - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::DeleteContactL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView:: DeleteContactL() - { - TRACER_AUTO; - TInt index = CurrentItemIndex(); - HBufC* deletePrompt = NULL; - TPtrC name( KNullDesC ); - - if(iContainer) - { - iContainer->CheckAndSetLastItemFlag(); - } - if( index <= 0 ) - { - // return if item not found - return; - } - - TPtrC seletctedItem = iCommandHandler.GetProcessInterface().GetItemUserId(index) ; - name.Set( seletctedItem ); - - deletePrompt = StringLoader::LoadLC( R_QTN_SERVTAB_DELETE_CONTACT, name, CCoeEnv::Static() ); - TInt ret( VIMPSTUtilsDialog::DisplayQueryDialogL(R_GENERIC_YES_NO_CONFIRMATION_QUERY, *deletePrompt ) ); - CleanupStack::PopAndDestroy( deletePrompt ); - - MVPbkContactLink* contactLink = iCommandHandler.GetProcessInterface().ContactLink(index); - - if( ( ret == EAknSoftkeyOk ) || ( ret == EAknSoftkeyYes ) ) - { - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_CHAT_DELETING_CONTACT ,ETrue); - iCommandHandler.HandleCommandL(EDeleteContact, this, &contactLink ); - } - } - - - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ChangeStatusProcessL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ChangeStatusProcessL() - { - TRACER_AUTO; - if( iEngine.ServiceState() ) - { - // Check variation - TInt showAppearOffline = 1; - TInt showAway = 1 ; - TInt showBusy = 1; - - TInt awayIndex( 0 ); - TInt busyIndex( 0 ); - TInt appOfflineIndex( 0 ); - - // first icon is online - // calculate indexes for other icons - if ( showAway) - { - awayIndex++; - busyIndex++; - appOfflineIndex++; - } - else - { - awayIndex = -1; - } - - if ( showBusy ) - { - busyIndex++; - appOfflineIndex++; - } - else - { - busyIndex = -1; - } - - if ( showAppearOffline ) - { - appOfflineIndex++; - } - else - { - appOfflineIndex = -1; - } - - TInt status( 0 ); - CAknListQueryDialog* dlg = new ( ELeave ) - CAknListQueryDialog( &status ); - dlg->PrepareLC( R_IM_STATUS_CHANGE_DLG ); - - // Format the texts - // Create a array for texts - CDesCArray* listItemsArray = - new ( ELeave ) CDesCArrayFlat( KAmountOfOwnStatusStates ); - CleanupStack::PushL( listItemsArray ); - - // Online - HBufC* onlineText = NULL; - onlineText = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_OWN_ONLINE ); - - HBufC* itemTxtOnline = - HBufC::NewLC( KTabFormatLenght + onlineText->Length() ); - TPtr itemTxtPtrOnline( itemTxtOnline->Des() ); - - itemTxtPtrOnline.Format( KTabFormat, KOnlineIconIndex ); - itemTxtPtrOnline.Append( *onlineText ); - listItemsArray->AppendL( itemTxtPtrOnline ); - CleanupStack::PopAndDestroy( itemTxtOnline ); - CleanupStack::PopAndDestroy( onlineText ); - - // Away - if ( showAway ) - { - HBufC* awayText = NULL; - awayText = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_OWN_AWAY ); - - HBufC* itemTxtAway = HBufC::NewLC( - KTabFormatLenght + awayText->Length() ); - TPtr itemTxtPtrAway( itemTxtAway->Des() ); - - itemTxtPtrAway.Format( KTabFormat, awayIndex ); - itemTxtPtrAway.Append( *awayText ); - listItemsArray->AppendL( itemTxtPtrAway ); - CleanupStack::PopAndDestroy( itemTxtAway ); - CleanupStack::PopAndDestroy( awayText ); - } - - // Busy - if ( showBusy ) - { - HBufC* busyText = NULL; - busyText = StringLoader::LoadLC( R_QTN_SERVTAB_CHANGE_OWN_DND ); - - HBufC* itemTextBusy = HBufC::NewLC( - KTabFormatLenght + busyText->Length() ); - TPtr itemTxtPtrBusy( itemTextBusy->Des() ); - - itemTxtPtrBusy.Format( KTabFormat, busyIndex ); - itemTxtPtrBusy.Append( *busyText ); - listItemsArray->AppendL( itemTxtPtrBusy ); - CleanupStack::PopAndDestroy( itemTextBusy ); - CleanupStack::PopAndDestroy( busyText ); - } - // Appear offline - if ( showAppearOffline ) - { - HBufC* offlineText = NULL; - offlineText = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_OWN_APPEAR_OFFLINE ); - - HBufC* itemTextOffline = HBufC::NewLC( - KTabFormatLenght + offlineText->Length() ); - TPtr itemTxtPtrOffline( itemTextOffline->Des() ); - - itemTxtPtrOffline.Format( KTabFormat, appOfflineIndex ); - itemTxtPtrOffline.Append( *offlineText ); - listItemsArray->AppendL( itemTxtPtrOffline ); - CleanupStack::PopAndDestroy( itemTextOffline ); - CleanupStack::PopAndDestroy( offlineText ); - } - - // Set the array - dlg->SetOwnershipType( ELbmOwnsItemArray ); - CleanupStack::Pop( listItemsArray ); - dlg->SetItemTextArray( listItemsArray ); - - // Add icons - CArrayPtr< CGulIcon >* icons = LoadOwnStatusIconsL(); - - - dlg->SetIconArrayL( icons ); // transfers ownership - // TODO::get own status - - // get dialog's listbox - CEikListBox* listBox = dlg->ListBox(); - - //listBox->SetCurrentItemIndex( 0 ); - - TInt result = dlg->RunLD(); - - //structure to pack status and status text. - TStatusAndStatusText statusAndSatatustext; - - TInt error( KErrNone ); - if ( ( result == EAknSoftkeyOk ) || - ( result == EAknSoftkeySelect ) ) - { - if ( status == 0 ) - { - TInt autoStatusMsgEnabledForOnline = 1; /*IMUtils::IntResourceValueL( RSC_CHAT_VARIATION_ONLINE_AUTO );*/ - if( autoStatusMsgEnabledForOnline ) - { - error = AskStatusMessageL( TVIMPSTEnums::EOnline, EFalse ); - } - if( error == KErrNone ) - { - statusAndSatatustext.iStatus = TVIMPSTEnums::EOnline; - statusAndSatatustext.iStatusText.Copy(iStatusMessage->Des()); - CVIMPSTUtilsWaitNote* note = CVIMPSTUtilsWaitNote::ShowWaitNoteLC( R_QTN_CHAT_CHANGE_STATUS_CHANGING ); - error = iCommandHandler.HandleCommandL(EChangeOwnStatus, this, &statusAndSatatustext); - CleanupStack::PopAndDestroy( note ); - } - } - else if ( status == awayIndex ) // Away - { - // can't get here unless Away is enabled - TInt autoStatusMsgEnabledForAway = 1; - //IMUtils::IntResourceValueL( RSC_CHAT_VARIATION_AWAY_AUTO ); - if( autoStatusMsgEnabledForAway ) - { - error = AskStatusMessageL( TVIMPSTEnums::EAway, EFalse ); - } - if( error == KErrNone ) - { - statusAndSatatustext.iStatus = TVIMPSTEnums::EAway; - statusAndSatatustext.iStatusText.Copy(iStatusMessage->Des()); - CVIMPSTUtilsWaitNote* note = CVIMPSTUtilsWaitNote::ShowWaitNoteLC( R_QTN_CHAT_CHANGE_STATUS_CHANGING ); - error = iCommandHandler.HandleCommandL(EChangeOwnStatus, this, &statusAndSatatustext); - CleanupStack::PopAndDestroy( note ); - } - } - - else if ( status == busyIndex ) // Busy - { - // can't get here unless Busy is enabled - TInt autoStatusMsgEnabledForBusy = 1; - //IMUtils::IntResourceValueL( RSC_CHAT_VARIATION_BUSY_AUTO ); - if( autoStatusMsgEnabledForBusy ) - { - error = AskStatusMessageL( TVIMPSTEnums::EBusy, EFalse ); - } - if( error == KErrNone ) - { - statusAndSatatustext.iStatus = TVIMPSTEnums::EBusy; - statusAndSatatustext.iStatusText.Copy(iStatusMessage->Des()); - CVIMPSTUtilsWaitNote* note = CVIMPSTUtilsWaitNote::ShowWaitNoteLC( R_QTN_CHAT_CHANGE_STATUS_CHANGING ); - error = iCommandHandler.HandleCommandL(EChangeOwnStatus, this, &statusAndSatatustext); - CleanupStack::PopAndDestroy( note ); - - } - } - else if ( status == appOfflineIndex ) //appearOffline - { - - statusAndSatatustext.iStatus = TVIMPSTEnums::EInvisible; - statusAndSatatustext.iStatusText.Copy(iStatusMessage->Des()); - CVIMPSTUtilsWaitNote* note = CVIMPSTUtilsWaitNote::ShowWaitNoteLC( R_QTN_CHAT_CHANGE_STATUS_CHANGING ); - error = iCommandHandler.HandleCommandL(EChangeOwnStatus, this, &statusAndSatatustext); - CleanupStack::PopAndDestroy( note ); - } - else - { - HBufC* text = NULL; - text = StringLoader::LoadLC( R_QTN_IM_CHANGE_STATUS_NOT_CHANGED ); - VIMPSTUtilsDialog::DisplayNoteDialogL( *text ); - CleanupStack::PopAndDestroy( text ); - } - //iUISessionManager->SetStatusPaneIconsL(); - } - } - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::LoadOwnStatusIconsL -// --------------------------------------------------------- -// -CAknIconArray* CVIMPSTUiTabbedView::LoadOwnStatusIconsL() - { - TRACER_AUTO; - CAknIconArray* icons = iBrandHandler->LoadOwnStatusIconsLC(); - CleanupStack::Pop( icons ); - return icons; - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::AskStatusMessageL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -TInt CVIMPSTUiTabbedView::AskStatusMessageL( TVIMPSTEnums::TOnlineStatus aStatus, - TBool aUpdateToNetwork ) - { - TRACER_AUTO; - CDesCArray* statusMessages = new( ELeave )CDesCArrayFlat(4); - CleanupStack::PushL( statusMessages ); - - HBufC* firstLine = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_NEW_MESSAGE ); - statusMessages->AppendL( *firstLine ); - CleanupStack::PopAndDestroy( firstLine ); - - // Read status messages - ReadStatusMessagesL( *statusMessages, aStatus ); - - // show the query - TInt selectionIndex( statusMessages->Count() > 1 ? 1 : 0 ); - - // Force to continue if selection query is not shown - TInt ret = EAknSoftkeyOk; - - if( selectionIndex == 1 ) - { - // There were previous status messages, show selection query - HBufC* titleText = StringLoader::LoadLC( R_QTN_CHAT_CHANGE_SELECT_MESSAGE ); - ret = VIMPSTUtilsDialog::DisplayListQueryDialogL( &selectionIndex, statusMessages, - R_IM_LIST_SELECT_STATUS_MESSAGE_DLG, - *titleText, KNullDesC, ETrue ); - CleanupStack::PopAndDestroy( titleText ); - } - - if ( !( ret == EAknSoftkeyOk || ret == EAknSoftkeyDone || ret == EAknSoftkeySelect ) ) - { - CleanupStack::PopAndDestroy( statusMessages ); - return KErrCancel; - } - - TPtr statusTxt( iStatusMessage->Des() ); - statusTxt.Zero(); - - if( selectionIndex != 0 ) - { - statusTxt.Copy( ( *statusMessages) [ selectionIndex ] ); - } - - TInt result = VIMPSTUtilsDialog::DisplayTextQueryDialogL( - statusTxt , - R_QTN_CHAT_CHANGE_STATUS_MESSAGE, - R_IM_ENTER_STATUS_MESSAGE_QUERY, - ETrue, // T9 - ETrue // LSK always visible - ); - - if ( (result == EAknSoftkeyOk || result == EAknSoftkeyDone )&&(iEngine.ServiceState())) - { - - // Delete first line. - statusMessages->Delete( 0 ); - statusMessages->InsertL( 0, statusTxt ); - WriteStatusMessagesL( *statusMessages, aStatus ); - if( aUpdateToNetwork ) - { - CVIMPSTUtilsWaitNote* note = CVIMPSTUtilsWaitNote::ShowWaitNoteLC( R_QTN_CHAT_CHANGE_MESSAGE_CHANGING ); - //structure to pack status and status text. - TStatusAndStatusText statusAndSatatustext; - statusAndSatatustext.iStatus = aStatus; - statusAndSatatustext.iStatusText.Copy( statusTxt ); - iCommandHandler.HandleCommandL(EChangeOwnMessage, this, &statusAndSatatustext); - CleanupStack::PopAndDestroy( note ); - } - } - else - { - CleanupStack::PopAndDestroy();//statusMessages - return KErrCancel; - } - CleanupStack::PopAndDestroy(); //statusMessages - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ReadStatusMessagesL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ReadStatusMessagesL( CDesCArray& aArray, TVIMPSTEnums::TOnlineStatus aStatus) - { - TRACER_AUTO; - RBuf buffer; - buffer.CreateL( RProperty::KMaxPropertySize ); - CleanupClosePushL( buffer ); - TInt err(KErrNone); - switch ( aStatus ) - { - case TVIMPSTEnums::EOnline: - { - err = iSettingsStore->GetL( iServiceId, EServiceOwnStatusMessagesOnline, buffer ); - break; - } - case TVIMPSTEnums::EBusy: - { - err = iSettingsStore->GetL( iServiceId, EServiceOwnStatusMessagesBusy, buffer ); - break; - } - case TVIMPSTEnums::EAway: - { - err = iSettingsStore->GetL( iServiceId, EServiceOwnStatusMessagesAway, buffer ); - break; - } - } - TBuf< KStatusMessageHeaderLength > header; - - TInt countOfMessages( 0 ); - TInt offset( 1 ); // First character is for header length - TInt headerLength( 0 ); - if( err == KErrNone && buffer.Length() ) - { - TLex lexer( buffer.Left( 1 ) ); - err = lexer.Val( headerLength ); - } - else - { - err = KErrEof; - } - while( err == KErrNone && countOfMessages < KMaxStatusMessageCount ) - { - TPtrC ptr( buffer.Mid( offset ) ); - if( ptr.Length() > headerLength ) - { - header.Copy( ptr.Left( headerLength ) ); - header.Trim(); - TLex lexer( header ); - offset += headerLength; - TInt messageLength( 0 ); - err = lexer.Val( messageLength ); - if( err == KErrNone ) - { - ptr.Set( buffer.Mid( offset ) ); - if( ptr.Length() >= messageLength ) - { - if (messageLength) - { - aArray.AppendL( ptr.Left( messageLength ) ); - ++countOfMessages; // this should be increased only for not null messages. - } - offset += messageLength; - } - else - { - err = KErrEof; - } - } - } - else - { - err = KErrEof; - } - } - CleanupStack::PopAndDestroy(); //buffer - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::WriteStatusMessagesL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// - -void CVIMPSTUiTabbedView::WriteStatusMessagesL( MDesCArray& aArray, TVIMPSTEnums::TOnlineStatus aStatus ) - { - TRACER_AUTO; - TPtrC firstLine = aArray.MdcaPoint( 0 ); - TInt countOfMessages( 0 ); - TInt arrayCount( aArray.MdcaCount() ); - TInt index( 0 ); - - RBuf buffer; - buffer.CreateL( RProperty::KMaxPropertySize ); - CleanupClosePushL( buffer ); - - TBuf< KStatusMessageHeaderLength > header; - // Read the array and append the buffer - while( index < arrayCount && countOfMessages < KMaxStatusMessageCount ) - { - if( index == 0 ) - { - header.Format( KStatusMessageHeaderLengthFormat, - KStatusMessageHeaderLength ); - buffer.Append( header ); - } - TPtrC message = aArray.MdcaPoint( index ); - if( index == 0 || message.CompareF( firstLine ) != 0 ) - { - header.Format( KStatusMessageHeaderFormat, message.Length() ); - buffer.Append( header ); - buffer.Append( message ); - //skipping increase of countOfMessages is to get one more status message if it is null. - if( message.Length() ) // null status message - { - ++countOfMessages; - } - } - ++index; - } - switch ( aStatus ) - { - case TVIMPSTEnums::EOnline: - { - iSettingsStore->SetL( iServiceId, EServiceOwnStatusMessagesOnline, buffer ); - break; - } - case TVIMPSTEnums::EBusy: - { - iSettingsStore->SetL( iServiceId, EServiceOwnStatusMessagesBusy, buffer ); - break; - } - case TVIMPSTEnums::EAway: - { - iSettingsStore->SetL( iServiceId, EServiceOwnStatusMessagesAway, buffer ); - break; - } - } - CleanupStack::PopAndDestroy(); // buffer - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ChangeOwnStatusMessageL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ChangeOwnStatusMessageL() - { - TVIMPSTEnums::TOnlineStatus status = iCommandHandler.GetProcessInterface().GetOnlineStatusL( 0 ); //0 for own status item - // ETrue meaning network change required - AskStatusMessageL(status, ETrue); - } -// ----------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ChangeOwnAvatarL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ChangeOwnAvatarL(const TDesC& aFileName, const TDesC8& aMimeType ) - { - TRACER_AUTO; - MVIMPSTProcessArray& arrayprocess = iCommandHandler.GetProcessInterface(); - TAvatarData avatarData; - avatarData.iStatus = arrayprocess.GetOnlineStatusL(0); - avatarData.iStatusText.Copy( arrayprocess.StatusTextL(0) ); - avatarData.iFileName.Set(aFileName); - avatarData.iMimeType.Set(aMimeType); - iCommandHandler.HandleCommandL(EChangeOwnAvtar, this, &avatarData); - } -// ----------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::GetServiceState -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TVIMPSTEnums::TVIMPSTRegistrationState CVIMPSTUiTabbedView::GetServiceState() - { - return iEngine.ServiceState(); - } - - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::SearchContactsL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView:: SearchContactsL() - { - TRACER_AUTO; - CVIMPSTUiSearchFieldArray& fieldArray = iExtensionService.GetSearchFieldArray(); - - if( !fieldArray.Count() ) - { - return; - } - - if(!iIsToolBarHidden) - { - ShowHideFixedToolbarL(EFalse); - } - - if (iContainer) - { - iContainer->DeactivateFindPaneL(); - } - - fieldArray.ResetFieldData(); - fieldArray.SetSearchType( EIMBasicSearch ); - //Launch the search view with search dialog - LaunchViewL( iExtensionService.SearchViewId() ); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::LaunchViewL() -// --------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::LaunchViewL( TInt aViewId ) - { - TRACER_AUTO; - - CPbk2ViewState* state = CPbk2ViewState::NewLC( ); - - TInt searchViewId; - TInt err = iMapper.GetNewView( - KIMCONTACTSEXTNIMPLEMENTATIONUID, - aViewId, - searchViewId ); - User::LeaveIfError( err ); - Phonebook2::Pbk2AppUi()->Pbk2ViewExplorer()->ActivatePhonebook2ViewL - (TUid::Uid(searchViewId), state); - - CleanupStack::PopAndDestroy( state ); - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::CreateToolBarL -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::CreateToolBarL() - { - TRACER_AUTO; - if ( AknLayoutUtils::PenEnabled() ) - { - TInt resourceId = 0; - if(iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM) && - !iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EVoip)) - { - resourceId = R_IM_APP_TOOLBAR; - } - else if(iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EVoip) && - !iEngine.IsSubServiceSupportedL(TVIMPSTEnums::EIM)) - { - resourceId = R_VOIP_APP_TOOLBAR; - } - else - { - resourceId = R_IM_VOIP_APP_TOOLBAR; - } - if ( resourceId != 0 && !iFixedToolbar ) - { - CAknToolbar* temp = iFixedToolbar; - - iFixedToolbar = CAknToolbar::NewL( resourceId ); - iFixedToolbar->SetToolbarObserver( this ); - iFixedToolbar->SetCloseOnAllCommands( EFalse ); - CEikAppUiFactory* appUiFactory = - static_cast(CEikonEnv::Static()->AppUiFactory() ); - appUiFactory->SetViewFixedToolbar( iFixedToolbar ); - - iFixedToolbar->SetToolbarVisibility( EFalse, EFalse ); - delete temp; - temp = NULL; - } - } - else - { - delete iFixedToolbar; - iFixedToolbar = NULL; - } - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::UpdateToolbarL -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::UpdateToolbarL() - { - TRACER_AUTO; - if ( AknLayoutUtils::PenEnabled() && iFixedToolbar && iContainer ) - { - TInt currentItemIndex = iContainer->CurrentItemIndex(); - TVIMPSTEnums::TItem itemType = iCommandHandler.GetProcessInterface().GetType(currentItemIndex); - TVIMPSTEnums::TOnlineStatus onlinestatus = iCommandHandler.GetProcessInterface().GetOnlineStatusL(currentItemIndex); - TBool imEnabled = iEngine.IsSubServiceEnabled(TVIMPSTEnums::EIM); - TBool voipEnabled = iEngine.IsSubServiceEnabled(TVIMPSTEnums::EVoip); - TPtrC selectedItem = iCommandHandler.GetProcessInterface().GetItemUserId(currentItemIndex); - - if(voipEnabled && imEnabled) - { - if( TVIMPSTEnums::EOwnStatusItem == itemType || - TVIMPSTEnums::EFriendRequestItem == itemType || - KErrNotFound == currentItemIndex ) - { - iFixedToolbar->SetItemDimmed( ECmdToolbarVoipCall, ETrue, EFalse ); - iFixedToolbar->SetItemDimmed( ECmdToolbarChat, ETrue, EFalse ); - iFixedToolbar->SetItemDimmed( ECmdToolbarDetails, ETrue, EFalse ); - } - else if( TVIMPSTEnums::EUnknonContactItem == itemType ) - { - iFixedToolbar->SetItemDimmed(ECmdToolbarVoipCall, EFalse, EFalse); - iFixedToolbar->SetItemDimmed(ECmdToolbarChat, EFalse, EFalse); - iFixedToolbar->SetItemDimmed(ECmdToolbarDetails, ETrue, EFalse); - } - else if( TVIMPSTEnums::EContactItem == itemType ) - { - if( selectedItem != KNullDesC && TVIMPSTEnums::EServiceOut != onlinestatus ) - { - - iFixedToolbar->SetItemDimmed(ECmdToolbarChat, EFalse, EFalse); - } - else - { - iFixedToolbar->SetItemDimmed(ECmdToolbarChat, ETrue, EFalse); - } - iFixedToolbar->SetItemDimmed(ECmdToolbarDetails, EFalse, EFalse); - iFixedToolbar->SetItemDimmed(ECmdToolbarVoipCall, EFalse, EFalse); - } - else - { - iFixedToolbar->SetItemDimmed(ECmdToolbarVoipCall, ETrue, EFalse); - iFixedToolbar->SetItemDimmed(ECmdToolbarChat, ETrue, EFalse); - iFixedToolbar->SetItemDimmed(ECmdToolbarDetails, EFalse, EFalse); - } - } - else if(imEnabled && !voipEnabled) - { - if( TVIMPSTEnums::EOwnStatusItem == itemType || - TVIMPSTEnums::EFriendRequestItem == itemType || - KErrNotFound == currentItemIndex) - { - iFixedToolbar->SetItemDimmed( ECmdToolbarChat, ETrue, EFalse ); - iFixedToolbar->SetItemDimmed( ECmdToolbarDetails, ETrue, EFalse ); - } - else if( TVIMPSTEnums::EUnknonContactItem == itemType ) - { - iFixedToolbar->SetItemDimmed(ECmdToolbarChat, EFalse, EFalse); - iFixedToolbar->SetItemDimmed(ECmdToolbarDetails, ETrue, EFalse); - } - else if( TVIMPSTEnums::EContactItem == itemType ) - { - iFixedToolbar->SetItemDimmed( ECmdToolbarDetails, EFalse, EFalse ); - if( selectedItem != KNullDesC && TVIMPSTEnums::EServiceOut != onlinestatus ) - { - iFixedToolbar->SetItemDimmed(ECmdToolbarChat, EFalse, EFalse); - } - else - { - iFixedToolbar->SetItemDimmed(ECmdToolbarChat, ETrue, EFalse); - } - } - } - else if( voipEnabled && !imEnabled ) - { - if( (TVIMPSTEnums::EOwnStatusItem == itemType || - TVIMPSTEnums::EFriendRequestItem == itemType || - KErrNotFound == currentItemIndex) && !iAddContact ) - { - iFixedToolbar->SetItemDimmed( ECmdToolbarNewContact, EFalse, EFalse ); - iFixedToolbar->SetItemDimmed( ECmdToolbarVoipCall, ETrue, EFalse ); - iFixedToolbar->SetItemDimmed( ECmdToolbarDetails, ETrue, EFalse ); - } - else if( TVIMPSTEnums::EUnknonContactItem == itemType ) - { - iFixedToolbar->SetItemDimmed( ECmdToolbarNewContact, EFalse, EFalse ); - iFixedToolbar->SetItemDimmed(ECmdToolbarVoipCall, EFalse, EFalse ); - iFixedToolbar->SetItemDimmed(ECmdToolbarDetails, ETrue, EFalse); - } - else if( TVIMPSTEnums::EContactItem == itemType ) - { - iFixedToolbar->SetItemDimmed( ECmdToolbarNewContact, EFalse, EFalse ); - iFixedToolbar->SetItemDimmed( ECmdToolbarDetails, EFalse, EFalse ); - iFixedToolbar->SetItemDimmed(ECmdToolbarVoipCall, EFalse, EFalse); - } - } - else - { - if( (TVIMPSTEnums::EOwnStatusItem == itemType || - TVIMPSTEnums::EFriendRequestItem == itemType || - KErrNotFound == currentItemIndex) && !iAddContact ) - { - iFixedToolbar->SetItemDimmed( ECmdToolbarNewContact, EFalse, EFalse ); - } - else if( TVIMPSTEnums::EUnknonContactItem == itemType ) - { - iFixedToolbar->SetItemDimmed( ECmdToolbarNewContact, EFalse, EFalse); - } - else - { - iFixedToolbar->SetItemDimmed( ECmdToolbarNewContact, EFalse, EFalse ); - iFixedToolbar->SetItemDimmed( ECmdToolbarDetails, EFalse, EFalse ); - } - } - iFixedToolbar->DrawNow(); - } - } -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::DynInitToolbarL -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::DynInitToolbarL( TInt /*aResourceId*/, CAknToolbar* /*aToolbar*/ ) - { - if ( AknLayoutUtils::PenEnabled() ) - { - UpdateToolbarL(); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::OfferToolbarEventL -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::OfferToolbarEventL( TInt aCommand ) - { - TRACER_AUTO; - if ( AknLayoutUtils::PenEnabled() ) - { - switch( aCommand ) - { - case ECmdToolbarVoipCall: - { - MakeVoipCallL(); - break; - } - case ECmdToolbarChat: - { - HandleCommandL( ECmdOpenConversation ); - break; - } - case ECmdToolbarDetails: - { - HandleCommandL( ECmdContactDetails );//EChatLaunchCCA - - break; - } - case ECmdToolbarNewContact: - { - HandleCommandL ( ECmdAddContact ); - break; - } - } - } - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::ShowHideFixedToolbarL -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ShowHideFixedToolbarL(TBool aShow) - { - if ( iFixedToolbar && iContainer ) - { - iFixedToolbar->HideItemsAndDrawOnlyBackground( !aShow ); - if(aShow) - { - iFixedToolbar->SetToolbarVisibility( aShow, !aShow); - } - iContainer->CoeControl()->SetRect( iView.ClientRect() ); - iContainer->CoeControl()->DrawDeferred(); - iIsToolBarHidden = !aShow; - } - - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::ProcessFriendRequestL -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ProcessFriendRequestL() - { - TRACER_AUTO; - TInt index = CurrentItemIndex(); - if( index <= 0 ) - { - // return if item not found - return; - } - MVIMPSTProcessArray& arrayprocess = iCommandHandler.GetProcessInterface(); - if( iFriendRequestId ) - { - delete iFriendRequestId; - iFriendRequestId = NULL; - } - iFriendRequestId = arrayprocess.GetItemUserId(index).AllocL() ; - - if( !iFriendRequestId ) - { - return; - } - - HBufC* queryTxt = StringLoader::LoadLC( R_SERVTAB_FRIEND_REQUEST_CONF, *iFriendRequestId ); - - //ask the query and send the response back to the server. - TInt response = VIMPSTUtilsDialog::DisplayQueryDialogL(R_SERVTAB_GENERIC_ACCEPT_DECLINE_CONFIRMATION_QUERY,*queryTxt); - CleanupStack::PopAndDestroy(queryTxt); - - if((EAknSoftkeyYes == response)||(EAknSoftkeyOk == response ) ) - { - - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ; - if( storage && storage->IsLocalStore() )//if local store popup create new/update existing dialog - { - iSelectedAction = ShowNewUpdateQueryL(); - TUint assignFlags = 0; - if(CVIMPSTUiTabbedView::EInvitAcceptCreateNew == iSelectedAction )//create new option - { - assignFlags |= ECreateNewContact; - } - else if(CVIMPSTUiTabbedView::EInvitAcceptUpdateExisting == iSelectedAction ) //if update existing is selected - { - assignFlags = 0; - } - else //if the selection dialog is cancelled then just do nothing - { - return; - } - //show the phonebook dialog for create new/update existing option - if(iAiwParamList) - { - delete iAiwParamList; - iAiwParamList = NULL; - } - iAiwParamList = CAiwGenericParamList::NewL(); - - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamContactAssignData, - TAiwVariant(TAiwSingleContactAssignDataV1Pckg( - TAiwSingleContactAssignDataV1().SetFlags( assignFlags ))))); - - TBuf xspId; //xsp max length - xspId.Append(iEngine.ServiceName()); - xspId.Append(KColon); - xspId.Append(*iFriendRequestId); - - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamXSpId, - TAiwVariant(xspId)) - ); - ReInitializeServiceHandlerL(); - iServiceHandler->ExecuteServiceCmdL( - KAiwCmdAssign, - *iAiwParamList, - iServiceHandler->OutParamListL(), - 0, - this); - // remove of friend request is done in HnadleNotify aiw call back - // to handle the cancel of selection dialog - } - else // in case of server store - { - if( iWaitNote ) - { - delete iWaitNote; - iWaitNote = NULL; - } - iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_SERVTAB_SAVING_CONTACT, ETrue, EFalse ); - iCommandHandler.HandleCommandL(EFriendAccpeted, this, iFriendRequestId); - } - - } - //response value comes as zero if user rejects the request - else if( EAknSoftkeyCancel == response || 0 == response) // rejected the request - { - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_SERVTAB_DECLINING_INVITE, ETrue , EFalse );; - iCommandHandler.HandleCommandL(EFriendRejected, this, iFriendRequestId ); - } - - - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::HandleSearchResultL() -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::HandleSearchResultL(RArray /*aSearchData*/ ) - { - // no implemetation - } - - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::HandleSearchFinishedL() -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::HandleSearchFinishedL(TInt /*aError*/) - { - // no implemetation - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::HandleSearchKeysEventL() -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::HandleSearchKeysEventL( RArray& aEnumKeysArray, RPointerArray& aLebelKeysArray ) - { - iExtensionService.SetSearchFieldsDataL(aEnumKeysArray, aLebelKeysArray ); - } - -// --------------------------------------------------------- -// CVIMPSTUiSearchView::ShowURLQueryL() -// --------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ShowURLQueryL( ) - { - TRACER_AUTO; - // Open browser with the specified URL - RBuf buffer; - buffer.CreateL( RProperty::KMaxPropertySize ); - CleanupClosePushL( buffer ); - iSettingsStore->GetL(iServiceId, EServiceURLLink, buffer); - HBufC16* url = HBufC::NewL(buffer.Length()); - url = buffer.Alloc(); - OpenWebBrowserL( *url ); - CleanupStack::PopAndDestroy( ); //buffer - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::OpenWebBrowserL -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::OpenWebBrowserL( const TDesC& aUrl ) - { - if( !iBrLauncher ) - { - iBrLauncher = CBrowserLauncher::NewL(); - } - //Asynchronous operation to launch the browser with aUrl - iBrLauncher->LaunchBrowserEmbeddedL( aUrl,this,this ); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::LoginL -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::LoginL() - { - TRACER_AUTO; - TBool IsPasswordSet = iEngine.IsPasswordAvailableL(); - - if(iUserId) - { - delete iUserId; - iUserId = NULL; - } - - iUserId = iEngine.GetOwnUserIdFromCChOrStorageL(); - - - TBool urlNeedtoShow = IsURLQueryToBeShownL(); - //first login : userid is not initialized and password is not set. - TBool doLogin = ETrue; - if( urlNeedtoShow && (!IsPasswordSet) && (iUserId->Length() == 0)) - { - TInt menuChoise( KErrCancel ); - ShowUseExistingOrCreateNewMenuL( menuChoise ); - switch(menuChoise ) - { - case CVIMPSTUiTabbedView::EXmppMenuValuesCreateNew: - { - doLogin = EFalse; - ShowURLQueryL(); - break; - } - case CVIMPSTUiTabbedView::EXmppMenuValuesUseExisting: - { - // login must be called - doLogin = ETrue; - break; - } - default: // user has cancelled the createnew and i have acccount query - doLogin = EFalse; - break; - } - } - if( doLogin ) - { - TInt error = ShowTermsofuseL(); - if(KErrNone == error) - { - if( urlNeedtoShow ) - { - // Url query has been shown and accep by user - iSettingsStore->SetL(iServiceId, EURLRegistrationOff, ETrue); - } - iCommandHandler.HandleCommandL(ELoginService, this, &iServiceId); - } - } - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::IsURLQueryToBeShownL -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTUiTabbedView::IsURLQueryToBeShownL() - { - TRACER_AUTO; - TBool urlQueryShown = EFalse; - - RBuf buffer; - buffer.CreateL( RProperty::KMaxPropertySize ); - CleanupClosePushL( buffer ); - iSettingsStore->GetL(iServiceId, EServiceURLLink, buffer); - - //get the url from the cenrep. - TInt isURLQueryDisabled = EFalse; - iSettingsStore->GetL(iServiceId, EURLRegistrationOff, isURLQueryDisabled); - - if(buffer.Length() && !isURLQueryDisabled) - { - urlQueryShown = ETrue; - } - CleanupStack::PopAndDestroy(); //buffer - return urlQueryShown; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ShowUseExistingOrCreateNewMenuL -// return values <0 -> error -// 0 -> use existing -// 1 -> create new -// --------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ShowUseExistingOrCreateNewMenuL( TInt& aMenuChoise ) - { - TRACER_AUTO; - TInt rvalue( KErrGeneral ); - - CAknSinglePopupMenuStyleListBox* accountList = - new ( ELeave ) CAknSinglePopupMenuStyleListBox; - CleanupStack::PushL( accountList ); - - CAknPopupList* popupList = - CAknPopupList::NewL( accountList, R_AVKON_SOFTKEYS_OK_BACK ); - CleanupStack::PushL( popupList ); - - accountList->ConstructL( popupList, EAknListBoxMenuList); - - // construct listbox item array - CDesCArray *itemList = new (ELeave) CDesCArrayFlat( 2 ); - CleanupStack::PushL( itemList ); - TBuf item; - - // First listbox item - HBufC* text1 = StringLoader::LoadLC( R_QTN_USE_EXISTING ); - itemList->AppendL( *text1 ); - CleanupStack::PopAndDestroy( text1 ); - - // Second listbox item - HBufC* text2 = StringLoader::LoadLC( R_QTN_CREATE_NEW ); - itemList->AppendL( *text2 ); - CleanupStack::PopAndDestroy( text2 ); - - // Set items and ownership - accountList->Model()->SetItemTextArray( itemList ); - accountList->Model()->SetOwnershipType( ELbmOwnsItemArray ); - CleanupStack::Pop( itemList ); - - HBufC* title = StringLoader::LoadLC( R_QTN_SELECT_ACTION ); - popupList->SetTitleL( *title ); - CleanupStack::PopAndDestroy( title ); - - TInt popupOk = popupList->ExecuteLD(); - - if ( popupOk ) - { - rvalue = accountList->CurrentItemIndex(); - } - else - { - rvalue = KErrCancel; - } - - CleanupStack::Pop( popupList ); - CleanupStack::PopAndDestroy( accountList ); - - aMenuChoise = rvalue; - } -// --------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ShowNewUpdateQueryL -// return values <0 -> error -// 0 ->create new -// 1 -> update existing -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUiTabbedView::ShowNewUpdateQueryL() - { - TRACER_AUTO; - TInt retValue( KErrCancel ); - - CAknSinglePopupMenuStyleListBox* selectionList = - new ( ELeave ) CAknSinglePopupMenuStyleListBox; - CleanupStack::PushL( selectionList ); - - CAknPopupList* popupList = CAknPopupList::NewL( - selectionList, - R_AVKON_SOFTKEYS_SELECT_CANCEL ); - CleanupStack::PushL( popupList ); - - selectionList->ConstructL( popupList, EAknListBoxMenuList ); - - // construct listbox item array - CDesCArray *itemList = new (ELeave) CDesCArrayFlat( 2 ); - CleanupStack::PushL( itemList ); - - // First listbox item - HBufC* newItem = StringLoader::LoadLC( R_QTN_CREATE_NEW_CONTACT ); - itemList->AppendL( *newItem ); - CleanupStack::PopAndDestroy( newItem ); - - // Second listbox item - HBufC* updateItem = StringLoader::LoadLC( R_QTN_UPDATE_EXISTING ); - itemList->AppendL( *updateItem ); - CleanupStack::PopAndDestroy( updateItem ); - - // Set items and ownership - selectionList->Model()->SetItemTextArray( itemList ); - selectionList->Model()->SetOwnershipType( ELbmOwnsItemArray ); - CleanupStack::Pop( itemList ); // ownership is transfered to selectionList - - HBufC* title = StringLoader::LoadLC( R_QTN_SELECT_ACTION ); - popupList->SetTitleL( *title ); - CleanupStack::PopAndDestroy( title ); - - TInt response = popupList->ExecuteLD(); - - if ( response ) - { - retValue = selectionList->CurrentItemIndex(); - } - CleanupStack::Pop( popupList ); // onership given to selectionList - CleanupStack::PopAndDestroy( selectionList ); // selectionList - - return retValue; - } -// CVIMPSTUiTabbedView::ShowLoginDialogL -// --------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::ShowLoginDialogL( TDes& aUserName, TDes& aPassword ) - { - TRACER_AUTO; - HBufC* userName = HBufC::NewLC( KUsernameMaxLength ); - HBufC* passWord = HBufC::NewLC( KPasswordMaxLength ); - - TPtr ptrUserName = userName->Des(); - TPtr ptrPassWord = passWord->Des(); - - if( aUserName.Length()== 0 ) - { - CAknMultiLineDataQueryDialog* dlg = CAknMultiLineDataQueryDialog::NewL( ptrUserName, - ptrPassWord ); - if ( dlg->ExecuteLD( R_LOGIN_DIALOG ) ) - { - aUserName.Copy( ptrUserName.LeftTPtr( aUserName.MaxLength() ) ); - aPassword.Copy( ptrPassWord.LeftTPtr( aPassword.MaxLength() ) ); - } - else - { - User::Leave( KErrCancel ); - } - } - else - { - CAknMultiLineDataQueryDialog* dlg = CAknMultiLineDataQueryDialog::NewL( aUserName, - aPassword ); - if ( dlg->ExecuteLD( R_LOGIN_DIALOG ) ) - { - aUserName.Copy( aUserName.LeftTPtr( aUserName.MaxLength() ) ); - aPassword.Copy( aPassword.LeftTPtr( aPassword.MaxLength() ) ); - } - else - { - User::Leave( KErrCancel ); - } - } - CleanupStack::PopAndDestroy( passWord ); - CleanupStack::PopAndDestroy( userName ); - } -// ---------------------------------------------------- -// CVIMPSTUiTabbedView::HandleContentL -// Handles the content coming from the embedded browser. -// Returns EFalse: content will be passed on to framework -// ---------------------------------------------------- -// -TBool CVIMPSTUiTabbedView::HandleContentL( - const TDesC& /*aFileName*/, - const CAiwGenericParamList& /*aParamList*/, - TBool& aContinue ) - { - // Close browser after downloading content - aContinue = EFalse; - return EFalse; - } - -// ---------------------------------------------------- -// CVIMPSTUiTabbedView::DownloadedContentHandlerReserved1 -// ( Reserved for future use ) -// ---------------------------------------------------- -// -TAny* CVIMPSTUiTabbedView::DownloadedContentHandlerReserved1( TAny* /*aAnyParam*/ ) - { - // Empty implementation. - return NULL; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::CloseConversation -// --------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::CloseConversationL() - { - TRACER_AUTO; - TInt index = CurrentItemIndex(); - if( index <= 0 ) - { - // return if item not found - return; - } - MVIMPSTProcessArray& arrayprocess = iCommandHandler.GetProcessInterface(); - TPtrC itemId = arrayprocess.GetItemUserId(index); - - if(itemId.Length() == 0) - { - return; - } - - HBufC* queryTxt = StringLoader::LoadLC( R_QTN_SERVTAB_CLOSE_CONV, itemId ); - - //ask the query and send the response back to the server. - TInt response = VIMPSTUtilsDialog::DisplayQueryDialogL(R_GENERIC_YES_NO_CONFIRMATION_QUERY,*queryTxt); - CleanupStack::PopAndDestroy(queryTxt); - - if( (EAknSoftkeyYes == response)||(EAknSoftkeyOk == response ) ) - { - iCommandHandler.HandleCommandL(ECloseConversation, this, &itemId ); - } - - } - -// ---------------------------------------------------- -// CVIMPSTUiTabbedView::HandleServerAppExit -// ( Reserved for future use ) -// ---------------------------------------------------- -// -void CVIMPSTUiTabbedView::HandleServerAppExit( TInt /*aReason*/ ) - { - TRACER_AUTO; - TInt error = KErrNone; - TRAPD(leaveErr,error = ShowTermsofuseL()); - if(KErrNone == error && KErrNone == leaveErr) - { - TRAP_IGNORE(iCommandHandler.HandleCommandL(ELoginService, this, &iServiceId)); - } - } - -// ---------------------------------------------------- -// CVIMPSTUiTabbedView::ShowTermsofuseL -// ( Reserved for future use ) -// ---------------------------------------------------- -// -TInt CVIMPSTUiTabbedView::ShowTermsofuseL() - { - TRACER_AUTO; - TInt retVal = KErrNone; - // get the ETOUDlgOff if its set don't show TOU dialog else show TOU - TInt termsOfUseDisabled = KErrNone; - iSettingsStore->GetL(iServiceId, ETOUDlgOff, termsOfUseDisabled); - if( !termsOfUseDisabled) - { - HBufC* termsOfUsetext = iBrandHandler->GetToUStringL(); - if( termsOfUsetext ) - { - CleanupStack::PushL(termsOfUsetext); - retVal = CVIMPSTUiTermsOfUseDialogHandler::HandleTermsOfUseDialogLD( - *iSettingsStore, - *iUserId, - iServiceId, - termsOfUsetext ); // termsOfUsetext ownership is transfered - CleanupStack::Pop(); // termsOfUsetext ownership is transfered - } - } - return retVal; - } -// ---------------------------------------------------- -// CVIMPSTUiTabbedView::MakeVoipCallL -// ( Reserved for future use ) -// ---------------------------------------------------- -// -void CVIMPSTUiTabbedView::MakeVoipCallL() - { - TRACER_AUTO; - // making voip call will take in three steps - // pop up the selection dialog - // select adress - // create a call - TInt index = CurrentItemIndex(); - //Index should always be greater than zero - //Negative index means item not found. - if(index <= 0 ) - { - return; - } - MVIMPSTProcessArray& processArray = iCommandHandler.GetProcessInterface(); - TVIMPSTEnums::TItem itemType = processArray.GetType( index ) ; - - if( itemType == TVIMPSTEnums::EContactItem ) - { - iSelectedAction = CVIMPSTUiTabbedView::ECreateXSPCall; - TUint fetchFlags = 0; - TAiwSingleItemSelectionDataV3 data; - data.SetFlags(fetchFlags); - data.SetCommAddressSelectType(EAiwCommVOIPCall); - ReInitializeServiceHandlerL(); - CAiwGenericParamList& inParamList = iServiceHandler->InParamListL(); - // Set service data - inParamList.AppendL(TAiwGenericParam(EGenericParamContactSelectionData, - TAiwVariant(TAiwSingleItemSelectionDataV3Pckg(data)))); - - HBufC8* pack = processArray.ContactLink(index )->PackLC(); - // Set contactlink - inParamList.AppendL(TAiwGenericParam(EGenericParamContactLinkArray, - TAiwVariant(*pack))); - - iServiceHandler->ExecuteServiceCmdL(KAiwCmdSelect, inParamList, - iServiceHandler->OutParamListL(), 0, this); - CleanupStack::PopAndDestroy( pack ); - } - else if( itemType == TVIMPSTEnums::EUnknonContactItem ) - { - TPtrC unknownId = processArray.GetItemUserId( index ); - ExecuteAiwCallL( unknownId ); - } - } -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::ExecuteAiwCallL -// --------------------------------------------------------- -void CVIMPSTUiTabbedView::ExecuteAiwCallL( const TDesC& aSelectedAddress ) - { - TRACER_AUTO; - //aSelectedAdress will be an xsp id of format "ServiceName:UserId" - //here we need to truncate the servicename and pass only the UserId - //Find if aSelectedAdress of type "ServiceName:UserId" - //if true, then remove the service part - TInt phoneNumberStart = aSelectedAddress.Locate(':'); - HBufC* numBuf = NULL; - - if ( KErrNotFound != phoneNumberStart ) - { - phoneNumberStart++; //To get rid of ':' - numBuf = aSelectedAddress.Right( - aSelectedAddress.Length() - phoneNumberStart - ).AllocLC(); - } - else - { - numBuf = aSelectedAddress.AllocLC(); - } - - TPtr numDesc( numBuf->Des ()); - CommonPhoneParser::ParsePhoneNumber ( numDesc, - CommonPhoneParser::EPhoneClientNumber); - - CAiwDialDataExt* dialDataExt = CAiwDialDataExt::NewLC(); - dialDataExt->SetPhoneNumberL ( numBuf->Des ()); - dialDataExt->SetServiceId(iServiceId); - dialDataExt->SetCallType( CAiwDialData::EAIWVoiP); - - dialDataExt->SetWindowGroup ( CCoeEnv::Static()->RootWin().Identifier() ); - ReInitializeServiceHandlerL(); - CAiwGenericParamList& paramList = iServiceHandler->InParamListL(); - dialDataExt->FillInParamListL ( paramList); - iServiceHandler->ExecuteServiceCmdL ( KAiwCmdCall, - paramList, - iServiceHandler->OutParamListL(), - 0, - NULL); - CleanupStack::PopAndDestroy(dialDataExt); - CleanupStack::PopAndDestroy(numBuf); - } - -// --------------------------------------------------------- -// CVIMPSTUiTabbedView::LaunchHelpL() -// Function launches help application using the HlpLauncher. -// @params: Reference to a descriptor, serves as context. -// --------------------------------------------------------- -// - -void CVIMPSTUiTabbedView::LaunchHelpL( const TDesC& aContext ) - { - TRACER_AUTO; - CArrayFix< TCoeHelpContext >* cntx = new( ELeave ) CArrayFixFlat< TCoeHelpContext >( KHelpContextSize ); - CleanupStack::PushL( cntx ); - - TUid KHelpUid = { KHELPUID }; - cntx->AppendL( TCoeHelpContext( KHelpUid, aContext ) ); - CleanupStack::Pop( cntx ); - - //and launch help - takes ownership of context array - HlpLauncher::LaunchHelpApplicationL( CEikonEnv::Static()->WsSession(), cntx ); - } - -// ---------------------------------------------------- -// CVIMPSTUiTabbedView::SettingsStore() -// ---------------------------------------------------- -// -MVIMPSTSettingsStore* CVIMPSTUiTabbedView::SettingsStore() - { - return iSettingsStore; - } - -// ---------------------------------------------------- -// CVIMPSTUiTabbedView::CancelLoginSupportedL() -// ---------------------------------------------------- -// -TBool CVIMPSTUiTabbedView::CancelLoginSupportedL() - { - TRACER_AUTO; - TInt cancelNotSupported(KErrNone); - TBool returnValue = ETrue; - // read from the cenrep settings - TInt err = iSettingsStore->GetL(iServiceId, EServiceCancelLoginNotSupported,cancelNotSupported); - // if any error OR cancelNotSupported = 1 then - if ( err || cancelNotSupported ) - { - returnValue = EFalse; // SOME Error or cancel is not supported : return EFalse - } - return returnValue; // cancel is supported : return ETrue - } - - -// ---------------------------------------------------- -// CVIMPSTUiTabbedView::ChangeConnectionSupportedL() -// ---------------------------------------------------- -// -TBool CVIMPSTUiTabbedView::ChangeConnectionSupportedL() - { - TRACER_AUTO; - TInt changeConnectionSupported(KErrNone); - TBool returnValue = ETrue; - // read from the cenrep settings - TInt err = iSettingsStore->GetL(iServiceId, EServiceChangeConnectionNotSupported,changeConnectionSupported); - // if any error OR cancelNotSupported = 1 then - if ( err || changeConnectionSupported ) - { - returnValue = EFalse; // SOME Error or cancel is not supported : return EFalse - } - return returnValue; // cancel is supported : return ETrue - } - -// ---------------------------------------------------- -// CVIMPSTUiTabbedView::HandleNotifyL() -// ---------------------------------------------------- -// -TInt CVIMPSTUiTabbedView::HandleNotifyL( - TInt aCmdId, - TInt aEventId, - CAiwGenericParamList& aEventParamList, - const CAiwGenericParamList& /* aInParamList */) - { - TRACER_AUTO; - TInt result = 0; - if( (aCmdId == KAiwCmdSelect) && (aEventId == KAiwEventCompleted && iSelectedAction == ECreateXSPCall )) - { - if( iQueryResult ) - { - delete iQueryResult; - iQueryResult = NULL; - } - TInt index = 1; // Get field data from index 1 - const TAiwGenericParam* param = - aEventParamList.FindFirst(index, EGenericParamContactFieldData); - if (KErrNotFound != index) - { - TInt length = param->Value().AsDes().Length(); - iQueryResult = HBufC::NewL(length); - iQueryResult->Des().Append( param->Value().AsDes() ); - // Data must be found! - if (0 >= iQueryResult->Length()) - { - User::Leave(KErrGeneral); - } - if( !iContactSelection ) - { - iContactSelection = CVIMPSTUiContactSelection::NewL(*this); //register for the contactselection - } - iContactSelection->IssueRequest(); - } - else - { - User::Leave(KErrNotFound); - } - result = ETrue; - } - - else if (aCmdId == KAiwCmdAssign || aCmdId == KAiwCmdSelect ) - { - if (aEventId == KAiwEventCompleted ) - { - if( iSelectedAction == CVIMPSTUiTabbedView::EInvitAcceptUpdateExisting || - iSelectedAction == CVIMPSTUiTabbedView::EInvitAcceptCreateNew || - iSelectedAction == CVIMPSTUiTabbedView::EContactCreateNew || - iSelectedAction == CVIMPSTUiTabbedView::EContactAddFromContacts ) - { - // action has been completed , - // this will be excuted only if invitation accepted using update existing contact - TInt paramIndex = 0; - const TAiwGenericParam* contactParam = aEventParamList.FindFirst( - paramIndex, EGenericParamContactLinkArray );//get the contact link - TPtrC8 packLink = contactParam->Value().AsData(); - delete iSelectedData.iPackedLinks; - iSelectedData.iPackedLinks = NULL; - if( packLink.Length() ) - { - iSelectedData.iPackedLinks = packLink.AllocL(); - if( !iContactSelection ) - { - iContactSelection = CVIMPSTUiContactSelection::NewL(*this); //register for the contactselection - } - iContactSelection->IssueRequest(); - } - } - result = ETrue; - } - else if (aEventId == KAiwEventQueryExit) - { - // Send an exit command in order to close CCA and Phonebook2 - CAknAppUi* appUi = static_cast( CCoeEnv::Static()->AppUi() ); - - if ( appUi ) - { - appUi->ProcessCommandL( EAknCmdExit ); - } - result = ETrue; - } - else if(aEventId == KAiwEventOutParamCheck) - { - result = ETrue; - } - } - if(aEventId == KAiwEventCanceled) - { - result = ETrue; - } - return result; - } -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::BlockContactL -// -------------------------------------------------------------------------- -// -void CVIMPSTUiTabbedView::BlockContactL(TBool aBlock /* = EFalse */) - { - TRACER_AUTO; - TInt index = CurrentItemIndex(); - if(iContainer) - { - iContainer->CheckAndSetLastItemFlag(); - } - if( index <= 0 ) - { - // return if item not found - // 0 for own item which can not be blocked - return; - } - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - - MVIMPSTProcessArray& arrayprocess = iCommandHandler.GetProcessInterface(); - HBufC* contactId = arrayprocess.GetItemUserId(index).AllocLC(); - - if( contactId->Length() ) - { - if(aBlock ) - { - // load, format and show confirmation note - HBufC* prompt = StringLoader::LoadLC( R_QTN_SERVTAB_BLOCKING, *contactId ); - iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( *prompt, ETrue, EFalse ); - // iCommandHandler.HandleCommandL(ECmdBlockContact, this, &(contactId) ); - iCommandHandler.HandleCommandL(ECmdBlockContact, this, contactId ); - CleanupStack::PopAndDestroy();// prompt - - if(iContainer) - { - TRACE("HandleAvatarRefreshl calling for blocking"); - - iContainer->HandleAvatarRefreshL(*contactId, ETrue); - } - } - else - { - HBufC* unBprompt = StringLoader::LoadLC( R_QTN_CHAT_UNBLOCKING, *contactId ); - // load, format and show confirmation note - iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( *unBprompt, ETrue, EFalse ); - iCommandHandler.HandleCommandL(ECmdUnBlockContact, this, contactId ); - CleanupStack::PopAndDestroy();// unBprompt - } - } - CleanupStack::PopAndDestroy(); //contactId - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ShowBlockedContactListL -// -------------------------------------------------------------------------- -void CVIMPSTUiTabbedView::ShowBlockedContactListL() - { - TRACER_AUTO; - if(!iIsToolBarHidden) - { - ShowHideFixedToolbarL(EFalse); - } - - if (iContainer) - { - iContainer->DeactivateFindPaneL(); - } - - //Launch the search view with search dialog - LaunchViewL( iExtensionService.BlockViewId() ); - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::HandleContactSelectionCompleteL -// -------------------------------------------------------------------------- -void CVIMPSTUiTabbedView::HandleContactSelectionCompleteL() - { - TRACER_AUTO; - - if( iWaitNote ) - { - delete iWaitNote; - iWaitNote = NULL; - } - if( iSelectedAction == CVIMPSTUiTabbedView::EInvitAcceptUpdateExisting || iSelectedAction == CVIMPSTUiTabbedView::EInvitAcceptCreateNew) - { - iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_SERVTAB_SAVING_CONTACT, ETrue, EFalse ); - - if ( iSelectedData.iPackedLinks ) //add the selected contact to the service tab - { - TRACE("process contact"); - if( iSelectedAction == CVIMPSTUiTabbedView::EInvitAcceptCreateNew ) - { - iCommandHandler.HandleCommandL( ECmdProcessAcceptedContactNew, this, (TAny*)&iSelectedData ); - } - else - { - iCommandHandler.HandleCommandL( ECmdProcessAcceptedContactExist, this, (TAny*)&iSelectedData ); - } - delete iSelectedData.iPackedLinks; - iSelectedData.iPackedLinks = NULL; - } - iSelectedData.iXSPList.ResetAndDestroy(); - - //invitation has been accepted using update existing contact - // updation is successful - // send accepted request to command/engine/server - TRACE("frnrequest accepted"); - iCommandHandler.HandleCommandL(EFriendAccpeted, this, iFriendRequestId ); - } - else if( iSelectedAction == CVIMPSTUiTabbedView::EContactCreateNew || iSelectedAction == CVIMPSTUiTabbedView::EContactAddFromContacts) - { - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ; - TBool localStore = EFalse; - if( storage ) - { - localStore = storage->IsLocalStore(); - } - if( localStore )//for server store wait note is shown by AddContactL function - { - if(iWaitNote) - { - delete iWaitNote; - iWaitNote = NULL; - } - iWaitNote = CVIMPSTUtilsWaitNote::ShowWaitNoteL( R_QTN_SERVTAB_SAVING_CONTACT, ETrue, EFalse ); - } - - if ( iSelectedData.iPackedLinks ) //add the selected contact to the service tab - { - TRACE("process contact"); - if( iSelectedAction == CVIMPSTUiTabbedView::EContactCreateNew ) - { - iCommandHandler.HandleCommandL( ECmdProcessSelectedContactNew, this, (TAny*)&iSelectedData ); - } - else - { - iCommandHandler.HandleCommandL( ECmdProcessSelectedContactExist, this, (TAny*)&iSelectedData ); - } - delete iSelectedData.iPackedLinks; - iSelectedData.iPackedLinks = NULL; - //server store xspid will be stored in iSelectedData.iXSPList and adding it to UI - if( !localStore && iSelectedAction == CVIMPSTUiTabbedView::EContactAddFromContacts) - { - AddContactL( iSelectedData.iXSPList ); - } - iSelectedData.iXSPList.ResetAndDestroy(); - - } - // this is for adding a fresh contact for local store - // read the data from link and send it to server for updation - } - else if( iSelectedAction == CVIMPSTUiTabbedView::ECreateXSPCall && iQueryResult ) - { - // make a call here - ExecuteAiwCallL(*iQueryResult ); - delete iQueryResult; - iQueryResult = NULL; - } - iSelectedAction = KErrNotFound; // This is to clear the previous selected action. - - } - -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::LaunchSettingsViewL -// -------------------------------------------------------------------------- -void CVIMPSTUiTabbedView::LaunchSettingsViewL() - { - /* - If settingsui is already opened, instead of starting with StartDocument just bring csc to foreground and send message - (csc opens correct settings ui even when it´s already open)What comes to coming back to meco tab by pressing Back in - settingsui i made change that tab view is opened by using RxSPViewServices in csc side and csc is closed after that. - I found only one problem while testing this solution, that is if phonebook is closed when settingsui is still open. - In that case settingsui stays in background, but even then when Back is pressed on settingsui correct tab is opened - (phonebook is reopened using RxSPViewServices) - - ************************************************************************************** - CSC team agreed to provide new generic CSC view launcher API, once CSC provide new API - below code need to remove and new API will be called. - *************************************************************************************** - */ - TRACER_AUTO; - _LIT(KStartupParams, "ACTION=4 SERID="); - _LIT8(KStartupParams8, "ACTION=4 SERID="); - //Take CSC UID (In future if this UID change , we also need to change it otherwise we will not be able - //to launch CSC settings. - const TUid KCSCAppUid = { 0x10275458 }; - RWsSession ws; - User::LeaveIfError( ws.Connect() ); - CleanupClosePushL( ws ); - TApaTaskList list( ws ); - - TApaTask task( list.FindApp( KCSCAppUid ) ); - - if ( task.Exists() ) - { - TBuf8<255> params8; - params8.Copy( KStartupParams8 ); - params8.AppendNum( iServiceId ); - //Bring CSC to foreground if already open - task.BringToForeground(); - task.SendMessage( - TUid::Uid( KUidApaMessageSwitchOpenFileValue ), params8 ); - } - else - { - RApaLsSession session; - CleanupClosePushL( session ); - User::LeaveIfError(session.Connect()); - - TUid appUid = KCSCAppUid; - TThreadId threadId; - TFileName fileName; - - fileName.Copy( KStartupParams ); - fileName.AppendNum( iServiceId ); - - User::LeaveIfError( - session.StartDocument( fileName, appUid, threadId ) ); - - session.Close(); - CleanupStack::PopAndDestroy( &session ); - } - - CleanupStack::PopAndDestroy( &ws ); - - }//End LaunchSettingsUiL() - // -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ReInitializeServiceHandlerL() -// -------------------------------------------------------------------------- - -void CVIMPSTUiTabbedView::ReInitializeServiceHandlerL() - { - TRACER_AUTO; - if(iIsServiceHandleReSet ) - { - if(iServiceHandler) - { - iServiceHandler->AttachL( R_IM_APP_INTEREST ); - iServiceHandler->AttachMenuL( R_SERVTAB_TABBED_VIEW_MENU, - R_IM_APP_INTEREST ); - - iServiceHandler->AttachL( R_AIWASSIGNMENT_INTEREST ); - - iServiceHandler->AttachL( R_AIWSELECT_INTEREST ); - iIsServiceHandleReSet = EFalse; - } - } - } - // -------------------------------------------------------------------------- - // CVIMPSTUiTabbedView::LaunchFetchDialogL() - // -------------------------------------------------------------------------- - -void CVIMPSTUiTabbedView::LaunchFetchDialogL() - { - TRACER_AUTO; - iSelectedAction = EContactAddFromContacts; - MVIMPSTStorageServiceView* storage = CVIMPSTStorageManagerFactory::ContactListInterfaceL( iEngine.ServiceId() ) ; - TBool localStore = EFalse; - if( storage ) - { - localStore = storage->IsLocalStore(); - } - - if( localStore ) - { - //multiple item fetch. - TUint fetchFlags = 0; - fetchFlags |= ::EExcludeGroupsView; - - ExecuteMultipleItemFetchL( TAiwMultipleEntrySelectionDataV2().SetFlags( fetchFlags ) ); - } - else - { - //single item fetch. - TUint fetchFlags = 0; - - ExecuteSingleItemFetchL( TAiwSingleEntrySelectionDataV2().SetFlags( fetchFlags ) ); - } - - } - // -------------------------------------------------------------------------- - // CVIMPSTUiTabbedView::ExecuteSingleItemFetchL - // -------------------------------------------------------------------------- - -void CVIMPSTUiTabbedView::ExecuteSingleItemFetchL( TAiwSingleEntrySelectionDataV2 aData ) - { - TRACER_AUTO; - if(iAiwParamList) - { - delete iAiwParamList; - iAiwParamList = NULL; - } - iAiwParamList = CAiwGenericParamList::NewL(); - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamContactSelectionData, - TAiwVariant(TAiwSingleEntrySelectionDataV2Pckg(aData)))); - - ReInitializeServiceHandlerL(); - iServiceHandler->ExecuteServiceCmdL( - KAiwCmdSelect, - *iAiwParamList, - iServiceHandler->OutParamListL(), - 0, - this - ); - - } -// -------------------------------------------------------------------------- -// CVIMPSTUiTabbedView::ExecuteMultipleItemFetchL -// -------------------------------------------------------------------------- -void CVIMPSTUiTabbedView::ExecuteMultipleItemFetchL( TAiwMultipleEntrySelectionDataV2 aData ) - { - TRACER_AUTO; - if(iAiwParamList) - { - delete iAiwParamList; - iAiwParamList = NULL; - } - iAiwParamList = CAiwGenericParamList::NewL(); - ReInitializeServiceHandlerL(); - iAiwParamList->AppendL( - TAiwGenericParam( - EGenericParamContactSelectionData, - TAiwVariant(TAiwMultipleEntrySelectionDataV2Pckg(aData)))); - - - iServiceHandler->ExecuteServiceCmdL( - KAiwCmdSelect, - *iAiwParamList, - iServiceHandler->OutParamListL(), - 0, - this - ); - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuitermsofusedialoghandler.cpp --- a/uiservicetab/vimpstui/src/cvimpstuitermsofusedialoghandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2006 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: Dialogue handler for TOU -* -*/ - - -#include "cvimpstuitermsofusedialoghandler.h" -#include "cvimpstuitermsofusedlg.h" - -#include "cvimpstsettingsstore.h" -#include -#include -#include "uiservicetabtracer.h" - - - - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// CVIMPSTUiTermsOfUseDialogHandler::HandleTermsOfUseDialogLD -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUiTermsOfUseDialogHandler::HandleTermsOfUseDialogLD( - MVIMPSTSettingsStore& aSettingsStore, - const TDesC& /*aUserName*/, - TInt& aServiceId, - HBufC* aToUMsg/* = NULL*/) - { - TRACER_AUTO; - // Show Terms of Use, return KErrCancel if user does not accept them, - // otherwise continue - if ( !DisplayTermsOfUseAndQueryLD(aToUMsg) ) - { - // User canceled ToU query, login cancelled - // note is already shown inside DisplayTermsOfUseAndQueryL - // method, just return KErrCancel - //CleanupStack::PopAndDestroy(tmpSap); - return KErrCancel; - } - else - { - TInt touOff =1; - aSettingsStore.SetL(aServiceId, ETOUDlgOff, touOff ); - } - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTermsOfUseDialogHandler::DisplayTermsOfUseAndQueryLD() -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTUiTermsOfUseDialogHandler::DisplayTermsOfUseAndQueryLD(HBufC* aToUMsg/* = NULL*/) - { - TRACER_AUTO; - TInt retVal = EAknSoftkeyCancel; - CVIMPSTUiTermsOfUseDlg* dlg = CVIMPSTUiTermsOfUseDlg::NewLC( ); - dlg->SetToUMsgL(aToUMsg); - retVal = dlg->RunDialogLD( R_CNUI_TERMS_OF_USE_DIALOG ); - CleanupStack::Pop(dlg); - if ( retVal == EAknSoftkeyOk || retVal == EAknSoftkeyYes) - { - return ETrue; - } - else - { - return EFalse; - } - } - -//End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuitermsofusedlg.cpp --- a/uiservicetab/vimpstui/src/cvimpstuitermsofusedlg.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,610 +0,0 @@ -/* -* Copyright (c) 2006 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: UI dialog for showing the Terms of use of a certain server -* -*/ - -#include "cvimpstuitermsofusedlg.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // CEikRichTextEditor -#include - -#include //cdl -#include - -#include -// item finder (Automatic highlight) -#include -#include -#include -#include -// title pane handling -#include -#include -#include -#include -#include - -#include -#include "vimpstui.hrh" -#include "uiservicetabtracer.h" -const TInt KTextMargin = 100; // normal text margin in twips -const TInt KSpaceBefore = 10; // space before each paragraph (twips) -const TInt KPixelsBetweenLines = 5; // pixels between text lines - - -// ======== MEMBER FUNCTIONS ======== - - -// --------------------------------------------------------------------------- -// RunDialogLD -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUiTermsOfUseDlg::RunDialogLD( TInt aResourceId ) - { - TInt retVal; - iRetVal = &retVal; - - ExecuteLD( aResourceId ); - - return retVal; - } - -// --------------------------------------------------------------------------- -// NewL() -// --------------------------------------------------------------------------- -// -CVIMPSTUiTermsOfUseDlg* CVIMPSTUiTermsOfUseDlg::NewL( ) - { - CVIMPSTUiTermsOfUseDlg* self = CVIMPSTUiTermsOfUseDlg::NewLC( ); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// NewLC() -// --------------------------------------------------------------------------- -// -CVIMPSTUiTermsOfUseDlg* CVIMPSTUiTermsOfUseDlg::NewLC( ) - { - CVIMPSTUiTermsOfUseDlg* self = new( ELeave ) CVIMPSTUiTermsOfUseDlg; - CleanupStack::PushL( self ); - self->ConstructL( ); - return self; - } - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::ConstructL() -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::ConstructL( ) - { - TRACER_AUTO; - iBgContext = CAknsBasicBackgroundControlContext::NewL( - KAknsIIDQsnBgAreaMainMessage, Rect(), ETrue ); - - iItemFinder = CItemFinder::NewL(); - iItemFinder->AddObserver( *this ); - - SetNewTitleTextL(); - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CVIMPSTUiTermsOfUseDlg::~CVIMPSTUiTermsOfUseDlg() - { - TRAP_IGNORE( RestoreTitlePaneTextL() ); - - AknsUtils::DeregisterControlPosition( this ); - - delete iBgContext; - delete iItemFinder; - delete iOldTitleText; - if(iToUText) - { - delete iToUText; - } - } - -// --------------------------------------------------------------------------- -// C++ constructor -// --------------------------------------------------------------------------- -// -CVIMPSTUiTermsOfUseDlg::CVIMPSTUiTermsOfUseDlg() - { - } - - - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::HandleParsingComplete() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::HandleParsingComplete() - { - //not implemented - } -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::PreLayoutDynInitL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::PreLayoutDynInitL() - { - TRACER_AUTO; - CAknDialog::PreLayoutDynInitL(); - AknsUtils::RegisterControlPosition( this ); - - iEditor = static_cast( Control( ETOURichEditorId ) ); - - iParaFormatLayer = CParaFormatLayer::NewL(); - iEditor->SetParaFormatLayer( iParaFormatLayer ); // takes the ownership - - iCharFormatLayer = CCharFormatLayer::NewL(); - iEditor->SetCharFormatLayer( iCharFormatLayer ); // takes the ownership - - // Update text color from skin - UpdateTextColorL(); - - // Get ToU message - if(iToUText) - { - iEditor->SetTextL( iToUText ); - delete iToUText; - iToUText = NULL; - } - - // Insert paragraph delimiter to make - // iItemFinder scroll the view all the way down - TChar lb( CEditableText::EParagraphDelimiter ); - iEditor->Text()->InsertL( iEditor->TextLength(), lb ); - - iEditor->CreateScrollBarFrameL(); - // Only vertical scrollbar is needed - iEditor->ScrollBarFrame()->SetScrollBarVisibilityL( - CEikScrollBarFrame::EOff,CEikScrollBarFrame::EOn); - iEditor->ScrollBarFrame()->SetScrollBarFrameObserver(this); - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::PostLayoutDynInitL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::PostLayoutDynInitL() - { - TRACER_AUTO; - CAknDialog::PostLayoutDynInitL(); - - - iItemFinder->SetEditor( &iEditor ); - - if ( iBgContext ) - { - iBgContext->SetRect( Rect() ); - iBgContext->SetParentPos( PositionRelativeToScreen() ); - } - // Try to scroll down - if (! iItemFinder->NextItemOrScrollL( CItemFinder::ENextDown ) ) - { - // at bottom => return - UpdateCbaL(); - //return EFalse; - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::SetSizeAndPosition -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::SetSizeAndPosition( const TSize& /*aSize*/ ) - { - // dialog fills the mainpane - TRect mainPane; - AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane ); - SetRect( mainPane ); - } - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::OkToExitL( TInt aButtonId ) -// (other items were commented in a header). -// --------------------------------------------------------- -// -TBool CVIMPSTUiTermsOfUseDlg::OkToExitL( TInt aButtonId ) - { - switch( aButtonId ) - { - case EAknSoftkeyCancel: - { - *iRetVal = EAknSoftkeyCancel; - return ETrue; - } - case EIMPSCommonUITOUContinue: - { - *iRetVal = EAknSoftkeyOk; - return ETrue; - } - case EAknSoftkeyEmpty: - { - return EFalse; - } - default: - { - return ETrue; - } - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::OfferKeyEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TKeyResponse CVIMPSTUiTermsOfUseDlg::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - TRACER_AUTO; - if( aType != EEventKey ) - { - return EKeyWasNotConsumed; - } - - switch( aKeyEvent.iCode ) - { - case EKeyBackspace: - { - return EKeyWasConsumed; - } - - case EKeyUpArrow: - { - TKeyResponse res = - iItemFinder->NextItemOrScrollL( CItemFinder::ENextUp ) ? - EKeyWasConsumed : EKeyWasNotConsumed; - return res; - } - - case EKeyDownArrow: - { - TKeyResponse res = - iItemFinder->NextItemOrScrollL( CItemFinder::ENextDown ) ? - EKeyWasConsumed : EKeyWasNotConsumed; - if ( res == EKeyWasConsumed ) - { - UpdateCbaL(); - } - if ( !iItemFinder->NextItemOrScrollL( CItemFinder::ENextDown ) ) - { - UpdateCbaL(); - } - return res; - } - - case EKeyRightArrow: - { - return EKeyWasConsumed; - } - - case EKeyEscape: // handle dialog shutdown. - { - TryExitL( EAknSoftkeyExit ); - return EKeyWasConsumed; - } - default: - { - return EKeyWasConsumed; - } - } - } - -void CVIMPSTUiTermsOfUseDlg::HandleScrollEventL(CEikScrollBar* aScrollBar, TEikScrollEvent aEventType) - { - TRACER_AUTO; - if( !aScrollBar ) - { - return ; - } - switch( aEventType ) - { - - case EEikScrollThumbDragVert : - case EEikScrollDown: - case EEikScrollBottom: - case EEikScrollPageDown: - case EEikScrollUp: - case EEikScrollTop: - case EEikScrollPageUp: - { - - TInt pos = iEditor->ScrollBarFrame()->VerticalScrollBar()->ThumbPosition(); - iEditor->HandleScrollEventL(aScrollBar, aEventType); - if( pos == iThumbMaxPos ) - { - UpdateCbaL(); - } - break; - } - default: - break; - } - - } -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::MopSupplyObject -// -// --------------------------------------------------------- -// - -TTypeUid::Ptr CVIMPSTUiTermsOfUseDlg::MopSupplyObject( TTypeUid aId ) - { - if ( aId.iUid == MAknsControlContext::ETypeId ) - { - return MAknsControlContext::SupplyMopObject( aId, iBgContext ); - } - - return CCoeControl::MopSupplyObject( aId ); - } - - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::SizeChanged -// -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::SizeChanged() - { - // base class method - CAknDialog::SizeChanged(); - - if ( iBgContext ) - { - iBgContext->SetRect( Rect() ); - iBgContext->SetParentPos( PositionRelativeToScreen() ); - } - - if( iEditor ) - { - TRect temp = Rect(); - temp.SetWidth(Rect().Width()-iEditor->ScrollBarFrame()->VerticalScrollBar()->ScrollBarBreadth()); - iEditor->SetRect( temp ); - } - - // Update the font to correct size - if( iParaFormatLayer && iCharFormatLayer ) - { - // Correct font - const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontSecondaryFont ); - - // format richtext - TInt lineSpacing( font->HeightInPixels() + KPixelsBetweenLines ); - CParaFormat paraFormat; - TParaFormatMask paraFormatMask; - paraFormat.iLineSpacingControl = - CParaFormat::ELineSpacingExactlyInPixels; - paraFormatMask.SetAttrib( EAttLineSpacingControl ); - paraFormat.iLineSpacingInTwips = lineSpacing; - paraFormatMask.SetAttrib( EAttLineSpacing ); - paraFormat.iLanguage = - CAknEnv::Static()->SettingCache().InputLanguage(); - paraFormatMask.SetAttrib( EAttParaLanguage ); - paraFormat.iLeftMarginInTwips = KTextMargin; - paraFormatMask.SetAttrib( EAttLeftMargin ); - paraFormat.iSpaceBeforeInTwips = KSpaceBefore; - paraFormatMask.SetAttrib( EAttSpaceBefore ); - - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormat.iFontSpec = font->FontSpecInTwips(); - charFormatMask.SetAttrib( EAttFontTypeface ); - charFormatMask.SetAttrib( EAttFontHeight ); - - //can't leave here - if( iEditor ) - { - TRAPD(err, iParaFormatLayer->SetL( ¶Format, paraFormatMask ); - iCharFormatLayer->SetL( charFormat, charFormatMask ); - iEditor->HandleTextChangedL(); ); - - - if( err != KErrNone ) - { - CActiveScheduler::Current()->Error( err ); - } - } - TRAP_IGNORE(iEditor->MoveDisplayL(TCursorPosition::EFPageDown) ); - TRAP_IGNORE(iEditor->MoveDisplayL(TCursorPosition::EFPageDown) ); - - iThumbMaxPos = iEditor->ScrollBarFrame()->VerticalScrollBar()->ThumbPosition(); - - TRAP_IGNORE(iEditor->MoveDisplayL(TCursorPosition::EFPageUp) ); - TRAP_IGNORE(iEditor->MoveDisplayL(TCursorPosition::EFPageUp) ); - } - } - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::SetNewTitleText -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::SetNewTitleTextL() - { - TRACER_AUTO; - CAknTitlePane* title = GetTitlePaneInstanceL(); - - // Store old one - HBufC* tmp = title->Text()->AllocL(); - delete iOldTitleText; - iOldTitleText = tmp; - - // Clear the navi pane - // Get pointer to status-pane - CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()-> - StatusPane(); - // Get pointer to navi-pane - CAknNavigationControlContainer* naviPane = - static_cast( - statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - naviPane->PushDefaultL( ETrue ); - - // Set the new text - HBufC* tempTitle = iEikonEnv->AllocReadResourceLC( R_QTN_SERVTAB_TOU_TITLE ); - title->SetTextL( *tempTitle ); - CleanupStack::PopAndDestroy( tempTitle ); - } - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::GetTitlePaneInstanceL -// Gets titlepane instance from CEikonEnv -// (other items were commented in a header). -// --------------------------------------------------------- -// -CAknTitlePane* CVIMPSTUiTermsOfUseDlg::GetTitlePaneInstanceL() const - { - TRACER_AUTO; - CAknTitlePane* title = static_cast< CAknTitlePane* > - ( CEikonEnv::Static()->AppUiFactory()->StatusPane()->ControlL( - TUid::Uid( EEikStatusPaneUidTitle ) ) ); - if ( !title ) - { - User::Leave( KErrNotSupported ); - } - return title; - } - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::DoRestoreTitlePaneTextL() const -// Does the actual restoring. -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::RestoreTitlePaneTextL() const - { - TRACER_AUTO; - CAknTitlePane* title = GetTitlePaneInstanceL(); - - if ( iOldTitleText ) - { - title->SetTextL( *iOldTitleText ); - } - else - { - title->SetTextToDefaultL(); - } - - // restore the navi pane - // Get pointer to status-pane - CEikStatusPane* statusPane = CEikonEnv::Static()->AppUiFactory()-> - StatusPane(); - // Get pointer to navi-pane - CAknNavigationControlContainer* naviPane = - static_cast( - statusPane->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ) ); - naviPane->Pop(); - } - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::UpdateCbaL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::UpdateCbaL() - { - TRACER_AUTO; - TInt cbaRes = R_CNUI_TERMS_OF_USE_DIALOG_CBA; - CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); - cba->SetCommandSetL( cbaRes ); - cba->DrawNow(); - } - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::UpdateTextColorL() -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::UpdateTextColorL() - { - TRACER_AUTO; - if( !iEditor ) - { - return; - } - - // Get text color from skin - TRgb textColor( KRgbBlack ); - AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - textColor, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - TCharFormat charFormat; - TCharFormatMask charFormatMask; - charFormat.iFontPresentation.iTextColor = textColor; - charFormatMask.SetAttrib( EAttColor ); - - // Apply format - int length = iEditor->RichText()->DocumentLength(); - iEditor->RichText()->SetInsertCharFormatL( charFormat, charFormatMask, length ); - iEditor->RichText()->ApplyCharFormatL( charFormat, charFormatMask, 0, length ); - } - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::HandleResourceChange -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::HandleResourceChange( TInt aType ) - { - if ( aType == KAknsMessageSkinChange ) - { - // When skin changes, we need to update text color - TRAP_IGNORE( UpdateTextColorL(); - iEditor->HandleTextChangedL(); ); - } - CAknDialog::HandleResourceChange( aType ); - } - -// --------------------------------------------------------- -// CVIMPSTUiTermsOfUseDlg::SetToUMsg -// (other items were commented in a header). -// --------------------------------------------------------- -// -void CVIMPSTUiTermsOfUseDlg::SetToUMsgL(HBufC* aToUText) - { - iToUText = aToUText; - } - - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/cvimpstuiviewmanager.cpp --- a/uiservicetab/vimpstui/src/cvimpstuiviewmanager.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,182 +0,0 @@ -/* -* Copyright (c) 2008 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: Class that provides centralized access for UI classes -* to logic handling -* -*/ - - -// INCLUDE FILES -#include -#include - -#include "cvimpstuiviewmanager.h" -#include "cvimpstuiextensionservice.h" -#include "cvimpstuiextensionviewinfo.h" -#include "cvimpstuiextensionfactory.h" -#include "cvimpstuimenuextension.h" -#include "uiservicetabtracer.h" - - - -// ================= MEMBER FUNCTIONS ======================= - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::CVIMPSTUIViewManager -// --------------------------------------------------------------------------- -// -CVIMPSTUIViewManager::CVIMPSTUIViewManager( - const TDesC& aServiceName, - CVIMPSTUiExtensionFactory& aExtensionFactory ): - iServiceName( aServiceName ), - iExtensionFactory( aExtensionFactory ) - { - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::ConstructL -// --------------------------------------------------------------------------- -// -void CVIMPSTUIViewManager::ConstructL() - { - - iEikEnv = CEikonEnv::Static(); - - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::NewL -// --------------------------------------------------------------------------- -// -CVIMPSTUIViewManager* CVIMPSTUIViewManager::NewL( - const TDesC& aSpsHandler, - CVIMPSTUiExtensionFactory& aExtensionFactory ) - { - CVIMPSTUIViewManager* self = NewLC( aSpsHandler, - aExtensionFactory ); - CleanupStack::Pop(self); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::NewLC -// --------------------------------------------------------------------------- -// -CVIMPSTUIViewManager* CVIMPSTUIViewManager::NewLC( - const TDesC& aSpsHandler, - CVIMPSTUiExtensionFactory& aExtensionFactory ) - { - CVIMPSTUIViewManager* self = - new (ELeave) CVIMPSTUIViewManager( aSpsHandler,aExtensionFactory ); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::~CVIMPSTUIViewManager -// --------------------------------------------------------------------------- -// -CVIMPSTUIViewManager::~CVIMPSTUIViewManager() - { - - iViewInfos.Reset(); - iViewInfos.Close(); - - - iServices.ResetAndDestroy(); - iServices.Close(); - - } - - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::AddNewClientL -// --------------------------------------------------------------------------- -// -void CVIMPSTUIViewManager::AddNewClientL( TUint aServiceId, MVIMPSTEngine& aEngine, - TInt aTabbedViewId,TInt aSearchViewId,TInt aBlockedViewId ,CVIMPSTUIMenuExtension& aMenuExtension ) - { - - TRACER_AUTO; - CVIMPSTUIExtensionService* service = - CVIMPSTUIExtensionService::NewL( - aServiceId, - aTabbedViewId, - aSearchViewId, - aBlockedViewId, - aEngine.ServiceName(), - aMenuExtension, - aEngine - ); - iServices.Append( service ); - - iViewInfos.Append( service->TabbedViewInfoL() ); - iViewInfos.Append( service->SearchViewInfo() ); - iViewInfos.Append( service->BlockedViewInfo() ); - } - - - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::EikEnv() -// --------------------------------------------------------------------------- -// -CEikonEnv& CVIMPSTUIViewManager::EikEnv() - { - return *iEikEnv; - } - - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::ViewInfoCount() -// --------------------------------------------------------------------------- -// -TInt CVIMPSTUIViewManager::ViewInfoCount() const - { - return iViewInfos.Count(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::ViewInfo() -// --------------------------------------------------------------------------- -// -const MxSPViewInfo* CVIMPSTUIViewManager::ViewInfo( - TInt aIndex ) const - { - return static_cast( iViewInfos[ aIndex ] ); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::ServiceCount() -// --------------------------------------------------------------------------- - -TInt CVIMPSTUIViewManager::ServiceCount() const - { - return iServices.Count(); - } - -// --------------------------------------------------------------------------- -// CVIMPSTUIViewManager::ServiceCount() -// --------------------------------------------------------------------------- -// -CVIMPSTUIExtensionService& CVIMPSTUIViewManager::Service( - TInt aIndex ) const - { - return *iServices[ aIndex ]; - } - - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstui/src/dllmain.cpp --- a/uiservicetab/vimpstui/src/dllmain.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2008 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: -* Standard Symbian OS DLL entry point function and entry point for -* polymorphic dll usage. -* -*/ - - -// INCLUDES -// System includes -#include - -// internal includes -#include "vimpstextentionuiuid.h" -#include "cvimpstuiextensionfactory.h" - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY( KIMCONTACTSEXTNIMPLEMENTATIONUID, - CVIMPSTUiExtensionFactory::NewL ) - }; - -// The one and only exported function that is the ECom entry point -EXPORT_C const TImplementationProxy* ImplementationGroupProxy - (TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/bwins/vimpstutilsu.def --- a/uiservicetab/vimpstutils/bwins/vimpstutilsu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -EXPORTS - ??0CVIMPSTUtilsTextQueryDialog@@AAE@AAVTDes16@@ABW4TTone@CAknQueryDialog@@HH@Z @ 1 NONAME ; CVIMPSTUtilsTextQueryDialog::CVIMPSTUtilsTextQueryDialog(class TDes16 &, enum CAknQueryDialog::TTone const &, int, int) - ??1CVIMPSTUtilsTextQueryDialog@@UAE@XZ @ 2 NONAME ; CVIMPSTUtilsTextQueryDialog::~CVIMPSTUtilsTextQueryDialog(void) - ?Bitmap@CVIMPSTEngineImageHandler@@QAEAAVCFbsBitmap@@XZ @ 3 NONAME ; class CFbsBitmap & CVIMPSTEngineImageHandler::Bitmap(void) - ?CombineStringFromResourceLC@VIMPSTUtils@@SAPAVHBufC16@@HH@Z @ 4 NONAME ; class HBufC16 * VIMPSTUtils::CombineStringFromResourceLC(int, int) - ?ConstructL@CVIMPSTUtilsWaitNote@@AAEXABVTDesC16@@HHPAVMVIMPSTUtilsWaitNoteObserver@@@Z @ 5 NONAME ; void CVIMPSTUtilsWaitNote::ConstructL(class TDesC16 const &, int, int, class MVIMPSTUtilsWaitNoteObserver *) - ?DialogDismissedL@CVIMPSTUtilsWaitNote@@MAEXH@Z @ 6 NONAME ; void CVIMPSTUtilsWaitNote::DialogDismissedL(int) - ?DismissDialog@CVIMPSTUtilsWaitNote@@QAEXXZ @ 7 NONAME ; void CVIMPSTUtilsWaitNote::DismissDialog(void) - ?DisplayErrorNoteL@VIMPSTUtilsDialog@@SAHABVTDesC16@@H@Z @ 8 NONAME ; int VIMPSTUtilsDialog::DisplayErrorNoteL(class TDesC16 const &, int) - ?DisplayId@VIMPSTUtils@@SA?AVTPtrC16@@ABVTDesC16@@H@Z @ 9 NONAME ; class TPtrC16 VIMPSTUtils::DisplayId(class TDesC16 const &, int) - ?DisplayListQueryDialogL@VIMPSTUtilsDialog@@SAHPAHPAVMDesC16Array@@HABVTDesC16@@2HH@Z @ 10 NONAME ; int VIMPSTUtilsDialog::DisplayListQueryDialogL(int *, class MDesC16Array *, int, class TDesC16 const &, class TDesC16 const &, int, int) - ?DisplayNoteDialogL@VIMPSTUtilsDialog@@SAHABVTDesC16@@HABW4TTimeout@CAknNoteDialog@@@Z @ 11 NONAME ; int VIMPSTUtilsDialog::DisplayNoteDialogL(class TDesC16 const &, int, enum CAknNoteDialog::TTimeout const &) - ?DisplayQueryDialogL@VIMPSTUtilsDialog@@SAHHABVTDesC16@@@Z @ 12 NONAME ; int VIMPSTUtilsDialog::DisplayQueryDialogL(int, class TDesC16 const &) - ?DisplayTextQueryDialogL@VIMPSTUtilsDialog@@SAHAAVTDes16@@HHHHW4TLeftSoftkey@1@W4TInitialSelectionMode@1@H@Z @ 13 NONAME ; int VIMPSTUtilsDialog::DisplayTextQueryDialogL(class TDes16 &, int, int, int, int, enum VIMPSTUtilsDialog::TLeftSoftkey, enum VIMPSTUtilsDialog::TInitialSelectionMode, int) - ?LoadResourceL@VIMPSTUtils@@SAPAVHBufC16@@H@Z @ 14 NONAME ; class HBufC16 * VIMPSTUtils::LoadResourceL(int) - ?LoadResourceL@VIMPSTUtils@@SAPAVHBufC16@@HABVTDesC16@@@Z @ 15 NONAME ; class HBufC16 * VIMPSTUtils::LoadResourceL(int, class TDesC16 const &) - ?NewL@CVIMPSTEngineImageHandler@@SAPAV1@XZ @ 16 NONAME ; class CVIMPSTEngineImageHandler * CVIMPSTEngineImageHandler::NewL(void) - ?NewL@CVIMPSTUtilsTextQueryDialog@@SAPAV1@AAVTDes16@@ABW4TTone@CAknQueryDialog@@HH@Z @ 17 NONAME ; class CVIMPSTUtilsTextQueryDialog * CVIMPSTUtilsTextQueryDialog::NewL(class TDes16 &, enum CAknQueryDialog::TTone const &, int, int) - ?NewLC@CVIMPSTEngineImageHandler@@SAPAV1@XZ @ 18 NONAME ; class CVIMPSTEngineImageHandler * CVIMPSTEngineImageHandler::NewLC(void) - ?OfferKeyEventL@CVIMPSTUtilsTextQueryDialog@@UAE?AW4TKeyResponse@@ABUTKeyEvent@@W4TEventCode@@@Z @ 19 NONAME ; enum TKeyResponse CVIMPSTUtilsTextQueryDialog::OfferKeyEventL(struct TKeyEvent const &, enum TEventCode) - ?OkToExitL@CVIMPSTUtilsTextQueryDialog@@UAEHH@Z @ 20 NONAME ; int CVIMPSTUtilsTextQueryDialog::OkToExitL(int) - ?ProcessFromBitmapL@CVIMPSTEngineImageHandler@@QAEPAVHBufC8@@AAVCFbsBitmap@@@Z @ 21 NONAME ; class HBufC8 * CVIMPSTEngineImageHandler::ProcessFromBitmapL(class CFbsBitmap &) - ?ProcessImageFromDataL@CVIMPSTEngineImageHandler@@QAEPAVHBufC8@@ABVTDesC8@@0@Z @ 22 NONAME ; class HBufC8 * CVIMPSTEngineImageHandler::ProcessImageFromDataL(class TDesC8 const &, class TDesC8 const &) - ?ProcessImageFromFileL@CVIMPSTEngineImageHandler@@QAEPAVHBufC8@@ABVTDesC16@@ABVTDesC8@@@Z @ 23 NONAME ; class HBufC8 * CVIMPSTEngineImageHandler::ProcessImageFromFileL(class TDesC16 const &, class TDesC8 const &) - ?SetObserver@CVIMPSTUtilsWaitNote@@QAEXPAVMVIMPSTUtilsWaitNoteObserver@@@Z @ 24 NONAME ; void CVIMPSTUtilsWaitNote::SetObserver(class MVIMPSTUtilsWaitNoteObserver *) - ?ShowNoteL@VIMPSTUtilsNoteMapper@@SAXHABVTDesC16@@@Z @ 25 NONAME ; void VIMPSTUtilsNoteMapper::ShowNoteL(int, class TDesC16 const &) - ?ShowWaitNoteL@CVIMPSTUtilsWaitNote@@SAPAV1@ABVTDesC16@@HHPAVMVIMPSTUtilsWaitNoteObserver@@@Z @ 26 NONAME ; class CVIMPSTUtilsWaitNote * CVIMPSTUtilsWaitNote::ShowWaitNoteL(class TDesC16 const &, int, int, class MVIMPSTUtilsWaitNoteObserver *) - ?ShowWaitNoteL@CVIMPSTUtilsWaitNote@@SAPAV1@HHHPAVMVIMPSTUtilsWaitNoteObserver@@@Z @ 27 NONAME ; class CVIMPSTUtilsWaitNote * CVIMPSTUtilsWaitNote::ShowWaitNoteL(int, int, int, class MVIMPSTUtilsWaitNoteObserver *) - ?ShowWaitNoteLC@CVIMPSTUtilsWaitNote@@SAPAV1@ABVTDesC16@@HHPAVMVIMPSTUtilsWaitNoteObserver@@@Z @ 28 NONAME ; class CVIMPSTUtilsWaitNote * CVIMPSTUtilsWaitNote::ShowWaitNoteLC(class TDesC16 const &, int, int, class MVIMPSTUtilsWaitNoteObserver *) - ?ShowWaitNoteLC@CVIMPSTUtilsWaitNote@@SAPAV1@HHHPAVMVIMPSTUtilsWaitNoteObserver@@@Z @ 29 NONAME ; class CVIMPSTUtilsWaitNote * CVIMPSTUtilsWaitNote::ShowWaitNoteLC(int, int, int, class MVIMPSTUtilsWaitNoteObserver *) - ?UpdateLeftSoftKeyL@CVIMPSTUtilsTextQueryDialog@@UAEXXZ @ 30 NONAME ; void CVIMPSTUtilsTextQueryDialog::UpdateLeftSoftKeyL(void) - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/eabi/vimpstutilsu.def --- a/uiservicetab/vimpstutils/eabi/vimpstutilsu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -EXPORTS - _ZN11VIMPSTUtils13LoadResourceLEi @ 1 NONAME - _ZN11VIMPSTUtils13LoadResourceLEiRK7TDesC16 @ 2 NONAME - _ZN11VIMPSTUtils27CombineStringFromResourceLCEii @ 3 NONAME - _ZN11VIMPSTUtils9DisplayIdERK7TDesC16i @ 4 NONAME - _ZN17VIMPSTUtilsDialog17DisplayErrorNoteLERK7TDesC16i @ 5 NONAME - _ZN17VIMPSTUtilsDialog18DisplayNoteDialogLERK7TDesC16iRKN14CAknNoteDialog8TTimeoutE @ 6 NONAME - _ZN17VIMPSTUtilsDialog19DisplayQueryDialogLEiRK7TDesC16 @ 7 NONAME - _ZN17VIMPSTUtilsDialog23DisplayListQueryDialogLEPiP12MDesC16ArrayiRK7TDesC16S5_ii @ 8 NONAME - _ZN17VIMPSTUtilsDialog23DisplayTextQueryDialogLER6TDes16iiiiNS_12TLeftSoftkeyENS_21TInitialSelectionModeEi @ 9 NONAME - _ZN20CVIMPSTUtilsWaitNote10ConstructLERK7TDesC16iiP28MVIMPSTUtilsWaitNoteObserver @ 10 NONAME - _ZN20CVIMPSTUtilsWaitNote11SetObserverEP28MVIMPSTUtilsWaitNoteObserver @ 11 NONAME - _ZN20CVIMPSTUtilsWaitNote13DismissDialogEv @ 12 NONAME - _ZN20CVIMPSTUtilsWaitNote13ShowWaitNoteLERK7TDesC16iiP28MVIMPSTUtilsWaitNoteObserver @ 13 NONAME - _ZN20CVIMPSTUtilsWaitNote13ShowWaitNoteLEiiiP28MVIMPSTUtilsWaitNoteObserver @ 14 NONAME - _ZN20CVIMPSTUtilsWaitNote14ShowWaitNoteLCERK7TDesC16iiP28MVIMPSTUtilsWaitNoteObserver @ 15 NONAME - _ZN20CVIMPSTUtilsWaitNote14ShowWaitNoteLCEiiiP28MVIMPSTUtilsWaitNoteObserver @ 16 NONAME - _ZN20CVIMPSTUtilsWaitNote16DialogDismissedLEi @ 17 NONAME - _ZN21VIMPSTUtilsNoteMapper9ShowNoteLEiRK7TDesC16 @ 18 NONAME - _ZN25CVIMPSTEngineImageHandler18ProcessFromBitmapLER10CFbsBitmap @ 19 NONAME - _ZN25CVIMPSTEngineImageHandler21ProcessImageFromDataLERK6TDesC8S2_ @ 20 NONAME - _ZN25CVIMPSTEngineImageHandler21ProcessImageFromFileLERK7TDesC16RK6TDesC8 @ 21 NONAME - _ZN25CVIMPSTEngineImageHandler4NewLEv @ 22 NONAME - _ZN25CVIMPSTEngineImageHandler5NewLCEv @ 23 NONAME - _ZN25CVIMPSTEngineImageHandler6BitmapEv @ 24 NONAME - _ZN27CVIMPSTUtilsTextQueryDialog14OfferKeyEventLERK9TKeyEvent10TEventCode @ 25 NONAME - _ZN27CVIMPSTUtilsTextQueryDialog18UpdateLeftSoftKeyLEv @ 26 NONAME - _ZN27CVIMPSTUtilsTextQueryDialog4NewLER6TDes16RKN15CAknQueryDialog5TToneEii @ 27 NONAME - _ZN27CVIMPSTUtilsTextQueryDialog9OkToExitLEi @ 28 NONAME - _ZN27CVIMPSTUtilsTextQueryDialogC1ER6TDes16RKN15CAknQueryDialog5TToneEii @ 29 NONAME - _ZN27CVIMPSTUtilsTextQueryDialogC2ER6TDes16RKN15CAknQueryDialog5TToneEii @ 30 NONAME - _ZN27CVIMPSTUtilsTextQueryDialogD0Ev @ 31 NONAME - _ZN27CVIMPSTUtilsTextQueryDialogD1Ev @ 32 NONAME - _ZN27CVIMPSTUtilsTextQueryDialogD2Ev @ 33 NONAME - _ZTI20CVIMPSTUtilsWaitNote @ 34 NONAME ; ## - _ZTI21CVimpstImageProcessor @ 35 NONAME ; ## - _ZTI27CVIMPSTUtilsTextQueryDialog @ 36 NONAME ; ## - _ZTV20CVIMPSTUtilsWaitNote @ 37 NONAME ; ## - _ZTV21CVimpstImageProcessor @ 38 NONAME ; ## - _ZTV27CVIMPSTUtilsTextQueryDialog @ 39 NONAME ; ## - _ZThn4_N20CVIMPSTUtilsWaitNote16DialogDismissedLEi @ 40 NONAME ; ## - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/group/bld.inf --- a/uiservicetab/vimpstutils/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -/* -* Copyright (c) 2008 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: Build information file for IM utils -* -*/ - - - -PRJ_PLATFORMS - -DEFAULT - -PRJ_MMPFILES - -vimpstutils.mmp - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/group/vimpstutils.mmp --- a/uiservicetab/vimpstutils/group/vimpstutils.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2008 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: Utils for IMUiServiceTab modules. -* -*/ - - -// To get the APP_LAYER_SYSTEMINCLUDE-definition -#include -#include - -#include "../../inc/vimpstbuilddefinitions.h" - -CAPABILITY CAP_GENERAL_DLL - -TARGET vimpstutils.dll -TARGETTYPE dll -UID 0x1000008d 0x20012424 -VENDORID VID_DEFAULT - -VERSION 10.0 - -SOURCEPATH ../src -SOURCE vimpstutils.cpp -SOURCE vimpstutilsdialog.cpp -SOURCE vimpstutilsnotemapper.cpp -SOURCE vimpstutilswaitnote.cpp -SOURCE vimpstutilstextquerydialog.cpp -SOURCE cvimpstimageprocessor.cpp -SOURCE cvimpstengineaimagehandler.cpp -USERINCLUDE ../inc -USERINCLUDE ../../inc -USERINCLUDE ../../Group - - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY efsrv.lib -LIBRARY avkon.lib -LIBRARY aknnotify.lib -LIBRARY eikcore.lib -LIBRARY eikdlg.lib -LIBRARY eikcoctl.lib -LIBRARY bafl.lib -LIBRARY aknlayout.lib -LIBRARY eikctl.lib -LIBRARY cone.lib -LIBRARY commonengine.lib -LIBRARY imageconversion.lib // image processing -LIBRARY fbscli.lib // cfsbitmap -LIBRARY bitmaptransforms.lib // bitmap scaling -LIBRARY mediaclientimage.lib // bitmap to descriptor conversion - - - -//#ifdef CHAT_ENABLE_DEBUG_PRINT -LIBRARY flogger.lib -//#endif - -LANG SC - - -// EXPORTUNFROZEN - diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/inc/cvimpstengineimagehandler.h --- a/uiservicetab/vimpstutils/inc/cvimpstengineimagehandler.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,160 +0,0 @@ -/* -* Copyright (c) 2008 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: Image handler for VImpstengine handler -* -*/ - -#ifndef __CVIMPSTENGINEIMAGEHANDLER_H -#define __CVIMPSTENGINEIMAGEHANDLER_H - -// INCLUDES -#include - -#include "mvimpstimageprocessobserver.h" -#include -// FORWARD DECLARATIONS -class CVimpstImageProcessor; -class CFbsBitmap; - -// CLASS DECLARATION -/** - * This Class is wrapper over the CVimpstImageProcessor implements the processing of image - * @lib vimpstengine.lib - * @since S60 5.0 - */ -NONSHARABLE_CLASS( CVIMPSTEngineImageHandler ) : public CBase, - public MCAImageProcessObserver, - public MMdaImageUtilObserver - - { - - - public: // Two-phased constructors and destructor - - /** - * Two-phased constructor. - */ - - IMPORT_C static CVIMPSTEngineImageHandler* NewL(); - /** - * Two-phased constructor. - */ - IMPORT_C static CVIMPSTEngineImageHandler* NewLC(); - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - /** - * C++ Destructor. - */ - virtual ~CVIMPSTEngineImageHandler(); - - - private: - - /** - * default constructor - */ - CVIMPSTEngineImageHandler(); - - -public: //from MMdaImageUtilObserver - /** - * Defines required client behaviour when a create operation has completed. - * - * @param aError:A value identifying the status of the create operation. KErrNone or one of the system wide error codes. - * - */ - void MiuoCreateComplete(TInt aError); - /** - * Defines required client behaviour when an open operation has completed. - * - * @param aError: A value identifying the status of the open operation. KErrNone or one of the system wide error codes - */ - void MiuoOpenComplete(TInt aError); - /** - * Defines required client behaviour when a conversion, image rotation or image re-scaling operation has completed. - * - * @param aError: A value identifying the status of the operation. KErrNone or one of the system wide error codes. - */ - void MiuoConvertComplete(TInt aError); - - public: - /** - * process the image from file name - * @return processed image content - */ - IMPORT_C HBufC8* ProcessImageFromFileL(const TDesC& aFilename , - const TDesC8& aMimetype); - /** - * process the image from image data - * @return processed image content - */ - IMPORT_C HBufC8* ProcessImageFromDataL( const TDesC8& aImageData , const TDesC8& aMimeType); - /** - * process the image from image bitmap - * @return processed image content - */ - IMPORT_C HBufC8* ProcessFromBitmapL( CFbsBitmap& aBitMap ); - /** - * Get Bitmap - * @return bitmap - */ - IMPORT_C CFbsBitmap& Bitmap(); - public: // from MCAImageProcessObserver - - /** - * See MCAImageProcessObserver - */ - void HandleProcessingCompleteL( TInt aStatus ); - - - private: - - - //Result code from waited request - TInt iReqResult; - - // Owns content - HBufC8* iContent; - - // Owns imageporcessor - CVimpstImageProcessor* iProcessor; - - // own active sheduler - CActiveSchedulerWait iWait; - /* - * bitmap to descriptor pointer - * Owns - */ - CMdaImageBitmapToDescUtility* iToDesc; - /* - * image format - */ - TMdaJfifClipFormat iFormat; - /* - * stores converted descriptor from bitmap - * Doesn't Own: ownership is transferred to caller - */ - HBufC8* iBuf; - /* - * stores error code - */ - TInt iError; - - }; - -#endif //__CVIMPSTENGINEIMAGEHANDLER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/inc/cvimpstimageprocessor.h --- a/uiservicetab/vimpstutils/inc/cvimpstimageprocessor.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,224 +0,0 @@ -/* -* Copyright (c) 2008 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: Image processor -* -*/ - - -#ifndef CVIMPSTIMAGEPROCESSOR_H -#define CVIMPSTIMAGEPROCESSOR_H - -#include -#include "mvimpstimageprocessobserver.h" -class CImageDecoder; -class CBitmapScaler; -class CFbsBitmap; -class CImageEncoder; -// CLASS DECLARATION - -/** - * Image processor - * - * @lib vimpstutils.dll - */ -class CVimpstImageProcessor : public CActive - { - public: - /** - * Content processing states - */ - enum TContentProcessState - { - EContentNotProcessed = 0, - EConvertImageDatatoBitmap, - EScaleBitmap, - EConentFromScaledBitmap, - EProcessingComplete - }; - public: // Construction - - /** - * Construction - */ - static CVimpstImageProcessor* NewL( MCAImageProcessObserver* aObserver); - - /** - * Destruction - */ - ~CVimpstImageProcessor(); - - private: // Construction - - /** - * Constructor - */ - CVimpstImageProcessor(MCAImageProcessObserver* aObserver); - - /** - * Constructor - */ - void ConstructL(); - - private: // From CActive - - /** - * @see CActive - */ - void RunL(); - - /** - * @see CActive - */ - void DoCancel(); - - /** - * @see CActive. - */ - TInt RunError( TInt aError ); - - public: - /** - * This is used when the image data is ready - * image data is proceesed and the new content is of the image is given - * by reducing the image data size - * - * @param aImageData : Content of the image file - * @param aMimeType : Mime type of the file from which the content is passed - */ - TInt ProcessFromDataL( const TDesC8& aImageData , const TDesC8& aMimeType); - /** - * This is used when the image data is ready - * image data is proceesed and the new content is of the image is given - * by reducing the image data size - * - * @param aFileName : image file name - * @param aMimeType : Mime type of the file from which the content is passed - */ - void ProcessFromFileL( const TDesC& aFileName , const TDesC8& aMimeType); - /** - * Cancel the image processing operation - */ - void CancelProcessing(); - /** - * Register the observer to give callback - * once the processing is done - * @param aObserver : obeserver - */ - void RegisterObserver( MCAImageProcessObserver* aObserver ); - /** - * Retrieve the processed image - * Ownership of iContent is transferred to caller - * @return processed image - */ - HBufC8* GetContentData(); - /** - * Get Bitmap - * @return bitmap - */ - CFbsBitmap& Bitmap(); - - private: // New helper methods - - /** - * Convert image to bitmap - */ - void ConvertImageToBitmapL(); - /** - * Scale Bit map - */ - void ScaleBitmapL(); - /** - * store scaled bitmap content into iimageencoder - */ - void ContentFromScaledBitmapL(); - /** - * Get new size after decoding. - * Scale to nearest (larger or equal) size with ratio 1:1, 1:2, 1:4 or 1:8 - * directly when decoding. - * - * @param aSize Size of original image - * @param aTargetSize Size of target image - * @param aAnyRatio Set this to ETrue if the decoder is cabable of scaling to any * ratio - * @return New size of decoded image - */ - TSize DecodeSize( const TSize& aSize, const TSize& aTargetSize, - TBool aAnyRatio ); - - /** - * Get new size after scaling. If scale not needed return EFalse - * Scaled size will be 40x30 if width > height or 30x40 if - * height > width. - * - * @param aSize Original size of image - * @param aNewSize New size of scaled image - * @return ETrue if scale needed. - */ - TBool ScaleSize( const TSize& aSize, TSize& aNewSize ); - - /** - * Notify observer for completion and remove message from array - */ - void CompleteRequestL(); - /** - * Reset current operation and remove all pending messages from stack. - * @param aReason reson for reseting - */ - void ResetProcessingL( TInt aReason ); - - /** - * Deletes and cancels all processing units ( decoder, encoder etc ). - */ - void ClearState(); - - - private: // Data - - /// File system access - RFs iFs; - - // Decoder for image. - CImageDecoder* iImageDecoder; - CBitmapScaler* iScaler; - CImageEncoder* iImageEncoder; - /** - * Bitmap. Owns. - */ - CFbsBitmap* iBitmap; - /** - * Target size for bitmap - */ - TSize iTargetSize; - - /** - * Thumbnail size for bitmap - */ - TSize iThumbSize; - /** - * Doesn't Own - */ - HBufC8* iContent; - - /// Owns. - HBufC8* iMimeType; - TContentProcessState iProcessingState; - HBufC* iFilename; - - MCAImageProcessObserver* iObserver; - TInt iScaleSize; - TBool isBitmapReturned; - }; - -#endif // CVIMPSTIMAGEPROCESSOR_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/inc/mvimpstimageprocessobserver.h --- a/uiservicetab/vimpstutils/inc/mvimpstimageprocessobserver.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2008 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: Interface for observing content processors -* -*/ - - -#ifndef MCACONTENTPROCESSOBSERVER_H -#define MCACONTENTPROCESSOBSERVER_H - -// FORWARD CLASS DECLERATIONS - - -// CLASS DECLARATION - -/** - * Interface for observing content processors - * - * @lib vimpstutils.dll - */ -class MCAImageProcessObserver - { - public: // Interface - - /** - * Handle processing completion. Called by content processor when - * processing is ready. - * @param aStatus, Status of processing. KErrNone -> OK. - */ - virtual void HandleProcessingCompleteL( TInt aStatus ) = 0; - - protected: // For protection. - - /** - * Destructor - */ - virtual ~MCAImageProcessObserver(){} - }; - -#endif // MCACONTENTPROCESSOBSERVER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/inc/vimpstallerrors.h --- a/uiservicetab/vimpstutils/inc/vimpstallerrors.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2008 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: All CSP errors, symbolically - * -*/ - - -#ifndef _VIMPSTALLERRORS_H -#define _VIMPSTALLERRORS_H - - -#define KPREQUESTERRSUCCESSFUL 200 // successfull - -/** - * A Enum - * TEngineErrors list of engine errors - */ -enum TEngineErrors - { - EVIMPSTWrongUserIdPassword = 409, /* wrong userid password error*/ - EVIMPSTUnknownUserId = 531, /* unknown user id */ - - // 6xx - SESSION - EVIMPSTSessionExpired = 600, /* session expired*/ - EVIMPSTForcedLogout = 601, /* Forced Logout */ - EVIMPSTNotLoggedIn = 604, /* not logged in */ - EVIMPSCancelAccesspoint = 605 , /*cancel accespoint*/ - - // 7xx - PRESENCE AND CONTACT LIST - EVIMPSTInvalidPresenceAttribute = 750, /* invalid presence attribute */ - EVIMPSTInvalidPresenceValue = 751, /* Invalid presence value */ - - // 9xx - GENERAL ERRORS - EVIMPSTMultipleErrors = 900, /* Multiple errors */ - EVIMPSTNotSupported /* feature not supported*/ - }; - -#endif // _IMPSCSPALLERRORS_H diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/inc/vimpstutils.h --- a/uiservicetab/vimpstutils/inc/vimpstutils.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2008 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: Utils for IMUiServiceTab modules. -* -*/ - - -#ifndef __VIMPSTUTILS_H__ -#define __VIMPSTUTILS_H__ - -// INCLUDES -#include -#include - -/** - * Utils for IMUiServiceTab modules. - * @lib vimpstengine.lib - * @since 5.0 - */ -class VIMPSTUtils - { - public: // new methods - - /** - * Used for removing the domain part from the user id - * @param aId The id to process - * @param aListHiding, is list hiding. - * @return TPtrC The id without the domain part - */ - IMPORT_C static TPtrC DisplayId( const TDesC& aId, TBool aListHiding = EFalse ); - - /** - * used to load the resource - * @param aResourceId The id to read - * @return HBufC* The string for given resource id - */ - IMPORT_C static HBufC* LoadResourceL( TInt aResourceId ); - - /** - * used to load the resource - * @param aResourceId The id to read - * @param aPrompt %U string. - * @return HBufC* The string for given resource id - */ - IMPORT_C static HBufC* LoadResourceL( TInt aResourceId , const TDesC& aPrompt); - - /** - * Combines two strings given resource ids. - * The caller is responsible to delete the string - * - * @since 5.0 - * @param TInt aResourceId1 - * @param TInt aResourceId2 - * @return HBufC* the combined string - */ - IMPORT_C static HBufC* CombineStringFromResourceLC( TInt aResourceId1, TInt aResourceId2 ); - - }; - -#endif // __VIMPSTUTILS_H__ - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/inc/vimpstutilsdialog.h --- a/uiservicetab/vimpstutils/inc/vimpstutilsdialog.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -/* -* Copyright (c) 2008 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: Utils for IMUiServiceTab modules. - * -*/ - - - -#ifndef VIMPSTUTILSDIALOG_H -#define VIMPSTUTILSDIALOG_H - -// INCLUDES -#include // for R_AVKON_SOFTKEYS_EMPTY -#include -#include - -// CLASS DECLARATION -/** - * This class provides some useful methods to launch different dialogs. - * - * @lib vimpstutils.lib - * @since 5.0 - */ -class VIMPSTUtilsDialog - { - - public: // Enumerations - - enum TLeftSoftkey - { - EDefault = 0, - ESend, - EOk - }; - - enum TInitialSelectionMode - { - ESelectAll = 0, // Default mode - ESelectNone - }; - - public: // New functions - - /** - * This method displays note dialogs e.g. confirmation dialog - * Note dialog's type is defined in resource file - * @param aText Prompt text of dialog - * @param aButtonsResourceId tells buttons that are shown with note, default none - * @param aTimeout timeout when note showing stops - * @return KeyCode (e.g. EAknSoftKeyOk) - */ - IMPORT_C static TInt DisplayNoteDialogL( const TDesC& aText, - const TInt aButtonsResourceId = R_AVKON_SOFTKEYS_EMPTY, - const CAknNoteDialog::TTimeout& aTimeout = CAknNoteDialog::EShortTimeout ); - - /** - * This method displays error notes for corresponding resource Id - * @param aText Prompt text of dialog - * @param aSoftkeyOk Should there be OK softkey - * @return KeyCode - */ - IMPORT_C static TInt DisplayErrorNoteL( const TDesC& aText, - TBool aSoftkeyOk = EFalse ); - - - /** - * Displays query dialog with given data - * @param aDialogResourceId Dialogs resource id - * @param aPrompt Prompt text - * @return Dialog dismiss key - */ - IMPORT_C static TInt DisplayQueryDialogL( TInt aDialogResourceId, - const TDesC& aPrompt = KNullDesC ); - - /** - * This method displays Text Query Dialog - * @param aDataText Descriptor where written data is stored - * @param aTitleResourceId Resource ID of title text - * @param aDialogResource Resource of dialog - * @param aPredictiveInput Enable T9 predictive input (when ETrue) - * @param aLeftSoftkeyAlwaysVisible Is LSK always visible, or visible - * only when there is text in the editor. - * @param aLeftSoftkey Left soft key of dialog. - * @param aSelectionMode Initial selection mode in dialog editor. - * @param aDomainSelectionQuery Is domain selection variated on or not, - * ETrue causes dialog to exit when editor field - * is cleared by user. - * @return KeyCode (e.g. EAknSoftKeyOk) - */ - IMPORT_C static TInt DisplayTextQueryDialogL( TDes& aDataText, - const TInt aTitleResourceId, - const TInt aDialogResourceId, - TBool aPredictiveInput = EFalse, - TBool aLeftSoftkeyAlwaysVisible = EFalse, - TLeftSoftkey aLeftSoftkey = EDefault, - TInitialSelectionMode aSelectionMode = ESelectAll, - TBool aDomainSelectionQuery = EFalse ); - /** - * This method displays singleselection List Query Dialog - * NOTE that it is the responsibility of the caller to use - * cleanupstack for aItemList (ownership is NOT transferred to the - * list box). - * @param aSelectedIndex Index of selected item - * @param aItemList List of Items (Must be formatted) - * @param aDialogResourceId Resource ID of dialog - * @param aAlternativeTitle Alternative title text - * @param aListEmptyText Text to be shown if the list is empty - * @param aIsForwardQuery The dialog is for forwarding the message (ETrue) - * @return KeyCode (e.g. EAknSoftKeyOk) - */ - IMPORT_C static TInt DisplayListQueryDialogL( TInt* aSelectedIndex, - MDesCArray* aItemList, - const TInt aDialogResourceId, - const TDesC& aAlternativeTitle = KNullDesC, - const TDesC& aListEmptyText = KNullDesC, - const TBool aIsForwardQuery = EFalse, - const TBool aIsOnlySelect = EFalse ); - - }; - -#endif // VIMPSTUTILSDIALOG_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/inc/vimpstutilsnotemapper.h --- a/uiservicetab/vimpstutils/inc/vimpstutilsnotemapper.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2008 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: Utils for IMUiServiceTab modules. -* -*/ - - - -#ifndef VIMPSTUTILSNOTEMAPPER_H -#define VIMPSTUTILSNOTEMAPPER_H - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* Class is used for mapping engine errors to correct error notes -* -* @lib vimpstutils.app -* @since 5.0 -*/ -class VIMPSTUtilsNoteMapper - { - public: // New functions - /** - * Shows specified error note for aErrorCode (UI specification) - * @param aErrorCode Error code - * @param aAdditionalData Additional data to show. - */ - IMPORT_C static void ShowNoteL( const TInt aErrorCode, - const TDesC& aAdditionalData = KNullDesC ); - }; - -#endif // VIMPSTUTILSNOTEMAPPER_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/inc/vimpstutilstextquerydialog.h --- a/uiservicetab/vimpstutils/inc/vimpstutilstextquerydialog.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2006 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: Text query dialog that accepts empty input -* -*/ - - - -#ifndef CVIMPSTUTILSTEXTQUERYDIALOG_H -#define CVIMPSTUTILSTEXTQUERYDIALOG_H - -// INCLUDES -#include - -// CLASS DECLARATION - -/** - * Text query dialog that accepts empty input. - * Wrapper for CAknTextQueryDialog - * - * @lib chat.app - * @since - */ -class CVIMPSTUtilsTextQueryDialog : public CAknTextQueryDialog - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @see CAknTextQueryDialog::NewL - */ - IMPORT_C static CVIMPSTUtilsTextQueryDialog* NewL( TDes& aDataText, - const TTone& aTone = ENoTone, - TBool aLeftSoftkeyAlwaysVisible = ETrue, - TBool aDomainSelectionQuery = EFalse ); - - /** - * Destructor. - */ - ~CVIMPSTUtilsTextQueryDialog(); - - public: // Functions from base classes - - /** - * From CAknTextQueryDialog, allows empty text - * Overwritten method - */ - IMPORT_C void UpdateLeftSoftKeyL(); - - /** - * Handle key events. - * @see CAknTextQueryDialog - * @since - */ - IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ); - - /** - * Called before dialog is closed. - * @see CAknTextQueryDialog - * @since - */ - IMPORT_C TBool OkToExitL( TInt aButtonId ); - - private: - - /** - * C++ default constructor. - * @see CAknTextQueryDialog::CAknTextQueryDialog - */ - CVIMPSTUtilsTextQueryDialog( TDes& aDataText, const TTone& aTone = ENoTone, - TBool aLeftSoftkeyAlwaysVisible = ETrue, - TBool aDomainSelectionQuery = EFalse ); - - private: // Data - - TBool iLeftSoftkeyAlwaysVisible; - - TBool iDomainSelectionQuery; - }; - -#endif // CVIMPSTUTILSTEXTQUERYDIALOG_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/inc/vimpstutilswaitnote.h --- a/uiservicetab/vimpstutils/inc/vimpstutilswaitnote.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ -/* -* Copyright (c) 2006 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: Helper class for wait notes -* -*/ - - - -#ifndef CVIMPSTUTILSWAITNOTE_H -#define CVIMPSTUTILSWAITNOTE_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS - -// CLASS DECLARATION - - -// Observer class to notice dismissing note by cancel. -class MVIMPSTUtilsWaitNoteObserver - { - public: // Interface methods - - /** - * Wait note is canceled. - */ - virtual void NoteCanceled( TInt aButtonId ) = 0; - }; - -/** - * Helper class for wait notes - * - * @lib chat.exe - * @since - */ -class CVIMPSTUtilsWaitNote : public CBase, public MProgressDialogCallback - { - public: // Constructors and destructor - - /** - * Shows waitnote and pushes the item to cleanupstack - * - * @param aText Text to be shown in note. - * @param aShowImmediately If ETrue waitnote is shown immediately - * (not after 1 sec delay) - * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not - */ - IMPORT_C static CVIMPSTUtilsWaitNote* ShowWaitNoteLC( const TDesC& aText, - TBool aShowImmediately = EFalse, - TBool aCanBeCanceledByUser = EFalse, - MVIMPSTUtilsWaitNoteObserver* aObserver = NULL ); - - /** - * Shows waitnote,does not leave anything to cleanupstack. - * - * @param aText Text to be shown in note. - * @param aShowImmediately If ETrue waitnote is shown immediately - * (not after 1 sec delay) - * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not - */ - IMPORT_C static CVIMPSTUtilsWaitNote* ShowWaitNoteL( const TDesC& aText, - TBool aShowImmediately = EFalse, - TBool aCanBeCanceledByUser = EFalse, - MVIMPSTUtilsWaitNoteObserver* aObserver = NULL ); - - - /** - * Shows waitnote and pushes the item to cleanupstack - * - * @param aTextResource Resource id of text to be shown in note. - * @param aShowImmediately If ETrue waitnote is shown immediately - * (not after 1 sec delay) - * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not - */ - IMPORT_C static CVIMPSTUtilsWaitNote* ShowWaitNoteLC( TInt aTextResource, - TBool aShowImmediately = EFalse, - TBool aCanBeCanceledByUser = EFalse, - MVIMPSTUtilsWaitNoteObserver* aObserver = NULL ); - - /** - * Shows waitnote, does not leave anything to cleanupstack. - * - * @param aTextResource Resource id of text to be shown in note. - * @param aShowImmediately If ETrue waitnote is shown immediately - * (not after 1 sec delay) - * @param aCanBeCanceledByUser Do we show wait note with cancel soft key or not - */ - IMPORT_C static CVIMPSTUtilsWaitNote* ShowWaitNoteL( TInt aTextResource, - TBool aShowImmediately = EFalse, - TBool aCanBeCanceledByUser = EFalse, - MVIMPSTUtilsWaitNoteObserver* aObserver = NULL ); - /** - * Destructor. - */ - virtual ~CVIMPSTUtilsWaitNote(); - - protected: // From MProgressDialogCallback - - /** - * From MProgressDialogCallback Get's called when a dialog is dismissed - * @param aButtonId Button that was used to dismiss the dialog - */ - IMPORT_C void DialogDismissedL( TInt aButtonId ); - - - public: // New functions - - /** - * Dismisses this waitnote - */ - IMPORT_C void DismissDialog(); - - - private: - - /** - * C++ default constructor. - */ - CVIMPSTUtilsWaitNote(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL( const TDesC& aText, - TBool aShowImmediately, - TBool aCanBeCanceledByUser, - MVIMPSTUtilsWaitNoteObserver* aObserver ); - - public: // New methods - - /** - * Set wait note observer. NULL will unset this one. - */ - IMPORT_C void SetObserver( MVIMPSTUtilsWaitNoteObserver* aObserver ); - - private: // Data - - // Doesn't own (destroys itself) - CAknWaitDialog* iWaitDialog; - - /// Wait note observer. This will be notified when wait note is dismissed. - MVIMPSTUtilsWaitNoteObserver* iObserver; - }; - -#endif // CCAWAITNOTE_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/src/cvimpstengineaimagehandler.cpp --- a/uiservicetab/vimpstutils/src/cvimpstengineaimagehandler.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,256 +0,0 @@ -/* -* Copyright (c) 2008 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: Image handler for VImpst engine handler -* -*/ - -// INCLUDE FILES -#include "cvimpstengineimagehandler.h" - -#include "uiservicetabtracer.h" -#include "tvimpstenums.h" - - -#include "vimpstallerrors.h" -#include "tvimpstconsts.h" - -#include "cvimpstimageprocessor.h" // image processor - -const TInt KOFFSETSIZE = 10000; -const TInt KSIZEMULTIPLE = 3; -const TInt KQUALITYFACTOR = 55; -// ================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::NewL -// Two-phased constructor. -// --------------------------------------------------------- -EXPORT_C CVIMPSTEngineImageHandler* CVIMPSTEngineImageHandler::NewL() - { - TRACER_AUTO; - CVIMPSTEngineImageHandler* self = - CVIMPSTEngineImageHandler::NewLC( ); - CleanupStack::Pop( self ); - - return self; - } - -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::NewLC -// Two-phased constructor. -// --------------------------------------------------------- -EXPORT_C CVIMPSTEngineImageHandler* CVIMPSTEngineImageHandler::NewLC( ) - { - TRACER_AUTO; - CVIMPSTEngineImageHandler* self = new (ELeave) - CVIMPSTEngineImageHandler(); - CleanupStack::PushL( self ); - self->ConstructL(); - - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::CVIMPSTEngineImageHandler -// --------------------------------------------------------- -CVIMPSTEngineImageHandler::CVIMPSTEngineImageHandler():iError(0) - { - - } -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::ConstructL -// --------------------------------------------------------- -void CVIMPSTEngineImageHandler::ConstructL() - { - TRACER_AUTO; - iProcessor = CVimpstImageProcessor::NewL(this); - iFormat.iSettings.iQualityFactor = KQUALITYFACTOR; - iFormat.iSettings.iSampleScheme = TMdaJpgSettings::TColorSampling(TMdaJpgSettings::EColor420); - - } -// --------------------------------------------------------- -// CVIMPSTEngineImageHandler::~CVIMPSTEngineImageHandler -// --------------------------------------------------------- -CVIMPSTEngineImageHandler::~CVIMPSTEngineImageHandler() - { - TRACER_AUTO; - delete iProcessor; - if(iToDesc) - { - delete iToDesc; - } - - } - -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::HandleProcessingCompleteL -// -// ------------------------------------------------------------------------ -void CVIMPSTEngineImageHandler::HandleProcessingCompleteL( TInt aStatus ) - { - TRACER_AUTO; - if (!aStatus) - { - iContent = iProcessor->GetContentData(); - } - - if(iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::ProcessImageFromFileL -// -// ------------------------------------------------------------------------ -EXPORT_C HBufC8* CVIMPSTEngineImageHandler::ProcessImageFromFileL(const TDesC& aFilename , - const TDesC8& aMimetype) - { - TRACER_AUTO; - if(aFilename.Length()) - { - TRACE(" called"); - iProcessor->ProcessFromFileL( aFilename , aMimetype); - if( ! iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // CActiveSchedulerWait. - iWait.Start(); - } - } - - return iContent; - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::ProcessImageFromDataL -// -// ------------------------------------------------------------------------ -EXPORT_C HBufC8* CVIMPSTEngineImageHandler::ProcessImageFromDataL( const TDesC8& aImageData , const TDesC8& aMimeType) - { - TRACER_AUTO; - if(aImageData.Length()) - { - TRACE("ProcessImageFromDataL called"); - TInt err = iProcessor->ProcessFromDataL( aImageData , aMimeType); - if(KErrNone != err) - { - iContent = KNullDesC8().AllocL(); - return iContent; - } - if( ! iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // CActiveSchedulerWait. - iWait.Start(); - } - } - - return iContent; - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::ProcessFromBitmapL -// -// ------------------------------------------------------------------------ -EXPORT_C HBufC8* CVIMPSTEngineImageHandler::ProcessFromBitmapL( CFbsBitmap& aBitMap ) - { - - TRACER_AUTO; - - //bitmap to desc - const TSize size = aBitMap.SizeInPixels(); - const TInt descSize = (size.iWidth * size.iHeight * KSIZEMULTIPLE) + KOFFSETSIZE; - iBuf = HBufC8::NewL(descSize); - TPtr8 imageBuffer(iBuf->Des()); - if(iToDesc) - { - delete iToDesc;//delete the old one - iToDesc = NULL; - } - iToDesc = CMdaImageBitmapToDescUtility::NewL(*this); - iToDesc->CreateL(imageBuffer, &iFormat, 0, 0); - if( ! iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // CActiveSchedulerWait. - iWait.Start(); - } - User::LeaveIfError(iError);//CreateL is a asynch call.leave if error in creating - iToDesc->ConvertL(aBitMap); - if( ! iWait.IsStarted() ) - { - // codescanner warning can be ignored, we are not starting an active object but - // CActiveSchedulerWait. - iWait.Start(); - } - User::LeaveIfError(iError);//CreateL is a asynch call.leave if error in creating - - - return iBuf; - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::MiuoCreateComplete -// -// ------------------------------------------------------------------------ -void CVIMPSTEngineImageHandler::MiuoCreateComplete(TInt aError) - { - TRACER_AUTO; - iError = aError; - if(iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - - - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::MiuoOpenComplete -// -// ------------------------------------------------------------------------ -void CVIMPSTEngineImageHandler::MiuoOpenComplete(TInt aError) - { - TRACER_AUTO; - iError = aError; - if(iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - - - } -// ------------------------------------------------------------------------ -// CVIMPSTEngineImageHandler::MiuoConvertComplete -// -// ------------------------------------------------------------------------ -void CVIMPSTEngineImageHandler::MiuoConvertComplete(TInt aError) - { - TRACER_AUTO; - iError = aError; - if(iWait.IsStarted() ) - { - iWait.AsyncStop(); - } - - - } -// CVIMPSTEngineImageHandler::Bitmap -// -// ------------------------------------------------------------------------ -EXPORT_C CFbsBitmap& CVIMPSTEngineImageHandler::Bitmap() - { - TRACER_AUTO; - return iProcessor->Bitmap(); - } - -// end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/src/cvimpstimageprocessor.cpp --- a/uiservicetab/vimpstutils/src/cvimpstimageprocessor.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,451 +0,0 @@ -/* -* Copyright (c) 2008 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: Image processor and scaler - * -*/ - - -#include "cvimpstimageprocessor.h" -#include "tvimpstconsts.h" -#include -#include -#include -#include -#include "uiservicetabtracer.h" -// CONSTANTS -const TInt KChatCustomBitmapWidth = 65; -const TInt KChatCustomBitmapHeight = 65; -const TInt KMaxImageSize = 1800; //2k -const TInt KMimeLength = 16; -const TInt KScaleSize = 10; - -//----------------------------------------------------------------------------- -// CCAImageLoader::CCAImageLoader -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CVimpstImageProcessor::CVimpstImageProcessor( MCAImageProcessObserver* aObserver ) -: CActive( CActive::EPriorityLow ),iObserver(aObserver),iScaleSize(KScaleSize) - { - CActiveScheduler::Add( this ); - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::CVimpstImageProcessor -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CVimpstImageProcessor::~CVimpstImageProcessor() - { - iFs.Close(); - - delete iImageDecoder; - delete iScaler; - delete iImageEncoder; - if(!isBitmapReturned) - { - delete iBitmap; - } - delete iMimeType; - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::NewL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -CVimpstImageProcessor* CVimpstImageProcessor::NewL( MCAImageProcessObserver* aObserver) - { - TRACER_AUTO; - CVimpstImageProcessor* self = - new ( ELeave ) CVimpstImageProcessor(aObserver); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::ConstructL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::ConstructL() - { - User::LeaveIfError( iFs.Connect() ); - } - - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::RunL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::RunL() - { - TRACER_AUTO; - TInt status = iStatus.Int(); - - if(!status) - { - switch(iProcessingState) - { - case EConvertImageDatatoBitmap: - { - ConvertImageToBitmapL(); - break; - } - case EScaleBitmap: - { - ScaleBitmapL(); - break; - } - case EConentFromScaledBitmap: - { - ContentFromScaledBitmapL(); - break; - } - case EProcessingComplete: - { - if( iContent->Length() > KMaxImageSize) - { - delete iScaler; - iScaler = NULL; - delete iImageEncoder; - iImageEncoder = NULL; - delete iContent; - iTargetSize.SetSize( KChatCustomBitmapWidth - iScaleSize, KChatCustomBitmapHeight - iScaleSize ); - iScaleSize += KScaleSize; - ScaleBitmapL(); - } - else - { - TRACE("RunL completed "); - CompleteRequestL(); - } - break; - } - default: - { - - } - } - - } - else - { - TRACE("RunL completed "); - CompleteRequestL(); - } - - } -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::ConvertImageToBitmapL() -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::ConvertImageToBitmapL() - { - TRACER_AUTO; - TSize origSize( iImageDecoder->FrameInfo().iOverallSizeInPixels ); - ScaleSize( origSize, iTargetSize ); - TBool fullyScaleable( iImageDecoder->FrameInfo().iFlags & TFrameInfo::EFullyScaleable ); - TSize decodeSize( DecodeSize( origSize, iTargetSize, fullyScaleable ) ); - - iBitmap = new (ELeave) CFbsBitmap(); - User::LeaveIfError( iBitmap->Create( decodeSize, - iImageDecoder->FrameInfo().iFrameDisplayMode ) ); - iImageDecoder->Convert( &iStatus, *iBitmap ); - iProcessingState = EScaleBitmap; // set state to next step - if( !IsActive() ) - { - SetActive(); - } - } -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::ScaleBitmapL() -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::ScaleBitmapL() - { - TRACER_AUTO; - TSize currentSize( iBitmap ? iBitmap->SizeInPixels() : iTargetSize ); - - if( currentSize != iTargetSize ) - { - // bitmap exists and the size is wrong, - // we have to scale the bitmap - iScaler = CBitmapScaler::NewL(); - iScaler->Scale( &iStatus, *iBitmap, iTargetSize ); - iProcessingState = EConentFromScaledBitmap; // set state to next step - if( !IsActive() ) - { - SetActive(); - } - } - else - { // get content from scaled bitmap - ContentFromScaledBitmapL(); - } - - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::ContentFromScaledBitmapL() -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::ContentFromScaledBitmapL() - { - iContent = NULL; - iImageEncoder = CImageEncoder::DataNewL( iContent,*iMimeType); - iImageEncoder->Convert( &iStatus, *iBitmap ); - iProcessingState = EProcessingComplete ; // set state to next step - if( !IsActive() ) - { - SetActive(); - } - } - - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::DoCancel -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::DoCancel() - { - ClearState(); - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::RunError -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CVimpstImageProcessor::RunError( TInt aError ) - { - if( IsActive() ) - { - iStatus = aError; - Cancel(); - } - - if( aError == KErrNoMemory ) - { - CActiveScheduler::Current()->Error( KErrNoMemory ); - } - - // Clean up and reset all pending messages - ClearState(); - TRAP_IGNORE( ResetProcessingL( aError ) ); - - return KErrNone; - } -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::StartProcessingFromDataL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TInt CVimpstImageProcessor::ProcessFromDataL( const TDesC8& aImageData , const TDesC8& aMimeType) - { - TRACER_AUTO; - TInt err = KErrNone; - if ( aMimeType.Length()) - { - // if the mimetype is passed then allocate the memory - iMimeType = aMimeType.AllocL(); - } - else - { - // if no mimetype find the mimetype - iMimeType = HBufC8::NewL( KMimeLength); - TPtr8 mimePtr = iMimeType->Des(); - TRAP(err,CImageDecoder::GetMimeTypeDataL( aImageData , mimePtr )); - if(KErrNone != err) - { - return err; - } - } - iImageDecoder = NULL; - // need to check for the mimetype length, as sometimes CImageDecoder::GetMimeTypeDataL - // is alos not able to give the mimetype - iImageDecoder = CImageDecoder::DataNewL(iFs, aImageData , *iMimeType); - iProcessingState = EConvertImageDatatoBitmap; - RunL(); - return err; - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::ProcessFromFileL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::ProcessFromFileL( const TDesC& aFileName , const TDesC8& aMimeType) - { - TRACER_AUTO; - iMimeType = aMimeType.AllocL(); - iImageDecoder = NULL; - iImageDecoder = CImageDecoder::FileNewL(iFs, aFileName, *iMimeType ); - iProcessingState = EConvertImageDatatoBitmap; - RunL(); - - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::CancelProcessing -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::CancelProcessing() - { - if( IsActive() ) - { - Cancel(); - } - } -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::RegisterObserver -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::RegisterObserver( MCAImageProcessObserver* aObserver ) - { - iObserver = aObserver; - } -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::GetContentData -// ( Other items commented in header ) -//----------------------------------------------------------------------------- - -HBufC8* CVimpstImageProcessor::GetContentData() - { - return iContent; - } -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::Bitmap -// ( Other items commented in header ) -//----------------------------------------------------------------------------- - -CFbsBitmap& CVimpstImageProcessor::Bitmap() - { - isBitmapReturned = ETrue; - return *iBitmap; - } -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::DecodeSize -// Scale to nearest (larger or equal) size with ratio 1:1, 1:2, 1:4 or 1:8 -//----------------------------------------------------------------------------- -TSize CVimpstImageProcessor::DecodeSize( const TSize& aSize, const TSize& aTargetSize, - TBool aAnyRatio ) - { - TRACER_AUTO; - if( aAnyRatio || aSize == aTargetSize ) - { - // decoder can scale to any ratio or the size is already correct - return aTargetSize; - } - - // 1:1 is always valid ratio for decode scaling - TInt lastValidRatio( 1 ); - for( TInt ratio( KDecodeScaleRatioMin ); ratio <= KDecodeScaleRatioMax; ratio <<= 1 ) - { - if( aSize.iWidth % ratio + aSize.iHeight % ratio == 0 ) - { - // this ratio is valid - if( aSize.iWidth / ratio < aTargetSize.iWidth || - aSize.iHeight / ratio < aTargetSize.iHeight ) - { - // the decoded size was smaller in some dimension, - // the last valid ratio should be used - break; - } - - // this scale ratio results to greater or equal size - lastValidRatio = ratio; - } - } - - // return the size scaled with correct ratio - return TSize( aSize.iWidth / lastValidRatio, - aSize.iHeight / lastValidRatio ); - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::ScaleSize -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -TBool CVimpstImageProcessor::ScaleSize( const TSize& aSize, TSize& aNewSize ) - { - if( Max( aSize.iHeight, aSize.iWidth ) > KChatCustomBitmapWidth ) - { - aNewSize.SetSize( KChatCustomBitmapWidth, KChatCustomBitmapHeight ); - return ETrue; - } - - // old size is correct - aNewSize = aSize; - return EFalse; - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::CompleteRequestL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::CompleteRequestL() - { - iObserver->HandleProcessingCompleteL( iStatus.Int() ); - } - - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::ResetProcessingL -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::ResetProcessingL( TInt aReason ) - { - // cancel operation - if( IsActive() ) - { - iStatus = aReason; - Cancel(); - } - } - -//----------------------------------------------------------------------------- -// CVimpstImageProcessor::ClearState -// ( Other items commented in header ) -//----------------------------------------------------------------------------- -void CVimpstImageProcessor::ClearState() - { - if( iScaler ) - { - iScaler->Cancel(); - delete iScaler; - iScaler = NULL; - } - if( iImageDecoder ) - { - iImageDecoder->Cancel(); - delete iImageDecoder; - iImageDecoder = NULL; - } - if( iImageEncoder ) - { - iImageEncoder->Cancel(); - delete iImageEncoder; - iImageEncoder = NULL; - } - if( iBitmap ) - { - delete iBitmap; - iBitmap = NULL; - } - if (iMimeType) - { - delete iMimeType; - iMimeType = NULL; - } - - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/src/vimpstutils.cpp --- a/uiservicetab/vimpstutils/src/vimpstutils.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,161 +0,0 @@ -/* -* Copyright (c) 2008 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: Utils for IMUiServiceTab modules. -* -*/ - - -// INCLUDES -#include "vimpstutils.h" -#include "StringLoader.h" -//#include "vimpstdebugprint.h" //TODO: for later use -#include -#include "uiservicetabtracer.h" - -// CONSTANTS -// TODO: For later use -// general colon needed in various places -//_LIT( KColon, ":" ); -// general slash needed in various places -//_LIT( KSlash, "/" ); -// general slash needed in various places -_LIT( KAt, "@" ); - - - -// ----------------------------------------------------------------------------- -// VIMPSTUtils::DisplayId -// ----------------------------------------------------------------------------- -// -EXPORT_C TPtrC VIMPSTUtils::DisplayId( const TDesC& aId, TBool /*aListHiding*/ ) - { - TRACER_AUTO; - TPtrC ret( aId ); - - //TODO: Modify the function body when it is required later - - - /*MCAStoredContacts* contacts = NULL; - TRAPD( err, contacts = CCAStorageManagerFactory::ContactListInterfaceL() ); - if ( err != KErrNone || !contacts ) - { - // some error, don't modify - CHAT_DP_FUNC_DP("DisplayId", "Got some error, not hiding"); - return ret; - } - - // if we've branded the feature out, don't modify anything - if ( contacts->WVHiding() ) - { - // locate ":" for userid, groupid. - // locate "/" for list id. - TInt pos = aId.F//TODO : Modify the function body when required laterindC( aListHiding ? KSlash : KColon ); - - if ( ( pos != KErrNotFound) && ( pos != aId.Length()-1) ) - { - // contains the special character, and it is not the last char - // remove everything before the special char (including the char) - ret.Set( aId.Mid( pos + 1 ) ); - } - */ - // remove also the domain part - TInt domainPos = ret.FindC( KAt ); - if ( ( domainPos != KErrNotFound ) && ( domainPos != 0 ) ) - { - ret.Set( ret.Mid( 0, domainPos ) ); - } - // } - - - return ret; - } - - -// ----------------------------------------------------------------------------- -// VIMPSTUtils::LoadResourceL -// give ownership to caller -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* VIMPSTUtils::LoadResourceL( TInt aResourceId ) - { - TRACER_AUTO; - CCoeEnv* env = CCoeEnv::Static(); - HBufC* ret = NULL; - if(env) - { - ret = env->AllocReadResourceL(aResourceId); - return ret; - } - else - { - return ret; - } - - } - -// ----------------------------------------------------------------------------- -// VIMPSTUtils::LoadResourceL -// give ownership to caller -// ----------------------------------------------------------------------------- -// -EXPORT_C HBufC* VIMPSTUtils::LoadResourceL( TInt aResourceId , const TDesC& aPrompt) - { - TRACER_AUTO; - CCoeEnv* env = CCoeEnv::Static(); - HBufC* ret = NULL; - if(env) - { - ret = StringLoader::LoadL(aResourceId,aPrompt); - return ret; - } - else - { - return ret; - } - - } - -// --------------------------------------------------------- -// VIMPSTUtils::CombineStringFromResourceLC() -// See header for details. -// --------------------------------------------------------- -// -EXPORT_C HBufC* VIMPSTUtils::CombineStringFromResourceLC( TInt aResourceId1, TInt aResourceId2 ) - { - TRACER_AUTO; - // empty texts - _LIT ( KPSUIEmptyStringHeader, "%S\n%S" ); - HBufC* emptyText = CCoeEnv::Static()->AllocReadResourceLC( - aResourceId1 ); - - HBufC* emptyText2 = CCoeEnv::Static()->AllocReadResourceLC( - aResourceId2 ); - - HBufC* emptyFinal = HBufC::NewLC( - emptyText->Length() + emptyText2->Length() + 2 );// 2 is length of "\n" - - CleanupStack::Pop(emptyFinal); - - emptyFinal->Des().Format( KPSUIEmptyStringHeader, emptyText, emptyText2 ); - - CleanupStack::PopAndDestroy( 2 );// emptyText, emptyText2 - - CleanupStack::PushL(emptyFinal); - - return emptyFinal; - - } - - -// End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/src/vimpstutilsdialog.cpp --- a/uiservicetab/vimpstutils/src/vimpstutilsdialog.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,217 +0,0 @@ -/* -* Copyright (c) 2008 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: Utils for IMUiServiceTab modules. -* -*/ - - - -// INCLUDE FILES -#include "vimpstutilsdialog.h" -#include "vimpstutilstextquerydialog.h" - -#include -#include -#include -#include - -#include "uiservicetabtracer.h" - - -// --------------------------------------------------------- -// VIMPSTUtilsDialog::DisplayNoteDialogL -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C TInt VIMPSTUtilsDialog::DisplayNoteDialogL( const TDesC& aText, - const TInt aButtonsResourceId, /*= R_AVKON_SOFTKEYS_EMPTY*/ - const CAknNoteDialog::TTimeout& aTimeout /*= CAknNoteDialog::EShortTimeout*/ ) - { - TRACER_AUTO; - // CodeScanner warning ignored because CS does not - // notice that PrepareLC puts the dialog to cleanupstack - CAknNoteDialog* dlg = new ( ELeave ) CAknNoteDialog( // CSI: 35 # See comment above - CAknNoteDialog::EConfirmationTone , aTimeout ); - - //TODO : Modify the function body when required later - - dlg->PrepareLC( R_IM_INFO_NOTE_TEMPLATE ); - dlg->SetTextL( aText ); - - CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); - cba.SetCommandSetL( aButtonsResourceId ); - - return dlg->RunLD(); - } - - -// --------------------------------------------------------- -// VIMPSTUtilsDialog::DisplayErrorNoteL -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C TInt VIMPSTUtilsDialog::DisplayErrorNoteL( const TDesC& aText, - TBool aSoftkeyOk /*= EFalse*/ ) - { - TRACER_AUTO; - //TODO : Modify the function body when required later - if( aSoftkeyOk ) - { - return VIMPSTUtilsDialog::DisplayQueryDialogL( R_IM_ERROR_NOTE_TEMPLATE_WITH_OK, aText ); - } - else - { - // CodeScanner warning ignored because CS does not - // notice that PrepareLC puts the dialog to cleanupstack - CAknNoteDialog* dlg = // CSI: 35 # See comment above - new ( ELeave ) CAknNoteDialog( CAknNoteDialog::EErrorTone , - CAknNoteDialog::ELongTimeout ); - dlg->PrepareLC( R_IM_ERROR_NOTE_TEMPLATE ); - dlg->SetTextL( aText ); - return dlg->RunLD(); - } - } - - -// --------------------------------------------------------- -// VIMPSTUtilsDialog::DisplayQueryDialogL -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C TInt VIMPSTUtilsDialog::DisplayQueryDialogL( TInt aDialogResourceId, - const TDesC& aPrompt ) - { - TRACER_AUTO; - CAknQueryDialog* dlg = new (ELeave) CAknQueryDialog( - CAknQueryDialog::ENoTone ); - if( aPrompt != KNullDesC ) - { - CleanupStack::PushL( dlg ); - dlg->SetPromptL( aPrompt ); - CleanupStack::Pop( dlg ); - } - - return dlg->ExecuteLD( aDialogResourceId ); - } - -// --------------------------------------------------------- -// VIMPSTUtilsDialog::DisplayTextQueryDialogL() -// Displays text query dialog -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C TInt VIMPSTUtilsDialog::DisplayTextQueryDialogL( - TDes& aDataText, - const TInt aTitleResourceId, - const TInt aDialogResourceId, - TBool aPredictiveInput /* = EFalse */, - TBool aLeftSoftkeyAlwaysVisible /* = EFalse */, - TLeftSoftkey /*aLeftSoftkey = EDefault */, - TInitialSelectionMode aSelectionMode /* = ESelectAll */, - TBool aDomainSelectionQuery /* = EFalse */ ) - { - TRACER_AUTO; - // CodeScanner warning ignored because CS does not - // notice that PrepareLC puts the dialog to cleanupstack - CAknTextQueryDialog* dlg = CVIMPSTUtilsTextQueryDialog::NewL( aDataText, // CSI: 35 # See comment above - CAknQueryDialog::ENoTone, - aLeftSoftkeyAlwaysVisible, - aDomainSelectionQuery ); - - dlg->PrepareLC( aDialogResourceId ); - HBufC* text = CEikonEnv::Static()->AllocReadResourceLC( aTitleResourceId ); - dlg->SetPromptL( *text ); - dlg->SetPredictiveTextInputPermitted( aPredictiveInput ); - - CleanupStack::PopAndDestroy( text ); - - // Set correct selection mode - switch ( aSelectionMode ) - { - case ESelectNone: - { - CCoeControl* ctrl = dlg->ControlOrNull( EGeneralQuery ); - if ( ctrl ) - { - CAknQueryControl* query = static_cast( ctrl ); - ctrl = query->ControlByLayoutOrNull( EDataLayout ); - if ( ctrl ) - { - CEikEdwin* edwin = static_cast( ctrl ); - edwin->AddFlagToUserFlags( CEikEdwin::ENoAutoSelection ); - } - } - break; - } - default: - { - // Use default flags in edwin - break; - } - } - return ( dlg->RunLD() ); - } - -// --------------------------------------------------------- -// VIMPSTUtilsDialog::DisplayListQueryDialogL -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C TInt VIMPSTUtilsDialog::DisplayListQueryDialogL( TInt* aSelectedIndex, - MDesCArray* aItemList, - const TInt aDialogResourceId, - const TDesC& aAlternativeTitle /*KNullDesC*/, - const TDesC& aListEmptyText /*= KNullDesC*/, - const TBool aIsForwardQuery /* EFalse */, - const TBool /*aIsOnlySelect = EFalse */ ) - - { - TRACER_AUTO; - CAknListQueryDialog* dlg = new (ELeave) CAknListQueryDialog( - aSelectedIndex ); - dlg->PrepareLC( aDialogResourceId ); - dlg->SetItemTextArray( aItemList ); - dlg->SetOwnershipType( ELbmDoesNotOwnItemArray ); - - if ( aAlternativeTitle != KNullDesC ) - { - dlg->SetHeaderTextL( aAlternativeTitle ); - } - - if ( aItemList->MdcaCount() == 0 ) - { - CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); - cba.SetCommandSetL( R_AVKON_SOFTKEYS_CANCEL ); - } - else - { - if ( aIsForwardQuery ) - { - CEikButtonGroupContainer& cba = dlg->ButtonGroupContainer(); - cba.SetCommandSetL( R_AVKON_SOFTKEYS_SELECT_CANCEL__SELECT ); - } - } - - dlg->ListBox()->SetCurrentItemIndex( *aSelectedIndex ); - - if( aListEmptyText != KNullDesC ) - { - dlg->ListBox()->View()->SetListEmptyTextL( aListEmptyText ); - } - - return ( dlg->RunLD() ); - } - - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/src/vimpstutilsnotemapper.cpp --- a/uiservicetab/vimpstutils/src/vimpstutilsnotemapper.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2008 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: Utils for IMUiServiceTab modules. -* -*/ - - -// INCLUDE FILES -#include "vimpstutilsnotemapper.h" -#include "vimpstutilsdialog.h" -#include "vimpstallerrors.h" -#include -#include -#include -#include "uiservicetabtracer.h" - - - -// --------------------------------------------------------- -// VIMPSTUtilsNoteMapper::ShowNoteL -// (other items were commented in a header). -// --------------------------------------------------------- -// -EXPORT_C void VIMPSTUtilsNoteMapper::ShowNoteL( const TInt aErrorCode, const TDesC& aAdditionalData ) - { - TRACER_AUTO; - TBool ignoreAdditionalData( EFalse ); // Some logical strings are without parameters... - TBool errorNote( ETrue ); - TBool defaultNote( EFalse ); - TInt resourceID( 0 ); - TBool confirmationNote( EFalse ); - TBool softkeyOk( EFalse ); - - switch( aErrorCode ) - { - case EVIMPSTWrongUserIdPassword:// Invalid password or userid - { - defaultNote = ETrue; - errorNote = ETrue; - resourceID = R_IM_LOGIN_PASSER_NOTE; - ignoreAdditionalData = ETrue; - break; - } - case EVIMPSTSessionExpired: - case EVIMPSTNotSupported: - { - defaultNote = ETrue; - errorNote = ETrue; - ignoreAdditionalData = ETrue; - resourceID = R_IM_ERROR_SERVICE_ERR; - break; - } - case EVIMPSTMultipleErrors: // flowthrough - default: // Unknown error -> show general note - { - defaultNote = ETrue; - errorNote = ETrue; - ignoreAdditionalData = ETrue; - resourceID = R_IM_ERROR_GEN_ERROR; - break; - } - } - - if( resourceID != 0 ) - { - if( confirmationNote ) - { - VIMPSTUtilsDialog::DisplayQueryDialogL( resourceID ); - } - else - { - HBufC* prompt = NULL; - - if( aAdditionalData == KNullDesC || defaultNote || ignoreAdditionalData ) - { - prompt = CEikonEnv::Static()->AllocReadResourceLC( resourceID ); - } - else - { - prompt = StringLoader::LoadLC( resourceID, aAdditionalData ); - } - - if( errorNote ) - { - VIMPSTUtilsDialog::DisplayErrorNoteL( *prompt, softkeyOk ); - } - else - { - VIMPSTUtilsDialog::DisplayNoteDialogL( *prompt ); - } - - CleanupStack::PopAndDestroy( prompt ); - } - } - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/src/vimpstutilstextquerydialog.cpp --- a/uiservicetab/vimpstutils/src/vimpstutilstextquerydialog.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,152 +0,0 @@ -/* -* Copyright (c) 2006 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: Text query dialog that accepts empty input -* -*/ - - - -// INCLUDE FILES -#include "vimpstutilstextquerydialog.h" -#include "uiservicetabtracer.h" - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsTextQueryDialog::CVIMPSTUtilsTextQueryDialog -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -EXPORT_C CVIMPSTUtilsTextQueryDialog::CVIMPSTUtilsTextQueryDialog( TDes& aDataText, - const TTone& aTone /*= ENoTone*/, - TBool aLeftSoftkeyAlwaysVisible /*= ETrue*/, - TBool aDomainSelectionQuery /*= EFalse*/ ) - : CAknTextQueryDialog( aDataText, aTone ), - iLeftSoftkeyAlwaysVisible( aLeftSoftkeyAlwaysVisible ), - iDomainSelectionQuery( aDomainSelectionQuery ) - { - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsTextQueryDialog::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CVIMPSTUtilsTextQueryDialog* CVIMPSTUtilsTextQueryDialog::NewL( TDes& aDataText, - const TTone& aTone /*= ENoTone*/, - TBool aLeftSoftkeyAlwaysVisible /*= ETrue*/, - TBool aDomainSelectionQuery /*= EFalse*/ ) - { - TRACER_AUTO; - CVIMPSTUtilsTextQueryDialog* self = new( ELeave ) CVIMPSTUtilsTextQueryDialog( - aDataText, aTone, - aLeftSoftkeyAlwaysVisible, - aDomainSelectionQuery ); - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// - -EXPORT_C CVIMPSTUtilsTextQueryDialog::~CVIMPSTUtilsTextQueryDialog() - { - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsTextQueryDialog::UpdateLeftSoftKeyL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTUtilsTextQueryDialog::UpdateLeftSoftKeyL() - { - TRACER_AUTO; - if ( iLeftSoftkeyAlwaysVisible ) - { - // do nothing so the left softkey is always visible - return; - } - else - { - CAknTextQueryDialog::UpdateLeftSoftKeyL(); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsTextQueryDialog::OfferKeyEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -EXPORT_C TKeyResponse CVIMPSTUtilsTextQueryDialog::OfferKeyEventL( const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - TRACER_AUTO; - TInt oldLen = 0; - CEikEdwin* edwin = NULL; - // If this is launched after domain selection query - // check editor state - if ( iDomainSelectionQuery ) - { - CCoeControl* ctrl = ControlOrNull( EGeneralQuery ); - if ( ctrl ) - { - CAknQueryControl* query = static_cast( ctrl ); - ctrl = query->ControlByLayoutOrNull( EDataLayout ); - if ( ctrl ) - { - edwin = static_cast( ctrl ); - oldLen = edwin->TextLength(); - } - } - } - - TKeyResponse response = - CAknTextQueryDialog::OfferKeyEventL( aKeyEvent, aType ); - - if ( iDomainSelectionQuery && edwin - && aKeyEvent.iCode != EKeyOK ) - { - if ( oldLen > 0 - && response == EKeyWasConsumed - && edwin->TextLength() == 0 ) - { - // User has cleared editor -> exit dialog - TryExitL( EAknSoftkeyExit ); - } - } - - return response; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsTextQueryDialog::OfferKeyEventL -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CVIMPSTUtilsTextQueryDialog::OkToExitL( TInt aButtonId ) - { - TRACER_AUTO; - if ( aButtonId == EAknSoftkeyExit && iDomainSelectionQuery ) - { - return ETrue; - } - else - { - return CAknTextQueryDialog::OkToExitL( aButtonId ); - } - } -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetab/vimpstutils/src/vimpstutilswaitnote.cpp --- a/uiservicetab/vimpstutils/src/vimpstutilswaitnote.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -/* -* Copyright (c) 2008 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: Helper class for wait notes -* -*/ - - - -// INCLUDE FILES -#include "vimpstutilswaitnote.h" - -#include -#include "uiservicetabtracer.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsWaitNote::CVIMPSTUtilsWaitNote -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTUtilsWaitNote::CVIMPSTUtilsWaitNote() - { - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsWaitNote::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTUtilsWaitNote::ConstructL( const TDesC& aText, - TBool aShowImmediately, - TBool aCanBeCanceledByUser, - MVIMPSTUtilsWaitNoteObserver* aObserver ) - { - TRACER_AUTO; - // don't give dialog pointer as a parameter because - // it gets invalid after deletion of this instance - iWaitDialog = new( ELeave )CAknWaitDialog( NULL, aShowImmediately ); - if( aCanBeCanceledByUser ) - { - iWaitDialog->PrepareLC( R_IM_WAIT_NOTE_TEMPLATE_WITH_CANCEL ); - } - else - { - iWaitDialog->PrepareLC( R_IM_WAIT_NOTE_TEMPLATE ); - } - iWaitDialog->SetTone( CAknNoteDialog::ENoTone ); - iWaitDialog->SetTextL( aText ); - iWaitDialog->SetCallback( this ); - - SetObserver( aObserver ); - iWaitDialog->RunLD(); // CSI: 50 # iWaitDialog is not owned by us - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsWaitNote::ShowWaitNoteL -// ----------------------------------------------------------------------------- -// -EXPORT_C CVIMPSTUtilsWaitNote* CVIMPSTUtilsWaitNote::ShowWaitNoteL( const TDesC& aText, - TBool aShowImmediately /*= EFalse*/, - TBool aCanBeCanceledByUser /*= EFalse*/, - MVIMPSTUtilsWaitNoteObserver* aObserver /*= NULL*/ ) - { - TRACER_AUTO; - CVIMPSTUtilsWaitNote* self = ShowWaitNoteLC(aText,aShowImmediately,aCanBeCanceledByUser,aObserver); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsWaitNote::ShowWaitNoteLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CVIMPSTUtilsWaitNote* CVIMPSTUtilsWaitNote::ShowWaitNoteLC( const TDesC& aText, - TBool aShowImmediately /*= EFalse*/, - TBool aCanBeCanceledByUser /*= EFalse*/, - MVIMPSTUtilsWaitNoteObserver* aObserver /*= NULL*/ ) - { - TRACER_AUTO; - CVIMPSTUtilsWaitNote* self = new( ELeave ) CVIMPSTUtilsWaitNote(); - CleanupStack::PushL( self ); - self->ConstructL( aText, aShowImmediately, aCanBeCanceledByUser, aObserver ); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsWaitNote::ShowWaitNoteLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CVIMPSTUtilsWaitNote* CVIMPSTUtilsWaitNote::ShowWaitNoteLC( TInt aTextResource, - TBool aShowImmediately /*= EFalse*/, - TBool aCanBeCanceledByUser /*= EFalse*/, - MVIMPSTUtilsWaitNoteObserver* aObserver /*= NULL*/ ) - { - TRACER_AUTO; - CVIMPSTUtilsWaitNote* self = new( ELeave ) CVIMPSTUtilsWaitNote(); - CleanupStack::PushL( self ); - - HBufC* text = CCoeEnv::Static()->AllocReadResourceLC( aTextResource ); - self->ConstructL( *text, aShowImmediately, aCanBeCanceledByUser, aObserver ); - CleanupStack::PopAndDestroy( text ); - - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsWaitNote::ShowWaitNoteL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CVIMPSTUtilsWaitNote* CVIMPSTUtilsWaitNote::ShowWaitNoteL( TInt aTextResource, - TBool aShowImmediately /*= EFalse*/, - TBool aCanBeCanceledByUser /*= EFalse*/, - MVIMPSTUtilsWaitNoteObserver* aObserver /*= NULL*/ ) - { - TRACER_AUTO; - CVIMPSTUtilsWaitNote* self = ShowWaitNoteLC( aTextResource, - aShowImmediately, - aCanBeCanceledByUser, - aObserver ); - - CleanupStack::Pop( self ); - return self; - } - - - - -// Destructor -CVIMPSTUtilsWaitNote::~CVIMPSTUtilsWaitNote() - { - DismissDialog(); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsWaitNote::DialogDismissedL -// Called when dialog is dismissed -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTUtilsWaitNote::DialogDismissedL( TInt aButtonId ) - { - TRACER_AUTO; - iWaitDialog = NULL; - if( iObserver ) - { - iObserver->NoteCanceled( aButtonId ); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsWaitNote::DismissDialog -// Dismisses the dialog -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTUtilsWaitNote::DismissDialog() - { - TRACER_AUTO; - if( iWaitDialog ) - { - iWaitDialog->SetCallback( NULL ); - TRAPD( err, iWaitDialog->ProcessFinishedL() ); - - if( err != KErrNone ) - { - // don't know for sure that ProcessFinishedL deletes the dialog - // in all cases, so let's delete it - delete iWaitDialog; - iWaitDialog = NULL; - CActiveScheduler::Current()->Error( err ); - } - - TRAP_IGNORE( DialogDismissedL( 0 ) ); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTUtilsWaitNote::SetObserver -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -EXPORT_C void CVIMPSTUtilsWaitNote::SetObserver( MVIMPSTUtilsWaitNoteObserver* aObserver ) - { - iObserver = aObserver; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/bwins/vimpstsettingsu.def --- a/uiservicetabsettings/bwins/vimpstsettingsu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -EXPORTS - ?NewLC@CVIMPSTSettingsStore@@SAPAVMVIMPSTSettingsStore@@XZ @ 1 NONAME ; class MVIMPSTSettingsStore * CVIMPSTSettingsStore::NewLC(void) - ?NewL@CVIMPSTSettingsStore@@SAPAVMVIMPSTSettingsStore@@XZ @ 2 NONAME ; class MVIMPSTSettingsStore * CVIMPSTSettingsStore::NewL(void) - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/eabi/vimpstsettingsu.def --- a/uiservicetabsettings/eabi/vimpstsettingsu.def Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -EXPORTS - _ZN20CVIMPSTSettingsStore4NewLEv @ 1 NONAME - _ZN20CVIMPSTSettingsStore5NewLCEv @ 2 NONAME - _ZTI15CVIMPSTSettings @ 3 NONAME ; ## - _ZTI20CVIMPSTSettingsStore @ 4 NONAME ; ## - _ZTV15CVIMPSTSettings @ 5 NONAME ; ## - _ZTV20CVIMPSTSettingsStore @ 6 NONAME ; ## - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/group/2001B288.txt Binary file uiservicetabsettings/group/2001B288.txt has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/group/bld.inf --- a/uiservicetabsettings/group/bld.inf Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2008 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: Build information file for uiservicetabsettings -* -*/ - - -#include - -PRJ_PLATFORMS - -DEFAULT - - -PRJ_EXPORTS - -../inc/cvimpstsettingsstore.h APP_LAYER_PLATFORM_EXPORT_PATH( cvimpstsettingsstore.h ) - -2001B288.txt /epoc32/data/z/private/10202be9/2001B288.txt - -// component has to export its .iby files -// exporting the vimpstsettings tab's iby files -../rom/vimpstsettings.iby CORE_APP_LAYER_IBY_EXPORT_PATH(vimpstsettings.iby) - -// ROM SIS stubs -../sis/vimpstsettingsstub.sis /epoc32/data/Z/System/Install/vimpstsettingsstub.sis - - -PRJ_MMPFILES - -vimpstsettings.mmp - - - -// End of File - - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/group/vimpstsettings.mmp --- a/uiservicetabsettings/group/vimpstsettings.mmp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2008 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: cenrep settings store -* -*/ - - -#include -#include -#include "vimpstsettingsuids.h" - -TARGET vimpstsettings.dll -TARGETTYPE dll -UID KStaticInterfaceDllUid2 KMecoSettingstoreUid3 - -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -USERINCLUDE ../inc -USERINCLUDE ../group -USERINCLUDE ../src - -SOURCEPATH ../src -SOURCE cvimpstsettingsstore.cpp -SOURCE cvimpstsettings.cpp -//CenRep -SOURCE cvimpstsettingscenrep.cpp -SOURCE rvimpstsettingsreleasearray.cpp -//Generic key-value pair implementation -SOURCE cvimpstsettingskeyvaluepairs.cpp -SOURCE cvimpstsettingskeyvaluepair.cpp -SOURCE cvimpstsettingslookupkeyvaluepair.cpp - - - -APP_LAYER_SYSTEMINCLUDE - -LIBRARY centralrepository.lib // central repository -LIBRARY euser.lib // basic things -LIBRARY estor.lib // RReadStream - -#ifdef CHAT_ENABLE_DEBUG_PRINT -LIBRARY flogger.lib -#endif - -LANG SC -// end of file - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/group/vimpstsettingsuids.h --- a/uiservicetabsettings/group/vimpstsettingsuids.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2008 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: Common UID constants for mecosettingstore. -* -*/ - -#ifndef __MECOSETTINGSTOREUIDS_H -#define __MECOSETTINGSTOREUIDS_H - -// MACROS -//Uid2:s -#define KStaticInterfaceDllUid2 0x1000008d // CSI: 8 # - - -//Uid3:s -#define KMecoSettingstoreUid3 0x2001B2EE // CSI: 8 # - - -#endif // __MECOSETTINGSTOREUIDS_H -// End of File - - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/inc/cvimpstsettings.h --- a/uiservicetabsettings/inc/cvimpstsettings.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2008 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: settings container. -* -*/ - -#ifndef __CVIMPSTSETTINGS_H -#define __CVIMPSTSETTINGS_H - -// INCLUDES -#include -#include - - -class CVIMPSTSettingsKeyValuePairs; - -/* - * - Key-value pairs. - * Key-value pair mechanism for generic Settings extensions. - * - * @since 3.0 - */ - -class CVIMPSTSettings : public CBase - { - - public: // Constructors and destructor - - /** - * Two-phased constructor. - * - * @since 3.0 - */ - static CVIMPSTSettings* NewL(); - - - /** - * Two-phased constructor. - * - * @since 3.0 - */ - static CVIMPSTSettings* NewLC(); - - - /** - * Destructor. - */ - virtual ~CVIMPSTSettings(); - - - private: // Constructors - - /** - * C++ default constructor. - */ - CVIMPSTSettings(); - - - public: //SAP extension - - /** - * Key-value pair setters. - * - * Stores arbitrary data for given keyword. - * Key-value pairs are stored to flat data structure - * in side the target SAP. Different data types - * may not share same key name. - * Keyword may not contain string "||". Also, the - * maximum length for key+value is - * NCentralRepositoryConstants::KMaxUnicodeStringLength-5 - * - * @since 3.0 - * @param aKey Keyword to use to identify the value. - * @param aValue Descriptor / integer value to store. - * @return KErrNone: Storing the key value was succesful. - * KErrGeneral: Different data type was previously - * associated with given key. Old value will remain - * KErrNoMemory: Out of memory. Old value will remain - * KErrTooBig: Key+value are too big for storing - */ - - TInt SetOpaqueDesC16( const TDesC& aKey, const TDesC16& aValue ); - - - /** - * Key-value pair getters. - * - * Gets data previously stored for given keyword. - * - * @since 3.0 - * @param aKey Keyword to identify the value. - * @param aValue Pointer descriptor / integer where the value is get. - * Pointer descriptor is put to point to requested data. - * Data is owned by the SAP container and stays valid - * untill the container object is destroyed or new - * value for key is assigned. - * @return KErrNone: Retrieving the key value was succesful. - * KErrNotFound: No value associated with given key. - * KErrGeneral: Different data type associated with key. - */ - - TInt GetOpaqueDesC16( const TDesC& aKey, TPtrC16& aValue ) const; - - - /** - * Key-value pair cleanup. - * - * Deletes previously stored key-value pair. - * - * @since 3.0 - * @param aKey Keyword to identify the key-value pair. - * @return KErrNone: Key-value pair removed. - * KErrNotFound: Key-value pair not found. - */ - TInt DeleteOpaque( const TDesC& aKey ); - - /** - * return keyvalue pairs - */ - CVIMPSTSettingsKeyValuePairs& KeyValuePairs(); - - - private: // Data - - CVIMPSTSettingsKeyValuePairs* iKeyValuePairs; ///< OWN: key value pairs - - }; - -#endif // __CVIMPSTSETTINGS_H - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/inc/cvimpstsettingscenrep.h --- a/uiservicetabsettings/inc/cvimpstsettingscenrep.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* -* Copyright (c) 2008 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: Settings Store implementation. -* -*/ - - -#ifndef __CVIMPSTSETTINGSCENREP_H -#define __CVIMPSTSETTINGSCENREP_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class CRepository; -class CVIMPSTSettings; - - -// CLASS DECLARATION - -NONSHARABLE_CLASS( CVIMPSTSettingsCenRep ): public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * - */ - static CVIMPSTSettingsCenRep* NewL( ); - static CVIMPSTSettingsCenRep* NewLC( ); - - /** - * Destructor. - */ - virtual ~CVIMPSTSettingsCenRep(); - - - public: - /** - * UpdateOldSAPL - * @param aSAPSettings the pointer to respective sap - */ - void UpdateOldSettingsL( TUint32& aServiceId, CVIMPSTSettings* aSettings ); - /** - * GetSAPL - * @param aSAPSettings the pointer to respective sap - */ - void GetSettingsL( TUint32& aServiceId, CVIMPSTSettings* aSettings ); - /** - * DoGetSAPL - * @param aSAPSettings the pointer to respective sap - */ - void DoGetSettingsL( TUint32& aServiceId, CVIMPSTSettings* aSettings ); - /** - * StartOwnTransaction - * @param aMode updates the store - */ - TBool StartOwnTransaction( TInt aMode ); - /** - * StartOwnTransaction - * returns current repository - */ - CRepository* Repository() const; - - private: //Constructors - - /** - * C++ default constructor. - */ - CVIMPSTSettingsCenRep(); - - /** - * By default Symbian 2nd phase constructor is private. - * - * @param aPriority Priority for active object based store event - * notifier. This determines priority of notifying store - * event observers. - */ - void ConstructL( ); - - - private: // Data - CRepository* iRepository; // Handle to central repository session (own) - }; - -#endif // __CVIMPSTSETTINGSCENREP_H - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/inc/cvimpstsettingskeyvaluepair.h --- a/uiservicetabsettings/inc/cvimpstsettingskeyvaluepair.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,204 +0,0 @@ -/* -* Copyright (c) 2004 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: Key - value container. -* -*/ - -#ifndef __CVIMPSTSETTINGSKEYVALUEPAIR_H -#define __CVIMPSTSETTINGSKEYVALUEPAIR_H - -// INCLUDES -#include -#include - -// CLASS DECLARATION -/** - * Key - value container. - * Can be derived to expand services. - * - * @since 3.0 - **/ -NONSHARABLE_CLASS( CVIMPSTSettingsKeyValuePair ): public CBase - { - public: // Enumerations - - /** - * Data type enumeration. - * List supported value data types. - * @since 3.0 - **/ - enum TValueType - { - EValueTypeNone = 0, - EValueTypeDesC16 - }; - - - public: // Constructors and destructor - - /** - * Non leaving two phased constructor. - * - * If object allocation fails, returns NULL. - * - * @since 3.0 - * @param aKey The key. - */ - static CVIMPSTSettingsKeyValuePair* New( const TDesC& aKey ); - /** - * Two phased constructor initializing object state - * from given flat descriptor. - * - * @since 3.0 - * @param aKeyValuePairFlat The flat representation of key-value pair - */ - - static CVIMPSTSettingsKeyValuePair* NewLC( const TDesC& aKeyValuePairFlat ); - - /** - * Destructor. - */ - virtual ~CVIMPSTSettingsKeyValuePair(); - - - protected: // Constructor - - /** - * C++ default constructor. - */ - CVIMPSTSettingsKeyValuePair(); - - - /** - * Symbian OS constructor. - * Initializes object state from given stream. - * - * @since 3.0 - * @param aStream The stream to read object state. - */ - void ConstructL( RReadStream& aStream ); - - - public: //Data access - - /** - * Key accessor. - * - * Gets the key associated with key-value object. - * Virtual to allow derived classes to expand behaviour. - * - * @since 3.0 - * @return The key. - */ - virtual const TDesC& Key() const; - - - /** - * Data setters. - * - * - * @since 3.0 - * @param aValue The value to assign for key-value object. - * @return Error code. One of following: - * KErrNone: Value assigned/updated succesfully. - * KErrGeneral: Different data type already assigned. - * KErrNoMemory: No memory to allocate the new value. - * Original value remains if assigning new value fails. - */ - TInt SetValue( const TDesC16& aValue ); - - - /** - * Data getters. - * - * - * @since 3.0 - * @param aValue The value to get. - * @return Error code. One of following: - * KErrNone: Value read succesfully. - * KErrNotFound: No value yet assigned. - * KErrGeneral: Different data type assigned. - * Given aValue isn't changed if reading fails. - */ - TInt GetValue( TPtrC16& aValue ) const; - - - /** - * Key-Value pair flat representation - * - * Creates flat representation of the key-value pair - * and pushes it in cleanup stack. - * Ownership is transferred to calling method. - * - * @since 3.0 - * @return The flat representation of key-value pair - */ - - HBufC* KeyValuePairFlatLC(); - - /** - * Checks if the data fits in the flat - * descriptor - * - * @since 3.0 - * @return ETrue if data is too big. - */ - TBool IsDataTooBig() const; - - /** - * Approximates the value pair data size - * in decimal textual representation - * - * @since 3.0 - * @return The value pair data size. - */ - TInt DataSizeDec() const; - - private: // Help functions - - /** - * Resets the value pair data. - * @since 3.0 - */ - void Reset(); - - /** - * Parses value pair data from flat descriptor. - * @param aKeyValuePairFlat flat descriptor to parse - * @since 3.0 - */ - void ParseFlatKeyValuePairL( const TDesC& aKeyValuePairFlat ); - - - private: // Data - - - HBufC16* iKey; //OWN: The key. - - TValueType iValueType; //OWN: The value type. - - union //OWN: The value. Value type is determined from iValueType. - { - TInt iInt; - HBufC8* iBuf8; - HBufC16* iBuf16; - }; - - }; - -#endif // __CVIMPSTSETTINGSKEYVALUEPAIR_H - - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/inc/cvimpstsettingskeyvaluepairs.h --- a/uiservicetabsettings/inc/cvimpstsettingskeyvaluepairs.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,143 +0,0 @@ -/* -* Copyright (c) 2008 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: Container for individual key-value pairs. -* -*/ - -#ifndef __CVIMPSTSETTINGSKEYVALUEPAIRS_H -#define __CVIMPSTSETTINGSKEYVALUEPAIRS_H - -// INCLUDES - -#include "cvimpstsettingskeyvaluepair.h" - -#include -#include - - -// FORWARD DECLARATIONS -class CVIMPSTSettingsLookupKeyValuePair; - - -// CLASS DECLARATION -/** - * Container for individual key-value pairs. - * - * @since 3.0 - **/ -NONSHARABLE_CLASS( CVIMPSTSettingsKeyValuePairs ): public CBase - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * - * @since 3.0 - */ - static CVIMPSTSettingsKeyValuePairs* NewL(); - - - /** - * Destructor. - */ - virtual ~CVIMPSTSettingsKeyValuePairs(); - - - private: // Constructors - - - /** - * C++ default constructor. - */ - CVIMPSTSettingsKeyValuePairs(); - - /** - * Symbian OS constructor. - */ - void ConstructL(); - - - public: // Key value access - - - /** - * Key-value setters. - * - * - * @since 3.0 - * @param aKey The key to use identify the value. - * @param aValue The value to assign for keyword. - * @return Error code. One of following: - * KErrNone: Value assigned/updated succesfully. - * KErrGeneral: Different data type already assigned for given key. - * KErrNoMemory: No memory to allocate the new value. - * Original value for key remains if assigning - * value fails, - * KErrTooBig: Key and value are too big for storing. Original value - * remains. - * - */ - TInt SetValueDesC16( const TDesC& aKey, const TDesC16& aValue ); - - - /** - * Key-value getters. - * - * - * @since 3.0 - * @param aKey The key to use identify the value. - * @param aValue The value to get. Given aValue isn't - * changed if reading fails, - * @return Error code. One of following: - * KErrNone: Value read succesfully. - * KErrNotFound: No value yet assigned. - * KErrGeneral: Different data type assigned for given key. - */ - TInt GetValueDesC16( const TDesC& aKey, TPtrC16& aValue ); - - - /** - * Key value remove. - * - * @since 3.0 - * @param aKey The key to remove. - * @return Error code. One of following: - * KErrNone: Key value removed succesfully. - * KErrNotFound: Key value not found. - */ - TInt DeletePair( const TDesC& aKey ); - - /** - * Return Value-pair array. - * - * @since 3.0 - * @return Array of value-pairs: - */ - RPointerArray< CVIMPSTSettingsKeyValuePair >& Pairs(); - - - private: // Data - - mutable CVIMPSTSettingsLookupKeyValuePair* iLookupKey; //OWN: Lookup pair - - RPointerArray< CVIMPSTSettingsKeyValuePair > iPairs; //OWN: Pairs - }; - -#endif // __CVIMPSTSETTINGSKEYVALUEPAIRS_H - - -// End of File - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/inc/cvimpstsettingslookupkeyvaluepair.h --- a/uiservicetabsettings/inc/cvimpstsettingslookupkeyvaluepair.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2004 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: Lookup key container. -* -*/ - -#ifndef __CVIMPSTSETTINGSLOOKUPKEYVALUEPAIR_H -#define __CVIMPSTSETTINGSLOOKUPKEYVALUEPAIR_H - -// INCLUDES -#include "cvimpstsettingskeyvaluepair.h" - - -// CLASS DECLARATION -/** - * Lookup key container. - * - * Lookup key holder to be able to do linear order - * based key-value pair lookups without memory allocation. - * - * @since 3.0 - **/ -NONSHARABLE_CLASS( CVIMPSTSettingsLookupKeyValuePair ): public CVIMPSTSettingsKeyValuePair - { - public: // Constructors and destructor - - /** - * Two phased constructor. - * - * @since 3.0 - */ - static CVIMPSTSettingsLookupKeyValuePair* NewL(); - - /** - * Destructor. - */ - virtual ~CVIMPSTSettingsLookupKeyValuePair(); - - - - private: // Constructor - - /** - * C++ default constructor. - */ - CVIMPSTSettingsLookupKeyValuePair(); - - - - public: //Data access - - /** - * Key accessor. - * - * Gets the look up key associated with - * this key-value object. Overwritten - * from base. - * - * @since 3.0 - * @return The lookup key. - */ - const TDesC& Key() const; - - - /** - * Lookup key setter. - * - * Sets the look up key associated with - * this key-value object. - * - * @since 3.0 - * @param aLookUpKey The lookup key to use. - */ - void SetLookupKey( const TDesC& aLookUpKey ); - - - /** - * Lookup key reset. - * - * Resets the look up key to empty one. - * - * @since 3.0 - */ - void ResetLookupKey(); - - - private: // Data - - TPtrC iLookupKey; //OWN: Lookup key - - }; - -#endif // __CVIMPSTSETTINGSLOOKUPKEYVALUEPAIR_H - - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/inc/cvimpstsettingsstore.h --- a/uiservicetabsettings/inc/cvimpstsettingsstore.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,213 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpst settings store definitions -* -*/ -#ifndef __CVIMPSTSETTINGSSTORE_H -#define __CVIMPSTSETTINGSSTORE_H - -#include - -/** types of settings provided in meco settings */ -enum TSettingItemName - { - ETOUDlgOff = 0x00000000, // key value to enable or disable TOU Dialog to be shown - //0-> show TOU(default),1->Disable TOU.. - EURLRegistrationOff = 0x00000001, // key value to enable or disable URL registration query - //0->URL registration on,1-> URL registration off. - EServiceSuccessfullLogin = 0x00000002, - EServiceToneFileName = 0x00000003, // key value to get the IM tone File name.complete path of the file name should be provided. example "C:\sounds\digital\imtone.wav" - EServiceURLLink = 0x00000004, // key value to get the URL link for IM based on service - EServiceAvatar = 0x00000005, // key value to get the Own Avatar for IM based on service - EServiceAvatarMimeType = 0x00000006, // key value to get the Own Avatar s 'mimetype' for IM based on service - EServiceOwnAvatarIconIndex = 0x00000007 , // key value to get the Own Icon index for avatar s - // key value to check whether the "Cancel Login" is supported or not - // if setting "value = 1" then cancel login not supported else supported. - // if cancel is supported , no need to write anything to cenrep. - // By default its taken as supported. - // if not supported then write explicitly this setting as '1' - EServiceCancelLoginNotSupported = 0x00000008, - EServiceOwnStatusMessagesOnline = 0x00000009, // storing 4 previous messages for online - EServiceOwnStatusMessagesBusy = 0x0000000A, // storing 4 previous messages for busy - EServiceOwnStatusMessagesAway = 0x0000000B, // storing 4 previous messages for away - // key value to check whether the "ChangeConnection" is supported or not - // if setting "value = 1" then ChangeConnection not supported else supported. - // if ChangeConnection is supported , no need to write anything to cenrep. - // By default its taken as supported. - // if not supported then write explicitly this setting as '1' - EServiceChangeConnectionNotSupported = 0x0000000C, - // Presence Info used to republish own presence status in case of network lost and recovered - EServicePresenceAvailablilityValue = 0x0000000D, //Presence Availablility Info - EServicePresenceSessionIdentifier = 0x0000000E, //Presence Session Identifier - EServiceCustomStatusMessage = 0x0000000F, //Presence Custom Status Message - EServiceLastUserName = 0x00000010 // set username in cenrep. - }; - - - -//CLASS DECLARATION -/** - * M-Class for meco settingstore API's - * @lib vimpstsettingsstore.lib - * @since S60 5.0 - */ -class MVIMPSTSettingsStore - { - public: //Interface - - /** - * virtual Destructor. - */ - virtual ~MVIMPSTSettingsStore() - { - } - - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aValue, variable to set/get the value - * @return TInt, used as error passing value. - */ - virtual TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemName, TInt& aValue ) const = 0; - virtual TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TInt aValue ) = 0; - - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aBuffer, variable to set/get the value - * @return TInt, used as error passing value. - */ - virtual TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf& aBuffer ) const = 0; - virtual TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC& aBuffer ) = 0; - - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aBuffer, variable to set/get the value - * @return TInt, used as error passing value. - */ - virtual TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf8& aBuffer ) const = 0; - virtual TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) = 0; - - }; - -/** - * vimpst settings API class - * - * Main class of managing vimpst settings - * - * @code example code of how to get/set a value to the setting item in cenrep - * MVIMPSTSettingsStore* settings = CVIMPSTUiSettingsStore::NewLC(); - * TInt value = 1; - * TInt err = settings->SetL(serviceId, ETOUDlgOff, value ); - * similarly for getting the value - * settings->GetL(serviceId, ETOUDlgOff, value); - * delete settings or use clean up stack to push and pop - * @lib vimpstsettingsstore.lib - * @since S60 v5.0 - */ -class CVIMPSTSettingsCenRep; -class CVIMPSTSettings; - -class CVIMPSTSettingsStore : public CBase, - public MVIMPSTSettingsStore - { - - public: // Constructors and destructor - /** - * Constructors - * Do not use MVIMPSTSettingStore object as parameter while calling PopAndDestroy - */ - IMPORT_C static MVIMPSTSettingsStore* NewLC(); - /** - * Constructors , - * No not push MVIMPSSettingStore instance on cleanupstack,maily NewL can be used for member variable - */ - IMPORT_C static MVIMPSTSettingsStore* NewL(); - - /** - * Destructors. - */ - virtual ~CVIMPSTSettingsStore(); - - private: - - /** - * Performs the 2nd phase of construction. - */ - void ConstructL(); - - private: - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aValue, variable to set/get the value - * @return TInt, used as error passing value. - */ - TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemName, TInt& aValue ) const; - TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TInt aValue ); - - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aBuffer, variable to set/get the value - * @return TInt, used as error passing value. - */ - TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf& aBuffer ) const; - TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC& aBuffer ) ; - - /** - * Peforms Get/Set operation in the cenrep - * @param aServiceId, id if the service for which settings are get/set - * @param aSettingItemName, setting item name - * @param aBuffer, variable to set/get the value - * @return TInt, used as error passing value. - */ - TInt GetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, RBuf8& aBuffer ) const; - TInt SetL(TUint32 aServiceId, TSettingItemName aSettingItemNAme, const TDesC8& aBuffer ) ; - - /** - * Peforms comparision operation of userid in the cenrep - * @param aServiceId, id off the service for which user name is to be compared with cenrep store user id's - * @param auserId, user name to be compared with cenrep store user id's - * @return TBool, if TOU is already shown to user return ETrue else EFalse - */ - TBool IsTOUShownL(TUint32 aServiceId, const TDesC& auserId) ; - - /** - * Peforms Set operation of userid in the cenrep - * @param aServiceId, id of the service for which user name is to be stored in cenrep store - * @param auserId, user name to be stored in cenrep store - * @return TBool, successful will return ETrue else EFalse - */ - TBool SetTOUShownL(TUint32 aServiceId, const TDesC& auserId ); - - private: // helper functions - - void GetSAPL( TUint32 aServiceId , CVIMPSTSettings* aSettings ); - - - private: - // owns : pointer to cen rep - CVIMPSTSettingsCenRep* iCenrepStore; - // owns : pointer to settings - CVIMPSTSettings* iSettings; - }; - -#endif /*__CVIMPSTSETTINGSSTORE_H*/ diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/inc/rvimpstsettingsreleasearray.h --- a/uiservicetabsettings/inc/rvimpstsettingsreleasearray.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2008 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: Array utility class for cleanup management in central - repository transactions. -* -*/ - - -#ifndef __RVIMPSTSETTINGSRELEASEARRAY_H -#define __RVIMPSTSETTINGSRELEASEARRAY_H - - -// INCLUDES -#include - -// CLASS DECLARATION - -/** -* Extension for RPointerArray to include -* owned object cleanup in close. -* -* @lib vimpstui.dll -* @since 3.0 -*/ -NONSHARABLE_CLASS( RVIMPSTSettingsReleaseArray ): public RPointerArray< HBufC > - { - public: // New functions - - /** - * Overwritten function to include owned object cleanup in close. - * @since 3.0 - */ - - void Close(); - }; - -#endif // __RVIMPSTSETTINGSRELEASEARRAY_H - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/inc/vimpstsettingsstorecenrepuids.h --- a/uiservicetabsettings/inc/vimpstsettingsstorecenrepuids.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpstsettings central repository Uids -* -*/ - -#ifndef __VIMPSTSETTINGSSTORECENREPUIDS_H -#define __VIMPSTSETTINGSSTORECENREPUIDS_H - -// INCLUDES -#include - -// CONSTANTS - -//These are fixed CenRep Uids for vimpstsettings, do not modify. - -const TUid KCRUidIMStore = { 0x2001B288}; -const TUint32 KFlagURLRegistrationDlgShown = 0x00000001; - -#endif // __VIMPSTSETTINGSSTORECENREPUIDS_H diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/inc/vimpstsettingsstoredefinitions.h --- a/uiservicetabsettings/inc/vimpstsettingsstoredefinitions.h Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +0,0 @@ -/* -* Copyright (c) 2008 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: Common definitions for vimpstsettings store creation. -* -*/ - - -#ifndef __VIMPSTSETTINGSSTOREDEFINITIONS_H -#define __VIMPSTSETTINGSSTOREDEFINITIONS_H - -// INCLUDES -#include - - -// Key-Value pairs -enum TKeyValuePairs - { - EKeyValuePairBase = 256 - }; - -// Masks for bitwise operations -// -//Mask for finding Key-value pairs -//bits: 111111 1111111111 1111111100000000 -const TUint32 KSAPPairsMask = 0xFFFFFF00; - -//Mask for checking SAP existence -const TUint32 KSAPExistsMask = 0xFFFFFFFF; - -//Mask for finding SAP Uids -//bits: 1111111111111111 0000000000000000 -const TUint32 KSAPUidMask = 0xFFFF0000; - -// Offsets for bitwise operations -const TUint32 KServiceIDOffset = 16; //service id offset - -// field separator for flat key-valuepair structure -_LIT( KKeyValuePairFieldSeparator, "||" ); - -// Maximum length of TInt textual representation -const TInt KTIntMaxLengthTextual = 10; - -#endif // __VIMPSTSETTINGSSTOREDEFINITIONS_H - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/rom/vimpstsettings.iby --- a/uiservicetabsettings/rom/vimpstsettings.iby Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2005-2007 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: vimpstsettings IBY file. -* -*/ - - -#ifndef __VIMPSTSETTINGS_IBY__ -#define __VIMPSTSETTINGS_IBY__ - -//vimpstsettings -data=DATAZ_\private\10202be9\2001B288.txt private\10202BE9\2001B288.txt //vimpstui store -file=ABI_DIR\BUILD_DIR\vimpstsettings.dll SHARED_LIB_DIR\vimpstsettings.dll - - -// stub SIS, provides support for SIS upgrading -data=DATAZ_\system\install\vimpstsettingsstub.sis system\install\vimpstsettingsstub.sis - -#endif //__VIMPSTSETTINGS_IBY__ - - - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/sis/createsisx.bat --- a/uiservicetabsettings/sis/createsisx.bat Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -@rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -@rem All rights reserved. -@rem This component and the accompanying materials are made available -@rem under the terms of "Eclipse Public License v1.0" -@rem which accompanies this distribution, and is available -@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". -@rem -@rem Initial Contributors: -@rem Nokia Corporation - initial contribution. -@rem -@rem Contributors: -@rem -@rem Description: -@rem - -makesis vimpstsettings.pkg -signsis vimpstsettings.sis vimpstsettings.sisx rd.cer rd-key.pem diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/sis/vimpstsettings.pkg --- a/uiservicetabsettings/sis/vimpstsettings.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -; -; 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: -; -;Language - standard language definitions -&EN - -;UID is the dll's UID -#{"UiServiceTabSettings"},(0x2001B2EE),1,0,0, TYPE=SA, RU - -;Localised Vendor name -%{"Nokia-EN"} - -;VendorID -:"Nokia" - -; Files to copy - -"\EPOC32\RELEASE\ARMV5\UREL\vimpstsettings.dll" -"!:\sys\bin\vimpstsettings.dll" - -; end of file - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/sis/vimpstsettings.sis Binary file uiservicetabsettings/sis/vimpstsettings.sis has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/sis/vimpstsettings.sisx Binary file uiservicetabsettings/sis/vimpstsettings.sisx has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/sis/vimpstsettingsstub.pkg --- a/uiservicetabsettings/sis/vimpstsettingsstub.pkg Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -; -; 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: -; -;Language -&EN - -;Header -#{"UiServiceTabSettings"}, (0x2001B2EE), 1, 0, 0, TYPE=SA - -;Localised VendorID -%{"Nokia"} - -;VendorID -:"Nokia" - -;uiservicetabsettings components - -"" -"z:\sys\bin\vimpstsettings.dll" - -; end of file diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/sis/vimpstsettingsstub.sis Binary file uiservicetabsettings/sis/vimpstsettingsstub.sis has changed diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/src/cvimpstsettings.cpp --- a/uiservicetabsettings/src/cvimpstsettings.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,119 +0,0 @@ -/* -* Copyright (c) 2008 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: settings container. -* -*/ - -// INCLUDE FILES -#include -#include -#include - -#include "cvimpstsettings.h" -#include "cvimpstsettingskeyvaluepairs.h" -#include "cvimpstsettingskeyvaluepair.h" - - - - -// ================= MEMBER FUNCTIONS ======================= -// ----------------------------------------------------------------------------- -// CVIMPSTSettings::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettings* CVIMPSTSettings::NewL() - { - CVIMPSTSettings* self = CVIMPSTSettings::NewLC(); - CleanupStack::Pop(); - return self; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettings::NewLC() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettings* CVIMPSTSettings::NewLC() - { - CVIMPSTSettings* self = new (ELeave) CVIMPSTSettings(); - CleanupStack::PushL( self ); - self->iKeyValuePairs = CVIMPSTSettingsKeyValuePairs::NewL(); - return self; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettings::~CVIMPSTSettings() -// Destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTSettings::~CVIMPSTSettings() - { - delete iKeyValuePairs; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettings::CVIMPSTSettings() -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettings::CVIMPSTSettings() - { - } -// ----------------------------------------------------------------------------- -// CVIMPSTSettings::SetOpaqueDesC16() -// Key-value pairs. -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTSettings::SetOpaqueDesC16( const TDesC& aKey, - const TDesC16& aValue ) - { - TInt err = iKeyValuePairs->SetValueDesC16( aKey, aValue ); - return err; - } -// ----------------------------------------------------------------------------- -// CVIMPSTSettings::GetOpaqueDesC16() -// Key-value pairs. -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTSettings::GetOpaqueDesC16( const TDesC& aKey, - TPtrC16& aValue ) const - { - return iKeyValuePairs->GetValueDesC16( aKey, aValue ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettings::DeleteOpaque() -// Key-value pairs. -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTSettings::DeleteOpaque( const TDesC& aKey ) - { - return iKeyValuePairs->DeletePair( aKey ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettings::KeyValuePairs() -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsKeyValuePairs& CVIMPSTSettings::KeyValuePairs() - { - return *iKeyValuePairs; - } -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/src/cvimpstsettingscenrep.cpp --- a/uiservicetabsettings/src/cvimpstsettingscenrep.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* Copyright (c) 2008 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: vimpstsettings store implementation. -* -*/ - - -// INCLUDE FILES - -#include -#include - -#include "cvimpstsettingscenrep.h" -#include "cvimpstsettings.h" -#include "cvimpstsettingskeyvaluepair.h" -#include "cvimpstsettingskeyvaluepairs.h" -#include "vimpstsettingsstorecenrepuids.h" -#include "vimpstsettingsstoredefinitions.h" -#include "rvimpstsettingsreleasearray.h" - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::CVIMPSTUiSAPCenRep -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsCenRep::CVIMPSTSettingsCenRep() - { - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CVIMPSTSettingsCenRep::ConstructL( ) - { - iRepository = CRepository::NewL( KCRUidIMStore ); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsCenRep* CVIMPSTSettingsCenRep::NewL( ) - { - CVIMPSTSettingsCenRep* self = CVIMPSTSettingsCenRep::NewLC( ); - CleanupStack::Pop(); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::NewLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsCenRep* CVIMPSTSettingsCenRep::NewLC( ) - { - CVIMPSTSettingsCenRep* self = new( ELeave ) CVIMPSTSettingsCenRep(); - CleanupStack::PushL( self ); - self->ConstructL(); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::~CVIMPSTSettingsCenRep -// Destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsCenRep::~CVIMPSTSettingsCenRep() - { - delete iRepository; - } - - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::StoreNewSAPL() -// Stores new SAP in central repository -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -void CVIMPSTSettingsCenRep::UpdateOldSettingsL( TUint32& aServiceId, CVIMPSTSettings* aSettings ) - { - - // no documentation for StartTransaction() return values, leave if any error - User::LeaveIfError( iRepository->StartTransaction( CRepository::EReadWriteTransaction ) ); - - iRepository->CleanupCancelTransactionPushL(); - - const RPointerArray< CVIMPSTSettingsKeyValuePair >& pairs( aSettings->KeyValuePairs().Pairs() ); - - - //First delete old key-value pairs - RArray foundPairs; - CleanupClosePushL( foundPairs ); - iRepository->FindL( EKeyValuePairBase + aServiceId, KSAPPairsMask, foundPairs ); - TInt oldCount( foundPairs.Count() ); - for( TInt i( 0 ); i < oldCount; ++i ) - { - User::LeaveIfError( iRepository->Delete( foundPairs[i] ) ); - } - - TInt count( pairs.Count() ); - RVIMPSTSettingsReleaseArray tempArray; - CleanupClosePushL( tempArray ); - for( TInt i( 0 );i < count; ++i ) - { - //HBufC ownership transfers here - HBufC* valuePairFlat = pairs[i]->KeyValuePairFlatLC(); - User::LeaveIfError( iRepository->Create( EKeyValuePairBase + i + aServiceId, - *valuePairFlat ) ); - // CRepository->Create() is not copying the pointed data during transaction - // so these must be stored until the transaction has completed - tempArray.AppendL( valuePairFlat ); - CleanupStack::Pop( valuePairFlat ); - } - - TUint32 err( KErrNone ); - //passed err will be silently consumed because the value is of no use to client - User::LeaveIfError( iRepository->CommitTransaction( err ) ); - CleanupStack::PopAndDestroy( 3 ); //temparray, foundpairs, transaction - - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::GetSAPL() -// Gets SAP from central repository -// (other items were commented in a header). -// ----------------------------------------------------------------------------- - -void CVIMPSTSettingsCenRep::GetSettingsL( TUint32& aServiceId, CVIMPSTSettings* aSettings ) - { - TRAPD( err, DoGetSettingsL( aServiceId, aSettings ) ); - if( err ) - { - User::Leave( err ); - } - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::DoGetSAPL() -// Does the actual get operation -// (other items were commented in a header). -// ----------------------------------------------------------------------------- - -void CVIMPSTSettingsCenRep::DoGetSettingsL( TUint32& aServiceId, CVIMPSTSettings* aSettings ) - { - TBool transaction( StartOwnTransaction( CRepository::EReadTransaction ) ); - if( transaction ) - { - iRepository->CleanupCancelTransactionPushL(); - } - - HBufC* tmpBuffer = HBufC::NewLC( NCentralRepositoryConstants::KMaxUnicodeStringLength ); - TPtr tmpPtr( tmpBuffer->Des() ); - - RPointerArray< CVIMPSTSettingsKeyValuePair >& pairs( aSettings->KeyValuePairs().Pairs() ); - pairs.ResetAndDestroy(); - - RArray foundPairs; - CleanupClosePushL( foundPairs ); - iRepository->FindL( EKeyValuePairBase + aServiceId, KSAPPairsMask, foundPairs ); - TInt count( foundPairs.Count() ); - - for( TInt i( 0 );i < count; ++i ) - { - TPtr valuePairFlatPtr( tmpBuffer->Des() ); - - User::LeaveIfError( - iRepository->Get( foundPairs[ i ], - valuePairFlatPtr ) ); - - // parse the key-value pair descriptor - - CVIMPSTSettingsKeyValuePair* pair = CVIMPSTSettingsKeyValuePair::NewLC( valuePairFlatPtr ); - - pairs.AppendL( pair ); - - CleanupStack::Pop( pair ); - } - - if( transaction ) - { - TUint32 err( KErrNone ); - User::LeaveIfError( iRepository->CommitTransaction( err ) ); - CleanupStack::PopAndDestroy(); // transaction - } - CleanupStack::PopAndDestroy( 2 ); // foundPairs, tmpBuffer - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::StartOwnTransaction() -// Starts new transaction if there is no ongoing transaction -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTSettingsCenRep::StartOwnTransaction( TInt aMode ) - { - /*currently the API TransactionState() has been removed from 9.2 - * the API TransactionState was added for the synchronization purpose - * from meco point of view, as of now we are no where, same key value is not updated across processes or exe's - * this can be considered as a temporary fix and more analysis has to done on this - * to provide a complete fix. - */ - //TInt transaction( iRepository->TransactionState() ); - - // if( !transaction ) - // { - iRepository->StartTransaction( static_cast( aMode ) ); - return ETrue; - // } - //return EFalse; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsCenRep::Repository() -// Starts new transaction if there is no ongoing transaction -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -// -CRepository* CVIMPSTSettingsCenRep::Repository( )const - { - return iRepository; - } - -// End of File diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/src/cvimpstsettingskeyvaluepair.cpp --- a/uiservicetabsettings/src/cvimpstsettingskeyvaluepair.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,363 +0,0 @@ -/* -* Copyright (c) 2004 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: Key - value container. -* -*/ - -// INCLUDE FILES -#include // for unicode character conversions -#include -#include -#include "cvimpstsettingskeyvaluepair.h" -#include "vimpstsettingsstoredefinitions.h" -#include "vimpstsettingsstorecenrepuids.h" -//MACROS - -//Helper macro to check value type in data set -#define REQUIRE_SET_VALUE_TYPE( aType ) \ - { \ - TBool _settable = ( iValueType == EValueTypeNone ) || \ - ( iValueType == aType ); \ - if( !_settable )\ - {\ - return KErrGeneral;\ - }\ - } \ - -//Helper macro to check value type in data get -#define REQUIRE_GET_VALUE_TYPE( aType ) \ - { \ - if( iValueType == EValueTypeNone ) \ - { \ - return KErrNotFound; \ - } \ - TBool _readable = ( iValueType == aType ); \ - if( !_readable ) \ - { \ - return KErrGeneral; \ - } \ - } \ - - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::New() -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsKeyValuePair* CVIMPSTSettingsKeyValuePair::New( const TDesC16& aKey ) - { - //Non leaving two phased constructor!!! - - CVIMPSTSettingsKeyValuePair* self = new CVIMPSTSettingsKeyValuePair; // CSI: 62 # - if( self ) - { - self->iKey = aKey.Alloc(); - if( !self->iKey ) - { - delete self; - self = NULL; - } - } - - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::NewLC() -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsKeyValuePair* CVIMPSTSettingsKeyValuePair::NewLC( const TDesC& aKeyValuePairFlat ) - { - CVIMPSTSettingsKeyValuePair* self = new (ELeave) CVIMPSTSettingsKeyValuePair; - CleanupStack::PushL( self ); - self->ParseFlatKeyValuePairL( aKeyValuePairFlat ); - return self; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::~CVIMPSTSettingsKeyValuePair() -// Destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsKeyValuePair::~CVIMPSTSettingsKeyValuePair() - { - Reset(); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::CVIMPSTSettingsKeyValuePair() -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsKeyValuePair::CVIMPSTSettingsKeyValuePair() - : iValueType( EValueTypeNone ) - { - } - - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::ConstructL() -// ----------------------------------------------------------------------------- -// -void CVIMPSTSettingsKeyValuePair::ConstructL( RReadStream& aStream ) - { - - //Default data - TInt keyLength = aStream.ReadInt32L(); - iKey = HBufC::NewL( keyLength ); - TPtr keyPtr( iKey->Des() ); - aStream.ReadL( keyPtr, keyLength ); - - iValueType = static_cast< TValueType > ( aStream.ReadInt8L() ); - switch( iValueType ) - { - case EValueTypeDesC16: - { - TInt descLength = aStream.ReadInt32L(); - iBuf16 = HBufC16::NewL( descLength ); - TPtr16 descPtr16( iBuf16->Des() ); - aStream.ReadL( descPtr16, descLength ); - break; - } - - //FLOW THROUGH - case EValueTypeNone: - default: - { - break; - } - }; - } - - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::Reset() -// ----------------------------------------------------------------------------- -// -void CVIMPSTSettingsKeyValuePair::Reset() - { - switch( iValueType ) - { - case EValueTypeDesC16: - { - delete iBuf16; - iBuf16 = NULL; - break; - } - - //FLOW THROUGH - case EValueTypeNone: - default: - { - break; - } - }; - - iValueType = EValueTypeNone; - - delete iKey; - iKey = NULL; - } - - - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSAPKeyValuePair::Key() -// ----------------------------------------------------------------------------- -// -const TDesC& CVIMPSTSettingsKeyValuePair::Key() const - { - return *iKey; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::SetValue() -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTSettingsKeyValuePair::SetValue( const TDesC16& aValue ) - { - REQUIRE_SET_VALUE_TYPE( EValueTypeDesC16 ) - - // Allocate memory for the new value - HBufC16* tmp = aValue.Alloc(); - if( !tmp ) - { - return KErrNoMemory; - } - - // Swap pointers - HBufC16* tmp2( NULL ); - tmp2 = iBuf16; - iBuf16 = tmp; - iValueType = EValueTypeDesC16; - - TBool dataTooBig( IsDataTooBig() ); - TInt err( KErrNone ); - - // Rollback if data too bog - if( dataTooBig ) - { - iBuf16 = tmp2; - delete tmp; - err = KErrTooBig; - } - // Otherwise delete the old value - else - { - delete tmp2; - } - return err; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::GetValue() -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTSettingsKeyValuePair::GetValue( TPtrC16& aValue ) const - { - REQUIRE_GET_VALUE_TYPE( EValueTypeDesC16 ) - - aValue.Set( *iBuf16 ); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::KeyValuePairFlatLC() -// ----------------------------------------------------------------------------- -// - -HBufC* CVIMPSTSettingsKeyValuePair::KeyValuePairFlatLC() - { - - // reserve memory for 2 field separators - HBufC* flatBuf = HBufC::NewLC( NCentralRepositoryConstants::KMaxUnicodeStringLength ); - - TPtr flatBufPtr( flatBuf->Des() ); - - flatBufPtr.Append( *iKey ); - flatBufPtr.Append( KKeyValuePairFieldSeparator ); - flatBufPtr.AppendNum( iValueType, EDecimal ); - flatBufPtr.Append( KKeyValuePairFieldSeparator ); - - switch( iValueType ) - { - case EValueTypeDesC16: - { - flatBufPtr.Append( *iBuf16 ); - break; - } - - //FLOW THROUGH - case EValueTypeNone: - default: - { - break; - } - }; - return flatBuf; - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::IsDataTooBig() -// ----------------------------------------------------------------------------- -// -TBool CVIMPSTSettingsKeyValuePair::IsDataTooBig() const - { - return ( DataSizeDec() > ( NCentralRepositoryConstants::KMaxUnicodeStringLength - - 2*KKeyValuePairFieldSeparator().Length() - 1) ); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::DataSizeDec() -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTSettingsKeyValuePair::DataSizeDec() const - { - TInt dataSize( iKey->Length() ); - - switch( iValueType ) - { - case EValueTypeDesC16: - { - dataSize += iBuf16->Length(); - break; - } - - //FLOW THROUGH - case EValueTypeNone: - default: - { - break; - } - }; - - return dataSize; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePair::ParseFlatKeyValuePairL() -// ----------------------------------------------------------------------------- -// - -void CVIMPSTSettingsKeyValuePair::ParseFlatKeyValuePairL( const TDesC& aKeyValuePairFlat ) - { - TInt offset( aKeyValuePairFlat.Find( KKeyValuePairFieldSeparator ) ); - TInt offset2( aKeyValuePairFlat.Mid( offset + - KKeyValuePairFieldSeparator().Length() ).Find( - KKeyValuePairFieldSeparator ) - ); - - if( ( offset == KErrNotFound ) || ( offset2 == KErrNotFound ) ) - { - //Incorrect format, leave - User::Leave( KErrNotFound ); - } - - TPtrC key( aKeyValuePairFlat.Left( offset ) ); - - iKey = key.AllocL(); - - TPtrC valueType( aKeyValuePairFlat.Mid( offset + - KKeyValuePairFieldSeparator().Length(), offset2 ) ); - TLex lexer( valueType ); - TInt valueTypeInt( 0 ); - User::LeaveIfError( lexer.Val( valueTypeInt ) ); - TPtrC value( aKeyValuePairFlat.Mid(offset + offset2 + - 2*KKeyValuePairFieldSeparator().Length() ) ); // skip 2 separators - switch( valueTypeInt ) - { - case EValueTypeDesC16: - { - User::LeaveIfError( SetValue( value ) ); - break; - } - - //FLOW THROUGH - case EValueTypeNone: - default: - { - break; - } - } - } -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/src/cvimpstsettingskeyvaluepairs.cpp --- a/uiservicetabsettings/src/cvimpstsettingskeyvaluepairs.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* Copyright (c) 2008 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: Container for individual key-value pairs -* -*/ - -// INCLUDE FILES -#include "cvimpstsettingskeyvaluepairs.h" -#include "cvimpstsettingskeyvaluepair.h" -#include "cvimpstsettingslookupkeyvaluepair.h" - -#include - -//CONSTANTS -const TInt KKeyValuePairGranurality = 5; - - -// LOCAL CONSTANTS AND MACROS -#define KEYWORD_ORDER TLinearOrder< CVIMPSTSettingsKeyValuePair > ( CompareKeys ) - - -// ============================ LOCAL FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CompareKeys() -// Comparison function for TLinearOrder -// -// @param aLhs The left hand side in comparison. -// @param aRhs The right hand side in comparison. -// @return Result from compare -// ----------------------------------------------------------------------------- -// -TInt CompareKeys( const CVIMPSTSettingsKeyValuePair& aLhs, const CVIMPSTSettingsKeyValuePair& aRhs ) - { - return aLhs.Key().Compare( aRhs.Key() ); - } - -// ----------------------------------------------------------------------------- -// SetValueToPairs() -// Templated algorithm to set or update new value to list of key values. -// -// @param aPairs The list of key-value pairs. -// @param aLookupKey The lookup key to use in searching. -// @param aKey The key for which to assign the value. -// @param aValue Templated data type to assign to key. -// @return Error code. -// ----------------------------------------------------------------------------- -// -template< typename T > -TInt SetValueToPairs( RPointerArray< CVIMPSTSettingsKeyValuePair >& aPairs, - CVIMPSTSettingsLookupKeyValuePair& aLookupKey, - const TDesC& aKey, - const T& aValue ) - { - aLookupKey.SetLookupKey( aKey ); - - - TInt err = KErrNone; - TInt index = aPairs.FindInOrder( &aLookupKey, KEYWORD_ORDER ); - - if( index != KErrNotFound ) - { - //Update existing - err = aPairs[ index ]->SetValue( aValue ); - } - - else - { - //create new - CVIMPSTSettingsKeyValuePair* newPair = CVIMPSTSettingsKeyValuePair::New( aKey ); - if( !newPair ) - { - err = KErrNoMemory; - } - else - { - //Insert new - - err = newPair->SetValue( aValue ); - if( err == KErrNone ) - { - err = aPairs.InsertInOrderAllowRepeats( newPair, KEYWORD_ORDER ); - } - - if( err != KErrNone ) - { - delete newPair; - } - - } - } - aLookupKey.ResetLookupKey(); - return err; - } - - - - -// ----------------------------------------------------------------------------- -// GetValueFromPairs() -// -// Templated algorithm to get value from list of key values. -// -// @param aPairs The list of key-value pairs. -// @param aLookupKey The lookup key to use in searching. -// @param aKey The key for which to get the value. -// @param aValue Templated data type to get. -// @return Error code. -// ----------------------------------------------------------------------------- -// -template< typename T > -TInt GetValueFromPairs( const RPointerArray< CVIMPSTSettingsKeyValuePair >& aPairs, - CVIMPSTSettingsLookupKeyValuePair& aLookupKey, - const TDesC& aKey, - T& aValue ) - { - aLookupKey.SetLookupKey( aKey ); - - - TInt index = aPairs.FindInOrder( &aLookupKey, KEYWORD_ORDER ); - if( index != KErrNotFound ) - { - index = aPairs[ index ]->GetValue( aValue ); - } - - - aLookupKey.ResetLookupKey(); - return index; - } - -// ================= MEMBER FUNCTIONS ======================= - -// ----------------------------------------------------------------------------- -// CVIMPSTUiSAPKeyValuePairs::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsKeyValuePairs* CVIMPSTSettingsKeyValuePairs::NewL() - { - CVIMPSTSettingsKeyValuePairs* self = new (ELeave) CVIMPSTSettingsKeyValuePairs; - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(); //self - return self; - } - - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePairs::~CVIMPSTSettingsKeyValuePairs() -// Destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsKeyValuePairs::~CVIMPSTSettingsKeyValuePairs() - { - iPairs.ResetAndDestroy(); - delete iLookupKey; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePairs::CVIMPSTSettingsKeyValuePairs() -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsKeyValuePairs::CVIMPSTSettingsKeyValuePairs() - : iPairs( KKeyValuePairGranurality ) - { - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePairs::ConstructL) -// ----------------------------------------------------------------------------- -// -void CVIMPSTSettingsKeyValuePairs::ConstructL() - { - iLookupKey = CVIMPSTSettingsLookupKeyValuePair::NewL(); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePairs::SetValueDesC16() -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTSettingsKeyValuePairs::SetValueDesC16( const TDesC& aKey, const TDesC16& aValue ) - { - return SetValueToPairs( iPairs, *iLookupKey, aKey, aValue ); - } - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePairs::GetValueDesC16() -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTSettingsKeyValuePairs::GetValueDesC16( const TDesC& aKey, TPtrC16& aValue ) - { - return GetValueFromPairs( iPairs, *iLookupKey, aKey, aValue ); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePairs::DeletePair() -// ----------------------------------------------------------------------------- -// -TInt CVIMPSTSettingsKeyValuePairs::DeletePair( const TDesC& aKey ) - { - iLookupKey->SetLookupKey( aKey ); - - TInt index = iPairs.FindInOrder( iLookupKey, KEYWORD_ORDER ); - if( index != KErrNotFound ) - { - delete iPairs[ index ]; - iPairs.Remove( index ); - index = KErrNone; - } - - iLookupKey->ResetLookupKey(); - - return index; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsKeyValuePairs::Pairs() -// ----------------------------------------------------------------------------- -// -RPointerArray< CVIMPSTSettingsKeyValuePair >& CVIMPSTSettingsKeyValuePairs::Pairs() - { - return iPairs; - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/src/cvimpstsettingslookupkeyvaluepair.cpp --- a/uiservicetabsettings/src/cvimpstsettingslookupkeyvaluepair.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2004 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: Lookup key container. -* -*/ - -// INCLUDE FILES -#include "e32std.h" -#include "cvimpstsettingslookupkeyvaluepair.h" - - - -// ================= MEMBER FUNCTIONS ======================= - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsLookupKeyValuePair::NewL() -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsLookupKeyValuePair* CVIMPSTSettingsLookupKeyValuePair::NewL() - { - CVIMPSTSettingsLookupKeyValuePair* self = new (ELeave) CVIMPSTSettingsLookupKeyValuePair; - return self; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsLookupKeyValuePair::~CVIMPSTSettingsLookupKeyValuePair() -// Destructor -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsLookupKeyValuePair::~CVIMPSTSettingsLookupKeyValuePair() - { - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsLookupKeyValuePair::CVIMPSTSettingsLookupKeyValuePair() -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CVIMPSTSettingsLookupKeyValuePair::CVIMPSTSettingsLookupKeyValuePair() - { - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsLookupKeyValuePair::Key() const -// ----------------------------------------------------------------------------- -// -const TDesC& CVIMPSTSettingsLookupKeyValuePair::Key() const - { - return iLookupKey; - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsLookupKeyValuePair::SetLookupKey() -// ----------------------------------------------------------------------------- -// -void CVIMPSTSettingsLookupKeyValuePair::SetLookupKey( const TDesC& aLookUpKey ) - { - iLookupKey.Set( aLookUpKey ); - } - - -// ----------------------------------------------------------------------------- -// CVIMPSTSettingsLookupKeyValuePair::ResetLookupKey() -// ----------------------------------------------------------------------------- -// -void CVIMPSTSettingsLookupKeyValuePair::ResetLookupKey() - { - iLookupKey.Set( NULL, 0 ); - } - -// End of File - diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/src/cvimpstsettingsstore.cpp --- a/uiservicetabsettings/src/cvimpstsettingsstore.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,195 +0,0 @@ -/* -* Copyright (c) 2005 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: implimentation class for the settings store -* -* -*/ - -// INCLUDES -#include -#include "cvimpstsettingsstore.h" -#include "cvimpstsettingscenrep.h" -#include "cvimpstsettings.h" -#include - -//dummy serviceId, assuming the service id not more than 256. for the first time -//and it is assumed that this service id is for initializing the cenrep keys only. -//not updated in the service table and hence will not get a TAB in phone book -const TInt KServiceIDOffset = 16; - -//================= MEMBER FUNCTIONS ======================= -// --------------------------------------------------------- -// CVIMPSTSettingsStore::NewLC -// -// --------------------------------------------------------- -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewLC() - { - CVIMPSTSettingsStore* self = new (ELeave) CVIMPSTSettingsStore( ); - CleanupStack::PushL( self ); - self->ConstructL( ); - return self; - } - - -// --------------------------------------------------------- -// CVIMPSTSettingsStore::NewL -// -// --------------------------------------------------------- -EXPORT_C MVIMPSTSettingsStore* CVIMPSTSettingsStore::NewL() - { - MVIMPSTSettingsStore* self = CVIMPSTSettingsStore::NewLC(); - CleanupStack::Pop( );//self - return self; - } - -// --------------------------------------------------------- -// CVIMPSTSettingsStore::Destructor -// -// --------------------------------------------------------- -CVIMPSTSettingsStore::~CVIMPSTSettingsStore() - { - if(iCenrepStore) - { - delete iCenrepStore; - iCenrepStore = NULL; - } - if(iSettings) - { - delete iSettings; - iSettings = NULL; - } - } - -// --------------------------------------------------------- -// CVIMPSTSettingsStore::ConstructL -// -// --------------------------------------------------------- - - void CVIMPSTSettingsStore::ConstructL( ) - { - iCenrepStore = CVIMPSTSettingsCenRep::NewL(); - // Get settings from vimpstsettings store to work with - iSettings = CVIMPSTSettings::NewL(); - } - - -// --------------------------------------------------------- -// CVIMPSTSettingsStore::Get -// -// --------------------------------------------------------- -TInt CVIMPSTSettingsStore::GetL(TUint32 aServiceId, TSettingItemName aSettingItemName, TInt& aValue ) const - { - TInt maskedId = aServiceId << KServiceIDOffset ; - TInt retError = iCenrepStore->Repository()->Get( maskedId + aSettingItemName, aValue ); - if( retError == KErrNotFound) - { - //if key not found, create a new key with the defualt value 0 - aValue = 0; - retError = iCenrepStore->Repository()->Create( maskedId + aSettingItemName, aValue ) ; - } - return retError; // return the value : error code - } - -// --------------------------------------------------------- -// CVIMPSTSettingsStore::Set -// -// --------------------------------------------------------- -TInt CVIMPSTSettingsStore::SetL(TUint32 aServiceId, TSettingItemName aSettingItemName, const TInt aValue ) - { - TInt maskedId = aServiceId << KServiceIDOffset ; - TInt retError = iCenrepStore->Repository()->Set( maskedId + aSettingItemName, aValue ); - if( retError == KErrNotFound ) - { - retError = iCenrepStore->Repository()->Create( maskedId + aSettingItemName, aValue ); - } - return retError; // return the value : error code - } - -// --------------------------------------------------------- -// CVIMPSTSettingsStore::Get -// -// --------------------------------------------------------- - -TInt CVIMPSTSettingsStore::GetL(TUint32 aServiceId, TSettingItemName aSettingItemName, RBuf& aBuffer ) const - { - TInt maskedId = aServiceId << KServiceIDOffset ; - TInt retError = iCenrepStore->Repository()->Get( maskedId + aSettingItemName, aBuffer ); - if( retError == KErrNotFound) - { - aBuffer = _L(" "); - retError = iCenrepStore->Repository()->Create( maskedId + aSettingItemName, aBuffer ) ; - } - return retError; // return the value : error code - } - -// --------------------------------------------------------- -// CVIMPSTSettingsStore::Set -// -// --------------------------------------------------------- - -TInt CVIMPSTSettingsStore::SetL(TUint32 aServiceId, TSettingItemName aSettingItemName, const TDesC& aBuffer ) - { - TInt maskedId = aServiceId << KServiceIDOffset ; - TInt retError = iCenrepStore->Repository()->Set( maskedId + aSettingItemName, aBuffer ); - if( retError == KErrNotFound) - { - retError = iCenrepStore->Repository()->Create( maskedId + aSettingItemName, aBuffer ); - } - return retError; // return the value : error code - } - -// ----------------------------------------------------------------------------------------------------------- -// CVIMPSTSettingsStore::GetL -// -// ------------------------------------------------------------------------------------------------------------ - -TInt CVIMPSTSettingsStore::GetL(TUint32 aServiceId, TSettingItemName aSettingItemName, RBuf8& aBuffer ) const - { - TInt maskedId = aServiceId << KServiceIDOffset ; - TInt retError = iCenrepStore->Repository()->Get( maskedId + aSettingItemName, aBuffer ); - if( retError == KErrNotFound) - { - // if not found set return value to null descriptor and create in the cenrep - aBuffer = _L8(""); - retError = iCenrepStore->Repository()->Create( maskedId + aSettingItemName, aBuffer ) ; - } - return retError; // return the value : error code - } - -// -------------------------------------------------------------------------------------------------- -// CVIMPSTSettingsStore::SetL -// -// --------------------------------------------------------------------------------------------------- - -TInt CVIMPSTSettingsStore::SetL(TUint32 aServiceId, TSettingItemName aSettingItemName, const TDesC8& aBuffer ) - { - TInt maskedId = aServiceId << KServiceIDOffset ; - TInt retError = iCenrepStore->Repository()->Set( maskedId + aSettingItemName, aBuffer ); - if( retError == KErrNotFound) - { // if not found create - retError = iCenrepStore->Repository()->Create( maskedId + aSettingItemName, aBuffer ); - } - return retError; // return the value : Error code - } - -// --------------------------------------------------------------------------------------------------- -// CVIMPSTSettingsStore::GetSAPL -// -// ---------------------------------------------------------------------------------------------------- -void CVIMPSTSettingsStore::GetSAPL( TUint32 aServiceId, CVIMPSTSettings* aSettings ) - { - iCenrepStore->GetSettingsL( aServiceId, aSettings ); - } - -//End of file diff -r 2b7283837edb -r 3104fc151679 uiservicetabsettings/src/rvimpstsettingsreleasearray.cpp --- a/uiservicetabsettings/src/rvimpstsettingsreleasearray.cpp Thu Aug 19 09:41:53 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ -/* -* Copyright (c) 2005 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: Array utility class for cleanup management in central - repository transactions. -* -*/ - - -// INCLUDES -#include -#include "rvimpstsettingsreleasearray.h" - - -// ================= MEMBER FUNCTIONS ======================= -// ----------------------------------------------------------------------------- -// RVIMPSTSettingsReleaseArray::Close() -// Destroys all items stored in array and closes it -// ----------------------------------------------------------------------------- -// - -void RVIMPSTSettingsReleaseArray::Close() - { - ResetAndDestroy(); - RPointerArray::Close(); - } -