# HG changeset patch # User hgs # Date 1281086701 -28800 # Node ID 2f0c06423c723811d70a34d03a4c579429cd6ef6 # Parent 0e1e0022bd03b24acb59d61d6e62d7d4b78ee361 201031 diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/BMARM/COMMONADAPTERU.DEF --- a/CommonAdapter/BMARM/COMMONADAPTERU.DEF Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -EXPORTS - SetSoftkeys__11CGlobalNote18TGlobalNoteSoftkey @ 1 NONAME R3UNUSED ; CGlobalNote::SetSoftkeys(TGlobalNoteSoftkey) - NewLC__11CGlobalNote @ 2 NONAME R3UNUSED ; CGlobalNote::NewLC(void) - NewL__11CGlobalNote @ 3 NONAME R3UNUSED ; CGlobalNote::NewL(void) - CancelNoteL__11CGlobalNotei @ 4 NONAME R3UNUSED ; CGlobalNote::CancelNoteL(int) - ShowNoteL__11CGlobalNote15TGlobalNoteTypeRC7TDesC16 @ 5 NONAME R3UNUSED ; CGlobalNote::ShowNoteL(TGlobalNoteType, TDesC16 const &) - ShowNoteL__11CGlobalNoteR14TRequestStatus15TGlobalNoteTypeRC7TDesC16 @ 6 NONAME ; CGlobalNote::ShowNoteL(TRequestStatus &, TGlobalNoteType, TDesC16 const &) - "_._11CGlobalNote" @ 7 NONAME R3UNUSED ; CGlobalNote::~CGlobalNote(void) - diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/BWINS/COMMONADAPTERU.DEF --- a/CommonAdapter/BWINS/COMMONADAPTERU.DEF Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -EXPORTS - ??1CGlobalNote@@UAE@XZ @ 1 NONAME ; public: virtual __thiscall CGlobalNote::~CGlobalNote(void) - ?CancelNoteL@CGlobalNote@@QAEXH@Z @ 2 NONAME ; public: void __thiscall CGlobalNote::CancelNoteL(int) - ?NewL@CGlobalNote@@SAPAV1@XZ @ 3 NONAME ; public: static class CGlobalNote * __cdecl CGlobalNote::NewL(void) - ?NewLC@CGlobalNote@@SAPAV1@XZ @ 4 NONAME ; public: static class CGlobalNote * __cdecl CGlobalNote::NewLC(void) - ?SetSoftkeys@CGlobalNote@@QAEXW4TGlobalNoteSoftkey@@@Z @ 5 NONAME ; public: void __thiscall CGlobalNote::SetSoftkeys(enum TGlobalNoteSoftkey) - ?ShowNoteL@CGlobalNote@@QAEHAAVTRequestStatus@@W4TGlobalNoteType@@ABVTDesC16@@@Z @ 6 NONAME ; public: int __thiscall CGlobalNote::ShowNoteL(class TRequestStatus &,enum TGlobalNoteType,class TDesC16 const &) - ?ShowNoteL@CGlobalNote@@QAEHW4TGlobalNoteType@@ABVTDesC16@@@Z @ 7 NONAME ; public: int __thiscall CGlobalNote::ShowNoteL(enum TGlobalNoteType,class TDesC16 const &) - diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/EABI/CommonAdapterU.DEF --- a/CommonAdapter/EABI/CommonAdapterU.DEF Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -EXPORTS - _ZN11CGlobalNote11CancelNoteLEi @ 1 NONAME - _ZN11CGlobalNote11SetSoftkeysE18TGlobalNoteSoftkey @ 2 NONAME - _ZN11CGlobalNote4NewLEv @ 3 NONAME - _ZN11CGlobalNote5NewLCEv @ 4 NONAME - _ZN11CGlobalNote9ShowNoteLE15TGlobalNoteTypeRK7TDesC16 @ 5 NONAME - _ZN11CGlobalNote9ShowNoteLER14TRequestStatus15TGlobalNoteTypeRK7TDesC16 @ 6 NONAME - _ZN11CGlobalNoteD0Ev @ 7 NONAME - _ZN11CGlobalNoteD1Ev @ 8 NONAME - _ZN11CGlobalNoteD2Ev @ 9 NONAME - diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/group/CommonAdapter.mmp --- a/CommonAdapter/group/CommonAdapter.mmp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +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: Project definition file for Common Adapter. -* -*/ - - -#include - -TARGET commonadapter.dll -TARGETTYPE dll -UID 0x100039CE 0x101F852B - -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../src -SOURCE GlobalNoteImpl.cpp -SOURCE GlobalNote.cpp - -USERINCLUDE ../inc - -/* notifier removal workaround */ -USERINCLUDE /sf/mw/classicui/classicui_plat/extended_notifiers_api/inc -USERINCLUDE /sf/mw/classicui/classicui_plat/notifiers_api/inc - - -// This is a SYSTEMINCLUDE macro containing the middleware -// layer specific include directories -MW_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE ../../inc - -LIBRARY aknnotify.lib -LIBRARY euser.lib - -LANG SC - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/group/bld.inf --- a/CommonAdapter/group/bld.inf Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +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: Build information file for Common Adapter. -* -*/ - - -#include - -PRJ_EXPORTS - -// IBY-files -../rom/CommonAdapter.iby CORE_MW_LAYER_IBY_EXPORT_PATH(CommonAdapter.iby) - -PRJ_MMPFILES - -#ifndef TOOLS -CommonAdapter.mmp -#endif -// Enf of File diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/inc/GlobalNote.h --- a/CommonAdapter/inc/GlobalNote.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +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: Defines a common global note API meant to be -* customised by each SW platform. -* -*/ - - -#ifndef GLOBALNOTE_H -#define GLOBALNOTE_H - -// INCLUDES -#include - -// CONSTANTS - -// Available note types -enum TGlobalNoteType - { - EGlobalInformationNote = 1, - EGlobalWarningNote = 2, - EGlobalConfirmationNote = 3, - EGlobalErrorNote = 4, - EGlobalWaitNote = 5 - }; - -// Available note softkeys -enum TGlobalNoteSoftkey - { - // No sofkeys - EGlobalNoteSoftkeyNone = 0, - - // Single button notes - EGlobalNoteSoftkeyOk = 1, - EGlobalNoteSoftkeyExit = 2, - EGlobalNoteSoftkeyCancel = 3, - EGlobalNoteSoftkeyBack = 4, - EGlobalNoteSoftKeyClose = 5, - EGlobalNoteSoftKeyQuit = 6, - - // Double button notes. - EGlobalNoteSoftkeyOkCancel = 1000, - EGlobalNoteSoftkeyYesNo = 1001, - EGlobalNoteSoftkeyAnswerExit = 1002 - }; - - -// Return values for asynchronous notes -enum TGlobalNoteResult - { - EGlobalNoteResultOk = 1, - EGlobalNoteResultExit = 2, - EGlobalNoteResultCancel = 3, - EGlobalNoteResultBack = 4, - EGlobalNoteResultClose = 5, - EGlobalNoteResultQuit = 6, - EGlobalNoteResultYes = 7, - EGlobalNoteResultNo = 8, - EGlobalNoteResultAnswer = 9 - }; - -// FORWARD DECLARATIONS -class CGlobalNoteImpl; - -// CLASS DECLARATION - -/** -* Common global note adapter. -* -* Example usage of the API: -* -* Link your module against library commonadapter.lib -* Include header globalnote.h -* -* @code -* -* _LIT( KNoteText, "Haaha..\nDoes this thing work at all" ); -* _LIT( KCancelText, "Cancelled" ); -* -* CGlobalNote* globalNote = CGlobalNote::NewLC(); -* globalNote->SetSoftkeys( EGlobalNoteSoftkeyOkCancel ); -* TRequestStatus status; -* globalNote->ShowNoteL( status, EGlobalErrorNote, KNoteText ); -* User::WaitForRequest( status ); -* if ( status != KErrCancel ) -* { -* TBuf<12> buf; -* buf.AppendNum( status.Int() ); -* User::InfoPrint( buf ); -* } -* else -* { -* User::InfoPrint( KCancelText ); -* } -* -* CleanupStack::PopAndDestroy( globalNote ); -* -* @endcode -* -* @lib commonadapter.lib -* @since 2.0 -*/ -NONSHARABLE_CLASS( CGlobalNote ) : public CBase - { -public: - - /** - *Two-phased constructors. - */ - IMPORT_C static CGlobalNote* NewL(); - IMPORT_C static CGlobalNote* NewLC(); - - /** - * Destructor. - */ - IMPORT_C ~CGlobalNote(); - -public: // New functions - - /** - * Sets note softkeys. - * - * @since 2.0 - * - * @param aSoftKey Softkey ID - */ - IMPORT_C void SetSoftkeys( TGlobalNoteSoftkey aSoftkey ); - - /** - * Shows a global note. This call returns immediately. - * Deleting @c CGlobalNote instance does not remove the - * note after this call. - * - * @since 2.0 - * - * @param aType Note type. - * @param aNoteText Note text. - * - * @return Note ID. - */ - IMPORT_C TInt ShowNoteL( TGlobalNoteType aType, const TDesC& aNoteText ); - - /** - * Shows a global note. This call returns immediately. - * Deleting @c CGlobalNote instance cancels the note after - * this call. In this case, @c KErrCancel is returned in @c aStatus. - * - * @since 2.0 - * - * @param aStatus After user has pressed a softkey, this returns the - * corresponding @c TGlobalNoteResult code of - * the pressed softkey. - * @param aType Note type. - * @param aNoteText Note text. - * - * @return Note ID. - */ - IMPORT_C TInt ShowNoteL( TRequestStatus& aStatus, - TGlobalNoteType aType, - const TDesC& aNoteText ); - - /** - * Cancels a started note by ID. - * - * @since 2.0 - * - * @param aNoteId ID of the note to be canceled. - */ - IMPORT_C void CancelNoteL( TInt aNoteId ); - -private: - - /** - * C++ default constructor. - */ - CGlobalNote(); - - /** - * Symbian 2nd-phase constructor. - */ - void ConstructL(); - -private: - - /** - * Pointer to separate implementation class. - * Own. - */ - CGlobalNoteImpl* iImpl; - }; - -#endif // GLOBALNOTE_H diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/inc/GlobalNoteImpl.h --- a/CommonAdapter/inc/GlobalNoteImpl.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +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: Global Note Implementation for Common Adapter. -* -*/ - - -#ifndef GLOBALNOTEIMPL_H -#define GLOBALNOTEIMPL_H - -// INCLUDES -#include -#include -#include - -// CLASS DECLARATION - -/** -* Global Note Internal Implementation API. -* This API offers methods and mappings for the global note adapter into S60 -* global note functionality. -* -* @lib CommonAdapter.lib -* @since 2.0 -*/ -NONSHARABLE_CLASS( CGlobalNoteImpl ): public CBase - { -public: // New functions - - /** - * Two phase constructor - * @since 2.0 - */ - static CGlobalNoteImpl* NewL(); - - /** - * Destructor - */ - ~CGlobalNoteImpl(); - - /** - * Wrapper to call @c CAknGlobalNote::ShowNoteL() - * @since 2.0 - * - * @param aType Note type. - * @param aNoteText Note text. - * - * @return Note ID. - */ - TInt ShowNoteL( TGlobalNoteType aType, const TDesC& aNoteText ); - - /** - * Wrapper to call @c CAknGlobalNote::ShowNoteL() - * @since 2.0 - * - * @param aStatus After user has pressed a softkey, this returns the - * corresponding @c TGlobalNoteResult code of - * the pressed softkey. - * @param aType Note type. - * @param aNoteText Note text. - * - * @return Note ID. - */ - TInt ShowNoteL( TRequestStatus& aStatus, - TGlobalNoteType aType, - const TDesC& aNoteText ); - - /** - * Wrapper to call @c CAknGlobalNote::CancelGlobalNoteL() - * @since 2.0 - * - * @param aNoteId ID of the note to be canceled. - */ - void CancelGlobalNoteL( TInt aNoteId ); - - /** - * Wrapper to call @c CAknGlobalNote::SetSoftKeys() - * @since 2.0 - * - * @param aId Softkey ID. - */ - void SetSoftkeys( TInt aId ); - -private: // New functions - - /** - * Default constructor - */ - CGlobalNoteImpl(); - - /** - * Second part of two phase construction. - */ - void ConstructL(); - - /** - * Maps AVKON global note type according to @c TGlobalNoteType given. - * @since 2.0 - * - * @param aType Common global note type. - * @param[out] aAknType Corresponding type in AVKON global notes. - * - * @return @c KErrNotFound if note type not supported in AVKON. - */ - TInt NoteTypeInAvkon( const TGlobalNoteType& aType, - TAknGlobalNoteType& aAknType ) const; - - /** - * Maps AVKON soft key resource id according to @c aId given. - * @since 2.0 - * - * @param aId Common softkey ID. - * @param[out] aAknId Corresponding AVKON softkey ID. - * - * @return @c KErrNotFound if softkey ID not found from AVKON. - */ - void SoftKeysInAvkon( const TInt& aId, TInt& aAknId ) const; - -private: // Member definitions - - /** - * Pointer to AVKON global note instance. - * Own. - */ - CAknGlobalNote* iAknGlobalNote; - }; - -#endif // GLOBALNOTEIMPL_H - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/rom/CommonAdapter.iby --- a/CommonAdapter/rom/CommonAdapter.iby Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +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: Image description file for Common Adapter. -* -*/ - - -#ifndef COMMONADAPTER_IBY -#define COMMONADAPTER_IBY - -#include - -file=ABI_DIR\BUILD_DIR\commonadapter.dll SHARED_LIB_DIR\commonadapter.dll - -#endif // COMMONADAPTER_IBY diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/src/GlobalNote.cpp --- a/CommonAdapter/src/GlobalNote.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +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: API implementation for Global Note Adapter. -* -*/ - - -// INCLUDE FILES -#include -#include // For softkey resources - -#include "GlobalNoteImpl.h" - -// ============================ MEMBER FUNCTIONS ============================= - -// --------------------------------------------------------------------------- -// CGlobalNote::CGlobalNote -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------------------------- -// -CGlobalNote::CGlobalNote() - { - } - - -// --------------------------------------------------------------------------- -// CGlobalNote::ConstructL -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CGlobalNote::ConstructL() - { - iImpl = CGlobalNoteImpl::NewL(); - } - - -// --------------------------------------------------------------------------- -// CGlobalNote::NewL -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -EXPORT_C CGlobalNote* CGlobalNote::NewL() - { - CGlobalNote* self = NewLC(); - CleanupStack::Pop( self ); - - return self; - } - - -// --------------------------------------------------------------------------- -// CGlobalNote::NewLC -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -EXPORT_C CGlobalNote* CGlobalNote::NewLC() - { - CGlobalNote* self = new( ELeave ) CGlobalNote; - - CleanupStack::PushL( self ); - self->ConstructL(); - - return self; - } - - -// --------------------------------------------------------------------------- -// CGlobalNote::~CGlobalNote -// Destructor -// --------------------------------------------------------------------------- -// -EXPORT_C CGlobalNote::~CGlobalNote() - { - delete iImpl; - } - - -// --------------------------------------------------------------------------- -// CGlobalNote::SetSoftkeys() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -EXPORT_C void CGlobalNote::SetSoftkeys( TGlobalNoteSoftkey aSoftkey ) - { - iImpl->SetSoftkeys( aSoftkey ); - } - - -// --------------------------------------------------------------------------- -// CGlobalNote::ShowNoteL() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CGlobalNote::ShowNoteL( TGlobalNoteType aType, - const TDesC& aNoteText ) - { - return iImpl->ShowNoteL( aType, aNoteText ); - } - - -// --------------------------------------------------------------------------- -// CGlobalNote::ShowNoteL() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -EXPORT_C TInt CGlobalNote::ShowNoteL( TRequestStatus& aStatus, - TGlobalNoteType aType, - const TDesC& aNoteText ) - { - return iImpl->ShowNoteL( aStatus, aType, aNoteText ); - } - - -// --------------------------------------------------------------------------- -// CGlobalNote::CancelNoteL() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -EXPORT_C void CGlobalNote::CancelNoteL( TInt aNoteId ) - { - iImpl->CancelGlobalNoteL( aNoteId ); - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 CommonAdapter/src/GlobalNoteImpl.cpp --- a/CommonAdapter/src/GlobalNoteImpl.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,208 +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: Wrapper to AVKON global note functionality. -* -*/ - - -// INCLUDE FILES -#include "GlobalNoteImpl.h" -#include - -// ============================ MEMBER FUNCTIONS ============================= - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::CGlobalNoteImpl -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------------------------- -// -CGlobalNoteImpl::CGlobalNoteImpl() - { - } - - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::ConstructL -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CGlobalNoteImpl::ConstructL() - { - iAknGlobalNote = CAknGlobalNote::NewL(); - } - - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::NewL -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CGlobalNoteImpl* CGlobalNoteImpl::NewL() - { - CGlobalNoteImpl* self = new( ELeave ) CGlobalNoteImpl; - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - } - - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::~CGlobalNoteImpl -// Destructor -// --------------------------------------------------------------------------- -// -CGlobalNoteImpl::~CGlobalNoteImpl() - { - delete iAknGlobalNote; - } - - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::SetSoftkeys() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -void CGlobalNoteImpl::SetSoftkeys( TInt aId ) - { - TInt id; - SoftKeysInAvkon( aId, id ); - iAknGlobalNote->SetSoftkeys( id ); - } - - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::ShowNoteL() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -TInt CGlobalNoteImpl::ShowNoteL( TGlobalNoteType aType, - const TDesC& aNoteText ) - { - TAknGlobalNoteType type; - User::LeaveIfError( NoteTypeInAvkon( aType, type ) ); - - return iAknGlobalNote->ShowNoteL( type, aNoteText ); - } - - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::ShowNoteL() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -TInt CGlobalNoteImpl::ShowNoteL( TRequestStatus& aStatus, - TGlobalNoteType aType, - const TDesC& aNoteText ) - { - TAknGlobalNoteType type; - User::LeaveIfError( NoteTypeInAvkon( aType, type ) ); - - // This way we can indicate to avkon global note that adapter is in use. - iAknGlobalNote->SetPriority( 0xFFFF + 1 ); - - return iAknGlobalNote->ShowNoteL( aStatus, type, aNoteText ); - } - - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::NoteTypeInAvkon() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -TInt CGlobalNoteImpl::NoteTypeInAvkon( const TGlobalNoteType& aType, - TAknGlobalNoteType& aAknType ) const - { - switch ( aType ) - { - case EGlobalInformationNote: - aAknType = EAknGlobalInformationNote; - break; - case EGlobalWarningNote: - aAknType = EAknGlobalWarningNote; - break; - case EGlobalConfirmationNote: - aAknType = EAknGlobalConfirmationNote; - break; - case EGlobalErrorNote: - aAknType = EAknGlobalErrorNote; - break; - case EGlobalWaitNote: - aAknType = EAknGlobalWaitNote; - break; - default: - return KErrNotFound; - } - - return KErrNone; - } - - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::SoftKeysInAvkon() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -void CGlobalNoteImpl::SoftKeysInAvkon( const TInt& aId, TInt& aAknId ) const - { - switch ( aId ) - { - case EGlobalNoteSoftkeyOk: - aAknId = R_AVKON_SOFTKEYS_OK_EMPTY; - break; - case EGlobalNoteSoftkeyExit: - aAknId = R_AVKON_SOFTKEYS_EXIT; - break; - case EGlobalNoteSoftkeyCancel: - aAknId = R_AVKON_SOFTKEYS_CANCEL; - break; - case EGlobalNoteSoftkeyBack: - aAknId = R_AVKON_SOFTKEYS_BACK; - break; - case EGlobalNoteSoftKeyClose: - aAknId = R_AVKON_SOFTKEYS_CLOSE; - break; - case EGlobalNoteSoftKeyQuit: - aAknId = R_AVKON_SOFTKEYS_QUIT; - break; - case EGlobalNoteSoftkeyOkCancel: - aAknId = R_AVKON_SOFTKEYS_OK_CANCEL; - break; - case EGlobalNoteSoftkeyYesNo: - aAknId = R_AVKON_SOFTKEYS_YES_NO; - break; - case EGlobalNoteSoftkeyAnswerExit: - aAknId = R_AVKON_SOFTKEYS_ANSWER_EXIT; - break; - default: - aAknId = R_AVKON_SOFTKEYS_EMPTY; - break; - } - } - - -// --------------------------------------------------------------------------- -// CGlobalNoteImpl::CancelGlobalNoteL() -// (other items were commented in a header). -// --------------------------------------------------------------------------- -// -void CGlobalNoteImpl::CancelGlobalNoteL( TInt aNoteId ) - { - iAknGlobalNote->CancelNoteL( aNoteId ); - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/find_item_ui_api/inc/finditemdialog.h --- a/classicui_plat/find_item_ui_api/inc/finditemdialog.h Thu Jul 29 14:21:56 2010 +0800 +++ b/classicui_plat/find_item_ui_api/inc/finditemdialog.h Fri Aug 06 17:25:01 2010 +0800 @@ -56,7 +56,6 @@ class CFindItemVoIPExtension; class CAknsBasicBackgroundControlContext; class CRichTextEditorContainer; -class CSendUi; class CItemFinderExtension; // CLASS DECLARATION @@ -448,9 +447,6 @@ // Array to enable the scrollbar to know current position. CArrayFixFlat* iItemArrayForScrollBar; - // SendUi - CSendUi* iSendUi; - #ifndef RD_VIRTUAL_PHONEBOOK CPbkContactEngine* iPbkEngine; CPbkDataSaveAppUi* iPbkDataSave; diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/find_item_ui_api/inc/finditemmenu.h --- a/classicui_plat/find_item_ui_api/inc/finditemmenu.h Thu Jul 29 14:21:56 2010 +0800 +++ b/classicui_plat/find_item_ui_api/inc/finditemmenu.h Fri Aug 06 17:25:01 2010 +0800 @@ -37,7 +37,6 @@ // FORWARD DECLARATIONS class CRepository; class CEikMenuPane; -class CSendUi; #ifndef RD_VIRTUAL_PHONEBOOK class CPbkContactEngine; class CPbkDataSaveAppUi; @@ -414,9 +413,6 @@ TBool iIsContextMenu; TInt iIndex; - // SendUi - CSendUi* iSendUi; - #ifndef RD_VIRTUAL_PHONEBOOK CPbkContactEngine* iPbkEngine; CPbkDataSaveAppUi* iPbkDataSave; diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/ganes_api.metaxml --- a/classicui_plat/ganes_api/ganes_api.metaxml Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - ganes_api - Ganes API - c++ - INPUT WHEN CLEAR - - - - - - no - no - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/group/bld.inf --- a/classicui_plat/ganes_api/group/bld.inf Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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 - -PRJ_PLATFORMS -WINSCW ARMV5 - -PRJ_EXPORTS -../inc/ganes/HgGrid.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgGrid.h) -../inc/ganes/HgItem.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgItem.h) -../inc/ganes/HgList.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgList.h) -../inc/ganes/HgSingleGraphicList.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgSingleGraphicList.h) -../inc/ganes/HgSingleLargeList.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgSingleLargeList.h) -../inc/ganes/HgDoubleGraphicList.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgDoubleGraphicList.h) -../inc/ganes/HgDoubleTextList.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgDoubleTextList.h) -../inc/ganes/HgSingleTextList.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgSingleTextList.h) -../inc/ganes/HgScrollerWithTitle.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgScrollerWithTitle.h) -../inc/ganes/HgSelectionObserverIface.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgSelectionObserverIface.h) -../inc/ganes/HgMarkingObserverIface.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgMarkingObserverIface.h) -../inc/ganes/HgScrollBufferObserverIface.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgScrollBufferObserverIface.h) -../inc/ganes/HgScroller.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgScroller.h) -../inc/ganes/HgBufferOwnerIface.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgBufferOwnerIface.h) -../inc/ganes/HgScrollbarObserverIface.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgScrollbarObserverIface.h) -../inc/ganes/HgVgMediaWall.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgVgMediaWall.h) -../inc/ganes/HgVgItem.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgVgItem.h) -../inc/ganes/HgSingleTextListWithIcon.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgSingleTextListWithIcon.h) -../inc/ganes/HgVgMediaWallObserverIface.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgVgMediaWallObserverIface.h) -../inc/ganes/HgDoubleGraphicListFlat.h MW_LAYER_PLATFORM_EXPORT_PATH(ganes/HgDoubleGraphicListFlat.h) - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgBufferOwnerIface.h --- a/classicui_plat/ganes_api/inc/ganes/HgBufferOwnerIface.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGBUFFEROWNERIFACE_H_ -#define HGBUFFEROWNERIFACE_H_ - -#include - -/** - * Buffer observer interface. - */ -class MHgBufferOwner - { -public: - /** - * Buffer position changed. - * The items between the aReleaseStart and aReleaseEnd should be released as soon as possible. - * - * @param aReleaseStart The index of the first item in buffer. - * @param aReleaseEnd The index of the last item in buffer. - */ - virtual void Release(TInt aReleaseStart, TInt aReleaseEnd) = 0 ; - }; - -#endif /*HGBUFFEROWNERIFACE_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgDoubleGraphicList.h --- a/classicui_plat/ganes_api/inc/ganes/HgDoubleGraphicList.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +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 HGDOUBLEGRAPHICLIST_H_ -#define HGDOUBLEGRAPHICLIST_H_ - -#include - -class CHgDoubleGraphicList : public CHgList - { -public: - /** - * Creates new CHgDoubleGraphicList. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the grid - * @param aDefaultIcon Default icon to be used. - * @param aSession Window server session for DSA. Default is NULL and DSA is disabled. - * - * @return CHgDoubleGraphicList-object - */ - IMPORT_C static CHgDoubleGraphicList* NewL ( const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon = NULL, - RWsSession* aSession = NULL); - - /** - * Destructor. - */ - IMPORT_C virtual ~CHgDoubleGraphicList( ); - -public: - - /** - * Returns preferred image size that should be used when passing images. - */ - IMPORT_C static TSize PreferredImageSize(); - - /** - * Sets overlay indicator to be placed on top if the list icon. - * The indicator will be shown on list items that have enabled the overlay indicator flag. - * Ownership of the indicator is transferred. - * - * @param aIndicator The indicator to be shown - */ - IMPORT_C void SetIconOverlayIndicator(CGulIcon* aIndicator); - -protected: // CHgScroller - void HandleSizeChanged(); - -protected: // CHgList - void DrawItem(TInt aIndex, const TRect& aRect) const; - -protected: - CHgDoubleGraphicList( TInt aItemCount, - CGulIcon* aDefaultIcon ); - - void InitOverlayIcon(); - -protected: - - CGulIcon* iIconOverlayIndicator; - }; - -#endif /*HGDOUBLEGRAPHICLIST_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgDoubleGraphicListFlat.h --- a/classicui_plat/ganes_api/inc/ganes/HgDoubleGraphicListFlat.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGDOUBLEGRAPHICLISTFLAT_H_ -#define HGDOUBLEGRAPHICLISTFLAT_H_ - -#include - -class CHgDoubleGraphicListFlat : public CHgDoubleGraphicList - { -public: - /** - * Creates new CHgDoubleGraphicList. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the grid - * @param aDefaultIcon Default icon to be used. - * @param aSession Window server session for DSA. Default is NULL and DSA is disabled. - * - * @return CHgDoubleGraphicList-object - */ - IMPORT_C static CHgDoubleGraphicListFlat* NewL ( const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon = NULL, - RWsSession* aSession = NULL); - - /** - * Destructor. - */ - IMPORT_C virtual ~CHgDoubleGraphicListFlat( ); - -public: - - /** - * Returns preferred image size that should be used when passing images. - */ - IMPORT_C static TSize PreferredImageSize(); - -protected: // CHgScroller - void HandleSizeChanged(); - -protected: // CHgList - void DrawItem(TInt aIndex, const TRect& aRect) const; - -protected: - CHgDoubleGraphicListFlat( TInt aItemCount, - CGulIcon* aDefaultIcon ); - - }; - -#endif /*HGDOUBLEGRAPHICLISTFLAT_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgDoubleTextList.h --- a/classicui_plat/ganes_api/inc/ganes/HgDoubleTextList.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGDOUBLETEXTLIST_H_ -#define HGDOUBLETEXTLIST_H_ - -#include - -class CHgDoubleTextList : public CHgList - { -public: - /** - * Creates new CHgDoubleTextList. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the grid - * @param aDefaultIcon Default icon to be used. - * @param aSession Window server session for DSA. Default is NULL and DSA is disabled. - * - * @return CHgDoubleTextList-object - */ - IMPORT_C static CHgDoubleTextList* NewL ( const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon = NULL, - RWsSession* aSession = NULL); - - /** - * Destructor. - */ - IMPORT_C virtual ~CHgDoubleTextList( ); - -public: - - /** - * Returns preferred image size that should be used when passing images. - */ - IMPORT_C static TSize PreferredImageSize(); - -protected: // CHgScroller - void HandleSizeChanged(); - -protected: // CHgList - void DrawItem(TInt aIndex, const TRect& aRect) const; - -protected: - CHgDoubleTextList( TInt aItemCount, - CGulIcon* aDefaultIcon ); - - }; - -#endif /*HGDOUBLETEXTLIST_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgGrid.h --- a/classicui_plat/ganes_api/inc/ganes/HgGrid.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGGRID_H_ -#define HGGRID_H_ - -// INCLUDES -#include - -class CHgGridLayoutData; - -// CLASS DECLARATION -class CHgGrid : public CHgScroller - { -public: // CONSTRUCTORS & DESTRUCTOR - - /** - * Creates new HgGrid. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the grid - * @param aDefaultIcon Default icon to be used. - * @param aSession Window server session for DSA. Default is NULL and DSA is disabled. - * - * @return HgGrid-object - */ - IMPORT_C static CHgGrid* NewL( - const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon = NULL, - RWsSession* aSession = NULL ); - - /** - * Destructor. - */ - IMPORT_C virtual ~CHgGrid ( ); - -public: - - /** - * Returns preferred image size that should be used when passing images. - */ - IMPORT_C static TSize PreferredImageSize(); - - /** - * Set landscape scrolling support. If enabled lanscape scrolling - * is on only in landscape orientation. InitScreenL must be called after - * this to relayout the grid. - * - * @param aSupportLandscapeScrolling Landscape scrolling supported or not. - */ - IMPORT_C void SetLandscapeScrollingSupport( TBool aSupportLandscapeScrolling ); - -protected: // CHgScroller - TInt GetSelected( TPoint aPosition ) const; - void HandleSizeChanged(); - void InitItemsL(); - TSize TotalSize() const; - void DoDraw(const TRect& aRect ) const; - TBool DoHandleKeyEvent( const TKeyEvent& aEvent ); - void FitSelectionToView(); - void FitTopItemToView( TInt aIndex ); - TInt CurrentIndex(); - TBool IsDisplayed( TInt aIndex ); - -private: // Constructors - CHgGrid( TInt aItemCount, - CGulIcon* aDefaultIcon ); - - void ConstructL (const TRect& aRect, RWsSession* aSession ); - -private: - void DrawHighlight( const TRect& aOuterRect ) const; - - void HandleDownArrow(); - void HandleUpArrow(); - void HandleRightArrow(); - void HandleLeftArrow(); - void SelectDefaultItem(); - - TRect GridRect() const; - void DrawCols( TInt aRow, const TRect& aRect, TInt aYPos ) const; - void DrawRows( TInt aCol, const TRect& aRect, TInt aXPos ) const; - void DrawItem( TInt aIndex, const TRect& aRect ) const; - - void CalculateSizes(); - void ChangeSelectedIndex( TInt aMove ); - -private: // DATA - CHgGridLayoutData* iLayoutData; - - TInt iRows; // Total number of rows to display - TInt iCols; // Total number of cols to display - - TInt iRowWidth; - TBool iLandScapeScrollingSupported; - }; - -#endif // HGGRID_H_ -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgItem.h --- a/classicui_plat/ganes_api/inc/ganes/HgItem.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +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 HGITEM_H_ -#define HGITEM_H_ - -#include - -// Forward declarations -class CGulIcon; - -class CHgItem : public CBase - { -public: - - /** - * Creates new CHgItem. - * - * @param aFlags Item flags. Default is EHgItemFlagsNone - * @param aIcon Item Icon. Ownership transferred. - * @param aTitle Title text. - * @param aText Additional Text. - * - * @return CHgItem-object - */ - IMPORT_C static CHgItem* NewL(TInt aFlags = EHgItemFlagsNone, - CGulIcon* aIcon = 0, - const TDesC& aTitle = KNullDesC, - const TDesC& aText = KNullDesC ); - - /** - * @copydoc CHgItem::NewL - */ - IMPORT_C static CHgItem* NewLC(TInt aFlags = EHgItemFlagsNone, - CGulIcon* aIcon = 0, - const TDesC& aTitle = KNullDesC, - const TDesC& aText = KNullDesC); - - /** - * Destructor. - */ - IMPORT_C virtual ~CHgItem(); - -public: - /** - * Gets the Icon. - * - * @return pointer to Icon. - */ - IMPORT_C CGulIcon* Icon() const; - - /** - * Gets the title text. - * - * @return The title text. - */ - IMPORT_C const TDesC& Title() const; - - /** - * Gets the additional text. - * - * @return The additional text. - */ - IMPORT_C const TDesC& Text() const; - - /** - * Gets time of the item. - * - * @return Time. - */ - IMPORT_C TTime Time() const; - - /** - * Sets icon. - * - * @param aIcon New icon. Ownership transferred. - */ - IMPORT_C virtual void SetIcon( CGulIcon* aIcon, TInt aFlags = EHgItemFlagsNone ); - - /** - * Sets title text. - * - * @param aTitle New title text. - */ - IMPORT_C void SetTitleL( const TDesC& aTitle ); - - /** - * Sets additional text. - * - * @param aTitle New additional text. - */ - IMPORT_C void SetTextL( const TDesC& aText ); - - /** - * Sets item time. - * - * @param aTime Time. - */ - IMPORT_C void SetTime( TTime aTime ); - - /** - * Gets flags associated with item. - * @see THgItemFlags - */ - IMPORT_C TInt Flags(); - - -public: - - /** - * Item flags. - */ - enum THgItemFlags - { - EHgItemFlagsNone = 0, - EHgItemFlagMarked = 0x0001, - EHgItemFlagsDrmRightsValid = 0x0002, - EHgItemFlagsDrmRightsExpired = 0x0004, - EHgItemFlagsVideo = 0x0008, - EHgItemFlagsMmc = 0x0010, - EHgItemFlagsPlaybackIndicator = 0x0020, - EHgItemFlagsPauseIndicator = 0x0040, - EHgItemFlagsBrokenPlaylistIndicator = 0x0080, - EHgItemFlagsBrokenTrackIndicator = 0x0100, - EHgItemFlagsCorruptedTrackIndicator = 0x0200, - EHgItemFlagsNewVideoIndicator = 0x0400, - EHgItemFlagsMassStorageIndicator = 0x0800, - EHgItemFlagsPhoneStorageIndicator = 0x1000, - EHgItemFlagsNewPodcastIndicator = 0x2000, - EHgItemFlagsPlayedPodcastIndicator = 0x4000, - EHgItemFlagsCompletelyPlayedPodcastIndicator = 0x8000, - EHgItemFlagsMoveUpIndicator = 0x10000, - EHgItemFlagsMoveDownIndicator = 0x20000, - EHgItemFlagsMoveUpDownIndicator = 0x40000, - EHgItemFlagsIconOverlayIndicator = 0x80000000 - }; - - /** - * Sets item flags. - * - * @param aFlags Flags to be set. - */ - IMPORT_C void SetFlags( TInt aFlags ); - - /** - * Clears item flags. - * - * @param aFlags Flags to be cleared. - */ - IMPORT_C void ClearFlags( TInt aFlags ); - -protected: - - CHgItem( TInt aFlags, CGulIcon* aIcon ); - virtual void ConstructL( const TDesC& aTitle, const TDesC& aText ); - -protected: - - CGulIcon* iIcon; // Item icon. Own - HBufC* iTitle; // Item title. Own - HBufC* iText; // Item text. Own - TTime iTime; // Item time - - TInt iFlags; // Item flags - - }; - -#endif /*HGITEM_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgList.h --- a/classicui_plat/ganes_api/inc/ganes/HgList.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef __HGLIST_H__ -#define __HGLIST_H__ - -// INCLUDES -#include - -// Forward declarations -class CAknsFrameBackgroundControlContext; -class CFbsBitmap; -class CGulIcon; -class CHgListLayoutData; - -// CLASS DECLARATION -class CHgList : public CHgScroller - { -public: - - /** - * Destructor - */ - IMPORT_C virtual ~CHgList( ); - -protected: // CHgScroller - virtual TInt GetSelected( TPoint aPosition ) const; - virtual void HandleSizeChanged(); - virtual void DoDraw(const TRect& aRect ) const; - void InitItemsL(); - virtual TSize TotalSize() const; - void FitSelectionToView(); - virtual void FitTopItemToView( TInt aIndex ); - TInt CurrentIndex(); - TBool IsDisplayed( TInt aIndex ); - -protected: - void DrawHighlight( const TRect& aRect, TRgb& aTextColor ) const; - virtual TBool DoHandleKeyEvent( const TKeyEvent& aKeyEvent ); - void ResetClippingRect( CWindowGc& aGc ) const; - TRect ListRect() const; - -protected: - virtual void DrawItem(TInt aIndex, const TRect& aRect) const = 0; - -protected: // Constructors - CHgList ( TInt aItemCount, - CGulIcon* aDefaultIcon ); - - void ConstructL (const TRect& aRect, RWsSession* aSession ); - - void HandleDownArrow(); - void HandleUpArrow(); - void SelectDefaultItem(); - -protected: // DATA - CHgListLayoutData* iLayoutData; - - TInt iRows; // Total number of rows to display - - TRgb iColor; // Normal item color - TRgb iColorBack; // normal item background color - TRgb iHighlightedColor; // color for highlighted item - TRgb iHighlightedColorBack; // background color for highlighted item - - TPoint iListOffset; - }; - -#endif // __HGLIST_H__ - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgMarkingObserverIface.h --- a/classicui_plat/ganes_api/inc/ganes/HgMarkingObserverIface.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGMARKINGOBSERVERIFACE_H_ -#define HGMARKINGOBSERVERIFACE_H_ - -#include - -/** - * Marking observer interface. - */ -class MHgMarkingObserver - { -public: - - /** - * Handle marking. - * - * @param aIndex Selected item index. - * @param aMarked ETrue if item marked, EFalse if item is unmarked. - */ - virtual void HandleMarkingL( TInt aIndex, TBool aMarked ) = 0; - - }; - -#endif // HGMARKINGOBSERVERIFACE_H_ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgScrollBufferObserverIface.h --- a/classicui_plat/ganes_api/inc/ganes/HgScrollBufferObserverIface.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGSCROLLBUFFEROBSERVERIFACE_H_ -#define HGSCROLLBUFFEROBSERVERIFACE_H_ - -#include -#include - -/** - * Buffer observer interface. - */ -class MHgScrollBufferObserver : public MHgBufferOwner - { -public: - /** - * The direction of request. - */ - enum THgScrollDirection - { - EHgBufferNoMove, // Request initiated by adding or removing an item - EHgBufferReset, // Full buffer reset - EHgBufferScrollUp, // Request items before the buffer - EHgBufferScrollDown // Request items after the buffer - }; - -public: - /** - * Buffer position changed. - * The items between the aBufferStart and aBufferEnd should be loaded as soon as possible. - * - * @param aBufferStart The index of the first item in buffer. - * @param aBufferEnd The index of the last item in buffer. - * @param aDirection Scroll direction. - */ - virtual void Request(TInt aRequestStart, TInt aRequestEnd, THgScrollDirection aDirection) = 0 ; - - }; - -#endif // HGSCROLLBUFFEROBSERVERIFACE_H_ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgScrollbarObserverIface.h --- a/classicui_plat/ganes_api/inc/ganes/HgScrollbarObserverIface.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGSCROLLBAROBSERVERIFACE_H_ -#define HGSCROLLBAROBSERVERIFACE_H_ - -#include - -class MHgScrollbarObserver - { -public: - /** - */ - virtual void ScrollBarPositionChanged( const TPoint& aNewPosition ) = 0; - - virtual void HandleNaviStripChar( const TChar& aChar ) = 0; - }; - -#endif /* HGSCROLLBAROBSERVERIFACE_H_ */ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgScroller.h --- a/classicui_plat/ganes_api/inc/ganes/HgScroller.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,504 +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 HGSCROLLER_H_ -#define HGSCROLLER_H_ - -// INCLUDES -#include -#include - -#include -#include -#include -#include -#include - -// FORWARD DECLARATIONS -class CAknPhysics; -class MHgScrollBufferObserver; -class MHgSelectionObserver; -class MHgMarkingObserver; -class CHgItem; -class CHgScrollbar; -class CGulIcon; -class CHgScrollBufferManager; -class THgPopupDrawer; -class CHgIndicatorManager; -class CHgDrawUtils; -class CHgKeyUtils; -class CHgTextFind; -class CAknItemActionMenu; - -// CLASS DECLARATION -class CHgScroller : - public CCoeControl, - public MHgBufferOwner, - public MHgScrollbarObserver, - public MCoeForegroundObserver, - public MAknPhysicsObserver, - public MAknLongTapDetectorCallBack, - public MAknCollection - { -public: - - // Flags that define possible scroller modes - enum THgScrollerMode - { - EHgScrollerSelectionMode = 0x0001, - EHgScrollerSearchWithQWERTY = 0x0002, - EHgScrollerKeyMarkingDisabled = 0x0004, - EHgScrollerScreenFreeze = 0x0008, - EHgScrollerForceDoubleClick = 0x0010, - EHgScrollerFlatStatusPane = 0x0020 - }; - - // Scrollbar types - enum THgScrollBarType - { - EHgScrollerScrollBar = 0, - EHgScrollerLetterStrip, - EHgScrollerTimeStrip, - EHgScrollerLetterStripLite - }; - -public: // Destructor. - IMPORT_C virtual ~CHgScroller(); - -public: // CCoeControl - void Draw(const TRect& aRect ) const; - void SizeChanged(); - void HandlePointerEventL( const TPointerEvent& aEvent ); - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - virtual TCoeInputCapabilities InputCapabilities() const; - virtual void FocusChanged(TDrawNow aDrawNow); - virtual void HandleResourceChange(TInt aType); - -protected: // MAknPhysicsObserver - void ViewPositionChanged( const TPoint& aNewPosition, - TBool aDrawNow, - TUint aFlags ); - void PhysicEmulationEnded(); - TPoint ViewPosition() const; - -private: // MHgBufferOwner - void Release(TInt aReleaseStart, TInt aReleaseEnd); - -private: // MHgScrollbarObserver - void ScrollBarPositionChanged( const TPoint& aNewPosition ); - void HandleNaviStripChar( const TChar& aChar ); - -protected: // MAknLongTapDetectorCallBack - void HandleLongTapEventL( const TPoint& aPenEventLocation, - const TPoint& aPenEventScreenLocation); - -protected: // MAknCollection - TUint CollectionState() const; - void ItemActionMenuClosed(); - TInt CollectionExtension( TUint aExtensionId, TAny*& a0, TAny* a1 ); - -public: // NEW FUNCTIONS - /** - * Re-inits the grid display area. DSA version. - * - * @param aRect New display rect - * @param aSession Window server session for DSA - */ - IMPORT_C void InitScreenL( const TRect& aRect, RWsSession& aSession ); - - /** - * Re-inits the grid display area. Non-DSA version. - * - * @param aRect New display rect - */ - IMPORT_C void InitScreenL( const TRect& aRect ); - - /** - * Refreshes screen. - * @param aIndex Index that was modified. - */ - IMPORT_C void RefreshScreen( TInt aIndex ); - - /** - * Gives the first index on the screen. - * - * Note: The index is not guaranteed to be in the range of the scroller items. - * Index can be negative if the scroller is scrolled to the way up or - * over the count - 1 if scrolled way down. - * - * @return The index of the first item on the screen. - */ - IMPORT_C TInt FirstIndexOnScreen(); - - /** - * How many items fit on one screen. - * @return Item count. - */ - IMPORT_C TInt ItemsOnScreen(); - - /** - * Get item at specified index. - * - * @param aIndex Index of the item that is returned - * @return Reference to item. - */ - IMPORT_C CHgItem& ItemL( TInt aIndex ); - - /** - * Resets item at the index position. Old item is deleted. - * - * @param aItem New item. Ownership transferred. - * @param aIndex The index of the item. - */ - IMPORT_C void SetItem(CHgItem* aItem, TInt aIndex); - - /** - * Adds Item. - * - * @param aItem New item. Ownership transferred. - */ - IMPORT_C void AddItem(CHgItem* aItem); - - /** - * Inserts item at index postion. - * - * @param aItem New item. Ownership transferred. - * @param aIndex The index of the item. - */ - IMPORT_C void InsertItem(CHgItem* aItem, TInt aIndex); - - /** - * Removes item at index position. Removed item is deleted. - * - * @param aIndex The index of the item. - */ - IMPORT_C void RemoveItem(TInt aIndex); - - /** - * @return Selected index (KErrNotFound if nothing is selected) - */ - IMPORT_C TInt SelectedIndex(); - - /** - * Sets selected index. - * @param aIndex new selected index. Selection is also made visible. - */ - IMPORT_C void SetSelectedIndex( TInt aIndex ); - - /** - * Marks item at index position. - * @param aIndex Index of the item that is marked. - */ - IMPORT_C void Mark( TInt aIndex ); - - /** - * Unmarks item at index position. - * @param aIndex Index of the item that is unmarked. - */ - IMPORT_C void UnMark( TInt aIndex ); - - /** - * Marks all items. - */ - IMPORT_C void MarkAll(); - - /** - * Unmarks all items. - */ - IMPORT_C void UnMarkAll(); - - /** - * Gets all marked item indexes. - * @param aIndexes On return contains the indexes of marked items. - */ - IMPORT_C void GetMarkedItemsL( RArray& aIndexes ); - - /** - * Enables Buffering. - * @param aObserver Buffer change observer. - * @param aBufferSize The size of the buffer. - * @param aBufferTreshold The minimum change needed for buffer to be modified. - */ - IMPORT_C void EnableScrollBufferL( MHgScrollBufferObserver& aObserver, - TInt aBufferSize, - TInt aBufferTreshold ); - - /** - * Sets selection observer. - * @param aObserver Selection observer. - */ - IMPORT_C void SetSelectionObserver( MHgSelectionObserver& aObserver ); - - /** - * Sets marking observer. - * @param aObserver marking observer. - */ - IMPORT_C void SetMarkingObserver( MHgMarkingObserver& aObserver ); - - /** - * Removes all items and presents empty text - * */ - IMPORT_C void Reset(); - - /** - * Resizes Grid/List. - * @param aItemCount New Count of items. - */ - IMPORT_C void ResizeL( TInt aItemCount ); - - /** - * Set text that is displayed when there are no items in the view. - * @param aEmptyText Empty text. - */ - IMPORT_C void SetEmptyTextL( const TDesC& aEmptyText ); - - /** - * Fetch item count. - * @return Total number of items. - */ - IMPORT_C TInt ItemCount() const; - - /** - * Set scrollbar type. - * @param aType ScrollBar type - */ - IMPORT_C void SetScrollBarTypeL( THgScrollBarType aType ); - - /** - * Set mode flags. Possible values are defined in THgScrollerMode. - * @param aFlags flags to bet set. - */ - IMPORT_C void SetFlags( TInt aFlags ); - - /** - * Clear mode flags. Possible values are defined in THgScrollerMode. - * @param aFlags flags to be cleared. - */ - IMPORT_C void ClearFlags( TInt aFlags ); - - /** - * Get flags. Possible values are defined in THgScrollerMode. - * @return Current flags. - */ - IMPORT_C TInt Flags(); - - /** - * Highlights item based on the descriptor given. - * @param aHighlightText Text to be searched. - * @return Was aHighlightText found. - */ - IMPORT_C TBool HightlightItem( const TDesC& aHighlightText ); - - /** - * Sets new default icon. - * @param aDefaultIcon New default icon to be used in scroller. - */ - IMPORT_C void SetDefaultIconL( CGulIcon* aDefaultIcon ); - - /** - * Disables Scrollbuffer. - */ - IMPORT_C void DisableScrollBuffer(); - - // Selection modes. Used in internal key marking implemention. - enum TSelectionMode - { - ENoSelection = 0, - ESelectionPossible, - ESelectionMark, - ESelectionUnMark - }; - - /** - * Set selection mode. Used in internal key marking implemention. - * @param aMode New selection mode. - */ - void SetSelectionMode( TSelectionMode aMode ); - - /** - * Get current selection mode. Used in internal key marking implemention. - * @return Current selection mode. - */ - TSelectionMode SelectionMode() const; - -protected: // Pure Virtual Functions - virtual TInt GetSelected( TPoint aPosition ) const = 0; - virtual void HandleSizeChanged() = 0; - virtual void InitItemsL() = 0; - virtual TSize TotalSize() const = 0; - virtual void DoDraw( const TRect& aRect ) const = 0; - virtual TBool DoHandleKeyEvent( const TKeyEvent& aKeyEvent ) = 0; - virtual void FitSelectionToView() = 0; - virtual TInt CurrentIndex() = 0; - virtual TBool IsDisplayed( TInt aIndex ) = 0; - virtual void FitTopItemToView( TInt aIndex ) = 0; - -protected: // Constructors - CHgScroller( TInt aItemCount, - CGulIcon* aDefaultIcon ); - - void ConstructL (const TRect& aRect, RWsSession* aSession ); - -protected: - void InitPhysicsL(); - virtual void HandleViewPositionChanged( TBool aUpdateScrollbar = ETrue ); - void InitDrawBuffer() const; - void SelectionChanged(); - void FitRowToView( TInt aRow ); - TBool HasHighlight() const; - static TInt MarqueeCallback( TAny* aSelf ); - -private: - TKeyResponse HandleKeyEvent(const TKeyEvent& aKeyEvent); - - void HandleItemCountChanged(); - void HandleSelectionL(); - - TBool HandleScrollbarEventL( const TPointerEvent& aEvent ); - void HandleDownEventL( const TPointerEvent& aEvent ); - void HandleDragEventL( const TPointerEvent& aEvent ); - void HandleUpEventL( const TPointerEvent& aEvent ); - - void KeyEventDown(); - void KeyEventUp(); - - void InitGraphicsL(); - void InitScrollbarL(); - - void HandleGainingForeground(); - void HandleLosingForeground(); - - /** - * Launches the highlight timer. - */ - void LaunchHighlightTimer(); - - /** - * Callback method for highlight timer. - * - * @param aPtr Pointer to an instance of CHgScroller class. - * - * @return System wide error code. - */ - static TInt HighlightTimerCallback( TAny* aPtr ); - - /** - * Sets highlight to focused item. - */ - void SetHighlightL(); - - /** - * Callback method for key scrolling timer. - * - * @param aPtr Pointer to an instance of CHgScroller class. - * - * @return System wide error code. - */ - static TInt KeyScrollingTimerCallback( TAny* aPtr ); - - /** - * Move view based on key scolling mode. - */ - void DoKeyScrolling(); - - /** - * Sets item highlight and stops the scrolling timer. - */ - void StopKeyScrolling(); - -protected: - CAknPhysics* iPhysics; // Physics engine. Own - CHgScrollBufferManager* iManager; // Own - CHgScrollbar* iScrollbar; // Scrollbar. Own - CHgIndicatorManager* iIndicatorManager; // Utility for drawing indicators. Own - CHgDrawUtils* iDrawUtils; // Drawing utility. Own - CHgTextFind* iTextFind; // Text find utility to communicate with FEP. Own - CAknLongTapDetector* iDetector; // Longtap detector for single click. Own - CAknItemActionMenu* iActionMenu; // Item action menu for single click. Not Own - - // Observers - MHgSelectionObserver* iSelectionObserver; // Not Own - MHgMarkingObserver* iMarkingObserver; // Not Own - - // Arrays - RPointerArray iItems; // Items - - // For dragging - TPoint iStart; // Drag start position - TTime iStartTime; // Drag start time - TPoint iPrev; // Previous pointer event position. - - // The Rest. - CGulIcon* iDefaultIcon; // Default item icon - - TPoint iViewPosition; // Current view position - - TBool iLandscapeScrolling; // Scrolling landscape? - - TInt iWidth; // The width of the view - TInt iHeight; // The height of the view - TInt iRowHeight; // Row height (square images) - TInt iItemCount; // Total number of items - TInt iItemsOnScreen; - - TInt iCurrentRow; // The number of the first row that is drawn - TInt iSelectedIndex; // The index of the selected item - - TInt iKeyRepeats; // How many key repeasts have been received - - TSize iImageSize; // Image Size - TSize iIndicatorSize; // Size of the indicator in list or grid - - enum TKeyScrollingState - { - ENoKeyScrolling = 0, - EKeyScrollingUp, - EKeyScrollingDown, - EKeyScrollingLeft, - EKeyScrollingRight - } iKeyScrollingState; // State of the key scrolling - - TInt iFlags; // Possible mode flags - - HBufC* iEmptyText; // text for empty list or grid. - - THgPopupDrawer* iPopupDrawer; - TBool iPanning; - TBool iShowHighlight; - - THgScrollBarType iScrollBarType; // Scrollbar type - - RBuf iUpperCaseTitle; // Used in search for uppercase conversion - RBuf iPopupText1; - RBuf iPopupText2; - - TBool iFirstTime; // Flag to indicating first time run. - TBool iPointerDown; - - CPeriodic* iHighlightTimer; // Higlight timer, own. - TBool iSelectionToFocusedItem; // Is focused item clicked - TInt iFocusedIndex; // highlight timer updates this value - - CHgKeyUtils* iKeyUtils; // MSK key handler, own - - TSelectionMode iSelectionMode; - - CPeriodic* iKeyScrollingTimer; // Timer for key scrolling, own. - }; - -#endif /*HGSCROLLER_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgScrollerWithTitle.h --- a/classicui_plat/ganes_api/inc/ganes/HgScrollerWithTitle.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +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 HGSCROLLERWITHTITLE_H_ -#define HGSCROLLERWITHTITLE_H_ - -// INCLUDES -#include -#include - -// FORWARD DECLARATIONS -class CGulIcon; -class CHgScroller; -class CHgListLayoutData; -class CHgItem; - -// CLASS DECLARATION - -/** - * Compound control that compounds a static title element - * and HgScroller. Scroller is owned by this control but it can be - * accessed freely. However, user of this class - * should not call InitScreenL for the scroller, because it is this classes - * responsibility to set correct size for the HgScroller. - */ -class CHgScrollerWithTitle : public CCoeControl - { -public: - - // Possible scroller types. Used to define the scroller type - // for this compound control - enum THgScrollerType - { - EHgScrollerDoubleGraphicList, - EHgScrollerDoubleTextList, - EHgScrollerSingleGraphicList, - EHgScrollerSingleLargeList, - EHgScrollerSingleTextList, - EHgScrollerGrid, - EHgScrollerSingleTextListWithIcon, - EHgScrollerDoubleGraphicListFlat - }; - - /** - * Creates new CHgScrollerWithTitle. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the grid - * @param aScrollerType Type of the scroller control. - * @param aDefaultIcon Default icon to be used. - * - * @return CHgScrollerWithTitle-object - */ - IMPORT_C static CHgScrollerWithTitle* NewL( const TRect& aRect, - TInt aItemCount, - THgScrollerType aScrollerType, - CGulIcon* aDefaultIcon = NULL ); - -public: // Destructor. - - virtual ~CHgScrollerWithTitle(); - -public: // CCoeControl - - void Draw(const TRect& aRect ) const; - void SizeChanged(); - TInt CountComponentControls() const; - CCoeControl* ComponentControl(TInt aIndex) const; - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - void FocusChanged(TDrawNow aDrawNow); - -public: // NEW FUNCTIONS - - /** - * Re-inits the grid display area. - * - * @param aRect New display rect - */ - IMPORT_C void InitScreenL( const TRect& aRect ); - - /* - * Get CHgScroller compound control. - * - * Notice, you shouldn't call - * InitScreenL for the CHgScroller, instead this classes InitScreenL should - * be used to set the size of this control. - * - * @return Compound control. - */ - IMPORT_C CHgScroller& Scroller(); - - /* - * Get the title element. - * - * @return Title item (CHgItem). - */ - IMPORT_C CHgItem& TitleItem(); - - /** - * Returns preferred image size that should be used when setting image to title. - */ - IMPORT_C static TSize PreferredImageSize(); - -protected: // Constructors - - CHgScrollerWithTitle( ); - - void ConstructL(const TRect& aRect, - TInt aItemCount, - THgScrollerType aScrollerType, - CGulIcon* aDefaultIcon ); - -protected: - CHgScroller* iScroller; // Compound control. Own - CHgListLayoutData* iLayoutData; // Layout data stroge. Own - CHgItem* iTitleItem; // Title element. Own - - TRgb iColor; // Text color - TRect iTitleRect; // Drawing rect for the title. - }; - -#endif /*HGSCROLLER_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgSelectionObserverIface.h --- a/classicui_plat/ganes_api/inc/ganes/HgSelectionObserverIface.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGSELECTIONOBSERVERIFACE_H_ -#define HGSELECTIONOBSERVERIFACE_H_ - -#include - -// FORWARD DECLARATIONS -class CCoeControl; - -/** - * Selection observer interface. - */ -class MHgSelectionObserver - { -public: - - /** - * Handle selection. - * - * @param aIndex Selected item index. - */ - virtual void HandleSelectL( TInt aIndex ) = 0; - - /** - * Handle opening. - * - * @param aIndex Opened item index. - */ - virtual void HandleOpenL( TInt aIndex ) = 0; - - - /** - * Handle selection from certain CCoeControl - * - * @param aIndex Selected item index. - * @param aControl CCoeontrol calling this method. - */ - virtual void HandleSelectL( TInt aIndex, CCoeControl* /*aControl*/ ) { HandleSelectL(aIndex); } - - /** - * Handle open from certain CCoeControl - * - * @param aIndex Opened item index. - * @param aControl CCoeontrol calling this method. - */ - virtual void HandleOpenL( TInt aIndex, CCoeControl* /*aControl*/ ) { HandleOpenL(aIndex); } - }; - -#endif // HGSELECTIONOBSERVERIFACE_H_ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgSingleGraphicList.h --- a/classicui_plat/ganes_api/inc/ganes/HgSingleGraphicList.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGSINGLEGRAPHICLIST_H_ -#define HGSINGLEGRAPHICLIST_H_ - -#include - -class CHgSingleGraphicList : public CHgList - { -public: - /** - * Creates new CHgSingleGraphicList. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the grid - * @param aDefaultIcon Default icon to be used. - * @param aSession Window server session for DSA. Default is NULL and DSA is disabled. - * - * @return CHgSingleGraphicList-object - */ - IMPORT_C static CHgSingleGraphicList* NewL( const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon = NULL, - RWsSession* aSession = NULL); - - /** - * Destructor. - */ - IMPORT_C virtual ~CHgSingleGraphicList( ); - -public: - - /** - * Returns preferred image size that should be used when passing images. - */ - IMPORT_C static TSize PreferredImageSize(); - -protected: // CHgScroller - void HandleSizeChanged(); - -protected: // CHgList - void DrawItem(TInt aIndex, const TRect& aRect) const; - -protected: - CHgSingleGraphicList( TInt aItemCount, - CGulIcon* aDefaultIcon ); - - }; - -#endif /*HGSINGLEGRAPHICLIST_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgSingleLargeList.h --- a/classicui_plat/ganes_api/inc/ganes/HgSingleLargeList.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGSINGLELARGELIST_H_ -#define HGSINGLELARGELIST_H_ - -#include - -class CHgSingleLargeList : public CHgList - { -public: - /** - * Creates new CHgSingleLargeList. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the grid - * @param aDefaultIcon Default icon to be used. - * @param aSession Window server session for DSA. Default is NULL and DSA is disabled. - * - * @return CHgSingleLargeList-object - */ - IMPORT_C static CHgSingleLargeList* NewL( const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon = NULL, - RWsSession* aSession = NULL); - - /** - * Destructor. - */ - IMPORT_C virtual ~CHgSingleLargeList( ); - -public: - - /** - * Returns preferred image size that should be used when passing images. - */ - IMPORT_C static TSize PreferredImageSize(); - -protected: // CHgScroller - void HandleSizeChanged(); - -protected: // CHgList - void DrawItem(TInt aIndex, const TRect& aRect) const; - -protected: - CHgSingleLargeList( TInt aItemCount, - CGulIcon* aDefaultIcon ); - - }; - -#endif /*HGSINGLELARGELIST_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgSingleTextList.h --- a/classicui_plat/ganes_api/inc/ganes/HgSingleTextList.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGSINGLETEXTLIST_H_ -#define HGSINGLETEXTLIST_H_ - -#include - -// Forward declarations -class CHgItem; - -class CHgSingleTextList : public CHgList - { -public: - /** - * Creates new CHgSingleTextList. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the grid - * @param aDefaultIcon Default icon to be used. - * @param aSession Window server session for DSA. Default is NULL and DSA is disabled. - * - * @return CHgSingleTextList-object - */ - IMPORT_C static CHgSingleTextList* NewL ( const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon = NULL, - RWsSession* aSession = NULL); - - /** - * Destructor. - */ - IMPORT_C virtual ~CHgSingleTextList( ); - -protected: // CHgScroller - - void HandleSizeChanged(); - -protected: // CHgList - - void DrawItem(TInt aIndex, const TRect& aRect) const; - -protected: - CHgSingleTextList( TInt aItemCount, - CGulIcon* aDefaultIcon ); - -private: // Data - - }; - -#endif /*HGSINGLETEXTLIST_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgSingleTextListWithIcon.h --- a/classicui_plat/ganes_api/inc/ganes/HgSingleTextListWithIcon.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGSINGLETEXTLISTWITHICON_H_ -#define HGSINGLETEXTLISTWITHICON_H_ - -#include - -// Forward declarations -//class CHgItem; - -class CHgSingleTextListWithIcon : public CHgSingleTextList - { -public: - /** - * Creates new CHgSingleTextList. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the grid - * @param aDefaultIcon Default icon to be used. - * @param aSession Window server session for DSA. Default is NULL and DSA is disabled. - * - * @return CHgSingleTextList-object - */ - IMPORT_C static CHgSingleTextListWithIcon* NewL ( const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon = NULL, - RWsSession* aSession = NULL); - - /** - * Destructor. - */ - IMPORT_C virtual ~CHgSingleTextListWithIcon( ); - -protected: // CHgScroller - - void HandleSizeChanged(); - -protected: // CHgList - - void DrawItem(TInt aIndex, const TRect& aRect) const; - - void ConstructL( const TRect& aRect, RWsSession* aSession ); - -protected: - CHgSingleTextListWithIcon( TInt aItemCount, - CGulIcon* aDefaultIcon ); - -private: // Data - CHgListLayoutData* iGraphicLayoutData; - - }; - -#endif /*HGSINGLETEXTLISTWITHICON_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgVgItem.h --- a/classicui_plat/ganes_api/inc/ganes/HgVgItem.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGITEM_H_ -#define HGVGITEM_H_ - -// INCLUDES -#include // base class -#include - -// FORWARD DECLARATIONS -class CGulIcon; - -// CLASS DECLARATION -class CHgVgItem : public CHgItem - { -public: - - /** - * Creates new CHgVgItem. - * - * @param aFlags Item flags. Default is EHgItemFlagsNone - * @param aIcon Item Icon. Ownership transferred. - * @param aTitle Title text. - * @param aText Additional Text. - * - * @return CHgVgItem-object - */ - IMPORT_C static CHgVgItem* NewL(TInt aFlags = EHgItemFlagsNone, - CGulIcon* aIcon = 0, - const TDesC& aTitle = KNullDesC, - const TDesC& aText = KNullDesC ); - - /** - * @copydoc CHgVgItem::NewL - */ - IMPORT_C static CHgVgItem* NewLC(TInt aFlags = EHgItemFlagsNone, - CGulIcon* aIcon = 0, - const TDesC& aTitle = KNullDesC, - const TDesC& aText = KNullDesC); - - IMPORT_C virtual ~CHgVgItem(); - -public: // CHgItem - - IMPORT_C void SetIcon( CGulIcon* aIcon, TInt aFlags = EHgItemFlagsNone ); - -public: // METHODS - - /** - * Gets OpenVG Image. - * - * @return VGImage-object - */ - VGImage VgImage() const; - - /** - * Reloads openvg image resource. - * This is used by media wall to allocate resources on demand and should - * not be used externally. - */ - void ReloadOpenVgImage(); - - /** - * Frees openvg image resource. - * This is used by media wall to free resources on demand and should - * not be used externally. - */ - void FreeOpenVgImage(); - -protected: - - CHgVgItem(TInt aFlags, CGulIcon* aIcon); - - void ConstructL( const TDesC& aTitle, const TDesC& aText ); - -private: - - VGImage iVgImage; // VGImage of this item, owns. - }; - -#endif /* HGVGHELPER */ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgVgMediaWall.h --- a/classicui_plat/ganes_api/inc/ganes/HgVgMediaWall.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,781 +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 HGVGMEDIAWALL_H_ -#define HGVGMEDIAWALL_H_ - -// INCLUDES -#include -#include -#include -#include -#include -#include -#include - -// FORWARD DECLARATIONS -class MHgScrollBufferObserver; -class MHgSelectionObserver; -class CHgVgItem; -class CGulIcon; -class CHgScrollBufferManager; -class CHgVgScrollBar; -class CHgVgMediaWallRenderer; -class CHgVgSkinRenderer; -class CHgVgTimer; -class CHgVgPopup; -class CHgVgButton; -class MHgVgMediaWallObserver; -class CHgVgLabel; -class CHgVgEGL; -class THgVgSpring; -class CAlfCompositionSource; -class CFbsBitmap; - -// CLASS DECLARATION -class CHgVgMediaWall : - public CCoeControl, - public MHgBufferOwner, - public MHgScrollbarObserver, - public MCoeForegroundObserver, - public AknTouchGestureFw::MAknTouchGestureFwObserver - { -public: - - /** - * Style of the media wall to use. - */ - enum THgVgMediaWallStyle - { - EHgVgMediaWallStyleCoverflowFullScreen, - EHgVgMediaWallStyleCoverflowTBonePortrait, - EHgVgMediaWallStyleCoverflowTBoneLandscape, - EHgVgMediaWallStyleGrid, - EHgVgMediaWallStyleUnknown - }; - - /** - * Media walls current animation state. - */ - enum THgVgAnimationState - { - EHgVgMediaWallAnimationStateIdle, - EHgVgMediaWallAnimationStateTransition, - EHgVgMediaWallAnimationStateFastTransition, - EHgVgMediaWallAnimationStateOpening, - EHgVgMediaWallAnimationStateClosing, - EHgVgMediaWallAnimationStateItemOpened - }; - - /** - * Media walls selection animation type. - * Default behaviour is EHgSelectionAnimationFlipToFront. - */ - enum THgVgOpeningAnimationType - { - EHgVgOpeningAnimationNone, // no animation takes place when item is tapped - EHgVgOpeningAnimationFlipToFront, // flips the opened item by flip angle and fits to set opened item rect. - EHgVgOpeningAnimationZoomToFront, // zooms the opened item to set opened item rect. - EHgVgOpeningAnimationZoomIn // zooms the item to the back of the camera. - }; - - /** - * Event types, CHgVgMediaWall may send through MHgVgMediaWallObserver interface. - */ - enum THgVgMediaWallEvent - { - EHgVgMediaWallEventRequestHideSoftkeys, - EHgVgMediaWallEventRequestShowSoftkeys - }; - - /** - * Flags that define possible mediawall modes - */ - enum THgVgMediaWallMode - { - EHgVgMediaWallDrawToWindowGC = 0x0001 - }; - -public: - - /** - * Creates new HgVgMediaWall. - * - * @param aRect Rect that the control draws onto. - * @param aItemCount Total count of items in the mediawall. - * @param aStyle style of the mediawall. - * @param aEnableScrollBar ETrue to enable scrollbar. - * @param aDefaultIcon Default icon to be used. - * - * @return HgVGMediaWall-object - */ - IMPORT_C static CHgVgMediaWall* NewL ( const TRect& aRect, - TInt aItemCount, - THgVgMediaWallStyle aStyle, - TBool aEnableScrollBar, - MObjectProvider* aParent, - CGulIcon* aDefaultIcon = NULL); - - // Destructor. - IMPORT_C virtual ~CHgVgMediaWall(); - -public: // CCoeControl - - void Draw(const TRect& aRect ) const; - void SizeChanged(); - void HandlePointerEventL( const TPointerEvent& aEvent ); - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - void FocusChanged(TDrawNow aDrawNow); - void HandleResourceChange(TInt aType); - -private: // MHgBufferOwner - void Release(TInt aReleaseStart, TInt aReleaseEnd); - -private: // MHgScrollbarObserver - - void ScrollBarPositionChanged( const TPoint& aNewPosition ); - - void HandleNaviStripChar( const TChar& aChar ); - -public: //MCoeForegroundObserver - void HandleGainingForeground(); - void HandleLosingForeground(); - -private: // MAknTouchGestureFwObserver - - void HandleTouchGestureL( AknTouchGestureFw::MAknTouchGestureFwEvent& aEvent ); - -public: // NEW FUNCTIONS - /** - * Re-inits rendering for new window rectangle. - * - * @param aRect New display rect - */ - IMPORT_C void InitScreenL( const TRect& aRect ); - - /** - * Refreshes screen. - */ - IMPORT_C void RefreshScreen( TInt aIndex ); - - /** - * Gives the first index on the screen. - * - * Note: The index is not guaranteed to be in the range of the scroller items. - * Index can be negative if the scroller is scrolled to the way up or - * over the count - 1 if scrolled way down. - * - * @return The index of the first item on the screen. - */ - IMPORT_C TInt FirstIndexOnScreen(); - - /** - * How many items fit on one screen. - * @return Item count. - */ - IMPORT_C TInt ItemsOnScreen(); - - /** - * Get item at specified index. - * - * @param aIndex Index of the item that is returned - * @return Reference to item. - */ - IMPORT_C CHgVgItem& ItemL( TInt aIndex ); - - /** - * Resets item at the index position. Old item is deleted. - * - * @param aItem New item. Ownership transferred. - * @param aIndex The index of the item. - */ - IMPORT_C void SetItem(CHgVgItem* aItem, TInt aIndex); - - /** - * Adds Item. - * - * @param aItem New item. Ownership transferred. - */ - IMPORT_C void AddItem(CHgVgItem* aItem); - - /** - * Inserts item at index postion. - * - * @param aItem New item. Ownership transferred. - * @param aIndex The index of the item. - */ - IMPORT_C void InsertItem(CHgVgItem* aItem, TInt aIndex); - - /** - * Removes item at index position. Removed item is deleted. - * - * @param aIndex The index of the item. - */ - IMPORT_C void RemoveItem(TInt aIndex); - - /** - * Returns index of currently selected item in MediaWall. - * In the case of EHgVgMediaWallStyleStyleGrid this method can only - * return indices of the items at top row. The index of the item picked - * by user is on grids case only passed through MHgSelectionObserver interface. - * - * @return Selected index (KErrNotFound if nothing is selected) - */ - IMPORT_C TInt SelectedIndex(); - - /** - * Sets selected index. Positions the mediwall into this index. - * In case of a grid. The mediawall is positioned into row = aIndex / RowCount. - * @param aIndex new selected index. Selection is also made visible. - */ - IMPORT_C void SetSelectedIndex( TInt aIndex ); - - /** - * Enables Buffering. - * @param aObserver Buffer change observer. - * @param aBufferSize The size of the buffer. - * @param aBufferTreshold The minimum change needed for buffer to be modified. - */ - IMPORT_C void EnableScrollBufferL( MHgScrollBufferObserver& aObserver, - TInt aBufferSize, - TInt aBufferTreshold ); - - /** - * Sets selection observer. - * @param aObserver Selection observer. - */ - IMPORT_C void SetSelectionObserver( MHgSelectionObserver& aObserver ); - - /** - * Removes all items and presents empty text - * */ - IMPORT_C void Reset(); - - /** - * Resizes Grid/List. - * @param aItemCount New Count of items. - */ - IMPORT_C void ResizeL( TInt aItemCount ); - - /** - * Set text that is displayed when there are no items in the view. - * @param aEmptyText Empty text. - */ - IMPORT_C void SetEmptyTextL( const TDesC& aEmptyText ); - - /** - * Fetch item count. - * @return Total number of items. - */ - IMPORT_C TInt ItemCount() const; - - /** - * Sets new default icon. - * @param aDefaultIcon New default icon to be used in scroller. - */ - IMPORT_C void SetDefaultIconL( CGulIcon* aDefaultIcon ); - - /** - * Disables Scrollbuffer. - */ - IMPORT_C void DisableScrollBuffer(); - - /** - * Changes mediawalls style. - * - * @param aStyle style. - * @param aRect new window rectangle. - * @param aReuseSurface flag to indicate whether or not OpenVG surface should be reconstructed. - */ - IMPORT_C void ChangeStyleL( THgVgMediaWallStyle aStyle, const TRect& aRect, TBool aReuseSurface ); - - /** - * Sets button observer. Client can use this to register it self to be - * notified when the user for example, presses hide softkeys button. - * - * @param aObserver observer. - */ - IMPORT_C void SetObserver(MHgVgMediaWallObserver* aObserver); - - /** - * Sets type of selection animation to perform, when an item - * is opened. - * Default behaviour is EHgSelectionAnimationFlipToFront. - * - * @param aType type of opening animation. - */ - IMPORT_C void SetOpeningAnimationType(THgVgOpeningAnimationType aType); - - /** - * Gets current MediaWall style. - * - * @return THgVgMediaWallStyle. - */ - IMPORT_C THgVgMediaWallStyle Style() const; - - /** - * Gets current opening animation type - * - * @return THgVgOpeningAnimationType. - */ - IMPORT_C THgVgOpeningAnimationType OpeningAnimationType() const; - - /** - * Starts opening animation to selected direction. After animation is complete, - * Open event is sent to selection observer. - * - * @param aOpening if this is true, the selected item is opened, otherwise closed. - */ - IMPORT_C void StartOpeningAnimationL(TBool aOpening); - - /** - * Set mode flags. Possible values are defined in THgVgMediaWallMode. - * @param aFlags flags to bet set. - */ - IMPORT_C void SetFlags( TInt aFlags ); - - /** - * Clear mode flags. Possible values are defined in THgVgMediaWallMode. - * @param aFlags flags to be cleared. - */ - IMPORT_C void ClearFlags( TInt aFlags ); - - /** - * Get flags. Possible values are defined in THgVgMediaWallMode. - * @return Current flags. - */ - IMPORT_C TInt Flags(); - - /** - * Sets item at index as selected and opened item. HandleOpenL not called for observers. - * If index is out of range, does nothing. Using this function sets item at index - * to the state where it is when it was selected and opened by the user. - * One can use for example. StartOpeningAnimationL to togle animation backwards from - * this state to normal. This can be useful for example. when returning from a - * a different view and there is a need to pop the item back to the wall from front. - * - * @param aIndex of the item to open. - */ - IMPORT_C void SetItemToOpenedState(TInt aIndex); - - /** - * Sets the rectangle where item fit at the end of opening animation. - * - * @param aRect target rectangle where opened item is fitted at the end of opening animation. - */ - IMPORT_C void SetOpenedItemRect(const TRect& aRect); - -protected: // Constructors - - CHgVgMediaWall( TInt aItemCount, - CGulIcon* aDefaultIcon, THgVgMediaWallStyle aStyle, - TBool aEnableScrollBar ); - - void ConstructL (const TRect& aRect, MObjectProvider* aParent ); - -private: - - /** - * Handles viewposition change. - */ - void HandleViewPositionChanged(TBool aDontUpdateObserver=EFalse); - - /** - * Initializes items. - */ - void InitItemsL(); - - - /** - * - */ - void HandleKeyDown(); - - /** - * Handles key events. - * - * @param aKeyEvent TKeyEvent-object. - */ - TKeyResponse HandleKeyEvent(const TKeyEvent& aKeyEvent); - - /** - * - */ - void HandleKeyUp(); - - /** - * - */ - void StopKeyScrolling(); - - /** - * - */ - void DoKeyScrolling(); - - /** - * - */ - static TInt KeyScrollingTimerCallback( TAny* aPtr ); - - /** - * Handles items count change. - */ - void HandleItemCountChanged(); - - /** - * Initializes default icon and - * creates VGImage for it. - */ - void InitDefaultIconL(); - - /** - * Draws using OpenVG - */ - void DrawOpenVG() const; - - /** - * Called by callback to do actual animation. - */ - void DoAnimation(); - - /** - * Does transition animation, called by DoAnimation. - */ - void DoTransitionAnimation(); - - /** - * Does selection animation - */ - void DoSelectionAnimation(); - - /** - * Callback method for animation - * - * @param aPtr Pointer to an instance of CHgVgMediaWall class. - * - * @return System wide error code. - */ - static TInt AnimationTimerCallback( TAny* aPtr ); - - /** - * Updates bitmaps used to render album and artist titles. - */ - void UpdateLabelsAndPopup(); - - /** - * Draws album and artist titles. - */ - void DrawTitles(TReal aAlpha); - - - /** - * Initializes scroll bar. - */ - void InitScrollBarL(TBool aResize); - - /** - * Initializes skin rendering. - */ - void InitSkinRendererL(); - - /** - * Initializes whole rendering functionality. - */ - void InitRenderingL(TBool aRecreateSurface); - - /** - * Frees videomemory used by items. - */ - void FreeItemsImages(); - - /** - * Reloads images to items. - */ - void ReloadItemsImages(); - - /** - * - */ - void HandleTapEventL(const TPoint& aPosition); - - /** - * - */ - void HandleFlick(const TPoint& aSpeed); - - /** - * - */ - void HandleDragging(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); - - /** - * - */ - TInt GetStepsFromSpeed(TInt aSpeed) const; - - /** - * - */ - void StartAnimationTimer(); - - /** - * - */ - TReal GetAsPercentageOfScreenWidth(TInt aPixels) const; - - /** - * - */ - TReal GetAsPercentageOfScreenHeight(TInt aPixels) const; - - /** - * - */ - void DrawScene(); - - /** - * - */ - void HandleDragStart(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); - - /** - * - */ - void HandleDragOn(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); - - /** - * - */ - void HandleDragStop(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent); - - /** - * - */ - void HandleTransitionAnimationStop(); - - /** - * - */ - void DrawLetterStripAndTitles(); - - /** - * - */ - void DrawButtonsAndScrollbar(); - - /** - * - */ - void InitButtonsL(); - - /** - * - */ - CGulIcon* CreateIconL(TInt aId1, TInt aId2, const TSize& aSize); - - /** - * - */ - TBool HandleButtons(const TPointerEvent& aEvent); - - /** - * - */ - TInt MaxViewPosition() const; - - - /** - * - */ - TBool BeginSelection(TInt aIndex); - - /** - * - */ - void EndSelection(); - - /** - * - */ - void DoStartOpeningAnimationL(); - - /** - * - */ - void StartAnimationToPosition(TReal aX, TBool aUpdateScrollBar); - - /** - * - */ - void StartAnimationToPosition(TReal aX, TReal aY, TBool aUpdateScrollBar); - - /** - * - */ - CFbsBitmap* DrawToBitmap(); - - /** - * - */ - void DestroyRendering(); - - /** - * - */ - TBool DrawAll(); - - /** - * - */ - void InitMediaWallFullScreenLandscapeL(); - - /** - * - */ - void InitMediaWallTBonePortraitL(); - - /** - * - */ - void InitMediaWallGridLandscapeL(); - - /** - * - */ - void InitLabelsL(TInt aLayoutVariant); - - /** - * - */ - void InitPopupL(TInt aLayoutVariant); - -protected: - CHgScrollBufferManager* iManager; // Own - - HBufC* iEmptyText; // text for empty list or grid. - - // Observers - MHgSelectionObserver* iSelectionObserver; // Not Own - - // Arrays - RPointerArray iItems; // Items - - // For dragging - TTime iPrevTime; // Previous pointer position time. - - TInt iItemCount; // Total number of items - - TInt iItemsOnScreen; // Max items on screen. - - TInt iSelectedIndex; // The index of the selected item - - CGulIcon* iDefaultIcon; // Default item icon, owns - - THgVgAnimationState iAnimationState; // current animation state - TInt64 iAnimationDuration; // total length of the animation - TTime iAnimationStartTime; // starting time of the animation - TReal iAnimationAlpha; // value going from 0-1 during animation - CHgVgTimer* iAnimationTimer; - - TBool iScrollBarEnabled; - CHgVgScrollBar* iScrollBar; // Scrollbar, owns - TBool iScrollBarHit; - TBool iUpdateScrollBar; - - CHgVgMediaWallRenderer* iRenderer; // Renderer for current media wall style, owns - - CHgVgSkinRenderer* iSkinRenderer; // Renderer for drawing skin, owns. - - THgVgMediaWallStyle iMediaWallStyle; // Style of mediawall. - - //TTime iKeyPressStartTime; - - AknTouchGestureFw::CAknTouchGestureFw* iTouchFw; // touch gesture fw, own. - - TReal iViewPositionAtDragStart; - - CHgVgPopup* iLetterPopup; // letter popup show when using scrollbar, own. - - CHgVgButton* iHideSKButton; // button for hiding softkeys, own. - - MHgVgMediaWallObserver* iMediaWallObserver; - - TRect iRect; - - THgVgOpeningAnimationType iOpeningAnimationType; - - TInt iPreviousPointerDelta; - - TBool iIsForeground; - TBool iUsingDefaultIcon; - - TBool iButtonsHit; - - TBool iPointerDown; - - CHgVgLabel* iArtistLabel; // label for artist text, own. - CHgVgLabel* iAlbumLabel; // label for album text, own. - CHgVgLabel* iEmptyLabel; // label for empty text, own. - - enum TKeyScrollingState - { - ENoKeyScrolling = 0, - EKeyScrollingUp, - EKeyScrollingDown, - EKeyScrollingLeft, - EKeyScrollingRight - } iKeyScrollingState; // State of the key scrolling - - TInt iKeyRepeats; - CPeriodic* iKeyScrollingTimer; // Timer for key scrolling, own. - - CHgVgEGL* iEGL; // encapsulated egl stuff, own. - - TInt iRowCount; // number of rows in grid style - - TReal iCameraRotationFactor; // max amount of camera rotation in radians - TReal iCameraZoomFactor; // max amount of zoom out - TReal iSpringVelocityToAnimationFactor; // factor used to convert spring velocity to animation alpha - - RBuf iPopupText1; // text1 shown in popup - RBuf iPopupText2; // text2 shown in popup - - TBool iSelectionMode; // used to indicate when user is selectin items in grid style - - THgVgSpring* iSpring; // spring physics simulator, own. - - TInt iBufferPosition; - - CHgVgItem* iTempItem; - - TInt iPickedGridItem; // item picked from grid - - TInt iPrevGridItem; // prev item selected from grid - TInt iSelGridItem; // selected it from grid - - TReal iItemsToMoveOnFullScreenDrag; - - TInt iFlags; - - CAlfCompositionSource* iCompositionSource; - - CFbsBitmap* iSurfaceBitmap; - }; - - -#endif /*HGVGMEDIAWALL_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/inc/ganes/HgVgMediaWallObserverIface.h --- a/classicui_plat/ganes_api/inc/ganes/HgVgMediaWallObserverIface.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGMEDIAWALLBUTTONOBSERVER_H_ -#define HGVGMEDIAWALLBUTTONOBSERVER_H_ - -// FORWARD DECLARATIONS -class CHgVgMediaWall; - -/** - * MediaWall observer interface. - */ -class MHgVgMediaWallObserver - { -public: - /** - * Called by CHgVgMediaWall, when event handling from client is needed. - * - * @param aEvent events type. @see CHgVgMediaWall::THgVgMediaWallEvent. - * @param aSender MediaWall sending this event. - */ - virtual void HandleMediaWallEvent(TInt aEvent, CHgVgMediaWall* aSender)=0; - }; - -#endif /* HGVGMEDIAWALLBUTTONOBSERVER_H */ diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/bwins/testplatganeu.def --- a/classicui_plat/ganes_api/tsrc/bwins/testplatganeu.def Thu Jul 29 14:21:56 2010 +0800 +++ /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 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgdoublegraphiclist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgdoublegraphiclist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -[Test] -title TestCHgDoubleGraphicListL -run testscripter c:\testframework\ui_TestPlatGanehgdoublegraphiclist.cfg 1 -[Endtest] - -[Test] -title TestCHgDoubleGraphicListPreferredImageSizeL -run testscripter c:\testframework\ui_TestPlatGanehgdoublegraphiclist.cfg 2 -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgdoublegraphiclistflat.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgdoublegraphiclistflat.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -[Test] -title TestCHgDoubleGraphicListFlatL -run testscripter c:\testframework\ui_TestPlatGanehgdoublegraphiclistflat.cfg 1 -[Endtest] - -[Test] -title TestCHgDoubleGraphicListFlatPreferredImageSizeL -run testscripter c:\testframework\ui_TestPlatGanehgdoublegraphiclistflat.cfg 2 -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgdoubletextlist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgdoubletextlist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -[Test] -title TestCHgDoubleTextListL -run testscripter c:\testframework\ui_TestPlatGanehgdoubletextlist.cfg 1 -[Endtest] - -[Test] -title TestCHgDoubleTextListPreferredImageSizeL -run testscripter c:\testframework\ui_TestPlatGanehgdoubletextlist.cfg 2 -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehggrid.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehggrid.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -[Test] -title TestCHgGridNewL -run testscripter c:\testframework\ui_TestPlatGanehggrid.cfg 1 -[Endtest] - -[Test] -title TestCHgGridPreferredImageSizeL -run testscripter c:\testframework\ui_TestPlatGanehggrid.cfg 2 -[Endtest] - -[Test] -title TestCHgGridSetLandscapeScrollingSupport -run testscripter c:\testframework\ui_TestPlatGanehggrid.cfg 3 -[Endtest] - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgitem.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgitem.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -[Test] -title TestCHgItemNewL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 1 -[Endtest] - -[Test] -title TestCHgItemNewLCL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 2 -[Endtest] - -[Test] -title TestCHgItemIconL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 3 -[Endtest] - -[Test] -title TestCHgItemTitleL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 4 -[Endtest] - -[Test] -title TestCHgItemTextL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 5 -[Endtest] - -[Test] -title TestCHgItemTimeL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 6 -[Endtest] - -[Test] -title TestCHgItemSetIconL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 7 -[Endtest] - -[Test] -title TestCHgItemSetTitleL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 8 -[Endtest] - -[Test] -title TestCHgItemSetTextL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 9 -[Endtest] - -[Test] -title TestCHgItemSetTimeL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 10 -[Endtest] - -[Test] -title TestCHgItemFlagsL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 11 -[Endtest] - -[Test] -title TestCHgItemSetFlagsL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 12 -[Endtest] - -[Test] -title TestCHgItemClearFlagsL -run testscripter c:\testframework\ui_TestPlatGanehgitem.cfg 13 -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgscroller.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgscroller.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -[Test] -title TestCHgScrollerInitScreenL1L -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 1 -[Endtest] - -[Test] -title TestCHgScrollerInitScreenL2L -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 2 -[Endtest] - -[Test] -title TestCHgScrollerRefreshScreenL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 3 -[Endtest] - -[Test] -title TestCHgScrollerFirstIndexOnScreenL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 4 -[Endtest] - -[Test] -title TestCHgScrollerItemsOnScreenL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 5 -[Endtest] - -[Test] -title TestCHgScrollerItemL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 6 -[Endtest] - -[Test] -title TestCHgScrollerSetItemL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 7 -[Endtest] - -[Test] -title TestCHgScrollerAddItemL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 8 -[Endtest] - -[Test] -title TestCHgScrollerInsertItemL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 9 -[Endtest] - -[Test] -title TestCHgScrollerRemoveItemL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 10 -[Endtest] - -[Test] -title TestCHgScrollerSelectedIndexL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 11 -[Endtest] - -[Test] -title TestCHgScrollerSetSelectedIndexL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 12 -[Endtest] - -[Test] -title TestCHgScrollerMarkL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 13 -[Endtest] - -[Test] -title TestCHgScrollerUnMarkL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 14 -[Endtest] - -[Test] -title TestCHgScrollerMarkAllL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 15 -[Endtest] - -[Test] -title TestCHgScrollerUnMarkAllL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 16 -[Endtest] - -[Test] -title TestCHgScrollerGetMarkedItemsL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 17 -[Endtest] - -[Test] -title TestCHgScrollerResetL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 18 -[Endtest] - -[Test] -title TestCHgScrollerResizeL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 19 -[Endtest] - -[Test] -title TestCHgScrollerSetEmptyTextL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 20 -[Endtest] - -[Test] -title TestCHgScrollerItemCountL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 21 -[Endtest] - -[Test] -title TestCHgScrollerSetScrollBarTypeL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 22 -[Endtest] - -[Test] -title TestCHgScrollerSetFlagsL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 23 -[Endtest] - -[Test] -title TestCHgScrollerClearFlagsL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 24 -[Endtest] - -[Test] -title TestCHgScrollerFlagsL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 25 -[Endtest] - -[Test] -title TestCHgScrollerHightlightItemL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 26 -[Endtest] - -[Test] -title TestCHgScrollerSetDefaultIconL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 27 -[Endtest] - -[Test] -title TestCHgScrollerDisableScrollBufferL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 28 -[Endtest] - -[Test] -title TestCHgScrollerEnableScrollBufferL -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 29 -[Endtest] - -[Test] -title TestCHgScrollerSetSelectionObserver -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 30 -[Endtest] - -[Test] -title TestCHgScrollerSetMarkingObserver -run testscripter c:\testframework\ui_TestPlatGanehgscroller.cfg 31 -[Endtest] - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgscrollerwithtitle.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgscrollerwithtitle.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -[Test] -title TestCHgScrollerWithTitleNewL -run testscripter c:\testframework\ui_TestPlatGanehgscrollerwithtitle.cfg 1 -[Endtest] - -[Test] -title TestCHgScrollerWithTitleInitScreenL -run testscripter c:\testframework\ui_TestPlatGanehgscrollerwithtitle.cfg 2 -[Endtest] - -[Test] -title TestCHgScrollerWithTitleScrollerL -run testscripter c:\testframework\ui_TestPlatGanehgscrollerwithtitle.cfg 3 -[Endtest] - -[Test] -title TestCHgScrollerWithTitleTitleItemL -run testscripter c:\testframework\ui_TestPlatGanehgscrollerwithtitle.cfg 4 -[Endtest] - -[Test] -title TestCHgScrollerWithTitlePreferredImageSizeL -run testscripter c:\testframework\ui_TestPlatGanehgscrollerwithtitle.cfg 5 -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgsinglegraphiclist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgsinglegraphiclist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -[Test] -title TestCHgSingleGraphicListNewL -run testscripter c:\testframework\ui_TestPlatGanehgsinglegraphiclist.cfg 1 -[Endtest] - -[Test] -title TestCHgSingleGraphicListPreferredImageSizeL -run testscripter c:\testframework\ui_TestPlatGanehgsinglegraphiclist.cfg 2 -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgsinglelargelist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgsinglelargelist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -[Test] -title TestCHgSingleLargeListNewL -run testscripter c:\testframework\ui_TestPlatGanehgsinglelargelist.cfg 1 -[Endtest] - -[Test] -title TestCHgSingleLargeListPreferredImageSizeL -run testscripter c:\testframework\ui_TestPlatGanehgsinglelargelist.cfg 2 -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgsingletextlist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgsingletextlist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -[Test] -title TestCHgSingleTextListL -run testscripter c:\testframework\ui_TestPlatGanehgsingletextlist.cfg 1 -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgsingletextlistwithicon.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgsingletextlistwithicon.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -[Test] -title TestCHgSingleTextListWithIconNewL -run testscripter c:\testframework\ui_TestPlatGaneHgSingleTextListWithIcon.cfg 1 -[Endtest] - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgvgitem.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgvgitem.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -[Test] -title TestCHgVgItemNewL -run testscripter c:\testframework\ui_TestPlatGanehgvgitem.cfg 1 -[Endtest] - -[Test] -title TestCHgVgItemNewLC -run testscripter c:\testframework\ui_TestPlatGanehgvgitem.cfg 2 -[Endtest] - -[Test] -title TestCHgVgItemSetIcon -run testscripter c:\testframework\ui_TestPlatGanehgvgitem.cfg 3 -[Endtest] \ No newline at end of file diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/tctestplatganehgvgmediawall.cfg --- a/classicui_plat/ganes_api/tsrc/conf/tctestplatganehgvgmediawall.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -[Test] -title TestCHgVgMediaWallNewL -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 1 -[Endtest] - -[Test] -title TestCHgVgMediaWallInitScreenL -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 2 -[Endtest] - -[Test] -title TestCHgVgMediaWallRefreshScreen -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 3 -[Endtest] - -[Test] -title TestCHgVgMediaWallFirstIndexOnScreen -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 4 -[Endtest] - -[Test] -title TestCHgVgMediaWallItemsOnScreen -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 5 -[Endtest] - -[Test] -title TestCHgVgMediaWallItemL -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 6 -[Endtest] - -[Test] -title TestCHgVgMediaWallSetItem -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 7 -[Endtest] - -[Test] -title TestCHgVgMediaWallAddItem -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 8 -[Endtest] - -[Test] -title TestCHgVgMediaWallInsertItem -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 9 -[Endtest] - -[Test] -title TestCHgVgMediaWallRemoveItem -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 10 -[Endtest] - -[Test] -title TestCHgVgMediaWallSelectedIndex -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 11 -[Endtest] - -[Test] -title TestCHgVgMediaWallSetSelectedIndex -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 12 -[Endtest] - -[Test] -title TestCHgVgMediaWallEnableScrollBufferL -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 13 -[Endtest] - -[Test] -title TestCHgVgMediaWallSetSelectionObserver -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 14 -[Endtest] - -[Test] -title TestCHgVgMediaWallReset -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 15 -[Endtest] - -[Test] -title TestCHgVgMediaWallResizeL -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 16 -[Endtest] - -[Test] -title TestCHgVgMediaWallSetEmptyTextL -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 17 -[Endtest] - -[Test] -title TestCHgVgMediaWallItemCount -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 18 -[Endtest] - -[Test] -title TestCHgVgMediaWallSetDefaultIconL -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 19 -[Endtest] - -[Test] -title TestCHgVgMediaWallDisableScrollBuffer -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 20 -[Endtest] - -[Test] -title TestCHgVgMediaWallChangeStyleL -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 21 -[Endtest] - -[Test] -title TestCHgVgMediaWallSetObserver -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 22 -[Endtest] - -[Test] -title TestCHgVgMediaWallSetOpeningAnimationType -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 23 -[Endtest] - -[Test] -title TestCHgVgMediaWallStyle -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 24 -[Endtest] - -[Test] -title TestCHgVgMediaWallOpeningAnimationType -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 25 -[Endtest] - -[Test] -title TestCHgVgMediaWallStartOpeningAnimationL -run testscripter c:\testframework\ui_TestPlatGaneHgVgMediaWall.cfg 26 -[Endtest] - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgdoublegraphiclist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgdoublegraphiclist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -//testhgdoublegraphiclist.h - -[Test] -title TestCHgDoubleGraphicListL#1 -create TestPlatGane test -test TestCHgDoubleGraphicListL -delete test -[Endtest] - -[Test] -title TestCHgDoubleGraphicListPreferredImageSizeL#2 -create TestPlatGane test -test TestCHgDoubleGraphicListPreferredImageSizeL -delete test -[Endtest] diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgdoublegraphiclistflat.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgdoublegraphiclistflat.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -//testhgdoublegraphiclist.h - -[Test] -title TestCHgDoubleGraphicListFlatL#1 -create TestPlatGane test -test TestCHgDoubleGraphicListFlatL -delete test -[Endtest] - -[Test] -title TestCHgDoubleGraphicListFlatPreferredImageSizeL#2 -create TestPlatGane test -test TestCHgDoubleGraphicListFlatPreferredImageSizeL -delete test -[Endtest] diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgdoubletextlist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgdoubletextlist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -//testhgdoubletextlist.h - -[Test] -title TestCHgDoubleTextListL#1 -create TestPlatGane test -test TestCHgDoubleTextListL -delete test -[Endtest] - -[Test] -title TestCHgDoubleTextListPreferredImageSize#2 -create TestPlatGane test -test TestCHgDoubleTextListPreferredImageSize -delete test -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehggrid.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehggrid.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -//testhggrid.h - -[Test] -title TestCHgGridNewL#1 -create TestPlatGane test -test TestCHgGridNewL -delete test -[Endtest] - -[Test] -title TestCHgGridPreferredImageSizeL#2 -create TestPlatGane test -test TestCHgGridPreferredImageSizeL -delete test -[Endtest] - -[Test] -title TestCHgGridSetLandscapeScrollingSupport#3 -create TestPlatGane test -test TestCHgGridSetLandscapeScrollingSupport -delete test -[Endtest] - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgitem.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgitem.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ -//testhgitem.h - -[Test] -title TestCHgItemNewL#1 -create TestPlatGane test -test TestCHgItemNewL -delete test -[Endtest] - -[Test] -title TestCHgItemNewLCL#2 -create TestPlatGane test -test TestCHgItemNewLCL -delete test -[Endtest] - -[Test] -title TestCHgItemIconL#3 -create TestPlatGane test -test TestCHgItemIconL -delete test -[Endtest] - -[Test] -title TestCHgItemTitleL#4 -create TestPlatGane test -test TestCHgItemTitleL -delete test -[Endtest] - -[Test] -title TestCHgItemTextL#5 -create TestPlatGane test -test TestCHgItemTextL -delete test -[Endtest] - -[Test] -title TestCHgItemTimeL#6 -create TestPlatGane test -test TestCHgItemTimeL -delete test -[Endtest] - -[Test] -title TestCHgItemSetIconL#7 -create TestPlatGane test -test TestCHgItemSetIconL -delete test -[Endtest] - -[Test] -title TestCHgItemSetTitleL#8 -create TestPlatGane test -test TestCHgItemSetTitleL -delete test -[Endtest] - -[Test] -title TestCHgItemSetTextL#9 -create TestPlatGane test -test TestCHgItemSetTextL -delete test -[Endtest] - -[Test] -title TestCHgItemSetTimeL#10 -create TestPlatGane test -test TestCHgItemSetTimeL -delete test -[Endtest] - -[Test] -title TestCHgItemFlagsL#11 -create TestPlatGane test -test TestCHgItemFlagsL -delete test -[Endtest] - -[Test] -title TestCHgItemSetFlagsL#12 -create TestPlatGane test -test TestCHgItemSetFlagsL -delete test -[Endtest] - -[Test] -title TestCHgItemClearFlagsL#13 -create TestPlatGane test -test TestCHgItemClearFlagsL -delete test -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgscroller.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgscroller.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +0,0 @@ -//testhgscroller.h - -[Test] -title TestCHgScrollerInitScreenL1L#1 -create TestPlatGane test -test TestCHgScrollerInitScreenL1L -delete test -[Endtest] - -[Test] -title TestCHgScrollerInitScreenL2L#2 -create TestPlatGane test -test TestCHgScrollerInitScreenL2L -delete test -[Endtest] - -[Test] -title TestCHgScrollerRefreshScreenL#3 -create TestPlatGane test -test TestCHgScrollerRefreshScreenL -delete test -[Endtest] - -[Test] -title TestCHgScrollerFirstIndexOnScreenL#4 -create TestPlatGane test -test TestCHgScrollerFirstIndexOnScreenL -delete test -[Endtest] - -[Test] -title TestCHgScrollerItemsOnScreenL#5 -create TestPlatGane test -test TestCHgScrollerItemsOnScreenL -delete test -[Endtest] - -[Test] -title TestCHgScrollerItemL#6 -create TestPlatGane test -test TestCHgScrollerItemL -delete test -[Endtest] - -[Test] -title TestCHgScrollerSetItemL#7 -create TestPlatGane test -test TestCHgScrollerSetItemL -delete test -[Endtest] - -[Test] -title TestCHgScrollerAddItemL#8 -create TestPlatGane test -test TestCHgScrollerAddItemL -delete test -[Endtest] - -[Test] -title TestCHgScrollerInsertItemL#9 -create TestPlatGane test -test TestCHgScrollerInsertItemL -delete test -[Endtest] - -[Test] -title TestCHgScrollerRemoveItemL#10 -create TestPlatGane test -test TestCHgScrollerRemoveItemL -delete test -[Endtest] - -[Test] -title TestCHgScrollerSelectedIndexL#11 -create TestPlatGane test -test TestCHgScrollerSelectedIndexL -delete test -[Endtest] - -[Test] -title TestCHgScrollerSetSelectedIndexL#12 -create TestPlatGane test -test TestCHgScrollerSetSelectedIndexL -delete test -[Endtest] - -[Test] -title TestCHgScrollerMarkL#13 -create TestPlatGane test -test TestCHgScrollerMarkL -delete test -[Endtest] - -[Test] -title TestCHgScrollerUnMarkL#14 -create TestPlatGane test -test TestCHgScrollerUnMarkL -delete test -[Endtest] - -[Test] -title TestCHgScrollerMarkAllL#15 -create TestPlatGane test -test TestCHgScrollerMarkAllL -delete test -[Endtest] - -[Test] -title TestCHgScrollerUnMarkAllL#16 -create TestPlatGane test -test TestCHgScrollerUnMarkAllL -delete test -[Endtest] - -[Test] -title TestCHgScrollerGetMarkedItemsL#17 -create TestPlatGane test -test TestCHgScrollerGetMarkedItemsL -delete test -[Endtest] - -[Test] -title TestCHgScrollerResetL#18 -create TestPlatGane test -test TestCHgScrollerResetL -delete test -[Endtest] - -[Test] -title TestCHgScrollerResizeL#19 -create TestPlatGane test -test TestCHgScrollerResizeL -delete test -[Endtest] - -[Test] -title TestCHgScrollerSetEmptyTextL#20 -create TestPlatGane test -test TestCHgScrollerSetEmptyTextL -delete test -[Endtest] - -[Test] -title TestCHgScrollerItemCountL#21 -create TestPlatGane test -test TestCHgScrollerItemCountL -delete test -[Endtest] - -[Test] -title TestCHgScrollerSetScrollBarTypeL#22 -create TestPlatGane test -test TestCHgScrollerSetScrollBarTypeL -delete test -[Endtest] - -[Test] -title TestCHgScrollerSetFlagsL#23 -create TestPlatGane test -test TestCHgScrollerSetFlagsL -delete test -[Endtest] - -[Test] -title TestCHgScrollerClearFlagsL#24 -create TestPlatGane test -test TestCHgScrollerClearFlagsL -delete test -[Endtest] - -[Test] -title TestCHgScrollerFlagsL#25 -create TestPlatGane test -test TestCHgScrollerFlagsL -delete test -[Endtest] - -[Test] -title TestCHgScrollerHightlightItemL#26 -create TestPlatGane test -test TestCHgScrollerHightlightItemL -delete test -[Endtest] - -[Test] -title TestCHgScrollerSetDefaultIconL#27 -create TestPlatGane test -test TestCHgScrollerSetDefaultIconL -delete test -[Endtest] - -[Test] -title TestCHgScrollerDisableScrollBufferL#28 -create TestPlatGane test -test TestCHgScrollerDisableScrollBufferL -delete test -[Endtest] - - -[Test] -title TestCHgScrollerEnableScrollBufferL#29 -create TestPlatGane test -test TestCHgScrollerEnableScrollBufferL -delete test -[Endtest] - -[Test] -title TestCHgScrollerSetSelectionObserver#30 -create TestPlatGane test -test TestCHgScrollerSetSelectionObserver -delete test -[Endtest] - - -[Test] -title TestCHgScrollerSetMarkingObserver#31 -create TestPlatGane test -test TestCHgScrollerSetMarkingObserver -delete test -[Endtest] diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgscrollerwithtitle.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgscrollerwithtitle.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -//testhgscrollerwithtitle.h - -[Test] -title TestCHgScrollerWithTitleNewL#1 -create TestPlatGane test -test TestCHgScrollerWithTitleNewL -delete test -[Endtest] - -[Test] -title TestCHgScrollerWithTitleInitScreenL#2 -create TestPlatGane test -test TestCHgScrollerWithTitleInitScreenL -delete test -[Endtest] - -[Test] -title TestCHgScrollerWithTitleScrollerL#3 -create TestPlatGane test -test TestCHgScrollerWithTitleScrollerL -delete test -[Endtest] - -[Test] -title TestCHgScrollerWithTitleTitleItemL#4 -create TestPlatGane test -test TestCHgScrollerWithTitleTitleItemL -delete test -[Endtest] - -[Test] -title TestCHgScrollerWithTitlePreferredImageSizeL#5 -create TestPlatGane test -test TestCHgScrollerWithTitlePreferredImageSizeL -delete test -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgsinglegraphiclist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgsinglegraphiclist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -//testhgsinglegraphiclist.h - -[Test] -title TestCHgSingleGraphicListNewL#1 -create TestPlatGane test -test TestCHgSingleGraphicListNewL -delete test -[Endtest] - -[Test] -title TestCHgSingleGraphicListPreferredImageSizeL#2 -create TestPlatGane test -test TestCHgSingleGraphicListPreferredImageSizeL -delete test -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgsinglelargelist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgsinglelargelist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -//testhgsinglelargelist.h - -[Test] -title TestCHgSingleLargeListNewL#1 -create TestPlatGane test -test TestCHgSingleLargeListNewL -delete test -[Endtest] - -[Test] -title TestCHgSingleLargeListPreferredImageSizeL#2 -create TestPlatGane test -test TestCHgSingleLargeListPreferredImageSizeL -delete test -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgsingletextlist.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgsingletextlist.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -//testhgsingletextlist.h - -[Test] -title TestCHgSingleTextListL#1 -create TestPlatGane test -test TestCHgSingleTextListL -delete test -[Endtest] - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgsingletextlistwithicon.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgsingletextlistwithicon.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -//testhgsingletextwithicon.h - -[Test] -title TestCHgSingleTextListWithIconNewL#1 -create TestPlatGane test -test TestCHgSingleTextListWithIconNewL -delete test -[Endtest] - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgvgitem.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgvgitem.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -//testhgvgitem.h - -[Test] -title TestCHgVgItemNewL#1 -create TestPlatGane test -test TestCHgVgItemNewL -delete test -[Endtest] - -[Test] -title TestCHgVgItemNewLC#2 -create TestPlatGane test -test TestCHgVgItemNewLC -delete test -[Endtest] - -[Test] -title TestCHgVgItemSetIcon#3 -create TestPlatGane test -test TestCHgVgItemSetIcon -delete test -[Endtest] - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgvgmediawall.cfg --- a/classicui_plat/ganes_api/tsrc/conf/ui_testplatganehgvgmediawall.cfg Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,199 +0,0 @@ -[Test] -title TestCHgVgMediaWallNewL#1 -create TestPlatGane test -test TestCHgVgMediaWallNewL -delete test -[Endtest] - -[Test] -title TestCHgVgMediaWallInitScreenL#2 -create TestPlatGane test -test TestCHgVgMediaWallInitScreenL -delete test -[Endtest] - -[Test] -title TestCHgVgMediaWallRefreshScreen#3 -create TestPlatGane test -test TestCHgVgMediaWallRefreshScreen -delete test -[Endtest] - -[Test] -title TestCHgVgMediaWallFirstIndexOnScreen#4 -create TestPlatGane test -test TestCHgVgMediaWallFirstIndexOnScreen -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallItemsOnScreen#5 -create TestPlatGane test -test TestCHgVgMediaWallItemsOnScreen -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallItemL#6 -create TestPlatGane test -test TestCHgVgMediaWallItemL -delete test -[Endtest] - -[Test] -title TestCHgVgMediaWallSetItem#7 -create TestPlatGane test -test TestCHgVgMediaWallSetItem -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallAddItem#8 -create TestPlatGane test -test TestCHgVgMediaWallAddItem -delete test -[Endtest] - -[Test] -title TestCHgVgMediaWallInsertItem#9 -create TestPlatGane test -test TestCHgVgMediaWallInsertItem -delete test -[Endtest] - -[Test] -title TestCHgVgMediaWallRemoveItem#10 -create TestPlatGane test -test TestCHgVgMediaWallRemoveItem -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallSelectedIndex#11 -create TestPlatGane test -test TestCHgVgMediaWallSelectedIndex -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallSetSelectedIndex#12 -create TestPlatGane test -test TestCHgVgMediaWallSetSelectedIndex -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallEnableScrollBufferL#13 -create TestPlatGane test -test TestCHgVgMediaWallEnableScrollBufferL -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallSetSelectionObserver#14 -create TestPlatGane test -test TestCHgVgMediaWallSetSelectionObserver -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallReset#15 -create TestPlatGane test -test TestCHgVgMediaWallReset -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallResizeL#16 -create TestPlatGane test -test TestCHgVgMediaWallResizeL -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallSetEmptyTextL#17 -create TestPlatGane test -test TestCHgVgMediaWallSetEmptyTextL -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallItemCount#18 -create TestPlatGane test -test TestCHgVgMediaWallItemCount -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallSetDefaultIconL#19 -create TestPlatGane test -test TestCHgVgMediaWallSetDefaultIconL -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallDisableScrollBuffer#20 -create TestPlatGane test -test TestCHgVgMediaWallDisableScrollBuffer -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallChangeStyleL#21 -create TestPlatGane test -test TestCHgVgMediaWallChangeStyleL -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallSetObserver#22 -create TestPlatGane test -test TestCHgVgMediaWallSetObserver -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallSetOpeningAnimationType#23 -create TestPlatGane test -test TestCHgVgMediaWallSetOpeningAnimationType -delete test -[Endtest] - -[Test] -title TestCHgVgMediaWallStyle#24 -create TestPlatGane test -test TestCHgVgMediaWallStyle -delete test -[Endtest] - - -[Test] -title TestCHgVgMediaWallOpeningAnimationType#25 -create TestPlatGane test -test TestCHgVgMediaWallOpeningAnimationType -delete test -[Endtest] - -[Test] -title TestCHgVgMediaWallStartOpeningAnimationL#26 -create TestPlatGane test -test TestCHgVgMediaWallStartOpeningAnimationL -delete test -[Endtest] - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/eabi/testplatganeu.def --- a/classicui_plat/ganes_api/tsrc/eabi/testplatganeu.def Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z9LibEntryLR13CTestModuleIf @ 1 NONAME - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/group/bld.inf --- a/classicui_plat/ganes_api/tsrc/group/bld.inf Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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: ganes_api -* -*/ - - -PRJ_PLATFORMS -DEFAULT - - - -PRJ_EXPORTS - - -PRJ_TESTMMPFILES -testplatgane.mmp - -PRJ_MMPFILES - -// End of File - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/group/testplatgane.mmp --- a/classicui_plat/ganes_api/tsrc/group/testplatgane.mmp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +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: ganes_api -* -*/ - -#include -#include - -TARGET testplatgane.dll -TARGETTYPE dll -UID 0x1000008D 0x2001CB80 - -CAPABILITY ALL -TCB - -DEFFILE testplatgane.def - -USERINCLUDE ../inc - -MW_LAYER_SYSTEMINCLUDE - -SOURCEPATH ../src - -SOURCE testplatgane.cpp -SOURCE testplatganeblocks.cpp - -SOURCE testplatganeblockshgdoublegraphiclist.cpp -SOURCE testplatganeblockshgdoublegraphiclistflat.cpp -SOURCE testplatganeblockshgdoubletextlist.cpp -SOURCE testplatganeblockshggrid.cpp -SOURCE testplatganeblockshgitem.cpp -SOURCE testplatganeblockshgscroller.cpp -SOURCE testplatganeblockshgscrollerwithtitle.cpp -SOURCE testplatganeblockshgsinglegraphiclist.cpp -SOURCE testplatganeblockshgsinglelargelist.cpp -SOURCE testplatganeblockshgsingletextlist.cpp -SOURCE testplatganeblockshgvgmediawall.cpp -SOURCE testplatganeblockshgvgitem.cpp -SOURCE testplatganeblockshgsingletextlistwithicon.cpp - -LIBRARY euser.lib -LIBRARY stiftestinterface.lib -LIBRARY stiftestengine.lib -LIBRARY ganes.lib -LIBRARY ws32.lib - -LANG SC - -// End of File - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/group/testplatgane.pkg --- a/classicui_plat/ganes_api/tsrc/group/testplatgane.pkg Thu Jul 29 14:21:56 2010 +0800 +++ /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: -; -; Languages -&EN - -; Header -#{"testplatgane"}, (0x2001CB80), 1, 0, 0, TYPE=SA - -; Localised Vendor name -%{"Nokia"} - -; Unique Vendor name -:"Nokia" - - -;Copying ordinary file (not language dependent) to fixed drive drive. - -"..\init\testplatgane.ini"-"c:\Testframework\testplatgane.ini", FF ; FF stands for Normal file - -"..\conf\tctestplatganehgdoublegraphiclist.cfg"-"c:\Testframework\tctestplatganehgdoublegraphiclist.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatganehgdoubletextlist.cfg"-"c:\Testframework\tctestplatganehgdoubletextlist.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatganehggrid.cfg"-"c:\Testframework\tctestplatganehggrid.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatganehgitem.cfg"-"c:\Testframework\tctestplatganehgitem.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatganehgscroller.cfg"-"c:\Testframework\tctestplatganehgscroller.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatganehgscrollerwithtitle.cfg"-"c:\Testframework\tctestplatganehgscrollerwithtitle.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatganehgsinglegraphiclist.cfg"-"c:\Testframework\tctestplatganehgsinglegraphiclist.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatganehgsinglelargelist.cfg"-"c:\Testframework\tctestplatganehgsinglelargelist.cfg", FF ; FF stands for Normal file -"..\conf\tctestplatganehgsingletextlist.cfg"-"c:\Testframework\tctestplatganehgsingletextlist.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatganehgdoublegraphiclist.cfg"-"c:\Testframework\ui_testplatganehgdoublegraphiclist.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatganehgdoubletextlist.cfg"-"c:\Testframework\ui_testplatganehgdoubletextlist.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatganehggrid.cfg"-"c:\Testframework\ui_testplatganehggrid.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatganehgitem.cfg"-"c:\Testframework\ui_testplatganehgitem.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatganehgscroller.cfg"-"c:\Testframework\ui_testplatganehgscroller.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatganehgscrollerwithtitle.cfg"-"c:\Testframework\ui_testplatganehgscrollerwithtitle.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatganehgsinglegraphiclist.cfg"-"c:\Testframework\ui_testplatganehgsinglegraphiclist.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatganehgsinglelargelist.cfg"-"c:\Testframework\ui_testplatganehgsinglelargelist.cfg", FF ; FF stands for Normal file -"..\conf\ui_testplatganehgsingletextlist.cfg"-"c:\Testframework\ui_testplatganehgsingletextlist.cfg", FF ; FF stands for Normal file -"\epoc32\RELEASE\ARMV5\urel\testplatgane.dll"-"c:\sys\bin\testplatgane.dll", FF - - -; Trim For Mms -; ------------ -; to be added later - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/inc/testplatgane.h --- a/classicui_plat/ganes_api/tsrc/inc/testplatgane.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,884 +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: ganes_api -* -*/ - - -#ifndef C_TESTPLATGANE_H -#define C_TESTPLATGANE_H - -// INCLUDES -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// MACROS -#define TEST_CLASS_VERSION_MAJOR 0 -#define TEST_CLASS_VERSION_MINOR 0 -#define TEST_CLASS_VERSION_BUILD 0 - -// Logging path -_LIT( KTestPlatGaneLogPath, "\\logs\\testframework\\testplatgane\\" ); -// Log file -_LIT( KTestPlatGaneLogFile, "testplatgane.txt" ); -_LIT( KTestPlatGaneLogFileWithTitle, "testplatgane_[%S].txt" ); - -// const variable -const int KTest = 5; -const int KStringSize = 20; - -// Dummy observer for testing some methods. -class TDummyObserver : public MHgScrollBufferObserver, public MHgSelectionObserver, public MHgMarkingObserver - { - public: - void Request(TInt /*aRequestStart*/, TInt /*aRequestEnd*/, THgScrollDirection /*aDirection*/) {} - void Release(TInt /*aReleaseStart*/, TInt /*aReleaseEnd*/) { } - void HandleOpenL(TInt /*aIndex*/) { } - void HandleSelectL(TInt /*aIndex*/) { } - void HandleMarkingL( TInt /*aIndex*/, TBool /*aMarked*/ ) {} - }; - - - -/** -* CTestPlatGane test class for STIF Test Framework TestScripter. -* @since S60 5.0 -*/ -NONSHARABLE_CLASS( CTestPlatGane ) : public CScriptBase - { -public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CTestPlatGane* NewL( CTestModuleIf& aTestModuleIf ); - - /** - * Destructor. - */ - virtual ~CTestPlatGane(); - -public: // Functions from base classes - - /** - * From CScriptBase Runs a script line. - * @since S60 5.0 - * @param aItem Script line containing method name and parameters - * @return Symbian OS error code - */ - virtual TInt RunMethodL( CStifItemParser& aItem ); - -private: - - /** - * C++ default constructor. - */ - CTestPlatGane( CTestModuleIf& aTestModuleIf ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - /** - * Method used to log version of test class - */ - void SendTestClassVersion(); - -private: // [TestMethods] - /** - * TestCHgDoubleGraphicListL test of CHgDoubleGraphicList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgDoubleGraphicListL( CStifItemParser& aItem ); - - /** - * TestCHgDoubleGraphicListPreferredImageSize test PreferredImageSize of CHgDoubleGraphicList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgDoubleGraphicListPreferredImageSize( CStifItemParser& aItem ); - - /** - * TestCHgDoubleGraphicListL test of CHgDoubleGraphicList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgDoubleGraphicListFlatL( CStifItemParser& aItem ); - - /** - * TestCHgDoubleGraphicListPreferredImageSize test PreferredImageSize of CHgDoubleGraphicList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgDoubleGraphicListFlatPreferredImageSize( CStifItemParser& aItem ); - - /** - * TestCHgDoubleTextListL test of CHgDoubleTextList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgDoubleTextListL( CStifItemParser& aItem ); - - /** - * TestCHgDoubleTextListPreferredImageSize test PreferredImageSize of CHgDoubleTextList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgDoubleTextListPreferredImageSize( CStifItemParser& aItem ); - - /** - * TestCHgGridNewL test NewL of CHgGrid - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgGridNewL( CStifItemParser& aItem ); - - /** - * TestCHgGridPreferredImageSize test PreferredImageSize of CHgGrid - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgGridPreferredImageSize( CStifItemParser& aItem ); - - /** - * TestCHgGridSetLandscapeScrollingSupport test SetLandscapeScrollingSupport of CHgGrid - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgGridSetLandscapeScrollingSupport( CStifItemParser& aItem ); - - /** - * TestCHgItemNewL test NewL of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemNewL( CStifItemParser& aItem ); - - /** - * TestCHgItemNewLCL test NewLC of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemNewLCL( CStifItemParser& aItem ); - - /** - * TestCHgItemIconL test Icon of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemIconL( CStifItemParser& aItem ); - - /** - * TestCHgItemTitleL test Title of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemTitleL( CStifItemParser& aItem ); - - /** - * TestCHgItemTextL test Text of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemTextL( CStifItemParser& aItem ); - - /** - * TestCHgItemTimeL test Time of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemTimeL( CStifItemParser& aItem ); - - /** - * TestCHgItemSetIconL test SetIcon of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemSetIconL( CStifItemParser& aItem ); - - /** - * TestCHgItemSetTitleL test SetTitleL of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemSetTitleL( CStifItemParser& aItem ); - - /** - * TestCHgItemSetTextL test SetTextL of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemSetTextL( CStifItemParser& aItem ); - - /** - * TestCHgItemSetTimeL test SetTime of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemSetTimeL( CStifItemParser& aItem ); - - /** - * TestCHgItemFlagsL test Flags of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemFlagsL( CStifItemParser& aItem ); - - /** - * TestCHgItemSetFlagsL test SetFlags of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemSetFlagsL( CStifItemParser& aItem ); - - /** - * TestCHgItemClearFlagsL test ClearFlags of CHgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgItemClearFlagsL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerInitScreenL1 test InitScreenL of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerInitScreenL1( CStifItemParser& aItem ); - - /** - * TestCHgScrollerInitScreenL2L test InitScreenL of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerInitScreenL2L( CStifItemParser& aItem ); - - /** - * TestCHgScrollerRefreshScreenL test RefreshScreen of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerRefreshScreenL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerFirstIndexOnScreenL test FirstIndexOnScreen of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerFirstIndexOnScreenL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerItemsOnScreenL test ItemsOnScreen of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerItemsOnScreenL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerItemL test ItemL of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerItemL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerSetItemL test SetItem of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerSetItemL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerAddItemL test AddItem of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerAddItemL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerInsertItemL test InsertItem of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerInsertItemL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerRemoveItemL test RemoveItem of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerRemoveItemL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerSelectedIndexL test SelectedIndex of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerSelectedIndexL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerSetSelectedIndexL test SetSelectedIndex of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerSetSelectedIndexL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerMarkL test Mark of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerMarkL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerUnMarkL test UnMark of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerUnMarkL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerMarkAllL test MarkAll of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerMarkAllL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerUnMarkAllL test UnMarkAll of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerUnMarkAllL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerGetMarkedItemsL test GetMarkedItemsL of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerGetMarkedItemsL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerEnableScrollBufferL test EnableScrollBufferL of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerEnableScrollBufferL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerSetSelectionObserver test SetSelectionObserver of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerSetSelectionObserver( CStifItemParser& aItem ); - - /** - * TestCHgScrollerSetMarkingObserver test SetMarkingObserver of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerSetMarkingObserver( CStifItemParser& aItem ); - - /** - * TestCHgScrollerResetL test Reset of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerResetL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerResizeL test ResizeL of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerResizeL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerSetEmptyTextL test SetEmptyTextL of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerSetEmptyTextL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerItemCountL test ItemCount of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerItemCountL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerSetScrollBarTypeL test SetScrollBarTypeL of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerSetScrollBarTypeL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerSetFlagsL test SetFlags of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerSetFlagsL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerClearFlagsL test ClearFlags of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerClearFlagsL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerFlagsL test Flags of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerFlagsL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerHightlightItemL test HightlightItem of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerHightlightItemL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerSetDefaultIconL test SetDefaultIconL of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerSetDefaultIconL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerDisableScrollBufferL test DisableScrollBuffer of CHgScroller - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerDisableScrollBufferL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerWithTitleNewL test NewL of CHgScrollerWithTitle - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerWithTitleNewL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerWithTitleInitScreenL test InitScreenL of CHgScrollerWithTitle - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerWithTitleInitScreenL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerWithTitleScrollerL test Scroller of CHgScrollerWithTitle - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerWithTitleScrollerL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerWithTitleTitleItemL test TitleItem of CHgScrollerWithTitle - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerWithTitleTitleItemL( CStifItemParser& aItem ); - - /** - * TestCHgScrollerWithTitlePreferredImageSize test PreferredImageSize of CHgScrollerWithTitle - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgScrollerWithTitlePreferredImageSize( CStifItemParser& aItem ); - - /** - * TestCHgSingleGraphicListNewL test NewL of CHgSingleGraphicList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgSingleGraphicListNewL( CStifItemParser& aItem ); - - /** - * TestCHgSingleGraphicListPreferredImageSize test PreferredImageSize of CHgSingleGraphicList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgSingleGraphicListPreferredImageSize( CStifItemParser& aItem ); - - /** - * TestCHgSingleLargeListNewL test NewL of CHgSingleLargeList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgSingleLargeListNewL( CStifItemParser& aItem ); - - /** - * TestCHgSingleLargeListPreferredImageSize test PreferredImageSize of CHgSingleLargeList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgSingleLargeListPreferredImageSize( CStifItemParser& aItem ); - - /** - * TestCHgSingleTextListL test of CHgSingleTextList - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgSingleTextListL( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallNewL test NewL of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallNewL( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallInitScreenL test InitScreenL of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallInitScreenL( CStifItemParser& aItem ); - - - /** - * TestCHgVgMediaWallRefreshScreen test RefreshScreen of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallRefreshScreen( CStifItemParser& aItem ); - - - /** - * TestCHgVgMediaWallFirstIndexOnScreen test FirstIndexOnScreen of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallFirstIndexOnScreen( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallItemsOnScreen test ItemsOnScreen of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallItemsOnScreen( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallItemL test ItemL of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallItemL( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallSetItem test SetItem of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallSetItem( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallAddItem test AddItem of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallAddItem( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallInsertItem test InsertItem of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallInsertItem( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallRemoveItem test InsertItem of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallRemoveItem( CStifItemParser& aItem ); - - - /** - * TestCHgVgMediaWallSelectedIndex test SelectedIndex of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallSelectedIndex( CStifItemParser& aItem ); - - - /** - * TestCHgVgMediaWallSetSelectedIndex test SetSelectedIndex of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallSetSelectedIndex( CStifItemParser& aItem ); - - - /** - * TestCHgVgMediaWallEnableScrollBufferL test EnableScrollBufferL of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallEnableScrollBufferL( CStifItemParser& aItem ); - - - /** - * TestCHgVgMediaWallSetSelectionObserver test SetSelectionObserver of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallSetSelectionObserver( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallSetSelectionReset test Reset of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallReset( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallSetSelectionResizeL test ResizeL of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallResizeL( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallSetEmptyTextL test SetEmptyTextL of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallSetEmptyTextL( CStifItemParser& aItem ); - - - /** - * TestCHgVgMediaWallItemCount test ItemCount of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallItemCount( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallSetDefaultIconL test SetDefaultIconL of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallSetDefaultIconL( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallDisableScrollBuffer test DisableScrollBuffer of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallDisableScrollBuffer( CStifItemParser& aItem ); - - - /** - * TestCHgVgMediaWallChangeStyleL test ChangeStyleL of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallChangeStyleL( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallSetObserver test SetObserver of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallSetObserver( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallSetOpeningAnimationType test SetOpeningAnimationType of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallSetOpeningAnimationType( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallStyle test Style of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallStyle( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallOpeningAnimationType test OpeningAnimationType of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallOpeningAnimationType( CStifItemParser& aItem ); - - /** - * TestCHgVgMediaWallStartOpeningAnimationL test StartOpeningAnimationL of CHgVgMediaWall - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgMediaWallStartOpeningAnimationL( CStifItemParser& aItem ); - - /** - * TestCHgVgItemNewL test NewL of CHgVgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgItemNewL( CStifItemParser& aItem ); - - /** - * TestCHgVgItemNewLC test NewLC of CHgVgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgItemNewLC( CStifItemParser& aItem ); - - /** - * TestCHgVgItemSetIcon test SetIcon of CHgVgItem - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgVgItemSetIcon( CStifItemParser& aItem ); - - /** - * TestCHgSingleTextListWithIconNewL test NewL of CHgSingleTextListWithIcon - * @since S60 5.0 - * @param aItem never used - * @return Symbian OS error code. - */ - virtual TInt TestCHgSingleTextListWithIconNewL( CStifItemParser& aItem ); - - -private: // Data - - /** - * ScreenSaver Property - */ - TInt iOldScreenSaverProperty; - - }; - -#endif // C_TESTPLATGANE_H - -// End of File - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/init/testplatgane.ini --- a/classicui_plat/ganes_api/tsrc/init/testplatgane.ini Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,208 +0,0 @@ -# -# This is STIFTestFramework initialization file -# Comment lines start with '#'-character. -# See STIF TestFramework users guide.doc for instructions - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set following test engine settings: -# - Set Test Reporting mode. TestReportMode's possible values are: -# + 'Summary': Summary of the tested test cases. -# + 'Environment': Hardware and software info. -# + 'TestCases': Test case report. -# + 'FullReport': Set of all above ones. -# + Example 'TestReportMode= Summary TestCases' -# -# - CreateTestReport setting controls report creation mode -# + YES, Test report will created. -# + NO, No Test report. -# -# - File path indicates the base path of the test report. -# - File name indicates the name of the test report. -# -# - File format indicates the type of the test report. -# + TXT, Test report file will be txt type, for example 'TestReport.txt'. -# + HTML, Test report will be html type, for example 'TestReport.html'. -# -# - File output indicates output source of the test report. -# + FILE, Test report logging to file. -# + RDEBUG, Test report logging to using rdebug. -# -# - File Creation Mode indicates test report overwriting if file exist. -# + OVERWRITE, Overwrites if the Test report file exist. -# + APPEND, Continue logging after the old Test report information if -# report exist. - -[Engine_Defaults] - -TestReportMode= FullReport # Possible values are: - # '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 -UITestingSupport= Yes -SeparateProcesses= YES -[End_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Module configurations start -# Modules are added between module tags -# tags. Module name is specified after ModuleName= tag, like -# ModuleName= testplatganetestplatganetestplatgane -# Modules might have initialisation file, specified as -# IniFile= YYYYYY -# Modules might have several configuration files, like -# TestCaseFile= NormalCases.txt -# TestCaseFile= SmokeCases.txt -# TestCaseFile= ManualCases.txt - -# (TestCaseFile is synonym for old term ConfigFile) - -# Following case specifies demo module settings. Demo module -# does not read any settings from file, so tags -# IniFile and TestCaseFile are not used. -# In the simplest case it is enough to specify only the -# name of the test module when adding new test module - -[New_Module] -ModuleName= testcombiner -TestCaseFile= c:\testframework\tctestplatganehgdoublegraphiclist.cfg -TestCaseFile= c:\testframework\tctestplatganehgdoublegraphiclistflat.cfg -TestCaseFile= c:\testframework\tctestplatganehgdoubletextlist.cfg -TestCaseFile= c:\testframework\tctestplatganehggrid.cfg -TestCaseFile= c:\testframework\tctestplatganehgitem.cfg -TestCaseFile= c:\testframework\tctestplatganehgscroller.cfg -TestCaseFile= c:\testframework\tctestplatganehgscrollerwithtitle.cfg -TestCaseFile= c:\testframework\tctestplatganehgsinglegraphiclist.cfg -TestCaseFile= c:\testframework\tctestplatganehgsinglelargelist.cfg -TestCaseFile= c:\testframework\tctestplatganehgsingletextlist.cfg -TestCaseFile= c:\testframework\tctestplatganehgvgmediawall.cfg -TestCaseFile= c:\testframework\tctestplatganehgvgitem.cfg -TestCaseFile= c:\testframework\tctestplatganehgsingletextlistwithicon.cfg -[End_Module] - -#[New_Module] -#ModuleName= testscripter -#TestCaseFile= c:\testframework\ui_testplatganehgdoublegraphiclist.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgdoubletextlist.cfg -#TestCaseFile= c:\testframework\ui_testplatganehggrid.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgitem.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgscroller.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgscrollerwithtitle.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgsinglegraphiclist.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgsinglelargelist.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgsingletextlist.cfg -#[End_Module] - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -#Load testmoduletestplatgane, optionally with initialization file and/or test case files -#[New_Module] -#ModuleName= testmodulexxx - -#TestModuletestplatgane used initialization file -#IniFile= init.txt - -#TestModuletestplatgane used configuration file(s) - -#TestCaseFile= c:\testframework\ui_testplatganehgdoublegraphiclist.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgdoubletextlist.cfg -#TestCaseFile= c:\testframework\ui_testplatganehggrid.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgitem.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgscroller.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgscrollerwithtitle.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgsinglegraphiclist.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgsinglelargelist.cfg -#TestCaseFile= c:\testframework\ui_testplatganehgsingletextlist.cfg -#[End_Module] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - - - -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -# Set STIFTestFramework logging overwrite parameters for Logger. -# Hardware and emulator environment logging path and styles can -# be configured from here to overwrite the Logger's implemented values. -# -# Settings description: -# - Indicates option for creation log directory/directories. If log directory/directories -# is/are not created by user they will make by software. -# + YES, Create log directory/directories if not allready exist. -# + NO, Log directory/directories not created. Only created one is used. -# -# - Overwrite emulator path setting. -# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined -# Logger's path 'D:\\LOGS\\Module\\' with those definition the path -# will be 'C:\LOGS\TestFramework\LOGS\Module\' -# -# - Overwrite emulator's logging format. -# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. -# + HTML, Log file(s) will be html type(s), for example 'Module.html'. -# -# - Overwrited emulator logging output source. -# + FILE, Logging to file(s). -# + RDEBUG, Logging to using rdebug(s). -# -# - Overwrite hardware path setting (Same description as above in emulator path). -# - Overwrite hardware's logging format(Same description as above in emulator format). -# - Overwrite hardware's logging output source(Same description as above in emulator output). -# -# - File Creation Mode indicates file overwriting if file exist. -# + OVERWRITE, Overwrites if file(s) exist. -# + APPEND, Continue logging after the old logging information if file(s) exist. -# -# - Will thread id include to the log filename. -# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. -# + NO, No thread id to log file(s), Example filename 'Module.txt'. -# -# - Will time stamps include the to log file. -# + YES, Time stamp added to each line in log file(s). Time stamp is -# for example'12.Nov.2003 115958 LOGGING INFO' -# + NO, No time stamp(s). -# -# - Will line breaks include to the log file. -# + YES, Each logging event includes line break and next log event is in own line. -# + NO, No line break(s). -# -# - Will event ranking include to the log file. -# + YES, Event ranking number added to each line in log file(s). Ranking number -# depends on environment's tics, for example(includes time stamp also) -# '012 12.Nov.2003 115958 LOGGING INFO' -# + NO, No event ranking. -# - -[Logger_Defaults] - -#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' - -CreateLogDirectories= YES # Possible values: YES or NO - -EmulatorBasePath= C:\LOGS\TestFramework\ -EmulatorFormat= HTML # Possible values: TXT or HTML -EmulatorOutput= FILE # Possible values: FILE or RDEBUG - -#HardwareBasePath= D:\LOGS\TestFramework\ -#HardwareFormat= HTML # Possible values: TXT or HTML -#HardwareOutput= FILE # Possible values: FILE or RDEBUG - -FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND - -#ThreadIdToLogFile= YES # Possible values: YES or NO -#WithTimeStamp= YES # Possible values: YES or NO -#WithLineBreak= YES # Possible values: YES or NO -#WithEventRanking= YES # Possible values: YES or NO - -[End_Logger_Defaults] -# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -# End of file - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatgane.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatgane.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +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: ganes_api -* -*/ - - -// INCLUDE FILES -#include -#include -#include - -#include "testplatgane.h" - -// CONSTANTS -_LIT( KModuleName, "testplatgane.dll" ); - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CTestPlatGane::CTestPlatGane -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CTestPlatGane::CTestPlatGane( CTestModuleIf& aTestModuleIf ): - CScriptBase( aTestModuleIf ) - { - } - -// ----------------------------------------------------------------------------- -// CTestPlatGane::~CTestPlatGane -// Destructor. -// ----------------------------------------------------------------------------- -// -CTestPlatGane::~CTestPlatGane() - { - // Delete logger - delete iLog; - - } - -// ----------------------------------------------------------------------------- -// CTestPlatGane::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CTestPlatGane::ConstructL() - { - //Read logger settings to check whether test case name is to be - //appended to log file name. - RSettingServer settingServer; - CleanupClosePushL( 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(); - CleanupStack::PopAndDestroy( &settingServer ); - - TFileName logFileName; - - if ( loggerSettings.iAddTestCaseTitle ) - { - TName title; - TestModuleIf().GetTestCaseTitleL( title ); - logFileName.Format( KTestPlatGaneLogFileWithTitle, &title ); - } - else - { - logFileName.Copy( KTestPlatGaneLogFile ); - } - - iLog = CStifLogger::NewL( KTestPlatGaneLogPath, - logFileName, - CStifLogger::ETxt, - CStifLogger::EFile, - EFalse ); - - SendTestClassVersion(); - } - -// ----------------------------------------------------------------------------- -// CTestPlatGane::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CTestPlatGane* CTestPlatGane::NewL( CTestModuleIf& aTestModuleIf ) - { - CTestPlatGane* self = new( ELeave ) CTestPlatGane( aTestModuleIf ); - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - return self; - - } - -//----------------------------------------------------------------------------- -// CTestPlatGane::SendTestClassVersion -// Method used to send version of test class -//----------------------------------------------------------------------------- -// -void CTestPlatGane::SendTestClassVersion() - { - TVersion moduleVersion; - moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; - moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; - moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; - - TFileName moduleName; - moduleName = KModuleName; - - 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* ) CTestPlatGane::NewL( aTestModuleIf ); - } -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblocks.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblocks.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +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: ganes_api -* -*/ - - -// [INCLUDE FILES] -#include -#include -#include - -#include "testplatgane.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CTestPlatGane::RunMethodL -// Run specified method. Contains also table of test mothods and their names. -// ----------------------------------------------------------------------------- -// -TInt CTestPlatGane::RunMethodL( CStifItemParser& aItem ) - { - - static TStifFunctionInfo const KFunctions[] = - { - // First string is the function name used in TestScripter script file. - // Second is the actual implementation member function. - - // [test cases entries] - //HgDoubleGraphicList.h - ENTRY( "TestCHgDoubleGraphicListL", CTestPlatGane::TestCHgDoubleGraphicListL ), - ENTRY( "TestCHgDoubleGraphicListPreferredImageSizeL", CTestPlatGane::TestCHgDoubleGraphicListPreferredImageSize ), - //HgDoubleGraphicListFlat.h - ENTRY( "TestCHgDoubleGraphicListFlatL", CTestPlatGane::TestCHgDoubleGraphicListFlatL ), - ENTRY( "TestCHgDoubleGraphicListFlatPreferredImageSizeL", CTestPlatGane::TestCHgDoubleGraphicListFlatPreferredImageSize ), - //HgDoubleTextList.h - ENTRY( "TestCHgDoubleTextListL", CTestPlatGane::TestCHgDoubleTextListL ), - ENTRY( "TestCHgDoubleTextListPreferredImageSize", CTestPlatGane::TestCHgDoubleTextListPreferredImageSize ), - //HgGrid.h - ENTRY( "TestCHgGridNewL", CTestPlatGane::TestCHgGridNewL ), - ENTRY( "TestCHgGridPreferredImageSizeL", CTestPlatGane::TestCHgGridPreferredImageSize ), - ENTRY( "TestCHgGridSetLandscapeScrollingSupport", CTestPlatGane::TestCHgGridSetLandscapeScrollingSupport ), - //HgItem.h - ENTRY( "TestCHgItemNewL", CTestPlatGane::TestCHgItemNewL ), - ENTRY( "TestCHgItemNewLCL", CTestPlatGane::TestCHgItemNewLCL ), - ENTRY( "TestCHgItemIconL", CTestPlatGane::TestCHgItemIconL ), - ENTRY( "TestCHgItemTitleL", CTestPlatGane::TestCHgItemTitleL ), - ENTRY( "TestCHgItemTextL", CTestPlatGane::TestCHgItemTextL ), - ENTRY( "TestCHgItemTimeL", CTestPlatGane::TestCHgItemTimeL ), - ENTRY( "TestCHgItemSetIconL", CTestPlatGane::TestCHgItemSetIconL ), - ENTRY( "TestCHgItemSetTitleL", CTestPlatGane::TestCHgItemSetTitleL ), - ENTRY( "TestCHgItemSetTextL", CTestPlatGane::TestCHgItemSetTextL ), - ENTRY( "TestCHgItemSetTimeL", CTestPlatGane::TestCHgItemSetTimeL ), - ENTRY( "TestCHgItemFlagsL", CTestPlatGane::TestCHgItemFlagsL ), - ENTRY( "TestCHgItemSetFlagsL", CTestPlatGane::TestCHgItemSetFlagsL ), - ENTRY( "TestCHgItemClearFlagsL", CTestPlatGane::TestCHgItemClearFlagsL ), - //HgScroller.h - ENTRY( "TestCHgScrollerInitScreenL1L", CTestPlatGane::TestCHgScrollerInitScreenL1 ), - ENTRY( "TestCHgScrollerInitScreenL2L", CTestPlatGane::TestCHgScrollerInitScreenL2L ), - ENTRY( "TestCHgScrollerRefreshScreenL", CTestPlatGane::TestCHgScrollerRefreshScreenL ), - ENTRY( "TestCHgScrollerFirstIndexOnScreenL", CTestPlatGane::TestCHgScrollerFirstIndexOnScreenL ), - ENTRY( "TestCHgScrollerItemsOnScreenL", CTestPlatGane::TestCHgScrollerItemsOnScreenL ), - ENTRY( "TestCHgScrollerItemL", CTestPlatGane::TestCHgScrollerItemL ), - ENTRY( "TestCHgScrollerSetItemL", CTestPlatGane::TestCHgScrollerSetItemL ), - ENTRY( "TestCHgScrollerAddItemL", CTestPlatGane::TestCHgScrollerAddItemL ), - ENTRY( "TestCHgScrollerInsertItemL", CTestPlatGane::TestCHgScrollerInsertItemL ), - ENTRY( "TestCHgScrollerRemoveItemL", CTestPlatGane::TestCHgScrollerRemoveItemL ), - ENTRY( "TestCHgScrollerSelectedIndexL", CTestPlatGane::TestCHgScrollerSelectedIndexL ), - ENTRY( "TestCHgScrollerSetSelectedIndexL", CTestPlatGane::TestCHgScrollerSetSelectedIndexL ), - ENTRY( "TestCHgScrollerMarkL", CTestPlatGane::TestCHgScrollerMarkL ), - ENTRY( "TestCHgScrollerUnMarkL", CTestPlatGane::TestCHgScrollerUnMarkL ), - ENTRY( "TestCHgScrollerMarkAllL", CTestPlatGane::TestCHgScrollerMarkAllL ), - ENTRY( "TestCHgScrollerUnMarkAllL", CTestPlatGane::TestCHgScrollerUnMarkAllL ), - ENTRY( "TestCHgScrollerGetMarkedItemsL", CTestPlatGane::TestCHgScrollerGetMarkedItemsL ), - ENTRY( "TestCHgScrollerResetL", CTestPlatGane::TestCHgScrollerResetL ), - ENTRY( "TestCHgScrollerResizeL", CTestPlatGane::TestCHgScrollerResizeL ), - ENTRY( "TestCHgScrollerSetEmptyTextL", CTestPlatGane::TestCHgScrollerSetEmptyTextL ), - ENTRY( "TestCHgScrollerItemCountL", CTestPlatGane::TestCHgScrollerItemCountL ), - ENTRY( "TestCHgScrollerSetScrollBarTypeL", CTestPlatGane::TestCHgScrollerSetScrollBarTypeL ), - ENTRY( "TestCHgScrollerSetFlagsL", CTestPlatGane::TestCHgScrollerSetFlagsL ), - ENTRY( "TestCHgScrollerClearFlagsL", CTestPlatGane::TestCHgScrollerClearFlagsL ), - ENTRY( "TestCHgScrollerFlagsL", CTestPlatGane::TestCHgScrollerFlagsL ), - ENTRY( "TestCHgScrollerHightlightItemL", CTestPlatGane::TestCHgScrollerHightlightItemL ), - ENTRY( "TestCHgScrollerSetDefaultIconL", CTestPlatGane::TestCHgScrollerSetDefaultIconL ), - ENTRY( "TestCHgScrollerDisableScrollBufferL", CTestPlatGane::TestCHgScrollerDisableScrollBufferL ), - ENTRY( "TestCHgScrollerEnableScrollBufferL", CTestPlatGane::TestCHgScrollerEnableScrollBufferL ), - ENTRY( "TestCHgScrollerSetSelectionObserver", CTestPlatGane::TestCHgScrollerSetSelectionObserver ), - ENTRY( "TestCHgScrollerSetMarkingObserver", CTestPlatGane::TestCHgScrollerSetMarkingObserver ), - //HgScrollerWithTitle.h - ENTRY( "TestCHgScrollerWithTitleNewL", CTestPlatGane::TestCHgScrollerWithTitleNewL ), - ENTRY( "TestCHgScrollerWithTitleInitScreenL", CTestPlatGane::TestCHgScrollerWithTitleInitScreenL ), - ENTRY( "TestCHgScrollerWithTitleScrollerL", CTestPlatGane::TestCHgScrollerWithTitleScrollerL ), - ENTRY( "TestCHgScrollerWithTitleTitleItemL", CTestPlatGane::TestCHgScrollerWithTitleTitleItemL ), - ENTRY( "TestCHgScrollerWithTitlePreferredImageSizeL", CTestPlatGane::TestCHgScrollerWithTitlePreferredImageSize ), - //HgSingleGraphicList.h - ENTRY( "TestCHgSingleGraphicListNewL", CTestPlatGane::TestCHgSingleGraphicListNewL ), - ENTRY( "TestCHgSingleGraphicListPreferredImageSizeL", CTestPlatGane::TestCHgSingleGraphicListPreferredImageSize ), - //HgSingleLargeList.h - ENTRY( "TestCHgSingleLargeListNewL", CTestPlatGane::TestCHgSingleLargeListNewL ), - ENTRY( "TestCHgSingleLargeListPreferredImageSizeL", CTestPlatGane::TestCHgSingleLargeListPreferredImageSize ), - //HgSingleTextList.h - ENTRY( "TestCHgSingleTextListL", CTestPlatGane::TestCHgSingleTextListL ), - // HgVgMediaWall.h - ENTRY( "TestCHgVgMediaWallNewL", CTestPlatGane::TestCHgVgMediaWallNewL ), - ENTRY( "TestCHgVgMediaWallInitScreenL", CTestPlatGane::TestCHgVgMediaWallInitScreenL ), - ENTRY( "TestCHgVgMediaWallRefreshScreen", CTestPlatGane::TestCHgVgMediaWallRefreshScreen ), - ENTRY( "TestCHgVgMediaWallFirstIndexOnScreen", CTestPlatGane::TestCHgVgMediaWallFirstIndexOnScreen ), - ENTRY( "TestCHgVgMediaWallItemsOnScreen", CTestPlatGane::TestCHgVgMediaWallItemsOnScreen ), - ENTRY( "TestCHgVgMediaWallItemL", CTestPlatGane::TestCHgVgMediaWallItemL ), - ENTRY( "TestCHgVgMediaWallSetItem", CTestPlatGane::TestCHgVgMediaWallSetItem ), - ENTRY( "TestCHgVgMediaWallAddItem", CTestPlatGane::TestCHgVgMediaWallAddItem ), - ENTRY( "TestCHgVgMediaWallInsertItem", CTestPlatGane::TestCHgVgMediaWallInsertItem ), - ENTRY( "TestCHgVgMediaWallRemoveItem", CTestPlatGane::TestCHgVgMediaWallRemoveItem ), - ENTRY( "TestCHgVgMediaWallSelectedIndex", CTestPlatGane::TestCHgVgMediaWallSelectedIndex ), - ENTRY( "TestCHgVgMediaWallSetSelectedIndex", CTestPlatGane::TestCHgVgMediaWallSetSelectedIndex ), - ENTRY( "TestCHgVgMediaWallEnableScrollBufferL", CTestPlatGane::TestCHgVgMediaWallEnableScrollBufferL ), - ENTRY( "TestCHgVgMediaWallSetSelectionObserver", CTestPlatGane::TestCHgVgMediaWallSetSelectionObserver ), - ENTRY( "TestCHgVgMediaWallReset", CTestPlatGane::TestCHgVgMediaWallReset ), - ENTRY( "TestCHgVgMediaWallResizeL", CTestPlatGane::TestCHgVgMediaWallResizeL ), - ENTRY( "TestCHgVgMediaWallSetEmptyTextL", CTestPlatGane::TestCHgVgMediaWallSetEmptyTextL ), - ENTRY( "TestCHgVgMediaWallItemCount", CTestPlatGane::TestCHgVgMediaWallItemCount ), - ENTRY( "TestCHgVgMediaWallSetDefaultIconL", CTestPlatGane::TestCHgVgMediaWallSetDefaultIconL ), - ENTRY( "TestCHgVgMediaWallDisableScrollBuffer", CTestPlatGane::TestCHgVgMediaWallDisableScrollBuffer ), - ENTRY( "TestCHgVgMediaWallChangeStyleL", CTestPlatGane::TestCHgVgMediaWallChangeStyleL ), - ENTRY( "TestCHgVgMediaWallSetObserver", CTestPlatGane::TestCHgVgMediaWallSetObserver ), - ENTRY( "TestCHgVgMediaWallSetOpeningAnimationType", CTestPlatGane::TestCHgVgMediaWallSetOpeningAnimationType ), - ENTRY( "TestCHgVgMediaWallStyle", CTestPlatGane::TestCHgVgMediaWallStyle ), - ENTRY( "TestCHgVgMediaWallOpeningAnimationType", CTestPlatGane::TestCHgVgMediaWallOpeningAnimationType ), - ENTRY( "TestCHgVgMediaWallStartOpeningAnimationL", CTestPlatGane::TestCHgVgMediaWallStartOpeningAnimationL ), - // HgVgItem.h - ENTRY( "TestCHgVgItemNewL", CTestPlatGane::TestCHgVgItemNewL ), - ENTRY( "TestCHgVgItemNewLC", CTestPlatGane::TestCHgVgItemNewLC ), - ENTRY( "TestCHgVgItemSetIcon", CTestPlatGane::TestCHgVgItemSetIcon ), - // HgSingleTextListWithIcon.h - ENTRY( "TestCHgSingleTextListWithIconNewL", CTestPlatGane::TestCHgSingleTextListWithIconNewL ) - }; - - const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo ); - - return RunInternalL( KFunctions, count, aItem ); - - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgdoublegraphiclist.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgdoublegraphiclist.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgDoubleGraphicListL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgDoubleGraphicListL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgdoublegraphiclistl, "In TestCHgDoubleGraphicListL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgdoublegraphiclistl); - iLog->Log(Ktestchgdoublegraphiclistl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - CHgDoubleGraphicList* temp = CHgDoubleGraphicList::NewL( rect, item); - CleanupStack::PushL( temp ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgDoubleGraphicListPreferredImageSize -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgDoubleGraphicListPreferredImageSize( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(KTestCHgDoubleGraphicListPreferredImageSize, "In TestCHgDoubleGraphicListPreferredImageSize"); - TestModuleIf().Printf(0, Kctestplatgane, KTestCHgDoubleGraphicListPreferredImageSize); - iLog->Log(KTestCHgDoubleGraphicListPreferredImageSize); - - CHgDoubleGraphicList::PreferredImageSize(); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgdoublegraphiclistflat.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgdoublegraphiclistflat.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgDoubleGraphicListL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgDoubleGraphicListFlatL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgdoublegraphiclistl, "In TestCHgDoubleGraphicListFlatL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgdoublegraphiclistl); - iLog->Log(Ktestchgdoublegraphiclistl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - CHgDoubleGraphicList* temp = CHgDoubleGraphicListFlat::NewL( rect, item); - CleanupStack::PushL( temp ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgDoubleGraphicListPreferredImageSize -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgDoubleGraphicListFlatPreferredImageSize( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(KTestCHgDoubleGraphicListFlatPreferredImageSize, "In TestCHgDoubleGraphicListFlatPreferredImageSize"); - TestModuleIf().Printf(0, Kctestplatgane, KTestCHgDoubleGraphicListFlatPreferredImageSize); - iLog->Log(KTestCHgDoubleGraphicListFlatPreferredImageSize); - - CHgDoubleGraphicListFlat::PreferredImageSize(); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgdoubletextlist.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgdoubletextlist.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// ============================ MEMBER FUNCTIONS ========================= - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgDoubleTextListL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgDoubleTextListL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgdoubletextlistl, "In TestCHgDoubleTextListL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgdoubletextlistl); - iLog->Log(Ktestchgdoubletextlistl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - CHgDoubleTextList* temp = CHgDoubleTextList::NewL( rect, item); - CleanupStack::PushL( temp ); - CleanupStack::PopAndDestroy( temp ); - - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgDoubleTextListPreferredImageSize -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgDoubleTextListPreferredImageSize( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(KTestCHgDoubleTextListPreferredImageSize, "In TestCHgDoubleTextListPreferredImageSize"); - TestModuleIf().Printf(0, Kctestplatgane, KTestCHgDoubleTextListPreferredImageSize); - iLog->Log(KTestCHgDoubleTextListPreferredImageSize); - - CHgDoubleGraphicList::PreferredImageSize(); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshggrid.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshggrid.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// ============================ MEMBER FUNCTIONS ========================= - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgGridNewL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgGridNewL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchggridnewl, "In TestCHgGridNewL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchggridnewl); - iLog->Log(Ktestchggridnewl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - CHgGrid* temp = CHgGrid::NewL( rect, item); - CleanupStack::PushL( temp ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgGridPreferredImageSize -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgGridPreferredImageSize( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(KTestCHgGridPreferredImageSize, "In TestCHgGridPreferredImageSize"); - TestModuleIf().Printf(0, Kctestplatgane, KTestCHgGridPreferredImageSize); - iLog->Log(KTestCHgGridPreferredImageSize); - - CHgGrid::PreferredImageSize(); - - return KErrNone; - } - -TInt CTestPlatGane::TestCHgGridSetLandscapeScrollingSupport( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(KTestCHgGridSetLandscapeScrollingSupport, "In TestCHgGridSetLandscapeScrollingSupport"); - TestModuleIf().Printf(0, Kctestplatgane, KTestCHgGridSetLandscapeScrollingSupport); - iLog->Log(KTestCHgGridSetLandscapeScrollingSupport); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - CHgGrid* temp = CHgGrid::NewL( rect, item); - temp->SetLandscapeScrollingSupport(ETrue); - CleanupStack::PushL( temp ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgitem.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgitem.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,272 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// ============================ MEMBER FUNCTIONS ========================= - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemNewL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemNewL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemnewl, "In TestCHgItemNewL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemnewl); - iLog->Log(Ktestchgitemnewl); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemNewLCL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemNewLCL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemnewlcl, "In TestCHgItemNewLCL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemnewlcl); - iLog->Log(Ktestchgitemnewlcl); - - CHgItem* temp = CHgItem::NewLC(); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemIconL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemIconL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemiconl, "In TestCHgItemIconL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemiconl); - iLog->Log(Ktestchgitemiconl); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - temp->Icon(); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemTitleL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemTitleL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemtitlel, "In TestCHgItemTitleL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemtitlel); - iLog->Log(Ktestchgitemtitlel); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - temp->Title(); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemTextL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemTextL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemtextl, "In TestCHgItemTextL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemtextl); - iLog->Log(Ktestchgitemtextl); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - temp->Text(); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemTimeL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemTimeL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemtimel, "In TestCHgItemTimeL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemtimel); - iLog->Log(Ktestchgitemtimel); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - temp->Time(); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemSetIconL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemSetIconL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemseticonl, "In TestCHgItemSetIconL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemseticonl); - iLog->Log(Ktestchgitemseticonl); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - temp->SetIcon( NULL ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemSetTitleL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemSetTitleL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemsettitlel, "In TestCHgItemSetTitleL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemsettitlel); - iLog->Log(Ktestchgitemsettitlel); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - temp->SetTitleL( _L( "SetTile" ) ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemSetTextL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemSetTextL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemsettextl, "In TestCHgItemSetTextL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemsettextl); - iLog->Log(Ktestchgitemsettextl); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - temp->SetTextL( _L( "SetText" ) ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemSetTimeL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemSetTimeL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemsettimel, "In TestCHgItemSetTimeL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemsettimel); - iLog->Log(Ktestchgitemsettimel); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - TInt tp = 10; - TTime time(tp); - - temp->SetTime( time ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemFlagsL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemFlagsL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemflagsl, "In TestCHgItemFlagsL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemflagsl); - iLog->Log(Ktestchgitemflagsl); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - temp->Flags(); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemSetFlagsL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemSetFlagsL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemsetflagsl, "In TestCHgItemSetFlagsL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemsetflagsl); - iLog->Log(Ktestchgitemsetflagsl); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - TInt flag = 0; - temp->SetFlags( flag ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemClearFlagsL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgItemClearFlagsL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemclearflagsl, "In TestCHgItemClearFlagsL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemclearflagsl); - iLog->Log(Ktestchgitemclearflagsl); - - CHgItem* temp = CHgItem::NewL(); - CleanupStack::PushL( temp ); - TInt flag = 0 ; - temp->ClearFlags( flag ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgscroller.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgscroller.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,916 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerInitScreenL1 -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerInitScreenL1( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerinitscreenl1, "In TestCHgScrollerInitScreenL1"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerinitscreenl1); - iLog->Log(Ktestchgscrollerinitscreenl1); - - // DSA not supported anymore. - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerInitScreenL2L -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerInitScreenL2L( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerinitscreenl2l, "In TestCHgScrollerInitScreenL2L"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerinitscreenl2l); - iLog->Log(Ktestchgscrollerinitscreenl2l); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item, - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.InitScreenL( rect ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerRefreshScreenL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerRefreshScreenL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerrefreshscreenl, "In TestCHgScrollerRefreshScreenL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerrefreshscreenl); - iLog->Log(Ktestchgscrollerrefreshscreenl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.RefreshScreen( item ); - - CleanupStack::PopAndDestroy( scroler ); - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerFirstIndexOnScreenL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerFirstIndexOnScreenL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerfirstindexonscreenl, "In TestCHgScrollerFirstIndexOnScreenL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerfirstindexonscreenl); - iLog->Log(Ktestchgscrollerfirstindexonscreenl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.FirstIndexOnScreen(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerItemsOnScreenL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerItemsOnScreenL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrolleritemsonscreenl, "In TestCHgScrollerItemsOnScreenL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrolleritemsonscreenl); - iLog->Log(Ktestchgscrolleritemsonscreenl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.ItemsOnScreen(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerItemL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerItemL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrolleriteml, "In TestCHgScrollerItemL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrolleriteml); - iLog->Log(Ktestchgscrolleriteml); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - - CHgItem* newItem = CHgItem::NewL(); - CleanupStack::PushL( newItem ); - - temp.AddItem( newItem ); - temp.ItemL( item ); - - CleanupStack::Pop( newItem ); - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerSetItemL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerSetItemL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollersetiteml, "In TestCHgScrollerSetItemL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollersetiteml); - iLog->Log(Ktestchgscrollersetiteml); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - CHgItem* newItem = CHgItem::NewL(); - - temp.SetItem( newItem, item ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerAddItemL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerAddItemL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrolleradditeml, "In TestCHgScrollerAddItemL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrolleradditeml); - iLog->Log(Ktestchgscrolleradditeml); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - - CHgItem* newItem = CHgItem::NewL(); - - temp.AddItem( newItem ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerInsertItemL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerInsertItemL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerinsertiteml, "In TestCHgScrollerInsertItemL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerinsertiteml); - iLog->Log(Ktestchgscrollerinsertiteml); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - CHgItem* newItem = CHgItem::NewL(); - - temp.InsertItem( newItem, item ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerRemoveItemL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerRemoveItemL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerremoveiteml, "In TestCHgScrollerRemoveItemL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerremoveiteml); - iLog->Log(Ktestchgscrollerremoveiteml); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - item = 0; - - CHgItem* newItem = CHgItem::NewL(); - - temp.AddItem( newItem ); - temp.RemoveItem( item ); - - CleanupStack::PopAndDestroy( scroler ); - - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerSelectedIndexL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerSelectedIndexL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerselectedindexl, "In TestCHgScrollerSelectedIndexL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerselectedindexl); - iLog->Log(Ktestchgscrollerselectedindexl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - - temp.SelectedIndex(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerSetSelectedIndexL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerSetSelectedIndexL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollersetselectedindexl, "In TestCHgScrollerSetSelectedIndexL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollersetselectedindexl); - iLog->Log(Ktestchgscrollersetselectedindexl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - item = 0; - - CHgItem* newItem = CHgItem::NewL(); - - temp.AddItem( newItem ); - temp.SetSelectedIndex( item ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerMarkL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerMarkL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollermarkl, "In TestCHgScrollerMarkL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollermarkl); - iLog->Log(Ktestchgscrollermarkl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - TInt itemmark = 0; - temp.Mark( itemmark ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerUnMarkL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerUnMarkL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerunmarkl, "In TestCHgScrollerUnMarkL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerunmarkl); - iLog->Log(Ktestchgscrollerunmarkl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - TInt itemmark = 0; - temp.Mark( itemmark ); - temp.UnMark( itemmark ); - - CleanupStack::PopAndDestroy( scroler ); - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerMarkAllL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerMarkAllL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollermarkalll, "In TestCHgScrollerMarkAllL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollermarkalll); - iLog->Log(Ktestchgscrollermarkalll); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.MarkAll(); - - CleanupStack::PopAndDestroy( scroler ); - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerUnMarkAllL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerUnMarkAllL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerunmarkalll, "In TestCHgScrollerUnMarkAllL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerunmarkalll); - iLog->Log(Ktestchgscrollerunmarkalll); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.MarkAll(); - temp.UnMarkAll(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerGetMarkedItemsL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerGetMarkedItemsL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollergetmarkeditemsl, "In TestCHgScrollerGetMarkedItemsL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollergetmarkeditemsl); - iLog->Log(Ktestchgscrollergetmarkeditemsl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - RArray indexes; - CleanupClosePushL( indexes ); - temp.GetMarkedItemsL( indexes ); - indexes.Reset(); - CleanupStack::PopAndDestroy(); - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerResetL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerResetL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerresetl, "In TestCHgScrollerResetL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerresetl); - iLog->Log(Ktestchgscrollerresetl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - - temp.Reset(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerResizeL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerResizeL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerresizel, "In TestCHgScrollerResizeL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerresizel); - iLog->Log(Ktestchgscrollerresizel); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - TInt tmp = 0; - temp.ResizeL( tmp ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerSetEmptyTextL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerSetEmptyTextL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollersetemptytextl, "In TestCHgScrollerSetEmptyTextL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollersetemptytextl); - iLog->Log(Ktestchgscrollersetemptytextl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - - TBufC tmp( _L("Hi") ); - temp.SetEmptyTextL( tmp ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerItemCountL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerItemCountL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrolleritemcountl, "In TestCHgScrollerItemCountL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrolleritemcountl); - iLog->Log(Ktestchgscrolleritemcountl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.ItemCount(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerSetScrollBarTypeL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerSetScrollBarTypeL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollersetscrollbartypel, "In TestCHgScrollerSetScrollBarTypeL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollersetscrollbartypel); - iLog->Log(Ktestchgscrollersetscrollbartypel); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.SetScrollBarTypeL( CHgScroller::EHgScrollerScrollBar ); - - CleanupStack::PopAndDestroy( scroler ); - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerSetFlagsL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerSetFlagsL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollersetflagsl, "In TestCHgScrollerSetFlagsL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollersetflagsl); - iLog->Log(Ktestchgscrollersetflagsl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - TInt tmp = 0; - temp.SetFlags( tmp ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerClearFlagsL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerClearFlagsL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerclearflagsl, "In TestCHgScrollerClearFlagsL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerclearflagsl); - iLog->Log(Ktestchgscrollerclearflagsl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - TInt tmp = 0; - temp.ClearFlags( tmp ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerFlagsL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerFlagsL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerflagsl, "In TestCHgScrollerFlagsL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerflagsl); - iLog->Log(Ktestchgscrollerflagsl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.Flags(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerHightlightItemL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerHightlightItemL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerhightlightiteml, "In TestCHgScrollerHightlightItemL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerhightlightiteml); - iLog->Log(Ktestchgscrollerhightlightiteml); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.HightlightItem( _L("Test") ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerSetDefaultIconL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerSetDefaultIconL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollersetdefaulticonl, "In TestCHgScrollerSetDefaultIconL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollersetdefaulticonl); - iLog->Log(Ktestchgscrollersetdefaulticonl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.SetDefaultIconL( NULL ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerDisableScrollBufferL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerDisableScrollBufferL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerdisablescrollbufferl, "In TestCHgScrollerDisableScrollBufferL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerdisablescrollbufferl); - iLog->Log(Ktestchgscrollerdisablescrollbufferl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - temp.DisableScrollBuffer(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerEnableScrollBufferL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerEnableScrollBufferL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerdisablescrollbufferl, "In TestCHgScrollerDisableScrollBufferL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerdisablescrollbufferl); - iLog->Log(Ktestchgscrollerdisablescrollbufferl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - TDummyObserver obs; - temp.EnableScrollBufferL(obs, 80, 20); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerSetSelectionObserver -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerSetSelectionObserver( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerdisablescrollbufferl, "In TestCHgScrollerDisableScrollBufferL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerdisablescrollbufferl); - iLog->Log(Ktestchgscrollerdisablescrollbufferl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - TDummyObserver obs; - temp.SetSelectionObserver(obs); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerSetMarkingObserver -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerSetMarkingObserver( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerdisablescrollbufferl, "In TestCHgScrollerDisableScrollBufferL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerdisablescrollbufferl); - iLog->Log(Ktestchgscrollerdisablescrollbufferl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item , - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CHgScroller& temp = scroler->Scroller(); - TDummyObserver obs; - temp.SetMarkingObserver(obs); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgscrollerwithtitle.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgscrollerwithtitle.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// ============================ MEMBER FUNCTIONS ========================= - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerWithTitleNewL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerWithTitleNewL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerwithtitlenewl, "In TestCHgScrollerWithTitleNewL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerwithtitlenewl); - iLog->Log(Ktestchgscrollerwithtitlenewl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item, - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - CleanupStack::PopAndDestroy( scroler ); - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerWithTitleInitScreenL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerWithTitleInitScreenL( CStifItemParser& /*aItem*/ ) - { - - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerwithtitleinitscreenl, "In TestCHgScrollerWithTitleInitScreenL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerwithtitleinitscreenl); - iLog->Log(Ktestchgscrollerwithtitleinitscreenl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item, - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - scroler->InitScreenL( rect ); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerWithTitleScrollerL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerWithTitleScrollerL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerwithtitlescrollerl, "In TestCHgScrollerWithTitleScrollerL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerwithtitlescrollerl); - iLog->Log(Ktestchgscrollerwithtitlescrollerl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item, - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - scroler->Scroller(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerWithTitleTitleItemL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerWithTitleTitleItemL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgscrollerwithtitletitleiteml, "In TestCHgScrollerWithTitleTitleItemL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgscrollerwithtitletitleiteml); - iLog->Log(Ktestchgscrollerwithtitletitleiteml); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgScrollerWithTitle* scroler = CHgScrollerWithTitle::NewL( rect, item, - CHgScrollerWithTitle::EHgScrollerDoubleGraphicList ); - CleanupStack::PushL( scroler ); - - scroler->TitleItem(); - - CleanupStack::PopAndDestroy( scroler ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgScrollerWithTitlePreferredImageSize -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgScrollerWithTitlePreferredImageSize( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(KTestCHgScrollerWithTitlePreferredImageSize, "In TestCHgScrollerWithTitlePreferredImageSize"); - TestModuleIf().Printf(0, Kctestplatgane, KTestCHgScrollerWithTitlePreferredImageSize); - iLog->Log(KTestCHgScrollerWithTitlePreferredImageSize); - - CHgScrollerWithTitle::PreferredImageSize(); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgsinglegraphiclist.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgsinglegraphiclist.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// ============================ MEMBER FUNCTIONS ========================= - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgSingleGraphicListNewL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgSingleGraphicListNewL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgsinglegraphiclistnewl, "In TestCHgSingleGraphicListNewL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgsinglegraphiclistnewl); - iLog->Log(Ktestchgsinglegraphiclistnewl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgSingleGraphicList* list = CHgSingleGraphicList::NewL( rect, item); - CleanupStack::PushL( list ); - CleanupStack::PopAndDestroy( list ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgSingleGraphicListPreferredImageSize -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgSingleGraphicListPreferredImageSize( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(KTestCHgSingleGraphicListPreferredImageSize, "In TestCHgSingleGraphicListPreferredImageSize"); - TestModuleIf().Printf(0, Kctestplatgane, KTestCHgSingleGraphicListPreferredImageSize); - iLog->Log(KTestCHgSingleGraphicListPreferredImageSize); - - CHgSingleGraphicList::PreferredImageSize(); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgsinglelargelist.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgsinglelargelist.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// ============================ MEMBER FUNCTIONS ========================= - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgSingleLargeListNewL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgSingleLargeListNewL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgsinglelargelistnewl, "In TestCHgSingleLargeListNewL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgsinglelargelistnewl); - iLog->Log(Ktestchgsinglelargelistnewl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgSingleLargeList* list = CHgSingleLargeList::NewL( rect, item); - CleanupStack::PushL( list ); - CleanupStack::PopAndDestroy( list ); - - return KErrNone; - - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgSingleLargeListPreferredImageSize -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgSingleLargeListPreferredImageSize( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(KTestCHgSingleLargeListPreferredImageSize, "In TestCHgSingleLargeListPreferredImageSize"); - TestModuleIf().Printf(0, Kctestplatgane, KTestCHgSingleLargeListPreferredImageSize); - iLog->Log(KTestCHgSingleLargeListPreferredImageSize); - - CHgSingleLargeList::PreferredImageSize(); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgsingletextlist.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgsingletextlist.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgSingleTextListL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgSingleTextListL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgsingletextlistl, "In TestCHgSingleTextListL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgsingletextlistl); - iLog->Log(Ktestchgsingletextlistl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgSingleTextList* list = CHgSingleTextList::NewL( rect, item); - CleanupStack::PushL( list ); - CleanupStack::PopAndDestroy( list ); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgsingletextlistwithicon.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgsingletextlistwithicon.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgSingleTextListL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgSingleTextListWithIconNewL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgsingletextlistl, "In TestCHgSingleTextListWithIconNewL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgsingletextlistl); - iLog->Log(Ktestchgsingletextlistl); - - TInt left = 0; - TInt wrigth = KTest; - TInt item = 0; - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); - - CHgSingleTextListWithIcon* list = CHgSingleTextListWithIcon::NewL( rect, item);//) - CleanupStack::PushL( list ); - CleanupStack::PopAndDestroy( list ); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgvgitem.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgvgitem.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - -// ============================ MEMBER FUNCTIONS ========================= - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemNewL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgItemNewL( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemnewl, "In TestCHgVgItemNewL"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemnewl); - iLog->Log(Ktestchgitemnewl); - - CHgVgItem* temp = CHgVgItem::NewL(); - CleanupStack::PushL( temp ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemNewLCL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgItemNewLC( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemnewlcl, "In TestCHgVgItemNewLC"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemnewlcl); - iLog->Log(Ktestchgitemnewlcl); - - CHgVgItem* temp = CHgVgItem::NewLC(); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgItemSetIconL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgItemSetIcon( CStifItemParser& /*aItem*/ ) - { - _LIT(Kctestplatgane, "CTestPlatGane"); - _LIT(Ktestchgitemseticonl, "In TestCHgVgItemSetIcon"); - TestModuleIf().Printf(0, Kctestplatgane, Ktestchgitemseticonl); - iLog->Log(Ktestchgitemseticonl); - - CHgVgItem* temp = CHgVgItem::NewL(); - CleanupStack::PushL( temp ); - temp->SetIcon( NULL ); - CleanupStack::PopAndDestroy( temp ); - - return KErrNone; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 classicui_plat/ganes_api/tsrc/src/testplatganeblockshgvgmediawall.cpp --- a/classicui_plat/ganes_api/tsrc/src/testplatganeblockshgvgmediawall.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,356 +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: ganes_api -* -*/ - -// [INCLUDE FILES] -#include "testplatgane.h" - - - -_LIT(Kctestplatgane, "CTestPlatGane"); -const CHgVgMediaWall::THgVgOpeningAnimationType KDefaultSelectionAnimation( - CHgVgMediaWall::EHgVgOpeningAnimationFlipToFront); -const CHgVgMediaWall::THgVgMediaWallStyle KDefaultStyle( - CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen); -const TBool KDefaultScrollBarState(ETrue); -const TInt KDefaultAmountOfItems(0); -const TInt KScrollBufferSize(80); - -#define START_TEST(TEST_NAME, FUNCTION_NAME) \ - TInt left = 0; \ - TInt wrigth = KTest; \ - TRect rect(TPoint( left, left), TPoint( wrigth, wrigth) ); \ - CHgVgMediaWall* temp = CHgVgMediaWall::NewL ( rect, KDefaultAmountOfItems, KDefaultStyle, \ - KDefaultScrollBarState, NULL, NULL ); \ - CleanupStack::PushL( temp ); - -#define END_TEST \ - CleanupStack::PopAndDestroy( temp ); \ - return KErrNone; - -// ============================ MEMBER FUNCTIONS ========================= - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgGridNewL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallNewL ( CStifItemParser& ) - { - START_TEST(newl, TestCHgVgMediaWallNewL) - END_TEST - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallInitScreenL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallInitScreenL ( CStifItemParser& ) - { - START_TEST(initscreenl, TestCHgVgMediaWallInitScreenL) - temp->InitScreenL( rect ); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallRefreshScreen -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallRefreshScreen ( CStifItemParser& ) - { - START_TEST(refreshscreen, TestCHgVgMediaWallRefreshScreen) - temp->RefreshScreen(0); - END_TEST - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallFirstIndexOnScreen -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallFirstIndexOnScreen ( CStifItemParser& ) - { - START_TEST(firstindexonscreen, TestCHgVgMediaWallFirstIndexOnScreen) - temp->FirstIndexOnScreen(); - END_TEST - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallItemsOnScreen -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallItemsOnScreen ( CStifItemParser& ) - { - START_TEST(itemsonscreen, TestCHgVgMediaWallItemsOnScreen) - temp->ItemsOnScreen(); - END_TEST - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallItemL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallItemL ( CStifItemParser& ) - { - START_TEST(iteml, TestCHgVgMediaWallItemL) - temp->AddItem(CHgVgItem::NewL()); - temp->ItemL(0); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallSetItem -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallSetItem ( CStifItemParser& ) - { - START_TEST(setitem, TestCHgVgMediaWallSetItem) - CHgVgItem* newItem = CHgVgItem::NewL(); - temp->SetItem( newItem, 0 ); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallAddItem -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallAddItem ( CStifItemParser& ) - { - START_TEST(additem, TestCHgVgMediaWallAddItem) - CHgVgItem* newItem = CHgVgItem::NewL(); - temp->AddItem( newItem ); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallInsertItem -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallInsertItem ( CStifItemParser& ) - { - START_TEST(insertitem, TestCHgVgMediaWallInsertItem) - CHgVgItem* newItem = CHgVgItem::NewL(); - temp->InsertItem( newItem, 0 ); - END_TEST - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallRemoveItem -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallRemoveItem ( CStifItemParser& ) - { - START_TEST(removeitem, TestCHgVgMediaWallRemoveItem) - CHgVgItem* newItem = CHgVgItem::NewL(); - temp->AddItem( newItem ); - temp->RemoveItem(0); - END_TEST - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallSelectedIndex -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallSelectedIndex ( CStifItemParser& ) - { - START_TEST(selectedindex, TestCHgVgMediaWallSelectedIndex) - temp->SelectedIndex(); - END_TEST - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallSetSelectedIndex -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallSetSelectedIndex ( CStifItemParser& ) - { - START_TEST(setselectedindex, TestCHgVgMediaWallSetSelectedIndex) - temp->SetSelectedIndex(0); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallEnableScrollBufferL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallEnableScrollBufferL ( CStifItemParser& ) - { - START_TEST(enablescrollbufferl, TestCHgVgMediaWallEnableScrollBufferL) - TDummyObserver obs; - temp->EnableScrollBufferL(obs, KScrollBufferSize, KScrollBufferSize / 4); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallSetSelectionObserver -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallSetSelectionObserver ( CStifItemParser& ) - { - START_TEST(setselectionobserver, TestCHgVgMediaWallSetSelectionObserver) - TDummyObserver obs; - temp->SetSelectionObserver(obs); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallReset -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallReset ( CStifItemParser& ) - { - START_TEST(reset, TestCHgVgMediaWallReset) - temp->Reset(); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallResizeL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallResizeL ( CStifItemParser& ) - { - START_TEST(resizel, TestCHgVgMediaWallResizeL) - temp->ResizeL(100); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallSetEmptyTextL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallSetEmptyTextL ( CStifItemParser& ) - { - START_TEST(setemptytextl, TestCHgVgMediaWallSetEmptyTextL) - temp->SetEmptyTextL(_L("Empty")); - END_TEST - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallItemCount -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallItemCount ( CStifItemParser& ) - { - START_TEST(itemcount, TestCHgVgMediaWallItemCount) - temp->ItemCount(); - END_TEST - } - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallSetDefaultIconL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallSetDefaultIconL ( CStifItemParser& ) - { - START_TEST(setdefaulticonl, TestCHgVgMediaWallSetDefaultIconL) - temp->SetDefaultIconL(NULL); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallDisableScrollBuffer -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallDisableScrollBuffer ( CStifItemParser& ) - { - START_TEST(disablescrollbuffer, TestCHgVgMediaWallDisableScrollBuffer) - temp->DisableScrollBuffer(); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallChangeStyleL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallChangeStyleL ( CStifItemParser& ) - { - START_TEST(changestylel, TestCHgVgMediaWallChangeStyleL) - temp->ChangeStyleL(CHgVgMediaWall::EHgVgMediaWallStyleCoverflowTBonePortrait, - rect, EFalse); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallSetObserver -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallSetObserver ( CStifItemParser& ) - { - START_TEST(setobserver, TestCHgVgMediaWallSetObserver) - temp->SetObserver(NULL); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallSetOpeningAnimationType -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallSetOpeningAnimationType ( CStifItemParser& ) - { - START_TEST(setopeninganimationtype, TestCHgVgMediaWallSetOpeningAnimationType) - temp->SetOpeningAnimationType(CHgVgMediaWall::EHgVgOpeningAnimationNone); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallStyle -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallStyle ( CStifItemParser& ) - { - START_TEST(setobserver, TestCHgVgMediaWallStyle) - temp->Style(); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallOpeningAnimationType -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallOpeningAnimationType ( CStifItemParser& ) - { - START_TEST(openinganimationtype, TestCHgVgMediaWallOpeningAnimationType) - temp->OpeningAnimationType(); - END_TEST - } - - -// -------------------------------------------------------------------------- -// CTestPlatGane::TestCHgVgMediaWallStartOpeningAnimationL -// -------------------------------------------------------------------------- -// -TInt CTestPlatGane::TestCHgVgMediaWallStartOpeningAnimationL ( CStifItemParser& ) - { - START_TEST(startopeninganimationl, TestCHgVgMediaWallStartOpeningAnimationL) - temp->StartOpeningAnimationL(ETrue); - END_TEST - } - - diff -r 0e1e0022bd03 -r 2f0c06423c72 commonuis/CommonUi/group/CommonUI.mmp --- a/commonuis/CommonUi/group/CommonUI.mmp Thu Jul 29 14:21:56 2010 +0800 +++ b/commonuis/CommonUi/group/CommonUI.mmp Fri Aug 06 17:25:01 2010 +0800 @@ -111,7 +111,6 @@ LIBRARY etext.lib // For class CPlainText, class TCharFormat LIBRARY form.lib // For class CTextLayout LIBRARY eikctl.lib // For class CRichText -LIBRARY sendui.lib // For class CSendUi, class CMessageData #ifndef RD_VIRTUAL_PHONEBOOK LIBRARY PbkView.lib // For class RPbkViewResourceFile, class CPbkDataSaveAppUi LIBRARY PbkEng.lib // For class CPbkContactEngine, class CPbkFieldInfo diff -r 0e1e0022bd03 -r 2f0c06423c72 commonuis/CommonUi/src/FindItemDialog.cpp --- a/commonuis/CommonUi/src/FindItemDialog.cpp Thu Jul 29 14:21:56 2010 +0800 +++ b/commonuis/CommonUi/src/FindItemDialog.cpp Fri Aug 06 17:25:01 2010 +0800 @@ -47,10 +47,6 @@ #include // AiwContactAssign #endif // !RD_VIRTUAL_PHONEBOOK -#include // for CSendAppUi -#include // for CMessageData -#include // Mtm uids - #include // Phonenumber parser #include // For CClipboard @@ -301,7 +297,6 @@ delete iSBFrame; delete iItemArrayForScrollBar; - delete iSendUi; #ifndef RD_VIRTUAL_PHONEBOOK delete iPbkDataSave; delete iPbkEngine; @@ -612,39 +607,7 @@ // void CFindItemDialog::SendMessageL( const TUid aMtmUid ) { - __ASSERT_DEBUG( iEdwin->SelectionLength() > 0, Panic( ENoItemSelected ) ); - - if ( !iSendUi ) - { - return; - } - - // Hide options menu if showing - if ( CAknDialog::MenuShowing() ) - { - CAknDialog::HideMenu(); - } - - TCursorSelection selection = iEdwin->Selection(); - HBufC* number = HBufC::NewLC( selection.Length() ); - TPtr numberPtr = number->Des(); - numberPtr.Append( - iPlainText.Mid( - selection.LowerPos(), selection.Length() ) ); - if ( iSearchCase & CFindItemEngine::EFindItemSearchPhoneNumberBin ) - { - CommonPhoneParser::ParsePhoneNumber( - numberPtr, CommonPhoneParser::EPlainPhoneNumber ); - AknTextUtils::ConvertDigitsTo( numberPtr, EDigitTypeWestern ); - } - - CMessageData* messageData = CMessageData::NewL(); - CleanupStack::PushL( messageData ); - messageData->AppendToAddressL( *number ); - - iSendUi->CreateAndSendMessageL( aMtmUid, messageData ); - CleanupStack::PopAndDestroy(2); // messageData, number - + } // ----------------------------------------------------------------------------- @@ -831,64 +794,6 @@ // fix for FAMZ-7JVQ4Y case EFindItemSubMenuSend: { - CFindItemEngine::SFoundItem item; - TBool founditem = iController->Item( item ); - TSendingCapabilities sendingCapabilities; - sendingCapabilities.iFlags = TSendingCapabilities::ESupportsEditor; - CArrayFixFlat* mtmFilter = new(ELeave) CArrayFixFlat( 1 ); - CleanupStack::PushL(mtmFilter); - mtmFilter->AppendL(KSenduiMtmPostcardUid);// hide postcard - // Hide MMs - #ifndef RD_UNIFIED_EDITOR - if( !iMMSFeatureSupported ) - { - mtmFilter->AppendL(KSenduiMtmMmsUid); - } - #endif - - // Hide Sms - if ( iSearchCase == CFindItemEngine::EFindItemSearchMailAddressBin || - ( iFindItemVoIPExtension->IsVoIPSupported() && - founditem && item.iItemType == CFindItemEngine::EFindItemSearchMailAddressBin && - iSearchCase == KSearchTelInternetNumber ) ) - { - #ifndef RD_UNIFIED_EDITOR - if ( !iEmailOverSmsFeatureSupported ) - { - mtmFilter->AppendL(KSenduiMtmSmsUid); - } - #endif - } - - // Hide Mail - else if ( !iEmailUiFeatureSupported || - ( iSearchCase == CFindItemEngine::EFindItemSearchPhoneNumberBin || - ( iFindItemVoIPExtension->IsVoIPSupported() && founditem && - item.iItemType == CFindItemEngine::EFindItemSearchPhoneNumberBin && - iSearchCase == KSearchTelInternetNumber ) ) ) - { - mtmFilter->AppendL(KSenduiMtmSmtpUid); - mtmFilter->AppendL(KSenduiMtmImap4Uid); - mtmFilter->AppendL(KSenduiMtmPop3Uid); - mtmFilter->AppendL(KSenduiMtmSyncMLEmailUid); - } - // Hide Audio - if ( iSearchCase != CFindItemEngine::EFindItemSearchPhoneNumberBin || - !iAudioMessagingFeatureSupported ) - { - mtmFilter->AppendL(KSenduiMtmAudioMessageUid); - } - - TUid uid = iSendUi->ShowTypedQueryL( CSendUi::EWriteMenu, NULL, sendingCapabilities, mtmFilter ); - - CleanupStack::PopAndDestroy(); - - if ( uid == KNullUid ) - { - break; - } - SendMessageL(uid); - break; } case EFindItemCmdGoToUrl: @@ -1589,7 +1494,6 @@ if ( iSearchCase == KSearchTelInternetNumber ) { resource = R_FINDITEM_TITLE_TELINTERNET; - iSendUi = CSendUi::NewL(); } else if ( iSearchCase & CFindItemEngine::EFindItemSearchURLBin ) { @@ -1598,12 +1502,10 @@ else if ( iSearchCase & CFindItemEngine::EFindItemSearchMailAddressBin ) { resource = R_FINDITEM_TITLE_MAIL; - iSendUi = CSendUi::NewL(); } else if ( iSearchCase & CFindItemEngine::EFindItemSearchPhoneNumberBin ) { resource = R_FINDITEM_TITLE_PHONE; - iSendUi = CSendUi::NewL(); } else { diff -r 0e1e0022bd03 -r 2f0c06423c72 commonuis/CommonUi/src/FindItemMenu.cpp --- a/commonuis/CommonUi/src/FindItemMenu.cpp Thu Jul 29 14:21:56 2010 +0800 +++ b/commonuis/CommonUi/src/FindItemMenu.cpp Fri Aug 06 17:25:01 2010 +0800 @@ -28,11 +28,7 @@ #include -#include // for CSendAppUi -#include // for CMessageData - #include // Phonenumber parser -#include // Mtm uids #include // RApaLsSession for WMLBrowser launch #include @@ -209,7 +205,7 @@ } delete iRPbkResourceFile; #endif // !RD_VIRTUAL_PHONEBOOK - delete iSendUi; + delete iSenderDescriptor; delete iServiceHandler; @@ -903,49 +899,6 @@ } case EFindItemSubMenuSend: { - TSendingCapabilities sendingCapabilities; - sendingCapabilities.iFlags = TSendingCapabilities::ESupportsEditor; - CArrayFixFlat* mtmFilter = new(ELeave) CArrayFixFlat( 1 ); - CleanupStack::PushL(mtmFilter); - CItemFinder::TItemType itemType = iAutomaticFind ? iAutomaticFind->CurrentItemExt().iItemType : CItemFinder::ENoneSelected; - - mtmFilter->AppendL(KSenduiMtmPostcardUid);// dim postcard - // Hide SMS if not supported - - #ifndef RD_UNIFIED_EDITOR - if ( !iEmailOverSmsFeatureSupported ) - { - mtmFilter->AppendL(KSenduiMtmSmsUid); - } - // Hide MMS if not supported - if (!iMMSFeatureSupported) - { - mtmFilter->AppendL(KSenduiMtmMmsUid); - } - #endif - - // Hide E-Mail if nosupported or phonenumber - if ( !iEmailUiFeatureSupported || itemType == CItemFinder::EPhoneNumber ) - { - mtmFilter->AppendL(KSenduiMtmSmtpUid); - mtmFilter->AppendL(KSenduiMtmImap4Uid); - mtmFilter->AppendL(KSenduiMtmPop3Uid); - mtmFilter->AppendL(KSenduiMtmSyncMLEmailUid); - } - // Hide Audio if not supported or E-mail address - if( !iAudioMessagingFeatureSupported || itemType == CItemFinder::EEmailAddress) - { - mtmFilter->AppendL(KSenduiMtmAudioMessageUid); - } - TUid uid = iSendUi->ShowTypedQueryL( CSendUi::EWriteMenu, NULL, sendingCapabilities, mtmFilter ); - - CleanupStack::PopAndDestroy(); - if ( uid == KNullUid ) - { - break; - } - SendMessageL(uid); - break; } @@ -1134,29 +1087,7 @@ void CFindItemMenu::SendMessageL( const TUid aMtmUid ) { - HBufC* parsedAddress = 0; - TBool isNumber = EFalse; - if ( iAutomaticFind && iAutomaticFind->CurrentItemExt().iItemType == CItemFinder::EEmailAddress ) - { - parsedAddress = iAutomaticFind->CurrentItemExt().iItemDescriptor; - } - else - { - // if sender descriptor is something else than phone number it will - // still go through this brach.. - TBool numberSelected = ( iAutomaticFind && iAutomaticFind->CurrentItemExt().iItemType == CItemFinder::EPhoneNumber ); - parsedAddress = ( numberSelected ? iAutomaticFind->CurrentItemExt().iItemDescriptor : iSenderDescriptor)->AllocLC(); - TPtr numberPtr = parsedAddress->Des(); - CommonPhoneParser::ParsePhoneNumber( numberPtr, CommonPhoneParser::EPlainPhoneNumber ); - AknTextUtils::ConvertDigitsTo( numberPtr, EDigitTypeWestern ); - isNumber = ETrue; - } - - CMessageData* messageData = CMessageData::NewL(); - CleanupStack::PushL( messageData ); - messageData->AppendToAddressL( parsedAddress->Des() ); - iSendUi->CreateAndSendMessageL( aMtmUid,messageData ); - CleanupStack::PopAndDestroy( isNumber ? 2 : 1 ); // messageData, number + } void CFindItemMenu::GoToUrlL( TUid /*aHandlerAppUid*/ ) @@ -1355,7 +1286,6 @@ iPbkEngine = CPbkContactEngine::NewL(); iPbkDataSave = CPbkDataSaveAppUi::NewL( *iPbkEngine ); #endif // !RD_VIRTUAL_PHONEBOOK - iSendUi = CSendUi::NewL(); TRAPD( ret, iCommonUiRepository = CRepository::NewL( KCRUidCommonUi ) ); if ( ret == KErrNone ) diff -r 0e1e0022bd03 -r 2f0c06423c72 commonuisupport/uikon/group_ncp/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/commonuisupport/uikon/group_ncp/bld.inf Fri Aug 06 17:25:01 2010 +0800 @@ -0,0 +1,104 @@ +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies 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 Framework (LAF policy-free) +// +// + +/** + @file +*/ + +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 + +// from ..\coreinc\coreincc.prj +../coreinc/eikamnt.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikamnt.h) +../coreinc/eikautomenutitlearray.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikautomenutitlearray.h) +../coreinc/EIKAPP.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikapp.h) +../coreinc/EIKCMOBS.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikcmobs.h) +../coreinc/EIKDEBUG.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eikdebug.h) +../coreinc/EIKDEF.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikdef.h) +../coreinc/EIKDLL.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikdll.h) +../coreinc/EIKDOC.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikdoc.h) +../coreinc/EIKEMBAL.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikembal.h) +../coreinc/EIKFCTRY.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikfctry.h) +../coreinc/EIKFUTIL.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikfutil.h) +../coreinc/EIKIRFTY.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eikirfty.h) +../coreinc/EIKMOBS.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikmobs.h) +../coreinc/EIKMSG.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikmsg.h) +../coreinc/EIKPANIC.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eikpanic.h) +../coreinc/EIKPROC.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikproc.h) +../coreinc/EIKRUTIL.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikrutil.h) +../coreinc/EIKSVDEF.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eiksvdef.h) +../coreinc/eikvcurs.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikvcurs.h) +../coreinc/eikbhelp.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikbhelp.h) +../coreinc/EIKSTART.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikstart.h) +../coreinc/EikServerApp.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eikserverapp.h) +../coreinc/EIKENV.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikenv.h) +../coreinc/eikenvinterface.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikenvinterface.h) +../coreinc/EIKAPPUI.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikappui.h) +../coreinc/EIKAUFTY.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikaufty.h) +../coreinc/eikpicturefactory.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eikpicturefactory.h) +../coreinc/eikmischelp.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikmischelp.h) +../coreinc/eikdefaulticondefs.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikdefaulticondefs.h) +../coreinc/eikctrlstatus.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikctrlstatus.h) +../coreinc/eikdefconst.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikdefconst.h) +../coreinc/eikdefmacros.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikdefmacros.h) +#ifdef SYMBIAN_OLD_EXPORT_LOCATION +../coreinc/eikdefconstinternal.h /epoc32/include/uikon/eikdefconstinternal.h +#endif +../coreinc/EIKDGFTY.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eikdgfty.h) +../coreinc/EIKLIBRY.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eiklibry.h) +../coreinc/EikInfoMsgWin.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eikinfomsgwin.h) +../coreinc/EikBusyMsgWin.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eikbusymsgwin.h) +../coreinc/eikenv.inl SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikenv.inl) +../coreinc/eikenvinterface.inl SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikenvinterface.inl) + +../srvinc/eiksrv.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eiksrv.h) +../srvinc/eikcycledef.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eikcycledef.h) +../srvinc/EIKSRVC.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eiksrvc.h) +../srvinc/EIKSRVS.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eiksrvs.h) +../srvinc/EIKUNDER.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eikunder.h) +../srvinc/EIKALSRV.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(uikon/eikalsrv.h) +../srvinc/EIKALSUP.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikalsup.h) +../srvinc/EIKNFYSV.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eiknfysv.h) +../srvinc/EIKSVFTY.H SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eiksvfty.h) +../srvinc/EIKSRV.PAN SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(eiksrv.pan) +../srvinc/eiknotapi.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(eiknotapi.h) +../srvinc/patchdata.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/patchdata.h) +../srvinc/eikscchange.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eikscchange.h) +../srvinc/eiknotifyalert.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(uikon/eiknotifyalert.h) + +../group/uikon.iby /epoc32/rom/include/uikon.iby + +../bwins/EIKINITU.DEF /epoc32/release/wins/eikinitu.def +../eabi/EIKINITU.DEF /epoc32/include/def/eabi/eikinitu.def + +// from ..\docs +//../docs/extended_notifier_design_spec.doc /epoc32/engdoc/application_framework/uikon/proposed/extended_notifier_design_spec.doc +//../docs/status_pane_design.doc /epoc32/engdoc/application_framework/uikon/status_pane_design.doc +//../docs/uikon_1.2_menu_extensions.doc /epoc32/engdoc/application_framework/uikon/uikon_1.2_menu_extensions.doc +//../docs/uikon_1.2_border_extensions.doc /epoc32/engdoc/application_framework/uikon/uikon_1.2_border_extensions.doc +//../docs/uikon_1.2_border_colours_utilities_extensions.doc /epoc32/engdoc/application_framework/uikon/uikon_1.2_border_colours_utilities_extensions.doc +//../docs/Uikon_1.2_Caps_Lock_Extension.doc /epoc32/engdoc/application_framework/uikon/uikon_1.2_caps_lock_extension.doc + + +PRJ_MMPFILES + +../group/EIKSRVC.MMP +../group/EIKCORE.MMP + diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/AknGlobalUI/AknCapServer/group/AknCapServer.mmp --- a/uifw/AknGlobalUI/AknCapServer/group/AknCapServer.mmp Thu Jul 29 14:21:56 2010 +0800 +++ b/uifw/AknGlobalUI/AknCapServer/group/AknCapServer.mmp Fri Aug 06 17:25:01 2010 +0800 @@ -105,7 +105,6 @@ LIBRARY syslangutil.lib LIBRARY centralrepository.lib LIBRARY akntransitionutils.lib -LIBRARY widgetregistryclient.lib LIBRARY akndynamicsoftnoteeventmanager.lib LIBRARY ecompluginnotifier.lib LIBRARY touchfeedback.lib diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/AknGlobalUI/AknCapServer/inc/AknFastswapWindowControl.h --- a/uifw/AknGlobalUI/AknCapServer/inc/AknFastswapWindowControl.h Thu Jul 29 14:21:56 2010 +0800 +++ b/uifw/AknGlobalUI/AknCapServer/inc/AknFastswapWindowControl.h Fri Aug 06 17:25:01 2010 +0800 @@ -26,8 +26,6 @@ #include #include #include // MCoeControlObserver - -#include #include // CONSTANTS @@ -43,8 +41,6 @@ class CAknInfoPopupNoteController; class CEikLabel; class CAknAlwaysShownAppList; - -class CAknWidgetList; class CAknChoiceList; class CAknStylusPopUpMenu; class CAknLongTapAnimation; @@ -504,13 +500,6 @@ TBool iAppArcSessionInitiated; RApaLsSession iAppArcSession; - /** Contains data of running widgets */ - CAknWidgetList* iWidgetList; - friend class CAknWidgetList; - /** Window group id of Widget application */ - TInt iWidgetAppUiWgId; - TBool iWidgetsSupported; - // Tooltip that shows application names. CAknInfoPopupNoteController* iTooltip; CEikLabel* iLabel; diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/AknGlobalUI/AknCapServer/inc/AknKeyFilter.h --- a/uifw/AknGlobalUI/AknCapServer/inc/AknKeyFilter.h Thu Jul 29 14:21:56 2010 +0800 +++ b/uifw/AknGlobalUI/AknCapServer/inc/AknKeyFilter.h Fri Aug 06 17:25:01 2010 +0800 @@ -37,7 +37,6 @@ TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); private: // new functions - TKeyResponse HandleHomeKeyEventL(TEventCode aType); TKeyResponse HandleQwertyKeyEvent(const TKeyEvent& aKeyEvent, TEventCode aType); void HandleFlipKeyEvent(TInt aCode); static TInt HomeTickL(TAny* aThis); @@ -57,7 +56,6 @@ CAknCapAppServerAppUi* iAppUi; // not owned CPeriodic* iHomeTimer; TInt iSuppressAppSwitch; - TInt iHomeKeyHandle; TVwsViewId iHomeViewId; RArray iHardwareStateKeyCaptures; TInt iQwertyOnKeyHandle; diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/AknGlobalUI/AknCapServer/src/AknFastswapWindowControl.cpp --- a/uifw/AknGlobalUI/AknCapServer/src/AknFastswapWindowControl.cpp Thu Jul 29 14:21:56 2010 +0800 +++ b/uifw/AknGlobalUI/AknCapServer/src/AknFastswapWindowControl.cpp Fri Aug 06 17:25:01 2010 +0800 @@ -39,8 +39,6 @@ #include #include #include -#include -#include #include #include #include @@ -157,150 +155,6 @@ return KErrNone; } -NONSHARABLE_CLASS(CAknWidgetList) : public CBase - { - public: - static CAknWidgetList* NewL( CAknFastSwapWindowControl& aParent ); - /** Destructor */ - ~CAknWidgetList(); - - /** - * Initializes the list that stores widgets. - * @return - - */ - void InitializeWidgetListL(); - - /** - * Check if a uid is the uid of the widget application. - * @param aAppUid The application uid to be checked. - * @return ETrue application uid belongs to widget application - EFalse otherwise. - */ - TBool IsWidgetAppUI( TUid aAppUid ); - - /** - * Check if the window group id value refers to widget. - * @param aWgId window group id. - * @return ETrue if window group id has value that refers to widget. - */ - TBool IsWidget( TInt aWgId ); - - /** - * Map tasklist application index to application Uid. - * - * @param aIndex index of tasklist item array. - * @param aAlwaysShownCount number of applications that are always shown on - the active applications list. - * @return application Uid - */ - TUid IndexToAppUid( TInt aIndex, TInt aAlwaysShownCount ); - - private: - /** Constructor */ - CAknWidgetList( CAknFastSwapWindowControl& aParent ); - void ConstructL(); - void ResetArrayOfWidgetInfo( RWidgetInfoArray& aWidgetInfoArr ); - - static void CleanupConnect( TAny* aThis ); - - public: - /** Contains list of widgets that are currently running */ - RWidgetInfoArray iRunningWidgets; - private: - CAknFastSwapWindowControl& iParent; - RWidgetRegistryClientSession iWidgetRegistryClientSession; - }; - - -CAknWidgetList* CAknWidgetList::NewL( CAknFastSwapWindowControl& aParent ) - { - _AKNTRACE_FUNC_ENTER; - CAknWidgetList* self = new (ELeave) CAknWidgetList( aParent ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); //self - _AKNTRACE_FUNC_EXIT; - return self; - } - -CAknWidgetList::CAknWidgetList( CAknFastSwapWindowControl& aParent ): iParent( aParent ) - { - } - -CAknWidgetList::~CAknWidgetList() - { - _AKNTRACE_FUNC_ENTER; - ResetArrayOfWidgetInfo( iRunningWidgets ); - iRunningWidgets.Reset(); - _AKNTRACE_FUNC_EXIT; - } - -void CAknWidgetList::ConstructL() - { - } - -void CAknWidgetList::CleanupConnect( TAny* aThis ) - { - _AKNTRACE_FUNC_ENTER; - (( CAknWidgetList*)aThis)->iWidgetRegistryClientSession.Disconnect(); - _AKNTRACE_FUNC_EXIT; - } - -void CAknWidgetList::InitializeWidgetListL() - { - _AKNTRACE_FUNC_ENTER; - ResetArrayOfWidgetInfo( iRunningWidgets ); - iRunningWidgets.Reset(); - User::LeaveIfError( iWidgetRegistryClientSession.Connect() ); - CleanupStack::PushL( TCleanupItem( CleanupConnect, this) ); - iWidgetRegistryClientSession.RunningWidgetsL(iRunningWidgets); - for ( TInt i = iRunningWidgets.Count() - 1; i > -1; i-- ) - { - if ( !iWidgetRegistryClientSession.IsWidgetInFullView(iRunningWidgets[i]->iUid) ) - { - delete iRunningWidgets[i]; - iRunningWidgets.Remove(i); - } - } - CleanupStack::Pop(); // clean WidgetRegistryClientSession item - iWidgetRegistryClientSession.Disconnect(); - _AKNTRACE_FUNC_EXIT; - } - -TBool CAknWidgetList::IsWidgetAppUI( TUid aAppUid ) - { - _AKNTRACE( "[%s] aAppUid = %d", - __FUNCTION__, aAppUid.iUid ); - return (aAppUid == KWidgetAppUid); - } - -TBool CAknWidgetList::IsWidget( TInt aWgId ) - { - _AKNTRACE( "[%s] aWgId = %d", - __FUNCTION__, aWgId ); - return (aWgId == KWidgetWithoutWG); - } - -TUid CAknWidgetList::IndexToAppUid( TInt aIndex, TInt aAlwaysShownCount ) - { - _AKNTRACE( "[%s] aIndex = %d aAlwaysShownCount = %d", - __FUNCTION__, aIndex, aAlwaysShownCount ); - return iRunningWidgets[aIndex + iRunningWidgets.Count() + - aAlwaysShownCount - iParent.iNumberOfWGs]->iUid; - } - -void CAknWidgetList::ResetArrayOfWidgetInfo( - RWidgetInfoArray& aWidgetInfoArr ) - { - _AKNTRACE_FUNC_ENTER; - for ( TInt i = 0; i < aWidgetInfoArr.Count(); i++ ) - { - CWidgetInfo *item = aWidgetInfoArr[i]; - delete item ; - } - _AKNTRACE_FUNC_EXIT; - } - - NONSHARABLE_CLASS(CAknAlwaysShownAppList) : public CBase { public: @@ -528,9 +382,8 @@ // might leave. // CAknFastSwapWindowControl::CAknFastSwapWindowControl(CAknCapAppServerAppUi& aAppUi) -: iAppUi( aAppUi ),iLowMemory( EFalse ), iLowMemIcons( EFalse ), iAppArcSessionInitiated( EFalse ), - iWidgetAppUiWgId(-1), iWidgetsSupported( EFalse ), - iTooltipModeTouch( EFalse ),iTransparencyEnabled( CAknEnv::Static()->TransparencyEnabled() ), +: iAppUi( aAppUi ), iLowMemory( EFalse ), iLowMemIcons( EFalse ), iAppArcSessionInitiated( EFalse ), + iTooltipModeTouch( EFalse ), iTransparencyEnabled( CAknEnv::Static()->TransparencyEnabled() ), iIsStylusPopupShow(EFalse), iState( EWaiting ) { AKNTASHOOK_ADD( this, "CAknFastSwapWindowControl" ); @@ -559,10 +412,6 @@ } } - if (FeatureManager::FeatureSupported(KFeatureIdWebWidgets)) - { - iWidgetsSupported = ETrue; - } CreateCbaL(); CreateGridL(); CreateItemArraysL(); @@ -587,10 +436,6 @@ // the list for always shown applications in the fast swap iAlwaysShownList = CAknAlwaysShownAppList::NewL( *this ); - if (iWidgetsSupported) - { - iWidgetList = CAknWidgetList::NewL( *this ); - } MakeVisible( EFalse ); _AKNTRACE_FUNC_EXIT; } @@ -610,7 +455,7 @@ AknsUtils::DeregisterControlPosition( iGrid ); } delete iAlwaysShownList; - delete iWidgetList; + FadeBackground( EFalse ); delete iFrameContext; delete iGrid; // destroys also iIconArray and scrollbar frame @@ -886,10 +731,7 @@ iAppArcSession.GetAllApps(); // create list for always shown applications iAlwaysShownList->InitializeAlwaysShownListL(); - if (iWidgetsSupported) - { - iWidgetList->InitializeWidgetListL(); - } + //Initializes CAknFastSwapWindowControl private data ( iWgIds, iNumberOfWGs ) RWsSession& wsSession=iEikonEnv->WsSession(); TInt count=wsSession.NumWindowGroups( 0 ); @@ -940,10 +782,7 @@ { iAlwaysShownList->AddWgGroupToAlwaysShownList( applicationUid, wgId ); } - else if (iWidgetsSupported && iWidgetList->IsWidgetAppUI(applicationUid)) - { - iWidgetAppUiWgId = wgId; - } + // could't use windowName->IsAppReady(), because then java and console application // wouldn't be seen in FSW. Now it is possible that some system apps are seen at the // beginning of their start for a while in FSW (even they should be hidden all the time) @@ -959,15 +798,6 @@ } } - if (iWidgetsSupported) - { - for ( TInt index = 0; index < iWidgetList->iRunningWidgets.Count(); index++) - { - SWindowGroupInfo wgInfo = { KWidgetWithoutWG, EFalse }; - shownWgIds->AppendL( wgInfo ); - } - } - // always shown applications are appended to the end of window group list for ( TInt index = 0; index < iAlwaysShownList->iAppList->Count(); index++) { @@ -2043,21 +1873,6 @@ name.Append( KTab ); name.Append( caption ); } - else if (iWidgetsSupported && iWidgetList->IsWidget( wgId )) - { - appUid = iWidgetList->IndexToAppUid( index, iAlwaysShownList->iAppList->Count() ); - iAppArcSession.GetAppInfo( info, appUid ); - - // retrieve the app name - TPtrC caption = info.iShortCaption; - name.Zero(); - - // conversion from TInt to TReal, might be a problem in the future - name.AppendNum( index ); - - name.Append( KTab ); - name.Append( caption ); - } // // Running Applications // @@ -2231,10 +2046,6 @@ { LaunchAppL( iAlwaysShownList->IndexToAppUid( aIndex ) ); } - else if ( iWidgetsSupported && wgId == KWidgetWithoutWG ) - { - LaunchAppL( iWidgetList->IndexToAppUid( aIndex, iAlwaysShownList->iAppList->Count() ) ); - } // brings existing application to foreground and closes fastswap else { @@ -3033,25 +2844,7 @@ iIsClosing = ETrue; - if (iWidgetsSupported && iWidgetList->IsWidget( iConfirmCloseWgId )) - { - TWsEvent event; - event.SetType(EEventUser); - - TUid widgetUid = iWidgetList->IndexToAppUid(aIndex, iAlwaysShownList->iAppList->Count()); - - TInt32 widgetAppUiUidInt = KWidgetAppUid.iUid; - TInt32 widgetUidInt = widgetUid.iUid; - TUint8* eventData = event.EventData(); - // Fill bits 0-31 with widget application Uid. - (TUint32&)*eventData = widgetAppUiUidInt; - eventData+=sizeof(TUint32); - // Fill bits 32-63 with uid of the widget that should be closed. - (TUint32&)*eventData = widgetUidInt; - // Send the event to Widget AppUi. - iEikonEnv->WsSession().SendEventToWindowGroup(iWidgetAppUiWgId, event); - } - else if ( aIsShift ) + if ( aIsShift ) { TApaTask task( iEikonEnv->WsSession() ); task.SetWgId( iConfirmCloseWgId ); diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/AknGlobalUI/AknCapServer/src/aknKeyFilter.cpp --- a/uifw/AknGlobalUI/AknCapServer/src/aknKeyFilter.cpp Thu Jul 29 14:21:56 2010 +0800 +++ b/uifw/AknGlobalUI/AknCapServer/src/aknKeyFilter.cpp Fri Aug 06 17:25:01 2010 +0800 @@ -91,7 +91,6 @@ FreeHardwareStateKeys(); RWindowGroup& groupWin = iCoeEnv->RootWin(); - groupWin.CancelCaptureKeyUpAndDowns( iHomeKeyHandle ); groupWin.CancelCaptureKeyUpAndDowns( iQwertyOnKeyHandle ); groupWin.CancelCaptureKeyUpAndDowns( iQwertyOffKeyHandle ); groupWin.CancelCaptureKey( iFlipOpenKeyHandle ); @@ -111,7 +110,6 @@ void CAknServKeyFilter::ConstructL( CAknCapAppServerAppUi& aAppUi ) { RWindowGroup& groupWin = iCoeEnv->RootWin(); - iHomeKeyHandle = groupWin.CaptureKeyUpAndDowns(EStdKeyApplication0, 0, 0); iQwertyOnKeyHandle = groupWin.CaptureKeyUpAndDowns(EStdKeyApplication7, 0, 0); // EKeyQwertyOn iQwertyOffKeyHandle = groupWin.CaptureKeyUpAndDowns(EStdKeyApplication8, 0, 0); // EKeyQwertyOff iFlipOpenKeyHandle = groupWin.CaptureKey(EKeyDeviceA, 0, 0); // EKeyFlipOpen @@ -342,11 +340,7 @@ return EKeyWasConsumed; } - if ( aKeyEvent.iScanCode == EStdKeyApplication0 ) - { - return HandleHomeKeyEventL( aType ); - } - else if ( aKeyEvent.iScanCode == EStdKeyApplication7 || // EKeyQwertyOn + if ( aKeyEvent.iScanCode == EStdKeyApplication7 || // EKeyQwertyOn aKeyEvent.iScanCode == EStdKeyApplication8 ) // EKeyQwertyOff { return HandleQwertyKeyEvent( aKeyEvent, aType ); @@ -360,58 +354,6 @@ } -// --------------------------------------------------------------------------- -// CAknServKeyFilter::HandleHomeKeyEventL -// Handles the pressing of applications key. -// --------------------------------------------------------------------------- -// -TKeyResponse CAknServKeyFilter::HandleHomeKeyEventL( TEventCode aType ) - { - if ( iAppUi->IsAppsKeySuppressed() ) - { - return EKeyWasNotConsumed; - } - - if ( aType == EEventKeyDown ) - { - delete iHomeTimer; - iHomeTimer = NULL; - iHomeTimer = CPeriodic::NewL( CActive::EPriorityHigh ); - - iHomeTimer->Start( KHomeHoldDelay, 1, TCallBack( HomeTickL, this ) ); - return EKeyWasConsumed; - } - else if ( aType == EEventKeyUp ) - { - if ( iHomeTimer && iHomeTimer->IsActive() ) - { - iHomeTimer->Cancel(); - delete iHomeTimer; - iHomeTimer = NULL; - if ( !iAppUi->HandleShortAppsKeyPressL() ) - { - RWsSession& ws = iEikonEnv->WsSession(); - TApaTaskList apList( ws ); - TApaTask task = apList.FindApp( iHomeViewId.iAppUid ); - if( task.Exists() && task.WgId() == ws.GetFocusWindowGroup() ) - { - GfxTransEffect::BeginFullScreen( - AknTransEffect::EApplicationExit, - TRect(), - AknTransEffect::EParameterType, - AknTransEffect::GfxTransParam( iHomeViewId.iAppUid ) ); - } - - ToggleShellL(); - } - - return EKeyWasConsumed; - } - } - - return EKeyWasNotConsumed; - } - // --------------------------------------------------------------------------- // CAknServKeyFilter::HandleQwertyKeyEvent diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/BWINS/ganesu.def --- a/uifw/ganes/BWINS/ganesu.def Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +0,0 @@ -EXPORTS - ??1CHgDoubleGraphicList@@UAE@XZ @ 1 NONAME ; CHgDoubleGraphicList::~CHgDoubleGraphicList(void) - ??1CHgDoubleTextList@@UAE@XZ @ 2 NONAME ; CHgDoubleTextList::~CHgDoubleTextList(void) - ??1CHgGrid@@UAE@XZ @ 3 NONAME ; CHgGrid::~CHgGrid(void) - ??1CHgItem@@UAE@XZ @ 4 NONAME ; CHgItem::~CHgItem(void) - ??1CHgList@@UAE@XZ @ 5 NONAME ; CHgList::~CHgList(void) - ??1CHgScroller@@UAE@XZ @ 6 NONAME ; CHgScroller::~CHgScroller(void) - ??1CHgSingleGraphicList@@UAE@XZ @ 7 NONAME ; CHgSingleGraphicList::~CHgSingleGraphicList(void) - ??1CHgSingleLargeList@@UAE@XZ @ 8 NONAME ; CHgSingleLargeList::~CHgSingleLargeList(void) - ?AddItem@CHgScroller@@QAEXPAVCHgItem@@@Z @ 9 NONAME ; void CHgScroller::AddItem(class CHgItem *) - ?ClearFlags@CHgItem@@QAEXH@Z @ 10 NONAME ; void CHgItem::ClearFlags(int) - ?ClearFlags@CHgScroller@@QAEXH@Z @ 11 NONAME ; void CHgScroller::ClearFlags(int) - ?DisableScrollBuffer@CHgScroller@@QAEXXZ @ 12 NONAME ; void CHgScroller::DisableScrollBuffer(void) - ?EnableScrollBufferL@CHgScroller@@QAEXAAVMHgScrollBufferObserver@@HH@Z @ 13 NONAME ; void CHgScroller::EnableScrollBufferL(class MHgScrollBufferObserver &, int, int) - ?FirstIndexOnScreen@CHgScroller@@QAEHXZ @ 14 NONAME ; int CHgScroller::FirstIndexOnScreen(void) - ?Flags@CHgItem@@QAEHXZ @ 15 NONAME ; int CHgItem::Flags(void) - ?Flags@CHgScroller@@QAEHXZ @ 16 NONAME ; int CHgScroller::Flags(void) - ?GetMarkedItemsL@CHgScroller@@QAEXAAV?$RArray@H@@@Z @ 17 NONAME ; void CHgScroller::GetMarkedItemsL(class RArray &) - ?HightlightItem@CHgScroller@@QAEHABVTDesC16@@@Z @ 18 NONAME ; int CHgScroller::HightlightItem(class TDesC16 const &) - ?Icon@CHgItem@@QBEPAVCGulIcon@@XZ @ 19 NONAME ; class CGulIcon * CHgItem::Icon(void) const - ?InitScreenL@CHgScroller@@QAEXABVTRect@@@Z @ 20 NONAME ; void CHgScroller::InitScreenL(class TRect const &) - ?InitScreenL@CHgScroller@@QAEXABVTRect@@AAVRWsSession@@@Z @ 21 NONAME ; void CHgScroller::InitScreenL(class TRect const &, class RWsSession &) - ?InsertItem@CHgScroller@@QAEXPAVCHgItem@@H@Z @ 22 NONAME ; void CHgScroller::InsertItem(class CHgItem *, int) - ?ItemCount@CHgScroller@@QBEHXZ @ 23 NONAME ; int CHgScroller::ItemCount(void) const - ?ItemL@CHgScroller@@QAEAAVCHgItem@@H@Z @ 24 NONAME ; class CHgItem & CHgScroller::ItemL(int) - ?ItemsOnScreen@CHgScroller@@QAEHXZ @ 25 NONAME ; int CHgScroller::ItemsOnScreen(void) - ?Mark@CHgScroller@@QAEXH@Z @ 26 NONAME ; void CHgScroller::Mark(int) - ?MarkAll@CHgScroller@@QAEXXZ @ 27 NONAME ; void CHgScroller::MarkAll(void) - ?NewL@CHgDoubleGraphicList@@SAPAV1@ABVTRect@@HPAVCGulIcon@@PAVRWsSession@@@Z @ 28 NONAME ; class CHgDoubleGraphicList * CHgDoubleGraphicList::NewL(class TRect const &, int, class CGulIcon *, class RWsSession *) - ?NewL@CHgDoubleTextList@@SAPAV1@ABVTRect@@HPAVCGulIcon@@PAVRWsSession@@@Z @ 29 NONAME ; class CHgDoubleTextList * CHgDoubleTextList::NewL(class TRect const &, int, class CGulIcon *, class RWsSession *) - ?NewL@CHgGrid@@SAPAV1@ABVTRect@@HPAVCGulIcon@@PAVRWsSession@@@Z @ 30 NONAME ; class CHgGrid * CHgGrid::NewL(class TRect const &, int, class CGulIcon *, class RWsSession *) - ?NewL@CHgItem@@SAPAV1@HPAVCGulIcon@@ABVTDesC16@@1@Z @ 31 NONAME ; class CHgItem * CHgItem::NewL(int, class CGulIcon *, class TDesC16 const &, class TDesC16 const &) - ?NewL@CHgSingleGraphicList@@SAPAV1@ABVTRect@@HPAVCGulIcon@@PAVRWsSession@@@Z @ 32 NONAME ; class CHgSingleGraphicList * CHgSingleGraphicList::NewL(class TRect const &, int, class CGulIcon *, class RWsSession *) - ?NewL@CHgSingleLargeList@@SAPAV1@ABVTRect@@HPAVCGulIcon@@PAVRWsSession@@@Z @ 33 NONAME ; class CHgSingleLargeList * CHgSingleLargeList::NewL(class TRect const &, int, class CGulIcon *, class RWsSession *) - ?NewLC@CHgItem@@SAPAV1@HPAVCGulIcon@@ABVTDesC16@@1@Z @ 34 NONAME ; class CHgItem * CHgItem::NewLC(int, class CGulIcon *, class TDesC16 const &, class TDesC16 const &) - ?PreferredImageSize@CHgDoubleGraphicList@@SA?AVTSize@@XZ @ 35 NONAME ; class TSize CHgDoubleGraphicList::PreferredImageSize(void) - ?PreferredImageSize@CHgDoubleTextList@@SA?AVTSize@@XZ @ 36 NONAME ; class TSize CHgDoubleTextList::PreferredImageSize(void) - ?PreferredImageSize@CHgGrid@@SA?AVTSize@@XZ @ 37 NONAME ; class TSize CHgGrid::PreferredImageSize(void) - ?PreferredImageSize@CHgSingleGraphicList@@SA?AVTSize@@XZ @ 38 NONAME ; class TSize CHgSingleGraphicList::PreferredImageSize(void) - ?PreferredImageSize@CHgSingleLargeList@@SA?AVTSize@@XZ @ 39 NONAME ; class TSize CHgSingleLargeList::PreferredImageSize(void) - ?RefreshScreen@CHgScroller@@QAEXH@Z @ 40 NONAME ; void CHgScroller::RefreshScreen(int) - ?RemoveItem@CHgScroller@@QAEXH@Z @ 41 NONAME ; void CHgScroller::RemoveItem(int) - ?Reset@CHgScroller@@QAEXXZ @ 42 NONAME ; void CHgScroller::Reset(void) - ?ResizeL@CHgScroller@@QAEXH@Z @ 43 NONAME ; void CHgScroller::ResizeL(int) - ?SelectedIndex@CHgScroller@@QAEHXZ @ 44 NONAME ; int CHgScroller::SelectedIndex(void) - ?SetDefaultIconL@CHgScroller@@QAEXPAVCGulIcon@@@Z @ 45 NONAME ; void CHgScroller::SetDefaultIconL(class CGulIcon *) - ?SetEmptyTextL@CHgScroller@@QAEXABVTDesC16@@@Z @ 46 NONAME ; void CHgScroller::SetEmptyTextL(class TDesC16 const &) - ?SetFlags@CHgItem@@QAEXH@Z @ 47 NONAME ; void CHgItem::SetFlags(int) - ?SetFlags@CHgScroller@@QAEXH@Z @ 48 NONAME ; void CHgScroller::SetFlags(int) - ?SetIcon@CHgItem@@QAEXPAVCGulIcon@@H@Z @ 49 NONAME ABSENT ; void CHgItem::SetIcon(class CGulIcon *, int) - ?SetItem@CHgScroller@@QAEXPAVCHgItem@@H@Z @ 50 NONAME ; void CHgScroller::SetItem(class CHgItem *, int) - ?SetScrollBarTypeL@CHgScroller@@QAEXW4THgScrollBarType@1@@Z @ 51 NONAME ; void CHgScroller::SetScrollBarTypeL(enum CHgScroller::THgScrollBarType) - ?SetSelectedIndex@CHgScroller@@QAEXH@Z @ 52 NONAME ; void CHgScroller::SetSelectedIndex(int) - ?SetSelectionObserver@CHgScroller@@QAEXAAVMHgSelectionObserver@@@Z @ 53 NONAME ; void CHgScroller::SetSelectionObserver(class MHgSelectionObserver &) - ?SetTextL@CHgItem@@QAEXABVTDesC16@@@Z @ 54 NONAME ; void CHgItem::SetTextL(class TDesC16 const &) - ?SetTime@CHgItem@@QAEXVTTime@@@Z @ 55 NONAME ; void CHgItem::SetTime(class TTime) - ?SetTitleL@CHgItem@@QAEXABVTDesC16@@@Z @ 56 NONAME ; void CHgItem::SetTitleL(class TDesC16 const &) - ?Text@CHgItem@@QBEABVTDesC16@@XZ @ 57 NONAME ; class TDesC16 const & CHgItem::Text(void) const - ?Time@CHgItem@@QBE?AVTTime@@XZ @ 58 NONAME ; class TTime CHgItem::Time(void) const - ?Title@CHgItem@@QBEABVTDesC16@@XZ @ 59 NONAME ; class TDesC16 const & CHgItem::Title(void) const - ?UnMark@CHgScroller@@QAEXH@Z @ 60 NONAME ; void CHgScroller::UnMark(int) - ?UnMarkAll@CHgScroller@@QAEXXZ @ 61 NONAME ; void CHgScroller::UnMarkAll(void) - ??1CHgSingleTextList@@UAE@XZ @ 62 NONAME ; CHgSingleTextList::~CHgSingleTextList(void) - ?NewL@CHgSingleTextList@@SAPAV1@ABVTRect@@HPAVCGulIcon@@PAVRWsSession@@@Z @ 63 NONAME ; class CHgSingleTextList * CHgSingleTextList::NewL(class TRect const &, int, class CGulIcon *, class RWsSession *) - ??1CHgScrollerWithTitle@@UAE@XZ @ 64 NONAME ; CHgScrollerWithTitle::~CHgScrollerWithTitle(void) - ?InitScreenL@CHgScrollerWithTitle@@QAEXABVTRect@@@Z @ 65 NONAME ; void CHgScrollerWithTitle::InitScreenL(class TRect const &) - ?NewL@CHgScrollerWithTitle@@SAPAV1@ABVTRect@@HW4THgScrollerType@1@PAVCGulIcon@@@Z @ 66 NONAME ; class CHgScrollerWithTitle * CHgScrollerWithTitle::NewL(class TRect const &, int, enum CHgScrollerWithTitle::THgScrollerType, class CGulIcon *) - ?PreferredImageSize@CHgScrollerWithTitle@@SA?AVTSize@@XZ @ 67 NONAME ; class TSize CHgScrollerWithTitle::PreferredImageSize(void) - ?Scroller@CHgScrollerWithTitle@@QAEAAVCHgScroller@@XZ @ 68 NONAME ; class CHgScroller & CHgScrollerWithTitle::Scroller(void) - ?TitleItem@CHgScrollerWithTitle@@QAEAAVCHgItem@@XZ @ 69 NONAME ; class CHgItem & CHgScrollerWithTitle::TitleItem(void) - ?SetMarkingObserver@CHgScroller@@QAEXAAVMHgMarkingObserver@@@Z @ 70 NONAME ; void CHgScroller::SetMarkingObserver(class MHgMarkingObserver &) - ?SetLandscapeScrollingSupport@CHgGrid@@QAEXH@Z @ 71 NONAME ; void CHgGrid::SetLandscapeScrollingSupport(int) - ?ChangeStyleL@CHgVgMediaWall@@QAEXW4THgVgMediaWallStyle@1@ABVTRect@@H@Z @ 72 NONAME ; void CHgVgMediaWall::ChangeStyleL(enum CHgVgMediaWall::THgVgMediaWallStyle, class TRect const &, int) - ?ItemsOnScreen@CHgVgMediaWall@@QAEHXZ @ 73 NONAME ; int CHgVgMediaWall::ItemsOnScreen(void) - ?SetItem@CHgVgMediaWall@@QAEXPAVCHgVgItem@@H@Z @ 74 NONAME ; void CHgVgMediaWall::SetItem(class CHgVgItem *, int) - ?ItemCount@CHgVgMediaWall@@QBEHXZ @ 75 NONAME ; int CHgVgMediaWall::ItemCount(void) const - ??1CHgSingleTextListWithIcon@@UAE@XZ @ 76 NONAME ; CHgSingleTextListWithIcon::~CHgSingleTextListWithIcon(void) - ?SetIcon@CHgVgItem@@UAEXPAVCGulIcon@@H@Z @ 77 NONAME ; void CHgVgItem::SetIcon(class CGulIcon *, int) - ?AddItem@CHgVgMediaWall@@QAEXPAVCHgVgItem@@@Z @ 78 NONAME ; void CHgVgMediaWall::AddItem(class CHgVgItem *) - ?EnableScrollBufferL@CHgVgMediaWall@@QAEXAAVMHgScrollBufferObserver@@HH@Z @ 79 NONAME ; void CHgVgMediaWall::EnableScrollBufferL(class MHgScrollBufferObserver &, int, int) - ?SetIcon@CHgItem@@UAEXPAVCGulIcon@@H@Z @ 80 NONAME ; void CHgItem::SetIcon(class CGulIcon *, int) - ?SetOpeningAnimationType@CHgVgMediaWall@@QAEXW4THgVgOpeningAnimationType@1@@Z @ 81 NONAME ; void CHgVgMediaWall::SetOpeningAnimationType(enum CHgVgMediaWall::THgVgOpeningAnimationType) - ?RemoveItem@CHgVgMediaWall@@QAEXH@Z @ 82 NONAME ; void CHgVgMediaWall::RemoveItem(int) - ?SetSelectionObserver@CHgVgMediaWall@@QAEXAAVMHgSelectionObserver@@@Z @ 83 NONAME ; void CHgVgMediaWall::SetSelectionObserver(class MHgSelectionObserver &) - ?SetDefaultIconL@CHgVgMediaWall@@QAEXPAVCGulIcon@@@Z @ 84 NONAME ; void CHgVgMediaWall::SetDefaultIconL(class CGulIcon *) - ?NewL@CHgSingleTextListWithIcon@@SAPAV1@ABVTRect@@HPAVCGulIcon@@PAVRWsSession@@@Z @ 85 NONAME ; class CHgSingleTextListWithIcon * CHgSingleTextListWithIcon::NewL(class TRect const &, int, class CGulIcon *, class RWsSession *) - ?Style@CHgVgMediaWall@@QBE?AW4THgVgMediaWallStyle@1@XZ @ 86 NONAME ; enum CHgVgMediaWall::THgVgMediaWallStyle CHgVgMediaWall::Style(void) const - ?ItemL@CHgVgMediaWall@@QAEAAVCHgVgItem@@H@Z @ 87 NONAME ; class CHgVgItem & CHgVgMediaWall::ItemL(int) - ?ResizeL@CHgVgMediaWall@@QAEXH@Z @ 88 NONAME ; void CHgVgMediaWall::ResizeL(int) - ?NewL@CHgVgItem@@SAPAV1@HPAVCGulIcon@@ABVTDesC16@@1@Z @ 89 NONAME ; class CHgVgItem * CHgVgItem::NewL(int, class CGulIcon *, class TDesC16 const &, class TDesC16 const &) - ?NewLC@CHgVgItem@@SAPAV1@HPAVCGulIcon@@ABVTDesC16@@1@Z @ 90 NONAME ; class CHgVgItem * CHgVgItem::NewLC(int, class CGulIcon *, class TDesC16 const &, class TDesC16 const &) - ?OpeningAnimationType@CHgVgMediaWall@@QBE?AW4THgVgOpeningAnimationType@1@XZ @ 91 NONAME ; enum CHgVgMediaWall::THgVgOpeningAnimationType CHgVgMediaWall::OpeningAnimationType(void) const - ?InsertItem@CHgVgMediaWall@@QAEXPAVCHgVgItem@@H@Z @ 92 NONAME ; void CHgVgMediaWall::InsertItem(class CHgVgItem *, int) - ?NewL@CHgVgMediaWall@@SAPAV1@ABVTRect@@HW4THgVgMediaWallStyle@1@HPAVMObjectProvider@@PAVCGulIcon@@@Z @ 93 NONAME ; class CHgVgMediaWall * CHgVgMediaWall::NewL(class TRect const &, int, enum CHgVgMediaWall::THgVgMediaWallStyle, int, class MObjectProvider *, class CGulIcon *) - ??1CHgVgItem@@UAE@XZ @ 94 NONAME ; CHgVgItem::~CHgVgItem(void) - ?SelectedIndex@CHgVgMediaWall@@QAEHXZ @ 95 NONAME ; int CHgVgMediaWall::SelectedIndex(void) - ?SetEmptyTextL@CHgVgMediaWall@@QAEXABVTDesC16@@@Z @ 96 NONAME ; void CHgVgMediaWall::SetEmptyTextL(class TDesC16 const &) - ?DisableScrollBuffer@CHgVgMediaWall@@QAEXXZ @ 97 NONAME ; void CHgVgMediaWall::DisableScrollBuffer(void) - ??1CHgVgMediaWall@@UAE@XZ @ 98 NONAME ; CHgVgMediaWall::~CHgVgMediaWall(void) - ?RefreshScreen@CHgVgMediaWall@@QAEXH@Z @ 99 NONAME ; void CHgVgMediaWall::RefreshScreen(int) - ?FirstIndexOnScreen@CHgVgMediaWall@@QAEHXZ @ 100 NONAME ; int CHgVgMediaWall::FirstIndexOnScreen(void) - ?SetObserver@CHgVgMediaWall@@QAEXPAVMHgVgMediaWallObserver@@@Z @ 101 NONAME ; void CHgVgMediaWall::SetObserver(class MHgVgMediaWallObserver *) - ?StartOpeningAnimationL@CHgVgMediaWall@@QAEXH@Z @ 102 NONAME ; void CHgVgMediaWall::StartOpeningAnimationL(int) - ?SetSelectedIndex@CHgVgMediaWall@@QAEXH@Z @ 103 NONAME ; void CHgVgMediaWall::SetSelectedIndex(int) - ?Reset@CHgVgMediaWall@@QAEXXZ @ 104 NONAME ; void CHgVgMediaWall::Reset(void) - ?InitScreenL@CHgVgMediaWall@@QAEXABVTRect@@@Z @ 105 NONAME ; void CHgVgMediaWall::InitScreenL(class TRect const &) - ?NewL@CHgDoubleGraphicListFlat@@SAPAV1@ABVTRect@@HPAVCGulIcon@@PAVRWsSession@@@Z @ 106 NONAME ; class CHgDoubleGraphicListFlat * CHgDoubleGraphicListFlat::NewL(class TRect const &, int, class CGulIcon *, class RWsSession *) - ??1CHgDoubleGraphicListFlat@@UAE@XZ @ 107 NONAME ; CHgDoubleGraphicListFlat::~CHgDoubleGraphicListFlat(void) - ?PreferredImageSize@CHgDoubleGraphicListFlat@@SA?AVTSize@@XZ @ 108 NONAME ; class TSize CHgDoubleGraphicListFlat::PreferredImageSize(void) - ?SetIconOverlayIndicator@CHgDoubleGraphicList@@QAEXPAVCGulIcon@@@Z @ 109 NONAME ; void CHgDoubleGraphicList::SetIconOverlayIndicator(class CGulIcon *) - ?ClearFlags@CHgVgMediaWall@@QAEXH@Z @ 110 NONAME ; void CHgVgMediaWall::ClearFlags(int) - ?Flags@CHgVgMediaWall@@QAEHXZ @ 111 NONAME ; int CHgVgMediaWall::Flags(void) - ?SetFlags@CHgVgMediaWall@@QAEXH@Z @ 112 NONAME ; void CHgVgMediaWall::SetFlags(int) - ?SetItemToOpenedState@CHgVgMediaWall@@QAEXH@Z @ 113 NONAME ; void CHgVgMediaWall::SetItemToOpenedState(int) - ?SetOpenedItemRect@CHgVgMediaWall@@QAEXABVTRect@@@Z @ 114 NONAME ; void CHgVgMediaWall::SetOpenedItemRect(class TRect const &) - diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/EABI/ganesu.def --- a/uifw/ganes/EABI/ganesu.def Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -EXPORTS - _ZN11CHgScroller10ClearFlagsEi @ 1 NONAME - _ZN11CHgScroller10InsertItemEP7CHgItemi @ 2 NONAME - _ZN11CHgScroller10RemoveItemEi @ 3 NONAME - _ZN11CHgScroller11InitScreenLERK5TRect @ 4 NONAME - _ZN11CHgScroller11InitScreenLERK5TRectR10RWsSession @ 5 NONAME - _ZN11CHgScroller13ItemsOnScreenEv @ 6 NONAME - _ZN11CHgScroller13RefreshScreenEi @ 7 NONAME - _ZN11CHgScroller13SelectedIndexEv @ 8 NONAME - _ZN11CHgScroller13SetEmptyTextLERK7TDesC16 @ 9 NONAME - _ZN11CHgScroller14HightlightItemERK7TDesC16 @ 10 NONAME - _ZN11CHgScroller15GetMarkedItemsLER6RArrayIiE @ 11 NONAME - _ZN11CHgScroller15SetDefaultIconLEP8CGulIcon @ 12 NONAME - _ZN11CHgScroller16SetSelectedIndexEi @ 13 NONAME - _ZN11CHgScroller17SetScrollBarTypeLENS_16THgScrollBarTypeE @ 14 NONAME - _ZN11CHgScroller18FirstIndexOnScreenEv @ 15 NONAME - _ZN11CHgScroller19DisableScrollBufferEv @ 16 NONAME - _ZN11CHgScroller19EnableScrollBufferLER23MHgScrollBufferObserverii @ 17 NONAME - _ZN11CHgScroller20SetSelectionObserverER20MHgSelectionObserver @ 18 NONAME - _ZN11CHgScroller4MarkEi @ 19 NONAME - _ZN11CHgScroller5FlagsEv @ 20 NONAME - _ZN11CHgScroller5ItemLEi @ 21 NONAME - _ZN11CHgScroller5ResetEv @ 22 NONAME - _ZN11CHgScroller6UnMarkEi @ 23 NONAME - _ZN11CHgScroller7AddItemEP7CHgItem @ 24 NONAME - _ZN11CHgScroller7MarkAllEv @ 25 NONAME - _ZN11CHgScroller7ResizeLEi @ 26 NONAME - _ZN11CHgScroller7SetItemEP7CHgItemi @ 27 NONAME - _ZN11CHgScroller8SetFlagsEi @ 28 NONAME - _ZN11CHgScroller9UnMarkAllEv @ 29 NONAME - _ZN11CHgScrollerD0Ev @ 30 NONAME - _ZN11CHgScrollerD1Ev @ 31 NONAME - _ZN11CHgScrollerD2Ev @ 32 NONAME - _ZN17CHgDoubleTextList18PreferredImageSizeEv @ 33 NONAME - _ZN17CHgDoubleTextList4NewLERK5TRectiP8CGulIconP10RWsSession @ 34 NONAME - _ZN17CHgDoubleTextListD0Ev @ 35 NONAME - _ZN17CHgDoubleTextListD1Ev @ 36 NONAME - _ZN17CHgDoubleTextListD2Ev @ 37 NONAME - _ZN18CHgSingleLargeList18PreferredImageSizeEv @ 38 NONAME - _ZN18CHgSingleLargeList4NewLERK5TRectiP8CGulIconP10RWsSession @ 39 NONAME - _ZN18CHgSingleLargeListD0Ev @ 40 NONAME - _ZN18CHgSingleLargeListD1Ev @ 41 NONAME - _ZN18CHgSingleLargeListD2Ev @ 42 NONAME - _ZN20CHgDoubleGraphicList18PreferredImageSizeEv @ 43 NONAME - _ZN20CHgDoubleGraphicList4NewLERK5TRectiP8CGulIconP10RWsSession @ 44 NONAME - _ZN20CHgDoubleGraphicListD0Ev @ 45 NONAME - _ZN20CHgDoubleGraphicListD1Ev @ 46 NONAME - _ZN20CHgDoubleGraphicListD2Ev @ 47 NONAME - _ZN20CHgSingleGraphicList18PreferredImageSizeEv @ 48 NONAME - _ZN20CHgSingleGraphicList4NewLERK5TRectiP8CGulIconP10RWsSession @ 49 NONAME - _ZN20CHgSingleGraphicListD0Ev @ 50 NONAME - _ZN20CHgSingleGraphicListD1Ev @ 51 NONAME - _ZN20CHgSingleGraphicListD2Ev @ 52 NONAME - _ZN7CHgGrid18PreferredImageSizeEv @ 53 NONAME - _ZN7CHgGrid4NewLERK5TRectiP8CGulIconP10RWsSession @ 54 NONAME - _ZN7CHgGridD0Ev @ 55 NONAME - _ZN7CHgGridD1Ev @ 56 NONAME - _ZN7CHgGridD2Ev @ 57 NONAME - _ZN7CHgItem10ClearFlagsEi @ 58 NONAME - _ZN7CHgItem4NewLEiP8CGulIconRK7TDesC16S4_ @ 59 NONAME - _ZN7CHgItem5FlagsEv @ 60 NONAME - _ZN7CHgItem5NewLCEiP8CGulIconRK7TDesC16S4_ @ 61 NONAME - _ZN7CHgItem7SetIconEP8CGulIconi @ 62 NONAME - _ZN7CHgItem7SetTimeE5TTime @ 63 NONAME - _ZN7CHgItem8SetFlagsEi @ 64 NONAME - _ZN7CHgItem8SetTextLERK7TDesC16 @ 65 NONAME - _ZN7CHgItem9SetTitleLERK7TDesC16 @ 66 NONAME - _ZN7CHgItemD0Ev @ 67 NONAME - _ZN7CHgItemD1Ev @ 68 NONAME - _ZN7CHgItemD2Ev @ 69 NONAME - _ZN7CHgListD0Ev @ 70 NONAME - _ZN7CHgListD1Ev @ 71 NONAME - _ZN7CHgListD2Ev @ 72 NONAME - _ZNK11CHgScroller9ItemCountEv @ 73 NONAME - _ZNK7CHgItem4IconEv @ 74 NONAME - _ZNK7CHgItem4TextEv @ 75 NONAME - _ZNK7CHgItem4TimeEv @ 76 NONAME - _ZNK7CHgItem5TitleEv @ 77 NONAME - _ZTI11CHgScroller @ 78 NONAME ; ## - _ZTI17CHgDoubleTextList @ 79 NONAME ; ## - _ZTI18CHgSingleLargeList @ 80 NONAME ; ## - _ZTI20CHgDoubleGraphicList @ 81 NONAME ; ## - _ZTI20CHgSingleGraphicList @ 82 NONAME ; ## - _ZTI7CHgGrid @ 83 NONAME ; ## - _ZTI7CHgItem @ 84 NONAME ; ## - _ZTI7CHgList @ 85 NONAME ; ## - _ZTV11CHgScroller @ 86 NONAME ; ## - _ZTV17CHgDoubleTextList @ 87 NONAME ; ## - _ZTV18CHgSingleLargeList @ 88 NONAME ; ## - _ZTV20CHgDoubleGraphicList @ 89 NONAME ; ## - _ZTV20CHgSingleGraphicList @ 90 NONAME ; ## - _ZTV7CHgGrid @ 91 NONAME ; ## - _ZTV7CHgItem @ 92 NONAME ; ## - _ZTV7CHgList @ 93 NONAME ; ## - _ZN17CHgSingleTextList4NewLERK5TRectiP8CGulIconP10RWsSession @ 94 NONAME - _ZN17CHgSingleTextListD0Ev @ 95 NONAME - _ZN17CHgSingleTextListD1Ev @ 96 NONAME - _ZN17CHgSingleTextListD2Ev @ 97 NONAME - _ZTI17CHgSingleTextList @ 98 NONAME ; ## - _ZTV17CHgSingleTextList @ 99 NONAME ; ## - _ZN20CHgScrollerWithTitle11InitScreenLERK5TRect @ 100 NONAME - _ZN20CHgScrollerWithTitle18PreferredImageSizeEv @ 101 NONAME - _ZN20CHgScrollerWithTitle4NewLERK5TRectiNS_15THgScrollerTypeEP8CGulIcon @ 102 NONAME - _ZN20CHgScrollerWithTitle8ScrollerEv @ 103 NONAME - _ZN20CHgScrollerWithTitle9TitleItemEv @ 104 NONAME - _ZN20CHgScrollerWithTitleD0Ev @ 105 NONAME - _ZN20CHgScrollerWithTitleD1Ev @ 106 NONAME - _ZN20CHgScrollerWithTitleD2Ev @ 107 NONAME - _ZTI20CHgScrollerWithTitle @ 108 NONAME ; ## - _ZTV20CHgScrollerWithTitle @ 109 NONAME ; ## - _ZN11CHgScroller18SetMarkingObserverER18MHgMarkingObserver @ 110 NONAME - _ZN7CHgGrid28SetLandscapeScrollingSupportEi @ 111 NONAME - _ZN14CHgVgMediaWall10InsertItemEP9CHgVgItemi @ 112 NONAME - _ZN14CHgVgMediaWall10RemoveItemEi @ 113 NONAME - _ZN14CHgVgMediaWall11InitScreenLERK5TRect @ 114 NONAME - _ZN14CHgVgMediaWall11SetObserverEP22MHgVgMediaWallObserver @ 115 NONAME - _ZN14CHgVgMediaWall12ChangeStyleLENS_19THgVgMediaWallStyleERK5TRecti @ 116 NONAME - _ZN14CHgVgMediaWall13ItemsOnScreenEv @ 117 NONAME - _ZN14CHgVgMediaWall13RefreshScreenEi @ 118 NONAME - _ZN14CHgVgMediaWall13SelectedIndexEv @ 119 NONAME - _ZN14CHgVgMediaWall13SetEmptyTextLERK7TDesC16 @ 120 NONAME - _ZN14CHgVgMediaWall15SetDefaultIconLEP8CGulIcon @ 121 NONAME - _ZN14CHgVgMediaWall16SetSelectedIndexEi @ 122 NONAME - _ZN14CHgVgMediaWall18FirstIndexOnScreenEv @ 123 NONAME - _ZN14CHgVgMediaWall19DisableScrollBufferEv @ 124 NONAME - _ZN14CHgVgMediaWall19EnableScrollBufferLER23MHgScrollBufferObserverii @ 125 NONAME - _ZN14CHgVgMediaWall20SetSelectionObserverER20MHgSelectionObserver @ 126 NONAME - _ZN14CHgVgMediaWall22StartOpeningAnimationLEi @ 127 NONAME - _ZN14CHgVgMediaWall23SetOpeningAnimationTypeENS_25THgVgOpeningAnimationTypeE @ 128 NONAME - _ZN14CHgVgMediaWall4NewLERK5TRectiNS_19THgVgMediaWallStyleEiP15MObjectProviderP8CGulIcon @ 129 NONAME - _ZN14CHgVgMediaWall5ItemLEi @ 130 NONAME - _ZN14CHgVgMediaWall5ResetEv @ 131 NONAME - _ZN14CHgVgMediaWall7AddItemEP9CHgVgItem @ 132 NONAME - _ZN14CHgVgMediaWall7ResizeLEi @ 133 NONAME - _ZN14CHgVgMediaWall7SetItemEP9CHgVgItemi @ 134 NONAME - _ZN14CHgVgMediaWallD0Ev @ 135 NONAME - _ZN14CHgVgMediaWallD1Ev @ 136 NONAME - _ZN14CHgVgMediaWallD2Ev @ 137 NONAME - _ZN25CHgSingleTextListWithIcon4NewLERK5TRectiP8CGulIconP10RWsSession @ 138 NONAME - _ZN25CHgSingleTextListWithIconD0Ev @ 139 NONAME - _ZN25CHgSingleTextListWithIconD1Ev @ 140 NONAME - _ZN25CHgSingleTextListWithIconD2Ev @ 141 NONAME - _ZN9CHgVgItem4NewLEiP8CGulIconRK7TDesC16S4_ @ 142 NONAME - _ZN9CHgVgItem5NewLCEiP8CGulIconRK7TDesC16S4_ @ 143 NONAME - _ZN9CHgVgItem7SetIconEP8CGulIconi @ 144 NONAME - _ZN9CHgVgItemD0Ev @ 145 NONAME - _ZN9CHgVgItemD1Ev @ 146 NONAME - _ZN9CHgVgItemD2Ev @ 147 NONAME - _ZNK14CHgVgMediaWall20OpeningAnimationTypeEv @ 148 NONAME - _ZNK14CHgVgMediaWall5StyleEv @ 149 NONAME - _ZNK14CHgVgMediaWall9ItemCountEv @ 150 NONAME - _ZTI14CHgVgMediaWall @ 151 NONAME - _ZTI25CHgSingleTextListWithIcon @ 152 NONAME - _ZTI9CHgVgItem @ 153 NONAME - _ZTV14CHgVgMediaWall @ 154 NONAME - _ZTV25CHgSingleTextListWithIcon @ 155 NONAME - _ZTV9CHgVgItem @ 156 NONAME - _ZN24CHgDoubleGraphicListFlat18PreferredImageSizeEv @ 157 NONAME - _ZN24CHgDoubleGraphicListFlat4NewLERK5TRectiP8CGulIconP10RWsSession @ 158 NONAME - _ZN24CHgDoubleGraphicListFlatD0Ev @ 159 NONAME - _ZN24CHgDoubleGraphicListFlatD1Ev @ 160 NONAME - _ZN24CHgDoubleGraphicListFlatD2Ev @ 161 NONAME - _ZTI24CHgDoubleGraphicListFlat @ 162 NONAME - _ZTV24CHgDoubleGraphicListFlat @ 163 NONAME - _ZN20CHgDoubleGraphicList23SetIconOverlayIndicatorEP8CGulIcon @ 164 NONAME - _ZN14CHgVgMediaWall10ClearFlagsEi @ 165 NONAME - _ZN14CHgVgMediaWall5FlagsEv @ 166 NONAME - _ZN14CHgVgMediaWall8SetFlagsEi @ 167 NONAME - _ZN14CHgVgMediaWall17SetOpenedItemRectERK5TRect @ 168 NONAME - _ZN14CHgVgMediaWall20SetItemToOpenedStateEi @ 169 NONAME - diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/group/bld.inf --- a/uifw/ganes/group/bld.inf Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#include - -PRJ_PLATFORMS -WINSCW ARMV5 - -#ifndef TOOLS -PRJ_EXTENSIONS -START EXTENSION s60/mifconv -OPTION TARGETFILE ganes.mif -OPTION HEADERFILE ganes.mbg -OPTION SOURCES\ - -c32,8 qgn_prop_sub_marked\ - -c32,8 qgn_prop_file_video\ - -c32,8 qgn_prop_fmgr_file_video\ - -c32,8 qgn_prop_drm_rights_valid_super\ - -c32,8 qgn_prop_drm_rights_exp_super\ - -c32,8 qgn_prop_phone_memc\ - -c32,8 qgn_prop_mmc_memc\ - -c32,8 qgn_prop_fmgr_ms_small\ - -c32,8 qgn_graf_mup_lst_brokenplayl\ - -c32,8 qgn_graf_mup_lst_brokentrack\ - -c32,8 qgn_graf_mup_lst_corrupttrack\ - -c32,8 qgn_indi_mup_play\ - -c32,8 qgn_indi_mup_pause\ - -c32,8 qgn_graf_mup_lst_pdc_new\ - -c32,8 qgn_graf_mup_lst_pdc_partplay\ - -c32,8 qgn_graf_mup_lst_pdc_compplay\ - -c32,8 qgn_graf_mup_adtl_reorder_down\ - -c32,8 qgn_graf_mup_adtl_reorder_up\ - -c32,8 qgn_graf_mup_adtl_reorder_updown\ - -c32,8 qgn_prop_checkbox_on\ - -c32,8 qgn_indi_button_exit_fs -END -#endif - -PRJ_MMPFILES -#ifndef TOOLS -ganes.mmp -#endif - -PRJ_EXPORTS -../rom/ganes.iby CORE_MW_LAYER_IBY_EXPORT_PATH(ganes.iby) -../sis/ganesstub.sis /epoc32/data/z/system/install/ganesstub.sis diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/group/ganes.mmp --- a/uifw/ganes/group/ganes.mmp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,116 +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 -#include -#include - -TARGET ganes.dll -TARGETTYPE dll -UID 0x1000008D 0x2001CBE2 -SECUREID 0x2001CBE2 - -VENDORID VID_DEFAULT -CAPABILITY CAP_GENERAL_DLL - -VERSION 10.0 -LANG SC - -PAGED - -SOURCEPATH ../src -SOURCE HgGrid.cpp -SOURCE HgList.cpp -SOURCE HgScroller.cpp -SOURCE HgItem.cpp -SOURCE HgScrollbar.cpp -SOURCE HgSingleGraphicList.cpp -SOURCE HgSingleLargeList.cpp -SOURCE HgDoubleGraphicList.cpp -SOURCE HgScrollBufferManager.cpp -SOURCE HgPopupDrawer.cpp -SOURCE HgMarquee.cpp -SOURCE HgDoubleTextList.cpp -SOURCE HgDrawUtils.cpp -SOURCE HgIndicatorManager.cpp -SOURCE HgSingleTextList.cpp -SOURCE HgScrollerWithTitle.cpp -SOURCE HgKeyUtils.cpp -SOURCE HgTextFind.cpp -SOURCE HgVgMediaWall.cpp -SOURCE HgVgDrawBuffer.cpp -SOURCE HgVgScrollBar.cpp -SOURCE HgVgHelper.cpp -SOURCE HgVgMediaWallRenderer.cpp -SOURCE HgVgSkinRenderer.cpp -SOURCE HgVgItem.cpp -SOURCE HgVgTimer.cpp -SOURCE HgVgLetterPopup.cpp -SOURCE HgSingleTextListWithIcon.cpp -SOURCE HgVgButton.cpp -SOURCE HgVgLabel.cpp -SOURCE HgDoubleGraphicListFlat.cpp -SOURCE HgVgEGL.cpp -SOURCE HgVgSpring.cpp -SOURCE HgVgImageCreator.cpp - -USERINCLUDE ../inc - -MW_LAYER_SYSTEMINCLUDE - -LIBRARY aknicon.lib -LIBRARY AknLayout2.lib -LIBRARY AknLayout2Scalable.lib -LIBRARY aknnotify.lib -LIBRARY aknphysics.lib -LIBRARY aknskins.lib -LIBRARY aknskinsrv.lib -LIBRARY akntouchgesturefw.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY bitgdi.lib -LIBRARY CdlEngine.lib -LIBRARY CenrepNotifHandler.lib -LIBRARY centralrepository.lib -LIBRARY commonengine.lib -LIBRARY cone.lib -LIBRARY efsrv.lib -LIBRARY egul.lib -LIBRARY eikcoctl.lib -LIBRARY eikcore.lib -LIBRARY eikctl.lib -LIBRARY estor.lib -LIBRARY euser.lib -LIBRARY fbscli.lib -LIBRARY fepbase.lib -LIBRARY FeatMgr.lib -LIBRARY gdi.lib -LIBRARY imageconversion.lib -LIBRARY libOpenVG.lib -LIBRARY libOpenVGU.lib -LIBRARY libEGL.lib -LIBRARY touchfeedback.lib -LIBRARY ws32.lib -LIBRARY NVGDecoder.lib -LIBRARY alfdecoderserverclient.lib -LIBRARY featdiscovery.lib - -#ifdef ENABLE_ABIV2_MODE -DEBUGGABLE -#endif - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgConstants.h --- a/uifw/ganes/inc/HgConstants.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGCONSTANTS_H_ -#define HGCONSTANTS_H_ - -// UI Constants -const TInt KMinDragDistance(20); -const TInt KPhysLaunchKeyCount(10); -const TInt KTurboModeLimit(15); -const TInt KKeyScrollingNormalModeMove(20); -const TInt KKeyScrollingTurboModeMove(40); -const TInt KMaxSearchLenght(128); -const TInt KSearchEndTimeOut(1500000); // 0,5 sec -const TInt KFocusTextFontSize(50); // biggest font available -const TInt KMaxPopupTextLength(32); -const TInt KScrollAreaOffset(15); -const TInt KListHighlightInnerRectShrink(10); -const TInt KPopupTextExtraPadding(50); -const TInt KPopupWidthDiv(3); -const TInt KDefaultHighlightTimeout( 50000 ); // 50 ms -const TInt KMaxNumberOfTitleIndicators( 2 ); -const TInt KKeyScrollingUpdateInterval( 50000 ); -// timeout for long keypress used in markable lists -const TInt KLongPressInterval = 600000; // 0,6 seconds -const TInt KMSKControlId = 3; - -// Marquee CONSTANTS -const TInt KHgMarqueeDelay = 1000000; // start scrolling after a delay of 1 second -const TInt KHgMarqueeInterval = 100000; // scroll 10 times in a second -const TInt KHgMarqueeSpeed = 7; // scroll 3 pixels at time -const TInt KHgMarqueeLoops = 1; -const TInt KAknSensibleLength = 80; -// it does not make any sense to marquee texts longer than this -// since it will take hours and drain battery. -const TInt KAknMaxMarqueeLength = 512; - -_LIT( KGanesMif, "\\resource\\apps\\ganes.mif" ); -_LIT( KGanesDateString, "%D%M%Y%/0%1%/1%2%/2%3%/3" ); -_LIT( KGanesYearString, "%Y%3" ); -_LIT( KGanesMonthString, "%N%M%2" ); - -#endif /* HGCONSTANTS_H_ */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgDrawUtils.h --- a/uifw/ganes/inc/HgDrawUtils.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +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 HGDRAWUTILS_H_ -#define HGDRAWUTILS_H_ - -#include - -class CWindowGc; -class CCoeControl; -class TRgb; -class CHgMarquee; -class TAknWindowComponentLayout; -class TAknTextComponentLayout; -class CGulIcon; -class CGraphicsContext; - -void DrawEmptyListImpl_real( const TRect &aClientRect, - CGraphicsContext &aGc, - TPtrC aText, - const TRgb& aColor ); - -NONSHARABLE_CLASS( CHgDrawUtils ) : public CBase - { -public: - static CHgDrawUtils* NewL( TCallBack& aMarqueeCallback ); - - virtual ~CHgDrawUtils(); - -public: - void ResetMarquee(); - void EnableMarquee( TBool aEnable ); - - void DrawImage( - CWindowGc& aGc, - const TRect& aRect, - const TAknWindowComponentLayout& aLayout, - const CGulIcon& aIcon - ) const; - - void DrawText( - CWindowGc& aGc, - const TRect& aRect, - const TAknTextComponentLayout& aLayout, - const TDesC& aText, - const TRgb& aColor - ) const; - - void DrawTextMarquee( - CWindowGc& aGc, - const TRect& aRect, - const TAknTextComponentLayout& aLayout, - const TDesC& aText, - const TRgb& aColor, - const TInt& aMarqueeLine - ); - - void DrawEmptyText( - CWindowGc& aGc, - const TRect& aRect, - const TDesC& aText, - const TRgb& aColor - ) const; - -private: - CHgDrawUtils(); - - void ConstructL( TCallBack& aMarqueeCallback ); - -private: - - CHgMarquee* iMarquee; - - TInt iMarqueeLine; - }; - -#endif // HGDRAWUTILS_H_ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgIndicatorManager.h --- a/uifw/ganes/inc/HgIndicatorManager.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +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 HGINDICATORMANAGER_H_ -#define HGINDICATORMANAGER_H_ - -#include - -class CWindowGc; -class TAknLayoutRect; -class CGulIcon; -class TAknsItemID; -class TAknWindowComponentLayout; - -NONSHARABLE_CLASS( CHgIndicatorManager ) : public CBase - { -public: - - static CHgIndicatorManager* NewL(); - - /** - * Destructor. - */ - virtual ~CHgIndicatorManager(); - - void InitIndicatorsL( const TSize& aIndicatorSize ); - - void DrawIndicators( - CWindowGc& aGc, - const TRect& aRect, - TInt aFlags, - TAknWindowComponentLayout aFirstIndicatorLayout, - TAknWindowComponentLayout aSecondIndicatorLayout - ) const; - - TBool DrawIndicator( - CWindowGc& aGc, - TAknLayoutRect& aRect, - TInt aFlags, - TBool& aMemIndicator - ) const; - - void InitIconL( - CGulIcon*& aIcon, - const TAknsItemID& aItemId, - TInt aIconIndex, - TInt aMaskIndex, - TSize aSize); - - void InitColorIconL( - CGulIcon*& aIcon, - const TAknsItemID& aItemId, - TInt aIconIndex, - TInt aMaskIndex, - TSize aSize); - - void InitIconL( - CGulIcon*& aIcon, - TInt aIconIndex, - TInt aMaskIndex, - TSize aSize); - - static TInt CountIndicators( TInt aFlags ); - -private: - - CHgIndicatorManager(); - - void ConstructL(); - -private: // data - - // Indicator stuff - CGulIcon* iDrmIcon; // icon for valid drm rights indicator - CGulIcon* iDrmExpIcon; // icon for expired drm rights indicator - CGulIcon* iVideoIcon; // icon for video indicator - CGulIcon* iMarkIcon; // Icon for selection marking - CGulIcon* iMmcIcon; // Mmc indicator icon - CGulIcon* iPlaybackIndicatorIcon; // Playback indicator icon - CGulIcon* iPauseIndicatorIcon; // Playback pause indicator icon - CGulIcon* iBrokenPlaylistIcon; // Playback pause indicator icon - CGulIcon* iBrokenTrackIcon; // Playback pause indicator icon - CGulIcon* iCorruptedTrackIcon; // Playback pause indicator icon - CGulIcon* iNewVideoIcon; // new item icon for myVideos - CGulIcon* iMassStorageIcon; // new mass storage icon for my videos - CGulIcon* iPhoneStorageIcon; // phone memory icon for my videos - CGulIcon* iNewPodcastIcon; // new podcast icon for mpx - CGulIcon* iPlayedPodcastIcon; // played podcast icon for mpx - CGulIcon* iCompletelyPlayedPodcastIcon; // completely played podcast icon for mpx - CGulIcon* iMoveUpIcon; // reorder playlist icon - CGulIcon* iMoveDownIcon; // reorder playlist icon - CGulIcon* iMoveUpDownIcon; // reorder playlist icon - - }; - - -#endif // HGINDICATORMANAGER_H diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgKeyUtils.h --- a/uifw/ganes/inc/HgKeyUtils.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +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 HGKEYUTILS_H_ -#define HGKEYUTILS_H_ - -#include -#include -#include -#include -#include -#include -#include // KAknFepHashKeySelection -#include // KAknQwertyInputModeActive -#include -#include - -// Forward declarations -class CPeriodic; -struct TKeyEvent; -class CHgScroller; -class CEikButtonGroupContainer; -class CCoeControl; -class CEikCba; - -NONSHARABLE_CLASS( CHgKeyUtils ) : - public CBase, - public MCenRepNotifyHandlerCallback, - public MEikCommandObserver - { -public: - static CHgKeyUtils* NewL( CHgScroller& aScroller ); - - virtual ~CHgKeyUtils(); - - void HandleLosingFocus(); - void HandleGainingFocus(); - - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - -public: // from MCenRepNotifyHandlerCallback - - void HandleNotifyInt(TUint32 aId, TInt aNewValue); - -private: - CHgKeyUtils( CHgScroller& aScroller ); - - void ConstructL(); - - void UpdateMSKVars(); - - TBool SelectionMode( const TKeyEvent& aKeyEvent ); - - void ProcessCommandL(TInt aCommandId); - - void CreateMSKObserver(); - - void RemoveMSKObserver(); - -private: - - CHgScroller& iScroller; // Not Own. - CRepository* iCenRep; // Own. - CCenRepNotifyHandler* iCenRepNotifyHandler; // Own. - CEikCba* iCba; // Not own - - TBool iSelectionModeEnabled; - TBool iAknFepHashKeySelection; - TBool iShiftKeyPressed; - TBool iMskEnabledInPlatform; - TBool iMSKButtonGroupAlive; // status of buttongroup, which is used for MSK observer - - }; - -#endif // HGKEYUTILS_H_ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgLayoutData.h --- a/uifw/ganes/inc/HgLayoutData.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,208 +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: -* -*/ - - - - - -/* - * HgLayoutData.h - * - * Created on: Feb 6, 2009 - * Author: anjokela - */ - -#ifndef HGLAYOUTDATA_H_ -#define HGLAYOUTDATA_H_ - -#include -#include -#include "HgConstants.h" - -NONSHARABLE_CLASS( CHgListLayoutData ) : public CBase - { -public: - static CHgListLayoutData* NewL() - { - CHgListLayoutData* self = new (ELeave) CHgListLayoutData; - CleanupStack::PushL(self); - self->ConstructL( KMaxNumberOfTitleIndicators ); - CleanupStack::Pop(self); - return self; - } - - virtual ~CHgListLayoutData() - { - iTitleLayouts.Close(); - } - -public: - - inline void SetBaseLayout( const TAknWindowComponentLayout& aLayout ) - { - iBaseLayout = aLayout; - } - - inline const TAknWindowComponentLayout& BaseLayout() - { - return iBaseLayout; - } - - inline void SetItemLayout( const TAknWindowComponentLayout& aLayout ) - { - iItemLayout = aLayout; - } - - inline const TAknWindowComponentLayout& ItemLayout() - { - return iItemLayout; - } - - inline void SetIconLayout( const TAknWindowComponentLayout& aLayout ) - { - iIconLayout = aLayout; - } - - inline const TAknWindowComponentLayout& IconLayout() - { - return iIconLayout; - } - - inline void SetTitleLayout( TInt aIndicators, const TAknTextComponentLayout& aLayout ) - { - if(aIndicators >= 0 && aIndicators < iTitleLayouts.Count()) - { - iTitleLayouts[aIndicators] = aLayout; - } - } - - inline const TAknTextComponentLayout& TitleLayout( TInt aIndicators ) - { - return iTitleLayouts[aIndicators]; - } - - inline void SetTextLayout( const TAknTextComponentLayout& aLayout ) - { - iTextLayout = aLayout; - } - - inline const TAknTextComponentLayout& TextLayout() - { - return iTextLayout; - } - - inline void SetFirstIndicatorLayout( const TAknWindowComponentLayout& aLayout ) - { - iFirstIndicatorLayout = aLayout; - } - - inline const TAknWindowComponentLayout& FirstIndicatorLayout() - { - return iFirstIndicatorLayout; - } - - inline void SetSecondIndicatorLayout( const TAknWindowComponentLayout& aLayout ) - { - iSecondIndicatorLayout = aLayout; - } - - inline const TAknWindowComponentLayout& SecondIndicatorLayout() - { - return iSecondIndicatorLayout; - } -protected: - - void ConstructL( TInt aMaxIndicators ) - { - for(TInt i = 0; i <= aMaxIndicators; ++i) - { - User::LeaveIfError(iTitleLayouts.Append(TAknTextComponentLayout())); - } - } - -protected: // data - - TAknWindowComponentLayout iBaseLayout; - TAknWindowComponentLayout iItemLayout; - TAknWindowComponentLayout iIconLayout; - RArray iTitleLayouts; - TAknTextComponentLayout iTextLayout; - TAknWindowComponentLayout iFirstIndicatorLayout; - TAknWindowComponentLayout iSecondIndicatorLayout; - - }; - -NONSHARABLE_CLASS( CHgGridLayoutData ) : public CHgListLayoutData - { -public: - static CHgGridLayoutData* NewL(TInt aMaxColumnCount) - { - CHgGridLayoutData* self = new (ELeave) CHgGridLayoutData; - CleanupStack::PushL(self); - self->ConstructL( aMaxColumnCount ); - CleanupStack::Pop(self); - return self; - } - - virtual ~CHgGridLayoutData() - { - iColumnLayouts.Close(); - } -public: - inline void SetColumnLayout( TInt aIndex, const TAknWindowComponentLayout& aLayout ) - { - if(aIndex >= 0 && aIndex < iColumnLayouts.Count()) - { - iColumnLayouts[aIndex] = aLayout; - } - } - - inline const TAknWindowComponentLayout& ColumnLayout(TInt aIndex) - { - return iColumnLayouts[aIndex]; - } - - void ChangeCols( TInt aCols ) - { - if(aCols < 0) aCols = 0; - - while( iColumnLayouts.Count() < aCols ) - { - iColumnLayouts.Append(TAknWindowComponentLayout()); - } - while( iColumnLayouts.Count() > aCols ) - { - iColumnLayouts.Remove(iColumnLayouts.Count() - 1); - } - } -protected: - - void ConstructL( TInt aMaxColumnCount ) - { - CHgListLayoutData::ConstructL(0); - - for(TInt i = 0; i < aMaxColumnCount; ++i) - { - User::LeaveIfError(iColumnLayouts.Append(TAknWindowComponentLayout())); - } - } -protected: - RArray iColumnLayouts; - - }; - -#endif /* HGLAYOUTDATA_H_ */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgMarquee.h --- a/uifw/ganes/inc/HgMarquee.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,234 +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: Text scrolling functionality. -* -*/ - - -#ifndef __HGMARQUEE_H__ -#define __HGMARQUEE_H__ - -#include -#include -#include - -// FORWARD DECLARATIONS -class TAknTextComponentLayout; -class TAknLayoutText; - - -/** -* Marquee control for AVKON -* -*/ -NONSHARABLE_CLASS(CHgMarquee) : public CBase - { - public: - - /** - * Two-phased constructor. - * @param aLoops Max number of loops to be executed - * @param aScrollAmount The amount of pixels scrolled per iteration - * @param aScrollDelay The interval between iterations - */ - static CHgMarquee* NewL(const TInt aLoops = 1, - const TInt aScrollAmount = 6, const TInt aScrollDelay = 1000000); - - /** - * Two-phased constructor. - * @param aLoops Max number of loops to be executed - * @param aScrollAmount The amount of pixels scrolled per iteration - * @param aScrollDelay The interval between iterations - */ - static CHgMarquee* NewLC(const TInt aLoops = 1, - const TInt aScrollAmount = 6, const TInt aScrollDelay = 1000000); - - /** - * set redraw event callback - * - */ - void SetRedrawCallBack( TCallBack& aRedrawEventCallback ); - - /** - * Draws text in the current position. - * After the marquee object is created calling this should be enough. - * @since S60 3.1 - * @param aGc Graphics context. - * @param aRect Parent rectangle for the text layout. - * @param aTextLayout Text layout that is used to draw the text. - * @param aText Text to marquee. - * @param aFont Font used in drawing. If this is NULL then the font is - * taken from the aTextLayout. - * @param aColor Color of the text - * @return ETrue = All the loops have been executed, EFalse = There are loops to be executed. - */ - TBool DrawText( CWindowGc& aGc, - const TRect& aRect, - const TAknTextComponentLayout& aTextLayout, - const TDesC& aText, - const TRgb& aColor ); - - /** - * Enable or disable logical to visual reordering in text drawing. - * By default, it is enabled. This has any effect only when bidirectional text - * is rendered. - * - * If the text is converted to visual order prior to passing it to DrawText methods - * of this class, then the conversion should be disabled by calling this method. - * - * @since 3.1 - * @param aUseConversion Enable or disable conversion. - */ - void UseLogicalToVisualConversion( TBool aUseConversion ); - - /** - * Starts scrolling the text. - * - */ - void Start(); - - /** - * Stops scrolling the text. - * - */ - void Stop(); - - /** - * Resets the animation data. - * - */ - void Reset(); - - /** - * Is marquee on? - * - */ - #ifdef __WINS__ - const TBool IsMarqueeOn(); - #else - TBool IsMarqueeOn(); - #endif // __WINS__ - - /** - * Sets the amount of pixels the text moves per animation loop - * - */ - void SetSpeedInPixels(TInt aSpeed); - - /** - * Sets the delay between loops. - * - */ - void SetDelay(TInt aDelay); - - /** - * Sets the animation interval (=frames/second) - * - */ - void SetInterval(TInt aInterval); - - /** - * Sets the maximum number of loops to be executed. - * - */ - void SetLoops(TInt aLoops); - - /** - * Enables / disables marquee feature but does NOT start it yet. - * - */ - void EnableMarquee(TBool aEnable); // ETrue = ON, EFalse = OFF - - /** - * Destructor - * - */ - virtual ~CHgMarquee(); - - - // from CCoeControl - protected: - - private: - - enum TMarqueeFlags - { - // Is marquee enabled or not - EFlagIsOn, - // RTL when the first directional character is LTR character - EFlagIsWestern, - // If true, there needs to be a delay before the scrolling starts - EFlagIsBeginningOfLoop, - // Is conversion needed - EFlagUseVisualToLogicalConversion, - // In case of two-lined lists etc, this flag is turned on - // when the text has been scrolled all the way to the left/right. - EFlagIsWaitingForCallBack - }; - - /** - * Default constructor - * - */ - CHgMarquee(const TInt aLoops, const TInt aScrollAmount, const TInt aScrollDelay); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - /** - * advance text and issue a callback to parent - */ - void DoScroll(); - - /** - * static callback for periodic timer - */ - static TInt ScrollEvent(TAny * aPtr); - - void DrawWestern( CWindowGc& aGc, - const TRect& aRect, - const TRect& aMarqueeRect, - const TAknTextComponentLayout& aTextLayout, - TAknLayoutText aLayout, - const TDesC& aText, - TInt aTextWidth, - const TRgb& aColor ); - - void DrawNonWestern( CWindowGc& aGc, - const TRect& aRect, - const TRect& aMarqueeRect, - const TAknTextComponentLayout& aTextLayout, - TAknLayoutText aLayout, - const TDesC& aText, - TInt aTextWidth, - const TRgb& aColor ); - - -private: // Data - - CPeriodic* iPeriodicTimer; // creates scrolling events - TInt iDelta; // The difference between the old and new position in pixels - TInt iDelay; // Delay between loops in microseconds - TInt iSpeed; // Amount of pixels the text moves in a frame - TInt iInterval; // The interval between frame updates (= "frames/second") - TCallBack iCallBack; // Callback to parent - TInt iLoops; // Amount of loops executed - TInt iMaxLoops; // Amount of loops *to be executed* - TBitFlags iFlags; - TBool iLastCharacter; // It is ETrue if last character has appeared, otherwise. - }; - -#endif // __HGMARQUEE_H__ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgPopupDrawer.h --- a/uifw/ganes/inc/HgPopupDrawer.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGPOPUPDRAWER_H -#define HGPOPUPDRAWER_H - -#include - -// Forward declarations -class CFont; -class CWindowGc; - -NONSHARABLE_CLASS( THgPopupDrawer ) - { -public: - - THgPopupDrawer(); - - void Init( TRect aRect, const CFont* aFont ); - void Draw( CWindowGc& aGc, const TDesC& aDesc ); - void DrawNaviChar( CWindowGc& aGc, const TDesC& aDesc ); - void Draw( CWindowGc& aGc, - const TDesC& aDesc1, - const TDesC& aDesc2 - ); -private: - - void DrawBackground(CWindowGc& aGc, const TRect& aRect); - void InitFont(CWindowGc& aGc); - void InitLongestMonth(); - -private: - - TRect iRect; // client rect - const CFont* iFont; // Not own - TInt iLongestMonth; - - }; - -#endif //HGPOPUPDRAWER_H diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgScrollBufferManager.h --- a/uifw/ganes/inc/HgScrollBufferManager.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#ifndef HGSCROLLBUFFERMANAGER_H_ -#define HGSCROLLBUFFERMANAGER_H_ - -#include -class MHgScrollBufferObserver; -class MHgBufferOwner; - -NONSHARABLE_CLASS( CHgScrollBufferManager ) : public CActive - { -public: - - static CHgScrollBufferManager* NewL( - MHgScrollBufferObserver& aObserver, - TInt aBufferSize, - TInt aBufferTreshold, - TInt aInitialPosition, - TInt aTotalCount ); - - virtual ~CHgScrollBufferManager(); - -protected: // From CActive - - void RunL(); - void DoCancel(); - TInt RunError( TInt aError ); - -public: - void SetPosition( TInt aIndex ); - - void ItemCountChanged( TInt aIndex, TBool aRemoved, TInt aNewTotalCount ); - - void SetTotalCount( TInt aTotalCount ); - - void SetBufferOwner( MHgBufferOwner& aOwner ); - - void ResetBuffer( TInt aPosition, TInt aTotalCount); - -protected: - CHgScrollBufferManager( - MHgScrollBufferObserver& aObserver, - TInt aBufferSize, - TInt aBufferTreshold, - TInt aInitialPosition, - TInt aTotalCount ); - - void ConstructL(); - -private: - void NotifyObserver(); - -private: - MHgScrollBufferObserver& iObserver; - MHgBufferOwner* iOwner; - - TInt iBufferSize; - TInt iBufferTreshold; - TInt iBufferPosition; - TInt iDiff; - TInt iTotalCount; - - TBool iResetOrdered; - - TInt iRequestStart; - TInt iRequestCount; - TInt iReleaseStart; - TInt iReleaseCount; - }; - -#endif /*HGSCROLLBUFFERMANAGER_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgScrollbar.h --- a/uifw/ganes/inc/HgScrollbar.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +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 HGSCROLLBAR_H_ -#define HGSCROLLBAR_H_ - - -#include -#include - -struct TPointerEvent; -class TAknsItemID; -class CWindowGc; -class CFbsBitmap; -class CGulIcon; -class CFont; - -class MHgScrollbarObserver; - -NONSHARABLE_CLASS( CHgScrollbar ) : public CBase - { -public: - static CHgScrollbar* NewL( MHgScrollbarObserver& aObserver ); - - virtual ~CHgScrollbar(); - -public: - - void InitScrollBarL( - TRect aScrollbarRect, - TSize aTotalSize, - TSize aViewSize, - TBool aLandscapeScrolling ); - - void SetViewPosition( TPoint aPosition ); - - TBool HandlePointerEventL( const TPointerEvent& aEvent ); - - void Draw( CWindowGc& aGc ); - - const CGulIcon* ScrollbarBg() const; - - const CGulIcon* ScrollbarHandleBg() const; - - const CGulIcon* ScrollbarHandle() const; - - const CGulIcon* ScrollbarBgSelected() const; - - const CGulIcon* ScrollbarHandleSelected() const; - - const TRect& ScrollbarRect() const; - - const TPoint& HandlePosition() const; - - TBool IsStatic() const; - - TBool IsDragging() const; - - TBool Handler() const; - - void Reset(); - -protected: - CHgScrollbar( MHgScrollbarObserver& aObserver ); - - void ConstructL(); - -private: - - void DrawScrollbar( CWindowGc& aGc ); - - TBool HandleScrollBarPointerEvent( const TPointerEvent& aEvent ); - - void CheckHandlePosition( TBool aReportChange ); - - void InitIconsL( TBool aInitBgIcons ); - - void CreateIconL( CGulIcon*& aIcon, TSize aSize); - - void DrawIconL( CGulIcon& aIcon, - const TAknsItemID& aTop, - const TAknsItemID& aMiddle, - const TAknsItemID& aBottom ); - - void DrawBitmapL( CGulIcon& aIcon, - const TAknsItemID& aItem, - const TRect& aDestRect ); - - void ScaleBitmapL( const TRect& aDestRect, - CFbsBitmap* aDest, - const CFbsBitmap* aSrc); - -private: - MHgScrollbarObserver& iObserver; - - CGulIcon* iScrollbarBg; - CGulIcon* iScrollbarHandleBg; - CGulIcon* iScrollbarHandle; - CGulIcon* iScrollbarBgSelected; - CGulIcon* iScrollbarHandleSelected; - - TRect iScrollbarRect; - TRect iNaviRect; - TPoint iHandlePosition; - TPoint iPrevDrag; - TSize iTotalSize; - TSize iViewSize; - TSize iHandleSize; - TBool iLandscapeScrolling; - TBool iDragging; - TBool iHandler; - TBool iStatic; - - TInt iScrollLength; - TInt iTotalLength; - }; - -#endif /*HGSCROLLBAR_H_*/ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgTextFind.h --- a/uifw/ganes/inc/HgTextFind.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +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 HGTEXTFIND_H_ -#define HGTEXTFIND_H_ - -#include -#include -#include - -class CHgScroller; - -NONSHARABLE_CLASS( CHgTextFind ) : - public CBase, - public MCoeFepAwareTextEditor, - public MCoeFepAwareTextEditor_Extension1 - { -public: - static CHgTextFind* NewL(CHgScroller& aScroller); - virtual ~CHgTextFind(); - -public: // from MCoeFepAwareTextEditor - void StartFepInlineEditL(const TDesC& aInitialInlineText, TInt aPositionOfInsertionPointInInlineText, - TBool aCursorVisibility, const MFormCustomDraw* aCustomDraw, MFepInlineTextFormatRetriever& aInlineTextFormatRetriever, - MFepPointerEventHandlerDuringInlineEdit& aPointerEventHandlerDuringInlineEdit); - void UpdateFepInlineTextL(const TDesC& aNewInlineText, TInt aPositionOfInsertionPointInInlineText); - void SetInlineEditingCursorVisibilityL(TBool aCursorVisibility); - void CancelFepInlineEdit(); - TInt DocumentLengthForFep() const; - TInt DocumentMaximumLengthForFep() const; - void SetCursorSelectionForFepL(const TCursorSelection& aCursorSelection); - void GetCursorSelectionForFep(TCursorSelection& aCursorSelection) const; - void GetEditorContentForFep(TDes& aEditorContent, TInt aDocumentPosition, TInt aLengthToRetrieve) const; - void GetFormatForFep(TCharFormat& aFormat, TInt aDocumentPosition) const; - void GetScreenCoordinatesForFepL(TPoint& aLeftSideOfBaseLine, TInt& aHeight, TInt& aAscent, TInt aDocumentPosition) const; - MCoeFepAwareTextEditor_Extension1* Extension1(TBool& aSetToTrue); - -public: // MCoeFepAwareTextEditor_Extension1 - void SetStateTransferingOwnershipL(CState* aState, TUid aTypeSafetyUid); - CState* State(TUid aTypeSafetyUid); - -public: - const TDesC& Text(); - -private: // from MCoeFepAwareTextEditor - void DoCommitFepInlineEditL(); - -private: - CHgTextFind( CHgScroller& aScroller ); - void ConstructL(); - -private: - static TInt SearchTimerCallback( TAny* aSelf ); - void ClearSearchDesc(); - - -public: - CAknEdwinState* iState; - CPeriodic* iTimer; // Used for triggering search string clearing - CHgScroller& iScroller; - - RBuf iSearchDesc; // Search string - RBuf iBuf; // Type in buffer - }; - - - - -#endif /* HGTEXTFIND_H_ */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgButton.h --- a/uifw/ganes/inc/HgVgButton.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGBUTTON_H_ -#define HGVGBUTTON_H_ - -// INCLUDES -#include -#include -#include - -class MHgVgMediaWallButtonObserver; -class CGulIcon; - -/** - * Button class, which draws buttons using OpenVG. - */ -NONSHARABLE_CLASS(CHgVgButton) : public CBase - { -public: - - /** - * Creates new CHgVgButton. - * - * @param aSize sizeof the button. - * @param aPosition position of the button. - * @return HgVgButton-object - */ - static CHgVgButton* NewL (const TSize& aSize, const TPoint& aPosition, - const CGulIcon& aIcon); - - // Destructor. - virtual ~CHgVgButton(); - -private: - CHgVgButton(const TSize& aSize, const TPoint& aPosition); - - void ConstructL(const CGulIcon& aIcon); - -public: // METHODS - - /** - * - */ - TBool HandlePointerEvent(const TPointerEvent& aEvent); - - /** - * - */ - TBool IsEnabled() const; - - - /** - * - */ - const TPoint& Position() const; - - /** - * - */ - const TSize& Size() const; - - /** - * - */ - void SetEnabled(TBool aEnabled); - - /** - * - */ - void SetPosition(const TPoint& aPosition); - - /** - * - */ - void SetSize(const TSize& aSize); - - /** - * - */ - void Draw(const TRect& aWindowRect, TReal aAlpha=1); - -private: - - TSize iSize; - TPoint iPosition; - VGImage iImage; - TBool iEnabled; - TBool iPointerDown; - - }; - -#endif /* HGVGBUTTON_H */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgConstants.h --- a/uifw/ganes/inc/HgVgConstants.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,126 +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 HGVGCONSTANTS_H_ -#define HGVGCONSTANTS_H_ - -// INCLUDES -#include - -namespace HgVgConstants - { - - // maximum velocity of the spring (max velocity of view movement) - const TReal KMaxSpringVelocity(300.0f); - - // - const TReal KSpringVelocityToAnimationFactor(20.0f); - - - // maximum quads in coverflow - const TInt KMaxCoversVisible(17); - - // selected item index - const TInt KSelectedItemIndex(8); - - // - const TReal KMinFlickSpeed(0.5f); - - const TInt KViewScrollingUpdateInterval( 16000 ); // > ~60 fps - - // The amound of pixels one item (virtually) takes on the screen (if you think coverflow as uniform list) - const TReal KRowHeight(1.0f); - const TInt KRowHeightStep(10); - - // PI - const TReal PI(3.1415926535897932f); - - // Spring constant - const TReal KSpringK(35.0f); - - // Spring damping - const TReal KSpringDamping(11.0f); - - // maximum distance from target to snap - const TReal KPositionSnap(0.02); - - // maximum speed where to snap to item - const TReal KMinSpringVelocity(0.05); - - // how far user must have dragged an item before - // we move to next item when user has stopped dragging gesture. - const TReal KDragForwardThreshold(0.2f); - - // how many albums it is threoretically possible to go forward/backward - // if the distance of a drag is fullscreen in length - const TReal KItemsToDragOnFullScreenDrag(5.0f); - - // Physics update timestep - const TReal KTimeStep(0.01f); // we update physics 100 fps - - // Width of one quad in 3d space - const TReal KWorldQuadWidth(1); - - // size of default icon in pixels - const TInt KDefaultIconWidth(240); - const TInt KDefaultIconHeight(240); - - // duration of album cover flip selection animation - const TInt KSelectionAnimationDuration(400000); // 0.4 seconds - - // EGL surface bits - const TInt KSurfaceRedBits(8); - const TInt KSurfaceGreenBits(8); - const TInt KSurfaceBlueBits(8); - const TInt KSurfaceAlphaBits(8); - - // used for conversions - const TInt KOneSecondInMicroSeconds(1000000); - // how long a flick gesture can tage before it is interpreted as dragging only - const TInt KMaxFlickDuration(200000); // 2 ms - // how long it user must press to move one index further - const TInt KKeyPressDuration(800000); - // factor used for converting swipe speed to view movement - const TReal KSwipeSpeedFactor(0.4f); - - // Camera rotation factor to use in animation - // when swiping - const TReal KCameraRotationFactor(PI/8.0f); - - // zooming factor to use in animation - const TReal KCameraZoomFactor(0); - - const TInt KLetterPopupSizeX(128); - const TInt KLetterPopupSizeY(128); - const TInt KLetterPopupFontSize(100); - const TReal KMaxLetterPopupOpacity(0.85); - - const TReal KZOffset(1.0f); - - const TInt KMediaWallKeyScrollingUpdateInterval( 50000 ); - - - const TInt KGridRowCount(3); - - const TReal KGridFlipAngle(PI * 2); - - const TReal KSpaceBetweenGridItems(0.02f); - - const TReal KDefaultBlurDeviation(4); - } - -#endif /* HGVGCONSTANTS */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgDrawBuffer.h --- a/uifw/ganes/inc/HgVgDrawBuffer.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +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 HGVGDRAWBUFFER_H_ -#define HGVGDRAWBUFFER_H_ - -// INCLUDES -#include -#include -#include - -/** - * Helper class for rendering graphics to offscreen buffer - * using avkon and then copying that buffer to OpenVG images. - */ -NONSHARABLE_CLASS(CHgVgDrawBuffer) : public CBase - { -public: - - /** - * Creates new CHgVgDrawBuffer - * - * @param aDrawBufferSize - * @param aDisplayMode - * @return HgVgDrawBuffer-object - */ - static CHgVgDrawBuffer* NewL (const TSize& aDrawBufferSize, const TDisplayMode& aMode); - - // Destructor. - virtual ~CHgVgDrawBuffer(); - -public: // METHODS - - /** - * Getter for buffer size in pixels. - * - * @return buffer size in pixels. - */ - const TSize& BufferSize() const; - - /** - * Getter for draw context. - * - * @return reference to CFbsBitGc-object. - */ - CFbsBitGc& Gc(); - - /** - * - */ - CFbsBitmap& DrawBuffer(); - - /** - * Clears draw buffer - * - * @param aColor color to clear. - */ - void Clear(const TRect& aRect, const TRgb& aColor); - - /** - * Draws text to draw buffer. - * - * @param aText text. - * @param aFont font to use for text rendering. - * @param aColor color to use for text rendering. - * @param aPosition position to render. - */ - void DrawText(const TDesC& aText, const CFont* aFont, - const TRgb& aColor, const TPoint& aPosition); - - /** - * Gets drawbuffer to VGImage. - * - * @param aSrcRect rectangle in draw buffer to copy to the image. - * @param aDestRect rectangle in image. - * @param aDestImage destination image. - */ - void GetDrawBufferToVgImage(const TRect& aSrcRect, - const TPoint& aDest, VGImage destImage, VGImageFormat destFormat); - -protected: // Constructors - CHgVgDrawBuffer( ); - - void ConstructL (const TSize& aBufferSize, const TDisplayMode& aMode ); - -private: // Data - - CFbsBitmapDevice* iDevice; // owns - CFbsBitmap* iDrawBuffer; // owns - CFbsBitGc* iGc; // owns - TSize iBufferSize; - - }; - -#endif /* HGVGDRAWBUFFER_H_ */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgEGL.h --- a/uifw/ganes/inc/HgVgEGL.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +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 HGVGEGL_H_ -#define HGVGEGL_H_ - -// INCLUDES -#include -#include -#include - -class RWindow; -class CFbsBitmap; - -/** - * Wrapper for EGL - */ -NONSHARABLE_CLASS(CHgVgEGL) : CBase - { -public: - - /** - * Creates new CHgVgEGL - * - * @param aRect window rectangle. - * @return HgVgSkinRenderer-object. - */ - static CHgVgEGL* NewL (RWindow& aWindow); - - // Destructor. - virtual ~CHgVgEGL(); - -public: // Methods - - void InitWindowSurfaceL(RWindow& aWindow); - - void FreeWindowSurface(); - - TBool ReadyToRender() const; - - void SwapBuffers(); - - EGLDisplay Display() const; - - EGLSurface Surface() const; - - EGLContext Context() const; - - EGLConfig CurrentConfig() const; - - CFbsBitmap* GetSurfaceToBitmap(const TRect& aRect) const; - -protected: // Constructors - - CHgVgEGL(); - - void ConstructL (RWindow& aWindow); - - void InitEGL(RWindow& aWindow); - - void DestroyEGL(); - - void InitEGLWindowSurfaceL(RWindow& aWindow); - -private: // Data - - EGLDisplay iDisplay; // handle to egl display - EGLSurface iSurface; // handle to egl surface, owns - EGLContext iContextVg; // handle to vgl context, owns - EGLConfig iChosenConfig; // current config used to create surface. - - }; - -#endif /* HGVGSKINRENDERER */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgHelper.h --- a/uifw/ganes/inc/HgVgHelper.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,256 +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 HGVHELPER_H_ -#define HGVHELPER_H_ - -// INCLUDES -#include -#include -#include -#include - -// FORWARD DECLARATIONS -class CFbsBitmap; -class CHgVgEGL; -class CGulIcon; - -#define RGBA(r, g, b, a) ((VGuint) (((r) << 24) | ((g) << 16) | ((b) << 8) | (a))) - - -/** - * Helper classes and methods for CHgVg* classes. - */ -namespace HgVgHelper -{ - /**-------------------------------------------------------------- - * Vertex and Matrix manipulations helper classes - --------------------------------------------------------------*/ - - // Forward declarations - class TMatrix; - class TVertex; - - /** - * 3D Vertex class - */ - class TVertex - { - public: - // model coordinates - VGfloat iX, iY, iZ; - - // transformed mode-view-coordinates - VGfloat iTx, iTy, iTz; - - // projected screen coordinates - VGfloat iScreenX; - VGfloat iScreenY; - - /** - * Projects model-view-coordinates to screen space coordinates. - * - * @param aScreenWidth width of the rendering window - * @param aScreenHeight height of the rendering window - * @param aFov field of view to use - */ - void ProjectPoint(VGfloat aScreenWidth, VGfloat aScreenHeight, VGfloat aFov); - - /** - * Transform model coordinates by matrix given and sets - * result to tranformed model-view-coordinates. - * - * @param aMatrix model-view-transformation matrix. - */ - void TransformPoint(const TMatrix& aMatrix); - }; - - /** - * 4x4 Matrix class - */ - class TMatrix - { - public: - // matrix data - VGfloat iM[4][4]; - - // Construction and destruction. - TMatrix(); - TMatrix(const TMatrix& rhs); - ~TMatrix(); - - // Operators - TMatrix& operator=(const TMatrix& rhs); - - /** - * Makes this matrix identity matrix. - */ - void Identity(); - - /** - * Multiplies this matrix by rhs matrix. - * - * @param rhs Right hand side matrix. - */ - void Multiply(const TMatrix& rhs); - - /** - * Sets this matrix to rotation matrix around X-axis. - * - * @param aAngle angle in radians. - */ - void RotationX(VGfloat aAngle); - - /** - * Sets this matrix to rotation matrix around Y-axis. - * - * @param aAngle angle in radians. - */ - void RotationY(VGfloat aAngle); - - /** - * Sets this matrix to rotation matrix around Z-axis. - * - * @param aAngle angle in radians. - */ - void RotationZ(VGfloat aAngle); - - /** - * Sets this matrix to scale matrix. - * - * @param aSx scaling on X-axis - * @param aSy scaling on Y-axis - * @param aSz scaling on Z-axis - */ - void Scale(VGfloat aSx, VGfloat aSy, VGfloat aSz); - - /** - * Sets this matrix to translation matrix. - * - * @param aTx translation on X-axis. - * @param aTy translation on Y-axis. - * @param aTz translation on Z-axis. - */ - void Translation(VGfloat aTx, VGfloat aTy, VGfloat aTz); - }; - - /**-------------------------------------------------------------- - * IMAGE HANDLING ROUTINES - --------------------------------------------------------------*/ - - /** - * Creates VGImage from CGuiIcon. - * May leave for example if runs out of video memory. - * - * @param aIcon valid CGuiIcon-object. - * @return VGImage-object. - */ - VGImage CreateVgImageFromIconL( const CGulIcon& aIcon ); - - - /**-------------------------------------------------------------- - * Misc. Helpers. - --------------------------------------------------------------*/ - - /** - * Clamps value between lower and upper limits. - * - * @param aValue value. - * @param aUpper upper limit. - * @param aLower lower limit. - * @return clamped value. - */ - VGfloat Clamp(VGfloat aValue, VGfloat aUpper, VGfloat aLower); - - /** - * Linearly interpolates value between start and end. - * - * @param aStart starting value. - * @param aEnd ending value. - * @param aT t value between 0.0f - 1.0f. - */ - VGfloat Lerp(VGfloat aStart, VGfloat aEnd, VGfloat aT); - - /** - * Gets values absolute. - * - * @param aValue value. - * @return absolute of the value. - */ - VGfloat Abs(VGfloat aValue); - - - /** - * Calculates bounding rect from points. - * - * @param aRect destination rect-object, rectangle in symbian screen coordinates. - * @param aPoints source points in vg coordinates (x, y, x, y...). - * @param aNumPoints number of points in aPoints. - */ - void CalculateBoundingRect(TRect& aRect, VGfloat* aPoints, TInt aNumPoints, - const TRect& aWindowRect); - - - /** - * Draws vg image to current vg surface. - * NOTE: Assumes that the image is in vg coordinates. - * - * @param aImage image to draw. - * @param aPos position where to draw (in symbian screen coordinates). - * @param aWindowRect drawing windows rectangle. - */ - void DrawImage(VGImage aImage, const TPoint& aPos, const TRect& aWindowRect, TBool aCentered = EFalse); - - /** - * Draws vg image to current vg surface multiplying its colors by a color. - * NOTE: Assumes that the image is in vg coordinates. - * - * @param aImage image to draw. - * @param aColor color which is multiplied with image colors. - * @param aPos position where the image is drawn (in sumbian screen coordinates) - * @param aWindowRect drawing windows renctangle. - */ - void DrawImageColorized(VGImage aImage, const TRgb& aColor, - const TPoint& aPos, const TRect& aWindowRect, TBool aCentered = EFalse); - - - /** - * Wrapper for creating paths. - * - * @param aNumSegment - * @param aSegments - * @param aPoints - */ - VGPath CreatePath(VGuint aNumSegments, const VGubyte* aSegments, const VGfloat* aPoints); - - /** - * Wrapper for creating single color paints. - * - * @param aColor - */ - VGPaint CreateColorPaint(const TRgb& aColor); - - /** - * Wrapper for creating single color paints. - * - * @param aColor - */ - VGPaint CreateColorPaint(const VGfloat* aColor); - - } - -#endif /* HGVGHELPER */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgImageCreator.h --- a/uifw/ganes/inc/HgVgImageCreator.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGIMAGECREATOR_H_ -#define HGVGIMAGECREATOR_H_ - -// INCLUDES -#include -#include -#include -#include -#include - -// FORWARD DECLARATIONS -class CHgVgEGL; -class CNvgEngine; - -NONSHARABLE_CLASS(CHgVgImageCreator) : public CCoeStatic - { -public: - /** - * - */ - static CHgVgImageCreator* InstanceL(); - -private: - - CHgVgImageCreator(); - ~CHgVgImageCreator(); - - void ConstructL(); - -public: - /** - * This must be called to set current EGL, before calling any other methods. - */ - void Initialize(CHgVgEGL* aEGL); - - /** - * Creates new VGImage from given CFbsBitmap. - * Bitmap must be extended bitmap containing NVGData in data address. - * - * @param aIcon icon used to create the image. - * @return VGImage-handle to created image. - */ - VGImage RenderImageFromIconL(const CFbsBitmap* aBitmap); - - //CNvgEngine* iNvgEngine; - CHgVgEGL* iEGL; - }; - - - -#endif /* HGVGIMAGECREATOR */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgLabel.h --- a/uifw/ganes/inc/HgVgLabel.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGLABEL_H_ -#define HGVGLABEL_H_ - -// INCLUDES -#include -#include -#include -#include - - -// FORWARD DECLARATIONS -class CHgVgDrawBuffer; -class CFont; - -/** - * Helper class for rendering titles to media wall - */ -NONSHARABLE_CLASS(CHgVgLabel) : CBase - { -public: - - /** - * Creates new CHgVgLabel - * - * @param aRect Rectangle of the drawing area. - * @return HgVgLabel-object. - */ - static CHgVgLabel* NewL (const TRect& aRect, const CFont* aFont, const TDesC& aText=KNullDesC); - - // Destructor. - virtual ~CHgVgLabel(); - -public: // Methods - - void SetTextL(const TDesC& aText); - - void SetFont(const CFont* aFont); - - void SetColor(const TRgb& aColor); - - void SetShadowColor(const TRgb& aColor); - - void Draw(const TRect& aWindowRect, TReal aAlpha=1.0); - - void SetLayout(const TAknTextComponentLayout& aLayout, const TRect& aParentRect); - - void DrawEmptyText(const TRect& aClientRect, const TDesC& aText); - -protected: // Constructors - - CHgVgLabel(const TRect& aRect, const CFont* aFont); - - void ConstructL (const TDesC& aText); - - void Update(); - -private: // Data - - TRect iRect; - - const CFont* iFont; - - HBufC* iText; // Item title. Own - - CHgVgDrawBuffer* iTextRenderer; // used to renrer text to bit gc, owns - - TRgb iTextColor; - - TRgb iShadowColor; - - VGImage iTextImage; // image containing texts, owns - - TBool iDirty; - - TAknTextComponentLayout iLayout; - - TRect iParentRect; - }; - -#endif /* HGVGLABEL */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgLetterPopup.h --- a/uifw/ganes/inc/HgVgLetterPopup.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGLETTERPOPUP_H_ -#define HGVGLETTERPOPUP_H_ - -// INCLUDES -#include -#include -#include -#include - -class CHgVgDrawBuffer; -class CFont; - -/** - * Helper class for drawing letter strip. - */ -NONSHARABLE_CLASS(CHgVgPopup) : CBase - { -public: - - /** - * Creates new CHgVgLetterStrip. - * - * @param aSize size of the letter strip in pixels. - * @param aFont font to use for letter rendering. - * @return HgVgLetterStrip-object - */ - static CHgVgPopup* NewL (const TRect& aRect, const CFont* aFont); - - // Destructor. - virtual ~CHgVgPopup(); - -private: - CHgVgPopup(const TRect& aRect, const CFont* aFont); - -public: // METHODS - - /** - * Sets letter in letter strip. - * - * @param aLetter - */ - void SetTextL(const TDesC& aText); - - /** - * Set two text to popupup - * - * @param aText1 - * @param aText2 - */ - void SetTexts(const TDesC& aText1, const TDesC& aText2); - - - /** - * Draws lettter strip at position. - * - * @param aPosition position to draw letter strip. - */ - void Draw(const TRect& aWindowRect, TReal aAlpha); - - /** - * - */ - void SetLayouts(const TAknWindowComponentLayout& aPopupLayout, - const TAknTextComponentLayout& aTextLayout, const TRect& aParentRect); - -protected: // Constructors - CHgVgPopup(); - - void ConstructL ( ); - -private: - - TRect iRect; - const CFont* iFont; - CHgVgDrawBuffer* iDrawBuffer; // renderer for drawing glyphs, owns; - VGImage iLetterImage; - VGPath iLetterBgPath; - VGPaint iLetterBgPaint; - HBufC* iPrevText; - - TAknWindowComponentLayout iPopupLayout; - TAknTextComponentLayout iTextLayout; - TRect iParentRect; - }; - -#endif /* HGVGLETTERPOPUP_H */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgMediaWallRenderer.h --- a/uifw/ganes/inc/HgVgMediaWallRenderer.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,358 +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 HGVGMEDIAWALLRENDERER_H_ -#define HGVGMEDIAWALLRENDERER_H_ - -// INCLUDES -#include -#include -#include - -/** - * Helper abstract base class for drawing mediawall. - */ -NONSHARABLE_CLASS(CHgVgMediaWallRenderer) : public CBase - { -public: - - /** - * Factory method for constructing new MediaWallRenderer-Object - */ - static CHgVgMediaWallRenderer* NewL(TInt aMaxQuads, const TRect& aWindowRect, - const TRect& aFrontRect, TReal aZOffset); - - /** - * Destructor - */ - virtual ~CHgVgMediaWallRenderer(); - - -private: - - CHgVgMediaWallRenderer(const TRect& aWindowRect, - const TRect& aFrontRect, TReal aZOffset); - - void ConstructL(TInt aMaxQuads); - -public: - - /** - * Draws the mediawall. - * - * @param aItems items to draw. - * @param aSelectedIndex index of the selected item. - * @param aViewPosition views position - * @param aAnimationAlpha alpha from going from 0-1 during animation states. - * @param aState current state of the animation. - * @param aSelectionAnimationType type of the selection animation to use - */ - void Draw(RPointerArray& aItems, - TInt aSelectedIndex, TReal aNextIndex, - TReal aViewPosition, - TReal aAnimationAlpha, - CHgVgMediaWall::THgVgAnimationState aAnimationState, - CHgVgMediaWall::THgVgOpeningAnimationType aSelectionAnimationType, - CHgVgMediaWall::THgVgMediaWallStyle aStyle); - - /** - * - */ - void DrawGrid( - TInt aRowCount, - RPointerArray& aItems, - TReal aViewX, TReal aViewY, - TInt aCurItem, - TInt aPrevItem, - TReal aAnimationAlpha, - CHgVgMediaWall::THgVgAnimationState aAnimationState, - TInt aPickedItem, - CHgVgMediaWall::THgVgOpeningAnimationType aAnimationType); - - /** - * Sets default icon for rendering items with no icons. - * Ownership of the icon is not transfered. - * - * @param aIcon reference to CGulIcon-object - */ - void SetDefaultIconL(const CGulIcon& aIcon); - - /** - * Sets Camera position modifier to use in rendering. - * - * @param aCameraPosition camera position - */ - void SetCameraPosition(TReal aX, TReal aY, TReal aZ); - - /** - * Sets camera rotation modifiers to use in rendering. - * - * @param aAngle angle in radians. - */ - void SetCameraRotation(TReal aAngle); - - /** - * Gets ItemIndex of a quad at pointer position. - * NOTE: This is only valid after drawing. - * - * @param aPointerPosition position of the pointer - * @return ItemIndex or KErrNotFound if nothings if no hit. - */ - TInt GetItemIndex(const TPoint& aPointerPosition) const; - - /** - * This should be called by the client. When skin change event is triggered. - * This rebuilds all renderers skin related internal resources. - */ - void HandleSkinChange(); - - /** - * - */ - TReal GetWorldSpaceRowHeight() const; - - /** - * - */ - void SetReflections(TBool aEnabled); - - - /** - * - */ - TBool ReflectionsEnabled() const; - - /** - * - */ - TSize ImageSize() const; - - /** - * - */ - void SetFlippedRect(const TRect& aFlippedRect); - - /* - * - */ - void SetFlipAngle(TReal aAngle); - - /** - * - */ - void EnableBlurOnFlip(TBool aEnabled, TReal aBlurX, TReal aBlurY); - - - /** - * - */ - void SetOffset(const TPoint& aOffset); - - /** - * - */ - void EnableFlipXY(TBool aEnabled); - -private: - - class TQuad - { - public: - // quads world-space position - VGfloat iX; - VGfloat iY; - VGfloat iZ; - // quads angle - VGfloat iAngle; - // image used to draw this quad - VGImage iImage; - // transform constructed in TransformQuads for rendering - VGfloat iTM[9]; - // transformed 2d points - VGfloat iPoints[2*4]; - // index from CHgVgItem - TInt iItemIndex; - // flag indicating iImage is not valid, uses iDefaultImage then. - TBool iNoImage; - // - VGfloat iAlpha; - VGfloat iMirroredPoints[2*4]; - VGfloat iMirroredTM[9]; - - TBool iFlipped; - }; - - /** - * - */ - void GetGroundColorFromSkin(VGfloat* aColor); - - /** - * Transforms quads - */ - void TransformQuads(TInt aNumVisibleQuads, TBool aMirrored, - VGfloat aFov, CHgVgMediaWall::THgVgOpeningAnimationType aOpeningAnimationType); - - /** - * Sorts quads by z from iQuads to sorted quads. - */ - void SortQuads(TInt aNumVisibleNumQuads); - - /** - * Draws quads using VG - */ - void DrawQuads(TBool aDrawMirrored); - - /** - * Draws one quad using OpenVG - */ - void DrawQuad(TQuad* q, TBool aDrawMirrored); - - /** - * Setups quads into their positions/orientations, after this they can by transformed - * and rendered. - */ - TInt SetupQuads(RPointerArray& aItems, - TInt aSelectedIndex, TReal aNextIndex, - VGfloat aViewPosition, - VGfloat aAnimationAlpha, - CHgVgMediaWall::THgVgAnimationState aState, - CHgVgMediaWall::THgVgOpeningAnimationType aAnimationType); - - - /** - * Setups quads for grid mediawall style. - */ - void SetupQuadsToRow( - TInt aRow, - TInt aRowCount, - TInt& aItemsOnScreen, - RPointerArray& aItems, - TReal aViewX, TReal aViewY, - TInt aCurItem, TInt aPrevItem, - TReal aAnimationAlpha, - CHgVgMediaWall::THgVgAnimationState aAnimationState, - TInt aPickedItem, - CHgVgMediaWall::THgVgOpeningAnimationType aAnimationType); - - /** - * Applies flip animation to a quad. - */ - void ApplyOpeningAnimation(CHgVgMediaWallRenderer::TQuad* aQuad, - TReal aAnimationAlpha, TReal aZNear, CHgVgMediaWall::THgVgMediaWallStyle aMediaWallStyle, - CHgVgMediaWall::THgVgOpeningAnimationType aAnimationStyle); - - /** - * Creates path and paint for ground. - */ - void CreateGround(); - - /** - * Draws ground. - * @param aWidth width of the ground. - * @param aHeight height of the ground. - */ - void DrawGround(TInt aWidth, TInt aHeight); - - - /** - * - */ - void TransformAndDraw(TInt itemsOnScreen, - CHgVgMediaWall::THgVgOpeningAnimationType aOpeningAnimationType); - - /** - * - */ - void AdjustSettingsBasedOnRects(const TRect& aFrontRect, - TReal aZOffset); - - /** - * - */ - VGfloat GetZInWorldSpaceBasedOnWidth(VGfloat aWidth); - - /** - * - */ - void UpdateBlurChildImage(VGImage aImage); - -private: - - VGint iMaxQuads; - TRect iRect; - VGfloat iCameraX; - VGfloat iCameraY; - VGfloat iCameraZ; - VGfloat iCameraRotation; - VGImage iDefaultImage; - RPointerArray iQuads; - RPointerArray iSortedQuads; - - VGPaint iGroundPaint; - VGPath iGroundPath; - - VGfloat iSelectedQuadStartX; - VGfloat iSelectedQuadStartY; - - TBool iReflectionsEnabled; - - TSize iImageSize; - - VGfloat iCameraBaseX; - VGfloat iCameraBaseY; - VGfloat iCameraBaseZ; - - VGfloat iFlippedX; - VGfloat iFlippedY; - VGfloat iFlippedZ; - - // Which item is the front item in coverflow - TInt iSelectedItemIndex; - // Ending position of the left album stack - TReal iLeftStackEndX; - // Ending position of the right album stack - TReal iRightStackStartX; - // Z-coordinate of the frontmost album - TReal iZNear; - // Z-coordinate of the albums on the back - TReal iZFar; - // Space between albums in stacks - TReal iSpaceBetween; - // How much to zoom when fast swiped - TReal iFov; - // angle to flip the item around X-axis in flip opening animation - TReal iFlipAngle; - - VGImage iBlurImage; - VGfloat iBlurAlpha; - VGfloat iBlurDeviationX; - VGfloat iBlurDeviationY; - - VGfloat iFlippedWidth; - VGfloat iFlippedHeight; - - VGint iBlurImageWidth; - VGint iBlurImageHeight; - VGImage iChildBlurImage; - - TPoint iOffset; - - TBool iFlipXY; - }; - -#endif /* HGVGMEDIAWALLRENDERER */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgScrollBar.h --- a/uifw/ganes/inc/HgVgScrollBar.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGSCROLLBAR_H_ -#define HGVGSCROLLBAR_H_ - -// INCLUDES -#include -#include -#include -#include - -// FORWARD DECLARATIONS - -class MHgScrollbarObserver; -class CHgScrollbar; - -/** - * Helper class for drawing and interacting scrollbars. - */ -NONSHARABLE_CLASS(CHgVgScrollBar) : CBase - { -public: - - /** - * Creates new CHgVGScrollBar. - * - * @param aObserver observer for the scrollbar. - */ - static CHgVgScrollBar* NewL( MHgScrollbarObserver& aObserver, - TRect aScrollbarRect, - TSize aTotalSize, - TSize aViewSize, - TBool aLandscapeScrolling, - CHgScroller::THgScrollBarType aScrollBarType ); - - // Destructor. - virtual ~CHgVgScrollBar(); - -public: // METHODS - - void SetViewPosition( TPoint aPosition ); - - TBool HandlePointerEventL( const TPointerEvent& aEvent ); - - void Draw(const TRect& aWindowRect, TReal aAlpha) const; - - TBool IsEnabled() const; - - void SetEnabled(TBool aEnabled); - - void ResizeL(MHgScrollbarObserver& aObserver, TRect aScrollbarRect, - TSize aTotalSize, - TSize aViewSize, - TBool aLandscapeScrolling, - CHgScroller::THgScrollBarType aScrollBarType); - -protected: // Constructors - CHgVgScrollBar( ); - - void ConstructL (MHgScrollbarObserver& aObserver, TRect aScrollbarRect, - TSize aTotalSize, - TSize aViewSize, - TBool aLandscapeScrolling, - CHgScroller::THgScrollBarType aScrollBarType); - -protected: // Internal implementation - - void CreateImagesL(); - - void DrawImage(const TPoint& aPosition, VGImage aImage, - const TSize& aSize, const TRect& aWindowRect, TReal aAlpha) const; - -private: - TBool iEnabled; - - CHgScrollbar* iScrollbar; - - VGImage iScrollbarBg; - VGImage iScrollbarHandleBg; - VGImage iScrollbarHandle; - VGImage iScrollbarBgSelected; - VGImage iScrollbarHandleSelected; - - }; - -#endif /* HGVGSCROLLBAR */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgSkinRenderer.h --- a/uifw/ganes/inc/HgVgSkinRenderer.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGSKINRENDERER_H_ -#define HGVGSKINRENDERER_H_ - -// INCLUDES -#include -#include -#include - -// FORWARD DECLARATIONS -class CHgVgDrawBuffer; - - -/** - * Helper class for rendering skin to media wall. - */ -NONSHARABLE_CLASS(CHgVgSkinRenderer) : CBase - { -public: - - /** - * Creates new CHgVgSkinRenderer. - * - * @param aRect window rectangle. - * @return HgVgSkinRenderer-object. - */ - static CHgVgSkinRenderer* NewL (const TRect& aRect); - - // Destructor. - virtual ~CHgVgSkinRenderer(); - - void SetRect( const TRect& aRect ); - -public: // Methods - /** - * Draws skin to draw buffer. Should be called from controls Draw method. - * - * @param aProvider provider - * @param aControl control - */ - void UpdateSkinL(const MObjectProvider* aProvider, - const CCoeControl* aControl); - - /** - * Renders skin using vg. - * - * @param aRect window rectangle. - */ - void Draw() const; - - -protected: // Constructors - CHgVgSkinRenderer(const TRect& aRect); - - void ConstructL (); - -private: // Data - - CHgVgDrawBuffer* iDrawBuffer; - - VGImage iSkinImage; - - TRect iRect; - }; - -#endif /* HGVGSKINRENDERER */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgSpring.h --- a/uifw/ganes/inc/HgVgSpring.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGSPRING_H_ -#define HGVSPRING_H_ - -// INCLUDES -#include -#include - - - NONSHARABLE_CLASS(THgVgSpring) - { - public: - - THgVgSpring(TReal aSpringK, TReal aSpringDamping, - TReal aSpringMaxVelocity, TReal aPositionSnap, - TReal aVelocitySnap); - - void SetConstants(TReal aSpringK, TReal aSpringDamping, - TReal aSpringMaxVelocity, TReal aPositionSnap, - TReal aVelocitySnap); - - void Reset(); - void Reset(TReal aX, TReal aY); - void SetXY(TReal aX, TReal aY); - void SetEnd(TReal aX, TReal aY); - void SetVelocity(TReal aVx, TReal aVy); - TBool IntegratePhysics(TReal aDeltaTime, TBool aEndCondition); - TReal GetX() const; - TReal GetY() const; - TReal GetInterpolatedX() const; - TReal GetInterpolatedY() const; - TReal VelX() const; - TReal VelY() const; - TReal EndX() const; - TReal EndY() const; - - private: - - TReal iPrevX, iPrevY; - TReal iX, iY; - TReal iEndX, iEndY; - TReal iVelX, iVelY; - TReal iAccumulator; - TReal iSpringK; - TReal iSpringDamping; - TReal iMaxSpringVelocity; - TReal iPositionSnap; - TReal iVelocitySnap; - }; - - -#endif /* HGVGSPRING_H */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/inc/HgVgTimer.h --- a/uifw/ganes/inc/HgVgTimer.h Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -#ifndef HGVGTIMER_H_ -#define HGVGTIMER_H_ - -// INCLUDES -#include -#include - -/** - * Timer class. Needed for better timer resolution in HgVgMediaWall. - */ -NONSHARABLE_CLASS(CHgVgTimer) : public CTimer - { -public: - - /** - * Creates new CHgVgTimer - */ - static CHgVgTimer* NewL (); - - // Destructor. - virtual ~CHgVgTimer(); - -protected: - CHgVgTimer(); - -public: // CTimer - - void RunL(); - -public: - void Start( TTimeIntervalMicroSeconds32 aDelay, - TTimeIntervalMicroSeconds32 anInterval, - TCallBack aCallBack ); - -private: - TTimeIntervalMicroSeconds32 iInterval; - TCallBack iCallBack; - }; - -#endif /* HGVGTIMER */ diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/rom/ganes.iby --- a/uifw/ganes/rom/ganes.iby Thu Jul 29 14:21:56 2010 +0800 +++ /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: Iby file -* -*/ - - -#ifndef GANES_IBY -#define GANES_IBY - -#include - -file=ABI_DIR\BUILD_DIR\ganes.dll SHARED_LIB_DIR\ganes.dll -data=\epoc32\data\Z\resource\apps\ganes.mif APP_RESOURCE_DIR\ganes.mif -data=ZSYSTEM\install\ganesstub.sis System\Install\ganesstub.sis - -#endif // GANES_IBY diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/sis/ganes.pkg --- a/uifw/ganes/sis/ganes.pkg Thu Jul 29 14:21:56 2010 +0800 +++ /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: -; -; Installation file for GanesLib DLL -; -;Language - standard language definitions -&EN - -; standard SIS file header -#{"GanesLib"},(0x2001CBE2),10,10,0, TYPE=SA, RU - -;Localised Vendor name -%{"Nokia"} - -;Unique Vendor name -:"Nokia" - -;Supports Series 60 v 5.0 -[0x1028315F], 0, 0, 0, {"S60ProductID"} - -;Files to install -;Ganes -"\epoc32\release\armv5\urel\ganes.dll" -"c:\sys\bin\ganes.dll" -"\epoc32\data\z\resource\apps\ganes.mif" -"c:\resource\apps\ganes.mif" diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/sis/ganesstub.pkg --- a/uifw/ganes/sis/ganesstub.pkg Thu Jul 29 14:21:56 2010 +0800 +++ /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: -; -; Installation file for Ganes library stub for IAD -; -;Language - standard language definitions -&EN - -; standard SIS file header -#{"GanesLib"},(0x2001CBE2),10,0,0, TYPE=SA - -;Localised Vendor name -%{"Nokia"} - -;Unique Vendor name -:"Nokia" - -;Files to install -;Ganes -"" - "z:\sys\bin\ganes.dll" -"" - "z:\resource\apps\ganes.mif" diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/sis/ganesstub.sis Binary file uifw/ganes/sis/ganesstub.sis has changed diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgDoubleGraphicList.cpp --- a/uifw/ganes/src/HgDoubleGraphicList.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,232 +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 -#include -#include "HgMarquee.h" -#include "HgLayoutData.h" -#include "HgIndicatorManager.h" -#include "HgDrawUtils.h" -#include "HgConstants.h" - - -#include -#include -#include - -#include -#include -#include - -using namespace AknLayoutScalable_Avkon; - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgDoubleGraphicList* CHgDoubleGraphicList::NewL( - const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon, - RWsSession* aSession) - { - CHgDoubleGraphicList* self = new ( ELeave ) CHgDoubleGraphicList( - aItemCount, - aDefaultIcon ); - - CleanupStack::PushL (self ); - self->ConstructL( aRect, aSession ); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::~CHgDoubleGraphicList() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgDoubleGraphicList::~CHgDoubleGraphicList( ) - { - delete iIconOverlayIndicator; - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::PreferredImageSize() -// ----------------------------------------------------------------------------- -// -EXPORT_C TSize CHgDoubleGraphicList::PreferredImageSize() - { - TAknLayoutRect image; - image.LayoutRect(TRect(), AknLayoutScalable_Avkon::list_double_large_graphic_pane_g1( 0 )); - return image.Rect().Size(); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::PreferredImageSize() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgDoubleGraphicList::SetIconOverlayIndicator( CGulIcon* aIndicator ) - { - delete iIconOverlayIndicator; - iIconOverlayIndicator = aIndicator; - InitOverlayIcon(); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::HandleSizeChanged() -// ----------------------------------------------------------------------------- -// -void CHgDoubleGraphicList::HandleSizeChanged() - { - // Call base implementation - CHgList::HandleSizeChanged(); - - iLayoutData->SetItemLayout(list_double_large_graphic_pane( 0 )); - iLayoutData->SetIconLayout(list_double_large_graphic_pane_g1( 2 )); - for(TInt i = 0; i <= KMaxNumberOfTitleIndicators; ++i) - iLayoutData->SetTitleLayout(i, list_double_large_graphic_pane_t1( i )); - iLayoutData->SetTextLayout(list_double_large_graphic_pane_t2( 2 )); - iLayoutData->SetFirstIndicatorLayout(list_double_large_graphic_pane_g3(0)); - iLayoutData->SetSecondIndicatorLayout(list_double_large_graphic_pane_g2(1)); - - // Get the Row rect. - TAknLayoutRect layout; - layout.LayoutRect(ListRect(), iLayoutData->ItemLayout()); - iRowHeight = layout.Rect().Height(); - - // Icon rect. - TAknLayoutRect image; - image.LayoutRect(layout.Rect(), iLayoutData->IconLayout()); - iImageSize = image.Rect().Size(); - - InitOverlayIcon(); - - // Indicator Rect. - TAknLayoutRect indicator; - indicator.LayoutRect(layout.Rect(), iLayoutData->FirstIndicatorLayout()); - iIndicatorSize = indicator.Rect().Size(); - - // Calculate the items on the screen. - iItemsOnScreen = iHeight / iRowHeight; - iHeight = iItemsOnScreen * iRowHeight; - - if( iCurrentRow != KErrNotFound ) - FitTopItemToView( iCurrentRow ); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::DrawItem() -// ----------------------------------------------------------------------------- -// -void CHgDoubleGraphicList::DrawItem( TInt aIndex, const TRect& aRect ) const - { - // Get the Icon - CHgItem* item = iItems[aIndex]; - CGulIcon* icon = item->Icon() ? item->Icon() : iDefaultIcon; - TInt indicators = CHgIndicatorManager::CountIndicators(item->Flags()); - - CWindowGc& gc = SystemGc(); - - // Highlight the row if it's selected - TRgb color = iColor; - if( aIndex == iSelectedIndex ) - { - DrawHighlight( aRect, color ); - - // Draw first line text - iDrawUtils->DrawTextMarquee( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color, 0); - - // Draw second line text - iDrawUtils->DrawTextMarquee( - gc, - aRect, - iLayoutData->TextLayout(), - item->Text(), - color, 1); - - ResetClippingRect( gc ); - } - else - { - // Draw first line text - iDrawUtils->DrawText( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color); - - // Draw second line text - iDrawUtils->DrawText( - gc, - aRect, - iLayoutData->TextLayout(), - item->Text(), - color); - } - - // Draw the icon - iDrawUtils->DrawImage(gc, aRect, iLayoutData->IconLayout(), *icon); - - // Draw the icon overlay indicator if applicable - if( item->Flags() & CHgItem::EHgItemFlagsIconOverlayIndicator - && iIconOverlayIndicator ) - { - iDrawUtils->DrawImage( - gc, - aRect, - iLayoutData->IconLayout(), - *iIconOverlayIndicator); - } - - // Draw the indicators. - iIndicatorManager->DrawIndicators( - gc, - aRect, - item->Flags(), - iLayoutData->FirstIndicatorLayout(), - iLayoutData->SecondIndicatorLayout() ); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::CHgDoubleGraphicList() -// ----------------------------------------------------------------------------- -// -CHgDoubleGraphicList::CHgDoubleGraphicList( TInt aItemCount, - CGulIcon* aDefaultIcon ) -: CHgList( aItemCount, aDefaultIcon ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::InitOverlayIcon() -// ----------------------------------------------------------------------------- -// -void CHgDoubleGraphicList::InitOverlayIcon() - { - if( iIconOverlayIndicator && iIconOverlayIndicator->Bitmap() ) - { - AknIconUtils::SetSize(iIconOverlayIndicator->Bitmap(), iImageSize); - } - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgDoubleGraphicListFlat.cpp --- a/uifw/ganes/src/HgDoubleGraphicListFlat.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +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 -#include -#include "HgMarquee.h" -#include "HgLayoutData.h" -#include "HgIndicatorManager.h" -#include "HgDrawUtils.h" -#include "HgConstants.h" - - -#include -#include -#include - -#include -#include -#include - -using namespace AknLayoutScalable_Avkon; - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicListFlat::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgDoubleGraphicListFlat* CHgDoubleGraphicListFlat::NewL( - const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon, - RWsSession* aSession) - { - CHgDoubleGraphicListFlat* self = new ( ELeave ) CHgDoubleGraphicListFlat( - aItemCount, - aDefaultIcon ); - - CleanupStack::PushL (self ); - self->ConstructL( aRect, aSession ); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicListFlat::~CHgDoubleGraphicListFlat() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgDoubleGraphicListFlat::~CHgDoubleGraphicListFlat( ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicListFlat::PreferredImageSize() -// ----------------------------------------------------------------------------- -// -EXPORT_C TSize CHgDoubleGraphicListFlat::PreferredImageSize() - { - TAknLayoutRect image; - image.LayoutRect(TRect(), AknLayoutScalable_Avkon::list_double_large_graphic_pane_g1( 0 )); - return image.Rect().Size(); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicListFlat::HandleSizeChanged() -// ----------------------------------------------------------------------------- -// -void CHgDoubleGraphicListFlat::HandleSizeChanged() - { - // Call base implementation - CHgDoubleGraphicList::HandleSizeChanged(); - - iHeight = Rect().Height(); - - if(iHeight % iRowHeight) iItemsOnScreen++; - - if( iCurrentRow != KErrNotFound ) - FitTopItemToView( iCurrentRow ); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicListFlat::DrawItem() -// ----------------------------------------------------------------------------- -// -void CHgDoubleGraphicListFlat::DrawItem( TInt aIndex, const TRect& aRect ) const - { - CHgDoubleGraphicList::DrawItem( aIndex, aRect ); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicListFlat::CHgDoubleGraphicListFlat() -// ----------------------------------------------------------------------------- -// -CHgDoubleGraphicListFlat::CHgDoubleGraphicListFlat( TInt aItemCount, - CGulIcon* aDefaultIcon ) -: CHgDoubleGraphicList( aItemCount, aDefaultIcon ) - { - SetFlags( EHgScrollerFlatStatusPane ); // Set Flat status pane on - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgDoubleTextList.cpp --- a/uifw/ganes/src/HgDoubleTextList.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#include -#include - -#include "HgMarquee.h" -#include "HgLayoutData.h" -#include "HgIndicatorManager.h" -#include "HgDrawUtils.h" -#include "HgConstants.h" - -#include -#include -#include - -#include -#include -#include - -using namespace AknLayoutScalable_Avkon; - -// ----------------------------------------------------------------------------- -// CHgDoubleTextList::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgDoubleTextList* CHgDoubleTextList::NewL( - const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon, - RWsSession* aSession) - { - CHgDoubleTextList* self = new ( ELeave ) CHgDoubleTextList( - aItemCount, - aDefaultIcon ); - - CleanupStack::PushL (self ); - self->ConstructL( aRect, aSession ); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgDoubleTextList::~CHgDoubleTextList() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgDoubleTextList::~CHgDoubleTextList( ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgDoubleTextList::PreferredImageSize() -// ----------------------------------------------------------------------------- -// -EXPORT_C TSize CHgDoubleTextList::PreferredImageSize() - { - return TSize(0,0); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleTextList::HandleSizeChanged() -// ----------------------------------------------------------------------------- -// -void CHgDoubleTextList::HandleSizeChanged() - { - // Call base implementation - CHgList::HandleSizeChanged(); - - iLayoutData->SetItemLayout(list_double_pane( 0 )); - for(TInt i = 0; i <= KMaxNumberOfTitleIndicators; ++i) - iLayoutData->SetTitleLayout(i, list_double_pane_t1( i )); - iLayoutData->SetTextLayout(list_double_pane_t2( 2 )); - iLayoutData->SetFirstIndicatorLayout(list_double_pane_g2(0)); - iLayoutData->SetSecondIndicatorLayout(list_double_pane_g1(1)); - - // Get the Row rect. - TAknLayoutRect layout; - layout.LayoutRect(ListRect(), iLayoutData->ItemLayout()); - iRowHeight = layout.Rect().Height(); - - // Indicator Rect. - TAknLayoutRect indicator; - indicator.LayoutRect(layout.Rect(), iLayoutData->FirstIndicatorLayout() ); - iIndicatorSize = indicator.Rect().Size(); - - // Calculate the items on the screen. - iItemsOnScreen = iHeight / iRowHeight; - iHeight = iItemsOnScreen * iRowHeight; - - if( iCurrentRow != KErrNotFound ) - FitTopItemToView( iCurrentRow ); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleTextList::DrawItem() -// ----------------------------------------------------------------------------- -// -void CHgDoubleTextList::DrawItem( TInt aIndex, const TRect& aRect ) const - { - // Get the Icon - CHgItem* item = iItems[aIndex]; - TInt indicators = CHgIndicatorManager::CountIndicators(item->Flags()); - - CWindowGc& gc = SystemGc(); - - // Highlight the row if it's selected - TRgb color = iColor; - if( aIndex == iSelectedIndex ) - { - DrawHighlight( aRect, color ); - - // Draw first line text - iDrawUtils->DrawTextMarquee( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color, 0); - - // Draw second line text - iDrawUtils->DrawTextMarquee( - gc, - aRect, - iLayoutData->TextLayout(), - item->Text(), - color, 1); - - ResetClippingRect( gc ); - } - else - { - // Draw first line text - iDrawUtils->DrawText( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color); - - // Draw second line text - iDrawUtils->DrawText( - gc, - aRect, - iLayoutData->TextLayout(), - item->Text(), - color); - - } - - // Draw the indicators. - iIndicatorManager->DrawIndicators( - gc, - aRect, - item->Flags(), - iLayoutData->FirstIndicatorLayout(), - iLayoutData->SecondIndicatorLayout() ); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleTextList::CHgDoubleTextList() -// ----------------------------------------------------------------------------- -// -CHgDoubleTextList::CHgDoubleTextList( TInt aItemCount, - CGulIcon* aDefaultIcon ) -: CHgList( aItemCount, aDefaultIcon ) - { - - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgDrawUtils.cpp --- a/uifw/ganes/src/HgDrawUtils.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,504 +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 "HgDrawUtils.h" - -#include "HgMarquee.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -const TInt KHgDrawUtilsGranularity(10); -const TInt KHgDrawUtilsMaxNumberOfLines(4); - -CHgDrawUtils* CHgDrawUtils::NewL( TCallBack& aMarqueeCallback ) - { - CHgDrawUtils* self = new (ELeave) CHgDrawUtils(); - CleanupStack::PushL( self ); - self->ConstructL( aMarqueeCallback ); - CleanupStack::Pop(self); - return self; - } - -CHgDrawUtils::~CHgDrawUtils() - { - delete iMarquee; - } - - -void DrawEmptyListImpl_real_DrawUpToTwoLines( CGraphicsContext &aGc, - TPtrC aText, - TAknLayoutText &aLine1, - TAknLayoutText &aLine2, - TInt aLine1length, - TInt aLine2length, - const CFont* aFont, - TRgb aColor, - TDes& aBuffer ) - { - TRAPD( error, - { - CArrayFix* wrapWidthArray = new( ELeave ) CArrayFixFlat(KHgDrawUtilsGranularity); - CleanupStack::PushL( wrapWidthArray ); - - wrapWidthArray->AppendL( aLine1length ); - wrapWidthArray->AppendL( aLine2length ); - - AknBidiTextUtils::ConvertToVisualAndWrapToStringL( - aText, *wrapWidthArray, *aFont, aBuffer, ETrue ); - - CleanupStack::PopAndDestroy( wrapWidthArray ); // wrapWidthArray - } ); // TRAP end - - if ( error != KErrNone ) - { - aBuffer = aText; - } - - // Drawing text - aGc.Reset(); - TBool oneline( EFalse ); - TPtrC ptr = aBuffer; - TPtrC top = ptr; - TInt off = ptr.Locate('\n'); - if ( off >= 0 ) - { - top.Set(ptr.Left(off)); - ptr.Set(ptr.Mid(off+1)); - - TInt off1 = ptr.Locate('\n'); - if ( off1 >= 0 ) - { - ptr.Set(ptr.Left(off1)); - } - else - { - oneline = ETrue; - } - } - - aGc.SetBrushStyle(CGraphicsContext::ENullBrush); - - // no layout exist for popup list - mainpane layout is ok for X - // coords, center vertically. Also need to calculate vertical - // position for mainpane lists, since laf is broken as designed. - // If you don't believe this, try using laf values in phonebook. - aGc.UseFont( aFont ); - aGc.SetPenColor( aColor ); - - aLine1.DrawText(aGc, top, EFalse, aColor ); - if ( !oneline ) - { - aLine2.DrawText( aGc, ptr, EFalse, aColor ); - } - aGc.DiscardFont(); - } - -void DrawEmptyListImpl_real_DrawMoreThanTwoLines( const TRect &aParentRect, - CGraphicsContext &aGc, - TPtrC aText, - TRgb aColor, - TDes& buffer ) - - { - // fetch layouts - TAknLayoutText line[KHgDrawUtilsMaxNumberOfLines]; - - line[0].LayoutText( aParentRect, AknLayoutScalable_Avkon::main_pane_empty_t1(2) ); - line[1].LayoutText( aParentRect, AknLayoutScalable_Avkon::main_pane_empty_t3(0) ); - line[2].LayoutText( aParentRect, AknLayoutScalable_Avkon::main_pane_empty_t4(0) ); - line[3].LayoutText( aParentRect, AknLayoutScalable_Avkon::main_pane_empty_t5(0) ); - - TInt lineLength[KHgDrawUtilsMaxNumberOfLines]; - TInt i; - for ( i = 0; i < KHgDrawUtilsMaxNumberOfLines; i++ ) - { - lineLength[i] = line[i].TextRect().Width(); - } - - const CFont *bigFont = line[0].Font(); - const CFont *smallFont = line[1].Font(); - - // wrap text - TInt off = aText.Locate('\n'); - TPtrC rest( aText ); - rest.Set( aText.Right(aText.Length() - off - 1 )); - - HBufC* firstLine = NULL; - - TRAPD( error1, - { - firstLine = HBufC::NewL( - aText.Left(off).Length() + KAknBidiExtraSpacePerLine ); - }); - - if (error1 == KErrNone) - { - TPtr firstLinePtr = firstLine->Des(); - AknBidiTextUtils::ConvertToVisualAndClip( - aText.Left(off), - firstLinePtr, - *bigFont, - lineLength[0], - lineLength[0] ); - } - - TRAPD( error2, - { - CArrayFix* wrapWidthArray = new( ELeave ) CArrayFixFlat(KHgDrawUtilsGranularity); - CleanupStack::PushL( wrapWidthArray ); - - // wrap small font lines - wrapWidthArray->Reset(); - for ( i = 1; i < KHgDrawUtilsMaxNumberOfLines; i++ ) - { - wrapWidthArray->AppendL( lineLength[i] ); - } - - AknBidiTextUtils::ConvertToVisualAndWrapToStringL( - rest, *wrapWidthArray, *smallFont, buffer, ETrue ); - - CleanupStack::PopAndDestroy( wrapWidthArray ); // wrapWidthArray - } ); // TRAP end - - - TPtrC ptr[KHgDrawUtilsMaxNumberOfLines]; - TInt n = 0; - - if (error1 == KErrNone) - { - ptr[0].Set( firstLine->Des() ); - } - if ( error1 != KErrNone || error2 != KErrNone ) - { - ptr[0].Set(aText.Left(off)); - } - else - { - TInt newlines[3]; - n = 0; - for ( i = 0; i < buffer.Length(); i++ ) - { - if ( buffer[i] != '\n' ) - { - continue; - } - newlines[n] = i; - - n++; - if ( n >= 3 ) - { - break; - } - } - - if ( n >= 1 ) - { - ptr[1].Set( buffer.Left( newlines[0] ) ); - } - if ( n >= 2 ) - { - ptr[2].Set( buffer.Mid( newlines[0] + 1, newlines[1] - newlines[0] - 1 ) ); - } - if ( n >= 3 ) - { - ptr[3].Set( buffer.Mid( newlines[1] + 1, newlines[2] - newlines[1] - 1 ) ); - } - } - - // draw texts - aGc.SetBrushStyle(CGraphicsContext::ENullBrush); - - for ( i = 0; i < KHgDrawUtilsMaxNumberOfLines; i++ ) - { - line[i].DrawText( aGc, ptr[i], EFalse, aColor ); - } - - delete firstLine; - } - -void DrawEmptyListImpl_real( const TRect &aClientRect, - CGraphicsContext &aGc, - TPtrC aText, - const TRgb& aColor ) - { - if ( !aText.Length() ) - { - return; - } - - HBufC* hbuf = HBufC::New( aText.Size() + 3 * ( KAknBidiExtraSpacePerLine +1 ) - + 10 ); // reserve space for newlines - if ( !hbuf ) - { // can't really do anything - return; - } - - TPtr buffer(hbuf->Des()); - - /* - * input text can be either - * - "line1" - * - "line1 which will be wrapped to 2 lines and truncated with..." - * - "line1\nline2" - * - "line1\nMany other lines which will be wrapped to several lines" - * - * there are 3 layouts - * - 1 line with big font, - * - 2 lines with big font - * - 1 line with big font + 1..3 lines with small font (not for popup lists) - * - * so first we need to check if given text has a newline, - * if so, then we need to check if given text fits to 2 lines or - * should it be split to several small font lines - */ - - TInt i, n; - n = 0; - for (i = 0; i < aText.Length(); i ++) - { - if ( aText[i] == '\n' ) - { - n++; - } - } - - - TAknTextComponentLayout layout1( AknLayoutScalable_Avkon::main_pane_empty_t1( 0 ) ); - TAknTextComponentLayout layout2( AknLayoutScalable_Avkon::main_pane_empty_t2( 0 ) ); - TAknLayoutText line1; - TAknLayoutText line2; - - line1.LayoutText( aClientRect, layout1 ); - TInt line1length = line1.TextRect().Size().iWidth; - - line2.LayoutText( aClientRect, layout2 ); - TInt line2length = line2.TextRect().Size().iWidth; - - const CFont *font = line1.Font(); - - if ( n == 0 ) - { // one line, or one line which will be wrapped to two - DrawEmptyListImpl_real_DrawUpToTwoLines( aGc, aText, line1, line2, - line1length, line2length, - font, aColor, buffer ); - delete hbuf; - return; - } - - TRAPD( error, - { - CArrayFix* wrapWidthArray = new( ELeave ) CArrayFixFlat(KHgDrawUtilsGranularity); - CleanupStack::PushL( wrapWidthArray ); - - wrapWidthArray->AppendL( line1length ); - wrapWidthArray->AppendL( line2length ); - wrapWidthArray->AppendL( line2length ); // allow wrap to 3 lines - - AknBidiTextUtils::ConvertToVisualAndWrapToStringL( - aText, *wrapWidthArray, *font, buffer, ETrue ); - - CleanupStack::PopAndDestroy( wrapWidthArray ); // wrapWidthArray - } ); // TRAP end - - - n = 0; - for ( i = 0; i < buffer.Length(); i ++) - { - if (buffer[i] == '\n') - { - n++; - } - } - - // wrapping adds a \n to end of each line --> n < 3 - // there is no layout for empty popuplist - if ( error != KErrNone || n < 3 ) - { // 2 lines which fit to 2 line space - DrawEmptyListImpl_real_DrawUpToTwoLines( aGc, aText, line1, line2, - line1length, line2length, - font, aColor, buffer ); - } - else - { // 1 line with big font + 1..3 lines with small font - DrawEmptyListImpl_real_DrawMoreThanTwoLines( aClientRect, aGc, aText, aColor, buffer ); - } - - delete hbuf; - } - -void CHgDrawUtils::DrawEmptyText( - CWindowGc& aGc, - const TRect& aRect, - const TDesC& aText, - const TRgb& aColor - ) const - { - DrawEmptyListImpl_real(aRect, aGc, aText, aColor); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::DrawImage() -// ----------------------------------------------------------------------------- -// -void CHgDrawUtils::DrawImage( - CWindowGc& aGc, - const TRect& aRect, - const TAknWindowComponentLayout& aLayout, - const CGulIcon& aIcon - ) const - { - TAknLayoutRect image; - image.LayoutRect(aRect, aLayout); -// image.DrawImage(aGc, aIcon.Bitmap(), aIcon.Mask()); - TSize slotSize(image.Rect().Size()); - TPoint cropPoint(0,0); - TPoint toTl(image.Rect().iTl); - if( aIcon.Bitmap() && aIcon.Bitmap()->SizeInPixels() != slotSize ) - { - TSize bitmapSize( aIcon.Bitmap()->SizeInPixels() ); - if( bitmapSize.iWidth != slotSize.iWidth ) - { - if( bitmapSize.iWidth < slotSize.iWidth ) - { - // Bitmap smaller than slot -> move draw position - toTl.iX += ( slotSize.iWidth - bitmapSize.iWidth )/2; - } - else - { - // Slot smaller than bitmap -> move crop rect position - cropPoint.iX += ( bitmapSize.iWidth - slotSize.iWidth )/2; - } - } - - if( bitmapSize.iHeight != slotSize.iHeight ) - { - if( bitmapSize.iHeight < slotSize.iHeight ) - { - // Bitmap smaller than slot -> move draw position - toTl.iY += ( slotSize.iHeight - bitmapSize.iHeight )/2; - } - else - { - // Slot smaller than bitmap -> move crop rect position - cropPoint.iY += ( bitmapSize.iHeight - slotSize.iHeight )/2; - } - } - } - - TRect cropRect(cropPoint, slotSize); - - if (aIcon.Mask()) - { - aGc.BitBltMasked(toTl, aIcon.Bitmap(), cropRect, aIcon.Mask(), ETrue); - } - else - { - aGc.BitBlt(toTl, aIcon.Bitmap(), cropRect); - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::DrawText() -// ----------------------------------------------------------------------------- -// -void CHgDrawUtils::DrawText( - CWindowGc& aGc, - const TRect& aRect, - const TAknTextComponentLayout& aLayout, - const TDesC& aText, - const TRgb& aColor - ) const - { - TAknLayoutText textLayout; - textLayout.LayoutText(aRect, aLayout.LayoutLine()); - textLayout.DrawText(aGc, aText, ETrue, aColor ); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::DrawTextMarquee() -// ----------------------------------------------------------------------------- -// -void CHgDrawUtils::DrawTextMarquee( - CWindowGc& aGc, - const TRect& aRect, - const TAknTextComponentLayout& aLayout, - const TDesC& aText, - const TRgb& aColor, - const TInt& aMarqueeLine - ) - { - TBool drawn = EFalse; - - if( iMarqueeLine == aMarqueeLine) - - { - if( iMarquee->DrawText( - aGc, - aRect, - aLayout.LayoutLine(), - aText, - aColor)) - { - iMarquee->Reset(); - iMarqueeLine++; - } - else - { - drawn = ETrue; - } - } - - if(!drawn) - { - DrawText(aGc, aRect, aLayout, aText, aColor); - } - } - - -CHgDrawUtils::CHgDrawUtils() - { - - } - -void CHgDrawUtils::ConstructL( TCallBack& aMarqueeCallback ) - { - iMarquee = CHgMarquee::NewL(); - iMarquee->SetRedrawCallBack( aMarqueeCallback ); - } - -void CHgDrawUtils::ResetMarquee() - { - if(iMarquee) - { - iMarquee->Reset(); - iMarqueeLine = 0; - } - } - -void CHgDrawUtils::EnableMarquee( TBool aEnable ) - { - iMarquee->EnableMarquee(aEnable); - } diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgGrid.cpp --- a/uifw/ganes/src/HgGrid.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,792 +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 - -#include "HgLayoutData.h" -#include "HgIndicatorManager.h" -#include "HgDrawUtils.h" - - -#include - -#include "HgConstants.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -using namespace AknLayoutScalable_Apps; - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CHgGrid::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgGrid* CHgGrid::NewL ( - const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon, - RWsSession* aSession ) - { - CHgGrid* self = new ( ELeave ) CHgGrid( - aItemCount, - aDefaultIcon); - CleanupStack::PushL (self ); - self->ConstructL( aRect, aSession ); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgGrid::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgGrid::ConstructL (const TRect& aRect, RWsSession* aSession ) - { - TAknLayoutScalableParameterLimits limits = cell_gallery2_pane_ParamLimits(0); - TInt cols = limits.LastColumn() + 1; - iLayoutData = CHgGridLayoutData::NewL( cols ); - - CHgScroller::ConstructL( aRect, aSession ); - - // Activate the window, which makes it ready to be drawn - ActivateL ( ); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::CHgGrid() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgGrid::CHgGrid( - TInt aItemCount, - CGulIcon* aDefaultIcon ) -: CHgScroller( aItemCount, aDefaultIcon ) - { - // No implementation required - } - -// ----------------------------------------------------------------------------- -// CHgGrid::~CHgGrid() -// Destructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgGrid::~CHgGrid ( ) - { - delete iLayoutData; - } - -// ----------------------------------------------------------------------------- -// CHgGrid::PreferredImageSize() -// ----------------------------------------------------------------------------- -// -EXPORT_C TSize CHgGrid::PreferredImageSize() - { - TAknLayoutRect gridAppPane; - TAknLayoutRect gridItem; - TAknLayoutRect gridImage; - - gridAppPane.LayoutRect( TRect(), grid_gallery2_pane(0)); - gridItem.LayoutRect( gridAppPane.Rect(), cell_gallery2_pane(1, 0, 0)); - gridImage.LayoutRect(gridItem.Rect(), cell_gallery2_pane_g2(1)); - - return gridImage.Rect().Size(); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::InitItemsL() -// ----------------------------------------------------------------------------- -// -void CHgGrid::InitItemsL() - { - for(TInt i = 0; i < iItemCount; ++i) - { - iItems.Append( CHgItem::NewL() ); - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::DoDraw() -// ----------------------------------------------------------------------------- -// -void CHgGrid::DoDraw (const TRect& /*aRect*/) const - { - // Get the standard graphics context - TInt xdiff = (iViewPosition.iX-(iWidth/2))% (iLandscapeScrolling ? iRowHeight : iRowWidth); - TInt ydiff = (iViewPosition.iY-(iHeight/2))%( iLandscapeScrolling ? iRowWidth : iRowHeight); - - if( iItemCount == 0 ) - { - TRgb color( KRgbBlack ); - if ( AknsUtils::AvkonSkinEnabled() ) - { - AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), - color, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - } - if( iEmptyText ) - iDrawUtils->DrawEmptyText(SystemGc(), Rect(), *iEmptyText, color); - } - else - { - TAknLayoutRect gridAppPane; - gridAppPane.LayoutRect( GridRect(), iLayoutData->ItemLayout() ); - - if( iLandscapeScrolling ) - { - if( AknLayoutUtils::LayoutMirrored() ) - { - for(TInt i = iCurrentRow; i < iCols; ++i) - { - TInt xPos = - (((i-iCurrentRow)*iRowHeight) - xdiff); - if( i < 0 ) - continue; - else if( xPos < -iWidth ) - break; - - DrawRows( i, gridAppPane.Rect(), xPos ); - } - } - else - { - for(TInt i = iCurrentRow; i < iCols; ++i) - { - TInt xPos = ((i-iCurrentRow)*iRowHeight) - xdiff; - if( i < 0 ) - continue; - else if( xPos > iWidth ) - break; - - DrawRows( i, gridAppPane.Rect(), xPos ); - } - } - } - else - { - for(TInt i = iCurrentRow; i < iRows; ++i) - { - TInt yPos = ((i-iCurrentRow)*iRowHeight) - ydiff; - if( i < 0 ) - continue; - else if( yPos > iHeight ) - break; - - DrawCols( i, gridAppPane.Rect(), yPos ); - } - } - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::DrawRows() -// ----------------------------------------------------------------------------- -// -void CHgGrid::DrawRows( TInt aCol, const TRect& aRect, TInt aXPos ) const - { - for(TInt j = 0; j < iRows; ++j) - { - TInt index = aCol*iRows + j; - if( index < iItems.Count()) - { - TAknLayoutRect gridItem; - gridItem.LayoutRect( aRect,iLayoutData->ColumnLayout(j) ); - - TRect rect(gridItem.Rect()); - rect.Move( aXPos, 0 ); - - DrawItem( index, rect ); - } - else - { - break; - } - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::DrawCols() -// ----------------------------------------------------------------------------- -// -void CHgGrid::DrawCols(TInt aRow, const TRect& aRect, TInt aYPos) const - { - for(TInt j = 0; j < iCols; ++j) - { - TInt index = aRow*iCols + j; - if( index < iItems.Count()) - { - TAknLayoutRect gridItem; - gridItem.LayoutRect( aRect,iLayoutData->ColumnLayout(j) ); - - TRect rect(gridItem.Rect()); - rect.Move( 0, aYPos ); - - DrawItem( index, rect ); - } - else - { - break; - } - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::DoDraw() -// ----------------------------------------------------------------------------- -// -void CHgGrid::DrawItem(TInt aIndex, const TRect& aRect ) const - { - CHgItem* item = iItems[aIndex]; - CGulIcon* icon = item->Icon() ? item->Icon() : iDefaultIcon; - - if( aIndex == iSelectedIndex ) - { - DrawHighlight(aRect); - } - - CWindowGc& gc = SystemGc(); - - iDrawUtils->DrawImage(gc, aRect, iLayoutData->IconLayout(), *icon); - - // Draw the indicators. - iIndicatorManager->DrawIndicators( - gc, - aRect, - item->Flags(), - iLayoutData->FirstIndicatorLayout(), - iLayoutData->SecondIndicatorLayout() ); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::HandleSizeChanged() -// ----------------------------------------------------------------------------- -// -void CHgGrid::HandleSizeChanged ( ) - { - iLandscapeScrolling = Layout_Meta_Data::IsLandscapeOrientation() && iLandScapeScrollingSupported; - - TInt oldCount = iLandscapeScrolling ? iRows : iCols; - - CalculateSizes(); - - if( iLandscapeScrolling ) - { - iCols = iItemCount / iRows; - if(iItemCount%iRows) - { - ++iCols; // partially filled col - } - - iItemsOnScreen = iWidth / iRowHeight; - if((iWidth % iRowHeight)) - iItemsOnScreen += 2; - else - iItemsOnScreen++; - - iItemsOnScreen *= iRows; - - if( oldCount != iRows ) - { - FitTopItemToView( iCurrentRow*oldCount ); - } - } - else - { - iRows = iItemCount / iCols; - if(iItemCount%iCols) - { - ++iRows; // partially filled row - } - - iItemsOnScreen = iHeight / iRowHeight; - if((iHeight % iRowHeight)) - iItemsOnScreen += 2; - else - iItemsOnScreen++; - - iItemsOnScreen *= iCols; - - if( oldCount != iCols ) - { - FitTopItemToView( iCurrentRow*oldCount ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::CalculateSizes() -// ----------------------------------------------------------------------------- -// -void CHgGrid::CalculateSizes() - { - // Count number of visible rows - // First is checked if 3x4 or 4x3 items fits to the grid. - TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0; - - TAknLayoutScalableParameterLimits limits = cell_gallery2_pane_ParamLimits(variety); - iCols = limits.LastColumn() + 1; - iRows = limits.LastRow() + 1; - - iLayoutData->ChangeCols( iCols ); - - iLayoutData->SetBaseLayout(main_gallery2_pane(0)); - iLayoutData->SetItemLayout(grid_gallery2_pane(variety)); - iLayoutData->SetIconLayout(cell_gallery2_pane_g2(variety)); - - for(TInt i = 0; i < iCols; ++i) - { - if( iLandscapeScrolling ) - { - iLayoutData->SetColumnLayout(i, cell_gallery2_pane(variety, 0, i)); - } - else - { - iLayoutData->SetColumnLayout(i, cell_gallery2_pane(variety, i, 0)); - } - } - iLayoutData->SetFirstIndicatorLayout(cell_gallery2_pane_g5(variety)); - iLayoutData->SetSecondIndicatorLayout(cell_gallery2_pane_g4(variety)); - - TAknLayoutRect gridAppPane; - TAknLayoutRect gridItem; - TAknLayoutRect gridImage; - - gridAppPane.LayoutRect( GridRect(), iLayoutData->ItemLayout()); - gridItem.LayoutRect( gridAppPane.Rect(), iLayoutData->ColumnLayout(0)); - gridImage.LayoutRect( gridItem.Rect(), iLayoutData->IconLayout()); - - if( iLandscapeScrolling ) - { - iRowHeight = gridItem.Rect().Width(); - iRowWidth = gridItem.Rect().Height(); - } - else - { - iRowHeight = gridItem.Rect().Height(); - iRowWidth = gridItem.Rect().Width(); - } - - iImageSize = gridImage.Rect().Size(); - - TAknLayoutRect indicator; - indicator.LayoutRect( gridItem.Rect(), iLayoutData->FirstIndicatorLayout() ); - iIndicatorSize = indicator.Rect().Size(); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::GetSelected() -// ----------------------------------------------------------------------------- -// -TInt CHgGrid::GetSelected( TPoint aPosition ) const - { - TAknLayoutRect gridAppPane; - gridAppPane.LayoutRect( GridRect(), iLayoutData->ItemLayout()); - aPosition -= gridAppPane.Rect().iTl; - - TInt index = 0; - if( iLandscapeScrolling ) - { - TInt y = aPosition.iY + ((iViewPosition.iY - (iHeight/2)) % iRowWidth); - y /= iRowWidth; - TInt x = 0; - if( AknLayoutUtils::LayoutMirrored() ) - { - x = aPosition.iX - ((iViewPosition.iX - (iWidth/2)) % iRowHeight); - - if(x < 0) // to correct the division - x-= iRowHeight; - x /= iRowHeight; - x = ((iWidth / iRowHeight) - 1) - x; // mirrored correction to x - } - else - { - x = aPosition.iX + ((iViewPosition.iX - (iWidth/2)) % iRowHeight); - x /= iRowHeight; - } - index = (iCurrentRow*iRows) + (x*iRows) + y; - } - else - { - TInt x = aPosition.iX + ((iViewPosition.iX - (iWidth/2)) % iRowWidth); - TInt y = aPosition.iY + ((iViewPosition.iY - (iHeight/2)) % iRowHeight); - x /= iRowWidth; - y /= iRowHeight; - - if( AknLayoutUtils::LayoutMirrored() ) - { - x = (iCols - 1) - x; - } - - index = (iCurrentRow*iCols) + (y*iCols) + x; - } - - - return index >= iItems.Count() || index < 0 ? KErrNotFound : index; - } - -// ----------------------------------------------------------------------------- -// CHgGrid::TotalSize() -// ----------------------------------------------------------------------------- -// -TSize CHgGrid::TotalSize() const - { - return iLandscapeScrolling ? TSize( iCols*iRowHeight, iHeight ) : TSize(iWidth, iRows*iRowHeight); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::DrawHighlight() -// ----------------------------------------------------------------------------- -// -void CHgGrid::DrawHighlight( const TRect& aOuterRect ) const - { - TRect innerRect( aOuterRect ); - innerRect.Shrink(2,2); - - CWindowGc& gc = SystemGc(); - - if( HasHighlight() ) - { - if( iPointerDown && !iPanning && iFocusedIndex != KErrNotFound && iSelectionToFocusedItem ) - { - AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), - gc, - aOuterRect, - innerRect, - KAknsIIDQsnFrGridPressed, - KAknsIIDQsnFrGridCenterPressed ); - } - else - { - AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), - gc, - aOuterRect, - innerRect, - KAknsIIDQsnFrGrid, - KAknsIIDQsnFrGridCenter ); - } - } - else if( iPointerDown && !iPanning ) - { - AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), - gc, - aOuterRect, - innerRect, - KAknsIIDQsnFrGrid, - KAknsIIDQsnFrGridCenter ); - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::DoHandleKeyEvent() -// ----------------------------------------------------------------------------- -// -TBool CHgGrid::DoHandleKeyEvent( const TKeyEvent& aEvent ) - { - TBool ret = ETrue; - switch( aEvent.iCode ) - { - case EKeyUpArrow: - HandleUpArrow(); - break; - case EKeyDownArrow: - HandleDownArrow(); - break; - case EKeyLeftArrow: - HandleLeftArrow(); - break; - case EKeyRightArrow: - HandleRightArrow(); - break; - default: - ret = EFalse; - break; - } - - return ret; - } - -// ----------------------------------------------------------------------------- -// CHgGrid::HandleDownArrow() -// ----------------------------------------------------------------------------- -// -void CHgGrid::HandleDownArrow() - { - if( iSelectedIndex == KErrNotFound ) - { - SelectDefaultItem(); - } - else - { - if( iLandscapeScrolling ) - { - ChangeSelectedIndex( 1 ); - } - else - { - ChangeSelectedIndex( iCols ); - } - FitSelectionToView(); - SelectionChanged(); - DrawDeferred(); - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::GridRect() -// ----------------------------------------------------------------------------- -// -TRect CHgGrid::GridRect() const - { - TAknLayoutRect listscrollAppPane; - listscrollAppPane.LayoutRect( Rect(), iLayoutData->BaseLayout()); - return listscrollAppPane.Rect(); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::HandleUpArrow() -// ----------------------------------------------------------------------------- -// -void CHgGrid::HandleUpArrow() - { - if( iSelectedIndex == KErrNotFound ) - { - SelectDefaultItem(); - } - else - { - if( iLandscapeScrolling ) - { - ChangeSelectedIndex( -1 ); - } - else - { - ChangeSelectedIndex( -iCols ); - } - FitSelectionToView(); - SelectionChanged(); - DrawDeferred(); - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::HandleRightArrow() -// ----------------------------------------------------------------------------- -// -void CHgGrid::HandleRightArrow() - { - if( iSelectedIndex == KErrNotFound ) - { - SelectDefaultItem(); - } - else - { - if( iLandscapeScrolling ) - { - TInt change = AknLayoutUtils::LayoutMirrored() ? -iRows : iRows; - ChangeSelectedIndex( change ); - } - else - { - ChangeSelectedIndex( 1 ); - } - FitSelectionToView(); - SelectionChanged(); - DrawDeferred(); - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::HandleLeftArrow() -// ----------------------------------------------------------------------------- -// -void CHgGrid::HandleLeftArrow() - { - if( iSelectedIndex == KErrNotFound ) - { - SelectDefaultItem(); - } - else - { - if( iLandscapeScrolling ) - { - TInt change = AknLayoutUtils::LayoutMirrored() ? iRows : -iRows; - ChangeSelectedIndex( change ); - } - else - { - ChangeSelectedIndex( -1 ); - } - FitSelectionToView(); - SelectionChanged(); - DrawDeferred(); - } - } - -// ----------------------------------------------------------------------------- -// CHgGrid::FitSelectionToView() -// ----------------------------------------------------------------------------- -// -void CHgGrid::FitSelectionToView() - { - const TInt index = iLandscapeScrolling ? - iSelectedIndex/iRows : iSelectedIndex/iCols; - FitRowToView( index ); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::SelectDefaultItem() -// ----------------------------------------------------------------------------- -// -void CHgGrid::SelectDefaultItem() - { - iSelectedIndex = CurrentIndex(); - FitSelectionToView(); - DrawDeferred(); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::CurrentIndex() -// ----------------------------------------------------------------------------- -// -TInt CHgGrid::CurrentIndex() - { - return iLandscapeScrolling ? iCurrentRow * iRows : iCurrentRow * iCols; - } - -// ----------------------------------------------------------------------------- -// CHgGrid::IsDisplayed() -// ----------------------------------------------------------------------------- -// -TBool CHgGrid::IsDisplayed( TInt aIndex ) - { - TInt start = CurrentIndex(); - TInt end = start + iItemsOnScreen; - return aIndex >= start && aIndex < end; - } - -// ----------------------------------------------------------------------------- -// CHgGrid::FitTopItemToView() -// ----------------------------------------------------------------------------- -// -void CHgGrid::FitTopItemToView( TInt aIndex ) - { - if( iLandscapeScrolling ) - { - // Higlighted item is set to top of the list - const TInt newCol = aIndex/iRows; - TInt newPos = newCol*iRowWidth + iWidth/2; - - if( ItemsOnScreen() >= iItems.Count() ) - { - newPos = iWidth/2; - } - else - { - const TInt endMid = TotalSize().iWidth - iWidth/2; - if( newPos > endMid ) - { - // We are presenting last items in the list - newPos = endMid; - } - } - - iViewPosition.iX = newPos; - } - else - { - // Higlighted item is set to top of the list - const TInt newRow = aIndex/iCols; - TInt newPos = newRow*iRowHeight + iHeight/2; - - if( ItemsOnScreen() >= iItems.Count() ) - { - newPos = iHeight/2; - } - else - { - const TInt endMid = TotalSize().iHeight - iHeight/2; - if( newPos > endMid ) - { - // We are presenting last items in the list - newPos = endMid; - } - } - - iViewPosition.iY = newPos; - } - - HandleViewPositionChanged(); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::SetLandscapeScrollingSupport() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgGrid::SetLandscapeScrollingSupport( TBool aSupportLandscapeScrolling ) - { - iLandScapeScrollingSupported = aSupportLandscapeScrolling; - } - -void CHgGrid::ChangeSelectedIndex( TInt aMove ) - { - TInt nextIndex = 0; - if( iSelectedIndex + aMove > iItems.Count() - 1 ) - { - // go to beginning - nextIndex = 0; - } - else if( iSelectedIndex + aMove < 0 ) - { - // go to end - nextIndex = iItems.Count() - 1; - } - else - { - nextIndex = iSelectedIndex + aMove; - } - - if( iSelectionMode == ESelectionMark ) - { - Mark( iSelectedIndex ); - Mark( nextIndex ); - } - else if( iSelectionMode == ESelectionUnMark ) - { - UnMark( iSelectedIndex ); - UnMark( nextIndex ); - } - - iSelectedIndex = nextIndex; - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgIndicatorManager.cpp --- a/uifw/ganes/src/HgIndicatorManager.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,444 +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 "HgIndicatorManager.h" - -#include "HgConstants.h" -#include - -#include -#include -#include -#include -#include -#include -#include - - -CHgIndicatorManager* CHgIndicatorManager::NewL() - { - CHgIndicatorManager* self = new (ELeave) CHgIndicatorManager; - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -CHgIndicatorManager::~CHgIndicatorManager() - { - delete iDrmIcon; - delete iDrmExpIcon; - delete iVideoIcon; - delete iPlaybackIndicatorIcon; - delete iMmcIcon; - delete iMarkIcon; - delete iPauseIndicatorIcon; - delete iBrokenPlaylistIcon; - delete iBrokenTrackIcon; - delete iCorruptedTrackIcon; - delete iMassStorageIcon; - delete iNewVideoIcon; - delete iPhoneStorageIcon; - delete iNewPodcastIcon; - delete iPlayedPodcastIcon; - delete iCompletelyPlayedPodcastIcon; - delete iMoveUpIcon; - delete iMoveDownIcon; - delete iMoveUpDownIcon; - } - -void CHgIndicatorManager::InitIndicatorsL( const TSize& aIndicatorSize ) - { - // Non-Skinned icons - // Broken Playlist icon - InitIconL( iBrokenPlaylistIcon, - EMbmGanesQgn_graf_mup_lst_brokenplayl, - EMbmGanesQgn_graf_mup_lst_brokenplayl_mask, - aIndicatorSize); - - // Broken track icon - InitIconL( iBrokenTrackIcon, - EMbmGanesQgn_graf_mup_lst_brokentrack, - EMbmGanesQgn_graf_mup_lst_brokentrack_mask, - aIndicatorSize); - - // Corrupted track icon - InitIconL( iCorruptedTrackIcon, - EMbmGanesQgn_graf_mup_lst_corrupttrack, - EMbmGanesQgn_graf_mup_lst_corrupttrack_mask, - aIndicatorSize); - - // New podcast icon - InitIconL( iNewPodcastIcon, - EMbmGanesQgn_graf_mup_lst_pdc_new, - EMbmGanesQgn_graf_mup_lst_pdc_new_mask, - aIndicatorSize); - - // Played podcast icon - InitIconL( iPlayedPodcastIcon, - EMbmGanesQgn_graf_mup_lst_pdc_partplay, - EMbmGanesQgn_graf_mup_lst_pdc_partplay_mask, - aIndicatorSize); - - // Completely played podcast icon - InitIconL( iCompletelyPlayedPodcastIcon, - EMbmGanesQgn_graf_mup_lst_pdc_compplay, - EMbmGanesQgn_graf_mup_lst_pdc_compplay_mask, - aIndicatorSize); - - // Skinned icons - // Mark icon - InitIconL( iMarkIcon, KAknsIIDQgnPropSubMarked, - EMbmGanesQgn_prop_sub_marked, - EMbmGanesQgn_prop_sub_marked_mask, - aIndicatorSize); - - // Video icon - InitIconL( iVideoIcon, KAknsIIDQgnPropFileVideo, - EMbmGanesQgn_prop_file_video, - EMbmGanesQgn_prop_file_video_mask, - aIndicatorSize); - - // DRM valid icon - InitIconL( iDrmIcon, KAknsIIDQgnPropDrmRightsValidSuper, - EMbmGanesQgn_prop_drm_rights_valid_super, - EMbmGanesQgn_prop_drm_rights_valid_super_mask, - aIndicatorSize); - - // DRM expired icon - InitIconL( iDrmExpIcon, KAknsIIDQgnPropDrmRightsExpSuper, - EMbmGanesQgn_prop_drm_rights_exp_super, - EMbmGanesQgn_prop_drm_rights_exp_super_mask, - aIndicatorSize); - - // Playback icon - InitIconL( iPlaybackIndicatorIcon, KAknsIIDQgnIndiMupPlay, - EMbmGanesQgn_indi_mup_play, - EMbmGanesQgn_indi_mup_play_mask, - aIndicatorSize); - - // Pause icon - InitIconL( iPauseIndicatorIcon, KAknsIIDQgnIndiMupPause, - EMbmGanesQgn_indi_mup_pause, - EMbmGanesQgn_indi_mup_pause_mask, - aIndicatorSize); - - // New Video icon - InitIconL( iNewVideoIcon, KAknsIIDQgnPropFmgrFileVideo, - EMbmGanesQgn_prop_fmgr_file_video, - EMbmGanesQgn_prop_fmgr_file_video_mask, - aIndicatorSize); - - // Phone memory icon - InitIconL( iPhoneStorageIcon, KAknsIIDQgnPropPhoneMemc, - EMbmGanesQgn_prop_phone_memc, - EMbmGanesQgn_prop_phone_memc_mask, - aIndicatorSize); - - // MMC memory icon - InitIconL( iMmcIcon, KAknsIIDQgnPropMmcMemc, - EMbmGanesQgn_prop_mmc_memc, - EMbmGanesQgn_prop_mmc_memc_mask, - aIndicatorSize); - - // Mass memory icon - InitIconL( iMassStorageIcon, KAknsIIDQgnPropFmgrMsSmall, - EMbmGanesQgn_prop_fmgr_ms_small, - EMbmGanesQgn_prop_fmgr_ms_small_mask, - aIndicatorSize); - - // Move up icon - InitIconL( iMoveUpIcon, KAknsIIDQgnGrafMupAdtlReorderUp, - EMbmGanesQgn_graf_mup_adtl_reorder_up, - EMbmGanesQgn_graf_mup_adtl_reorder_up_mask, - aIndicatorSize); - - // Move down icon - InitIconL( iMoveDownIcon, KAknsIIDQgnGrafMupAdtlReorderDown, - EMbmGanesQgn_graf_mup_adtl_reorder_down, - EMbmGanesQgn_graf_mup_adtl_reorder_down_mask, - aIndicatorSize); - - // Move updown icon - InitIconL( iMoveUpDownIcon, KAknsIIDQgnGrafMupAdtlReorderUpdown, - EMbmGanesQgn_graf_mup_adtl_reorder_updown, - EMbmGanesQgn_graf_mup_adtl_reorder_updown_mask, - aIndicatorSize); - } - -void CHgIndicatorManager::DrawIndicators( - CWindowGc& aGc, - const TRect& aRect, - TInt aFlags, - TAknWindowComponentLayout aFirstIndicatorLayout, - TAknWindowComponentLayout aSecondIndicatorLayout - ) const - { - TAknLayoutRect secondIndicator; - secondIndicator.LayoutRect(aRect, aSecondIndicatorLayout); - - TAknLayoutRect firstIndicator; - firstIndicator.LayoutRect(aRect, aFirstIndicatorLayout); - - TAknLayoutRect rect = secondIndicator; - TBool memIndicator = EFalse; - TInt indicatorsDrawn = 0; - - if( aFlags & CHgItem::EHgItemFlagMarked ) - { - rect.DrawImage(aGc, iMarkIcon->Bitmap(), iMarkIcon->Mask()); - ++indicatorsDrawn; - rect = firstIndicator; - } - - if( DrawIndicator(aGc, rect, aFlags, memIndicator) ) - { - ++indicatorsDrawn; - rect = firstIndicator; - } - - if( indicatorsDrawn == 1 && !memIndicator ) - { - if( aFlags & CHgItem::EHgItemFlagsMmc ) - { - rect.DrawImage(aGc, iMmcIcon->Bitmap(), iMmcIcon->Mask() ); - } - else if( aFlags & CHgItem::EHgItemFlagsMassStorageIndicator ) - { - rect.DrawImage(aGc, iMassStorageIcon->Bitmap(), iMassStorageIcon->Mask() ); - } - else if( aFlags & CHgItem::EHgItemFlagsPhoneStorageIndicator ) - { - rect.DrawImage(aGc, iPhoneStorageIcon->Bitmap(), iPhoneStorageIcon->Mask() ); - } - } - - } - -TBool CHgIndicatorManager::DrawIndicator( - CWindowGc& aGc, - TAknLayoutRect& aRect, - TInt aFlags, - TBool& aMemIndicator - ) const - { - TBool ret = EFalse; - - if( aFlags & CHgItem::EHgItemFlagsPlaybackIndicator ) - { - aRect.DrawImage(aGc, iPlaybackIndicatorIcon->Bitmap(), iPlaybackIndicatorIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsPauseIndicator ) - { - aRect.DrawImage(aGc, iPauseIndicatorIcon->Bitmap(), iPauseIndicatorIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsDrmRightsValid ) - { - aRect.DrawImage(aGc, iDrmIcon->Bitmap(), iDrmIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsDrmRightsExpired ) - { - aRect.DrawImage(aGc, iDrmExpIcon->Bitmap(), iDrmExpIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsVideo ) - { - aRect.DrawImage(aGc, iVideoIcon->Bitmap(), iVideoIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsBrokenPlaylistIndicator ) - { - aRect.DrawImage(aGc, iBrokenPlaylistIcon->Bitmap(), iBrokenPlaylistIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsBrokenTrackIndicator ) - { - aRect.DrawImage(aGc, iBrokenTrackIcon->Bitmap(), iBrokenTrackIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsCorruptedTrackIndicator ) - { - aRect.DrawImage(aGc, iCorruptedTrackIcon->Bitmap(), iCorruptedTrackIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsNewVideoIndicator ) - { - aRect.DrawImage(aGc, iNewVideoIcon->Bitmap(), iNewVideoIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsNewPodcastIndicator ) - { - aRect.DrawImage(aGc, iNewPodcastIcon->Bitmap(), iNewPodcastIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsPlayedPodcastIndicator ) - { - aRect.DrawImage(aGc, iPlayedPodcastIcon->Bitmap(), iPlayedPodcastIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsCompletelyPlayedPodcastIndicator ) - { - aRect.DrawImage(aGc, iCompletelyPlayedPodcastIcon->Bitmap(), iCompletelyPlayedPodcastIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsMoveUpIndicator ) - { - aRect.DrawImage(aGc, iMoveUpIcon->Bitmap(), iMoveUpIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsMoveDownIndicator ) - { - aRect.DrawImage(aGc, iMoveDownIcon->Bitmap(), iMoveDownIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsMoveUpDownIndicator ) - { - aRect.DrawImage(aGc, iMoveUpDownIcon->Bitmap(), iMoveUpDownIcon->Mask() ); - ret = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsMmc ) - { - aRect.DrawImage(aGc, iMmcIcon->Bitmap(), iMmcIcon->Mask() ); - ret = ETrue; - aMemIndicator = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsMassStorageIndicator ) - { - aRect.DrawImage(aGc, iMassStorageIcon->Bitmap(), iMassStorageIcon->Mask() ); - ret = ETrue; - aMemIndicator = ETrue; - } - else if( aFlags & CHgItem::EHgItemFlagsPhoneStorageIndicator ) - { - aRect.DrawImage(aGc, iPhoneStorageIcon->Bitmap(), iPhoneStorageIcon->Mask() ); - ret = ETrue; - aMemIndicator = ETrue; - } - return ret; - } - -// ----------------------------------------------------------------------------- -// CHgIndicatorManager::InitIconL() -// ----------------------------------------------------------------------------- -// -void CHgIndicatorManager::InitIconL( CGulIcon*& aIcon, - TInt aIconIndex, - TInt aMaskIndex, - TSize aSize ) - { - if( !aIcon ) - { - CFbsBitmap* bitmap, *mask; - AknIconUtils::CreateIconL( - bitmap, - mask, - KGanesMif, - aIconIndex, - aMaskIndex ); - aIcon = CGulIcon::NewL(bitmap, mask); - } - - AknIconUtils::SetSize(aIcon->Bitmap(), aSize); - } - -// ----------------------------------------------------------------------------- -// CHgIndicatorManager::InitIconL() -// ----------------------------------------------------------------------------- -// -void CHgIndicatorManager::InitIconL( CGulIcon*& aIcon, - const TAknsItemID& aItemId, - TInt aIconIndex, - TInt aMaskIndex, - TSize aSize ) - { - if( !aIcon ) - { - aIcon = AknsUtils::CreateGulIconL( - AknsUtils::SkinInstance(), - aItemId, - KGanesMif, - aIconIndex, - aMaskIndex ); - } - - AknIconUtils::SetSize(aIcon->Bitmap(), aSize); - } - -// ----------------------------------------------------------------------------- -// CHgIndicatorManager::InitIconL() -// ----------------------------------------------------------------------------- -// -void CHgIndicatorManager::InitColorIconL( CGulIcon*& aIcon, - const TAknsItemID& aItemId, - TInt aIconIndex, - TInt aMaskIndex, - TSize aSize ) - { - if( !aIcon ) - { - TRgb defaultColour( KRgbWhite ); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - AknsUtils::GetCachedColor( skin, - defaultColour, - KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG13 ); - - CFbsBitmap *bitmap,*mask; - AknsUtils::CreateColorIconL( - skin, - aItemId, - KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG13, - bitmap, - mask, - KGanesMif, - aIconIndex, - aMaskIndex, - defaultColour ); - - aIcon = CGulIcon::NewL(bitmap, mask); - } - - AknIconUtils::SetSize(aIcon->Bitmap(), aSize); - } - -TInt CHgIndicatorManager::CountIndicators( TInt aFlags ) - { - TInt count = 0; - aFlags &= (~CHgItem::EHgItemFlagsIconOverlayIndicator); // overlayindicator not counted - while(aFlags) - { - count += aFlags & 0x1; - aFlags = aFlags >> 1; - } - return count > KMaxNumberOfTitleIndicators ? KMaxNumberOfTitleIndicators : count; - } - -CHgIndicatorManager::CHgIndicatorManager() - { - - } - -void CHgIndicatorManager::ConstructL() - { - - } diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgItem.cpp --- a/uifw/ganes/src/HgItem.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,190 +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 -#include - -// ----------------------------------------------------------------------------- -// CHgItem::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgItem* CHgItem::NewL( - TInt aFlags, - CGulIcon* aIcon, - const TDesC& aTitle, - const TDesC& aText ) - { - CHgItem* self = CHgItem::NewLC( aFlags, aIcon, aTitle, aText ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgItem::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgItem* CHgItem::NewLC( - TInt aFlags, - CGulIcon* aIcon, - const TDesC& aTitle, - const TDesC& aText ) - { - CHgItem* self = new (ELeave) CHgItem( aFlags, aIcon ); - CleanupStack::PushL( self ); - self->ConstructL( aTitle, aText ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgItem::~CHgItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgItem::~CHgItem() - { - delete iIcon; - delete iTitle; - delete iText; - } - -// ----------------------------------------------------------------------------- -// CHgItem::CHgItem() -// ----------------------------------------------------------------------------- -// -CHgItem::CHgItem( TInt aFlags, CGulIcon* aIcon ) : - iIcon( aIcon ), - iFlags( aFlags ) - { - iTime.HomeTime(); - } - -// ----------------------------------------------------------------------------- -// CHgItem::ConstructL() -// ----------------------------------------------------------------------------- -// -void CHgItem::ConstructL( const TDesC& aTitle, const TDesC& aText ) - { - iTitle = aTitle.AllocL(); - iText = aText.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CHgItem::Icon() -// ----------------------------------------------------------------------------- -// -EXPORT_C CGulIcon* CHgItem::Icon() const - { - return iIcon; - } - -// ----------------------------------------------------------------------------- -// CHgItem::Title() -// ----------------------------------------------------------------------------- -// -EXPORT_C const TDesC& CHgItem::Title() const - { - return *iTitle; - } - -// ----------------------------------------------------------------------------- -// CHgItem::Text() -// ----------------------------------------------------------------------------- -// -EXPORT_C const TDesC& CHgItem::Text() const - { - return *iText; - } - -// ----------------------------------------------------------------------------- -// CHgItem::Time() -// ----------------------------------------------------------------------------- -// -EXPORT_C TTime CHgItem::Time() const - { - return iTime; - } - -// ----------------------------------------------------------------------------- -// CHgItem::SetIcon() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgItem::SetIcon( CGulIcon* aIcon, TInt aFlags ) - { - delete iIcon; - iIcon = aIcon; - SetFlags( aFlags ); - } - -// ----------------------------------------------------------------------------- -// CHgItem::SetTitleL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgItem::SetTitleL( const TDesC& aTitle ) - { - delete iTitle; - iTitle = 0; - iTitle = aTitle.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CHgItem::SetTextL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgItem::SetTextL( const TDesC& aText ) - { - delete iText; - iText = 0; - iText = aText.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CHgItem::SetTime() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgItem::SetTime( TTime aTime ) - { - iTime = aTime; - } - -// ----------------------------------------------------------------------------- -// CHgItem::SetTextL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgItem::SetFlags( TInt aFlags ) - { - iFlags |= aFlags; - } - -// ----------------------------------------------------------------------------- -// CHgItem::SetTextL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgItem::ClearFlags( TInt aFlags ) - { - iFlags &= ~aFlags; - } - -// ----------------------------------------------------------------------------- -// CHgItem::SetTextL() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgItem::Flags() - { - return iFlags; - } - -// End of file diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgKeyUtils.cpp --- a/uifw/ganes/src/HgKeyUtils.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,288 +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 "HgKeyUtils.h" -#include "HgConstants.h" -#include -#include - -#include -#include -#include -#include -#include -#include - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::NewL() -// ----------------------------------------------------------------------------- -// -CHgKeyUtils* CHgKeyUtils::NewL( CHgScroller& aScroller ) - { - CHgKeyUtils* self = new (ELeave) CHgKeyUtils( aScroller ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::CHgKeyUtils() -// ----------------------------------------------------------------------------- -// -CHgKeyUtils::~CHgKeyUtils() - { - RemoveMSKObserver(); - // Stop listening CenRep. - if (iCenRepNotifyHandler) - { - iCenRepNotifyHandler->StopListening(); - } - delete iCenRepNotifyHandler; - delete iCenRep; - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::HandleNotifyInt() -// ----------------------------------------------------------------------------- -// -void CHgKeyUtils::HandleNotifyInt(TUint32 aId, TInt aNewValue) - { - if (aId == KAknFepHashKeySelection) - { - iAknFepHashKeySelection = (TBool)aNewValue; - } - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::CHgKeyUtils() -// ----------------------------------------------------------------------------- -// -CHgKeyUtils::CHgKeyUtils( CHgScroller& aScroller ): - iScroller( aScroller ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::ConstructL() -// ----------------------------------------------------------------------------- -// -void CHgKeyUtils::ConstructL() - { - iMskEnabledInPlatform = AknLayoutUtils::MSKEnabled(); - - // Start listening a CenRep key indicating whether hash key selection is active. - TRAPD(err, iCenRep = CRepository::NewL(KCRUidAknFep)); - if (err == KErrNone) - { - iCenRepNotifyHandler = CCenRepNotifyHandler::NewL(*this, - *iCenRep, - CCenRepNotifyHandler::EIntKey, - KAknFepHashKeySelection); - - iCenRepNotifyHandler->StartListeningL(); - iCenRep->Get(KAknFepHashKeySelection, iAknFepHashKeySelection); - } - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::SelectionMode() -// ----------------------------------------------------------------------------- -// -TBool CHgKeyUtils::SelectionMode( const TKeyEvent& aKeyEvent ) - { - return (iAknFepHashKeySelection && aKeyEvent.iScanCode == EStdKeyHash) || - aKeyEvent.iScanCode == EStdKeyLeftShift || - aKeyEvent.iScanCode == EStdKeyRightShift || - aKeyEvent.iScanCode == EStdKeyLeftCtrl || - aKeyEvent.iScanCode == EStdKeyRightCtrl; - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::ProcessCommandL() -// ----------------------------------------------------------------------------- -// -void CHgKeyUtils::ProcessCommandL(TInt aCommandId) - { - if( !iMskEnabledInPlatform ) - return; - - switch ( aCommandId ) - { - case EAknSoftkeyShiftMSK: - { - const TInt selectedIndex = iScroller.SelectedIndex(); - if ( selectedIndex != KErrNotFound ) - { - if( iScroller.ItemL( selectedIndex ).Flags() & CHgItem::EHgItemFlagMarked ) - { - iScroller.UnMark(selectedIndex); - iScroller.SetSelectionMode( CHgScroller::ESelectionUnMark ); - } - else - { - iScroller.Mark(selectedIndex); - iScroller.SetSelectionMode( CHgScroller::ESelectionMark ); - } - } - } - break; - default: - break; - } - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::CreateMSKObserverL() -// ----------------------------------------------------------------------------- -// -void CHgKeyUtils::CreateMSKObserver() - { - if( !iMskEnabledInPlatform ) - return; - - RemoveMSKObserver(); - - UpdateMSKVars(); - - if( !iCba ) - return; - - iCba->SetMSKCommandObserver(this); - iMSKButtonGroupAlive = ETrue; - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::RemoveMSKObserver() -// ----------------------------------------------------------------------------- -// -void CHgKeyUtils::RemoveMSKObserver() - { - if( !iMSKButtonGroupAlive || !iMskEnabledInPlatform ) - return; - - UpdateMSKVars(); - - if( !iCba ) - return; - - iCba->SetMSKCommandObserver(NULL); - iMSKButtonGroupAlive = EFalse; - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::UpdateMSKVars() -// ----------------------------------------------------------------------------- -// -void CHgKeyUtils::UpdateMSKVars() - { - if( !iMskEnabledInPlatform ) - return; - - CEikButtonGroupContainer* bgc; - iCba = NULL; - - iScroller.MopGetObject( bgc ); - if ( bgc ) - { - iCba = ( static_cast( bgc->ButtonGroup() ) ); // downcast from MEikButtonGroup - } - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::OfferKeyEventL() -// ----------------------------------------------------------------------------- -// -TKeyResponse CHgKeyUtils::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) - { - TKeyResponse response = EKeyWasNotConsumed; - - // if we have markable list and either shift, ctrl or hash is long pressed - // down, we will enter selection (marking) mode, where MSK is Mark/Unmark - if( SelectionMode( aKeyEvent ) ) - { - if( aType == EEventKeyDown ) - { - iShiftKeyPressed = ETrue; - iScroller.SetSelectionMode( CHgScroller::ESelectionPossible ); - } - else if( aType == EEventKeyUp ) - { - iShiftKeyPressed = EFalse; - iScroller.SetSelectionMode( CHgScroller::ENoSelection ); - } - response = EKeyWasConsumed; - } - - const TInt selectedIndex = iScroller.SelectedIndex(); - if( iShiftKeyPressed - && aType == EEventKey - && selectedIndex != KErrNotFound - && iScroller.SelectionMode() == CHgScroller::ESelectionPossible ) - { - TBool itemMarked = iScroller.ItemL( selectedIndex ).Flags() & CHgItem::EHgItemFlagMarked; - if(itemMarked) - { - iScroller.SetSelectionMode( CHgScroller::ESelectionUnMark ); - } - else - { - iScroller.SetSelectionMode( CHgScroller::ESelectionMark ); - } - - if( ( iAknFepHashKeySelection && aKeyEvent.iScanCode == EStdKeyHash ) ) - { - if( itemMarked ) - { - iScroller.UnMark(selectedIndex); - } - else - { - iScroller.Mark(selectedIndex); - } - iScroller.RefreshScreen(selectedIndex); - } - - } - - return response; - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::HandleLosingForeground() -// ----------------------------------------------------------------------------- -// -void CHgKeyUtils::HandleLosingFocus() - { - // switch off selection (marking) mode when we lose focus - iShiftKeyPressed = EFalse; - iSelectionModeEnabled = EFalse; - iScroller.SetSelectionMode( CHgScroller::ENoSelection ); - RemoveMSKObserver(); - } - -// ----------------------------------------------------------------------------- -// CHgKeyUtils::HandleGainingForeground() -// ----------------------------------------------------------------------------- -// -void CHgKeyUtils::HandleGainingFocus() - { - CreateMSKObserver(); - } - -// End of file diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgList.cpp --- a/uifw/ganes/src/HgList.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,443 +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 - -#include "HgLayoutData.h" -#include "HgDrawUtils.h" - -#include - -#include "HgConstants.h" -#include "HgMarquee.h" - -#include -#include -#include //AknLayoutUtils -#include // CFont -#include -#include -#include -#include -#include - -#include -#include - -// UI Constants - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CHgList::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgList::ConstructL (const TRect& aRect, RWsSession* aSession ) - { - // Inherited classes might use some custom layout data, so lets use the - // default one only if not yet initialized. - if( !iLayoutData ) - iLayoutData = CHgListLayoutData::NewL(); - - CHgScroller::ConstructL( aRect, aSession ); - - // Activate the window, which makes it ready to be drawn - ActivateL ( ); - } - -// ----------------------------------------------------------------------------- -// CHgList::CHgList() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgList::CHgList( TInt aItemCount, - CGulIcon* aDefaultIcon ) -: CHgScroller( aItemCount, aDefaultIcon ), - iColor( KRgbBlack ), - iColorBack( AKN_LAF_COLOR( 0 ) ), - iHighlightedColor( KRgbBlack ), - iHighlightedColorBack( AKN_LAF_COLOR( 0 ) ) - { - SetFlags(EHgScrollerSearchWithQWERTY); // Set QWERTY search on - } - -// ----------------------------------------------------------------------------- -// CHgList::~CHgList() -// Destructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgList::~CHgList ( ) - { - delete iLayoutData; - } - -// ----------------------------------------------------------------------------- -// CHgList::InitItemsL() -// ----------------------------------------------------------------------------- -// -void CHgList::InitItemsL() - { - for(TInt i = 0; i < iItemCount; ++i) - { - iItems.Append(CHgItem::NewL()); - } - } - -// ----------------------------------------------------------------------------- -// CHgList::DrawHighlight() -// Called by Draw function to draw the higlighted item effect. -// ----------------------------------------------------------------------------- -// -void CHgList::DrawHighlight( const TRect& aRect, TRgb& aTextColor ) const - { - // Init drawing options - TRect outerRect( aRect ); - TRect innerRect( aRect ); - innerRect.Shrink(KListHighlightInnerRectShrink,KListHighlightInnerRectShrink); - - CWindowGc& gc = SystemGc(); - - // Draw "selected item" rect for the row. Bitmaps to draw the rect are feched from - // current skin instance. - if( HasHighlight() ) - { - if( iPointerDown && !iPanning && iFocusedIndex != KErrNotFound && iSelectionToFocusedItem ) - { - AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), - gc, - outerRect, - innerRect, - KAknsIIDQsnFrListPressed, - KAknsIIDQsnFrListCenterPressed ); - } - else - { - AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), - gc, - outerRect, - innerRect, - KAknsIIDQsnFrList, - KAknsIIDQsnFrListCenter ); - } - aTextColor = iHighlightedColor; - } - else if( iPointerDown && !iPanning ) - { - AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), - gc, - outerRect, - innerRect, - KAknsIIDQsnFrList, - KAknsIIDQsnFrListCenter ); - } - } - -// ----------------------------------------------------------------------------- -// CHgList::HandleSizeChanged() -// Called by framework when the view size is changed. -// ----------------------------------------------------------------------------- -// -void CHgList::HandleSizeChanged ( ) - { - iLandscapeScrolling = EFalse; // list always scrolls in portrait mode - iRows = iItemCount; - - // Resolve colors for normal and higlighted items - if ( AknsUtils::AvkonSkinEnabled() ) - { - // this does not modify color unless it gets a correct one - // no real need to check errors - AknsUtils::GetCachedColor( - AknsUtils::SkinInstance(), - iColor, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - - AknsUtils::GetCachedColor( - AknsUtils::SkinInstance(), - iHighlightedColor, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG10 ); - } - iLayoutData->SetBaseLayout(AknLayoutScalable_Avkon::list_gen_pane(0)); - - if( iFlags & CHgScroller::EHgScrollerFlatStatusPane ) - { - iListOffset = TPoint(0,0); - } - else - { - TAknLayoutRect foobar; - foobar.LayoutRect(Rect(), AknLayoutScalable_Avkon::listscroll_gen_pane(0)); - - iWidth = foobar.Rect().Width(); - iHeight = foobar.Rect().Height(); - iListOffset = foobar.Rect().iTl; - } - } - -// ----------------------------------------------------------------------------- -// CHgList::DoDraw() -// ----------------------------------------------------------------------------- -// -void CHgList::DoDraw(const TRect& /*aRect*/ ) const - { - // Calculate the displacement. How much of the first row is showing. - TInt ydiff = (iViewPosition.iY-(iHeight/2))%(iRowHeight); - - CWindowGc& gc = SystemGc(); - - if( iItemCount == 0 ) - { - if( iEmptyText ) - iDrawUtils->DrawEmptyText(gc, Rect(), *iEmptyText, iColor); - } - else - { - // Get the row rect - TAknLayoutRect layout; - layout.LayoutRect(ListRect(), iLayoutData->ItemLayout()); - - ResetClippingRect(gc); - - // Draw rows - for(TInt i = iCurrentRow; i < iRows && i < iItems.Count(); ++i) - { - // Topleft position of the row. - TPoint point( - 0, - ((i-iCurrentRow)*iRowHeight) - ydiff); - - if( i < 0 || point.iY < iListOffset.iY - layout.Rect().Height() ) - continue; // Not a real row - else if( point.iY + iListOffset.iY > iHeight ) - break; // Row is now showing on the screen, we can stop. - - - TRect rect(layout.Rect()); - // Move to correct y-position - rect.Move(point); - DrawItem( i, rect ); - } - gc.CancelClippingRect(); - } - } - - -void CHgList::ResetClippingRect( CWindowGc& aGc ) const - { - if( !(iFlags & CHgScroller::EHgScrollerFlatStatusPane) ) - aGc.SetClippingRect( TRect(iListOffset, TSize(iWidth, iHeight+2)) ); - } - -// ----------------------------------------------------------------------------- -// CHgList::TotalSize() -// ----------------------------------------------------------------------------- -// -TSize CHgList::TotalSize() const - { - return TSize( iWidth, iRows*iRowHeight ); - } - -// ----------------------------------------------------------------------------- -// CHgList::GetSelected() -// ----------------------------------------------------------------------------- -// -TInt CHgList::GetSelected( TPoint aPosition ) const - { - // Real position is current screen pos + world pos - TInt y = aPosition.iY + (iViewPosition.iY - (iHeight/2)) - iListOffset.iY; - y /= iRowHeight; - return y >= iItems.Count() || y < 0 ? KErrNotFound : y; - } - -// ----------------------------------------------------------------------------- -// CHgList::DoHandleKeyEvent() -// ----------------------------------------------------------------------------- -// -TBool CHgList::DoHandleKeyEvent(const TKeyEvent& aKeyEvent) - { - TBool ret = ETrue; - switch( aKeyEvent.iCode ) - { - case EKeyUpArrow: - HandleUpArrow(); - break; - case EKeyDownArrow: - HandleDownArrow(); - break; - case EKeyLeftArrow: - case EKeyRightArrow: - default: - ret = EFalse; - break; - } - - return ret; - } - -// ----------------------------------------------------------------------------- -// CHgList::HandleDownArrow() -// ----------------------------------------------------------------------------- -// -void CHgList::HandleDownArrow() - { - if( iSelectedIndex == KErrNotFound ) - { - SelectDefaultItem(); - } - else - { - if( iSelectedIndex <= iRows - 1 ) - { - const TInt nextIndex = iSelectedIndex == (iRows - 1) ? - 0 : iSelectedIndex + 1; - - if( iSelectionMode == ESelectionMark ) - { - Mark( iSelectedIndex ); - Mark( nextIndex ); - } - else if( iSelectionMode == ESelectionUnMark ) - { - UnMark( iSelectedIndex ); - UnMark( nextIndex ); - } - iSelectedIndex = nextIndex; - FitSelectionToView(); - SelectionChanged(); - DrawDeferred(); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgList::HandleUpArrow() -// ----------------------------------------------------------------------------- -// -void CHgList::HandleUpArrow() - { - if( iSelectedIndex == KErrNotFound ) - { - SelectDefaultItem(); - } - else - { - if( iSelectedIndex >= 0 ) - { - const TInt nextIndex = iSelectedIndex == 0 ? - iRows - 1 : iSelectedIndex - 1; - - if( iSelectionMode == ESelectionMark ) - { - Mark( iSelectedIndex ); - Mark( nextIndex ); - } - else if( iSelectionMode == ESelectionUnMark ) - { - UnMark( iSelectedIndex ); - UnMark( nextIndex ); - } - iSelectedIndex = nextIndex; - FitSelectionToView(); - SelectionChanged(); - DrawDeferred(); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgList::FitSelectionToView() -// ----------------------------------------------------------------------------- -// -void CHgList::FitSelectionToView() - { - FitRowToView( iSelectedIndex ); - } - -// ----------------------------------------------------------------------------- -// CHgList::ListRect() -// ----------------------------------------------------------------------------- -// -TRect CHgList::ListRect() const - { - TRect rect(iListOffset, TSize(iWidth,iHeight)); - TAknLayoutRect areaaftersb; - areaaftersb.LayoutRect(rect, iLayoutData->BaseLayout()); - return areaaftersb.Rect(); - } - -// ----------------------------------------------------------------------------- -// CHgList::SelectDefaultItem() -// ----------------------------------------------------------------------------- -// -void CHgList::SelectDefaultItem() - { - iSelectedIndex = iCurrentRow; - FitSelectionToView(); - SelectionChanged(); - - DrawDeferred(); - } - -TInt CHgList::CurrentIndex() - { - return iCurrentRow; - } - -TBool CHgList::IsDisplayed( TInt aIndex ) - { - TInt start = CurrentIndex(); - TInt rowsPerView = ItemsOnScreen(); - if( (iViewPosition.iY-(iHeight/2))%(iRowHeight) ) - ++rowsPerView; - TInt end = start + rowsPerView; - return aIndex >= start && aIndex <= end; - } - -// ----------------------------------------------------------------------------- -// CHgList::FitTopItemToView() -// ----------------------------------------------------------------------------- -// -void CHgList::FitTopItemToView( TInt aIndex ) - { - // Higlighted item is set to top of the list - TInt newPos = aIndex*iRowHeight + iHeight/2; - - if( ItemsOnScreen() >= iItems.Count() ) - { - newPos = iHeight/2; - } - else - { - const TInt endMid = TotalSize().iHeight - iHeight/2; - if( newPos > endMid ) - { - // We are presenting last items in the list - newPos = endMid; - } - } - - iViewPosition.iY = newPos; - HandleViewPositionChanged(); - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgMarquee.cpp --- a/uifw/ganes/src/HgMarquee.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,471 +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: Text scrolling functionality. -* -*/ - - -// INCLUDE FILES -#include "HgMarquee.h" -#include -#include -#include -#include -#include "HgConstants.h" - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::CAknMarqueeControl -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CHgMarquee::CHgMarquee(const TInt aLoops, const TInt aScrollAmount, - const TInt aScrollDelay) : - iDelta(0), - iDelay(aScrollDelay), - iSpeed(aScrollAmount), - iInterval(KHgMarqueeInterval), - iLoops(0), - iMaxLoops(aLoops), - iLastCharacter(EFalse) - { - iFlags.Set( EFlagIsBeginningOfLoop ); - iFlags.Set( EFlagUseVisualToLogicalConversion ); - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::ConstructL -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgMarquee::ConstructL() - { - iPeriodicTimer = CPeriodic::NewL(CActive::EPriorityIdle); - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::NewLC -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgMarquee* CHgMarquee::NewLC(const TInt aLoops, - const TInt aScrollAmount, - const TInt aScrollDelay) - { - CHgMarquee* self = new( ELeave )CHgMarquee(aLoops, aScrollAmount, aScrollDelay); - - CleanupStack::PushL( self ); - self->ConstructL(); - - return self; - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::NewL -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgMarquee* CHgMarquee::NewL(const TInt aLoops, - const TInt aScrollAmount, - const TInt aScrollDelay) - { - CHgMarquee* self = CHgMarquee::NewLC(aLoops, aScrollAmount, aScrollDelay); - CleanupStack::Pop( self ); - - return self; - } - -// Destructor -CHgMarquee::~CHgMarquee() - { - if (iPeriodicTimer) - { - iPeriodicTimer->Cancel(); - delete iPeriodicTimer; - } - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::SetRedrawCallBack -// -// ----------------------------------------------------------------------------- -// -void CHgMarquee::SetRedrawCallBack(TCallBack& aCallBack) - { - iCallBack = aCallBack; - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::DrawText -// -// ----------------------------------------------------------------------------- -// -TBool CHgMarquee::DrawText( - CWindowGc& aGc, - const TRect& aRect, - const TAknTextComponentLayout& aTextLayout, - const TDesC& aText, - const TRgb& aColor ) - { - // In this function, TAknLayoutText::DrawText performs logical-to-visual - // conversion for the given text. - if ( iLoops < iMaxLoops && aText.Length() < KAknSensibleLength ) // Has every loop been executed - { - TAknLayoutText textLayout; - textLayout.LayoutText( aRect, aTextLayout ); - - TRect marqueeRect( textLayout.TextRect() ); - TInt textWidth = textLayout.Font()->TextWidthInPixels( aText ); - if ( textWidth <= marqueeRect.Width() ) - { - iLoops = iMaxLoops; - return ETrue; - } - - if ( TBidiText::TextDirectionality( aText ) == TBidiText::ELeftToRight ) - iFlags.Set( EFlagIsWestern ); - else - iFlags.Clear( EFlagIsWestern ); - - aGc.SetClippingRect( marqueeRect ); - - if ( iFlags.IsSet( EFlagIsBeginningOfLoop ) && - !iFlags.IsSet( EFlagIsWaitingForCallBack ) ) - { - Stop(); // Just in case - textLayout.DrawText( aGc, aText, iFlags.IsSet( EFlagUseVisualToLogicalConversion ), aColor ); - iFlags.Clear( EFlagIsBeginningOfLoop ); - Start(); - } - else if ( iDelta == 0 ) // we are still drawing non-scrolling text (2 line lists need this) - { - textLayout.DrawText( aGc, aText, iFlags.IsSet( EFlagUseVisualToLogicalConversion ), aColor ); - } - else if ( iFlags.IsSet( EFlagIsWestern ) ) // Scrolls from right to left. - { - DrawWestern( - aGc, - aRect, - marqueeRect, - aTextLayout, - textLayout, - aText, - textWidth, - aColor); - } - else // Non-western, scrolls from left to right. - { - DrawNonWestern( - aGc, - aRect, - marqueeRect, - aTextLayout, - textLayout, - aText, - textWidth, - aColor); - } - - aGc.CancelClippingRect(); - // Time to let the parent know if all loops aren't executed yet. - return EFalse; - } - else // No more loops to be executed -> draw text in the default position. - { - Stop(); // No need to generate events any longer. - return ETrue; // Indicate the parent that marquee has stopped, - } // parent is then able to for example truncate the text. - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::DrawWestern -// Starts scrolling the text. -// ----------------------------------------------------------------------------- -// -void CHgMarquee::DrawWestern( CWindowGc& aGc, - const TRect& aRect, - const TRect& aMarqueeRect, - const TAknTextComponentLayout& aTextLayout, - TAknLayoutText aLayout, - const TDesC& aText, - TInt aTextWidth, - const TRgb& aColor ) - { - TRect rect = aRect; - rect.SetWidth( aRect.Width() + ( aTextWidth - aMarqueeRect.Width() ) ); - rect.Move(-iDelta, 0); - - // ESRY-7M5A33 - // Due to text rolling region is not actual parent region, - // textLayout.TextRect() is incorrect. Introduce a temparory layout to recalculate. - TAknTextLineLayout tmpTextLineLayout = aTextLayout; - tmpTextLineLayout.iW = aTextWidth; - aLayout.LayoutText( rect, tmpTextLineLayout ); - - aLayout.DrawText( aGc, aText, iFlags.IsSet( EFlagUseVisualToLogicalConversion ), aColor ); - - if ( iFlags.IsSet( EFlagIsWaitingForCallBack ) ) - { - // do nothing - } - // Sliding behaviour: When the last character is visible, scrolling stops - // and starts from the beginning after a short delay. - else if ( aLayout.TextRect().iBr.iX >= aMarqueeRect.iBr.iX ) - { - iFlags.Clear( EFlagIsBeginningOfLoop ); - if ( !iPeriodicTimer->IsActive() ) - Start(); - } - else // Last character has appeared, so let's make it reappear from the other - { // side after a delay - iFlags.Set( EFlagIsBeginningOfLoop ); - iFlags.Set( EFlagIsWaitingForCallBack ); - iLastCharacter = ETrue; - Stop(); // Cancel all outstanding requests. - ++iLoops; - Start(); - } - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::DrawNonWestern -// Starts scrolling the text. -// ----------------------------------------------------------------------------- -// -void CHgMarquee::DrawNonWestern( CWindowGc& aGc, - const TRect& aRect, - const TRect& aMarqueeRect, - const TAknTextComponentLayout& aTextLayout, - TAknLayoutText aLayout, - const TDesC& aText, - TInt aTextWidth, - const TRgb& aColor ) - { - TRect rect = aRect; - // Prepare rect to be scrolled from l -> r - rect.iTl.iX = rect.iTl.iX - ( aTextWidth - aMarqueeRect.Width() ); - rect.Move(iDelta, 0); - - // note refer to case western - TAknTextLineLayout tmpTextLineLayout = aTextLayout; - tmpTextLineLayout.iW = aTextWidth; - aLayout.LayoutText( rect, tmpTextLineLayout ); - - aLayout.DrawText( aGc, aText, iFlags.IsSet( EFlagUseVisualToLogicalConversion ), aColor ); - - if ( iFlags.IsSet( EFlagIsWaitingForCallBack ) ) - { - // do nothing - } - else if ( aLayout.TextRect().iTl.iX < aMarqueeRect.iTl.iX ) - { - iFlags.Clear( EFlagIsBeginningOfLoop ); - if ( !iPeriodicTimer->IsActive() ) - Start(); - } - else // Last character has appeared - { - iFlags.Set( EFlagIsBeginningOfLoop ); - iFlags.Set( EFlagIsWaitingForCallBack ); - iLastCharacter = ETrue; - Stop(); // Cancel all outstanding requests. - ++iLoops; - Start(); - } - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::Start -// Starts scrolling the text. -// ----------------------------------------------------------------------------- -// -void CHgMarquee::Start() - { - if ( iFlags.IsSet( EFlagIsOn ) ) - { - if ( !iPeriodicTimer->IsActive() ) // start timer if not already started - { - iPeriodicTimer->Start( TTimeIntervalMicroSeconds32( iDelay ), - TTimeIntervalMicroSeconds32( iInterval ), - TCallBack( CHgMarquee::ScrollEvent, this ) ); - } - } - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::Stop -// Stops scrolling the text. -// ----------------------------------------------------------------------------- -// -void CHgMarquee::Stop() - { - //Stop the timer if it is active - if ( iPeriodicTimer->IsActive() ) - { - iPeriodicTimer->Cancel(); - } - if ( !iFlags.IsSet(EFlagIsWaitingForCallBack) ) - { - iDelta = 0; // reset scroll position - } - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::Reset -// Resets the animation data. -// ----------------------------------------------------------------------------- -// -void CHgMarquee::Reset() - { - iDelta = 0; // reset scroll position - iLoops = 0; - iLastCharacter = EFalse; - Stop(); - iFlags.Set( EFlagIsBeginningOfLoop ); - iFlags.Clear( EFlagIsWaitingForCallBack ); - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::IsMarqueeOn -// Returns marquee status -// Two versions to discard compiler warnings -// ----------------------------------------------------------------------------- -// -#ifdef __WINS__ -const TBool CHgMarquee::IsMarqueeOn() - { - return iFlags.IsSet( EFlagIsOn ); - } -#else -TBool CHgMarquee::IsMarqueeOn() - { - return iFlags.IsSet( EFlagIsOn ); - } -#endif // __WINS__ - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::SetSpeedInPixels -// sets scrolling speed in pixels -// ----------------------------------------------------------------------------- -// -void CHgMarquee::SetSpeedInPixels(TInt aSpeed) - { - if ( aSpeed <= 0 ) - aSpeed = KHgMarqueeSpeed; - iSpeed = aSpeed; - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::SetDelay -// Sets delay between loops -// ----------------------------------------------------------------------------- -// -void CHgMarquee::SetDelay(TInt aDelay) - { - if ( aDelay < 0 ) - aDelay = KHgMarqueeDelay; - iDelay = aDelay; - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::SetInterval -// Sets scrolling interval -// ----------------------------------------------------------------------------- -// -void CHgMarquee::SetInterval(TInt aInterval) - { - iInterval = aInterval; - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::SetLoops -// Sets the amount of maximum loops to be executed. -// ----------------------------------------------------------------------------- -// -void CHgMarquee::SetLoops(TInt aLoops) - { - if ( aLoops < 0 ) - aLoops = KHgMarqueeLoops; - iMaxLoops = aLoops; - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::DoScroll -// advances text position and instructs parent control to do a redraw -// ----------------------------------------------------------------------------- -// -void CHgMarquee::DoScroll() - { - if ( !iFlags.IsSet( EFlagIsWaitingForCallBack ) ) - { - iDelta += iSpeed; // advance text - } - - iFlags.Clear( EFlagIsWaitingForCallBack ); - - if ( !iCallBack.CallBack() ) // stop timer if callback returns false - { - iPeriodicTimer->Cancel(); - } - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::ScrollEvent -// This static function is called by the periodic timer -// ----------------------------------------------------------------------------- -// -TInt CHgMarquee::ScrollEvent(TAny * aPtr) - { - ( ( CHgMarquee* ) aPtr )->DoScroll(); - return TRUE; // run again - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::EnableMarquee -// Enables/disables marquee feature. -// ----------------------------------------------------------------------------- -// -void CHgMarquee::EnableMarquee(TBool aEnable) - { - if ( aEnable ) - { - iFlags.Set( EFlagIsOn ); - } - else - { - iFlags.Clear( EFlagIsOn ); - } - } - -// ----------------------------------------------------------------------------- -// CAknMarqueeControl::UseLogicalToVisualConversion -// ----------------------------------------------------------------------------- -// - -void CHgMarquee::UseLogicalToVisualConversion( - TBool aUseConversion ) - { - if ( aUseConversion ) - { - iFlags.Set( EFlagUseVisualToLogicalConversion ); - } - else - { - iFlags.Clear( EFlagUseVisualToLogicalConversion ); - } - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgPopupDrawer.cpp --- a/uifw/ganes/src/HgPopupDrawer.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,215 +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 "HgPopupDrawer.h" -#include "HgConstants.h" - -#include -#include -#include -#include -#include -#include -#include -#include - - -THgPopupDrawer::THgPopupDrawer() - { - } - -void THgPopupDrawer::Init( TRect aRect, const CFont* aFont ) - { - iRect = aRect; - iFont = aFont; - iLongestMonth = 0; - } - -void THgPopupDrawer::InitLongestMonth() - { - TTime time; - time.HomeTime(); - TDateTime date = time.DateTime(); - date.SetMonth(EJanuary); - time = date; - - TFileName month; - month.Zero(); - - for(TInt i = 0; i < 12; ++i) - { - TRAP_IGNORE - ( - time.FormatL(month, KGanesMonthString); - ) - time += TTimeIntervalMonths(1); - TInt monthLen = iFont->TextWidthInPixels(month); - iLongestMonth = monthLen > iLongestMonth ? monthLen : iLongestMonth; - } - } - -void THgPopupDrawer::Draw( CWindowGc& aGc, const TDesC& aDesc ) - { - // Resolve rect for the popup "window" - const TInt textLength = iFont->TextWidthInPixels( aDesc ); - TInt width = iRect.Width()/KPopupWidthDiv > textLength + KPopupTextExtraPadding ? - iRect.Width()/KPopupWidthDiv : textLength + KPopupTextExtraPadding; - TInt height = (iFont->FontMaxHeight() * 2); - - // calculate the position of the popup - TPoint pos(((iRect.Width() - width )/2), (iRect.Height() - height)/2); - TRect area( pos, TSize( width, height) ); - - // First draw background box, after that the text - DrawBackground(aGc, area); - - InitFont(aGc); - - // Draw Text - TPoint point( area.iTl ); - point.iY += iFont->FontMaxAscent() + ((area.Height() - iFont->FontMaxHeight()) / 2); - - TRAP_IGNORE( - TBidiText* text = TBidiText::NewL( aDesc, 1 ); - text->WrapText(area.Width(), *iFont, NULL); - if(text->Directionality() == TBidiText::ELeftToRight ) - { - point.iX += (area.Width() - textLength)/2; - } - else - { - point.iX -= (area.Width() - textLength)/2; - } - - text->DrawText( aGc, point ); - delete text; - ) - } - -void THgPopupDrawer::DrawNaviChar( CWindowGc& aGc, const TDesC& aDesc ) - { - TRgb normal; - AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), - normal, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - - TAknLayoutRect layout; - layout.LayoutRect(iRect, AknLayoutScalable_Apps::popup_navstr_preview_pane(0)); - - DrawBackground( aGc, layout.Rect() ); - - TAknLayoutText textLayout; - textLayout.LayoutText(layout.Rect(), AknLayoutScalable_Apps::popup_navstr_preview_pane_t1(0).LayoutLine()); - textLayout.DrawText(aGc, aDesc, ETrue, normal ); - - } - -void THgPopupDrawer::Draw( CWindowGc& aGc, - const TDesC& aDesc1, - const TDesC& aDesc2 - ) - { - // init longest month value. - if(!iLongestMonth) - InitLongestMonth(); - - // Resolve rect for the popup "window" - TInt d1Length = iFont->TextWidthInPixels( aDesc1 ); - TInt d2Length = iFont->TextWidthInPixels( aDesc2 ); - - // Calculate the dimensions - TInt width = iRect.Width()/KPopupWidthDiv > iLongestMonth + KPopupTextExtraPadding ? - iRect.Width()/KPopupWidthDiv : iLongestMonth + KPopupTextExtraPadding; - TInt height = (iFont->FontMaxHeight() * 3); - - // calculate the position of the popup - TPoint pos(((iRect.Width() - width )/2), (iRect.Height() - height)/2); - TRect area( pos, TSize( width, height) ); - - // First draw background box, after that the text - DrawBackground(aGc, area); - - InitFont(aGc); - - // First text - TPoint point( area.iTl ); - point.iY += iFont->FontMaxAscent() + (iFont->FontMaxHeight() / 2); - TRAP_IGNORE( - TBidiText* text = TBidiText::NewL( aDesc1, 1 ); - text->WrapText(area.Width(), *iFont, NULL); - if(text->Directionality() == TBidiText::ELeftToRight ) - { - point.iX += (area.Width() - d1Length)/2; - } - else - { - point.iX -= (area.Width() - d1Length)/2; - } - - text->DrawText( aGc, point ); - delete text; - ) - - // Second text - point.iX = area.iTl.iX; - point.iX += (area.Width() - d2Length)/2; - point.iY += iFont->FontMaxHeight(); - aGc.DrawText(aDesc2, point ); - } - -void THgPopupDrawer::DrawBackground( CWindowGc& aGc, const TRect& aRect ) - { - TAknLayoutRect cornerRect; - // skinned draw uses submenu popup window skin (skinned border) - cornerRect.LayoutRect( - aRect, - SkinLayout::Submenu_skin_placing_Line_2() ); - - TRect innerRect( aRect ); - innerRect.Shrink( cornerRect.Rect().Width(), cornerRect.Rect().Height() ); - - if ( !AknsDrawUtils::DrawFrame( - AknsUtils::SkinInstance(), - aGc, - aRect, - innerRect, - KAknsIIDQsnFrPopupSub, - KAknsIIDQsnFrPopupCenterSubmenu ) ) - { - // skinned border failed -> black border - aGc.SetPenStyle( CGraphicsContext::ESolidPen ); - aGc.SetBrushColor( KRgbBlack ); - aGc.DrawRect( aRect ); - } - } - -void THgPopupDrawer::InitFont(CWindowGc& aGc) - { - // Get color for the text from the skin. - TRgb normal; - AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), - normal, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - - // Draw text - aGc.UseFont( iFont ); - aGc.SetPenColor(normal); - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgScrollBufferManager.cpp --- a/uifw/ganes/src/HgScrollBufferManager.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,335 +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 "HgScrollBufferManager.h" -#include - -#include - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::NewL() -// ----------------------------------------------------------------------------- -// -CHgScrollBufferManager* CHgScrollBufferManager::NewL( - MHgScrollBufferObserver& aObserver, - TInt aBufferSize, - TInt aBufferTreshold, - TInt aInitialPosition, - TInt aTotalCount ) - { - CHgScrollBufferManager* self = new (ELeave) CHgScrollBufferManager( - aObserver, - aBufferSize, - aBufferTreshold, - aInitialPosition, - aTotalCount ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::CHgScrollBufferManager() -// ----------------------------------------------------------------------------- -// -CHgScrollBufferManager::CHgScrollBufferManager( - MHgScrollBufferObserver& aObserver, - TInt aBufferSize, - TInt aBufferTreshold, - TInt aInitialPosition, - TInt aTotalCount ) -: CActive( CActive::EPriorityHigh ), - iObserver( aObserver ), - iBufferSize( aBufferSize ), - iBufferTreshold( aBufferTreshold ), - iBufferPosition( aInitialPosition ), - iTotalCount( aTotalCount ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::ConstructL() -// ----------------------------------------------------------------------------- -// -void CHgScrollBufferManager::ConstructL() - { - CActiveScheduler::Add(this); - - iResetOrdered = ETrue; - ResetBuffer(iBufferPosition, iTotalCount); - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::~CHgScrollBufferManager() -// ----------------------------------------------------------------------------- -// -CHgScrollBufferManager::~CHgScrollBufferManager() - { - Cancel(); - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::RunL() -// ----------------------------------------------------------------------------- -// -void CHgScrollBufferManager::RunL() - { - MHgScrollBufferObserver::THgScrollDirection direction = MHgScrollBufferObserver::EHgBufferNoMove; - - if(iResetOrdered) - { - iResetOrdered = EFalse; - direction = MHgScrollBufferObserver::EHgBufferReset; - } - else - { - if(iDiff < 0) - { - iReleaseStart = iBufferPosition; - iRequestStart = iBufferPosition + iBufferSize; - direction = MHgScrollBufferObserver::EHgBufferScrollDown; - } - else if( iDiff > 0) - { - iReleaseStart = iBufferPosition + iBufferSize - iDiff; - iRequestStart = iBufferPosition - iDiff; - direction = MHgScrollBufferObserver::EHgBufferScrollUp; - } - } - - // Release - TInt end = iReleaseStart + iReleaseCount < iTotalCount ? - iReleaseStart + iReleaseCount: iTotalCount; - end--; - if(end >= iReleaseStart ) - { - iObserver.Release(iReleaseStart, end); - if(iOwner) iOwner->Release( iReleaseStart, end ); - } - - iReleaseCount = 0; - - // Request - end = iRequestStart + iRequestCount < iTotalCount ? - iRequestStart + iRequestCount : iTotalCount; - - end--; - if(end >= iRequestStart ) - iObserver.Request(iRequestStart, end, direction); - - iRequestCount = 0; - - // Move Buffer - iBufferPosition -= iDiff; - // Reset Diff - iDiff = 0; - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::DoCancel() -// ----------------------------------------------------------------------------- -// -void CHgScrollBufferManager::DoCancel() - { - // Nothing to do here - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::RunError() -// ----------------------------------------------------------------------------- -// -TInt CHgScrollBufferManager::RunError( TInt /*aError*/ ) - { - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::SetPosition() -// ----------------------------------------------------------------------------- -// -void CHgScrollBufferManager::SetPosition( TInt aIndex ) - { - TBool forceUpdate = EFalse; - aIndex -= iBufferSize / 2; // normalize index to Buffer start - - if(aIndex < 0) - { - aIndex = 0; - forceUpdate = ETrue; - } - else if( aIndex > iTotalCount - iBufferSize ) - { - aIndex = iTotalCount - iBufferSize; - forceUpdate = ETrue; - } - - iDiff = iBufferPosition - aIndex; - - // Too large change reset whole buffer - if( iDiff >= iBufferSize || -iDiff >= iBufferSize || iResetOrdered ) - { - ResetBuffer(aIndex + (iBufferSize/2), iTotalCount); - } - // Move Up - else if( iDiff >= iBufferTreshold ) - { - iRequestCount = iDiff; - iReleaseCount = iDiff; - NotifyObserver(); - } - // Move Down - else if( -iDiff >= iBufferTreshold ) - { - iRequestCount = -iDiff; - iReleaseCount = -iDiff; - NotifyObserver(); - } - // Top or bottom has been reached - else if( forceUpdate && iDiff ) - { - TInt diff = iDiff < 0 ? -iDiff : iDiff; - iRequestCount = diff; - iReleaseCount = diff; - NotifyObserver(); - } - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::SetTotalCount() -// ----------------------------------------------------------------------------- -// -void CHgScrollBufferManager::SetTotalCount( TInt aTotalCount ) - { - iTotalCount = aTotalCount; - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::SetBufferOwner() -// ----------------------------------------------------------------------------- -// -void CHgScrollBufferManager::SetBufferOwner( MHgBufferOwner& aOwner ) - { - iOwner = &aOwner; - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::ResetBuffer() -// ----------------------------------------------------------------------------- -// -void CHgScrollBufferManager::ResetBuffer( TInt aPosition, TInt aTotalCount) - { - if( !iResetOrdered ) - { - // release Old buffer - iReleaseStart = iBufferPosition; - iReleaseCount = iBufferSize; - } - - // set position and count - iBufferPosition = aPosition - (iBufferSize / 2); - iTotalCount = aTotalCount; - iDiff = 0; - - if( iBufferPosition + iBufferSize > iTotalCount - 1 ) - { - iBufferPosition = iTotalCount - iBufferSize; - } - - if(iBufferPosition < 0 ) - { - iBufferPosition = 0; - } - - //request new Buffer - iRequestStart = iBufferPosition; - iRequestCount = iBufferSize; - iResetOrdered = ETrue; - - NotifyObserver(); - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::NotifyObserver() -// ----------------------------------------------------------------------------- -// -void CHgScrollBufferManager::NotifyObserver() - { - if( !IsActive() ) - { - SetActive(); - TRequestStatus* status = &iStatus; - User::RequestComplete(status, KErrNone); - } - } - -// ----------------------------------------------------------------------------- -// CHgScrollBufferManager::ItemChanged() -// ----------------------------------------------------------------------------- -// -void CHgScrollBufferManager::ItemCountChanged( - TInt aIndex, - TBool aRemoved, - TInt aNewTotalCount ) - { - iTotalCount = aNewTotalCount; - if ( aIndex >= iBufferPosition && aIndex < iBufferPosition + iBufferSize ) - { - // Change inside the buffer - MHgScrollBufferObserver::THgScrollDirection direction = MHgScrollBufferObserver::EHgBufferNoMove; - if( aRemoved ) - { - // Release removed item ( Item deleted already from the owner ) - iObserver.Release( aIndex, aIndex ); - if( iTotalCount >= iBufferSize ) - { - // There are more items to keep the buffer filled - if( iBufferPosition + iBufferSize <= iTotalCount ) - { - // Requested from the end - iObserver.Request( iBufferPosition + iBufferSize - 1, - iBufferPosition + iBufferSize - 1, direction ); - } - else if( iBufferPosition > 0 ) - { - // Move buffer and request from the beginning - iBufferPosition--; - iObserver.Request( iBufferPosition, iBufferPosition, direction ); - } - } - } - else - { - if( iTotalCount > iBufferSize ) - { - // One item needs to be released - if( iBufferPosition + iBufferSize < iTotalCount ) - { - // Release from the end of the buffer - iObserver.Release(iBufferPosition + iBufferSize, iBufferPosition + iBufferSize); - if(iOwner) - iOwner->Release(iBufferPosition + iBufferSize, iBufferPosition + iBufferSize); - } - } - // Request added item - iObserver.Request(aIndex, aIndex, direction); - } - } - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgScrollbar.cpp --- a/uifw/ganes/src/HgScrollbar.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,616 +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 "HgScrollbar.h" -#include -#include "HgConstants.h" - -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include -#include -#include -#include - -// ----------------------------------------------------------------------------- -// CHgScrollbar::NewL() -// ----------------------------------------------------------------------------- -// -CHgScrollbar* CHgScrollbar::NewL( MHgScrollbarObserver& aObserver ) - { - CHgScrollbar* self = new (ELeave) CHgScrollbar( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::~CHgScrollbar() -// ----------------------------------------------------------------------------- -// -CHgScrollbar::~CHgScrollbar() - { - delete iScrollbarBg; - delete iScrollbarHandle; - delete iScrollbarHandleBg; - delete iScrollbarBgSelected; - delete iScrollbarHandleSelected; - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::CHgScrollbar() -// ----------------------------------------------------------------------------- -// -CHgScrollbar::CHgScrollbar( MHgScrollbarObserver& aObserver ) - : iObserver( aObserver ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::ConstructL() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::ConstructL() - { - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::SetScrollbarL() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::InitScrollBarL( - TRect aRect, - TSize aTotalSize, - TSize aViewSize, - TBool aLandscapeScrolling ) - { - if( iTotalSize == aTotalSize - && iViewSize == aViewSize - && iLandscapeScrolling == aLandscapeScrolling ) - { - return; - } - - TInt variety = aLandscapeScrolling ? 1 : 0; - - TAknLayoutRect layout; - layout.LayoutRect(aRect, AknLayoutScalable_Avkon::scroll_pane( variety )); - iScrollbarRect = layout.Rect(); - - if((aTotalSize.iHeight <= aViewSize.iHeight && !aLandscapeScrolling) - || (aTotalSize.iWidth <= aViewSize.iWidth && aLandscapeScrolling) ) - { - iTotalSize = aViewSize; - iStatic = ETrue; - } - else - { - iTotalSize = aTotalSize; - iStatic = EFalse; - } - - TBool viewChanged = iViewSize != aViewSize; - - iViewSize = aViewSize; - iLandscapeScrolling = aLandscapeScrolling; - iHandlePosition.SetXY(0,0); - - if(iLandscapeScrolling) - { - iTotalLength = iTotalSize.iWidth - iViewSize.iWidth; - } - else - { - iTotalLength = iTotalSize.iHeight - iViewSize.iHeight; - } - - InitIconsL( viewChanged ); - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::SetViewPosition() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::SetViewPosition( TPoint aPosition ) - { - if(!iStatic) - { - if(iLandscapeScrolling) - { - if (AknLayoutUtils::LayoutMirrored()) - { - iHandlePosition.iX = (iScrollLength) * (1.0 - aPosition.iX / TReal(iTotalLength)); - } - else - { - iHandlePosition.iX = (iScrollLength) * (aPosition.iX / TReal(iTotalLength)); - } - } - else - { - iHandlePosition.iY = (iScrollLength) * (aPosition.iY / TReal(iTotalLength)); - } - CheckHandlePosition( EFalse ); - } - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::HandlePointerEventL() -// ----------------------------------------------------------------------------- -// -TBool CHgScrollbar::HandlePointerEventL( const TPointerEvent& aEvent ) - { - return HandleScrollBarPointerEvent( aEvent ); - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::HandleScrollBarPointerEvent() -// ----------------------------------------------------------------------------- -// -TBool CHgScrollbar::HandleScrollBarPointerEvent( const TPointerEvent& aEvent ) - { - TBool ret = EFalse; - // Quick and dirty hack, remove when logic for fetching the correct drag rect is available - TRect dragArea( iScrollbarRect ); - dragArea.iBr.iX += KScrollAreaOffset; - dragArea.iTl.iX -= KScrollAreaOffset; - - // Start drag - if( aEvent.iType == TPointerEvent::EButton1Down && dragArea.Contains(aEvent.iPosition)) - { - TSize size(iHandleSize); - size.iWidth += KScrollAreaOffset*2; - TRect handleRect( dragArea.iTl + iHandlePosition, size ); - iDragging = handleRect.Contains( aEvent.iPosition ); - iPrevDrag = aEvent.iPosition; - iHandler = ret = ETrue; - CheckHandlePosition( !iStatic ); - } - - // Drag - if( aEvent.iType == TPointerEvent::EDrag && iHandler) - { - if( iDragging ) - { - if(iLandscapeScrolling) - { - iHandlePosition.iX -= iPrevDrag.iX - aEvent.iPosition.iX; - } - else - { - iHandlePosition.iY -= iPrevDrag.iY - aEvent.iPosition.iY; - } - CheckHandlePosition( !iStatic ); - - iPrevDrag = aEvent.iPosition; - } - ret = ETrue; - } - - // End drag - if( aEvent.iType == TPointerEvent::EButton1Up && iHandler) - { - if(!iDragging) - { - TBool below = iLandscapeScrolling ? - aEvent.iPosition.iX > iHandlePosition.iX - : aEvent.iPosition.iY > iHandlePosition.iY; - iHandlePosition += below ? iHandleSize.AsPoint() : -iHandleSize.AsPoint(); - } - CheckHandlePosition( !iStatic ); - iHandler = iDragging = EFalse; - ret = ETrue; - } - - return ret; - } - - -// ----------------------------------------------------------------------------- -// CHgScrollbar::Draw() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::Draw( CWindowGc& aGc ) - { - DrawScrollbar( aGc ); - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::DrawScrollbar() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::DrawScrollbar( CWindowGc& aGc ) - { - if(iScrollbarBg && iScrollbarHandle && iScrollbarHandleBg) - { - if(iHandler && !iStatic) - { - aGc.BitBltMasked(iScrollbarRect.iTl, - iScrollbarHandleBg->Bitmap(), - iScrollbarHandleBg->Bitmap()->SizeInPixels(), - iScrollbarHandleBg->Mask(), - EFalse); - - aGc.BitBltMasked(iScrollbarRect.iTl + iHandlePosition, - iScrollbarHandleSelected->Bitmap(), - iScrollbarHandleSelected->Bitmap()->SizeInPixels(), - iScrollbarHandleSelected->Mask(), - EFalse); - } - else - { - aGc.BitBltMasked(iScrollbarRect.iTl, - iScrollbarBg->Bitmap(), - iScrollbarBg->Bitmap()->SizeInPixels(), - iScrollbarBg->Mask(), - EFalse); - - aGc.BitBltMasked(iScrollbarRect.iTl + iHandlePosition, - iScrollbarHandle->Bitmap(), - iScrollbarHandle->Bitmap()->SizeInPixels(), - iScrollbarHandle->Mask(), - EFalse); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::CheckHandlePosition() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::CheckHandlePosition( TBool aReportChange ) - { - - if(iLandscapeScrolling) - { - iHandlePosition.iY = 0; - if(iHandlePosition.iX < 0 ) - iHandlePosition.iX = 0; - if(iHandlePosition.iX > iScrollLength) - iHandlePosition.iX = iScrollLength; - } - else - { - iHandlePosition.iX = 0; - if(iHandlePosition.iY < 0 ) - iHandlePosition.iY = 0; - if(iHandlePosition.iY > iScrollLength) - iHandlePosition.iY = iScrollLength; - } - if( aReportChange ) - { - TPoint pos (iViewSize.iWidth/2, iViewSize.iHeight/2); - if(iLandscapeScrolling) - { - if (AknLayoutUtils::LayoutMirrored()) - { - pos.iX += (1.0 - iHandlePosition.iX / TReal(iScrollLength)) * (iTotalLength); - } - else - { - pos.iX += (iHandlePosition.iX / TReal(iScrollLength)) * (iTotalLength); - } - } - else - { - pos.iY += (iHandlePosition.iY / TReal(iScrollLength)) * (iTotalLength); - } - - iObserver.ScrollBarPositionChanged( pos ); - } - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::InitIconsL() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::InitIconsL( TBool aInitBgIcons ) - { - if(aInitBgIcons) - { - delete iScrollbarBg; iScrollbarBg = NULL; - delete iScrollbarBgSelected; iScrollbarBgSelected = NULL; - delete iScrollbarHandleBg; iScrollbarHandleBg = NULL; - - CreateIconL(iScrollbarBg, iScrollbarRect.Size()); - CreateIconL(iScrollbarBgSelected, iScrollbarRect.Size()); - CreateIconL(iScrollbarHandleBg, iScrollbarRect.Size()); - } - - TReal xFactor = iScrollbarRect.Width()/TReal(iTotalSize.iWidth); - TReal yFactor = iScrollbarRect.Height()/TReal(iTotalSize.iHeight); - - iHandleSize = TSize ( iViewSize.iWidth * xFactor, iViewSize.iHeight * yFactor ); - - if(iLandscapeScrolling) - { - TInt min = 2*iHandleSize.iHeight; - if( iHandleSize.iWidth < min ) - { - iHandleSize.iWidth = min; - } - iScrollLength = iScrollbarRect.Width() - iHandleSize.iWidth; - } - else - { - TInt min = 2*iHandleSize.iWidth; - if( iHandleSize.iHeight < min ) - { - iHandleSize.iHeight = min; - } - iScrollLength = iScrollbarRect.Height() - iHandleSize.iHeight; - } - - delete iScrollbarHandle; iScrollbarHandle = NULL; - delete iScrollbarHandleSelected; iScrollbarHandleSelected = NULL; - - CreateIconL(iScrollbarHandle, iHandleSize ); - CreateIconL(iScrollbarHandleSelected, iHandleSize ); - - if( iLandscapeScrolling ) - { - if( aInitBgIcons ) - { - DrawIconL( *iScrollbarBg, - KAknsIIDQsnCpScrollHorizontalBgTop, - KAknsIIDQsnCpScrollHorizontalBgMiddle, - KAknsIIDQsnCpScrollHorizontalBgBottom ); - - // TODO, check if this is needed. - // DrawIconL( *iScrollbarHandleBg, - // KAknsIIDQsnCpScrollHorizontalHandleBgTop, - // KAknsIIDQsnCpScrollHorizontalHandleBgMiddle, - // KAknsIIDQsnCpScrollHorizontalHandleBgBottom ); - - DrawIconL( *iScrollbarBgSelected, - KAknsIIDQsnCpScrollHorizontalBgTopPressed, - KAknsIIDQsnCpScrollHorizontalBgMiddlePressed, - KAknsIIDQsnCpScrollHorizontalBgBottomPressed ); - } - - DrawIconL( *iScrollbarHandle, - KAknsIIDQsnCpScrollHorizontalHandleTop, - KAknsIIDQsnCpScrollHorizontalHandleMiddle, - KAknsIIDQsnCpScrollHorizontalHandleBottom); - - DrawIconL( *iScrollbarHandleSelected, - KAknsIIDQsnCpScrollHorizontalHandleTopPressed, - KAknsIIDQsnCpScrollHorizontalHandleMiddlePressed, - KAknsIIDQsnCpScrollHorizontalHandleBottomPressed ); - } - else - { - if(aInitBgIcons) - { - DrawIconL( *iScrollbarBg, - KAknsIIDQsnCpScrollBgTop, - KAknsIIDQsnCpScrollBgMiddle, - KAknsIIDQsnCpScrollBgBottom ); - - DrawIconL( *iScrollbarHandleBg, - KAknsIIDQsnCpScrollHandleBgTop, - KAknsIIDQsnCpScrollHandleBgMiddle, - KAknsIIDQsnCpScrollHandleBgBottom ); - - DrawIconL( *iScrollbarBgSelected, - KAknsIIDQsnCpScrollBgTopPressed, - KAknsIIDQsnCpScrollBgMiddlePressed, - KAknsIIDQsnCpScrollBgBottomPressed ); - } - - DrawIconL( *iScrollbarHandle, - KAknsIIDQsnCpScrollHandleTop, - KAknsIIDQsnCpScrollHandleMiddle, - KAknsIIDQsnCpScrollHandleBottom); - - DrawIconL( *iScrollbarHandleSelected, - KAknsIIDQsnCpScrollHandleTopPressed, - KAknsIIDQsnCpScrollHandleMiddlePressed, - KAknsIIDQsnCpScrollHandleBottomPressed ); - } - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::CreateIconL() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::CreateIconL( CGulIcon*& aIcon, TSize aSize) - { - CFbsBitmap* bmap = new (ELeave) CFbsBitmap; - CleanupStack::PushL( bmap ); - User::LeaveIfError( bmap->Create( aSize , EColor64K)); - - CFbsBitmap* mask = new (ELeave) CFbsBitmap; - CleanupStack::PushL( mask ); - User::LeaveIfError( mask->Create( aSize , EGray256)); - - aIcon = CGulIcon::NewL( bmap, mask ); - - CleanupStack::Pop(2, bmap); - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::DrawIconL() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::DrawIconL( CGulIcon& aIcon, - const TAknsItemID& aTop, - const TAknsItemID& aMiddle, - const TAknsItemID& aBottom ) - { - TRect rect; - TSize iconSize(aIcon.Bitmap()->SizeInPixels()); - TSize tSize; - TPoint point(0,0); - if(iLandscapeScrolling) - { - tSize.SetSize(iconSize.iHeight, iconSize.iHeight); - } - else - { - tSize.SetSize(iconSize.iWidth, iconSize.iWidth); - } - - // TOP - rect.SetRect(point, tSize); - DrawBitmapL( aIcon, aTop, rect ); - - // MIDDLE - TSize middlesize(iconSize); - if(iLandscapeScrolling) - { - point.iX = tSize.iWidth; - middlesize.iWidth -= 2*tSize.iWidth; - } - else - { - point.iY = tSize.iHeight; - middlesize.iHeight -= 2*tSize.iHeight; - } - rect.SetRect(point, middlesize); - DrawBitmapL( aIcon, aMiddle, rect); - - // BOTTOM - point = iconSize.AsPoint()-tSize; - rect.SetRect(point, tSize); - DrawBitmapL( aIcon, aBottom, rect ); - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::DrawBitmapL() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::DrawBitmapL( CGulIcon& aIcon, - const TAknsItemID& aItem, - const TRect& aDestRect ) - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - TRAP_IGNORE( AknsUtils::CreateIconL(AknsUtils::SkinInstance(), aItem, bitmap, mask, KNullDesC, -1, -1); ) - - if(!bitmap) - { - AknsUtils::CreateIconL(AknsUtils::SkinInstance(), aItem, bitmap, KNullDesC, -1); - } - - AknIconUtils::SetSize(bitmap, aDestRect.Size(), EAspectRatioNotPreserved); - ScaleBitmapL(aDestRect, aIcon.Bitmap(), bitmap); - - if(mask) - { - AknIconUtils::SetSize(mask, aDestRect.Size(), EAspectRatioNotPreserved); - ScaleBitmapL(aDestRect, aIcon.Mask(), mask); - } - - delete bitmap; bitmap = NULL; - delete mask; mask = NULL; - } - - -// ----------------------------------------------------------------------------- -// CHgScrollbar::ScaleBitmapL() -// ----------------------------------------------------------------------------- -// -void CHgScrollbar::ScaleBitmapL( const TRect& aDestRect, - CFbsBitmap* aDest, - const CFbsBitmap* aSrc) - { - CFbsBitmapDevice* device = CFbsBitmapDevice::NewL(aDest); - CleanupStack::PushL(device); - - CFbsBitGc* gc = NULL; - User::LeaveIfError(device->CreateContext(gc)); - CleanupStack::PushL(gc); - - gc->DrawBitmap(aDestRect, aSrc); - - CleanupStack::PopAndDestroy(2, device); - } - -// ----------------------------------------------------------------------------- -// CHgScrollbar::ScrollbarBg() -// ----------------------------------------------------------------------------- -// -const CGulIcon* CHgScrollbar::ScrollbarBg() const - { - return iScrollbarBg; - } - - -const CGulIcon* CHgScrollbar::ScrollbarHandleBg() const - { - return iScrollbarHandleBg; - } - -const CGulIcon* CHgScrollbar::ScrollbarHandle() const - { - return iScrollbarHandle; - } - -const CGulIcon* CHgScrollbar::ScrollbarBgSelected() const - { - return iScrollbarBgSelected; - } - -const CGulIcon* CHgScrollbar::ScrollbarHandleSelected() const - { - return iScrollbarHandleSelected; - } - -const TRect& CHgScrollbar::ScrollbarRect() const - { - return iScrollbarRect; - } - -const TPoint& CHgScrollbar::HandlePosition() const - { - return iHandlePosition; - } - -TBool CHgScrollbar::IsStatic() const - { - return iStatic; - } - -TBool CHgScrollbar::IsDragging() const - { - return iDragging; - } - -TBool CHgScrollbar::Handler() const - { - return iHandler; - } - -void CHgScrollbar::Reset() - { - iHandler = iDragging = EFalse; - } - -// End of file diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgScroller.cpp --- a/uifw/ganes/src/HgScroller.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1686 +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 - -#include -#include -#include -#include -#include "HgScrollbar.h" -#include "HgScrollBufferManager.h" -#include "HgConstants.h" -#include "HgPopupDrawer.h" -#include "HgMarquee.h" -#include "HgDrawUtils.h" -#include "HgIndicatorManager.h" -#include "HgTextFind.h" -#include "HgKeyUtils.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -const TInt KIntensity = 50; // 50% - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CHgScroller::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgScroller::ConstructL (const TRect& aRect, RWsSession* aSession ) - { - // Create a window for this application view - CreateWindowL ( ); - EnableDragEvents(); - ClaimPointerGrab(); - - iUpperCaseTitle.CreateL( KMaxSearchLenght ); - iPopupText1.CreateL( KMaxPopupTextLength ); - iPopupText2.CreateL( KMaxPopupTextLength ); - - iScrollbar = CHgScrollbar::NewL(*this); - iPopupDrawer = new (ELeave) THgPopupDrawer(); - - TCallBack callback(CHgScroller::MarqueeCallback, this); - iDrawUtils = CHgDrawUtils::NewL( callback ); - - iIndicatorManager = CHgIndicatorManager::NewL(); - - /* - * TODO: Vasco says it supports qwerty, so the variation cannot be done. - * Commented out for the time being to fix a crash. - // Enable key search only in non-touch or hybrid (touch + qwerty) devices - if( !AknLayoutUtils::PenEnabled() || - CFeatureDiscovery::IsFeatureSupportedL(TUid::Uid(KFeatureIdQwertyInput)) ) - { - iTextFind = CHgTextFind::NewL( *this ); - iKeyUtils = CHgKeyUtils::NewL(*this); - } - */ - - // Init Stuff - if( aSession ) - { - InitScreenL( aRect, *aSession ); - } - else - { - InitScreenL( aRect ); - } - - iHighlightTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - iKeyScrollingTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - - CAknAppUi* appUi = static_cast(iEikonEnv->AppUi()); - if( appUi && appUi->IsSingleClickCompatible() ) - { - iDetector = CAknLongTapDetector::NewL(this); - iActionMenu = CAknItemActionMenu::RegisterCollectionL(*this); - } - - iDrawUtils->EnableMarquee(HasHighlight()); - - InitItemsL(); - - iCoeEnv->AddForegroundObserverL( *this ); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::InputCapabilities() -// ----------------------------------------------------------------------------- -// -TCoeInputCapabilities CHgScroller::InputCapabilities() const - { - TCoeInputCapabilities cap( TCoeInputCapabilities::ENone ); - - if(iTextFind) - { - MCoeFepAwareTextEditor* editor = NULL; - - if( iSelectionMode == ENoSelection - && iFlags & EHgScrollerSearchWithQWERTY ) - editor = iTextFind; - - cap = TCoeInputCapabilities( TCoeInputCapabilities::EAllText, - editor, - NULL ); - - cap.SetObjectProvider( const_cast(this) ); - } - - return cap; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::InitScreenL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::InitScreenL( const TRect& /*aRect*/, RWsSession& /*aSession*/ ) - { - // DSA not supported anymore. - User::Leave( KErrNotSupported ); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::InitScreenL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::InitScreenL( const TRect& aRect ) - { - // Set the windows size - SetRect ( aRect ); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::RefreshScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::RefreshScreen( TInt aIndex ) - { - if( IsDisplayed( aIndex ) ) - DrawDeferred(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::RefreshScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgScroller::FirstIndexOnScreen() - { - return CurrentIndex(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::RefreshScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgScroller::ItemsOnScreen() - { - return iItemsOnScreen; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::RefreshScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgScroller::SelectedIndex() - { - return iSelectedIndex; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::RefreshScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::SetSelectedIndex( TInt aIndex ) - { - if( aIndex >= 0 && aIndex < iItems.Count() ) - { - iSelectedIndex = aIndex; - // Move view position so that it is fully visible. - FitSelectionToView(); - SelectionChanged(); - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::Mark() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::Mark( TInt aIndex ) - { - if( aIndex >= 0 && aIndex < iItems.Count() ) - { - if( !(iItems[aIndex]->Flags() & CHgItem::EHgItemFlagMarked) ) - { - iItems[aIndex]->SetFlags( CHgItem::EHgItemFlagMarked ); - if( iMarkingObserver ) - { - TRAP_IGNORE( iMarkingObserver->HandleMarkingL( aIndex, ETrue ) ); - } - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::UnMark() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::UnMark( TInt aIndex ) - { - if( aIndex >= 0 && aIndex < iItems.Count() ) - { - if( iItems[aIndex]->Flags() & CHgItem::EHgItemFlagMarked ) - { - iItems[aIndex]->ClearFlags( CHgItem::EHgItemFlagMarked ); - if( iMarkingObserver ) - { - TRAP_IGNORE( iMarkingObserver->HandleMarkingL( aIndex, EFalse ) ); - } - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::MarkAll() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::MarkAll() - { - for(TInt i = 0; i < iItems.Count(); ++i) - { - iItems[i]->SetFlags( CHgItem::EHgItemFlagMarked ); - } - - DrawDeferred(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::UnMarkAll() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::UnMarkAll() - { - for(TInt i = 0; i < iItems.Count(); ++i) - { - iItems[i]->ClearFlags(CHgItem::EHgItemFlagMarked); - } - - DrawDeferred(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::GetMarkedItemsL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::GetMarkedItemsL( RArray& aIndexes ) - { - for(TInt i = 0; i < iItems.Count(); ++i) - { - if(iItems[i]->Flags() & CHgItem::EHgItemFlagMarked ) - { - aIndexes.AppendL( i ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::EnableScrollBufferL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::EnableScrollBufferL( - MHgScrollBufferObserver& aObserver, - TInt aBufferSize, - TInt aBufferTreshold ) - { - delete iManager; iManager = NULL; - - iManager = CHgScrollBufferManager::NewL( - aObserver, - aBufferSize, - aBufferTreshold, - CurrentIndex(), - iItemCount); - - iManager->SetBufferOwner( *this ); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::EnableNaviStripL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::SetScrollBarTypeL( THgScrollBarType aType ) - { - iScrollBarType = aType; - DrawDeferred(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::SetSelectionObserver() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::SetSelectionObserver( MHgSelectionObserver& aObserver ) - { - iSelectionObserver = &aObserver; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::SetMarkingObserver() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::SetMarkingObserver( MHgMarkingObserver& aObserver ) - { - iMarkingObserver = &aObserver; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::CHgScroller() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgScroller::CHgScroller( - TInt aItemCount, - CGulIcon* aDefaultIcon ) - : iDefaultIcon( aDefaultIcon ), - iItemCount(aItemCount), - iCurrentRow(-1), - iSelectedIndex(KErrNotFound), - iScrollBarType( EHgScrollerScrollBar ), - iFirstTime(ETrue) - { - // No implementation required - } - -// ----------------------------------------------------------------------------- -// CHgScroller::~CHgScroller() -// Destructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgScroller::~CHgScroller ( ) - { - iCoeEnv->RemoveForegroundObserver( *this ); - - iItems.ResetAndDestroy(); - - delete iManager; - delete iPhysics; - delete iScrollbar; - delete iEmptyText; - delete iDefaultIcon; - delete iPopupDrawer; - delete iDrawUtils; - delete iHighlightTimer; - delete iIndicatorManager; - delete iKeyUtils; - delete iTextFind; - delete iKeyScrollingTimer; - delete iDetector; - - if(iActionMenu) - iActionMenu->RemoveCollection(*this); - - iUpperCaseTitle.Close(); - iPopupText1.Close(); - iPopupText2.Close(); - - } - -// ----------------------------------------------------------------------------- -// CHgScroller::InitPhysicsL() -// ----------------------------------------------------------------------------- -// -void CHgScroller::InitPhysicsL() - { - if(!iPhysics) - { - iPhysics = CAknPhysics::NewL(*this, this); - } - - iPhysics->InitPhysicsL( TotalSize(), - TSize(iWidth, iHeight), - iLandscapeScrolling); - } - -// ----------------------------------------------------------------------------- -// CHgGrid::Draw() -// Draws the display. -// ----------------------------------------------------------------------------- -// -void CHgScroller::Draw ( const TRect& aRect ) const - { - CWindowGc& gc = SystemGc(); - - // Flush screen buffer - InitDrawBuffer(); - - DoDraw( aRect ); - - if( iScrollbar && iItemCount ) - { - iScrollbar->Draw( gc ); - } - - if( iPopupDrawer ) - { - if(iPopupText2.Length() > 0) - { - iPopupDrawer->Draw( gc, - iPopupText1, - iPopupText2 - ); - } - else if( iPopupText1.Length( ) > 0 ) - { - if( iScrollBarType == EHgScrollerLetterStrip - || iScrollBarType == EHgScrollerLetterStripLite ) - { - iPopupDrawer->DrawNaviChar( gc, iPopupText1 ); - } - else - { - iPopupDrawer->Draw( gc, iPopupText1 ); - } - } - else if( iTextFind && iTextFind->Text().Length() > 0 ) - { - iPopupDrawer->Draw( gc, iTextFind->Text() ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::InitDrawBuffer() -// ----------------------------------------------------------------------------- -// -void CHgScroller::InitDrawBuffer() const - { - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - AknsDrawUtils::DrawBackground( skin, cc, this, SystemGc(), - TPoint(0,0), Rect(), KAknsDrawParamDefault ); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::SizeChanged() -// Called by framework when the view size is changed. -// ----------------------------------------------------------------------------- -// -void CHgScroller::SizeChanged ( ) - { - iWidth = Rect().Width(); - iHeight = Rect().Height(); - - HandleItemCountChanged(); - - if( iPopupDrawer ) - { - iPopupDrawer->Init( Rect(), - &ScreenFont( TCoeFont( KFocusTextFontSize, TCoeFont::EPlain ) ) ); - } - - if(iFirstTime) - { - iViewPosition = TPoint(iWidth/2, iHeight/2); - iFirstTime = EFalse; - } - - HandleViewPositionChanged(); - - TRAP_IGNORE( InitGraphicsL(); ) - DrawDeferred ( ); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleItemCountChaged() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandleItemCountChanged() - { - HandleSizeChanged(); - - if( iSelectedIndex >= iItemCount ) - { - iSelectedIndex = iItemCount - 1; - SelectionChanged(); - } - - TRAP_IGNORE ( - InitScrollbarL(); - InitPhysicsL(); - ) - } - -// ----------------------------------------------------------------------------- -// CHgScroller::InitScrollbarL() -// ----------------------------------------------------------------------------- -// -void CHgScroller::InitScrollbarL() - { - if( iScrollbar && iItemCount ) - { - iScrollbar->InitScrollBarL( Rect(), - TotalSize(), - TSize(iWidth, iHeight), - iLandscapeScrolling); - - iScrollbar->SetViewPosition( iViewPosition - TPoint(iWidth/2, iHeight/2)); - } - } -// ----------------------------------------------------------------------------- -// CHgScroller::HandlePointerEventL() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandlePointerEventL( const TPointerEvent& aEvent ) - { - if( !HandleScrollbarEventL( aEvent ) && iItemCount ) - { - iShowHighlight = EFalse; - - // Start drag - if( aEvent.iType == TPointerEvent::EButton1Down ) - { - iPointerDown = ETrue; - HandleDownEventL( aEvent ); - - if( iDetector && !HasHighlight() && iActionMenu->InitMenuL() ) - iDetector->PointerEventL( aEvent ); - } - // Drag - else if( aEvent.iType == TPointerEvent::EDrag && iPointerDown ) - { - HandleDragEventL( aEvent ); - - if( iPanning && iDetector && !HasHighlight() ) - iDetector->CancelAnimationL(); - } - // End drag - else if( aEvent.iType == TPointerEvent::EButton1Up && iPointerDown ) - { - if( iDetector && !HasHighlight() ) - iDetector->PointerEventL( aEvent ); - - HandleUpEventL( aEvent ); - iPointerDown = EFalse; - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleScrollbarEventL() -// ----------------------------------------------------------------------------- -// -TBool CHgScroller::HandleScrollbarEventL( const TPointerEvent& aEvent ) - { - TBool sbHandles = EFalse; - if( iScrollbar ) - { - sbHandles = iScrollbar->HandlePointerEventL( aEvent ); - if ( sbHandles && !iScrollbar->IsStatic() ) - { - MTouchFeedback* feedback = MTouchFeedback::Instance(); - // Start drag - if( aEvent.iType == TPointerEvent::EButton1Down ) - { - if ( feedback ) - { - feedback->InstantFeedback( this, ETouchFeedbackBasicSlider, aEvent ); - } - } - // Drag - else if( aEvent.iType == TPointerEvent::EDrag - && iScrollbar->IsDragging() ) - { - // Smooth continuous tactile feedback is produced - // during thumb dragging. The tactile feedback API - // filters out possible re-startings of the effect. - if ( feedback ) - { - TTimeIntervalMicroSeconds32 timeout( 300000 ); - feedback->StartFeedback( this, - ETouchContinuousSlider, - &aEvent, - KIntensity, // intensity 50% - timeout ); - } - } - // End drag - else if( aEvent.iType == TPointerEvent::EButton1Up ) - { - // Stop the continuous tactile feedback that may be playing - // at the time due to possible previous thumb dragging. - if ( feedback ) - { - feedback->StopFeedback( this ); - TTouchFeedbackType type = ETouchFeedbackVibra; - feedback->InstantFeedback( this, ETouchFeedbackBasicSlider, type, aEvent ); - } - iPopupText1.Zero(); - iPopupText2.Zero(); - DrawDeferred(); - } - } - } - return sbHandles; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleDownEventL() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandleDownEventL( const TPointerEvent& aEvent ) - { - if( !HasHighlight() - && (iPhysics->OngoingPhysicsAction() == CAknPhysics::EAknPhysicsActionFlicking) ) - { - iPanning = ETrue; - if(iDetector) - iDetector->CancelAnimationL(); - } - else - { - iPanning = EFalse; - } - - iPhysics->StopPhysics(); - iPhysics->ResetFriction(); - - iStart = aEvent.iPosition; - iPrev = iStart; - iStartTime.HomeTime(); - - if(iLandscapeScrolling) - iViewPosition.iY = iHeight / 2; - else - iViewPosition.iX = iWidth / 2; - - iFocusedIndex = KErrNotFound; - iSelectionToFocusedItem = EFalse; - iDrawUtils->EnableMarquee(HasHighlight()); - if(HasHighlight()) - { - LaunchHighlightTimer(); - } - else if( !iPanning ) - { - SetHighlightL(); - } - MTouchFeedback* feedback = MTouchFeedback::Instance(); - if ( feedback ) - { - feedback->InstantFeedback( this, ETouchFeedbackBasicItem, aEvent ); - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleDragEventL() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandleDragEventL( const TPointerEvent& aEvent ) - { - if(!iPanning) - { - TInt delta = 0; - if(iLandscapeScrolling) - { - delta = iPrev.iX - aEvent.iPosition.iX; - } - else - { - delta = iPrev.iY - aEvent.iPosition.iY; - } - - delta = delta < 0 ? -delta : delta; - iPanning = delta >= iPhysics->DragThreshold(); - } - - if(iPanning) - { - TPoint delta = iPrev - aEvent.iPosition; - if(iLandscapeScrolling && AknLayoutUtils::LayoutMirrored()) - delta = -delta; - iPhysics->RegisterPanningPosition( delta ); - iPrev = aEvent.iPosition; - iHighlightTimer->Cancel(); - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleUpEventL() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandleUpEventL( const TPointerEvent& aEvent ) - { - MTouchFeedback* feedback = MTouchFeedback::Instance(); - TTouchFeedbackType type = ETouchFeedbackVibra; - if( iPanning ) - { - // enable physics - TPoint drag = iStart - aEvent.iPosition; - if(iLandscapeScrolling && AknLayoutUtils::LayoutMirrored()) - drag = -drag; - iPhysics->StartPhysics(drag, iStartTime); - if ( feedback ) - { - feedback->InstantFeedback( this, ETouchFeedbackItemScroll, type, aEvent ); - } - } - else - { - HandleSelectionL(); - if ( feedback ) - { - feedback->InstantFeedback( this, ETouchFeedbackBasicItem, type, aEvent ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleSelectionL() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandleSelectionL() - { - TInt index = GetSelected(iStart); - if(index != KErrNotFound) - { - if( iFocusedIndex == KErrNotFound ) - { - // Highlight timer hasn't triggered so lets set the highlight. - // this is not usually the case since interval is 50ms but just to be sure. - SetHighlightL(); - } - - if( iFlags & EHgScrollerSelectionMode || iSelectionMode != ENoSelection ) - // Marking mode or shift key pressed ( or hash ) - { - if( iItems[iSelectedIndex]->Flags() & CHgItem::EHgItemFlagMarked ) - { - UnMark( iSelectedIndex ); - } - else - { - Mark( iSelectedIndex ); - } - DrawDeferred(); - } - else // Selection - { - if( iSelectionToFocusedItem || !HasHighlight() ) - { - if(iSelectionObserver) - iSelectionObserver->HandleOpenL(iSelectedIndex); - } - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::OfferKeyEventL() -// ----------------------------------------------------------------------------- -// -TKeyResponse CHgScroller::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) - { - if( iKeyUtils - && !(iFlags & EHgScrollerKeyMarkingDisabled) - && iKeyUtils->OfferKeyEventL( aKeyEvent, aType ) == EKeyWasConsumed ) - return EKeyWasConsumed; - - switch( aType ) - { - case EEventKeyDown: - KeyEventDown(); - break; - case EEventKey: - return HandleKeyEvent( aKeyEvent ); - case EEventKeyUp: - KeyEventUp(); - default: - break; - } - - // Let CCoeControl handle other cases. - return CCoeControl::OfferKeyEventL( aKeyEvent, aType ); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::KeyEventDown() -// ----------------------------------------------------------------------------- -// -void CHgScroller::KeyEventDown() - { - iKeyRepeats = 0; - iKeyScrollingState = ENoKeyScrolling; - - iPointerDown = EFalse; - iPanning = EFalse; - iShowHighlight = ETrue; - iDrawUtils->EnableMarquee(HasHighlight()); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::KeyEventUp() -// ----------------------------------------------------------------------------- -// -void CHgScroller::KeyEventUp() - { - if( iKeyScrollingState != ENoKeyScrolling ) - { - // Key has been released so stop the key scrolling. - StopKeyScrolling(); - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::SetItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::SetItem(CHgItem* aItem, TInt aIndex) - { - if( aItem && aIndex >= 0 && aIndex < iItems.Count() ) - { - delete iItems[aIndex]; - iItems[aIndex] = aItem; - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::AddItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::AddItem(CHgItem* aItem) - { - if( aItem ) - { - iItems.Append(aItem); - iItemCount++; - HandleItemCountChanged(); - if( iManager ) - { - iManager->ItemCountChanged( iItemCount-1, EFalse, iItemCount ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::InsertItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::InsertItem(CHgItem* aItem, TInt aIndex) - { - if( aItem && aIndex >= 0 ) - { - if(aIndex < iItems.Count()) - { - iItems.Insert(aItem, aIndex); - } - else - { - iItems.Append(aItem); - } - iItemCount++; - HandleItemCountChanged(); - - if( iManager ) - { - iManager->ItemCountChanged( aIndex, EFalse, iItemCount ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::RemoveItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::RemoveItem(TInt aIndex) - { - if( aIndex >= 0 && aIndex < iItems.Count() ) - { - delete iItems[aIndex]; iItems[aIndex] = NULL; - iItems.Remove(aIndex); - iItemCount--; - HandleItemCountChanged(); - - if( iManager ) - { - iManager->ItemCountChanged( aIndex, ETrue, iItemCount ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::ResizeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::ResizeL( TInt aItemCount ) - { - // Add More - if( iItems.Count() < aItemCount ) - { - while( iItems.Count() < aItemCount ) - { - iItems.AppendL( CHgItem::NewL() ); - } - } - // remove from the end - else if( iItems.Count() > aItemCount ) - { - while( iItems.Count() > aItemCount ) - { - delete iItems[iItems.Count() - 1]; - iItems.Remove( iItems.Count() - 1 ); - } - } - else - { - return; // no change needed - } - - iItemCount = aItemCount; - - if( iManager ) - { - iManager->ResetBuffer( iSelectedIndex, iItemCount ); - } - - HandleItemCountChanged(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::ItemL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgItem& CHgScroller::ItemL(TInt aIndex) - { - if( aIndex < 0 || aIndex >= iItems.Count() ) - { - User::Leave( KErrArgument ); - } - - return *iItems[aIndex]; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::ViewPositionChanged() -// ----------------------------------------------------------------------------- -// -void CHgScroller::ViewPositionChanged( const TPoint& aNewPosition, - TBool aDrawNow, - TUint /*aFlags*/ ) - { - iViewPosition = aNewPosition; - HandleViewPositionChanged(); - if( aDrawNow ) - DrawNow(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::ScrollBarPositionChanged() -// ----------------------------------------------------------------------------- -// -void CHgScroller::ScrollBarPositionChanged( const TPoint& aNewPosition ) - { - iViewPosition = aNewPosition; - iPhysics->StopPhysics(); - - if( iScrollBarType == EHgScrollerTimeStrip ) - { - // Show first item's time. - TInt selectedItem = CurrentIndex(); - if( selectedItem >= 0 && selectedItem < iItems.Count() ) - { - TRAP_IGNORE( - iItems[selectedItem]->Time().FormatL( iPopupText1, KGanesMonthString ); - iItems[selectedItem]->Time().FormatL( iPopupText2, KGanesYearString ); - ) - // To display year correctly in arabic. - AknTextUtils::LanguageSpecificNumberConversion( iPopupText2 ); - } - } - else if( iScrollBarType == EHgScrollerLetterStrip - || iScrollBarType == EHgScrollerLetterStripLite ) - { - TInt selectedItem = CurrentIndex(); - if( selectedItem >= 0 && selectedItem < iItems.Count() ) - { - if(iItems[selectedItem]->Title().Length()) - { - iPopupText1.Zero(); - iPopupText1.Append( iItems[selectedItem]->Title()[0] ); - } - } - } - HandleViewPositionChanged( EFalse ); - DrawNow(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleNaviStripChar() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandleNaviStripChar( const TChar& /*aChar*/ ) - { - // Feature not used anymore - } - -// ----------------------------------------------------------------------------- -// CHgScroller::PhysicEmulationEnded() -// ----------------------------------------------------------------------------- -// -void CHgScroller::PhysicEmulationEnded() - { - // Nothing to do. - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleViewPositionChanged() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandleViewPositionChanged(TBool aUpdateScrollbar) - { - TInt newRow = iLandscapeScrolling ? - (iViewPosition.iX-(iWidth/2))/((iRowHeight)): - (iViewPosition.iY-(iHeight/2))/(iRowHeight); - - if(iScrollbar && aUpdateScrollbar) - iScrollbar->SetViewPosition( iViewPosition - TPoint(iWidth/2, iHeight/2)); - - if(newRow != iCurrentRow) - { - iCurrentRow = newRow; - - if(iManager) - { - iManager->SetPosition( CurrentIndex() ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleViewPositionChanged() -// ----------------------------------------------------------------------------- -// -TPoint CHgScroller::ViewPosition() const - { - return iViewPosition; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleKeyEvent() -// ----------------------------------------------------------------------------- -// -TKeyResponse CHgScroller::HandleKeyEvent(const TKeyEvent& aKeyEvent) - { - iKeyRepeats++; - TInt prevSelected = iSelectedIndex; - - TKeyScrollingState possibleKeyScrollingState = ENoKeyScrolling; - - switch( aKeyEvent.iCode ) - { - case EKeyUpArrow: - if( !iLandscapeScrolling ) - possibleKeyScrollingState = EKeyScrollingUp; - break; - case EKeyDownArrow: - if( !iLandscapeScrolling ) - possibleKeyScrollingState = EKeyScrollingDown; - break; - case EKeyLeftArrow: - if( iLandscapeScrolling ) - possibleKeyScrollingState = EKeyScrollingLeft; - break; - case EKeyRightArrow: - if( iLandscapeScrolling ) - possibleKeyScrollingState = EKeyScrollingRight; - break; - case EKeyEnter: - { - if( iSelectedIndex != KErrNotFound && iSelectionObserver ) - { - TRAP_IGNORE( iSelectionObserver->HandleOpenL( iSelectedIndex ); ) - return EKeyWasConsumed; - } - return EKeyWasNotConsumed; - } - default: - break; - } - - if( possibleKeyScrollingState != ENoKeyScrolling - && iKeyRepeats > KPhysLaunchKeyCount - && iSelectionMode == ENoSelection ) - { - if( !iKeyScrollingTimer->IsActive() ) - { - iKeyScrollingState = possibleKeyScrollingState; - iKeyScrollingTimer->Start( - TTimeIntervalMicroSeconds32( 0 ), - TTimeIntervalMicroSeconds32( KKeyScrollingUpdateInterval ), - TCallBack( KeyScrollingTimerCallback, this ) ); - } - } - - TBool handled = DoHandleKeyEvent(aKeyEvent); - - if( iSelectedIndex != prevSelected && iSelectionObserver ) - { - iDrawUtils->ResetMarquee(); - TRAP_IGNORE( iSelectionObserver->HandleSelectL(iSelectedIndex); ) - } - - if( !handled ) - iKeyRepeats--; - - return handled ? EKeyWasConsumed : EKeyWasNotConsumed; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::Release() -// ----------------------------------------------------------------------------- -// -void CHgScroller::Release(TInt aReleaseStart, TInt aReleaseEnd) - { - for(; aReleaseStart <= aReleaseEnd; ++aReleaseStart) - { - if( aReleaseStart >= 0 && aReleaseStart < iItems.Count()) - { - iItems[aReleaseStart]->SetIcon(NULL, iItems[aReleaseStart]->Flags()); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::Reset() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::Reset() - { - if(iItemCount) - { - iItems.ResetAndDestroy(); - iItemCount = 0; - iSelectedIndex = -1; - - if( iManager ) - { - iManager->ResetBuffer( iSelectedIndex, iItemCount ); - } - - HandleItemCountChanged(); - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::SetFlags() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::SetFlags(TInt aFlags) - { - iFlags |= aFlags; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::ClearFlags() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::ClearFlags(TInt aFlags) - { - iFlags &= ~aFlags; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::Flags() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgScroller::Flags() - { - return iFlags; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::SetEmptyTextL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::SetEmptyTextL( const TDesC& aEmptyText ) - { - delete iEmptyText; - iEmptyText = 0; - iEmptyText = aEmptyText.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::ItemCount() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgScroller::ItemCount() const - { - return iItems.Count(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HightlightItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C TBool CHgScroller::HightlightItem( const TDesC& aHighlightText ) - { - TInt searchStartIndex = aHighlightText.Length() == 1 || - iSelectedIndex == KErrNotFound ? iSelectedIndex + 1 : iSelectedIndex; - - // From selected to end - for(TInt i = searchStartIndex; i < iItems.Count(); ++i) - { - if(iItems[i]->Title().Length() > 0 ) - { - iUpperCaseTitle.Copy( iItems[i]->Title().Left( aHighlightText.Length() ) ); - iUpperCaseTitle.UpperCase(); - TInt result = iUpperCaseTitle.CompareC( aHighlightText ); - - if(result == 0) - { - iSelectedIndex = i; - FitSelectionToView(); - DrawDeferred(); - return ETrue; - } - } - } - - // From beginning to selected - 1 - for(TInt i = 0; i < iSelectedIndex; ++i) - { - if(iItems[i]->Title().Length() > 0 ) - { - iUpperCaseTitle.Copy( iItems[i]->Title().Left( aHighlightText.Length() ) ); - iUpperCaseTitle.UpperCase(); - TInt result = iUpperCaseTitle.CompareC( aHighlightText ); - - if(result == 0) - { - iSelectedIndex = i; - FitSelectionToView(); - DrawDeferred(); - return ETrue; - } - else if( result > 0) - { - break; - } - } - } - - return EFalse; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::SetDefaultIconL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::SetDefaultIconL( CGulIcon* aDefaultIcon ) - { - if( aDefaultIcon ) - { - delete iDefaultIcon; - iDefaultIcon = aDefaultIcon; - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::DisableScrollBuffer() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScroller::DisableScrollBuffer() - { - delete iManager; - iManager = NULL; - } - -// ----------------------------------------------------------------------------- -// CHgScroller::InitGraphicsL() -// ----------------------------------------------------------------------------- -// -void CHgScroller::InitGraphicsL() - { - // Non-Skinned icons - // Default icon - if(iIndicatorManager) - { - iIndicatorManager->InitIconL(iDefaultIcon, - EMbmGanesQgn_prop_checkbox_on, EMbmGanesQgn_prop_checkbox_on_mask, iImageSize); - - iIndicatorManager->InitIndicatorsL(iIndicatorSize); - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::SelectionChanged() -// ----------------------------------------------------------------------------- -// -void CHgScroller::SelectionChanged() - { - } - -// ----------------------------------------------------------------------------- -// CHgScroller::FitRowToView() -// ----------------------------------------------------------------------------- -// -void CHgScroller::FitRowToView( TInt aRow ) - { - if( iLandscapeScrolling ) - { - if ( aRow*iRowHeight < iViewPosition.iX-(iWidth/2) ) - { - // Item is at top but not fully visible - iViewPosition.iX -= (iViewPosition.iX-(iWidth/2) - ((aRow)*iRowHeight)); - HandleViewPositionChanged(); - } - else if ( (aRow+1)*iRowHeight > iViewPosition.iX+(iWidth/2) ) - { - // Item is at bottom but not fully visible - iViewPosition.iX += ((aRow+1)*iRowHeight - (iViewPosition.iX+(iWidth/2))); - HandleViewPositionChanged(); - } - } - else - { - if ( aRow*iRowHeight < iViewPosition.iY-(iHeight/2) ) - { - // Item is at top but not fully visible - iViewPosition.iY -= (iViewPosition.iY-(iHeight/2) - ((aRow)*iRowHeight)); - HandleViewPositionChanged(); - } - else if ( (aRow+1)*iRowHeight > iViewPosition.iY+(iHeight/2) ) - { - // Item is at bottom but not fully visible - iViewPosition.iY += ((aRow+1)*iRowHeight - (iViewPosition.iY+(iHeight/2))); - HandleViewPositionChanged(); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::MarqueeCallback() -// ----------------------------------------------------------------------------- -// -TInt CHgScroller::MarqueeCallback( TAny* aSelf ) - { - CHgScroller* self = static_cast(aSelf); - if( self->IsDisplayed( self->iSelectedIndex ) ) - { - self->DrawDeferred(); - return ETrue; - } - else - { - return EFalse; - } - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleGainingForeground() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandleGainingForeground() - { - iSelectionMode = ENoSelection; - TRect rect( PositionRelativeToScreen(), Size() ); - TRAP_IGNORE( InitScreenL( rect ); ) - iScrollbar->Reset(); - } - -// ----------------------------------------------------------------------------- -// CHgScroller::HandleLosingForeground() -// ----------------------------------------------------------------------------- -// -void CHgScroller::HandleLosingForeground() - { - iPopupText1.Zero(); - iPopupText2.Zero(); - } - -// --------------------------------------------------------------------------- -// CHgScroller::LaunchHighlightTimer() -// --------------------------------------------------------------------------- -// -void CHgScroller::LaunchHighlightTimer() - { - if ( !iHighlightTimer ) - { - return; - } - - TInt highlightTimeout( 0 ); - if ( iPhysics ) - { - highlightTimeout = iPhysics->HighlightTimeout() * 1000; - } - if ( highlightTimeout == 0 ) - { - highlightTimeout = KDefaultHighlightTimeout; - } - - iHighlightTimer->Cancel(); - iHighlightTimer->Start( - TTimeIntervalMicroSeconds32( highlightTimeout ), - TTimeIntervalMicroSeconds32( highlightTimeout ), - TCallBack( HighlightTimerCallback, this ) ); - } - - -// --------------------------------------------------------------------------- -// CHgScroller::HighlightTimerCallback() -// --------------------------------------------------------------------------- -// -TInt CHgScroller::HighlightTimerCallback( TAny* aPtr ) - { - CHgScroller* scroller = - static_cast( aPtr ); - - TInt err = KErrNotFound; - - if ( scroller ) - { - TRAP( err, scroller->SetHighlightL() ); - } - - return err; - } - -// --------------------------------------------------------------------------- -// CHgScroller::SetHighlightL() -// --------------------------------------------------------------------------- -// -void CHgScroller::SetHighlightL() - { - iHighlightTimer->Cancel(); - - TInt index = GetSelected(iStart); - if(index != KErrNotFound && iPointerDown ) - { - iSelectionToFocusedItem = index == iSelectedIndex; - iSelectedIndex = index; - iFocusedIndex = index; - if( !iSelectionToFocusedItem ) // Selection has changed - { - if( iSelectionObserver ) - iSelectionObserver->HandleSelectL(iSelectedIndex); - - FitSelectionToView(); - SelectionChanged(); - iDrawUtils->ResetMarquee(); - } - DrawDeferred(); - } - } - -// --------------------------------------------------------------------------- -// CHgScroller::SetSelectionMode() -// --------------------------------------------------------------------------- -// -void CHgScroller::SetSelectionMode( TSelectionMode aMode ) - { - iSelectionMode = aMode; - if( iSelectionMode == ESelectionPossible - || iSelectionMode == ENoSelection ) - { - iCoeEnv->InputCapabilitiesChanged(); - } - } - -// --------------------------------------------------------------------------- -// CHgScroller::SelectionMode() -// --------------------------------------------------------------------------- -// -CHgScroller::TSelectionMode CHgScroller::SelectionMode() const - { - return iSelectionMode; - } - -// --------------------------------------------------------------------------- -// CHgScroller::KeyScrollingTimerCallback() -// --------------------------------------------------------------------------- -// -TInt CHgScroller::KeyScrollingTimerCallback( TAny* aPtr ) - { - CHgScroller* scroller = - static_cast( aPtr ); - - TInt err = KErrNotFound; - - if ( scroller ) - { - scroller->DoKeyScrolling(); - err = KErrNone; - } - - return err; - } - -// --------------------------------------------------------------------------- -// CHgScroller::DoKeyScrolling() -// --------------------------------------------------------------------------- -// -void CHgScroller::DoKeyScrolling() - { - TKeyEvent keyevent; - - switch( iKeyScrollingState ) - { - case EKeyScrollingUp: - { - keyevent.iCode = EKeyUpArrow; - HandleKeyEvent( keyevent ); - break; - } - case EKeyScrollingDown: - { - keyevent.iCode = EKeyDownArrow; - HandleKeyEvent( keyevent ); - break; - } - case EKeyScrollingLeft: - { - keyevent.iCode = EKeyLeftArrow; - HandleKeyEvent( keyevent ); - break; - } - case EKeyScrollingRight: - { - keyevent.iCode = EKeyRightArrow; - HandleKeyEvent( keyevent ); - break; - } - case ENoKeyScrolling: - default: - StopKeyScrolling(); - break; - } - - DrawNow(); - } - -// --------------------------------------------------------------------------- -// CHgScroller::StopKeyScrolling() -// --------------------------------------------------------------------------- -// -void CHgScroller::StopKeyScrolling() - { - iKeyScrollingTimer->Cancel(); - iKeyScrollingState = ENoKeyScrolling; - } - -// --------------------------------------------------------------------------- -// CHgScroller::FocusChanged() -// --------------------------------------------------------------------------- -// -void CHgScroller::FocusChanged(TDrawNow aDrawNow) - { - if( iKeyUtils ) - { - if( !(iFlags & EHgScrollerKeyMarkingDisabled) ) - { - if(IsFocused()) - { - iKeyUtils->HandleGainingFocus(); - } - else - { - iKeyUtils->HandleLosingFocus(); - } - } - else - { - iKeyUtils->HandleLosingFocus(); - } - } - - CCoeControl::FocusChanged( aDrawNow ); - } - -// --------------------------------------------------------------------------- -// CHgScroller::HandleResourceChange() -// --------------------------------------------------------------------------- -// -void CHgScroller::HandleResourceChange( TInt aType ) - { - TRAP_IGNORE( - // When skin changes the indicator icons must be reloaded. - if ( aType == KAknsMessageSkinChange ) - { - delete iIndicatorManager; iIndicatorManager = NULL; - iIndicatorManager = CHgIndicatorManager::NewL(); - InitGraphicsL(); - } - ) - } - -// --------------------------------------------------------------------------- -// CHgScroller::HandleLongTapEventL() -// --------------------------------------------------------------------------- -// -void CHgScroller::HandleLongTapEventL( const TPoint& /*aPenEventLocation*/, - const TPoint& aPenEventScreenLocation) - { - if( iActionMenu ) - { - iPointerDown = EFalse; - iActionMenu->ShowMenuL(aPenEventScreenLocation); - } - } - -// --------------------------------------------------------------------------- -// CHgScroller::CollectionState() -// --------------------------------------------------------------------------- -// -TUint CHgScroller::CollectionState() const - { - TUint ret = 0; - - if(IsFocused()) ret |= MAknCollection::EStateCollectionVisible; - - if(HasHighlight()) ret |= MAknCollection::EStateHighlightVisible; - - if( iFlags & EHgScrollerSelectionMode ) ret |= MAknCollection::EStateMultipleSelection; - - return ret; - } - -// --------------------------------------------------------------------------- -// CHgScroller::CollectionState() -// --------------------------------------------------------------------------- -// -void CHgScroller::ItemActionMenuClosed() - { - DrawDeferred(); - } - -// --------------------------------------------------------------------------- -// CHgScroller::CollectionState() -// --------------------------------------------------------------------------- -// -TInt CHgScroller::CollectionExtension( TUint /*aExtensionId*/, TAny*& /*a0*/, TAny* /*a1*/ ) - { - return KErrNone; - } - -// --------------------------------------------------------------------------- -// CHgScroller::HasHighlight() -// --------------------------------------------------------------------------- -// -TBool CHgScroller::HasHighlight() const - { - return (iActionMenu == NULL) || iShowHighlight || (iFlags & EHgScrollerForceDoubleClick); - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgScrollerWithTitle.cpp --- a/uifw/ganes/src/HgScrollerWithTitle.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,340 +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 -#include -#include -#include -#include -#include -#include -#include - -#include "HgConstants.h" -#include "HgLayoutData.h" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace AknLayoutScalable_Avkon; - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgScrollerWithTitle* CHgScrollerWithTitle::NewL( - const TRect& aRect, - TInt aItemCount, - THgScrollerType aScrollerType, - CGulIcon* aDefaultIcon ) - { - CHgScrollerWithTitle* self = new (ELeave) CHgScrollerWithTitle(); - CleanupStack::PushL( self ); - self->ConstructL( aRect, aItemCount, aScrollerType, aDefaultIcon ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgScrollerWithTitle::ConstructL (const TRect& aRect, - TInt aItemCount, - THgScrollerType aScrollerType, - CGulIcon* aDefaultIcon ) - { - // Create a window for this application view - CreateWindowL ( ); - - switch( aScrollerType ) - { - case EHgScrollerDoubleGraphicList: - { - iScroller = - CHgDoubleGraphicList::NewL( aRect, aItemCount, aDefaultIcon ); - break; - } - case EHgScrollerDoubleTextList: - { - iScroller = - CHgDoubleTextList::NewL( aRect, aItemCount, aDefaultIcon ); - break; - } - case EHgScrollerSingleGraphicList: - { - iScroller = - CHgSingleGraphicList::NewL( aRect, aItemCount, aDefaultIcon ); - break; - } - case EHgScrollerSingleLargeList: - { - iScroller = - CHgSingleLargeList::NewL( aRect, aItemCount, aDefaultIcon ); - break; - } - case EHgScrollerSingleTextList: - { - iScroller = - CHgSingleTextList::NewL( aRect, aItemCount, aDefaultIcon ); - break; - } - case EHgScrollerGrid: - { - iScroller = - CHgGrid::NewL( aRect, aItemCount, aDefaultIcon ); - break; - } - case EHgScrollerSingleTextListWithIcon: - { - iScroller = - CHgSingleTextListWithIcon::NewL( aRect, aItemCount, aDefaultIcon ); - break; - } - case EHgScrollerDoubleGraphicListFlat: - { - iScroller = - CHgDoubleGraphicList::NewL( aRect, aItemCount, aDefaultIcon ); - break; - } - default: - User::Leave( KErrArgument ); - } - - iScroller->SetMopParent( this ); - - iLayoutData = CHgListLayoutData::NewL(); - iTitleItem = CHgItem::NewL( ); - - ActivateL(); - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::Scroller() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgScroller& CHgScrollerWithTitle::Scroller() - { - return *iScroller; - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::InitScreenL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgScrollerWithTitle::InitScreenL( const TRect& aRect ) - { - // Set the windows size - SetRect ( aRect ); - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::TitleItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgItem& CHgScrollerWithTitle::TitleItem() - { - return *iTitleItem; - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::CHgScrollerWithTitle() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgScrollerWithTitle::CHgScrollerWithTitle() - { - // No implementation required - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::~CHgScrollerWithTitle() -// Destructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgScrollerWithTitle::~CHgScrollerWithTitle ( ) - { - delete iLayoutData; - delete iScroller; - delete iTitleItem; - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::Draw() -// Draws the display. -// ----------------------------------------------------------------------------- -// -void CHgScrollerWithTitle::Draw ( const TRect& /*aRect*/ ) const - { - // Draw background skin - CWindowGc& gc = SystemGc(); - - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( this ); - AknsDrawUtils::DrawBackground( skin, cc, this, gc, - TPoint(0,0), iTitleRect, KAknsDrawParamDefault ); - - // Draw background rect. Rect is just a little smaller - // than the actual item slot. - TRect recthg(iTitleRect); - TRect rect(recthg); - rect.Shrink(2,2); - AknsDrawUtils::DrawFrame( AknsUtils::SkinInstance(), - gc, - recthg, - rect, - KAknsIIDQsnFrPopup, - KAknsIIDQsnFrPopupCenter ); - - // Draw title icon if it exists. - CGulIcon* icon = iTitleItem->Icon(); - - if(icon) - { - // Draw the icon - TAknLayoutRect image; - image.LayoutRect(iTitleRect, iLayoutData->IconLayout()); - image.DrawImage(gc, icon->Bitmap(), icon->Mask()); - } - - // Draw first text line. - TAknLayoutText textLayout; - textLayout.LayoutText(iTitleRect, iLayoutData->TitleLayout(0) ); - textLayout.DrawText(gc, iTitleItem->Title(), ETrue, iColor ); - - // Draw second text line. - textLayout.LayoutText(iTitleRect, iLayoutData->TextLayout() ); - textLayout.DrawText(gc, iTitleItem->Text(), ETrue, iColor ); - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::SizeChanged() -// Called by framework when the view size is changed. -// ----------------------------------------------------------------------------- -// -void CHgScrollerWithTitle::SizeChanged ( ) - { - // Initialize layout data object - iLayoutData->SetItemLayout(list_double_large_graphic_pane( 0 )); - iLayoutData->SetIconLayout(list_double_large_graphic_pane_g1( 2 )); - for(TInt i = 0; i <= KMaxNumberOfTitleIndicators; ++i) - iLayoutData->SetTitleLayout(i, list_double_large_graphic_pane_t1( i )); - iLayoutData->SetTextLayout(list_double_large_graphic_pane_t2( 2 )); - iLayoutData->SetFirstIndicatorLayout(list_double_large_graphic_pane_g3(0)); - iLayoutData->SetSecondIndicatorLayout(list_double_large_graphic_pane_g2(0)); - iLayoutData->SetBaseLayout(AknLayoutScalable_Avkon::list_gen_pane(0)); - - TAknLayoutRect layout; - layout.LayoutRect(Rect(), iLayoutData->ItemLayout()); - - // Rect for the title item. - iTitleRect = layout.Rect(); - - // Set size for the compound control. - TRect scrollerRect( PositionRelativeToScreen(), Size() ); - scrollerRect.iTl.iY += iTitleRect.Height(); - TRAP_IGNORE( iScroller->InitScreenL( scrollerRect ); ) - - // Resolve color for normal items - if ( AknsUtils::AvkonSkinEnabled() ) - { - // this does not modify color unless it gets a correct one - // no real need to check errors - AknsUtils::GetCachedColor( - AknsUtils::SkinInstance(), - iColor, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - } - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::CountComponentControls() -// ----------------------------------------------------------------------------- -// -TInt CHgScrollerWithTitle::CountComponentControls() const - { - // We have only one child - return 1; - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::ComponentControl() -// ----------------------------------------------------------------------------- -// -CCoeControl* CHgScrollerWithTitle::ComponentControl(TInt aIndex) const - { - if( aIndex == 0 ) - { - return iScroller; - } - - return NULL; - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::ComponentControl() -// ----------------------------------------------------------------------------- -// -void CHgScrollerWithTitle::FocusChanged(TDrawNow aDrawNow) - { - if(iScroller) - { - iScroller->SetFocus(IsFocused(), aDrawNow); - } - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::OfferKeyEventL() -// ----------------------------------------------------------------------------- -// -TKeyResponse CHgScrollerWithTitle::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) - { - // send key events to children. - return iScroller->OfferKeyEventL( aKeyEvent, aType ); - } - -// ----------------------------------------------------------------------------- -// CHgScrollerWithTitle::PreferredImageSize() -// ----------------------------------------------------------------------------- -// -EXPORT_C TSize CHgScrollerWithTitle::PreferredImageSize() - { - // Fetch icon size from the layout. - TAknLayoutRect image; - image.LayoutRect(TRect(), AknLayoutScalable_Avkon::list_double_large_graphic_pane_g1( 2 )); - return image.Rect().Size(); - } - - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgSingleGraphicList.cpp --- a/uifw/ganes/src/HgSingleGraphicList.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +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 -#include -#include "HgMarquee.h" -#include "HgLayoutData.h" -#include "HgIndicatorManager.h" -#include "HgDrawUtils.h" -#include "HgConstants.h" - -#include -#include -#include - -#include -#include -#include - -using namespace AknLayoutScalable_Avkon; - -// ----------------------------------------------------------------------------- -// CHgSingleGraphicList::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgSingleGraphicList* CHgSingleGraphicList::NewL( - const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon, - RWsSession* aSession) - { - CHgSingleGraphicList* self = new ( ELeave ) CHgSingleGraphicList( - aItemCount, - aDefaultIcon ); - - CleanupStack::PushL (self ); - self->ConstructL( aRect, aSession ); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgSingleGraphicList::~CHgSingleGraphicList() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgSingleGraphicList::~CHgSingleGraphicList( ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgSingleGraphicList::PreferredImageSize() -// ----------------------------------------------------------------------------- -// -EXPORT_C TSize CHgSingleGraphicList::PreferredImageSize() - { - TAknLayoutRect image; - image.LayoutRect(TRect(), AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 )); - return image.Rect().Size(); - } - -// ----------------------------------------------------------------------------- -// CHgSingleGraphicList::HandleSizeChanged() -// ----------------------------------------------------------------------------- -// -void CHgSingleGraphicList::HandleSizeChanged() - { - CHgList::HandleSizeChanged(); - - iLayoutData->SetItemLayout(list_single_graphic_pane( 0 )); - iLayoutData->SetIconLayout(list_single_graphic_pane_g1( 2 )); - for(TInt i = 0; i <= KMaxNumberOfTitleIndicators; ++i) - iLayoutData->SetTitleLayout( i, list_single_graphic_pane_t1( i )); - iLayoutData->SetFirstIndicatorLayout(list_single_graphic_pane_g3(0)); - iLayoutData->SetSecondIndicatorLayout(list_single_graphic_pane_g2(1)); - - // Get the Row rect. - TAknLayoutRect layout; - layout.LayoutRect(ListRect(), iLayoutData->ItemLayout()); - iRowHeight = layout.Rect().Height(); - - // Icon rect. - TAknLayoutRect image; - image.LayoutRect(layout.Rect(), iLayoutData->IconLayout()); - iImageSize = image.Rect().Size(); - - // Indicator Rect. - TAknLayoutRect indicator; - indicator.LayoutRect(layout.Rect(), iLayoutData->FirstIndicatorLayout()); - iIndicatorSize = indicator.Rect().Size(); - - iItemsOnScreen = iHeight / iRowHeight; - iHeight = iItemsOnScreen * iRowHeight; - - if( iCurrentRow != KErrNotFound ) - FitTopItemToView( iCurrentRow ); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::DrawItem() -// ----------------------------------------------------------------------------- -// -void CHgSingleGraphicList::DrawItem( TInt aIndex, const TRect& aRect ) const - { - // Get the Icon - CHgItem* item = iItems[aIndex]; - CGulIcon* icon = item->Icon() ? item->Icon() : iDefaultIcon; - // Highlight the row if it's selected - TInt indicators = CHgIndicatorManager::CountIndicators(item->Flags()); - - CWindowGc& gc = SystemGc(); - - TRgb color = iColor; - if( aIndex == iSelectedIndex ) - { - DrawHighlight( aRect, color ); - - // Draw first line text - iDrawUtils->DrawTextMarquee( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color, 0); - - ResetClippingRect( gc ); - } - else - { - // Draw first line text - iDrawUtils->DrawText( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color); - } - - // Draw the icon - iDrawUtils->DrawImage(gc, aRect, iLayoutData->IconLayout(), *icon); - - // Draw the indicators. - iIndicatorManager->DrawIndicators( - gc, - aRect, - item->Flags(), - iLayoutData->FirstIndicatorLayout(), - iLayoutData->SecondIndicatorLayout() ); - } - -// ----------------------------------------------------------------------------- -// CHgSingleGraphicList::CHgSingleGraphicList() -// ----------------------------------------------------------------------------- -// -CHgSingleGraphicList::CHgSingleGraphicList( TInt aItemCount, - CGulIcon* aDefaultIcon ) -: CHgList( aItemCount, aDefaultIcon ) - { - - } - -// End of file diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgSingleLargeList.cpp --- a/uifw/ganes/src/HgSingleLargeList.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +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 -#include -#include "HgMarquee.h" -#include "HgLayoutData.h" -#include "HgIndicatorManager.h" -#include "HgDrawUtils.h" -#include "HgConstants.h" - -#include -#include -#include - -#include -#include -#include - -using namespace AknLayoutScalable_Avkon; - -// ----------------------------------------------------------------------------- -// CHgSingleLargeList::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgSingleLargeList* CHgSingleLargeList::NewL( - const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon, - RWsSession* aSession) - { - CHgSingleLargeList* self = new ( ELeave ) CHgSingleLargeList( - aItemCount, - aDefaultIcon ); - - CleanupStack::PushL (self ); - self->ConstructL( aRect, aSession ); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgSingleLargeList::~CHgSingleLargeList() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgSingleLargeList::~CHgSingleLargeList( ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgSingleLargeList::PreferredImageSize() -// ----------------------------------------------------------------------------- -// -EXPORT_C TSize CHgSingleLargeList::PreferredImageSize() - { - TAknLayoutRect image; - image.LayoutRect(TRect(), list_single_large_graphic_pane_g1( 0 )); - return image.Rect().Size(); - } - -// ----------------------------------------------------------------------------- -// CHgSingleLargeList::HandleSizeChanged() -// ----------------------------------------------------------------------------- -// -void CHgSingleLargeList::HandleSizeChanged() - { - CHgList::HandleSizeChanged(); - - iLayoutData->SetItemLayout(list_single_large_graphic_pane( 0, 0 )); - iLayoutData->SetIconLayout(list_single_large_graphic_pane_g1( 2 )); - for(TInt i = 0; i <= KMaxNumberOfTitleIndicators; ++i) - iLayoutData->SetTitleLayout( i, list_single_large_graphic_pane_t1( i )); - iLayoutData->SetFirstIndicatorLayout(list_single_large_graphic_pane_g3(0)); - iLayoutData->SetSecondIndicatorLayout(list_single_large_graphic_pane_g2(1)); - - // Get the Row rect. - TAknLayoutRect layout; - layout.LayoutRect(ListRect(), iLayoutData->ItemLayout()); - iRowHeight = layout.Rect().Height(); - - // Icon rect. - TAknLayoutRect image; - image.LayoutRect(layout.Rect(), iLayoutData->IconLayout()); - iImageSize = image.Rect().Size(); - - // Indicator Rect. - TAknLayoutRect indicator; - indicator.LayoutRect(layout.Rect(), iLayoutData->FirstIndicatorLayout()); - iIndicatorSize = indicator.Rect().Size(); - - iItemsOnScreen = iHeight / iRowHeight; - iHeight = iItemsOnScreen * iRowHeight; - - if( iCurrentRow != KErrNotFound ) - FitTopItemToView( iCurrentRow ); - } - -// ----------------------------------------------------------------------------- -// CHgDoubleGraphicList::DrawItem() -// ----------------------------------------------------------------------------- -// -void CHgSingleLargeList::DrawItem( TInt aIndex, const TRect& aRect ) const - { - // Get the Icon - CHgItem* item = iItems[aIndex]; - CGulIcon* icon = item->Icon() ? item->Icon() : iDefaultIcon; - - TInt indicators = CHgIndicatorManager::CountIndicators(item->Flags()); - - CWindowGc& gc = SystemGc(); - - // Highlight the row if it's selected - TRgb color = iColor; - if( aIndex == iSelectedIndex ) - { - DrawHighlight( aRect, color ); - - // Draw first line text - iDrawUtils->DrawTextMarquee( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color, 0); - - ResetClippingRect( gc ); - } - else - { - // Draw first line text - iDrawUtils->DrawText( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color); - } - - // Draw the icon - iDrawUtils->DrawImage(gc, aRect, iLayoutData->IconLayout(), *icon); - - // Draw the indicators. - iIndicatorManager->DrawIndicators( - gc, - aRect, - item->Flags(), - iLayoutData->FirstIndicatorLayout(), - iLayoutData->SecondIndicatorLayout() ); - } - -// ----------------------------------------------------------------------------- -// CHgSingleLargeList::CHgSingleLargeList() -// ----------------------------------------------------------------------------- -// -CHgSingleLargeList::CHgSingleLargeList( TInt aItemCount, - CGulIcon* aDefaultIcon ) -: CHgList( aItemCount, aDefaultIcon ) - { - - } - - - -// End of file diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgSingleTextList.cpp --- a/uifw/ganes/src/HgSingleTextList.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,158 +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 -#include -#include "HgMarquee.h" -#include "HgLayoutData.h" -#include "HgIndicatorManager.h" -#include "HgDrawUtils.h" - -#include -#include -#include - -#include -#include -#include - -using namespace AknLayoutScalable_Avkon; - -// ----------------------------------------------------------------------------- -// CHgSingleTextList::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgSingleTextList* CHgSingleTextList::NewL( - const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon, - RWsSession* aSession) - { - CHgSingleTextList* self = new ( ELeave ) CHgSingleTextList( - aItemCount, - aDefaultIcon ); - - CleanupStack::PushL (self ); - self->ConstructL( aRect, aSession ); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgSingleTextList::~CHgSingleTextList() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgSingleTextList::~CHgSingleTextList( ) - { - } - -// ----------------------------------------------------------------------------- -// CHgSingleTextList::HandleSizeChanged() -// ----------------------------------------------------------------------------- -// -void CHgSingleTextList::HandleSizeChanged() - { - // Call base implementation - CHgList::HandleSizeChanged(); - - iLayoutData->SetItemLayout(list_single_pane( 0 )); - for(TInt i = 0; i <= KMaxNumberOfTitleIndicators; ++i) - iLayoutData->SetTitleLayout( i, list_single_pane_t1( i ) ); - iLayoutData->SetFirstIndicatorLayout(list_single_pane_g2(0)); - iLayoutData->SetSecondIndicatorLayout(list_single_pane_g1(1)); - - // Get the Row rect. - TAknLayoutRect layout; - layout.LayoutRect(ListRect(), iLayoutData->ItemLayout()); - iRowHeight = layout.Rect().Height(); - - // This list type doesn't really visualize any icons. - iImageSize = TSize(0,0); - - // Indicator Rect. - TAknLayoutRect indicator; - indicator.LayoutRect(layout.Rect(), iLayoutData->FirstIndicatorLayout()); - iIndicatorSize = indicator.Rect().Size(); - - // Calculate the items on the screen. - iItemsOnScreen = iHeight / iRowHeight; - iHeight = iItemsOnScreen * iRowHeight; - - if( iCurrentRow != KErrNotFound ) - FitTopItemToView( iCurrentRow ); - } - -// ----------------------------------------------------------------------------- -// CHgSingleTextList::DrawItem() -// ----------------------------------------------------------------------------- -// -void CHgSingleTextList::DrawItem( TInt aIndex, const TRect& aRect ) const - { - // Get the Icon - CHgItem* item = iItems[aIndex]; - // Highlight the row if it's selected - TInt indicators = CHgIndicatorManager::CountIndicators(item->Flags()); - - CWindowGc& gc = SystemGc(); - - TRgb color = iColor; - if( aIndex == iSelectedIndex ) - { - DrawHighlight( aRect, color ); - - // Draw first line text - iDrawUtils->DrawTextMarquee( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color, 0); - - ResetClippingRect( gc ); - } - else - { - // Draw first line text - iDrawUtils->DrawText( - gc, - aRect, - iLayoutData->TitleLayout(indicators), - item->Title(), - color); - } - - // Draw the indicators. - iIndicatorManager->DrawIndicators( - gc, - aRect, - item->Flags(), - iLayoutData->FirstIndicatorLayout(), - iLayoutData->SecondIndicatorLayout() ); - } - -// ----------------------------------------------------------------------------- -// CHgSingleTextList::CHgSingleTextList() -// ----------------------------------------------------------------------------- -// -CHgSingleTextList::CHgSingleTextList( TInt aItemCount, - CGulIcon* aDefaultIcon ) -: CHgList( aItemCount, aDefaultIcon ) - { - - } - -// EOF diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgSingleTextListWithIcon.cpp --- a/uifw/ganes/src/HgSingleTextListWithIcon.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +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 -#include -#include "HgMarquee.h" -#include "HgLayoutData.h" -#include "HgIndicatorManager.h" -#include "HgDrawUtils.h" - -#include -#include -#include - -#include -#include -#include - -using namespace AknLayoutScalable_Avkon; - -// ----------------------------------------------------------------------------- -// CHgSingleTextList::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgSingleTextListWithIcon* CHgSingleTextListWithIcon::NewL( - const TRect& aRect, - TInt aItemCount, - CGulIcon* aDefaultIcon, - RWsSession* aSession) - { - CHgSingleTextListWithIcon* self = new ( ELeave ) CHgSingleTextListWithIcon( - aItemCount, - aDefaultIcon ); - - CleanupStack::PushL (self ); - self->ConstructL( aRect, aSession ); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgSingleTextListWithIcon::~CHgSingleTextListWithIcon() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgSingleTextListWithIcon::~CHgSingleTextListWithIcon( ) - { - delete iGraphicLayoutData; - } - -// ----------------------------------------------------------------------------- -// CHgSingleTextList::HandleSizeChanged() -// ----------------------------------------------------------------------------- -// -void CHgSingleTextListWithIcon::HandleSizeChanged() - { - // Init layout for the graphic item - iGraphicLayoutData->SetItemLayout(list_single_graphic_pane( 0 )); - iGraphicLayoutData->SetIconLayout(list_single_graphic_pane_g1( 2 )); - for(TInt i = 0; i <= KMaxNumberOfTitleIndicators; ++i) - iGraphicLayoutData->SetTitleLayout( i, list_single_graphic_pane_t1( i )); - iGraphicLayoutData->SetFirstIndicatorLayout(list_single_graphic_pane_g3(0)); - iGraphicLayoutData->SetSecondIndicatorLayout(list_single_graphic_pane_g2(1)); - - // Get the Row rect. - TAknLayoutRect layout; - layout.LayoutRect(ListRect(), iGraphicLayoutData->ItemLayout()); - - // Icon rect. - TAknLayoutRect image; - image.LayoutRect(layout.Rect(), iLayoutData->IconLayout()); - iImageSize = image.Rect().Size(); - - // Call base implementation - CHgSingleTextList::HandleSizeChanged(); - } - -// ----------------------------------------------------------------------------- -// CHgSingleTextList::DrawItem() -// ----------------------------------------------------------------------------- -// -void CHgSingleTextListWithIcon::DrawItem( TInt aIndex, const TRect& aRect ) const - { - // Get the Icon - CHgItem* item = iItems[aIndex]; - if( !item->Icon() ) - { - // Let single text list handle the normal item drawing. - CHgSingleTextList::DrawItem( aIndex, aRect ); - return; - } - - // Highlight the row if it's selected - TInt indicators = CHgIndicatorManager::CountIndicators(item->Flags()); - - CWindowGc& gc = SystemGc(); - - TRgb color = iColor; - if( aIndex == iSelectedIndex ) - { - DrawHighlight( aRect, color ); - - // Draw first line text - iDrawUtils->DrawTextMarquee( - gc, - aRect, - iGraphicLayoutData->TitleLayout(indicators), - item->Title(), - color, 0); - - ResetClippingRect( gc ); - } - else - { - // Draw first line text - iDrawUtils->DrawText( - gc, - aRect, - iGraphicLayoutData->TitleLayout(indicators), - item->Title(), - color); - } - - iDrawUtils->DrawImage(gc, aRect, iGraphicLayoutData->IconLayout(), *item->Icon() ); - - // Draw the indicators. - iIndicatorManager->DrawIndicators( - gc, - aRect, - item->Flags(), - iGraphicLayoutData->FirstIndicatorLayout(), - iGraphicLayoutData->SecondIndicatorLayout() ); - } - -// ----------------------------------------------------------------------------- -// CHgSingleTextList::CHgSingleTextList() -// ----------------------------------------------------------------------------- -// -CHgSingleTextListWithIcon::CHgSingleTextListWithIcon( TInt aItemCount, - CGulIcon* aDefaultIcon ) -: CHgSingleTextList( aItemCount, aDefaultIcon ) - { - SetFlags( EHgScrollerFlatStatusPane ); // Set Flat status pane on - } - -void CHgSingleTextListWithIcon::ConstructL( const TRect& aRect, RWsSession* aSession ) - { - iGraphicLayoutData = CHgListLayoutData::NewL(); - CHgList::ConstructL( aRect, aSession ); - } - - -// EOF diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgTextFind.cpp --- a/uifw/ganes/src/HgTextFind.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,281 +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 "HgTextFind.h" -#include -#include "HgConstants.h" - -// ----------------------------------------------------------------------------- -// CHgTextFind::NewL() -// ----------------------------------------------------------------------------- -// -CHgTextFind* CHgTextFind::NewL(CHgScroller& aScroller) - { - CHgTextFind* self = new (ELeave) CHgTextFind( aScroller ); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::~CHgTextFind() -// ----------------------------------------------------------------------------- -// -CHgTextFind::~CHgTextFind() - { - delete iState; - iBuf.Close(); - iSearchDesc.Close(); - delete iTimer; - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::CHgTextFind() -// ----------------------------------------------------------------------------- -// -CHgTextFind::CHgTextFind( CHgScroller& aScroller ) - : iScroller( aScroller) - { - - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::ConstructL() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::ConstructL() - { - iState = new (ELeave) CAknEdwinState(); - iState->SetObjectProvider(&iScroller); - iState->SetDefaultCase( EAknEditorUpperCase ); - iState->SetFlags( - EAknEditorFlagFixedCase | - EAknEditorFlagNoT9 | - EAknEditorFlagNoEditIndicators | - EAknEditorFlagNoLRNavigation | - EAknEditorFlagSupressShiftMenu - ); - - iBuf.CreateL( KMaxPopupTextLength ); - iSearchDesc.CreateL( KMaxSearchLenght ); - iTimer = CPeriodic::New( CActive::EPriorityLow ); - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::StartFepInlineEditL() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::StartFepInlineEditL( const TDesC& aInitialInlineText, - TInt /*aPositionOfInsertionPointInInlineText*/, - TBool /*aCursorVisibility*/, const MFormCustomDraw* /*aCustomDraw*/, - MFepInlineTextFormatRetriever& /*aInlineTextFormatRetriever*/, - MFepPointerEventHandlerDuringInlineEdit& /*aPointerEventHandlerDuringInlineEdit*/ ) - { - iTimer->Cancel(); - if( iBuf.Length() + aInitialInlineText.Length() < iBuf.MaxLength() ) - iBuf.Append(aInitialInlineText); - iScroller.DrawNow(); - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::UpdateFepInlineTextL() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::UpdateFepInlineTextL( const TDesC& aNewInlineText, - TInt /*aPositionOfInsertionPointInInlineText*/ ) - { - iTimer->Cancel(); - if( iBuf.Length() + aNewInlineText.Length() < iBuf.MaxLength() ) - { - if(iBuf.Length()) - { - if( aNewInlineText.Length() ) - { - iBuf.Replace(iBuf.Length()-1, aNewInlineText.Length(), aNewInlineText); - iScroller.DrawNow(); - } - else - { - iBuf.Delete(iBuf.Length()-1, 1); - } - } - else - { - iBuf.Append(aNewInlineText); - iScroller.DrawNow(); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::SetInlineEditingCursorVisibilityL() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::SetInlineEditingCursorVisibilityL( TBool /*aCursorVisibility*/ ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::CancelFepInlineEdit() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::CancelFepInlineEdit() - { - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::DocumentLengthForFep() -// ----------------------------------------------------------------------------- -// -TInt CHgTextFind::DocumentLengthForFep() const - { - return iBuf.Length(); - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::DocumentMaximumLengthForFep() -// ----------------------------------------------------------------------------- -// -TInt CHgTextFind::DocumentMaximumLengthForFep() const - { - return iBuf.MaxLength(); - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::SetCursorSelectionForFepL() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::SetCursorSelectionForFepL( const TCursorSelection& /*aCursorSelection*/ ) - { - - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::GetCursorSelectionForFep() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::GetCursorSelectionForFep( TCursorSelection& /*aCursorSelection*/ ) const - { - - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::GetEditorContentForFep() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::GetEditorContentForFep( TDes& /*aEditorContent*/, - TInt /*aDocumentPosition*/, TInt /*aLengthToRetrieve*/ ) const - { - - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::GetFormatForFep() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::GetFormatForFep( TCharFormat& /*aFormat*/, TInt /*aDocumentPosition*/ ) const - { - - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::GetScreenCoordinatesForFepL() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::GetScreenCoordinatesForFepL( TPoint& /*aLeftSideOfBaseLine*/, - TInt& /*aHeight*/, TInt& /*aAscent*/, TInt /*aDocumentPosition*/ ) const - { - - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::Extension1() -// ----------------------------------------------------------------------------- -// -MCoeFepAwareTextEditor_Extension1* CHgTextFind::Extension1(TBool& aSetToTrue) - { - aSetToTrue = ETrue; - return this; - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::SetStateTransferingOwnershipL() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::SetStateTransferingOwnershipL( CState* /*aState*/, TUid /*aTypeSafetyUid*/ ) -// this function must only transfer ownership after it has successfully done everything that can leave - { - - } -// ----------------------------------------------------------------------------- -// CHgTextFind::State() -// ----------------------------------------------------------------------------- -// -MCoeFepAwareTextEditor_Extension1::CState* CHgTextFind::State( TUid /*aTypeSafetyUid */ ) - { - return iState; - } - - -// ----------------------------------------------------------------------------- -// CHgTextFind::DoCommitFepInlineEditL() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::DoCommitFepInlineEditL() - { - iSearchDesc.Copy(iBuf); - iSearchDesc.UpperCase(); - iScroller.HightlightItem(iSearchDesc); - iTimer->Cancel(); - iTimer->Start(KSearchEndTimeOut, KSearchEndTimeOut, - TCallBack(CHgTextFind::SearchTimerCallback, this)); - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::SearchTimerCallback() -// ----------------------------------------------------------------------------- -// -TInt CHgTextFind::SearchTimerCallback( TAny* aSelf ) - { - CHgTextFind* self = (CHgTextFind*)aSelf; - self->ClearSearchDesc(); - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::ClearSearchDesc() -// ----------------------------------------------------------------------------- -// -void CHgTextFind::ClearSearchDesc() - { - iBuf.Zero(); - iTimer->Cancel(); - iScroller.DrawDeferred(); - } - -// ----------------------------------------------------------------------------- -// CHgTextFind::Text() -// ----------------------------------------------------------------------------- -// -const TDesC& CHgTextFind::Text() - { - return iBuf; - } - - diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgButton.cpp --- a/uifw/ganes/src/HgVgButton.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,176 +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 "HgVgButton.h" -#include "HgVgHelper.h" -#include -#include - - - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CHgVgButton::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgVgButton* CHgVgButton::NewL( const TSize& aSize, const TPoint& aPosition, - const CGulIcon& aIcon ) - { - CHgVgButton* self = new ( ELeave ) CHgVgButton( aSize, aPosition ); - CleanupStack::PushL (self ); - self->ConstructL(aIcon); - CleanupStack::Pop ( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgVgButton::ConstructL (const CGulIcon& aIcon) - { - iImage = HgVgHelper::CreateVgImageFromIconL(aIcon); - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::CHgVgButton() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgButton::CHgVgButton( const TSize& aSize, const TPoint& aPosition ) : -iSize(aSize), -iPosition(aPosition), -iImage(VG_INVALID_HANDLE), -iEnabled(ETrue), -iPointerDown(EFalse) - { - - - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::~CHgVgButton() -// Destructor. -// ----------------------------------------------------------------------------- -// -CHgVgButton::~CHgVgButton ( ) - { - - - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::HandlePointerEvent() -// ----------------------------------------------------------------------------- -// -TBool CHgVgButton::HandlePointerEvent(const TPointerEvent& aEvent) - { - if (!iEnabled) - return EFalse; - - TRect rect(iPosition, iSize); - TBool result = EFalse; - - if( aEvent.iType == TPointerEvent::EButton1Down && - rect.Contains(aEvent.iPosition) && !iPointerDown ) - { - iPointerDown = ETrue; - result = ETrue; - } - else if( aEvent.iType == TPointerEvent::EButton1Up ) - { - iPointerDown = EFalse; - result = EFalse; - } - - return result; - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::Enabled() -// ----------------------------------------------------------------------------- -// -TBool CHgVgButton::IsEnabled() const - { - return iEnabled; - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::Position() -// ----------------------------------------------------------------------------- -// -const TPoint& CHgVgButton::Position() const - { - return iPosition; - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::Size() -// ----------------------------------------------------------------------------- -// -const TSize& CHgVgButton::Size() const - { - return iSize; - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::SetEnabled() -// ----------------------------------------------------------------------------- -// -void CHgVgButton::SetEnabled(TBool aEnabled) - { - iEnabled = aEnabled; - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::SetPosition() -// ----------------------------------------------------------------------------- -// -void CHgVgButton::SetPosition(const TPoint& aPosition) - { - iPosition = aPosition; - } - -// ----------------------------------------------------------------------------- -// CHgVgButton::SetSize() -// ----------------------------------------------------------------------------- -// -void CHgVgButton::SetSize(const TSize& aSize) - { - iSize = aSize; - } - - -// ----------------------------------------------------------------------------- -// CHgVgButton::SetIconL() -// ----------------------------------------------------------------------------- -// -void CHgVgButton::Draw(const TRect& aWindowRect, TReal aAlpha) - { - if (iEnabled) - { - TRgb color(KRgbWhite); - color.SetAlpha(aAlpha * 255.0f); - HgVgHelper::DrawImageColorized(iImage, color, iPosition, aWindowRect, EFalse); - } - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgDrawBuffer.cpp --- a/uifw/ganes/src/HgVgDrawBuffer.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,168 +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 "HgVgDrawBuffer.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CHgVgDrawBuffer::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgVgDrawBuffer* CHgVgDrawBuffer::NewL(const TSize& aBufferSize, const TDisplayMode& aMode ) - { - CHgVgDrawBuffer* self = new ( ELeave ) CHgVgDrawBuffer(); - - CleanupStack::PushL (self ); - self->ConstructL(aBufferSize, aMode); - CleanupStack::Pop ( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgDrawBuffer::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgVgDrawBuffer::ConstructL (const TSize& aBufferSize, const TDisplayMode& aMode ) - { - - // Create draw buffer - iDrawBuffer = new (ELeave) CFbsBitmap(); - iDrawBuffer->Create(aBufferSize, aMode); - iBufferSize = aBufferSize; - - // Create device and context for drawing - iDevice = CFbsBitmapDevice::NewL(iDrawBuffer); - iDevice->CreateContext(iGc); - - - } - -// ----------------------------------------------------------------------------- -// CHgVgDrawBuffer::CHgVgDrawBuffer() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgDrawBuffer::CHgVgDrawBuffer() - { - - } - -// ----------------------------------------------------------------------------- -// CHgVgDrawBuffer::~CHgVgDrawBuffer() -// Destructor. -// ----------------------------------------------------------------------------- -// -CHgVgDrawBuffer::~CHgVgDrawBuffer ( ) - { - delete iGc; iGc = NULL; - delete iDevice; iDevice = NULL; - delete iDrawBuffer; iDrawBuffer = NULL; - } - - -// ----------------------------------------------------------------------------- -// CHgVgDrawBuffer::BufferSize() -// ----------------------------------------------------------------------------- -// -const TSize& CHgVgDrawBuffer::BufferSize() const -{ - return iBufferSize; -} - -// ----------------------------------------------------------------------------- -// CHgVgDrawBuffer::Gc() -// Gets drawcontext. -// ----------------------------------------------------------------------------- -// -CFbsBitGc& CHgVgDrawBuffer::Gc() - { - return *iGc; - } - - -CFbsBitmap& CHgVgDrawBuffer::DrawBuffer() - { - return *iDrawBuffer; - } - -// ----------------------------------------------------------------------------- -// CHgVgDrawBuffer::Clear -// Clear draw buffer to color -// ----------------------------------------------------------------------------- -// -void CHgVgDrawBuffer::Clear(const TRect& aRect, - const TRgb& aColor) - { - iGc->SetBrushColor(aColor); - iGc->Clear(aRect); - } - -// ----------------------------------------------------------------------------- -// CHgVgDrawBuffer::DrawText() -// Draws text to buffer -// ----------------------------------------------------------------------------- -// -void CHgVgDrawBuffer::DrawText(const TDesC& aText, const CFont* aFont, - const TRgb& aColor, const TPoint& aPosition) - { - iGc->SetPenColor(aColor); - iGc->UseFont(aFont); - iGc->DrawText(aText, aPosition); - } - -// ----------------------------------------------------------------------------- -// CHgVgDrawBuffer::GetDrawBufferToVgImage() -// Copies drawbuffer to vg image. -// ----------------------------------------------------------------------------- -// -void CHgVgDrawBuffer::GetDrawBufferToVgImage(const TRect& aSrcRect, - const TPoint& aDest, VGImage destImage, VGImageFormat destFormat) - { - - iDrawBuffer->BeginDataAccess(); - TInt stride = iDrawBuffer->DataStride(); - TInt sizeOfPixel = stride / iBufferSize.iWidth; - - TUint8* ptr = (TUint8*)iDrawBuffer->DataAddress(); - ptr += aSrcRect.iTl.iY * stride; - ptr += aSrcRect.iTl.iX * sizeOfPixel; - - vgImageSubData (destImage, ptr, stride, destFormat, aDest.iX, aDest.iY, aSrcRect.Width(), - aSrcRect.Height()); - - iDrawBuffer->EndDataAccess(); - - - } - - - - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgEGL.cpp --- a/uifw/ganes/src/HgVgEGL.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,321 +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 "HgVgEGL.h" -#include "HgVgConstants.h" -#include - - -using namespace HgVgConstants; - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CHgVgEGL::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgVgEGL* CHgVgEGL::NewL(RWindow& aWindow) - { - CHgVgEGL* self = new ( ELeave ) CHgVgEGL(); - CleanupStack::PushL (self ); - self->ConstructL(aWindow); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgEGL::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgVgEGL::ConstructL (RWindow& aWindow) - { - InitEGL(aWindow); - } - -// ----------------------------------------------------------------------------- -// CHgVgEGL::CHgVgEGL() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgEGL::CHgVgEGL() - { - } - -// ----------------------------------------------------------------------------- -// CHgVgEGL::~CHgVgEGL() -// Destructor. -// ----------------------------------------------------------------------------- -// -CHgVgEGL::~CHgVgEGL ( ) - { - DestroyEGL(); - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::InitWindowSurfaceL() -// --------------------------------------------------------------------------- -// -void CHgVgEGL::InitWindowSurfaceL(RWindow& aWindow) - { - RDebug::Print(_L("CHgVgEGL::InitWindowSurface")); - - InitEGL(aWindow); - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::FreeWindowSurface() -// --------------------------------------------------------------------------- -// -void CHgVgEGL::FreeWindowSurface() - { - RDebug::Print(_L("CHgVgEGL::FreeWindowSurface")); - - // make sure there is nothing pending. - vgFinish(); - - // unbind current surface. - eglMakeCurrent(iDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, iContextVg); - - // destroy surface - eglDestroySurface(iDisplay, iSurface); - iSurface = VG_INVALID_HANDLE; - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::ReadyToRender() -// --------------------------------------------------------------------------- -// -TBool CHgVgEGL::ReadyToRender() const - { - return iSurface && iDisplay && iContextVg; - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::SwapBuffers() -// --------------------------------------------------------------------------- -// -void CHgVgEGL::SwapBuffers() - { - eglSwapBuffers(iDisplay, iSurface); - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::Display() -// --------------------------------------------------------------------------- -// -EGLDisplay CHgVgEGL::Display() const - { - return iDisplay; - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::Surface -// --------------------------------------------------------------------------- -// -EGLSurface CHgVgEGL::Surface() const - { - return iSurface; - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::Context() -// --------------------------------------------------------------------------- -// -EGLContext CHgVgEGL::Context() const - { - return iContextVg; - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::CurrentConfig() -// --------------------------------------------------------------------------- -// -EGLConfig CHgVgEGL::CurrentConfig() const - { - return iChosenConfig; - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::InitEGL() -// --------------------------------------------------------------------------- -// -void CHgVgEGL::InitEGL(RWindow& aWindow) - { - - // if we are just resizing or recreating - if (iContextVg != VG_INVALID_HANDLE) - { - - - // save old surface - EGLSurface oldSurface = VG_INVALID_HANDLE; - if (iSurface != VG_INVALID_HANDLE) - { - // make sure there is nothing pending. - vgFinish(); - - oldSurface = iSurface; - - // unbind current surface. - eglMakeCurrent(iDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, iContextVg); - } - - // create new surface - InitEGLWindowSurfaceL(aWindow); - - // bind new surface - eglMakeCurrent(iDisplay, iSurface, iSurface, iContextVg); - - if (oldSurface != VG_INVALID_HANDLE) - { - // free old surface - eglDestroySurface(iDisplay,oldSurface); - } - - } - else - { - - // get display - iDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY); - - // intialize egl - eglInitialize(iDisplay, NULL, NULL); - - // find suitable display config - EGLint numConfigs; - iChosenConfig = 0; - - const EGLint KColorAttribList[] = - { - EGL_RED_SIZE, KSurfaceRedBits, - EGL_GREEN_SIZE, KSurfaceGreenBits, - EGL_BLUE_SIZE, KSurfaceBlueBits, - EGL_ALPHA_SIZE, KSurfaceAlphaBits, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT, - EGL_NONE - }; - - eglChooseConfig(iDisplay, KColorAttribList, &iChosenConfig, 1, &numConfigs); - - // we need openvg - eglBindAPI(EGL_OPENVG_API); - - InitEGLWindowSurfaceL(aWindow); - - // Create context for our thread. - iContextVg = eglCreateContext(iDisplay, iChosenConfig, EGL_NO_CONTEXT, NULL); - - // bind surface to context - eglMakeCurrent(iDisplay, iSurface, iSurface, iContextVg); - - } - - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::InitEGLWindowSurfaceL() -// --------------------------------------------------------------------------- -// -void CHgVgEGL::InitEGLWindowSurfaceL(RWindow& aWindow) - { - - - // Create surface with premodulated alpha, on IVE3 this gives better performance. - const EGLint KAttriblist[] = - { - EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_PRE, - EGL_NONE - }; - iSurface = eglCreateWindowSurface(iDisplay, iChosenConfig, &aWindow, KAttriblist); - EGLint error = eglGetError(); - if (error == EGL_BAD_ALLOC) - { - RDebug::Print(_L("CHgVgEGL:: Can't create surface! (out of memory)")); - User::Leave(KErrNoMemory); - } - else if (error == EGL_BAD_SURFACE || iSurface == EGL_NO_SURFACE) - { - RDebug::Print(_L("CHgVgEGL:: Can't create surface! (general)")); - User::Leave(KErrGeneral); - } - - eglSurfaceAttrib(iDisplay, iSurface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED); - - } - -// --------------------------------------------------------------------------- -// CHgVgEGL::DestroyEGL() -// --------------------------------------------------------------------------- -// -void CHgVgEGL::DestroyEGL() - { - // deinitialize egl - eglMakeCurrent(iDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - eglDestroySurface(iDisplay,iSurface); - eglDestroyContext( iDisplay, iContextVg ); - eglTerminate(iDisplay); - } - - -// --------------------------------------------------------------------------- -// CHgVgEGL::GetSurfaceToBitmap() -// --------------------------------------------------------------------------- -// -CFbsBitmap* CHgVgEGL::GetSurfaceToBitmap(const TRect& aRect) const - { - // make sure every thing is in back buffer - vgFinish(); - - VGuint dataStride = 4 * aRect.Width(); - - CFbsBitmap* bitmap = new CFbsBitmap(); - - if (bitmap) - { - // create temporary buffer for data - RBuf8 buf; - buf.Create(aRect.Width() * dataStride); - buf.Fill(0xFF); - - // read data from vg (this is sloooww) - vgReadPixels((void*)buf.Ptr(), - dataStride, VG_sARGB_8888, 0, 0, aRect.Width(), aRect.Height()); - - // because of bug in vg driver we need to swap memory using for loop, because - // negative datastrides case crash - bitmap->Create(TSize(aRect.Width(), aRect.Height()), EColor16MA); - bitmap->BeginDataAccess(); - TUint8* ptrTrg = (TUint8*)bitmap->DataAddress(); - TUint8* ptrSrc = (TUint8*)buf.Ptr(); - for (TInt i = 0; i < aRect.Height(); i++) - { - Mem::Copy(ptrTrg + dataStride * i, - ptrSrc + dataStride * (aRect.Height() - i - 1), dataStride); - } - bitmap->EndDataAccess(); - buf.Close(); - } - - return bitmap; - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgHelper.cpp --- a/uifw/ganes/src/HgVgHelper.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,535 +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 "HgVgHelper.h" -#include "HgVgDrawBuffer.h" -#include "HgVgImageCreator.h" - -#include -#include -#include -#include -#include -#include - -const TInt KVertexX(0); -const TInt KVertexY(1); -const TInt KVertexZ(2); -const TInt KNumColorValues(4); -const TInt KNumColorTransformValues(8); -const VGfloat KColorByteToFloatFactor(255.0f); - - -namespace HgVgHelper - { - -static VGImage CreateNonMaskedVgImageL( const CFbsBitmap& aBitmap ) - { - TSize size = aBitmap.SizeInPixels(); - VGImage image = vgCreateImage(VG_sRGB_565, size.iWidth, size.iHeight,VG_IMAGE_QUALITY_NONANTIALIASED); - VGErrorCode error = vgGetError(); - if (image == VG_INVALID_HANDLE || error == VG_OUT_OF_MEMORY_ERROR) - { - User::Leave(KErrNoMemory); - } - if (aBitmap.DisplayMode() == EColor64K && !aBitmap.IsCompressedInRAM()) - { - aBitmap.BeginDataAccess(); - TInt stride = aBitmap.DataStride(); - TUint8* ptr = (TUint8*)aBitmap.DataAddress(); - vgImageSubData (image, ptr, stride, VG_sRGB_565, 0, 0, size.iWidth, size.iHeight ); - aBitmap.EndDataAccess(); - } - else - { - TSize size = aBitmap.SizeInPixels(); - CHgVgDrawBuffer* temp = CHgVgDrawBuffer::NewL(size, EColor64K); - temp->Gc().BitBlt(TPoint(0,0), &aBitmap); - temp->GetDrawBufferToVgImage(size, TPoint(0,0), image, - VG_sRGB_565); - delete temp; - } - return image; - } - -static VGImage CreateMaskedVgImageL( CFbsBitmap* aBitmap, CFbsBitmap* aMask ) - { - TSize size = aBitmap->SizeInPixels(); - CHgVgDrawBuffer* temp = CHgVgDrawBuffer::NewL(size, EColor16MA); - temp->Gc().SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); - temp->Gc().SetBrushColor(TRgb(0,0,0,0)); - temp->Gc().Clear(); - temp->Gc().BitBltMasked(TPoint(0,0), aBitmap, size, aMask, EFalse); - - VGImage image = vgCreateImage(VG_sRGBA_8888, size.iWidth, size.iHeight,VG_IMAGE_QUALITY_NONANTIALIASED); - temp->GetDrawBufferToVgImage(size, TPoint(0,0), image, - VG_sARGB_8888); - - delete temp; - return image; - } - -// --------------------------------------------------------------------------- -// HgVgHelper::CreateVgImageFromIconL() -// --------------------------------------------------------------------------- -// -VGImage CreateVgImageFromIconL(const CGulIcon& aIcon) - { - - CFbsBitmap* bitmap = aIcon.Bitmap(); - User::LeaveIfNull(bitmap); - CFbsBitmap* mask = aIcon.Mask(); - - // if this is NVG image, rasterize it using - // nvg engine - if (bitmap->ExtendedBitmapType() != KNullUid) - { - return CHgVgImageCreator::InstanceL()->RenderImageFromIconL(bitmap); - } - else - { - // otherwise just blit/copy to vg image. - if (mask) - { - return CreateMaskedVgImageL(bitmap, mask); - } - else - { - return CreateNonMaskedVgImageL(*bitmap); - } - } - - } - -// --------------------------------------------------------------------------- -// HgVgHelper::Clamp() -// --------------------------------------------------------------------------- -// -VGfloat Clamp(VGfloat value, VGfloat min, VGfloat max) - { - VGfloat result = (value < min) ? min : value; - return (result > max) ? max : result; - } - -// --------------------------------------------------------------------------- -// HgVgHelper::Lerp() -// --------------------------------------------------------------------------- -// -VGfloat Lerp(VGfloat start, VGfloat end, VGfloat t) - { - return start * (1.0f - t) + end * t; - } - -// --------------------------------------------------------------------------- -// HgVgHelper::Abs() -// --------------------------------------------------------------------------- -// -VGfloat Abs(VGfloat value) - { - return (value < 0) ? -value : value; - } - -// --------------------------------------------------------------------------- -// HgVgHelper::CalculateBoudingRect() -// --------------------------------------------------------------------------- -// -void CalculateBoundingRect(TRect& aRect, VGfloat* aPoints, TInt aNumPoints, - const TRect& aWindowRect) - { - TInt height = aWindowRect.Height(); - - TPoint min((TInt)aPoints[0], height - (TInt)aPoints[1]); - TPoint max((TInt)aPoints[0], height - (TInt)aPoints[1]); - - for (TInt i = 0; i < aNumPoints; i++) - { - - TPoint temp((TInt)aPoints[i*2+0], height - (TInt)aPoints[i*2+1]); - - min.iX = (temp.iX < min.iX) ? temp.iX : min.iX; - max.iX = (temp.iX > max.iX) ? temp.iX : max.iX; - - min.iY = (temp.iY < min.iY) ? temp.iY : min.iY; - max.iY = (temp.iY > max.iY) ? temp.iY : max.iY; - - } - - // Top Left - aRect.iTl = min; - - // Bottom Right - aRect.iBr = max; - - } - -void TVertex::ProjectPoint(VGfloat aScreenWidth, VGfloat aScreenHeight, VGfloat aFov) - { - VGfloat hw = aScreenWidth * 0.5f; - VGfloat hh = aScreenHeight * 0.5f; - VGfloat alpha = aFov / 2.0f; - double tanAlpha; - Math::Tan(tanAlpha, alpha); - VGfloat d = hw / tanAlpha; - iScreenX = (VGfloat)(hw + d * iTx / iTz); - iScreenY = (VGfloat)(hh + d * iTy / iTz); - } - -void TVertex::TransformPoint(const TMatrix& aMatrix) - { - iTx = iX * aMatrix.iM[0][0] + iY * aMatrix.iM[1][0] + iZ * aMatrix.iM[2][0] + aMatrix.iM[3][0]; - iTy = iX * aMatrix.iM[0][1] + iY * aMatrix.iM[1][1] + iZ * aMatrix.iM[2][1] + aMatrix.iM[3][1]; - iTz = iX * aMatrix.iM[0][2] + iY * aMatrix.iM[1][2] + iZ * aMatrix.iM[2][2] + aMatrix.iM[3][2]; - } - -TMatrix::TMatrix() - { - } - -TMatrix::TMatrix(const TMatrix& rhs) - { - (*this) = rhs; - } - -TMatrix::~TMatrix() - { - } - -TMatrix& TMatrix::operator=(const TMatrix& rhs) - { - for (int i = 0; i < 4; ++i) - { - for (int j = 0; j < 4; ++j) - { - iM[i][j] = rhs.iM[i][j]; - } - } - return *this; - } - -void TMatrix::Identity() - { - iM[0][0] = 1.0f; - iM[0][1] = 0.0f; - iM[0][2] = 0.0f; - iM[0][3] = 0.0f; - - iM[1][0] = 0.0f; - iM[1][1] = 1.0f; - iM[1][2] = 0.0f; - iM[1][3] = 0.0f; - - iM[2][0] = 0.0f; - iM[2][1] = 0.0f; - iM[2][2] = 1.0f; - iM[2][3] = 0.0f; - - iM[3][0] = 0.0f; - iM[3][1] = 0.0f; - iM[3][2] = 0.0f; - iM[3][3] = 1.0f; - } - - -void TMatrix::Multiply(const TMatrix& rhs) - { - VGfloat temp[4][4]; - for (int i = 0; i < 4; ++i) - { - for (int j = 0; j < 4; ++j) - { - temp[i][j] = - iM[i][0] * rhs.iM[0][j] + - iM[i][1] * rhs.iM[1][j] + - iM[i][2] * rhs.iM[2][j] + - iM[i][3] * rhs.iM[3][j]; - } - } - for (int i = 0; i < 4; ++i) - { - for (int j = 0; j < 4; ++j) - { - iM[i][j] = temp[i][j]; - } - } - } - - -void TMatrix::RotationX(VGfloat angle) - { - double sa, ca; - Math::Sin(sa, angle); - Math::Cos(ca, angle); - - iM[0][0] = 1.0f; - iM[0][1] = 0.0f; - iM[0][2] = 0.0f; - iM[0][3] = 0.0f; - - iM[1][0] = 0.0f; - iM[1][1] = ca; - iM[1][2] = sa; - iM[1][3] = 0.0f; - - iM[2][0] = 0.0f; - iM[2][1] = -sa; - iM[2][2] = ca; - iM[2][3] = 0.0f; - - iM[3][0] = 0.0f; - iM[3][1] = 0.0f; - iM[3][2] = 0.0f; - iM[3][3] = 1.0f; - } - - -void TMatrix::RotationY(float angle) - { - double sa, ca; - Math::Sin(sa, angle); - Math::Cos(ca, angle); - - iM[0][0] = ca; - iM[0][1] = 0.0f; - iM[0][2] = -sa; - iM[0][3] = 0.0f; - - iM[1][0] = 0.0f; - iM[1][1] = 1.0f; - iM[1][2] = 0.0f; - iM[1][3] = 0.0f; - - iM[2][0] = sa; - iM[2][1] = 0.0f; - iM[2][2] = ca; - iM[2][3] = 0.0f; - - iM[3][0] = 0.0f; - iM[3][1] = 0.0f; - iM[3][2] = 0.0f; - iM[3][3] = 1.0f; - } - -void TMatrix::Scale(VGfloat aSx, VGfloat aSy, VGfloat aSz) - { - Identity(); - iM[0][0] = aSx; - iM[1][1] = aSy; - iM[2][2] = aSz; - } - -void TMatrix::Translation(VGfloat aX, VGfloat aY, VGfloat aZ) -{ - Identity(); - - iM[3][0] = aX; - iM[3][1] = aY; - iM[3][2] = aZ; -} - - -// --------------------------------------------------------------------------- -// HgVgHelper::ComputeRotationMatrixByY -// --------------------------------------------------------------------------- -// -void ComputeRotationMatrixByY(VGfloat* matrix, VGfloat angle) - { - // Build rotation matrix around Y-axis - double sinrad, cosrad; - Math::Sin (sinrad, angle ); - Math::Cos (cosrad, angle ); - VGfloat sa = sinrad; - VGfloat ca = cosrad; - - VGfloat rotMatrix[] = - { - ca, 0, sa, - 0, 1, 0, - sa, 0, -ca - }; - - // copy to result. - for (int i = 0; i < 9; i++ ) - matrix[i] = rotMatrix[i]; - } - - -// --------------------------------------------------------------------------- -// HgVgHelper::MultiplyMatrix() -// --------------------------------------------------------------------------- -// -void MultiplyMatrix(VGfloat* aResult, VGfloat* aA, VGfloat* aB) - { - for (VGint i = 0; i < 3; ++i) - { - for (VGint j = 0; j < 3; ++j) - { - aResult[i*3+j] = - aA[j*3+0] * aB[i*3+0] + - aA[j*3+1] * aB[i*3+1] + - aA[j*3+2] * aB[i*3+2]; - } - } - } - - -// --------------------------------------------------------------------------- -// HgVgHelper::TransformVertex -// --------------------------------------------------------------------------- -// -void TransformVertex(const VGfloat* inVertex, VGfloat* outVertex, - const VGfloat* matrix) - { - VGfloat x = inVertex[KVertexX]; - VGfloat y = inVertex[KVertexY]; - VGfloat z = inVertex[KVertexZ]; - - outVertex[KVertexX] = x * matrix[0] + y * matrix[3] + z * matrix[6]; - outVertex[KVertexY] = x * matrix[1] + y * matrix[4] + z * matrix[7]; - outVertex[KVertexZ] = x * matrix[2] + y * matrix[5] + z * matrix[8]; - } - -// --------------------------------------------------------------------------- -// HgVgHelper::PerspectiveTransformVertex -// --------------------------------------------------------------------------- -// -void PerspectiveTransformVertex(VGfloat* aInVertex, VGfloat* aOutVertex, - VGfloat aScreenWidth, VGfloat aScreenHeight, VGfloat aFov) - { -/* VGfloat x = inVertex[KVertexX]; - VGfloat y = inVertex[KVertexY]; - VGfloat z = inVertex[KVertexZ]; - - outVertex[KVertexX] = screenWidth * 0.5f + fov * x / z; - outVertex[KVertexY] = screenHeight * 0.5f + fov * y / z; -*/ - VGfloat hw = aScreenWidth * 0.5f; - VGfloat hh = aScreenHeight * 0.5f; - VGfloat alpha = aFov / 2.0f; - double tanAlpha; - Math::Tan(tanAlpha, alpha); - VGfloat d = hw / tanAlpha; - aOutVertex[KVertexX] = (VGfloat)(hw + d * aInVertex[KVertexX] / aInVertex[KVertexZ]); - aOutVertex[KVertexY] = (VGfloat)(hh + d * aInVertex[KVertexY] / aInVertex[KVertexZ]); - - } - -// --------------------------------------------------------------------------- -// HgVgHelper::DrawAlphaImage() -// --------------------------------------------------------------------------- -// -void DrawImage(VGImage aImage, - const TPoint& aPos, const TRect& aWindowRect, TBool aCentered) - { - - vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); - vgLoadIdentity(); - - if (!aCentered) - { - vgScale(1, -1); - vgTranslate(aPos.iX, -(aWindowRect.Height() - aPos.iY)); - } - else - { - VGint w = vgGetParameteri(aImage, VG_IMAGE_WIDTH); - VGint h = vgGetParameteri(aImage, VG_IMAGE_HEIGHT); - vgTranslate(aPos.iX, (aWindowRect.Height() - aPos.iY)); - vgScale(1, -1); - vgTranslate(-(VGfloat)w/2,-(VGfloat)h/2); - } - - vgDrawImage(aImage); - - } - -// --------------------------------------------------------------------------- -// HgVgHelper::DrawImageColorized -// --------------------------------------------------------------------------- -// -void DrawImageColorized(VGImage aImage, const TRgb& aColor, - const TPoint& aPos, const TRect& aWindowRect, TBool aCentered) - { - - VGfloat values[] = { 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 }; - - values[0] = (VGfloat)aColor.Red() / KColorByteToFloatFactor; - values[1] = (VGfloat)aColor.Green() / KColorByteToFloatFactor; - values[2] = (VGfloat)aColor.Blue() / KColorByteToFloatFactor; - values[3] = (VGfloat)aColor.Alpha() / KColorByteToFloatFactor; - - vgSetfv(VG_COLOR_TRANSFORM_VALUES, KNumColorTransformValues, values); - vgSeti(VG_COLOR_TRANSFORM, VG_TRUE); - - HgVgHelper::DrawImage(aImage, aPos, aWindowRect, aCentered); - - vgSeti(VG_COLOR_TRANSFORM, VG_FALSE); - } - - - -// --------------------------------------------------------------------------- -// HgVgHelper::CreatePath() -// --------------------------------------------------------------------------- -// -VGPath CreatePath(VGuint aNumSegments, const VGubyte* aSegments, const VGfloat* aPoints) - { - VGPath path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, - 1.0f, 0.0f, 4, 4, (unsigned int)VG_PATH_CAPABILITY_ALL); - - vgAppendPathData(path, aNumSegments, aSegments, aPoints); - - return path; - } - -// --------------------------------------------------------------------------- -// HgVgHelper::CreateColorPaint() -// --------------------------------------------------------------------------- -// -VGPaint CreateColorPaint(const VGfloat* aColor) - { - VGPaint paint = vgCreatePaint(); - - vgSetParameteri(paint, VG_PAINT_TYPE, - VG_PAINT_TYPE_COLOR); - - vgSetParameterfv(paint, VG_PAINT_COLOR, - KNumColorValues, aColor); - - return paint; - } - -// --------------------------------------------------------------------------- -// HgVgHelper::CreateColorPaint() -// --------------------------------------------------------------------------- -// -VGPaint CreateColorPaint(const TRgb& aColor) - { - VGfloat values[4]; - - values[0] = (VGfloat)aColor.Red() / KColorByteToFloatFactor; - values[1] = (VGfloat)aColor.Green() / KColorByteToFloatFactor; - values[2] = (VGfloat)aColor.Blue() / KColorByteToFloatFactor; - values[3] = (VGfloat)aColor.Alpha() / KColorByteToFloatFactor; - - return CreateColorPaint(values); - } - - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgImageCreator.cpp --- a/uifw/ganes/src/HgVgImageCreator.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +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 "HgVgImageCreator.h" -#include "HgVgEGL.h" - -#include -#include -#include -#include -#include -#include - - -static const TUid KUidMySingleton = { 0x100000E9 }; - - -static TAknIconHeader GetNvgIconHeader(HBufC8* aNVGData) - { - // Parse the icon header info from the extended data - TPtr8 IconHeaderPtr((TUint8*)aNVGData->Des().Ptr(), KIconHeaderLength, KIconHeaderLength); - TAknIconHeader iconheader(IconHeaderPtr); - - return iconheader; - } - -static TPtr8 GetNvgDataWithoutHeader(HBufC8* aNVGData) - { - // The rest of the data (after the iconheader) are the OVG drawing instructions - TInt lengthAfterHeader = aNVGData->Length() - KIconHeaderLength; - TPtr8 nvgDataVoidIC((TUint8 *)aNVGData->Des().Ptr() + KIconHeaderLength, lengthAfterHeader, lengthAfterHeader); - - return nvgDataVoidIC; - } - -static HBufC8* ReadNVGDataL(const CFbsBitmap& aBitmap) - { - // Fetch the extended data - aBitmap.BeginDataAccess(); - const TUint32* data = aBitmap.DataAddress(); - TInt dataSize = aBitmap.DataSize(); - TUint8* compressedData = new (ELeave) TUint8[dataSize]; - CleanupStack::PushL(compressedData); - Mem::Copy(compressedData, data, dataSize); - aBitmap.EndDataAccess(ETrue); - - // Create a descriptor out of the extended bitmap data. The iNVGData - // will now contain the direct OpenVG commands - TPtr8 nvgDataPtr(compressedData, dataSize, dataSize); - HBufC8* dataBuf = nvgDataPtr.AllocL(); - - CleanupStack::PopAndDestroy(compressedData); - return dataBuf; - } - -VGImage CHgVgImageCreator::RenderImageFromIconL( const CFbsBitmap* aBitmap ) - { - User::LeaveIfNull(aBitmap); - User::LeaveIfNull(iEGL); - - HBufC8* nvgData = ReadNVGDataL(*aBitmap); - - TSize size = aBitmap->SizeInPixels(); - - VGImage image = vgCreateImage(VG_sARGB_8888_PRE, size.iWidth, size.iHeight,VG_IMAGE_QUALITY_NONANTIALIASED); - - const EGLint KColorAttribList[] = - { - EGL_NONE - }; - - CNvgEngine* nvgEngine = CNvgEngine::NewL(); - CleanupStack::PushL(nvgEngine); - - EGLSurface newSurface = eglCreatePbufferFromClientBuffer( - iEGL->Display(), EGL_OPENVG_IMAGE, - static_cast(image), // Use the image as buffer - iEGL->CurrentConfig(), KColorAttribList ); - - eglMakeCurrent( iEGL->Display(), newSurface, newSurface, iEGL->Context() ); - - vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); - vgLoadIdentity(); - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); - vgLoadIdentity(); - vgSeti(VG_BLEND_MODE, VG_BLEND_SRC_OVER); - vgSeti( VG_SCISSORING, VG_FALSE ); - - - TAknIconHeader iconheader = GetNvgIconHeader(nvgData); - // Set preserve aspect ratio according to the header info - TNvgAlignStatusType alignTypeValue = ENvgPreserveAspectRatio_XmidYmid; - TNvgMeetOrSliceType meetOrSliceTypeValue = ENvgMeet; - if ( iconheader.GetScaleMode() == EAspectRatioPreserved ) - { - - } - else if (iconheader.GetScaleMode() == EAspectRatioPreservedSlice) - { - meetOrSliceTypeValue = ENvgSlice; - } - else if (iconheader.GetScaleMode() == EAspectRatioPreservedAndUnusedSpaceRemoved || - iconheader.GetScaleMode() == EAspectRatioNotPreserved ) - { - alignTypeValue = ENvgPreserveAspectRatio_None; - } - - nvgEngine->SetPreserveAspectRatio(alignTypeValue, meetOrSliceTypeValue); - nvgEngine->Rotate(iconheader.GetRotation(),size.iWidth >>1, size.iHeight >>1); - - nvgEngine->DrawNvg(GetNvgDataWithoutHeader(nvgData), size, NULL, NULL); - - // TODO: Error handling. DrawNvg mey fail icon rendering. - - delete nvgData; - - CleanupStack::PopAndDestroy(nvgEngine); - - // TODO: should we call explicitly vgFlush at this point to force all commands - // complete before eglMakeCurrent? - - eglMakeCurrent(iEGL->Display(), iEGL->Surface(), iEGL->Surface(), iEGL->Context()); - - if ( newSurface != EGL_NO_SURFACE ) - { - eglDestroySurface( iEGL->Display(), newSurface ); - } - - // reset states, and matrices which nvg lefts dirty. - vgSeti( VG_BLEND_MODE, VG_BLEND_SRC_OVER ); - vgSeti( VG_SCISSORING, VG_FALSE ); - vgSeti( VG_MASKING, VG_FALSE ); - vgSeti( VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER ); - vgLoadIdentity(); - vgSeti( VG_MATRIX_MODE, VG_MATRIX_STROKE_PAINT_TO_USER ); - vgLoadIdentity(); - - return image; - - } - -CHgVgImageCreator* CHgVgImageCreator::InstanceL() - { - CHgVgImageCreator* instance = static_cast( CCoeEnv::Static( KUidMySingleton ) ); - - if ( !instance ) - { - instance = new ( ELeave ) CHgVgImageCreator; - CleanupStack::PushL( instance ); - instance->ConstructL(); - CleanupStack::Pop(); - } - - return instance; - } - - -CHgVgImageCreator::CHgVgImageCreator() : CCoeStatic( KUidMySingleton ) - { - } - -CHgVgImageCreator::~CHgVgImageCreator() - { - //delete iNvgEngine; - } - -void CHgVgImageCreator::ConstructL() - { - //iNvgEngine = CNvgEngine::NewL(); - } - -void CHgVgImageCreator::Initialize(CHgVgEGL* aEGL) - { - iEGL = aEGL; - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgItem.cpp --- a/uifw/ganes/src/HgVgItem.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - - -#include -#include - -#include "HgVgHelper.h" - -// ----------------------------------------------------------------------------- -// CHgVgItem::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgVgItem* CHgVgItem::NewL( - TInt aFlags, - CGulIcon* aIcon, - const TDesC& aTitle, - const TDesC& aText ) - { - CHgVgItem* self = CHgVgItem::NewLC( aFlags, aIcon, aTitle, aText ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgItem::NewL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgVgItem* CHgVgItem::NewLC( - TInt aFlags, - CGulIcon* aIcon, - const TDesC& aTitle, - const TDesC& aText ) - { - CHgVgItem* self = new (ELeave) CHgVgItem( aFlags, aIcon ); - CleanupStack::PushL( self ); - self->ConstructL( aTitle, aText ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgItem::~CHgVgItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgVgItem::~CHgVgItem() - { - FreeOpenVgImage(); - } - -// ----------------------------------------------------------------------------- -// CHgVgItem::SetIcon() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgItem::SetIcon( CGulIcon* aIcon, TInt aFlags ) - { - CHgItem::SetIcon(aIcon, aFlags); - ReloadOpenVgImage(); - } - - -// ----------------------------------------------------------------------------- -// CHgVgItem::CHgVgItem() -// ----------------------------------------------------------------------------- -// -CHgVgItem::CHgVgItem( TInt aFlags, CGulIcon* aIcon ) : CHgItem(aFlags, aIcon), - iVgImage( VG_INVALID_HANDLE ) - { - ReloadOpenVgImage(); - } - -// ----------------------------------------------------------------------------- -// CHgVgItem::ConstructL() -// ----------------------------------------------------------------------------- -// -void CHgVgItem::ConstructL( const TDesC& aTitle, const TDesC& aText ) - { - CHgItem::ConstructL(aTitle, aText); - } - -// ----------------------------------------------------------------------------- -// CHgVgItem::VgImage() -// ----------------------------------------------------------------------------- -// -VGImage CHgVgItem::VgImage() const - { - return iVgImage; - } - -// ----------------------------------------------------------------------------- -// CHgVgItem::ReloadOpenVgImage() -// ----------------------------------------------------------------------------- -// -void CHgVgItem::ReloadOpenVgImage() - { - FreeOpenVgImage(); - if( iIcon ) - { - TRAP_IGNORE( iVgImage = HgVgHelper::CreateVgImageFromIconL(*iIcon); ) - } - } - -// ----------------------------------------------------------------------------- -// CHgVgItem::FreeOpenVgImage() -// ----------------------------------------------------------------------------- -// -void CHgVgItem::FreeOpenVgImage() - { - if (iVgImage != VG_INVALID_HANDLE) - { - vgDestroyImage(iVgImage); - iVgImage = VG_INVALID_HANDLE; - } - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgLabel.cpp --- a/uifw/ganes/src/HgVgLabel.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,237 +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 "HgVgLabel.h" -#include "HgVgHelper.h" -#include "HgVgDrawBuffer.h" -#include "HgDrawUtils.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CHgVgTitleRenderer::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgVgLabel* CHgVgLabel::NewL(const TRect& aRect, const CFont* aFont, const TDesC& aText) - { - CHgVgLabel* self = new ( ELeave ) CHgVgLabel(aRect, aFont); - CleanupStack::PushL (self ); - self->ConstructL(aText); - CleanupStack::Pop ( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgTitleRenderer::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgVgLabel::ConstructL (const TDesC& aText) - { - iText = aText.AllocL(); - - iTextRenderer = CHgVgDrawBuffer::NewL(iRect.Size(), EGray2); - - iTextImage = vgCreateImage(VG_A_1, - iRect.Width(), iRect.Height(), - VG_IMAGE_QUALITY_NONANTIALIASED); - - if (iTextImage == VG_INVALID_HANDLE) - { - User::Leave(KErrNoMemory); - } - - // get text color from skin - if ( AknsUtils::AvkonSkinEnabled() ) - { - // this does not modify color unless it gets a correct one - // no real need to check errors - AknsUtils::GetCachedColor( - AknsUtils::SkinInstance(), - iTextColor, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - } - - if (iTextColor.Red() < 128) - { - iShadowColor = KRgbWhite; - } - else - { - iShadowColor = KRgbBlack; - } - - } - -// ----------------------------------------------------------------------------- -// CHgVgTitleRenderer::CHgVgTitleRenderer() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgLabel::CHgVgLabel(const TRect& aRect, const CFont* aFont) : -iRect(aRect), -iFont(aFont), -iTextColor(KRgbDarkGray), -iShadowColor(KRgbBlack), -iDirty(ETrue) - { - - } - -// ----------------------------------------------------------------------------- -// CHgVgTitleRenderer::~CHgVgTitleRenderer() -// Destructor. -// ----------------------------------------------------------------------------- -// -CHgVgLabel::~CHgVgLabel ( ) - { - delete iText; - delete iTextRenderer; - // then parent - vgDestroyImage(iTextImage); - } - -// ----------------------------------------------------------------------------- -// CHgVgLabel::SetText() -// ----------------------------------------------------------------------------- -// -void CHgVgLabel::SetTextL(const TDesC& aText) - { - if (aText != *iText) - { - delete iText; - iText = 0; - iText = aText.AllocL(); - iDirty = ETrue; - } - } - -// ----------------------------------------------------------------------------- -// CHgVgLabel::SetFont() -// ----------------------------------------------------------------------------- -// -void CHgVgLabel::SetFont(const CFont* aFont) - { - if (aFont != iFont) - { - iFont = aFont; - iDirty = ETrue; - } - } - -// ----------------------------------------------------------------------------- -// CHgVgLabel::SetColor() -// ----------------------------------------------------------------------------- -// -void CHgVgLabel::SetColor(const TRgb& aColor) - { - iTextColor = aColor; - } - -// ----------------------------------------------------------------------------- -// CHgVgLabel::SetColor() -// ----------------------------------------------------------------------------- -// -void CHgVgLabel::SetShadowColor(const TRgb& aColor) - { - iShadowColor = aColor; - } - -// ----------------------------------------------------------------------------- -// CHgVgLabel::Draw() -// ----------------------------------------------------------------------------- -// -void CHgVgLabel::Draw(const TRect& aWindowRect, TReal aAlpha) - { - if (iDirty) - { - Update(); - iDirty = EFalse; - } - - TRgb color = iTextColor; - color.SetAlpha(255.0f * aAlpha); - TRgb shadowColor = iShadowColor; - shadowColor.SetAlpha(255.0f * aAlpha); - - //HgVgHelper::DrawImageColorized(iTextImage, shadowColor, iRect.iTl+TPoint(1,1), aWindowRect); - HgVgHelper::DrawImageColorized(iTextImage, color, iRect.iTl, aWindowRect); - } - -// ----------------------------------------------------------------------------- -// CHgVgLabel::Update() -// ----------------------------------------------------------------------------- -// -void CHgVgLabel::Update() - { - iTextRenderer->Clear(iRect.Size(), KRgbBlack); -/* iTextRenderer->Gc().SetPenColor(KRgbWhite); - - iTextRenderer->Gc().UseFont(iFont); - iTextRenderer->Gc().DrawText(*iText, TPoint( - iRect.Width() / 2 - iFont->TextWidthInPixels(*iText) / 2, - iFont->HeightInPixels())); -*/ - TAknLayoutText text; - - text.LayoutText(iParentRect, iLayout); - text.DrawText(iTextRenderer->Gc(), *iText, ETrue, KRgbWhite); - - iTextRenderer->GetDrawBufferToVgImage(TRect(TPoint(0,0), iRect.Size()), - TPoint(0, 0), iTextImage, VG_A_1); - } - - -void CHgVgLabel::SetLayout(const TAknTextComponentLayout& aLayout, const TRect& aParentRect) - { - iLayout = aLayout; - iLayout.Sett(0); - iLayout.Setl(0); - iParentRect = aParentRect; - } - -void CHgVgLabel::DrawEmptyText(const TRect& aClientRect, const TDesC& aText) - { - iTextRenderer->Clear(iRect.Size(), KRgbBlack); - DrawEmptyListImpl_real(aClientRect, iTextRenderer->Gc(), aText, KRgbWhite); - iTextRenderer->GetDrawBufferToVgImage(TRect(TPoint(0,0), iRect.Size()), - TPoint(0, 0), iTextImage, VG_A_1); - iDirty = EFalse; - Draw(aClientRect, 1.0f); - } - - - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgLetterPopup.cpp --- a/uifw/ganes/src/HgVgLetterPopup.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,222 +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 "HgVgLetterPopup.h" -#include "HgVgDrawBuffer.h" -#include "HgVgHelper.h" -#include -#include -#include - - - -const VGfloat KLetterStripColor[] = { 0.2f, 0.2f, 0.2f, 0.8f }; -const VGfloat KLetterStripCurviness(10); - - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CHgVgPopup::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgVgPopup* CHgVgPopup::NewL( const TRect& aRect, const CFont* aFont ) - { - CHgVgPopup* self = new ( ELeave ) CHgVgPopup( aRect, aFont ); - CleanupStack::PushL (self ); - self->ConstructL( ); - CleanupStack::Pop ( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgPopup::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgVgPopup::ConstructL ( ) - { - iPrevText = ((TDesC)KNullDesC).AllocL(); - - iDrawBuffer = CHgVgDrawBuffer::NewL(iRect.Size(), EGray2); - - iDrawBuffer->Gc().UseFont(iFont); - iDrawBuffer->Gc().SetPenColor(KRgbWhite); - iDrawBuffer->Gc().SetBrushColor(KRgbBlack); - - // Create VG Image to use - iLetterImage = vgCreateImage(VG_A_1, - iRect.Width(), iRect.Height(), - VG_IMAGE_QUALITY_NONANTIALIASED); - - VGErrorCode error = vgGetError(); - - if (iLetterImage == VG_INVALID_HANDLE || error == VG_OUT_OF_MEMORY_ERROR) - { - User::Leave(KErrNoMemory); - } - - iLetterBgPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, - 1.0f, 0.0f, 4, 4, (unsigned int)VG_PATH_CAPABILITY_ALL); - - vguRoundRect(iLetterBgPath, 0, 0, iRect.Width(), - iRect.Height(), KLetterStripCurviness, KLetterStripCurviness); - - iLetterBgPaint = vgCreatePaint(); - - vgSetParameteri(iLetterBgPaint, VG_PAINT_TYPE, - VG_PAINT_TYPE_COLOR); - - vgSetParameterfv(iLetterBgPaint, VG_PAINT_COLOR, 4, KLetterStripColor); - - } - -// ----------------------------------------------------------------------------- -// CHgVgPopup::CHgVgPopup() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgPopup::CHgVgPopup( const TRect& aRect, const CFont* aFont) : -iRect(aRect), -iFont(aFont) - { - - - } - -// ----------------------------------------------------------------------------- -// CHgVgPopup::~CHgVgLetterStrip() -// Destructor. -// ----------------------------------------------------------------------------- -// -CHgVgPopup::~CHgVgPopup ( ) - { - - delete iDrawBuffer; - - delete iPrevText; - - vgDestroyImage(iLetterImage); - - vgDestroyPath(iLetterBgPath); - vgDestroyPaint(iLetterBgPaint); - - } - -// ----------------------------------------------------------------------------- -// CHgVgPopup::SetLetter() -// ----------------------------------------------------------------------------- -// -void CHgVgPopup::SetTextL(const TDesC& aText) - { - User::LeaveIfNull(iPrevText); - if (*iPrevText != aText) - { - delete iPrevText; - iPrevText = 0; - iPrevText = aText.AllocL(); - iDrawBuffer->Clear(iRect.Size(), KRgbBlack); - - TAknLayoutText layout; - layout.LayoutText(iParentRect, iTextLayout); - layout.DrawText(iDrawBuffer->Gc(), aText, ETrue, KRgbWhite); - -/* TInt width = iFont->TextWidthInPixels(aText); - TInt height = iFont->HeightInPixels(); - TPoint pos(iRect.Width() / 2 - width / 2, - iRect.Height() / 2 + height / 2); - iDrawBuffer->DrawText(aText, iFont, KRgbWhite, pos);*/ - iDrawBuffer->GetDrawBufferToVgImage(iRect.Size(), TPoint(0,0), iLetterImage, VG_A_1); - } - } - -// ----------------------------------------------------------------------------- -// CHgVgPopup::SetTexts() -// ----------------------------------------------------------------------------- -// -void CHgVgPopup::SetTexts(const TDesC& aText1, const TDesC& aText2) - { - iDrawBuffer->Clear(iRect.Size(), KRgbBlack); - TInt w1 = iFont->TextWidthInPixels(aText1); - TInt w2 = iFont->TextWidthInPixels(aText2); - TInt height = iFont->HeightInPixels(); - TPoint pos(iRect.Width() / 2 - w1 / 2, iRect.Height() / 2); - iDrawBuffer->Gc().DrawText(aText1, pos); - pos.iY += height; - pos.iX = iRect.Width() / 2 - w2 / 2; - iDrawBuffer->Gc().DrawText(aText2, pos); - iDrawBuffer->GetDrawBufferToVgImage(iRect.Size(), TPoint(0,0), iLetterImage, VG_A_1); - } - -// ----------------------------------------------------------------------------- -// CHgVgPopup::Draw() -// ----------------------------------------------------------------------------- -// -void CHgVgPopup::Draw(const TRect& aWindowRect, TReal aAlpha) - { - - VGfloat w = iRect.Width(); - VGfloat h = iRect.Height(); - - TRgb color; - AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), - color, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - - TRgb bgColor(KRgbWhite); - if (color.Blue() > 128) - { - bgColor = KRgbBlack; - } - - // draw background - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); - vgLoadIdentity(); - - vgTranslate(iRect.iTl.iX, (aWindowRect.Height() - iRect.iBr.iY)); - - VGfloat bgv[4]; - bgv[0] = (VGfloat)bgColor.Red() / 255.0f; - bgv[1] = (VGfloat)bgColor.Green() / 255.0f; - bgv[2] = (VGfloat)bgColor.Blue() / 255.0f; - bgv[3] = aAlpha; - vgSetParameterfv(iLetterBgPaint, VG_PAINT_COLOR, 4, bgv); - - vgSetPaint(iLetterBgPaint, VG_FILL_PATH); - vgDrawPath(iLetterBgPath, VG_FILL_PATH); - - // draw letter - color.SetAlpha(aAlpha * 255.0f); - HgVgHelper::DrawImageColorized(iLetterImage, - color, iRect.iTl, aWindowRect, EFalse); - } - -void CHgVgPopup::SetLayouts(const TAknWindowComponentLayout& aPopupLayout, - const TAknTextComponentLayout& aTextLayout, const TRect& aParentRect) - { - iPopupLayout = aPopupLayout; - iTextLayout = aTextLayout; - iTextLayout.Setl(0); - iTextLayout.Sett(0); - iParentRect = aParentRect; - } - - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgMediaWall.cpp --- a/uifw/ganes/src/HgVgMediaWall.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2495 +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 -#include - -#include "HgVgDrawBuffer.h" -#include "HgVgScrollBar.h" -#include "HgVgHelper.h" -#include "HgVgMediaWallRenderer.h" -#include "HgVgSkinRenderer.h" -#include "HgVgTimer.h" -#include "HgVgLetterPopup.h" -#include "HgVgButton.h" -#include "HgVgLabel.h" -#include "HgVgEGL.h" -#include "HgVgSpring.h" -#include "HgVgImageCreator.h" -#include "HgPopupDrawer.h" - -#include -#include -#include -#include -#include "HgScrollbar.h" -#include "HgScrollBufferManager.h" -#include "HgConstants.h" -#include "HgVgConstants.h" -#include -//#include -#include -#include -#include -#include -#include // Abs - -#include - -#include -#include -#include -#include -#include -#include -#include - - - -using namespace AknTouchGestureFw; -using namespace HgVgConstants; - -const TInt KMediaWallFullScreenItemsOnScreen(5); -const TReal KMediaWallFullScreenCameraZoomFactor(1.5); -const TReal KMediaWallFullScreenCameraRotationFactor(KCameraRotationFactor * 2); -const TReal KMediaWallFullScreenSpringVelocityToAnimationFactor(KSpringVelocityToAnimationFactor / 2); -const TReal KMediaWallFullScreenZOffset(1); -const TInt KMediaWallFullScreenRowCount(1); -const TReal KMediaWallFullScreenSpringK(KSpringK); -const TReal KMediaWallFullScreenSpringDamping(KSpringDamping); -const TReal KMediaWallFullScreenSpringMaxVelocity(KMaxSpringVelocity); -const TReal KMediaWallFullScreenItemsToMoveOnFullScreenDrag(5); - -const TInt KMediaWallTBoneItemsOnScreen(3); -const TReal KMediaWallTBoneCameraZoomFactor(2); -const TReal KMediaWallTBoneCameraRotationFactor(KCameraRotationFactor); -const TReal KMediaWallTBoneSpringVelocityToAnimationFactor(KSpringVelocityToAnimationFactor); -const TInt KMediaWallTBonePopupFontSize(100); -const TInt KMediaWallTBoneLabelFontSize(18); -const TReal KMediaWallTBoneZOffset(0.5); -const TInt KMediaWallTBoneRowCount(1); -const TReal KMediaWallTBoneSpringK(KSpringK); -const TReal KMediaWallTBoneSpringDamping(KSpringDamping); -const TReal KMediaWallTBoneSpringMaxVelocity(KMaxSpringVelocity); -const TReal KMediaWallTBoneItemsToMoveOnFullScreenDrag(3); - -const TInt KMediaWallGridItemsOnScreen(3*10); -const TReal KMediaWallGridCameraZoomFactor(0.2); -const TReal KMediaWallGridCameraRotationFactor(KCameraRotationFactor); -const TReal KMediaWallGridSpringVelocityToAnimationFactor(KSpringVelocityToAnimationFactor/3); -const TInt KMediaWallGridPopupFontSize(30); -const TReal KMediaWallGridZOffset(0.5); -const TInt KMediaWallGridRowCount(3); -const TReal KMediaWallGridSpringK(KSpringK); -const TReal KMediaWallGridSpringDamping(KSpringDamping*2); -const TReal KMediaWallGridSpringMaxVelocity(KMaxSpringVelocity/3); -const TReal KMediaWallGridItemsToMoveOnFullScreenDrag(15); - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CHgMediaWall::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgVgMediaWall* CHgVgMediaWall::NewL( - const TRect& aRect, - TInt aItemCount, - THgVgMediaWallStyle aStyle, - TBool aScrollBarEnabled, - MObjectProvider* aParent, - CGulIcon* aDefaultIcon ) - { - CHgVgMediaWall* self = new ( ELeave ) CHgVgMediaWall( - aItemCount, - aDefaultIcon, aStyle, aScrollBarEnabled ); - - CleanupStack::PushL (self ); - self->ConstructL( aRect, aParent ); - CleanupStack::Pop (self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::ConstructL (const TRect& aRect, MObjectProvider* aParent ) - { - iPopupText1.CreateL( KMaxPopupTextLength ); - iPopupText2.CreateL( KMaxPopupTextLength ); - - iSpring = new (ELeave) THgVgSpring(KSpringK, KSpringDamping, - KMaxSpringVelocity, KPositionSnap, KMinSpringVelocity); - - iSpring->Reset(0,0); - - iAnimationTimer = CHgVgTimer::NewL(); - - iKeyScrollingTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - - SetEmptyTextL(KNullDesC); - - // Create a window for this application view - CreateWindowL ( ); - - EnableDragEvents(); - - ClaimPointerGrab(); - - InitScreenL( aRect ); - - InitItemsL(); - - HandleViewPositionChanged(ETrue); - - iCoeEnv->AddForegroundObserverL( *this ); - - // setup Avkon gesture framework. - iTouchFw = AknTouchGestureFw::CAknTouchGestureFw::NewL(*this, *this); - iTouchFw->SetGestureInterestL(AknTouchGestureFw::EAknTouchGestureFwGroupDrag | - AknTouchGestureFw::EAknTouchGestureFwGroupTap | - AknTouchGestureFw::EAknTouchGestureFwGroupFlick); - - ActivateL ( ); - - SetMopParent( aParent ); - - // skin needs to be updated after parent is set. - iSkinRenderer->UpdateSkinL(this, this); - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::InitScreenL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::InitScreenL( const TRect& aRect ) - { - // Set the windows size - SetRect ( aRect ); - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::RefreshScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::RefreshScreen( TInt aIndex ) - { - - if( !iIsForeground ) - { - return; - } - - if( !iAnimationTimer->IsActive() ) - { - if( /*iMediaWallStyle == EHgVgMediaWallStyleGrid ||*/ - (aIndex >= FirstIndexOnScreen() && aIndex <= FirstIndexOnScreen() + ItemsOnScreen()) ) - { - - UpdateLabelsAndPopup(); - if(iFlags & EHgVgMediaWallDrawToWindowGC) - { - DrawNow(); - } - else - { - DrawOpenVG(); - } - - } - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::FirstIndexOnScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgVgMediaWall::FirstIndexOnScreen() - { - return iBufferPosition - iItemsOnScreen / 2; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::RefreshScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgVgMediaWall::ItemsOnScreen() - { - return iItemsOnScreen; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::RefreshScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgVgMediaWall::SelectedIndex() - { - return iSelectedIndex * iRowCount; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::RefreshScreen() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetSelectedIndex( TInt aIndex ) - { - if( aIndex >= 0 && aIndex < iItems.Count() ) - { - iUpdateScrollBar = ETrue; - iSpring->Reset(aIndex / iRowCount, iSpring->EndY()); - HandleViewPositionChanged(ETrue); - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::EnableScrollBufferL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::EnableScrollBufferL( - MHgScrollBufferObserver& aObserver, - TInt aBufferSize, - TInt aBufferTreshold ) - { - - delete iManager; - iManager = NULL; - - iManager = CHgScrollBufferManager::NewL( - aObserver, - aBufferSize, - aBufferTreshold, - (TInt)iSpring->GetX() * iRowCount, - iItemCount); - - iManager->SetBufferOwner( *this ); - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SetSelectionObserver() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetSelectionObserver( MHgSelectionObserver& aObserver ) - { - iSelectionObserver = &aObserver; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::CHgVgMediaWall() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgMediaWall::CHgVgMediaWall( - TInt aItemCount, - CGulIcon* aDefaultIcon, - THgVgMediaWallStyle aStyle, - TBool aEnableScrollBar) : - iItemCount(aItemCount), - iItemsOnScreen(KMaxCoversVisible), - iDefaultIcon( aDefaultIcon ), - iAnimationState(EHgVgMediaWallAnimationStateIdle), - iScrollBarEnabled(aEnableScrollBar), - iMediaWallStyle(aStyle), - iOpeningAnimationType(CHgVgMediaWall::EHgVgOpeningAnimationFlipToFront), - iIsForeground(ETrue), - iUsingDefaultIcon(ETrue), - iRowCount(1), - iCameraRotationFactor(KCameraRotationFactor), - iCameraZoomFactor(KCameraZoomFactor), - iSpringVelocityToAnimationFactor(KSpringVelocityToAnimationFactor), - iPrevGridItem(KErrNotFound), - iSelGridItem(KErrNotFound) - // other intialized to 0 or EFalse - { - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::~CHgVgMediaWall() -// Destructor. -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgVgMediaWall::~CHgVgMediaWall ( ) - { - - if (iAnimationTimer->IsActive()) - iAnimationTimer->Cancel(); - - iItems.ResetAndDestroy(); - - iCoeEnv->RemoveForegroundObserver( *this ); - - if(MTouchFeedback::Instance()) - { - MTouchFeedback::Instance()->RemoveFeedbackArea(this, 0); - } - - delete iEmptyLabel; - delete iTouchFw; - delete iEmptyText; - delete iSkinRenderer; - delete iAlbumLabel; - delete iArtistLabel; - delete iRenderer; - delete iScrollBar; - delete iDefaultIcon; - delete iManager; - delete iKeyScrollingTimer; - delete iAnimationTimer; - delete iLetterPopup; - //delete iCompositionSource; - delete iEGL; - delete iSpring; - delete iSurfaceBitmap; - - iPopupText1.Close(); - iPopupText2.Close(); - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::Style() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgVgMediaWall::THgVgMediaWallStyle CHgVgMediaWall::Style() const - { - return iMediaWallStyle; - } - - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::OpeningAnimationType() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgVgMediaWall::THgVgOpeningAnimationType CHgVgMediaWall::OpeningAnimationType() const - { - return iOpeningAnimationType; - } - - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::Draw() -// Draws the display. -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::Draw ( const TRect& /*aRect*/ ) const - { - RDebug::Print(_L("CHgVgMediaWall::Draw begin")); - - CHgVgMediaWall* self = const_cast(this); - - if (iIsForeground) - { - if( iFlags & EHgVgMediaWallDrawToWindowGC ) - { - CFbsBitmap* screenshot = NULL; - screenshot = self->DrawToBitmap(); - if (screenshot) - { - SystemGc().BitBlt( Rect().iTl,screenshot ); - delete screenshot; - } - else - { - SystemGc().SetBrushColor(KRgbRed); - SystemGc().Clear(); - } - } - else - { - - // draw with alpha to make a hole to composition layer - SystemGc().SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); - SystemGc().SetBrushColor(TRgb(0,0,0,0)); - SystemGc().Clear(); - - DrawOpenVG(); - } - } - else - { - if (iSurfaceBitmap) - { - RDebug::Print(_L("CHgVgMediaWall::Draw blit screenshot")); - - SystemGc().BitBlt( Rect().iTl, iSurfaceBitmap ); - } - else - { - RDebug::Print(_L("CHgVgMediaWall::Draw clear red")); - - // we should not get here, ever - // still, clear with red color for debug purposes - SystemGc().SetBrushColor(KRgbRed); - SystemGc().Clear(); - } - } - - RDebug::Print(_L("CHgVgMediaWall::Draw end")); - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SizeChanged() -// Called by framework when the view size is changed. -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::SizeChanged ( ) - { - - iRect = Rect(); - TRAPD(error, InitRenderingL(ETrue)); - if( error != KErrNone ) - { - // if out of memory - if (error == KErrNoMemory) - { - // free all resources - FreeItemsImages(); - // try again - TRAPD(error, InitRenderingL(ETrue)); - // if still fails, need to give up - if (error != KErrNone) - { - User::Panic(_L("USER"), error); - } - // reload all images we can - ReloadItemsImages(); - } - else - { - // some other error occured during initialization - // TODO: should we try again? - User::Panic(_L("USER"), error); - } - } - - if(MTouchFeedback::Instance()) - { - MTouchFeedback::Instance()->SetFeedbackArea(this, - 0, - iRect, - ETouchFeedbackBasic, - ETouchEventStylusDown); - } - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::ChangeStyleL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::ChangeStyleL( THgVgMediaWallStyle aStyle, const TRect& aRect, TBool /*aReuseSurface*/ ) - { - - // If animation is on, stop it before changing style. - HandleTransitionAnimationStop(); - - iMediaWallStyle = aStyle; - - iAnimationState = EHgVgMediaWallAnimationStateIdle; - - // TODO: if (!aReUseSurface...) - - InitScreenL( aRect ); - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::HandleItemCountChaged() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleItemCountChanged() - { - - TRAP_IGNORE( InitScrollBarL(ETrue); ) - - if( iSelectedIndex >= MaxViewPosition() ) - { - iSpring->Reset((TReal)(MaxViewPosition()-1), 0); - HandleViewPositionChanged(); - } - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::HandlePointerEventL() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandlePointerEventL( const TPointerEvent& aEvent ) - { - - if (iAnimationState != EHgVgMediaWallAnimationStateItemOpened) - { - - // handle buttons - iButtonsHit = HandleButtons(aEvent); - - if (iScrollBar && iScrollBar->HandlePointerEventL(aEvent)) - { - iScrollBarHit = ETrue; - } - - if (aEvent.iType == TPointerEvent::EButton1Up) - { - iScrollBarHit = EFalse; - } - - - } - - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::OfferKeyEventL() -// ----------------------------------------------------------------------------- -// -TKeyResponse CHgVgMediaWall::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ) - { - if (iIsForeground) - { - switch( aType ) - { - case EEventKeyDown: - HandleKeyDown(); - break; - case EEventKey: - return HandleKeyEvent( aKeyEvent ); - case EEventKeyUp: - HandleKeyUp(); - break; - default: - break; - } - } - - // Let CCoeControl handle other cases. - return CCoeControl::OfferKeyEventL( aKeyEvent, aType ); - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SetItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetItem(CHgVgItem* aItem, TInt aIndex) - { - if( aItem && aIndex >= 0 && aIndex < iItems.Count() ) - { - delete iItems[aIndex]; - iItems[aIndex] = aItem; - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::AddItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::AddItem(CHgVgItem* aItem) - { - if( aItem ) - { - iItems.Append(aItem); - iItemCount++; - HandleItemCountChanged(); - if( iManager ) - { - iManager->ItemCountChanged( iItemCount-1, EFalse, iItemCount ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::InsertItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::InsertItem(CHgVgItem* aItem, TInt aIndex) - { - if( aItem && aIndex >= 0 ) - { - if(aIndex < iItems.Count()) - { - iItems.Insert(aItem, aIndex); - } - else - { - iItems.Append(aItem); - } - - iItemCount++; - HandleItemCountChanged(); - - if( iManager ) - { - iManager->ItemCountChanged( aIndex, EFalse, iItemCount ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::RemoveItem() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::RemoveItem(TInt aIndex) - { - if( aIndex >= 0 && aIndex < iItems.Count() ) - { - delete iItems[aIndex]; - iItems[aIndex] = NULL; - iItems.Remove(aIndex); - iItemCount--; - - HandleItemCountChanged(); - - if( iManager ) - { - iManager->ItemCountChanged( aIndex, ETrue, iItemCount ); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::ResizeL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::ResizeL( TInt aItemCount ) - { - // Add More - if( iItems.Count() < aItemCount ) - { - while( iItems.Count() < aItemCount ) - { - iItems.AppendL( CHgVgItem::NewL() ); - } - } - // remove from the end - else if( iItems.Count() > aItemCount ) - { - while( iItems.Count() > aItemCount ) - { - delete iItems[iItems.Count() - 1]; - iItems.Remove( iItems.Count() - 1 ); - } - } - else - { - return; // no change needed - } - - iItemCount = aItemCount; - - if( iManager ) - { - iManager->ResetBuffer( iSelectedIndex, iItemCount ); - } - - HandleItemCountChanged(); - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::ItemL() -// ----------------------------------------------------------------------------- -// -EXPORT_C CHgVgItem& CHgVgMediaWall::ItemL(TInt aIndex) - { - if( aIndex < 0 || aIndex >= iItems.Count() ) - { - User::Leave( KErrArgument ); - } - - return *iItems[aIndex]; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::HandleViewPositionChanged() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleViewPositionChanged(TBool aDontUpdateObserver) - { - // save previous index - TInt prevIndex = iSelectedIndex; - - // calculate new selected index - TReal frac; - Math::Frac(frac, iSpring->GetX()); - iSelectedIndex = (frac > 0.5f) ? iSpring->GetX() + 1 : iSpring->GetX(); - - // limit index to items - if (iSelectedIndex < 0) - iSelectedIndex = 0; - else if (iSelectedIndex >= MaxViewPosition()) - iSelectedIndex = MaxViewPosition() - 1; - - // if index has changed - if (iSelectedIndex != prevIndex) - { - // update titles - UpdateLabelsAndPopup(); - - // update scrollbar if needed - if (iUpdateScrollBar && iScrollBar) - iScrollBar->SetViewPosition(TPoint((TInt)iSelectedIndex, 0)); - - } - - // inform observer if needed - if (iMediaWallStyle != EHgVgMediaWallStyleGrid && - (iItems.Count() > 0 && iSelectionObserver && !aDontUpdateObserver && !iPointerDown)) - { - TRAP_IGNORE(iSelectionObserver->HandleSelectL(iSelectedIndex, this);) - } - - // update scroll buffer manager position - TInt newCol = (TInt)iSpring->GetX() * iRowCount; - if( newCol != iBufferPosition ) - { - iBufferPosition = newCol; - if( iManager ) - { - iManager->SetPosition((TInt)iBufferPosition); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::HandleKeyDown() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleKeyDown() - { - iKeyRepeats = 0; - iKeyScrollingState = ENoKeyScrolling; - iPointerDown = EFalse; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::HandleKeyEvent() -// ----------------------------------------------------------------------------- -// -TKeyResponse CHgVgMediaWall::HandleKeyEvent(const TKeyEvent& aKeyEvent) - { - iKeyRepeats++; - - TKeyScrollingState possibleKeyScrollingState = ENoKeyScrolling; - - TBool handled = EFalse; - - // handle input - switch( aKeyEvent.iCode ) - { - case EKeyUpArrow: - { - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - - TInt posY = (TInt)iSpring->EndY(); - TInt posX = (TInt)iSpring->EndX(); - - posY--; - if (posY < 0) - { - if (posX > 0) - { - posX--; - posY = iRowCount - 1; - } - else - { - posY = 0; - } - } - - BeginSelection(posX * iRowCount + posY); - - possibleKeyScrollingState = EKeyScrollingUp; - handled = ETrue; - } - - } break; - case EKeyDownArrow: - { - - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - - TInt posY = (TInt)iSpring->EndY(); - TInt posX = (TInt)iSpring->EndX(); - - posY++; - if (posY >= iRowCount) - { - if (posX < MaxViewPosition()) - { - posY = 0; - posX++; - } - else - { - posY = iRowCount - 1; - } - } - - BeginSelection(posX * iRowCount + posY); - - possibleKeyScrollingState = EKeyScrollingDown; - handled = ETrue; - - } - - } break; - case EKeyLeftArrow: - { - TInt posY = (TInt)iSpring->EndY(); - TInt posX = (TInt)iSpring->EndX(); - - if (AknLayoutUtils::LayoutMirrored()) - { - posX++; - } - else - { - posX--; - } - - BeginSelection(posX * iRowCount + posY); - - possibleKeyScrollingState = EKeyScrollingLeft; - handled = ETrue; - } break; - case EKeyRightArrow: - { - TInt posY = (TInt)iSpring->EndY(); - TInt posX = (TInt)iSpring->EndX(); - - if (!AknLayoutUtils::LayoutMirrored()) - { - posX++; - } - else - { - posX--; - } - - BeginSelection(posX * iRowCount + posY); - - possibleKeyScrollingState = EKeyScrollingRight; - handled = ETrue; - } break; - case EKeyEnter: - { - if( iSelectedIndex != KErrNotFound && iSelectionObserver ) - { - TRAP_IGNORE( StartOpeningAnimationL(ETrue ); ) - return EKeyWasConsumed; - } - return EKeyWasNotConsumed; - } - default: - break; - } - - // start key scrolling timer if enough key repeats hit - // and we are not yet scrolling - if( possibleKeyScrollingState != ENoKeyScrolling && iKeyRepeats > KPhysLaunchKeyCount ) - { - if( !iKeyScrollingTimer->IsActive() ) - { - iKeyScrollingState = possibleKeyScrollingState; - iKeyScrollingTimer->Start( - TTimeIntervalMicroSeconds32( 0 ), - TTimeIntervalMicroSeconds32( KMediaWallKeyScrollingUpdateInterval ), - TCallBack( KeyScrollingTimerCallback, this ) ); - } - } - - return handled ? EKeyWasConsumed : EKeyWasNotConsumed; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::HandleKeyUp() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleKeyUp() - { - StopKeyScrolling(); - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::StopKeyScrolling() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::StopKeyScrolling() - { - if (iKeyScrollingTimer->IsActive()) - iKeyScrollingTimer->Cancel(); - - iKeyScrollingState = ENoKeyScrolling; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::DoKeyScrolling() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::DoKeyScrolling() - { - TKeyEvent keyEvent; - if (iKeyScrollingState == EKeyScrollingRight) - { - keyEvent.iCode = EKeyRightArrow; - HandleKeyEvent(keyEvent); - } - else if (iKeyScrollingState == EKeyScrollingLeft) - { - keyEvent.iCode = EKeyLeftArrow; - HandleKeyEvent(keyEvent); - } - else if (iKeyScrollingState == EKeyScrollingUp) - { - keyEvent.iCode = EKeyUpArrow; - HandleKeyEvent(keyEvent); - } - else if (iKeyScrollingState == EKeyScrollingDown) - { - keyEvent.iCode = EKeyDownArrow; - HandleKeyEvent(keyEvent); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::KeyScrollingTimerCallback() -// --------------------------------------------------------------------------- -// -TInt CHgVgMediaWall::KeyScrollingTimerCallback( TAny* aPtr ) - { - CHgVgMediaWall* self = - static_cast( aPtr ); - - TInt err = KErrNotFound; - - if ( self ) - { - self->DoKeyScrolling(); - err = KErrNone; - } - - return err; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::Release() -// From MHgBufferOwner -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::Release(TInt aReleaseStart, TInt aReleaseEnd) - { - for(; aReleaseStart <= aReleaseEnd; ++aReleaseStart) - { - if( aReleaseStart >= 0 && aReleaseStart < iItems.Count()) - { - iItems[aReleaseStart]->SetIcon(NULL, iItems[aReleaseStart]->Flags()); - } - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::Reset() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::Reset() - { - iItems.ResetAndDestroy(); - iItemCount = 0; - HandleItemCountChanged(); - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SetEmptyTextL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetEmptyTextL( const TDesC& aEmptyText ) - { - delete iEmptyText; - iEmptyText = 0; - iEmptyText = aEmptyText.AllocL(); - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::ItemCount() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgVgMediaWall::ItemCount() const - { - return iItems.Count(); - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SetDefaultIconL() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetDefaultIconL( CGulIcon* aDefaultIcon ) - { - - if (iDefaultIcon) - { - delete iDefaultIcon; - } - - iDefaultIcon = aDefaultIcon; - - iUsingDefaultIcon = EFalse; - - InitDefaultIconL(); - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::DisableScrollBuffer() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::DisableScrollBuffer() - { - delete iManager; - iManager = NULL; - } - - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SetObserver() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetObserver(MHgVgMediaWallObserver* aObserver) - { - iMediaWallObserver = aObserver; - } - - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SetSelectionAnimationType() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetOpeningAnimationType(THgVgOpeningAnimationType aType) - { - iOpeningAnimationType = aType; - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::StartOpeningAnimation() -// --------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::StartOpeningAnimationL(TBool aOpening) - { - // stop possible animation - HandleTransitionAnimationStop(); - - if (iOpeningAnimationType == EHgVgOpeningAnimationNone) - { - if (iSelectionObserver) - { - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - iSelectionObserver->HandleOpenL(iPickedGridItem, this); - } - else - { - iSelectionObserver->HandleOpenL((TInt)iSpring->EndX(), this); - } - } - } - else - { - iAnimationState = aOpening ? EHgVgMediaWallAnimationStateOpening : EHgVgMediaWallAnimationStateClosing; - - StartAnimationTimer(); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DrawToWindow() -// --------------------------------------------------------------------------- -// -CFbsBitmap* CHgVgMediaWall::DrawToBitmap() - { - - if (!DrawAll()) - return NULL; - - return iEGL->GetSurfaceToBitmap(iRect); - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::InitDefaultIconL() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::InitDefaultIconL() - { - // if no icon is set, load ganes default icon - if (!iDefaultIcon && iUsingDefaultIcon) - { - - iDefaultIcon = CreateIconL(EMbmGanesQgn_prop_checkbox_on, - EMbmGanesQgn_prop_checkbox_on_mask, - iRenderer->ImageSize()); - - } - - if (iDefaultIcon && iRenderer) - { - iRenderer->SetDefaultIconL(*iDefaultIcon); - } - - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::FocusChanged() -// From CCoeControl -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::FocusChanged(TDrawNow /*aDrawNow*/) - { - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleResourceChange() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleResourceChange( TInt aType ) - { - if ( aType == KAknsMessageSkinChange ) - { - TRAP_IGNORE ( - InitButtonsL(); - InitScrollBarL(ETrue); - if (iRenderer) - iRenderer->HandleSkinChange(); - // if the default icon is not set by client, - // we need to reload our new default icon from skin. - if (iUsingDefaultIcon) - { - delete iDefaultIcon; - iDefaultIcon = NULL; - InitDefaultIconL(); - } - if (iSkinRenderer) - iSkinRenderer->UpdateSkinL(this, this); - ) - } - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::InitItemsL() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::InitItemsL() - { - for(TInt i = 0; i < iItemCount; ++i) - { - iItems.Append( CHgVgItem::NewL() ); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleGainingForeground() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleGainingForeground() - { - - // draw previous screenshot - DrawNow(); - - // delete it - delete iSurfaceBitmap; - iSurfaceBitmap = NULL; - - iIsForeground = ETrue; - - // init egl and openvg again - TRAP_IGNORE( InitRenderingL(EFalse); ) - - // reload images to ive - ReloadItemsImages(); - - // draw using openvg - DrawNow(); - - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleLosingForeground() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleLosingForeground() - { - - // make sure we are not animating - HandleTransitionAnimationStop(); - - if (iAnimationTimer->IsActive()) - { - if (iAnimationState == EHgVgMediaWallAnimationStateClosing) - iAnimationState = EHgVgMediaWallAnimationStateIdle; - else if (iAnimationState == EHgVgMediaWallAnimationStateOpening) - iAnimationState = EHgVgMediaWallAnimationStateItemOpened; - else - iAnimationState = EHgVgMediaWallAnimationStateIdle; - - iAnimationTimer->Cancel(); - } - - iIsForeground = EFalse; - - // take a screenshot - delete iSurfaceBitmap; - iSurfaceBitmap = NULL; - iSurfaceBitmap = DrawToBitmap(); - - // draw screenshot using window gc, this is needed - // for nga effects to work - DrawNow(); - - // free textures - FreeItemsImages(); - // free other resources - DestroyRendering(); - - iCoeEnv->WsSession().Flush(); - - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DrawOpenVG() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::DrawOpenVG() const - { - - if( iFlags & EHgVgMediaWallDrawToWindowGC || !iIsForeground ) - { - // Window GC drawing mode is on or we are on backround. - return; - } - - CHgVgMediaWall* self = const_cast(this); - - if (!self->DrawAll()) - return; - - iEGL->SwapBuffers(); - - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DoAnimation() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::DoAnimation() - { - switch (iAnimationState) - { - case EHgVgMediaWallAnimationStateTransition: - case EHgVgMediaWallAnimationStateFastTransition: - { - DoTransitionAnimation(); - } break; - case EHgVgMediaWallAnimationStateOpening: - case EHgVgMediaWallAnimationStateClosing: - case EHgVgMediaWallAnimationStateIdle: - case EHgVgMediaWallAnimationStateItemOpened: - { - DoSelectionAnimation(); - } break; - } - - DrawOpenVG(); - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DoSelectionAnimation() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::DoSelectionAnimation() - { - TTime now; - now.HomeTime(); - TInt diff = now.MicroSecondsFrom(iAnimationStartTime).Int64(); - - // limit to max duration - if (diff > KSelectionAnimationDuration) - diff = KSelectionAnimationDuration; - - // calculate animation alpha - TReal alpha = (TReal)diff / (TReal)KSelectionAnimationDuration; - - switch (iAnimationState) - { - case EHgVgMediaWallAnimationStateClosing: - { - iAnimationAlpha = 1.0f - alpha; - if (diff == KSelectionAnimationDuration) - iAnimationState = EHgVgMediaWallAnimationStateIdle; - } break; - case EHgVgMediaWallAnimationStateOpening: - { - iAnimationAlpha = alpha; - if (diff == KSelectionAnimationDuration) - iAnimationState = EHgVgMediaWallAnimationStateItemOpened; - } break; - case EHgVgMediaWallAnimationStateItemOpened: - { - iAnimationTimer->Cancel(); - if (iSelectionObserver) - { - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - TRAP_IGNORE( iSelectionObserver->HandleOpenL(iPickedGridItem, this); ) - } - else - { - TRAP_IGNORE( iSelectionObserver->HandleOpenL(iSelectedIndex, this); ) - } - } - } break; - case EHgVgMediaWallAnimationStateIdle: - { - iAnimationTimer->Cancel(); - } break; - } - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DoTransitionAnimation() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::DoTransitionAnimation() - { - TTime now; - now.HomeTime(); - TReal deltaTime = (TReal)now.MicroSecondsFrom(iPrevTime).Int64() / (TReal)KOneSecondInMicroSeconds; - iPrevTime = now; - - if (iSpring->IntegratePhysics(deltaTime, !iPointerDown)) - { - // snap - HandleTransitionAnimationStop(); - } - else - { - // update view position dependant stuff - HandleViewPositionChanged(ETrue); - } - - } - -void CHgVgMediaWall::HandleTransitionAnimationStop() - { - if (iAnimationTimer->IsActive() && (iAnimationState == EHgVgMediaWallAnimationStateTransition || - iAnimationState == EHgVgMediaWallAnimationStateFastTransition)) - { - // stop to this location - iSpring->Reset(); - iAnimationState = EHgVgMediaWallAnimationStateIdle; - - // cancel animation - iAnimationTimer->Cancel(); - - // handle view position change - HandleViewPositionChanged(); - } - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::AnimationTimerCallback() -// Timer callback for selection animation. -// --------------------------------------------------------------------------- -// -TInt CHgVgMediaWall::AnimationTimerCallback( TAny* aPtr ) - { - CHgVgMediaWall* scroller = static_cast(aPtr); - - TInt err = KErrNotFound; - - if( scroller ) - { - scroller->DoAnimation(); - err = KErrNone; - } - - return err; - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::ScrollBarViewPositionChanged() -// Called by scroll bar when its position has changed. -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::ScrollBarPositionChanged( const TPoint& aNewPosition ) - { - iScrollBarHit = ETrue; - if (iSpring->GetX() != aNewPosition.iX) - { - StartAnimationToPosition(aNewPosition.iX, EFalse); - } - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleNaviStripChar() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleNaviStripChar( const TChar& /*aChar*/ ) - { - // do nothing - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::UpdateTitles() -// Updates album and artist titles. -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::UpdateLabelsAndPopup() - { - if (iItems.Count() == 0) - return; - - CHgVgItem* item = NULL; - - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - TInt pos = (iSpring->GetX() * (TReal)KGridRowCount); - if (pos >= 0 && pos < iItems.Count() && iItems.Count() == iItemCount) - { - item = iItems[pos]; - } - } - else - { - if (iSelectedIndex >= 0 && iSelectedIndex < iItems.Count()) - item = iItems[iSelectedIndex]; - } - - // set album and artist titles from item - if( item ) - { - if (iArtistLabel && iAlbumLabel) - { - TRAP_IGNORE( - iArtistLabel->SetTextL(item->Title()); - iAlbumLabel->SetTextL(item->Text()); ) - } - - if (iLetterPopup) - { - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - if (item != iTempItem) - { - iTempItem = item; - - TRAP_IGNORE( - item->Time().FormatL( iPopupText1, KGanesMonthString ); - item->Time().FormatL( iPopupText2, KGanesYearString ); - ) - - // To display year correctly in arabic. - AknTextUtils::LanguageSpecificNumberConversion( iPopupText2 ); - - iLetterPopup->SetTexts(iPopupText1, iPopupText2); - } - } - else - { - TRAP_IGNORE( iLetterPopup->SetTextL(item->Title().Left(1)); ) - } - } - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DrawTitles() -// Draws album and artist titles. -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::DrawTitles(TReal aAlpha) - { - TReal alpha = aAlpha; - if( iAnimationState == EHgVgMediaWallAnimationStateOpening || - iAnimationState == EHgVgMediaWallAnimationStateClosing) - { - alpha = 1.0f - iAnimationAlpha; - } - else if (iAnimationState == EHgVgMediaWallAnimationStateItemOpened) - { - alpha = 0.0f; - } - - if( iAlbumLabel && iArtistLabel ) - { - iArtistLabel->Draw(iRect, alpha); - iAlbumLabel->Draw(iRect, alpha); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::InitScrollBarL() -// Inits scroll bar -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::InitScrollBarL(TBool /*aResize*/) - { - delete iScrollBar; - iScrollBar = NULL; - - if (iMediaWallStyle != CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen && - iMediaWallStyle != CHgVgMediaWall::EHgVgMediaWallStyleGrid) - return; - - iScrollBar = CHgVgScrollBar::NewL(*this, iRect, - TSize(MaxViewPosition(), 1), TSize(1, 1), - ETrue, CHgScroller::EHgScrollerScrollBar); - - iScrollBar->SetViewPosition( TPoint(iSelectedIndex, 0) ); - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::InitRenderingL() -// Inits all rendering. -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::InitRenderingL(TBool aRecreateSurface) - { - if (!iEGL) - { - iEGL = CHgVgEGL::NewL(Window()); - CHgVgImageCreator::InstanceL()->Initialize(iEGL); - } - else - { - if (aRecreateSurface) - iEGL->InitWindowSurfaceL(Window()); - } - - delete iRenderer; iRenderer = NULL; - delete iArtistLabel; iArtistLabel = NULL; - delete iAlbumLabel; iAlbumLabel = NULL; - delete iLetterPopup; iLetterPopup = NULL; - delete iSkinRenderer; iSkinRenderer = NULL; - iSkinRenderer = CHgVgSkinRenderer::NewL(iRect); - iSkinRenderer->UpdateSkinL(this, this); - - delete iEmptyLabel; iEmptyLabel = NULL; - iEmptyLabel = CHgVgLabel::NewL( - /*TRect(TPoint(iRect.Center().iX - 100, iRect.Center().iY - 50), - TSize(200, 100))*/iRect, &ScreenFont( TCoeFont( KMediaWallGridPopupFontSize, TCoeFont::EPlain )), - *iEmptyText); - - switch (iMediaWallStyle) - { - case EHgVgMediaWallStyleCoverflowFullScreen: - { - InitMediaWallFullScreenLandscapeL(); - } break; - case EHgVgMediaWallStyleCoverflowTBonePortrait: - { - InitMediaWallTBonePortraitL(); - } break; - case EHgVgMediaWallStyleGrid: - { - InitMediaWallGridLandscapeL(); - } break; - default: - { - User::Leave(KErrNotSupported); - } break; - } - - // load default icon - InitDefaultIconL(); - - // invalidate selected index so - // that HandleViewPositionChanged does - // all updates needed. - iSelectedIndex = KErrNotFound; - HandleViewPositionChanged(ETrue); - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::InitButtonsL() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::InitButtonsL() - { - - CGulIcon* icon = CreateIconL(EMbmGanesQgn_indi_button_exit_fs, - EMbmGanesQgn_indi_button_exit_fs_mask, TSize(41,41)); - - CleanupStack::PushL(icon); - - delete iHideSKButton; iHideSKButton = NULL; - - TAknLayoutRect rect; - rect.LayoutRect(iRect, AknLayoutScalable_Apps::main_cf0_pane_g1(0)); - - iHideSKButton = CHgVgButton::NewL(rect.Rect().Size(), rect.Rect().iTl, *icon); - - CleanupStack::PopAndDestroy(icon); - - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::CreateIconL() -// --------------------------------------------------------------------------- -// -CGulIcon* CHgVgMediaWall::CreateIconL(TInt aId1, TInt aId2, const TSize& aSize) - { - CFbsBitmap* bitmap = NULL; - CFbsBitmap* mask = NULL; - - AknIconUtils::CreateIconL( - bitmap, - mask, - KGanesMif, - aId1, - aId2 ); - - CGulIcon* icon = CGulIcon::NewL(bitmap, mask); - - AknIconUtils::SetSize(icon->Bitmap(), - aSize); - AknIconUtils::SetSize(icon->Mask(), - aSize); - - return icon; - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::FreeItemImages() -// Frees all loaded images. -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::FreeItemsImages() - { - for (TInt i = 0; i < iItems.Count(); i++) - { - iItems[i]->FreeOpenVgImage(); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::ReloadItemsImages() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::ReloadItemsImages() - { - for (TInt i = 0; i < iItems.Count(); i++) - { - iItems[i]->ReloadOpenVgImage(); - } - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleTouchGestureL() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleTouchGestureL( MAknTouchGestureFwEvent& aEvent ) - { - - if (iScrollBarHit || iButtonsHit || iAnimationState == EHgVgMediaWallAnimationStateOpening || - iAnimationState == EHgVgMediaWallAnimationStateClosing) - return; - - if (iAnimationState == EHgVgMediaWallAnimationStateItemOpened) - { - StartOpeningAnimationL(EFalse); - } - else - { - - switch (aEvent.Group()) - { - case EAknTouchGestureFwGroupTap: - { - MAknTouchGestureFwTapEvent* tapEvent = AknTouchGestureFwEventTap(aEvent); - if (tapEvent && aEvent.Type() == EAknTouchGestureFwTap) - { - HandleTapEventL(tapEvent->Position()); - } - } break; - case EAknTouchGestureFwGroupFlick: - { - MAknTouchGestureFwFlickEvent* flickEvent = AknTouchGestureFwEventFlick(aEvent); - if ((flickEvent && aEvent.Type() == EAknTouchGestureFwFlickLeft) || - (flickEvent && aEvent.Type() == EAknTouchGestureFwFlickRight)) - { - EndSelection(); - HandleFlick(flickEvent->Speed()); - } - } break; - case EAknTouchGestureFwGroupDrag: - { - MAknTouchGestureFwDragEvent* dragEvent = AknTouchGestureFwEventDrag(aEvent); - if (dragEvent && aEvent.Type() == EAknTouchGestureFwDrag) - { - EndSelection(); - HandleDragging(*dragEvent); - } - } break; - } - - } - - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleTapEvent() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleTapEventL(const TPoint& aPosition) - { - if (iRenderer) - { - TInt index = iRenderer->GetItemIndex(aPosition); - if (index != KErrNotFound) - { - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - iPickedGridItem = index; - DoStartOpeningAnimationL(); - } - else - { - if (index == iSelectedIndex && index == (TInt)iSpring->EndX()) - { - DoStartOpeningAnimationL(); - } - else - { - StartAnimationToPosition(index, ETrue); - } - } - } - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleFlick() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleFlick(const TPoint& aSpeed) - { - - // mirror for mirrored layouts - TInt speed = aSpeed.iX; - if (AknLayoutUtils::LayoutMirrored()) - speed = -speed; - - TReal fspeed = GetAsPercentageOfScreenWidth((TReal)speed); - - if (Abs(fspeed) < KMinFlickSpeed) // Discard small and slow flicks - return; - - TInt steps = -GetStepsFromSpeed(speed); - - iSpring->SetVelocity(iSpring->VelX() - fspeed, iSpring->VelY()); - - if (Abs(steps) > 0) - { - TReal x = iSpring->EndX() + steps; - x = Min(x, (TReal)(MaxViewPosition() - 1)); - x = Max(x, 0); - if (x != iSpring->EndX()) - { - StartAnimationToPosition(x, ETrue); - } - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::GetStepsFromSpeed() -// --------------------------------------------------------------------------- -// -TInt CHgVgMediaWall::GetStepsFromSpeed(TInt aSpeed) const - { - TInt steps = aSpeed > 0 ? 1 : -1; - TReal speed = GetAsPercentageOfScreenWidth(aSpeed); - TReal absSpeed = Abs(speed); - if (absSpeed > 1.0f) - { - steps = (TInt)(speed / KSwipeSpeedFactor); - } - return steps; - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleDragging() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleDragging(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent) - { - - switch (aEvent.State()) - { - case AknTouchGestureFw::EAknTouchGestureFwStart: - { - HandleDragStart(aEvent); - } break; - case AknTouchGestureFw::EAknTouchGestureFwStop: - { - HandleDragStop(aEvent); - } break; - case AknTouchGestureFw::EAknTouchGestureFwOn: - { - HandleDragOn(aEvent); - } break; - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleDragging() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::StartAnimationTimer() - { - - // animation may start event when - // timer was previously active. - iAnimationStartTime.HomeTime(); - - if (!iAnimationTimer->IsActive()) - { - iPrevTime.HomeTime(); - iAnimationTimer->Start( - TTimeIntervalMicroSeconds32( 0 ), - TTimeIntervalMicroSeconds32( KViewScrollingUpdateInterval ), - TCallBack( AnimationTimerCallback, this ) ); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::GetAsPercentageOfScreenWidth() -// --------------------------------------------------------------------------- -// -TReal CHgVgMediaWall::GetAsPercentageOfScreenWidth(TInt aPixels) const - { - return (TReal)aPixels / (TReal)iRect.Width(); - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::GetAsPercentageOfScreenHeight() -// --------------------------------------------------------------------------- -// -TReal CHgVgMediaWall::GetAsPercentageOfScreenHeight(TInt aPixels) const - { - return (TReal)aPixels / (TReal)iRect.Height(); - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DrawScene() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::DrawScene() - { - - TReal t = iSpring->VelX() / iSpringVelocityToAnimationFactor; - if (Abs(t) > 1.0f) - t = t / Abs(t); - - if (AknLayoutUtils::LayoutMirrored()) - t = -t; - - iRenderer->SetCameraRotation(-t * iCameraRotationFactor); - - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - TReal cameraY = (TReal)(iRowCount - 1) - iSpring->GetInterpolatedY(); - iRenderer->SetCameraPosition(0, 0,//cameraY * iRenderer->GetWorldSpaceRowHeight(), - -Abs(t)*iCameraZoomFactor); - iRenderer->DrawGrid(iRowCount, iItems, - iSpring->GetInterpolatedX(), iSpring->GetInterpolatedY(), - iSelGridItem, iPrevGridItem, iAnimationAlpha, iAnimationState, - iPickedGridItem, iOpeningAnimationType); - } - else - { - iRenderer->Draw(iItems, iSelectedIndex, iSpring->EndX(), - iSpring->GetInterpolatedX(), iAnimationAlpha, iAnimationState, - iOpeningAnimationType, iMediaWallStyle); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleDragStart() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleDragStart(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& /*aEvent*/) - { - - // cancel ongoing animation. - if (iAnimationTimer->IsActive()) - { - iAnimationTimer->Cancel(); - if (iMediaWallStyle != EHgVgMediaWallStyleGrid) - { - iSpring->SetEnd(iSelectedIndex, iSpring->EndY()); - } - } - - iPointerDown = ETrue; - iViewPositionAtDragStart = iSpring->GetX(); - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleDragOn() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleDragOn(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& aEvent) - { - - // calculate delta of dragging - TInt delta = aEvent.StartPosition().iX - aEvent.CurrentPosition().iX; - TReal fDelta = GetAsPercentageOfScreenWidth(delta); - - // flip for mirrored layout - if (AknLayoutUtils::LayoutMirrored()) - { - fDelta = -fDelta; - } - - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - // for grid we set new position to dragpos and start animation - // to get camera rotation effect for dragging also. - TReal newPosition = iViewPositionAtDragStart + fDelta * iItemsToMoveOnFullScreenDrag; - StartAnimationToPosition(newPosition, ETrue); - } - else - { - // for normal mediawall we move view position according to drag - TReal x = iViewPositionAtDragStart + fDelta * iItemsToMoveOnFullScreenDrag; - iUpdateScrollBar = ETrue; - iSpring->SetXY(x, 0); - iSpring->SetEnd(x, 0); - HandleViewPositionChanged(ETrue); - // draw view at new view position - DrawOpenVG(); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleDragStop() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::HandleDragStop(const AknTouchGestureFw::MAknTouchGestureFwDragEvent& /*aEvent*/) - { - iPointerDown = EFalse; - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - // if we dragged grids position outside bounds, - // we need to animate it back. - TReal x = iSpring->EndX(); - x = Min(x, (TReal)(MaxViewPosition() - 1)); - x = Max(x, 0); - if (x != iSpring->EndX()) - { - StartAnimationToPosition(x, ETrue); - } - } - else - { - // animate back to current selected index, because - // we dont want to be between items in mediawall - StartAnimationToPosition(iSelectedIndex, ETrue); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DrawLetterStripAndTitles() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::DrawLetterStripAndTitles() - { - if (iItems.Count() == 0) - { - DrawTitles(1.0f); - } - else - { - - // get distance to next target item - TReal dist = Abs(iSpring->GetX() - iSpring->EndX()); - - if (iMediaWallStyle == EHgVgMediaWallStyleCoverflowTBonePortrait) - { - // we bring letter popup when we are far enough from next item - if (iLetterPopup && (dist > 2.0f && iSpring->GetX() >= 0 && iSpring->GetX() < iItems.Count())) - { - iLetterPopup->Draw(iRect, KMaxLetterPopupOpacity * Max(1.0f, (dist - 2.0f) / 2.0f)); - } - else - { - DrawTitles(1.0f - dist/2.0f); - } - } - else if (iMediaWallStyle == EHgVgMediaWallStyleCoverflowFullScreen || - iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - // when scrollbar is being dragged we draw letter popup - if (iLetterPopup && (iScrollBarHit || (iKeyScrollingState != ENoKeyScrolling && dist >= 2.0f))) - { - iLetterPopup->Draw(iRect, KMaxLetterPopupOpacity); - } - - // when close to target item, we draw titles - if (dist <= 2.0f) - { - DrawTitles(1.0f - dist / 2.0f); - } - } - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DrawButtonsAndScrollbar() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::DrawButtonsAndScrollbar() - { - if (iScrollBar || iHideSKButton) - { - TReal alpha = 1.0f; - if (iAnimationState == EHgVgMediaWallAnimationStateOpening || iAnimationState == EHgVgMediaWallAnimationStateClosing) - alpha = 1.0f - iAnimationAlpha; - else if (iAnimationState == EHgVgMediaWallAnimationStateItemOpened) - alpha = 0.0f; - if (iScrollBar) - iScrollBar->Draw(iRect, alpha); - if (iHideSKButton) - iHideSKButton->Draw(iRect, alpha); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::HandleButtons() -// --------------------------------------------------------------------------- -// -TBool CHgVgMediaWall::HandleButtons(const TPointerEvent& aEvent) - { - // handle hitting buttons - TBool ret = EFalse; - if (iHideSKButton) - { - // if buttons is hit, hide scrollbar and button - if (iHideSKButton->HandlePointerEvent(aEvent)) - { - - if (iScrollBar) - iScrollBar->SetEnabled(EFalse); - - iHideSKButton->SetEnabled(EFalse); - - ret = ETrue; - - DrawOpenVG(); - - if (iMediaWallObserver) - iMediaWallObserver->HandleMediaWallEvent((TInt)EHgVgMediaWallEventRequestShowSoftkeys, this); - - } - // if screen is hit when button is not visible, show button and scrollbar - else if (!iHideSKButton->IsEnabled() && aEvent.iType == TPointerEvent::EButton1Down) - { - - if (iScrollBar) - iScrollBar->SetEnabled(ETrue); - - iHideSKButton->SetEnabled(ETrue); - - DrawOpenVG(); - - if (iMediaWallObserver) - iMediaWallObserver->HandleMediaWallEvent((TInt)EHgVgMediaWallEventRequestHideSoftkeys, this); - - } - } - - return ret; - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::MaxViewPosition() -// --------------------------------------------------------------------------- -// -TInt CHgVgMediaWall::MaxViewPosition() const - { - return iItemCount / iRowCount; - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::BeginSelection() -// --------------------------------------------------------------------------- -// -TBool CHgVgMediaWall::BeginSelection(TInt aIndex) - { - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - if (iSelectionObserver) - { - TRAP_IGNORE( iSelectionObserver->HandleSelectL(aIndex, this); ) - } - iPrevGridItem = iSelGridItem; - iSelGridItem = aIndex; - iSelectionMode = ETrue; - TInt x = aIndex / iRowCount; - TInt y = aIndex % iRowCount; - StartAnimationToPosition(x, y, ETrue); - } - return ETrue; - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::EndSelection() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::EndSelection() - { - if (iSelectionMode) - { - iSelGridItem = KErrNotFound; - iPrevGridItem = KErrNotFound; - iSelectionMode = EFalse; - StartAnimationToPosition(iSpring->EndX(), iRowCount - 1, ETrue); - } - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::DoStartOpeningAnimationL() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::DoStartOpeningAnimationL() - { - TBool opening = ETrue; - - if (iAnimationState == EHgVgMediaWallAnimationStateItemOpened) - opening = EFalse; - - StartOpeningAnimationL(opening); - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::StartAnimationToPosition() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::StartAnimationToPosition(TReal aX, TBool aUpdateScrollBar) - { - StartAnimationToPosition(aX, iSpring->EndY(), aUpdateScrollBar); - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWall::StartAnimationToPosition() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWall::StartAnimationToPosition(TReal aX, TReal aY, TBool aUpdateScrollBar) - { - iSpring->SetEnd(aX, aY); - iUpdateScrollBar = aUpdateScrollBar; - iAnimationState = EHgVgMediaWallAnimationStateTransition; - StartAnimationTimer(); - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SetFlags() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetFlags(TInt aFlags) - { - iFlags |= aFlags; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::ClearFlags() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::ClearFlags(TInt aFlags) - { - iFlags &= ~aFlags; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::Flags() -// ----------------------------------------------------------------------------- -// -EXPORT_C TInt CHgVgMediaWall::Flags() - { - return iFlags; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SetItemToOpenedState() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetItemToOpenedState(TInt aIndex) - { - if (aIndex >= 0 && aIndex < iItemCount) - { - HandleTransitionAnimationStop(); - SetSelectedIndex(aIndex); - if (iMediaWallStyle == EHgVgMediaWallStyleGrid) - { - iPickedGridItem = aIndex; - } - iAnimationAlpha = 1.0f; - iAnimationState = EHgVgMediaWallAnimationStateItemOpened; - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::SetFlippedRect() -// ----------------------------------------------------------------------------- -// -EXPORT_C void CHgVgMediaWall::SetOpenedItemRect(const TRect& aRect) - { - if (iRenderer) - { - iRenderer->SetFlippedRect(aRect); - } - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::DeleteComponents() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::DestroyRendering() - { - delete iScrollBar; iScrollBar = NULL; - delete iRenderer; iRenderer = NULL; - delete iArtistLabel; iArtistLabel = NULL; - delete iAlbumLabel; iAlbumLabel = NULL; - delete iLetterPopup; iLetterPopup = NULL; - delete iSkinRenderer; iSkinRenderer = NULL; - delete iEGL; iEGL = NULL; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::DrawAll() -// ----------------------------------------------------------------------------- -// -TBool CHgVgMediaWall::DrawAll() - { - if ( !iEGL || !iEGL->ReadyToRender() || !iRenderer ) - { - return EFalse; - } - - if (iSkinRenderer) - iSkinRenderer->Draw(); - - DrawScene(); - - DrawButtonsAndScrollbar(); - - if (iItems.Count() == 0) - { - if (iEmptyLabel) - { - iEmptyLabel->DrawEmptyText(iRect, *iEmptyText); - } - } - else - { - DrawLetterStripAndTitles(); - } - - return ETrue; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::CreateMediaWallFullScreenLandscapeL() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::InitMediaWallFullScreenLandscapeL() - { - - // set some factors to mediawall fullscreen mode specific values - iCameraZoomFactor = KMediaWallFullScreenCameraZoomFactor; - iCameraRotationFactor = KMediaWallFullScreenCameraRotationFactor; - iItemsOnScreen = KMediaWallFullScreenItemsOnScreen; - iSpringVelocityToAnimationFactor = KMediaWallFullScreenSpringVelocityToAnimationFactor; - iItemsToMoveOnFullScreenDrag = KMediaWallFullScreenItemsToMoveOnFullScreenDrag; - iRowCount = KMediaWallFullScreenRowCount; - - // get front rectange from layout - TAknLayoutRect frontRect; - frontRect.LayoutRect( iRect, AknLayoutScalable_Apps::cf0_flow_pane_g1(0) ); - - // set items at the back a bit further in the fullscreen mode. - iRenderer = CHgVgMediaWallRenderer::NewL(KMaxCoversVisible, iRect, frontRect.Rect(), - KMediaWallFullScreenZOffset); - - // set some default flipped rect for opening animation - iRenderer->SetFlippedRect(TRect(TPoint(iRect.Center().iX - iRect.Height() / 2, - iRect.Center().iY - iRect.Height() / 2), - TSize(iRect.Height(), iRect.Height()))); - - // in full screen, enable blurring on flip/zoom - iRenderer->EnableBlurOnFlip(ETrue, KDefaultBlurDeviation, - KDefaultBlurDeviation); - - InitLabelsL(1); - - InitPopupL(0); - - InitButtonsL(); - - InitScrollBarL(EFalse); - - iSpring->SetConstants( - KMediaWallFullScreenSpringK, - KMediaWallFullScreenSpringDamping, - KMediaWallFullScreenSpringMaxVelocity, - KPositionSnap, KMinSpringVelocity); - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWall::CreateMediaWallTBonePortraitL() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWall::InitMediaWallTBonePortraitL() - { - - // set some factors to mediawall fullscreen mode specific values - iCameraZoomFactor = KMediaWallTBoneCameraZoomFactor; - iCameraRotationFactor = KMediaWallTBoneCameraRotationFactor; - iItemsOnScreen = KMediaWallTBoneItemsOnScreen; - iSpringVelocityToAnimationFactor = KMediaWallTBoneSpringVelocityToAnimationFactor; - iItemsToMoveOnFullScreenDrag = KMediaWallTBoneItemsToMoveOnFullScreenDrag; - iRowCount = KMediaWallTBoneRowCount; - iOpeningAnimationType = EHgVgOpeningAnimationZoomToFront; - - // get front rectange from layout - TAknLayoutRect frontRect; - frontRect.LayoutRect( iRect, AknLayoutScalable_Apps::cf0_flow_pane_g1(1) ); - - iRenderer = CHgVgMediaWallRenderer::NewL(KMaxCoversVisible, iRect, frontRect.Rect(), - KMediaWallTBoneZOffset); - - iRenderer->SetFlippedRect(TRect(TPoint(iRect.Center().iX - iRect.Height() / 2, - iRect.Center().iY - iRect.Height() / 2), - TSize(iRect.Height(), iRect.Height()))); - - InitLabelsL(0); - - InitPopupL(0); - - iSpring->SetConstants( - KMediaWallTBoneSpringK, - KMediaWallTBoneSpringDamping, - KMediaWallTBoneSpringMaxVelocity, - KPositionSnap, KMinSpringVelocity); - - } - -void CHgVgMediaWall::InitMediaWallGridLandscapeL() - { - - TRect frontRect; - TSize size(120,90); - - // TODO: set this from layout data - frontRect = TRect(TPoint(iRect.Center().iX - size.iWidth/2, iRect.Center().iY - 45 + 90), - size); - - iCameraZoomFactor = KMediaWallGridCameraZoomFactor; - iCameraRotationFactor = KMediaWallGridCameraRotationFactor; - iItemsOnScreen = KMediaWallGridItemsOnScreen; - iSpringVelocityToAnimationFactor = KMediaWallGridSpringVelocityToAnimationFactor; - iItemsToMoveOnFullScreenDrag = KMediaWallGridItemsToMoveOnFullScreenDrag; - iRowCount = KMediaWallGridRowCount; - iOpeningAnimationType = EHgVgOpeningAnimationZoomIn; - - iRenderer = CHgVgMediaWallRenderer::NewL((KMaxCoversVisible+1) * KMediaWallGridRowCount, - iRect, frontRect, KMediaWallGridZOffset); - - iRenderer->SetFlippedRect(iRect); - - InitButtonsL(); - - InitScrollBarL(EFalse); - - //iRenderer->EnableFlipXY(ETrue); - - // TODO: set this from layout data - TSize lsize(300, 70); - iLetterPopup = CHgVgPopup::NewL(TRect(TPoint(iRect.Center().iX - lsize.iWidth / 2, - iRect.Center().iY - lsize.iHeight / 2), lsize), - &ScreenFont( TCoeFont( KMediaWallGridPopupFontSize, TCoeFont::EPlain ))); - - iSpring->SetConstants( - KMediaWallGridSpringK, - KMediaWallGridSpringDamping, - KMediaWallGridSpringMaxVelocity, - KPositionSnap, - KMinSpringVelocity); - } - - -void CHgVgMediaWall::InitLabelsL(TInt aLayoutVariant) - { - TAknTextComponentLayout l0 = AknLayoutScalable_Apps::main_cf0_pane_t1(aLayoutVariant); - TAknTextComponentLayout l1 = AknLayoutScalable_Apps::main_cf0_pane_t2(aLayoutVariant); - - TAknLayoutText t0; - TAknLayoutText t1; - - t0.LayoutText(iRect, l0); - t1.LayoutText(iRect, l1); - - iAlbumLabel = CHgVgLabel::NewL(t0.TextRect(), - &ScreenFont( TCoeFont( KMediaWallTBoneLabelFontSize, TCoeFont::EBold )) ); - - iArtistLabel = CHgVgLabel::NewL(t1.TextRect(), - &ScreenFont( TCoeFont( KMediaWallTBoneLabelFontSize, TCoeFont::EBold )) ); - - iAlbumLabel->SetLayout(l0, iRect); - iArtistLabel->SetLayout(l1, iRect); - } - -void CHgVgMediaWall::InitPopupL(TInt aLayoutVariant) - { - TAknLayoutRect popupRect; - popupRect.LayoutRect( iRect, AknLayoutScalable_Apps::cf0_flow_pane_g2(aLayoutVariant) ); - iLetterPopup = CHgVgPopup::NewL(popupRect.Rect(), - &ScreenFont( TCoeFont( KMediaWallTBonePopupFontSize, TCoeFont::EPlain ))); - - iLetterPopup->SetLayouts(AknLayoutScalable_Apps::cf0_flow_pane_g2(aLayoutVariant), - AknLayoutScalable_Apps::cf0_flow_pane_t1(aLayoutVariant), iRect); - } - - - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgMediaWallRenderer.cpp --- a/uifw/ganes/src/HgVgMediaWallRenderer.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1135 +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 "HgVgMediaWallRenderer.h" -#include "HgVgHelper.h" -#include "HgConstants.h" -#include "HgVgConstants.h" - -#include -#include -#include -#include -#include -#include -#include - -using namespace HgVgConstants; - -const VGfloat KColorByteToFloat(255.0f); -// Ending position of the left album stack -const VGfloat KLeftStackEndX(-1.04);//-235.0f); -// Ending position of the right album stack -const VGfloat KRightStackStartX(1.04);//235.0f); - -// Space between albums in stacks -const VGfloat KSpaceBetween(1.04);//235); - -const TInt KGroundHeightFactor(2); -const TInt KNumGroundGradientValues(4); -const VGfloat KGroundGradient[] = { - 0.0f, 0.0f, 0.0f, 1.0f -}; -const TInt KGroundVerticesHint(4); -const TInt KGroundSegmentsHint(4); -const VGfloat KGroundScale(1.0f); -const VGfloat KGroundBias(0.0f); - -const VGfloat KFov(PI/2); - -const VGfloat KFlipAngle(PI); - -const VGfloat KQuadVerts[] = - { - -1.0f, -1.0f, 0.0f, - 1.0f, -1.0f, 0.0f, - 1.0f, 1.0f, 0.0f, - -1.0f, 1.0f, 0.0f - }; - - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CHgVgCoverflowRenderer::NewL() -// ----------------------------------------------------------------------------- -// -CHgVgMediaWallRenderer* CHgVgMediaWallRenderer::NewL(TInt aMaxQuads, const TRect& aRect, - const TRect& aFrontRect, TReal aZOffset ) - { - CHgVgMediaWallRenderer* self = new (ELeave) CHgVgMediaWallRenderer( aRect, - aFrontRect, aZOffset); - CleanupStack::PushL( self ); - self->ConstructL(aMaxQuads); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::ConstructL (TInt aMaxQuads) - { - for (TInt i = 0; i < aMaxQuads; i++) - { - TQuad* q = new (ELeave)TQuad; - q->iItemIndex = -1; - iQuads.Append(q); - } - CreateGround(); - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::CHgVgMediaWallRenderer() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgMediaWallRenderer::CHgVgMediaWallRenderer( - const TRect& aWindowRect, - const TRect& aFrontRect, - TReal aZOffset) : - iRect(aWindowRect), - iReflectionsEnabled(ETrue), - iSelectedItemIndex(KSelectedItemIndex), - iLeftStackEndX(KLeftStackEndX), - iRightStackStartX(KRightStackStartX), - iSpaceBetween(KSpaceBetween), - iFov(KFov), - iFlipAngle(KFlipAngle) - { - AdjustSettingsBasedOnRects(aFrontRect, aZOffset); - } - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::~CHgVgScrollBar() -// Destructor. -// ----------------------------------------------------------------------------- -// -CHgVgMediaWallRenderer::~CHgVgMediaWallRenderer ( ) - { - if (iDefaultImage != VG_INVALID_HANDLE) - vgDestroyImage(iDefaultImage); - - if (iChildBlurImage != VG_INVALID_HANDLE) - vgDestroyImage(iChildBlurImage); - - if (iBlurImage != VG_INVALID_HANDLE) - vgDestroyImage(iBlurImage); - - vgDestroyPaint(iGroundPaint); - vgDestroyPath(iGroundPath); - - iQuads.ResetAndDestroy(); - iSortedQuads.Reset(); - } - -// ----------------------------------------------------------------------------- -// CHgMediaWallRenderer::SetDefaultImage() -// Setter for default image used to draw quads. -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::SetDefaultIconL(const CGulIcon& aIcon) - { - iDefaultImage = HgVgHelper::CreateVgImageFromIconL(aIcon); - } - -// ----------------------------------------------------------------------------- -// CHgMediaWallRenderer::SetCameraPosition() -// Setter for camera position modifier. -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::SetCameraPosition(TReal aX, TReal aY, TReal aZ) - { - iCameraX = aX; - iCameraY = aY; - iCameraZ = aZ; - } - -// ----------------------------------------------------------------------------- -// CHgMediaWallRenderer::SetCameraRotation() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::SetCameraRotation(TReal aAngle) - { - iCameraRotation = aAngle; - } - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::SortQuads -// Sorts quads from iQuads to iSortedQuads. -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::SortQuads(TInt aNumQuads) - { - - iSortedQuads.Reset(); - - for(TInt i = 0; i < aNumQuads; ++i) - { - iSortedQuads.Append(iQuads[i]); - } - - for (TInt i = 1; i < aNumQuads; i++) - { - for (int j = 0; j < aNumQuads; j++) - { - if( iSortedQuads[i]->iZ > iSortedQuads[j]->iZ ) - { - TQuad* q1 = iSortedQuads[i]; - TQuad* q2 = iSortedQuads[j]; - iSortedQuads[i] = q2; - iSortedQuads[j] = q1; - } - } - } - - } - - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::GetItemIndex -// gets index of the item under pointer position. -// ----------------------------------------------------------------------------- -// -TInt CHgVgMediaWallRenderer::GetItemIndex(const TPoint& aPointerPosition) const - { - for (TInt i = 0; i < iSortedQuads.Count(); i++) - { - VGfloat* verts = iSortedQuads[iSortedQuads.Count()-i-1]->iPoints; - TRect rect; - HgVgHelper::CalculateBoundingRect(rect, verts, 4, iRect); - if (rect.Contains(aPointerPosition)) - { - TInt index = iSortedQuads.Count()-i-1; - return iSortedQuads[index]->iItemIndex; - } - } - return KErrNotFound; - } - - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::TransformQuads -// Draws quads using OpenVG. -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::TransformQuads(TInt aNumVisibleQuads, - TBool aMirrored, VGfloat aFov, CHgVgMediaWall::THgVgOpeningAnimationType aOpeningAnimationType) - { - - VGfloat scW = (VGfloat) iRect.Width(); - VGfloat scH = (VGfloat) iRect.Height(); - - VGfloat imW = (VGfloat)iImageSize.iWidth; - VGfloat imH = (VGfloat)iImageSize.iHeight; - - // construct mirror matrix - HgVgHelper::TMatrix mirrorMatrix; - mirrorMatrix.Scale(1, -1, 1); - - // construct camera rotation matrix - HgVgHelper::TMatrix cameraRotMatrix; - if (iFlipXY) - { - cameraRotMatrix.RotationX(iCameraRotation); - } - else - { - cameraRotMatrix.RotationY(iCameraRotation); - } - - // mat[0] = transform - // mat[1] = mirrored transform - HgVgHelper::TMatrix mat[2]; - - VGfloat cameraX = iCameraBaseX + iCameraX; - VGfloat cameraY = iCameraBaseY + iCameraY; - VGfloat cameraZ = iCameraBaseZ + iCameraZ; - - if (iFlipXY) - { - VGfloat foobar = cameraX; - cameraX = cameraY; - cameraY = foobar; - } - - // scaling matrix is used to set correct size for the - // quad by image size - VGfloat hImW = (VGfloat)KWorldQuadWidth * 0.5f; - VGfloat hImH = (VGfloat)imH * (KWorldQuadWidth / imW) * 0.5f; - VGfloat oldHImH = hImH; - - // flips image upside down - HgVgHelper::TMatrix scaleMatrix; - scaleMatrix.Scale(hImW, -hImH, 1); // negative scale because our all images are updaside down. - - TBool deform = - (aOpeningAnimationType == CHgVgMediaWall::EHgVgOpeningAnimationFlipToFront) || - (aOpeningAnimationType == CHgVgMediaWall::EHgVgOpeningAnimationZoomToFront); - - for (TInt j = 0; j < aNumVisibleQuads; j++) - { - TQuad* q = iQuads[j]; - - if (q->iFlipped && deform) - { - // animate scaling to flipped rect size - VGfloat newH = (VGfloat)iFlippedHeight * (KWorldQuadWidth / iFlippedWidth) * 0.5f; - hImH = HgVgHelper::Lerp(hImH, newH, iBlurAlpha); - mat[0].Identity(); - mat[0].Scale(hImW, -hImH, 1); - } - else - { - // restore old normal half image height - hImH = oldHImH; - mat[0] = scaleMatrix; - } - - // rotMatrix rotates by quads angle - HgVgHelper::TMatrix rotMatrix; - rotMatrix.RotationY(-q->iAngle); - - // trMatrix translates by quads position - HgVgHelper::TMatrix trMatrix; - trMatrix.Translation(q->iX, q->iY + hImH, q->iZ); - - // then rotate - if (q->iAngle != 0) - { - mat[0].Multiply(rotMatrix); - } - - // then translate to position - mat[0].Multiply(trMatrix); - - // construct mirroring matrix - if (aMirrored) - { - mat[1] = mat[0]; - mat[1].Multiply(mirrorMatrix); - } - - // construct camera translation matrix - HgVgHelper::TMatrix cameraMatrix; - cameraMatrix.Translation(-cameraX, -cameraY - hImH, -cameraZ); - - // apply camera movement - mat[0].Multiply(cameraMatrix); - - // apply camera rotation hack - mat[0].Multiply(cameraRotMatrix); - - // apply to mirror matrix also - if (aMirrored) - { - mat[1].Multiply(cameraMatrix); - mat[1].Multiply(cameraRotMatrix); - } - - // transform all points by resulting transformation matrix - // and project to screen coordinates. - TInt count = aMirrored ? 2 : 1; - for (TInt k = 0; k < count; k++) - { - VGfloat* tverts = NULL; - VGfloat* tm = NULL; - - if (k == 0) - { - tverts = q->iPoints; - tm = q->iTM; - } - else - { - tverts = q->iMirroredPoints; - tm = q->iMirroredTM; - } - - for (TInt i = 0; i < 4; i++) - { - - HgVgHelper::TVertex v; - - v.iX = KQuadVerts[i*3+0]; - v.iY = KQuadVerts[i*3+1]; - v.iZ = KQuadVerts[i*3+2]; - - v.TransformPoint(mat[k]); - - v.ProjectPoint(scW, scH, aFov); - - tverts[i*2+0] = v.iScreenX; - tverts[i*2+1] = v.iScreenY; - - } - - VGImage image = q->iNoImage ? iDefaultImage : q->iImage; - VGfloat pxWidth = vgGetParameteri(image, VG_IMAGE_WIDTH); - VGfloat pxHeight = vgGetParameteri(image, VG_IMAGE_HEIGHT); - - // use screen coordinates to build warp matrix - // for rendering the image - vguComputeWarpQuadToQuad(tverts[0], tverts[1], tverts[2], tverts[3], - tverts[4], tverts[5], tverts[6], tverts[7], 0, 0, pxWidth, 0, - pxWidth, pxHeight, 0, pxHeight, tm); - - } - } - } - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::DrawQuads -// Draws quads using OpenVG. -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::DrawQuads(TBool aDrawMirrored) - { - - VGfloat values[] = { 1.0, 1.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 }; - - vgSeti(VG_COLOR_TRANSFORM, VG_TRUE); - - for (TInt j = 0; j < iSortedQuads.Count(); j++) - { - TQuad* q = iSortedQuads[j]; - - if (q->iAlpha < 0.01f) - continue; - - values[3] = q->iAlpha; - - vgSetfv(VG_COLOR_TRANSFORM_VALUES, 8, values); - - if (q->iZ < 0) - continue; - - DrawQuad(q, aDrawMirrored); - - } - - vgSeti(VG_COLOR_TRANSFORM, VG_FALSE); - - } - -// ----------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::DrawQuad -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::DrawQuad(CHgVgMediaWallRenderer::TQuad* q, TBool aDrawMirrored) - { - vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); - vgLoadIdentity(); - - //vgTranslate(iOffset.iX, iOffset.iY); - - VGImage image = q->iImage; - if (q->iNoImage) - { - image = iDefaultImage; - } - - if (aDrawMirrored) - { - vgMultMatrix(q->iMirroredTM); - } - else - { - vgMultMatrix(q->iTM); - if ((iBlurImage != VG_INVALID_HANDLE) && (iChildBlurImage != VG_INVALID_HANDLE) && q->iFlipped) - { - vgGaussianBlur(iChildBlurImage, image, iBlurDeviationX*iBlurAlpha, - iBlurDeviationY*iBlurAlpha, VG_TILE_PAD); - image = iChildBlurImage; - } - } - - - vgDrawImage(image); - } - - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::Draw() -// ----------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::Draw(RPointerArray& aItems, - TInt aSelectedIndex, TReal aNextIndex, - TReal aViewPosition, - TReal aAnimationAlpha, - CHgVgMediaWall::THgVgAnimationState aState, - CHgVgMediaWall::THgVgOpeningAnimationType aSelectionAnimationType, - CHgVgMediaWall::THgVgMediaWallStyle /*aStyle*/) - { - - TInt itemsOnScreen = 0; - itemsOnScreen = SetupQuads(aItems, - aSelectedIndex, aNextIndex, - aViewPosition, - aAnimationAlpha, - aState, aSelectionAnimationType); - - TransformAndDraw(itemsOnScreen, aSelectionAnimationType); - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::DrawGrid() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::DrawGrid( - TInt aRowCount, - RPointerArray& aItems, - TReal aViewX, TReal aViewY, - TInt aCurItem, TInt aPrevItem, - TReal aAnimationAlpha, - CHgVgMediaWall::THgVgAnimationState aAnimationState, - TInt aPickedItem, - CHgVgMediaWall::THgVgOpeningAnimationType aAnimationType) - { - TInt itemsOnScreen = 0; - - for (TInt i = 0; i < aRowCount; i++) - { - SetupQuadsToRow(i, aRowCount, itemsOnScreen, - aItems, aViewX, aViewY, aCurItem, aPrevItem, - aAnimationAlpha, aAnimationState, aPickedItem, - aAnimationType); - } - - TransformAndDraw(itemsOnScreen, aAnimationType); - } - - -TReal CHgVgMediaWallRenderer::GetWorldSpaceRowHeight() const - { - return (120.0 / 90.0 * 0.25 + 0.02); - } - - -// --------------------------------------------------------------------------- -// CHgVgCoverflowRenderer::CreateGround() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::CreateGround() -{ - iGroundPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, KGroundScale, KGroundBias, - KGroundVerticesHint, KGroundSegmentsHint, (unsigned int)VG_PATH_CAPABILITY_ALL); - - vguRect(iGroundPath, 0, 0, 1, 1); - - VGfloat gradientStops[] = { - 0, 0.0f, 0.0f, 0.0f, 1.0f, - 0.01f, 0.0f, 0.0f, 0.0f, 0.95f, - 1.0f, 0.0f, 0.0f, 0.0f, 0.0f - }; - - VGfloat groundColor[4]; - GetGroundColorFromSkin(groundColor); - - gradientStops[1] = groundColor[0]; - gradientStops[2] = groundColor[1]; - gradientStops[3] = groundColor[2]; - - gradientStops[6] = groundColor[0]; - gradientStops[7] = groundColor[1]; - gradientStops[8] = groundColor[2]; - - gradientStops[11] = groundColor[0]; - gradientStops[12] = groundColor[1]; - gradientStops[13] = groundColor[2]; - - iGroundPaint = vgCreatePaint(); - - vgSetParameteri(iGroundPaint, VG_PAINT_TYPE, - VG_PAINT_TYPE_LINEAR_GRADIENT); - - vgSetParameterfv(iGroundPaint, VG_PAINT_LINEAR_GRADIENT, - KNumGroundGradientValues, KGroundGradient); - - vgSetParameteri(iGroundPaint, VG_PAINT_COLOR_RAMP_SPREAD_MODE, - VG_COLOR_RAMP_SPREAD_PAD); - - vgSetParameterfv(iGroundPaint, VG_PAINT_COLOR_RAMP_STOPS, - 5*3, gradientStops); - - -} - -// --------------------------------------------------------------------------- -// CHgVgCoverflowRenderer::DrawGround() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::DrawGround(TInt aWidth, TInt aHeight) - { - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); - vgLoadIdentity(); - //vgTranslate(iOffset.iX, iOffset.iY); - vgScale(aWidth, aHeight); - vgSetPaint(iGroundPaint, VG_FILL_PATH); - vgDrawPath(iGroundPath, VG_FILL_PATH); - } - - - -// --------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::SetupQuadsToRow() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::SetupQuadsToRow( - TInt aRow, - TInt aRowCount, - TInt &aItemsOnScreen, - RPointerArray& aItems, - TReal aViewX, TReal aViewY, - TInt aCurItem, TInt aPrevItem, - TReal aAnimationAlpha, - CHgVgMediaWall::THgVgAnimationState aState, - TInt aPickedItem, - CHgVgMediaWall::THgVgOpeningAnimationType aAnimationType) - { - - if (aItems.Count() <= 0) - return; - - TReal src = aViewX; - TReal frac; - Math::Frac(frac, src); - VGfloat fDiff = frac; - - TBool isSelectionToFocusedItem = - ( - (aState == CHgVgMediaWall::EHgVgMediaWallAnimationStateOpening) || - (aState == CHgVgMediaWall::EHgVgMediaWallAnimationStateClosing) || - (aState == CHgVgMediaWall::EHgVgMediaWallAnimationStateItemOpened) - ) && - (aAnimationType != CHgVgMediaWall::EHgVgOpeningAnimationNone); - - TReal selectionAnimationAlpha = aAnimationAlpha; - if (aState == CHgVgMediaWall::EHgVgMediaWallAnimationStateItemOpened) - selectionAnimationAlpha = 1.0f; - - VGfloat leftIndex = (VGfloat)(iSelectedItemIndex - 1); - VGfloat leftX = iLeftStackEndX; - VGfloat step = iSpaceBetween; - - if (AknLayoutUtils::LayoutMirrored()) - { - leftX = iRightStackStartX; - step = -step; - } - - TInt i = 0; - - TInt currentRow = ((TInt)aViewX - (iSelectedItemIndex)) * aRowCount; - - VGfloat zFar = iZNear; - VGfloat zNear = zFar - 0.8; - - TInt itemsOnRow = 0; - - TInt selX = aCurItem / 3; - TInt selY = aCurItem % 3; - - TReal div = (TReal)(iQuads.Count()/aRowCount/2-1); - - while (itemsOnRow < (iQuads.Count()/aRowCount)) - { - - TInt itemIndex = currentRow + i * 3 + aRow; - - if (itemIndex < 0) - { - i++; - continue; - } - - // all items drawn and at the end of the list, lets bail out. - if (itemIndex >= aItems.Count()) - { - break; - } - - TQuad* q = iQuads[aItemsOnScreen + itemsOnRow]; - - q->iZ = zFar; - q->iAngle = 0; - q->iFlipped = EFalse; - - VGfloat fi = (VGfloat)i - fDiff; - - q->iX = leftX - step * (leftIndex - fi); - q->iAlpha = 1; - - q->iItemIndex = itemIndex; - - if (aItems[itemIndex]->VgImage() == VG_INVALID_HANDLE) - { - q->iNoImage = ETrue; - } - else - { - q->iNoImage = EFalse; - q->iImage = aItems[itemIndex]->VgImage(); - } - - - VGfloat imW = (VGfloat) iImageSize.iWidth; - VGfloat imH = (VGfloat) iImageSize.iHeight; - - // width is constant but same aspect ratio must be preserved - VGfloat worldImageHeight = imH * (KWorldQuadWidth / imW); - - q->iY = (2 - aRow) * (worldImageHeight + KSpaceBetweenGridItems); - - if (aCurItem != KErrNotFound && itemIndex == aCurItem) - { - TReal alphaX = 1.0 - Min(Abs(aViewX - (TReal)selX), 1); - TReal alphaY = 1.0 - Min(Abs(aViewY - (TReal)selY), 1); - - q->iZ = HgVgHelper::Lerp(zFar, zNear, Min(alphaX, alphaY)); - } - else if (aPrevItem != KErrNotFound && itemIndex == aPrevItem) - { - TReal alphaX = 1.0 - Min(Abs(aViewX - (TReal)selX), 1); - TReal alphaY = 1.0 - Min(Abs(aViewY - (TReal)selY), 1); - - q->iZ = HgVgHelper::Lerp(zFar, zNear, 1.0f - Min(alphaX, alphaY)); - } - - q->iAlpha = HgVgHelper::Lerp(1, 0, Max(0.0, (Abs(q->iX)-1.0) / div)); - - if (isSelectionToFocusedItem && (itemIndex == aPickedItem)) - { - q->iAlpha = 1; - q->iFlipped = ETrue; - iBlurAlpha = selectionAnimationAlpha; - ApplyOpeningAnimation(q, selectionAnimationAlpha, zFar, - CHgVgMediaWall::EHgVgMediaWallStyleGrid, - aAnimationType); - } - - if (iFlipXY) - { - VGfloat temp = q->iX; - q->iX = q->iY; - q->iY = -temp; - } - - i++; - itemsOnRow++; - } - - aItemsOnScreen += itemsOnRow; - - } - - - -// --------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::SetupQuads() -// --------------------------------------------------------------------------- -// -TInt CHgVgMediaWallRenderer::SetupQuads(RPointerArray& aItems, - TInt aSelectedIndex, TReal aNextIndex, - VGfloat aViewPosition, - VGfloat aAnimationAlpha, - CHgVgMediaWall::THgVgAnimationState aState, - CHgVgMediaWall::THgVgOpeningAnimationType aOpeningAnimationType) - { - - - if (aItems.Count() <= 0) - return 0; - - VGfloat selectionAnimationAlpha = aAnimationAlpha; - - TBool isSelectionToFocusedItem = - ((aState == CHgVgMediaWall::EHgVgMediaWallAnimationStateOpening) || - (aState == CHgVgMediaWall::EHgVgMediaWallAnimationStateClosing) || - (aState == CHgVgMediaWall::EHgVgMediaWallAnimationStateItemOpened)) && - (aOpeningAnimationType != CHgVgMediaWall::EHgVgOpeningAnimationNone); - - if (aState == CHgVgMediaWall::EHgVgMediaWallAnimationStateItemOpened) - selectionAnimationAlpha = 1.0f; - - TReal src = aViewPosition; - TReal frac; - Math::Frac(frac, src); - VGfloat fDiff = frac; - - VGfloat zFar = iZFar; - VGfloat leftIndex = (VGfloat)(iSelectedItemIndex - 1); - VGfloat rightIndex = (VGfloat)(iSelectedItemIndex + 1); - VGfloat centerIndex = (VGfloat)iSelectedItemIndex; - VGfloat leftX = iLeftStackEndX; - VGfloat rightX = iRightStackStartX; - VGfloat step = iSpaceBetween; - VGfloat centerX = 0; - - if (AknLayoutUtils::LayoutMirrored()) - { - rightX = iLeftStackEndX; - leftX = iRightStackStartX; - step = -step; - } - - TInt i = 0; - TInt itemsOnScreen = 0; - TInt currentRow = (TInt)aViewPosition - KSelectedItemIndex; - - TReal dist = Min(Max(0, Abs(aNextIndex - aViewPosition) - 1.0f), 1.0f); - VGfloat zNear = HgVgHelper::Lerp(iZNear, iZFar, dist); - - while (itemsOnScreen < iQuads.Count()) - { - TInt itemIndex = currentRow + i; - - if (itemIndex < 0) - { - i++; - continue; - } - - if (itemIndex >= aItems.Count()) - { - break; - } - - TQuad* q = iQuads[itemsOnScreen]; - - q->iY = 0; - q->iZ = zFar; - q->iAngle = 0; - q->iFlipped = EFalse; - - VGfloat fi = (VGfloat)i - fDiff; - - if (fi < leftIndex) - { - q->iX = leftX - step * (leftIndex - fi); - } - else if (fi >= leftIndex && fi < centerIndex) - { - q->iX = HgVgHelper::Lerp(leftX, centerX, fi - leftIndex); - q->iZ = HgVgHelper::Lerp(zFar, zNear, fi - leftIndex); - } - else if (fi >= centerIndex && fi < rightIndex) - { - q->iX = HgVgHelper::Lerp(centerX, rightX, fi - centerIndex); - q->iZ = HgVgHelper::Lerp(zNear, zFar, fi - centerIndex); - } - else if (fi >= rightIndex) - { - q->iX = rightX + step * (fi - rightIndex); - } - - q->iAlpha = HgVgHelper::Lerp(1, 0, Max(0.0, (Abs(q->iX)-2.0) / (TReal)(iQuads.Count()/2-2))); - - - q->iItemIndex = itemIndex; - - if (aItems[itemIndex]->VgImage() == VG_INVALID_HANDLE) - { - q->iNoImage = ETrue; - } - else - { - q->iNoImage = EFalse; - q->iImage = aItems[itemIndex]->VgImage(); - } - - if (isSelectionToFocusedItem && (itemIndex == aSelectedIndex)) - { - q->iAlpha = 1; - q->iFlipped = ETrue; - iBlurAlpha = selectionAnimationAlpha; - ApplyOpeningAnimation(q, selectionAnimationAlpha, zNear, - CHgVgMediaWall::EHgVgMediaWallStyleCoverflowFullScreen, - aOpeningAnimationType); - } - - i++; - itemsOnScreen++; - } - - return itemsOnScreen; - } - - -// --------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::ApplyFlipAnimation() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::ApplyOpeningAnimation(CHgVgMediaWallRenderer::TQuad* aQuad, - TReal aAnimationAlpha, TReal aZNear, CHgVgMediaWall::THgVgMediaWallStyle /*aMediaWallStyle*/, - CHgVgMediaWall::THgVgOpeningAnimationType aAnimationStyle) - { - VGfloat wz = 0.0f; - VGfloat wy = (iCameraBaseY + iCameraY); - VGfloat wx = (iCameraBaseX + iCameraX); - VGfloat angle = 0; - - if (aAnimationStyle == CHgVgMediaWall::EHgVgOpeningAnimationFlipToFront) - { - wz = iFlippedZ; - angle = iFlipAngle; - wx += iFlippedX; - wy += iFlippedY; - } - else if (aAnimationStyle == CHgVgMediaWall::EHgVgOpeningAnimationZoomToFront) - { - wz = iFlippedZ; - wx += iFlippedX; - wy += iFlippedY; - } - - if (iBlurImage != VG_INVALID_HANDLE) - { - VGImage image = aQuad->iNoImage ? iDefaultImage : aQuad->iImage; - UpdateBlurChildImage(image); - } - - aQuad->iZ = HgVgHelper::Lerp(aZNear, wz, aAnimationAlpha); - aQuad->iX = HgVgHelper::Lerp(aQuad->iX, wx, aAnimationAlpha); - aQuad->iY = HgVgHelper::Lerp(aQuad->iY, wy, aAnimationAlpha); - aQuad->iAngle = -aAnimationAlpha * angle; - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::GetGroundColorFromSkin() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::GetGroundColorFromSkin(VGfloat* aColor) - { - TRgb color(KRgbBlack); - // get text color from skin - if ( AknsUtils::AvkonSkinEnabled() ) - { - // this does not modify color unless it gets a correct one - // no real need to check errors - AknsUtils::GetCachedColor( - AknsUtils::SkinInstance(), - color, - KAknsIIDQsnTextColors, - EAknsCIQsnTextColorsCG6 ); - } - - if (color.Blue() < 128) - color = KRgbWhite; - else - color = KRgbBlack; - - aColor[0] = (VGfloat)color.Red() / KColorByteToFloat; - aColor[1] = (VGfloat)color.Green() / KColorByteToFloat; - aColor[2] = (VGfloat)color.Blue() / KColorByteToFloat; - aColor[3] = 1.0f; - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::HandleSkinChange() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::HandleSkinChange() - { - vgDestroyPaint(iGroundPaint); - vgDestroyPath(iGroundPath); - CreateGround(); - } - -// --------------------------------------------------------------------------- -// CHgVgMediaWallRenderer::AdjustSettingsBaseOnFrontRect() -// --------------------------------------------------------------------------- -// -void CHgVgMediaWallRenderer::AdjustSettingsBasedOnRects(const TRect& aFrontRect, - TReal aZOffset) - { - - // size of the images should be the same as given for aFrontRect - iImageSize = aFrontRect.Size(); - - // calculate screen center point - TPoint center(iRect.Width()/2, iRect.Height()/2); - - // near z coordinate is calculated so that the size of the quad at front matches - // aFrontRect - iZNear = GetZInWorldSpaceBasedOnWidth(aFrontRect.Width()); - iZFar = iZNear + aZOffset; - - // width is always constant - VGfloat ImW = KWorldQuadWidth; - // height is altered by image aspect ratio - VGfloat ImH = (VGfloat)(iImageSize.iHeight) * (KWorldQuadWidth / (VGfloat)iImageSize.iWidth); - - // camera coordinates are altered so that the front quad - // is at correct place - VGfloat deltaX = aFrontRect.Center().iX - center.iX; - VGfloat deltaY = aFrontRect.Center().iY - center.iY; - - iCameraBaseX = ImW * (deltaX / (VGfloat)iImageSize.iWidth); - iCameraBaseY = ImH * (deltaY / (VGfloat)iImageSize.iHeight); - iCameraBaseZ = 0; - - } - - -void CHgVgMediaWallRenderer::TransformAndDraw(TInt itemsOnScreen, - CHgVgMediaWall::THgVgOpeningAnimationType aOpeningAnimationType) - { -/* - vgSeti( VG_SCISSORING, VG_TRUE ); - VGfloat rects[4]; - rects[0]= 0; - rects[1]= 0; - rects[2]= iRect.Width(); - rects[3]= iRect.Height(); - vgSetfv( VG_SCISSOR_RECTS, 4, rects ); -*/ - vgSeti( VG_SCISSORING, VG_FALSE ); - - if (itemsOnScreen > 0) - { - - // draw reflections - - TransformQuads(itemsOnScreen, - iReflectionsEnabled, iFov, aOpeningAnimationType); - - SortQuads(itemsOnScreen); - - if (iReflectionsEnabled) - DrawQuads(ETrue); - - DrawGround(iRect.Width(), iRect.Height() / KGroundHeightFactor); - - DrawQuads(EFalse); - - } - else - { - - // if no items exists, just draw ground plane. - DrawGround(iRect.Width(), iRect.Height() / KGroundHeightFactor); - - } - - //vgSeti( VG_SCISSORING, VG_FALSE ); - - } - -void CHgVgMediaWallRenderer::SetReflections(TBool aEnabled) - { - iReflectionsEnabled = aEnabled; - } - -TBool CHgVgMediaWallRenderer::ReflectionsEnabled() const - { - return iReflectionsEnabled; - } - -TSize CHgVgMediaWallRenderer::ImageSize() const - { - return iImageSize; - } - - -void CHgVgMediaWallRenderer::SetFlippedRect(const TRect& aFlippedRect) - { - iFlippedWidth = aFlippedRect.Width(); - iFlippedHeight = aFlippedRect.Height(); - iFlippedZ = GetZInWorldSpaceBasedOnWidth(aFlippedRect.Width()); - TPoint center = iRect.Center(); - - VGfloat ImW = KWorldQuadWidth; - VGfloat ImH = (VGfloat)(iImageSize.iHeight) * (KWorldQuadWidth / (VGfloat)iImageSize.iWidth); - VGfloat deltaX = aFlippedRect.Center().iX - center.iX; - VGfloat deltaY = aFlippedRect.Center().iY - center.iY; - - iFlippedY = -ImH * (deltaY / (VGfloat)aFlippedRect.Height()); - iFlippedX = ImW * (deltaX / (VGfloat)aFlippedRect.Width()); - } - -VGfloat CHgVgMediaWallRenderer::GetZInWorldSpaceBasedOnWidth(VGfloat aWidth) - { - - // calculate screen center point - TPoint center(iRect.Width()/2, iRect.Height()/2); - - // Z-coordinate is set so that the front quad has - // the correct size - TReal hw = iRect.Width() * 0.5f; - TReal alpha = iFov / 2.0f; - TReal tanAlpha; - Math::Tan(tanAlpha, alpha); - TReal d = hw / tanAlpha; - - return (d * (-KWorldQuadWidth/2)) / ((TReal)(center.iX - aWidth/2) - hw); - - } - -void CHgVgMediaWallRenderer::SetFlipAngle(TReal aAngle) - { - iFlipAngle = aAngle; - } - - -void CHgVgMediaWallRenderer::EnableBlurOnFlip(TBool aEnabled, TReal aBlurX, TReal aBlurY) - { - if (iBlurImage != VG_INVALID_HANDLE) - { - vgDestroyImage(iBlurImage); - iBlurImage = VG_INVALID_HANDLE; - } - if (aEnabled) - { - iBlurDeviationX = aBlurX; - iBlurDeviationY = aBlurY; - iBlurImage = vgCreateImage(VG_sRGBA_8888_PRE, iImageSize.iWidth, iImageSize.iHeight, - VG_IMAGE_QUALITY_NONANTIALIASED); - } - } - -void CHgVgMediaWallRenderer::UpdateBlurChildImage(VGImage aImage) - { - VGint width = vgGetParameteri(aImage, VG_IMAGE_WIDTH); - VGint height = vgGetParameteri(aImage, VG_IMAGE_HEIGHT); - - if (iBlurImageWidth != width || iBlurImageHeight != height) - { - vgDestroyImage(iChildBlurImage); - iChildBlurImage = vgChildImage(iBlurImage, 0, 0, width, height); - iBlurImageWidth = width; - iBlurImageHeight = height; - } - } - - -void CHgVgMediaWallRenderer::SetOffset(const TPoint& aOffset) - { - iOffset = aOffset; - } - -void CHgVgMediaWallRenderer::EnableFlipXY(TBool aEnabled) - { - iFlipXY = aEnabled; - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgScrollBar.cpp --- a/uifw/ganes/src/HgVgScrollBar.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,197 +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 "HgVgScrollBar.h" -#include "HgVgDrawBuffer.h" -#include "HgVgHelper.h" -#include "HgScrollbar.h" -#include -#include - - - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgVgScrollBar* CHgVgScrollBar::NewL( MHgScrollbarObserver& aObserver, - TRect aScrollbarRect, - TSize aTotalSize, - TSize aViewSize, - TBool aLandscapeScrolling, - CHgScroller::THgScrollBarType aScrollBarType ) - { - CHgVgScrollBar* self = new ( ELeave ) CHgVgScrollBar( ); - CleanupStack::PushL (self ); - self->ConstructL( aObserver, aScrollbarRect, aTotalSize, aViewSize, aLandscapeScrolling, aScrollBarType ); - CleanupStack::Pop ( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgVgScrollBar::ConstructL ( MHgScrollbarObserver& aObserver, TRect aScrollbarRect, - TSize aTotalSize, - TSize aViewSize, - TBool aLandscapeScrolling, - CHgScroller::THgScrollBarType aScrollBarType ) - { - ResizeL(aObserver, aScrollbarRect, aTotalSize, aViewSize, aLandscapeScrolling, - aScrollBarType); - - CreateImagesL(); - } - - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::CreateImagesL() -// ----------------------------------------------------------------------------- -// -void CHgVgScrollBar::CreateImagesL() - { - iScrollbarBg = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarBg()); - iScrollbarBgSelected = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarBgSelected()); - iScrollbarHandle = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarHandle()); - iScrollbarHandleSelected = HgVgHelper::CreateVgImageFromIconL(*iScrollbar->ScrollbarHandleSelected()); - //iScrollbarHandleBg = HgVgHelper::CreateVgImageFromIconL(iScrollbar->ScrollbarHandleBg()); - } - - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::CHgVgMediaWall() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgScrollBar::CHgVgScrollBar( ) : -iEnabled(ETrue) - { - } - -// ----------------------------------------------------------------------------- -// CHgVgScrollBar::~CHgVgScrollBar() -// Destructor. -// ----------------------------------------------------------------------------- -// -CHgVgScrollBar::~CHgVgScrollBar ( ) - { - - vgDestroyImage(iScrollbarBg); - vgDestroyImage(iScrollbarBgSelected); - vgDestroyImage(iScrollbarHandle); - vgDestroyImage(iScrollbarHandleSelected); - //vgDestroyImage(iScrollbarHandleBg); - - delete iScrollbar; - - } - - -void CHgVgScrollBar::SetViewPosition( TPoint aPosition ) - { - iScrollbar->SetViewPosition(aPosition); - } - -TBool CHgVgScrollBar::HandlePointerEventL( const TPointerEvent& aEvent ) - { - if (!iEnabled) - return EFalse; - - return iScrollbar->HandlePointerEventL(aEvent); - } - -void CHgVgScrollBar::Draw(const TRect& aWindowRect, TReal aAlpha) const - { - if (!iEnabled) - return; - - TRect scrollbarRect = iScrollbar->ScrollbarRect(); - TPoint handlePosition = iScrollbar->HandlePosition(); - const CGulIcon* scrollbarBg = iScrollbar->ScrollbarBg(); - const CGulIcon* scrollbarBgSelected = iScrollbar->ScrollbarBgSelected(); - const CGulIcon* scrollbarHandle = iScrollbar->ScrollbarHandle(); - const CGulIcon* scrollbarHandleSelected = iScrollbar->ScrollbarHandleSelected(); - const CGulIcon* scrollbarHandleBg = iScrollbar->ScrollbarHandleBg(); - - if(scrollbarBg && scrollbarHandle && scrollbarHandleBg) - { - if(iScrollbar->Handler() && !iScrollbar->IsStatic()) - { - DrawImage(scrollbarRect.iTl, - iScrollbarBgSelected, - scrollbarBgSelected->Bitmap()->SizeInPixels(), aWindowRect, aAlpha); - - DrawImage(scrollbarRect.iTl + handlePosition, - iScrollbarHandleSelected, - scrollbarHandleSelected->Bitmap()->SizeInPixels(), aWindowRect, aAlpha); - } - else - { - DrawImage(scrollbarRect.iTl, - iScrollbarBg, - scrollbarBg->Bitmap()->SizeInPixels(), aWindowRect, aAlpha); - - DrawImage(scrollbarRect.iTl + handlePosition, - iScrollbarHandleBg, - scrollbarHandleBg->Bitmap()->SizeInPixels(), aWindowRect, aAlpha); - - DrawImage(scrollbarRect.iTl + handlePosition, - iScrollbarHandle, - scrollbarHandle->Bitmap()->SizeInPixels(), aWindowRect, aAlpha); - } - } - } - -void CHgVgScrollBar::DrawImage(const TPoint& aPosition, VGImage aImage, - const TSize& /*aSize*/, const TRect& aWindowRect, TReal aAlpha) const - { - TRgb color(255, 255, 255, aAlpha * 255.0f); - HgVgHelper::DrawImageColorized(aImage, color, aPosition, aWindowRect, EFalse); - } - -TBool CHgVgScrollBar::IsEnabled() const - { - return iEnabled; - } - -void CHgVgScrollBar::SetEnabled(TBool aEnabled) - { - iEnabled = aEnabled; - } - -void CHgVgScrollBar::ResizeL( - MHgScrollbarObserver& aObserver, - TRect aScrollbarRect, - TSize aTotalSize, - TSize aViewSize, - TBool aLandscapeScrolling, - CHgScroller::THgScrollBarType /*aScrollBarType */) - { - iScrollbar = CHgScrollbar::NewL(aObserver); - - iScrollbar->InitScrollBarL(aScrollbarRect, aTotalSize, aViewSize, aLandscapeScrolling); - } - - - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgSkinRenderer.cpp --- a/uifw/ganes/src/HgVgSkinRenderer.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /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: -* -*/ - -// INCLUDE FILES - -#include "HgVgSkinRenderer.h" -#include "HgVgHelper.h" -#include "HgVgDrawBuffer.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CHgVgSkinRenderer::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgVgSkinRenderer* CHgVgSkinRenderer::NewL(const TRect& aRect) - { - CHgVgSkinRenderer* self = new ( ELeave ) CHgVgSkinRenderer(aRect); - CleanupStack::PushL (self ); - self->ConstructL(); - CleanupStack::Pop ( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgSkinRenderer::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CHgVgSkinRenderer::ConstructL () - { - - iDrawBuffer = CHgVgDrawBuffer::NewL( TSize(iRect.Width(), iRect.Height()), EColor64K ); - - - } - -// ----------------------------------------------------------------------------- -// CHgVgSkinRenderer::CHgVgSkinRenderer() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgSkinRenderer::CHgVgSkinRenderer(const TRect& aRect) : iRect(aRect) - { - - } - -// ----------------------------------------------------------------------------- -// CHgVgSkinRenderer::~CHgVgSkinRenderer() -// Destructor. -// ----------------------------------------------------------------------------- -// -CHgVgSkinRenderer::~CHgVgSkinRenderer ( ) - { - - delete iDrawBuffer; - - vgDestroyImage(iSkinImage); - - } - -// ----------------------------------------------------------------------------- -// CHgVgSkinRenderer::UpdateSkin() -// Updates skin image. -// ----------------------------------------------------------------------------- -// -void CHgVgSkinRenderer::UpdateSkinL(const MObjectProvider* aProvider, - const CCoeControl* aControl) - { - // render skin to draw buffer - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - MAknsControlContext* cc = AknsDrawUtils::ControlContext( aProvider ); - AknsDrawUtils::DrawBackground( skin, cc, aControl, iDrawBuffer->Gc(), TPoint(0,0), - aControl->Rect(), KAknsDrawParamDefault ); - - // destroy old vg image - if (iSkinImage != VG_INVALID_HANDLE) - { - vgDestroyImage(iSkinImage); - iSkinImage = VG_INVALID_HANDLE; - } - - // create new image for the skin - iSkinImage = vgCreateImage(VG_sRGB_565, - iRect.Width(), iRect.Height(), - VG_IMAGE_QUALITY_NONANTIALIASED); - - // handle out of memory - VGErrorCode error = vgGetError(); - if (iSkinImage == VG_INVALID_HANDLE || error == VG_OUT_OF_MEMORY_ERROR) - { - User::Leave(KErrNoMemory); - } - - // Copy to draw buffer to vg image - iDrawBuffer->GetDrawBufferToVgImage(TRect(TPoint(0,0), TPoint(iRect.Width(), iRect.Height())), - TPoint(0,0), iSkinImage, VG_sRGB_565); - } - -void CHgVgSkinRenderer::SetRect( const TRect& aRect ) - { - iRect = aRect; - } - -// ----------------------------------------------------------------------------- -// CHgVgSkinRenderer::Draw -// Draws skin. -// ----------------------------------------------------------------------------- -// -void CHgVgSkinRenderer::Draw() const - { - HgVgHelper::DrawImage(iSkinImage, TPoint(0, 0), iRect); - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgSpring.cpp --- a/uifw/ganes/src/HgVgSpring.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,181 +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 "HgVgSpring.h" -#include "HgVgConstants.h" - -#include - -using namespace HgVgConstants; - - -THgVgSpring::THgVgSpring(TReal aSpringK, TReal aSpringDamping, - TReal aSpringMaxVelocity, TReal aPositionSnap, - TReal aVelocitySnap) : -iPrevX(0), -iPrevY(0), -iX(0), -iY(0), -iEndX(0), -iEndY(0), -iVelX(0), -iVelY(0), -iAccumulator(0), -iSpringK(aSpringK), -iSpringDamping(aSpringDamping), -iMaxSpringVelocity(aSpringMaxVelocity), -iPositionSnap(aPositionSnap), -iVelocitySnap(aVelocitySnap) - { - - } - -void THgVgSpring::SetConstants(TReal aSpringK, TReal aSpringDamping, - TReal aSpringMaxVelocity, TReal aPositionSnap, - TReal aVelocitySnap) - { - iSpringK = aSpringK; - iSpringDamping = aSpringDamping; - iMaxSpringVelocity = aSpringMaxVelocity; - iPositionSnap = aPositionSnap; - iVelocitySnap = aVelocitySnap; - } - - -void THgVgSpring::Reset(TReal aX, TReal aY) - { - iEndX = aX; - iEndY = aY; - Reset(); - } - -void THgVgSpring::Reset() - { - iPrevX = iX = iEndX; - iPrevY = iY = iEndY; - iAccumulator = 0; - iVelX = 0; - iVelY = 0; - } - -void THgVgSpring::SetXY(TReal aX, TReal aY) - { - iPrevX = iX = aX; - iPrevY = iY = aY; - } - -void THgVgSpring::SetEnd(TReal aX, TReal aY) - { - iEndX = aX; - iEndY = aY; - } - -void THgVgSpring::SetVelocity(TReal aVx, TReal aVy) - { - iVelX = aVx; - iVelY = aVy; - } - -TBool THgVgSpring::IntegratePhysics(TReal aDeltaTime, TBool aEndCondition) - { - iAccumulator += aDeltaTime; - while (iAccumulator >= KTimeStep) - { - iPrevX = iX; - iPrevY = iY; - - // calculate spring force F = -kx - bv - TReal Fx = -(iX - iEndX) * iSpringK - iVelX * iSpringDamping; - TReal Fy = -(iY - iEndY) * iSpringK - iVelY * iSpringDamping; - - // do euler integration - iVelX += Fx * KTimeStep; - iVelY += Fy * KTimeStep; - - // limit velocity to certain max - if (Abs(iVelX) > iMaxSpringVelocity) - iVelX = (iVelX < 0) ? -iMaxSpringVelocity : iMaxSpringVelocity; - - if (Abs(iVelY) > iMaxSpringVelocity) - iVelY = (iVelY < 0) ? -iMaxSpringVelocity : iMaxSpringVelocity; - - // do euler integration - iX += iVelX * KTimeStep; - iY += iVelY * KTimeStep; - - // decrease accumulator - iAccumulator -= KTimeStep; - - // snap to item if close enough and speed is small enough - if (Abs(iX - iEndX) < iPositionSnap && Abs(iVelX) < iVelocitySnap && - Abs(iY - iEndY) < iPositionSnap && Abs(iVelY) < iVelocitySnap && aEndCondition) - { - Reset(); - return ETrue; - } - - } - - return EFalse; - } - -TReal THgVgSpring::GetX() const - { - return iX; - } - -TReal THgVgSpring::GetY() const - { - return iY; - } - -TReal THgVgSpring::EndX() const - { - return iEndX; - } - -TReal THgVgSpring::EndY() const - { - return iEndY; - } - -TReal THgVgSpring::VelX() const - { - return iVelX; - } - -TReal THgVgSpring::VelY() const - { - return iVelY; - } - -TReal THgVgSpring::GetInterpolatedX() const - { - TReal a = iAccumulator / KTimeStep; - return iX * (1.0 - a) + iPrevX * a; - } - -TReal THgVgSpring::GetInterpolatedY() const - { - TReal a = iAccumulator / KTimeStep; - return iY * (1.0 - a) + iPrevY * a; - } - - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uifw/ganes/src/HgVgTimer.cpp --- a/uifw/ganes/src/HgVgTimer.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +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 "HgVgTimer.h" - -// ============================ MEMBER FUNCTIONS =============================== -// ----------------------------------------------------------------------------- -// CHgVgTimer::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CHgVgTimer* CHgVgTimer::NewL() - { - CHgVgTimer* self = new ( ELeave ) CHgVgTimer(); - CleanupStack::PushL (self ); - self->ConstructL( ); - CleanupStack::Pop ( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// CHgVgTimer::CHgVgTimer() -// C++ default constructor can NOT contain any code, that might leave. -// ----------------------------------------------------------------------------- -// -CHgVgTimer::CHgVgTimer() : CTimer(CActive::EPriorityStandard) - { - CActiveScheduler::Add( this ); - } - -// ----------------------------------------------------------------------------- -// CHgVgTimer::~CHgVgTimer() -// Destructor. -// ----------------------------------------------------------------------------- -// -CHgVgTimer::~CHgVgTimer ( ) - { - Cancel(); - } - -// ----------------------------------------------------------------------------- -// CHgVgTimer::Start() -// ----------------------------------------------------------------------------- -// -void CHgVgTimer::Start( TTimeIntervalMicroSeconds32 aDelay, - TTimeIntervalMicroSeconds32 aInterval, - TCallBack aCallBack) - { - iInterval = aInterval.Int(); - iCallBack = aCallBack; - HighRes( aDelay ); - } - -// ----------------------------------------------------------------------------- -// CHgVgTimer::RunL() -// ----------------------------------------------------------------------------- -// -void CHgVgTimer::RunL() - { - HighRes(iInterval); - iCallBack.CallBack(); - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/BMARM/AKNJAPANESEREADINGU.DEF --- a/uiutils/AknJapaneseReading/BMARM/AKNJAPANESEREADINGU.DEF Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -EXPORTS - CreateL__19CAknJapaneseReadingP10CPtiEngine @ 1 NONAME R3UNUSED ; CAknJapaneseReading::CreateL(CPtiEngine *) - ReadingTextL__19CAknJapaneseReading @ 2 NONAME R3UNUSED ; CAknJapaneseReading::ReadingTextL(void) - SetReadingEditor__17CReadingConverterR9CEikEdwin @ 3 NONAME R3UNUSED ; CReadingConverter::SetReadingEditor(CEikEdwin &) - HandleCompletionOfTransactionL__17CReadingConverter @ 4 NONAME R3UNUSED ; CReadingConverter::HandleCompletionOfTransactionL(void) - MainEditor__C17CReadingConverter @ 5 NONAME R3UNUSED ; CReadingConverter::MainEditor(void) const - NewL__17CReadingConverter @ 6 NONAME R3UNUSED ; CReadingConverter::NewL(void) - NewL__17CReadingConverterR9CEikEdwinT1 @ 7 NONAME R3UNUSED ; CReadingConverter::NewL(CEikEdwin &, CEikEdwin &) - ReadingEditor__C17CReadingConverter @ 8 NONAME R3UNUSED ; CReadingConverter::ReadingEditor(void) const - SetMainEditor__17CReadingConverterR9CEikEdwin @ 9 NONAME R3UNUSED ; CReadingConverter::SetMainEditor(CEikEdwin &) - diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/BWINS/AKNJAPANESEREADINGU.DEF --- a/uiutils/AknJapaneseReading/BWINS/AKNJAPANESEREADINGU.DEF Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -EXPORTS - ?CreateL@CAknJapaneseReading@@SAXPAVCPtiEngine@@@Z @ 1 NONAME ; public: static void __cdecl CAknJapaneseReading::CreateL(class CPtiEngine *) - ?ReadingTextL@CAknJapaneseReading@@SA?AVTPtrC16@@XZ @ 2 NONAME ; public: static class TPtrC16 __cdecl CAknJapaneseReading::ReadingTextL(void) - ?HandleCompletionOfTransactionL@CReadingConverter@@UAEXXZ @ 3 NONAME ; public: virtual void __thiscall CReadingConverter::HandleCompletionOfTransactionL(void) - ?MainEditor@CReadingConverter@@QBEAAVCEikEdwin@@XZ @ 4 NONAME ; public: class CEikEdwin & __thiscall CReadingConverter::MainEditor(void)const - ?NewL@CReadingConverter@@SAPAV1@AAVCEikEdwin@@0@Z @ 5 NONAME ; public: static class CReadingConverter * __cdecl CReadingConverter::NewL(class CEikEdwin &,class CEikEdwin &) - ?NewL@CReadingConverter@@SAPAV1@XZ @ 6 NONAME ; public: static class CReadingConverter * __cdecl CReadingConverter::NewL(void) - ?ReadingEditor@CReadingConverter@@QBEAAVCEikEdwin@@XZ @ 7 NONAME ; public: class CEikEdwin & __thiscall CReadingConverter::ReadingEditor(void)const - ?SetMainEditor@CReadingConverter@@QAEXAAVCEikEdwin@@@Z @ 8 NONAME ; public: void __thiscall CReadingConverter::SetMainEditor(class CEikEdwin &) - ?SetReadingEditor@CReadingConverter@@QAEXAAVCEikEdwin@@@Z @ 9 NONAME ; public: void __thiscall CReadingConverter::SetReadingEditor(class CEikEdwin &) - diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/EABI/AknJapaneseReadingU.DEF --- a/uiutils/AknJapaneseReading/EABI/AknJapaneseReadingU.DEF Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -EXPORTS - _ZN17CReadingConverter13SetMainEditorER9CEikEdwin @ 1 NONAME - _ZN17CReadingConverter16SetReadingEditorER9CEikEdwin @ 2 NONAME - _ZN17CReadingConverter30HandleCompletionOfTransactionLEv @ 3 NONAME - _ZN17CReadingConverter4NewLER9CEikEdwinS1_ @ 4 NONAME - _ZN17CReadingConverter4NewLEv @ 5 NONAME - _ZN19CAknJapaneseReading12ReadingTextLEv @ 6 NONAME - _ZN19CAknJapaneseReading7CreateLEP10CPtiEngine @ 7 NONAME - _ZNK17CReadingConverter10MainEditorEv @ 8 NONAME - _ZNK17CReadingConverter13ReadingEditorEv @ 9 NONAME - _ZThn4_N17CReadingConverter30HandleCompletionOfTransactionLEv @ 10 NONAME ; ## - diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/group/AknJapaneseReading.mmp --- a/uiutils/AknJapaneseReading/group/AknJapaneseReading.mmp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2002-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: MakMake Project file. -* -*/ - - -#include - -TARGET AknJapaneseReading.DLL -TARGETTYPE DLL -UID 0x1000008D 0x101F861C - -CAPABILITY CAP_GENERAL_DLL -VENDORID VID_DEFAULT - -SOURCEPATH ../src\ - -USERINCLUDE ../inc - -// This is a SYSTEMINCLUDE macro containing the middleware -// layer specific include directories -MW_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE ../../../inc - -SOURCE AknJapaneseReadingDLL.cpp -SOURCE AknJapaneseReading.cpp -SOURCE AknReadingConverter.cpp - -LIBRARY euser.lib -LIBRARY cone.lib -LIBRARY ptiengine.lib -LIBRARY eikcoctl.lib -LIBRARY fepbase.lib - -// End of file diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/group/bld.inf --- a/uiutils/AknJapaneseReading/group/bld.inf Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +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: Bldmake component description file. -* -*/ - - -#include - -PRJ_PLATFORMS - -PRJ_EXPORTS - -// IBY-files -../rom/AknJapaneseReading.iby CORE_MW_LAYER_IBY_EXPORT_PATH(aknjapanesereading.iby) - - -PRJ_MMPFILES - -#ifndef TOOLS -../group/AknJapaneseReading.mmp -#endif - -// End of file diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/inc/AknJapaneseReadingDLL.h --- a/uiutils/AknJapaneseReading/inc/AknJapaneseReadingDLL.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/* -* Copyright (c) 2002-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: Panic definitions. -* -*/ - - -#ifndef __AknJapaneseReadingDll_h__ -#define __AknJapaneseReadingDll_h__ - -#include - -enum TAknJapaneseReadingPanic - { - EAknJapaneseReadingNotPrepared - }; - -GLDEF_C void Panic(TAknJapaneseReadingPanic aPanic); - -#endif // __AknJapaneseReadingDll_h__ -// End of file diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/rom/AknJapaneseReading.iby --- a/uiutils/AknJapaneseReading/rom/AknJapaneseReading.iby Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +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 __AKNJAPANESEREADING_IBY__ -#define __AKNJAPANESEREADING_IBY__ - -file=ABI_DIR\BUILD_DIR\aknjapanesereading.dll SHARED_LIB_DIR\aknjapanesereading.dll - -#endif diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/src/AknJapaneseReading.cpp --- a/uiutils/AknJapaneseReading/src/AknJapaneseReading.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* -* Copyright (c) 2002-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: Implementation of CAknJapaneseReading class. -* -*/ - - -// INCLUDE FILES -#include "AknJapaneseReading.h" -#include "AknJapaneseReadingDLL.h" -#include - -// EXTERNAL DATA STRUCTURES - -// EXTERNAL FUNCTION PROTOTYPES - -// CONSTANTS - -// MACROS - -// LOCAL CONSTANTS AND MACROS - -// MODULE DATA STRUCTURES - -// LOCAL FUNCTION PROTOTYPES - -// FORWARD DECLARATIONS - -// ============================= LOCAL FUNCTIONS =============================== - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CAknJapaneseReading::CAknJapaneseReading -// Constructor. -// ----------------------------------------------------------------------------- -// -CAknJapaneseReading::CAknJapaneseReading() - : CCoeStatic(KAknJapaneseReadingStaticId) - { - } - -// ----------------------------------------------------------------------------- -// CAknJapaneseReading::~CAknJapaneseReading -// Destructor. -// ----------------------------------------------------------------------------- -// -CAknJapaneseReading::~CAknJapaneseReading() - { - } - -// ----------------------------------------------------------------------------- -// CAknJapaneseReading::CreateL -// -// ----------------------------------------------------------------------------- -// -EXPORT_C void CAknJapaneseReading::CreateL(CPtiEngine* aPtiEngine) - { - CAknJapaneseReading* self - = static_cast - (CCoeEnv::Static(KAknJapaneseReadingStaticId)); - if (!self) - { - // create singleton - self = new(ELeave) CAknJapaneseReading; - } - self->iPtiEngine = aPtiEngine; - } - -// ----------------------------------------------------------------------------- -// CAknJapaneseReading::ReadingTextL -// Return Reading Text when completed string. -// ----------------------------------------------------------------------------- -// -EXPORT_C TPtrC CAknJapaneseReading::ReadingTextL() - { - CAknJapaneseReading* self = Static(); - if (!self) - { - return TPtrC(); - } - return self->iPtiEngine->ReadingTextL(); - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/src/AknJapaneseReadingDLL.cpp --- a/uiutils/AknJapaneseReading/src/AknJapaneseReadingDLL.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2002-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: E32Dll and Panic definitions. -* -*/ - - -// INCLUDE FILES -#include -#include "AknJapaneseReadingDLL.h" - -// ----------------------------------------------------------------------------- -// Static DLL functions -// ----------------------------------------------------------------------------- -// - -GLDEF_C void Panic(TAknJapaneseReadingPanic aPanic) - { - _LIT(KPanicDll,"AknJapaneseReading"); - User::Panic(KPanicDll, aPanic); - } - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/AknJapaneseReading/src/AknReadingConverter.cpp --- a/uiutils/AknJapaneseReading/src/AknReadingConverter.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +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: ?Description -* -*/ - - -// INCLUDE FILES -#include "AknReadingConverter.h" -#include "AknJapaneseReading.h" -#include "eikedwin.h" -// LOCAL CONSTANTS AND MACROS - -// MODULE DATA STRUCTURES - - -// ============================ MEMBER FUNCTIONS =============================== - -inline CReadingConverter::CReadingConverter(CEikEdwin* aMainEditor, - CEikEdwin* aReadingEditor) : - iMainEditor(aMainEditor), - iReadingEditor(aReadingEditor) - { - } - -inline void CReadingConverter::ConstructL() - { - CCoeEnv::Static()->AddFepObserverL(*this); - } - -EXPORT_C CReadingConverter* CReadingConverter::NewL(CEikEdwin& aMainEditor, - CEikEdwin& aReadingEditor) - { - CReadingConverter* self = - new (ELeave) CReadingConverter( &aMainEditor, &aReadingEditor ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -EXPORT_C CReadingConverter* CReadingConverter::NewL() - { - CReadingConverter* self = - new (ELeave) CReadingConverter( NULL, NULL ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -CReadingConverter::~CReadingConverter() - { - delete iPreviousMainText; - CCoeEnv::Static()->RemoveFepObserver(*this); - } - -EXPORT_C void CReadingConverter::HandleCompletionOfTransactionL() - { - if (iMainEditor && iReadingEditor) - { - if (iMainEditor->IsFocused()) - { - TPtrC ptr = CAknJapaneseReading::ReadingTextL(); - TInt newTextLength = ptr.Length(); - if (newTextLength > 0) - { - TBool appendReading = ETrue; - if (iPreviousMainText) - { - HBufC* currentMainText = iMainEditor->GetTextInHBufL(); - if (currentMainText) - { - CleanupStack::PushL(currentMainText); - if (currentMainText->Compare(*iPreviousMainText) == 0) - { - // If there is no differences between previous main test - // and current its, there is nothing to append to Reading - // field. - appendReading = EFalse; - } - CleanupStack::PopAndDestroy(currentMainText); // currentMainText - } - else - { - // No buffer on Main editor in case of T9 insert word. - appendReading = EFalse; - } - } - - if (appendReading) - { - TInt maxLength = iReadingEditor->MaxLength(); - TInt oldTextLength = iReadingEditor->TextLength(); - if ((maxLength > 0) && (maxLength < oldTextLength + newTextLength)) - { - newTextLength = maxLength - oldTextLength; - } - HBufC* text = HBufC::NewLC(oldTextLength + newTextLength); - TPtr textPtr = text->Des(); - iReadingEditor->GetText(textPtr); - textPtr.Append(ptr.Ptr(), newTextLength); - iReadingEditor->SetTextL(text); - CleanupStack::PopAndDestroy(text); - iReadingEditor->DrawNow(); - // send EEventStateChanged event to observer - iReadingEditor->UpdateAllFieldsL(); - - // Save current main editor text - delete iPreviousMainText; - iPreviousMainText = NULL; - iPreviousMainText = HBufC::NewL(iMainEditor->TextLength()); - TPtr prev = iPreviousMainText->Des(); - iMainEditor->GetText(prev); - } - } - else - { - if (iMainEditor->TextLength() == 0) - { - iReadingEditor->SetTextL(&KNullDesC); - iReadingEditor->DrawNow(); - // send EEventStateChanged event to observer - iReadingEditor->UpdateAllFieldsL(); - delete iPreviousMainText; - iPreviousMainText = NULL; - } - } - } - } - } - -EXPORT_C void CReadingConverter::SetMainEditor(CEikEdwin& aMainEditor) - { - iMainEditor = &aMainEditor; - } - -EXPORT_C CEikEdwin& CReadingConverter::MainEditor() const - { - return *iMainEditor; - } - -EXPORT_C void CReadingConverter::SetReadingEditor(CEikEdwin& aReadingEditor) - { - iReadingEditor = &aReadingEditor; - } - -EXPORT_C CEikEdwin& CReadingConverter::ReadingEditor() const - { - return *iReadingEditor; - } - diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/gamerecognizer/group/01005A08.rss --- a/uiutils/gamerecognizer/group/01005A08.rss Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +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 definitions for project GameRecognizer -* -*/ - - -#include - -RESOURCE REGISTRY_INFO r_registry -{ - dll_uid = 0x01005A08; // should match name of this file - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x101F7D87; // const for all Data Recognizers - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0x11005A08; - version_no = 1; - display_name = "GameDataRec"; - default_data = ""; // Notify Interface - opaque_data = ""; - } - }; - } - }; -} - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/gamerecognizer/group/GameRecognizer.mmp --- a/uiutils/gamerecognizer/group/GameRecognizer.mmp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +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: Project definition file for project GameRecognizer -* -*/ - - -#include - -TARGET GameDataRec.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x01005A08 -START RESOURCE 01005A08.rss -TARGET GameDataRec.rsc -END - -CAPABILITY CAP_RECOGNISER -VENDORID VID_DEFAULT - -SOURCEPATH ../src - -SOURCE GameRecognizer.cpp - -USERINCLUDE ../inc - -// This is a SYSTEMINCLUDE macro containing the middleware -// layer specific include directories -MW_LAYER_SYSTEMINCLUDE - -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE /epoc32/include/ecom - - -LIBRARY euser.lib -LIBRARY apmime.lib - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/gamerecognizer/group/bld.inf --- a/uiutils/gamerecognizer/group/bld.inf Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +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: Build information file for project GameRecognizer -* -*/ - - -#include - -PRJ_EXPORTS - -// IBY-files -../rom/GameRecognizer.iby CORE_MW_LAYER_IBY_EXPORT_PATH(gamerecognizer.iby) - - -PRJ_MMPFILES -#ifndef TOOLS -GameRecognizer.mmp -#endif -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/gamerecognizer/inc/GameRecognizer.h --- a/uiutils/gamerecognizer/inc/GameRecognizer.h Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +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: -* -*/ - - -#ifndef GAMERECOGNIZER_H -#define GAMERECOGNIZER_H - -// includes -#include // For CApaDataRecognizerType - - -// constants -const TInt KMimeGameDataRecognizerValue = 0x01005A08; -const TInt KMimeGameDataRecognizerImplementationUid = 0x11005A08; -const TUid KUidMimeGameDataRecognizerValue = { KMimeGameDataRecognizerValue }; - -// We support only wmlc and wmlsc, but can recognize also -// other types internaly. - -const TInt KSupportedGameDataMimetypes(1); - -// Exported mimetypes -_LIT8( KGameDataMimeType, "application/x-nokiaGameData"); -_LIT( KDotNGD,".ngd"); -_LIT8( KGndHeader, "NGDX" ); - -// -// CGameRecognizer -// -class CGameRecognizer : public CApaDataRecognizerType - { -public: // from CApaDataRecognizerType - CGameRecognizer(); - virtual TUint PreferredBufSize(); - virtual TDataType SupportedDataTypeL(TInt aIndex) const; - static CApaDataRecognizerType* CreateRecognizerL(); - -private: // from CApaDataRecognizerType - virtual void DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer); - // New funtions -private: - TBool NameRecognizedL( const TDesC& aName) const; - TBool HeaderRecognized( const TDesC8& aName) const; - }; - -#endif // GAMERECOGNIZER_H - -// END FILE diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/gamerecognizer/rom/GameRecognizer.iby --- a/uiutils/gamerecognizer/rom/GameRecognizer.iby Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +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: Image description file for project GameRecognizer -* -*/ - - -#ifndef __GAMERECOGNIZER_IBY__ -#define __GAMERECOGNIZER_IBY__ - -ECOM_PLUGIN(gamedatarec.dll, 01005A08.rsc) - -#endif // __GAMERECOGNIZER_IBY__ - -// End of File diff -r 0e1e0022bd03 -r 2f0c06423c72 uiutils/gamerecognizer/src/GameRecognizer.cpp --- a/uiutils/gamerecognizer/src/GameRecognizer.cpp Thu Jul 29 14:21:56 2010 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,135 +0,0 @@ -/* -* Copyright (c) 2002, 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: -* -*/ - - -#include -#include -#include -#include "GameRecognizer.h" - -// -// CGameRecognizer -// -CGameRecognizer::CGameRecognizer () -:CApaDataRecognizerType(KUidMimeGameDataRecognizerValue, CApaDataRecognizerType::EHigh) - { - iCountDataTypes= KSupportedGameDataMimetypes; - } - -TUint CGameRecognizer::PreferredBufSize() - { - // no buffer recognition yet - return 128; - } - -TDataType CGameRecognizer::SupportedDataTypeL(TInt aIndex) const - { - __ASSERT_DEBUG(aIndex>=0 && aIndex < KSupportedGameDataMimetypes, User::Invariant()); - switch (aIndex) - { - case 0: - default: - return TDataType( KGameDataMimeType ); - } - } - -void CGameRecognizer::DoRecognizeL( const TDesC& aName, const TDesC8& aBuffer) - { - TBool nameOk( EFalse ); - TBool headerOk( EFalse ); - - iConfidence = ENotRecognized; - if ( aBuffer.Length() < 10 ) - { - return; - } - - // First try the name. Then the data. - nameOk = NameRecognizedL( aName ); - headerOk = HeaderRecognized( aBuffer ); - - if ( nameOk && headerOk ) - { - iConfidence = ECertain; - } - else if ( !nameOk && headerOk) - { - iConfidence = EProbable; - } - else if ( nameOk && !headerOk ) - { - iConfidence = EPossible; - } - else - { - return; - } - - iDataType = TDataType( KGameDataMimeType ); - } - -TBool CGameRecognizer::HeaderRecognized( const TDesC8& aBuffer ) const - { - if ( aBuffer.Find( KGndHeader ) > 10 ) - { - return ETrue; - } - else - { - return EFalse; - } - } - -TBool CGameRecognizer::NameRecognizedL( const TDesC& aName) const - { - TBool ret = EFalse; - if ( aName.Length() > 5 ) - { - TInt dotPos = aName.LocateReverse( '.' ); - if (dotPos != KErrNotFound) - { - TInt extLength = aName.Length() - dotPos; - HBufC* ext = aName.Right( extLength ).AllocL(); - CleanupStack::PushL( ext ); - if ( ext->CompareF( KDotNGD )==0 ) - { - ret = ETrue; - } - CleanupStack::PopAndDestroy( ext ); - } - } - return ret; - } - -CApaDataRecognizerType* CGameRecognizer::CreateRecognizerL() - { - return new (ELeave) CGameRecognizer(); - } - -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(KMimeGameDataRecognizerImplementationUid, - CGameRecognizer::CreateRecognizerL) - }; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; - } - -// End of File