# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272879092 -10800 # Node ID c499df2dbb332749fe85dd5834a75e8e822d6e39 # Parent 99ad1390cd33c8490596dfd021580c87d59a9004 Revision: 201015 Kit: 201018 diff -r 99ad1390cd33 -r c499df2dbb33 data/photos.css --- a/data/photos.css Fri Apr 16 14:58:46 2010 +0300 +++ b/data/photos.css Mon May 03 12:31:32 2010 +0300 @@ -39,12 +39,12 @@ fixed-height:12.2811un; } -HbListViewItem::icon-1[graphicsSize="Image"]:portrait{ +HbListViewItem::icon-1[graphicsSize="Thumbnail"]:portrait{ fixed-height: 13.43283un; fixed-width: 15.522388un; } -HbListViewItem::icon-1[graphicsSize="Image"]:landscape{ +HbListViewItem::icon-1[graphicsSize="Thumbnail"]:landscape{ fixed-height: 13.43283un; fixed-width: 15.522388un; } diff -r 99ad1390cd33 -r c499df2dbb33 engine/collectionframework/datasource/manager/bwins/glxdatasourcemanageru.def --- a/engine/collectionframework/datasource/manager/bwins/glxdatasourcemanageru.def Fri Apr 16 14:58:46 2010 +0300 +++ b/engine/collectionframework/datasource/manager/bwins/glxdatasourcemanageru.def Mon May 03 12:31:32 2010 +0300 @@ -50,4 +50,6 @@ ?ThumbnailInfo@CGlxThumbnailRequest@@QBEPAVCGlxtnFileInfo@@XZ @ 49 NONAME ; class CGlxtnFileInfo * CGlxThumbnailRequest::ThumbnailInfo(void) const ?ThumbnailRequest@CGlxThumbnailRequest@@QBEXAAVTGlxThumbnailRequest@@@Z @ 50 NONAME ; void CGlxThumbnailRequest::ThumbnailRequest(class TGlxThumbnailRequest &) const ?TryStartTask@CGlxDataSource@@IAEXH@Z @ 51 NONAME ; void CGlxDataSource::TryStartTask(int) + ?initializeTextResolverSymbian@CGlxCollectionPluginBase@@IAEXXZ @ 52 NONAME ; void CGlxCollectionPluginBase::initializeTextResolverSymbian(void) + ?LoadLocalizedStringLC@CGlxCollectionPluginBase@@IAEPAVHBufC16@@ABVTDesC16@@@Z @ 53 NONAME ; class HBufC16 * CGlxCollectionPluginBase::LoadLocalizedStringLC(class TDesC16 const &) diff -r 99ad1390cd33 -r c499df2dbb33 engine/collectionframework/datasource/manager/eabi/glxdatasourcemanageru.def --- a/engine/collectionframework/datasource/manager/eabi/glxdatasourcemanageru.def Fri Apr 16 14:58:46 2010 +0300 +++ b/engine/collectionframework/datasource/manager/eabi/glxdatasourcemanageru.def Mon May 03 12:31:32 2010 +0300 @@ -80,4 +80,6 @@ _ZThn28_N14CGlxDataSource18DataSourceRequestLEP11CGlxRequestR29MGlxDataSourceRequestObserver @ 79 NONAME ; ## _ZThn28_N14CGlxDataSource5CloseER28MGlxDataSourceUpdateObserver @ 80 NONAME ; ## _ZThn28_N24CGlxCollectionPluginBase13HandleMessageER9CMPXMedia @ 81 NONAME ; ## + _ZN24CGlxCollectionPluginBase21LoadLocalizedStringLCERK7TDesC16 @ 82 NONAME + _ZN24CGlxCollectionPluginBase29initializeTextResolverSymbianEv @ 83 NONAME diff -r 99ad1390cd33 -r c499df2dbb33 engine/collectionframework/datasource/manager/group/glxdatasourcemanager.mmp --- a/engine/collectionframework/datasource/manager/group/glxdatasourcemanager.mmp Fri Apr 16 14:58:46 2010 +0300 +++ b/engine/collectionframework/datasource/manager/group/glxdatasourcemanager.mmp Mon May 03 12:31:32 2010 +0300 @@ -49,6 +49,8 @@ SYSTEMINCLUDE ../../../../../commonutilities/common/inc SYSTEMINCLUDE ../../../../../inc SYSTEMINCLUDE ../../../thumbnailcreator/inc +SYSTEMINCLUDE /epoc32/include/mw/hb/hbcore + // System includes from epoc32/include @@ -62,6 +64,7 @@ LIBRARY mpxcommon.lib LIBRARY glxcommon.lib LIBRARY flogger.lib +LIBRARY HbCore.lib // End of File diff -r 99ad1390cd33 -r c499df2dbb33 engine/collectionframework/datasource/manager/inc/glxcollectionpluginbase.h --- a/engine/collectionframework/datasource/manager/inc/glxcollectionpluginbase.h Fri Apr 16 14:58:46 2010 +0300 +++ b/engine/collectionframework/datasource/manager/inc/glxcollectionpluginbase.h Mon May 03 12:31:32 2010 +0300 @@ -220,6 +220,18 @@ */ IMPORT_C HBufC* LoadLocalizedStringLC(const TDesC& aResourceFile, const TInt aResourceId); + /** + * initialize the TextResolver for the symbian code + */ + IMPORT_C void initializeTextResolverSymbian(); + + /** + * returns localised string. + * @param aStringName - name of the string that need to be localised. + * @return HBufC* containing the required string. + */ + IMPORT_C HBufC* LoadLocalizedStringLC(const TDesC& aStringName); + IMPORT_C virtual TGlxFilterProperties DefaultFilter(TInt aLevel); protected: diff -r 99ad1390cd33 -r c499df2dbb33 engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp --- a/engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/engine/collectionframework/datasource/manager/src/glxcollectionpluginbase.cpp Mon May 03 12:31:32 2010 +0300 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "glxcommandrequest.h" @@ -514,6 +515,18 @@ return filterProperties; } +EXPORT_C void CGlxCollectionPluginBase::initializeTextResolverSymbian() + { + TRACER("CGlxCollectionPluginBase::initializeTextResolverSymbian"); + _LIT(KSomeFile, "photos_"); + _LIT(KPath, "z:\\resource\\qt\\translations"); + HbTextResolverSymbian::Init(KSomeFile, KPath); + } +EXPORT_C HBufC* CGlxCollectionPluginBase::LoadLocalizedStringLC(const TDesC& aStringName) + { + TRACER("void CGlxCollectionPluginBase::LoadLocalizedStringLC()"); + return HbTextResolverSymbian::LoadLC(aStringName); + } // End of file diff -r 99ad1390cd33 -r c499df2dbb33 engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsidlist.cpp --- a/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsidlist.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcetaskmdsidlist.cpp Mon May 03 12:31:32 2010 +0300 @@ -67,8 +67,6 @@ #include "glxdatasourcemds.hrh" #include "glxdatasourcemdsutility.h" -// CONSTANTS -const TInt KGlxAlbumPromotionPosition = 0; _LIT(KPropertyDefNameCreationDate, "CreationDate"); diff -r 99ad1390cd33 -r c499df2dbb33 engine/collectionframework/plugins/glxcollectionpluginalbums/src/glxcollectionpluginalbums.cpp --- a/engine/collectionframework/plugins/glxcollectionpluginalbums/src/glxcollectionpluginalbums.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/engine/collectionframework/plugins/glxcollectionpluginalbums/src/glxcollectionpluginalbums.cpp Mon May 03 12:31:32 2010 +0300 @@ -97,6 +97,7 @@ void CGlxCollectionPluginAlbums::ConstructL() { iDataSource = MGlxDataSource::OpenDataSourceL(KGlxDefaultDataSourceUid, *this); + initializeTextResolverSymbian(); } void CGlxCollectionPluginAlbums::CpiAttributeAdditionalAttributes(const TMPXAttribute& aCpiAttribute, RArray& aAttributeArray) @@ -275,13 +276,15 @@ { if( TGlxMediaId(KCapturedAlbumId) == aMediaId ) { - HBufC* title = LoadLocalizedStringLC(KResourceFile, R_ALBUM_CAMERA_TITLE); - aResponse->SetTextValueL(attr, *title); - CleanupStack::PopAndDestroy(title); + _LIT(KCameraText,"txt_photos_dblist_my_camera"); + HBufC* title = LoadLocalizedStringLC(KCameraText); + aResponse->SetTextValueL(attr, *title); + CleanupStack::PopAndDestroy(title); } else if (TGlxMediaId(KFavoriteAlbumId) == aMediaId ) { - HBufC* title = LoadLocalizedStringLC(KResourceFile, R_ALBUM_FAVORITES_TITLE); + _LIT(KMyFavText,"txt_photos_dblist_my_favorites"); + HBufC* title = LoadLocalizedStringLC(KMyFavText); aResponse->SetTextValueL(attr, *title); CleanupStack::PopAndDestroy(title); } diff -r 99ad1390cd33 -r c499df2dbb33 gallery/sis/glxgallery.pkg --- a/gallery/sis/glxgallery.pkg Fri Apr 16 14:58:46 2010 +0300 +++ b/gallery/sis/glxgallery.pkg Mon May 03 12:31:32 2010 +0300 @@ -85,6 +85,7 @@ "\epoc32\data\z\resource\apps\0xE2C223D9.mif" - "!:\resource\apps\0xE2C223D9.mif" ;qt dlls +"\epoc32\release\armv5\urel\glxtvoutwrapper.dll" -"!:\sys\bin\glxtvoutwrapper.dll" "\epoc32\release\armv5\urel\glxmedialistwrapper.dll" -"!:\sys\bin\glxmedialistwrapper.dll" "\epoc32\release\armv5\urel\glxexternalutility.dll" -"!:\sys\bin\glxexternalutility.dll" "\epoc32\release\armv5\urel\glxmediamodel.dll" -"!:\sys\bin\glxmediamodel.dll" diff -r 99ad1390cd33 -r c499df2dbb33 gallery/sis/photosqt_stub.pkg --- a/gallery/sis/photosqt_stub.pkg Fri Apr 16 14:58:46 2010 +0300 +++ b/gallery/sis/photosqt_stub.pkg Mon May 03 12:31:32 2010 +0300 @@ -76,6 +76,7 @@ ""- "z:\resource\apps\0xE2C223D9.mif" ;qt dlls +""-"z:\sys\bin\glxtvoutwrapper.dll" ""-"z:\sys\bin\glxmedialistwrapper.dll" ""-"z:\sys\bin\glxexternalutility.dll" ""-"z:\sys\bin\glxmediamodel.dll" diff -r 99ad1390cd33 -r c499df2dbb33 group/bld_glx.inf --- a/group/bld_glx.inf Fri Apr 16 14:58:46 2010 +0300 +++ b/group/bld_glx.inf Mon May 03 12:31:32 2010 +0300 @@ -60,20 +60,4 @@ #include "../ui/uiengine/drmutility/group/bld.inf" #include "../ui/uiengine/medialists/group/bld.inf" -#include "../tvout/group/bld.inf" - -// include the icons -//rem #include "../icons/bld.inf" - -// include the view framework subsystem -//rem #include "../viewframework/group/bld.inf" - -// include the controllers subsystem -//rem #include "../controllers/group/bld.inf" - -// Include the application -//rem #include "../gallery/group/bld.inf" - -// include the slideshow build -//rem #include "../slideshow/group/bld.inf" - +#include "../tvout/tvoutengine/group/bld.inf" diff -r 99ad1390cd33 -r c499df2dbb33 imageviewerapp/imageviewerapp.pro --- a/imageviewerapp/imageviewerapp.pro Fri Apr 16 14:58:46 2010 +0300 +++ /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: -#* -#*/ - -SERVICEAPP = app -TARGET = imageviewerapp -DEPENDPATH += . -INCLUDEPATH += . \ - ../inc \ - ../ui/inc \ - ../ui/viewmanagement/statehandler/inc \ - ../ui/uiengine/model/mediamodel/inc \ - ../ui/uiengine/medialistwrapper/inc \ - ../loggers/loggerqt/inc \ - ../ui/views/viewsfactory/inc \ - ../ui/views/viewbase/inc - - -CONFIG += hb - -symbian: { - INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE - TARGET.UID3 = 0x200071B3 - isEmpty(TARGET.EPOCSTACKSIZE):TARGET.EPOCSTACKSIZE = 0x14000 - isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 20480 \ - 41943040 - TARGET.CAPABILITY = ALL \ - -TCB -} -RESOURCES += ../photos.qrc - - -LIBS += -lglxloggerqt.dll \ - -lglxviews.dll \ - -lglxmediamodel.dll \ - -lglxstatehandler.dll \ - -lglximageviewermanager.dll - -# Input -SOURCES += main.cpp - -RSS_RULES += \ - "hidden = KAppIsHidden;" \ - "embeddability = KAppEmbeddableOnly;" \ - "datatype_list = " \ - " {" \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/jpeg\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/jpg\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/jp2\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/tiff\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/x-wmf\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/ico\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/gif\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/bmp\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/x-bmp\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/x-bitmap\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/x-xbitmap\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/x-win-bitmap\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/x-windows-bmp\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/ms-bmp\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/x-ms-bmp\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/vnd.wap.wbmp\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/png\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/x-epoc-mbm\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/vnd.nokia.ota-bitmap\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/x-ota-bitmap\";" \ - " }," \ - " DATATYPE" \ - " {" \ - " priority = EDataTypePriorityHigh;" \ - " type = \"image/mng\";" \ - " }" \ - " };" \ - diff -r 99ad1390cd33 -r c499df2dbb33 imageviewerapp/main.cpp --- a/imageviewerapp/main.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies 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 -#include -#include -#include -#include - -#include -#include - - -int main(int argc, char *argv[]) -{ - // Initialization - HbApplication app(argc, argv); - QStringList args = QApplication::arguments(); - -#ifdef _DEBUG - foreach (QString arg, args) - { - qDebug() << "GlxImageViewer: cmdline arg=" << qPrintable(arg); - } -#endif - - CGlxImageViewerManager* imageViewerInstance = CGlxImageViewerManager::InstanceL(); - - QString arg = args[1]; - arg.replace(QString("/"), QString("\\")); - - TPtrC16 str(reinterpret_cast(arg.utf16())); - HBufC* uri = str.Alloc(); - - bool isPrivatepath = arg.contains("\\private\\", Qt::CaseInsensitive); ; - - RFile fileHandle; - RFs fs; - - - if(!isPrivatepath){ - imageViewerInstance->SetImageUriL(*uri); - } - else{ - fs.Connect(); - TInt err = fileHandle.Open( fs, *uri, EFileShareReadersOnly ); - if ( err ) - { - User::LeaveIfError( fileHandle.Open( fs, *uri, EFileShareAny ) ); - } - imageViewerInstance->SetImageFileHandleL(fileHandle); - } - - GlxStateManager mStateMgr; - mStateMgr.launchFromExternal(); - - // Enter event loop - int ret = app.exec(); - - fileHandle.Close(); - fs.Close(); - - imageViewerInstance->Close(); - return ret; -} diff -r 99ad1390cd33 -r c499df2dbb33 inc/glxlocalisationstrings.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/inc/glxlocalisationstrings.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localisation strings +* +*/ + +#ifndef GLXLOCALISATIONSTRINGS_H_ +#define GLXLOCALISATIONSTRINGS_H_ + + +//OPTIONS MENU +//Options list item +#define GLX_OPTION_SHARE hbTrId("txt_photos_opt_share") + +//Options list item. Opens submenu where slide show can be played or settings edited or viewed. +#define GLX_OPTION_SLIDESHOW hbTrId("txt_photos_opt_slideshow") +//sub menu options for slideshow play + +#define GLX_OPTION_SS_PLAY hbTrId("txt_photos_opt_sub_play") + +//sub menu options for slideshow +#define GLX_OPTION_SS_SETTINGS hbTrId("txt_photos_opt_sub_settings") + +// +#define GLX_OPTION_ADD_TO_ALBUM hbTrId("txt_photos_opt_add_to_album") + +// +#define GLX_OPTION_SETTINGS hbTrId("txt_common_opt_settings") + +//Options list item. Note! Only use this text ID if there are no icons. +//Erases something completely from the phone, list, or memory card, +//for example. Delete should only be used when something in removed permanently. +#define GLX_OPTION_DELETE hbTrId("txt_common_opt_delete") + +//Options list item. Marks all the items in the view for editing, transferring or removing. +#define GLX_OPTION_MARK_ALL hbTrId("txt_photos_opt_mark_all") + +//Options list item. Unmarks all the items in the view. +#define GLX_OPTION_UN_MARK_ALL hbTrId("txt_photos_opt_unmark_all") + +//Options list item. Removes selected item(s) from the folder. +#define GLX_OPTION_REMOVE_FROM_ALBUM hbTrId("txt_photos_opt_remove_from_album") + +// +#define GLX_OPTION_NEW_ALBUM hbTrId("txt_photos_opt_new_album") + +//CONTEXT MENU + +//context menu item share , invoke share UI +#define GLX_MENU_SHARE hbTrId("txt_photos_menu_share") + +//context menu item to play slideshow +#define GLX_MENU_SLIDESHOW hbTrId("txt_photos_menu_slideshow") + +//context menu item for adding current image to album(s) +#define GLX_MENU_ADD_TO_ALBUM hbTrId("txt_photos_menu_add_to_album") + +//Item specific menu item. Note! Only use this text ID if there are no icons. +//Erases something completely from the phone, list, or memory card, for example. +//Delete should only be used when something in removed permanently. +#define GLX_MENU_DELETE hbTrId("txt_common_menu_delete") + +// +#define GLX_MENU_RENAME hbTrId("txt_common_menu_rename_item") + + +//TITLE RELATED and DEFAULT STRINGS + +#define GLX_CAPTION hbTrId("txt_short_caption_photos") +#define GLX_TITLE hbTrId("txt_photos_title_photos") +#define GLX_CAMERA "txt_photos_dblist_my_camera" +#define GLX_MYFAV "txt_photos_dblist_my_favorites" +#define GLX_PLACES "txt_photos_dblist_places_ln" +#define GLX_ITEMS_CAMERA "txt_photos_dblist_val_ln_items" +#define GLX_ITEMS_MYFAV "txt_photos_subtitle_ln_items" +#define GLX_SUBTITLE_CAM_GRIDVIEW hbTrId("txt_photos_subtitle_my_camera") +#define GLX_SUBTITLE_MYFAV_GRIDVIEW hbTrId("txt_photos_subtitle_my_favorites") +#define GLX_SUBTITLE_NOITEMS hbTrId("txt_photos_subtitle_no_image_or_videos_to_display") + + +//VIEW RELATED STRINGS AND COMMON DIALOGS + +//comments lable for photos flip view +#define GLX_DETAILS_DESCRIPTION hbTrId("txt_photos_formlabel_description") + +//Button. Note! Use this text ID only if there are max. two buttons in the dialog. +//When this button is pressed, the focused item or operation will be selected or accepted. +#define GLX_BUTTON_OK hbTrId("txt_common_button_ok") + +//Button. Note! Use this text ID only if there are max. two buttons in the dialog. +//Allows the user to cancel the action or process. +#define GLX_BUTTON_CANCEL hbTrId("txt_common_button_cancel") + +#define GLX_BUTTON_SELECT hbTrId("txt_common_button_select") + +#define GLX_MENU_OPEN hbTrId("txt_common_menu_open") + + +#endif /* GLXLOCALISATIONSTRINGS_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 main/glxaiwservicehandler.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/glxaiwservicehandler.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,354 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "glxlocalisationstrings.h" + +// ---------------------------------------------------------------------------- +// GlxAiwServiceHandler() +// ---------------------------------------------------------------------------- +// +GlxAiwServiceHandler::GlxAiwServiceHandler() : + HbMainWindow(), mModel(NULL), mView(NULL), mService(NULL), + mStateMgr(NULL),mFSView(NULL),mFetcherContextMenu(NULL) + { + mService = new GlxGetImageService(this); + mImageViewerService = new GlxImageViewerService(this); + +#ifdef _DEBUG + QString t; + QStringList args = QApplication::arguments(); + foreach (QString arg, args) + { + t += "GlxAiwServiceHandler::cmdline arg=" + arg + "\n"; + } + qDebug()<< t; +#endif + } + +// ---------------------------------------------------------------------------- +// ~GlxAiwServiceHandler() +// ---------------------------------------------------------------------------- +// +GlxAiwServiceHandler::~GlxAiwServiceHandler() + { + HbStyleLoader::unregisterFilePath(":/data/photos.css"); + if (mView) + { + removeView(mView); + } + delete mView; + delete mFSView; + delete mModel; + delete mService; + } + +void GlxAiwServiceHandler::handleClientDisconnect() + { + // Just quit application + qApp->quit(); + } + +// ---------------------------------------------------------------------------- +// itemSelected() +// ---------------------------------------------------------------------------- +// +void GlxAiwServiceHandler::itemSelected(const QModelIndex & index) + { + qDebug() << "GlxFetcher::itemSelected"; + if (mService->isActive()) + { + qDebug() << "GlxFetcher::itemSelected :: SERVICE ACTIVE"; + QVariant variant = mModel->data(index, GlxUriRole); + if (variant.isValid()) + { + QString itemPath = variant.value (); + qDebug() << "GlxFetcher::itemSelected :: VALID URI -->" << itemPath; + QStringList list = (QStringList() << itemPath); + mService->complete(list); + } + } + } + + + +void GlxAiwServiceHandler::launchFetcher() + { + HbStyleLoader::registerFilePath(":/data/photos.css"); + GlxModelParm modelParm(KGlxCollectionPluginAllImplementationUid, 0); + mModel = new GlxMediaModel(modelParm); + + if ( this->orientation() == Qt::Horizontal ) { + mModel->setData(QModelIndex(), (int)GlxContextLsFs, GlxContextRole ); + } + else { + mModel->setData(QModelIndex(), (int)GlxContextPtFs, GlxContextRole ); + } + + mView = GlxViewsFactory::createView(GLX_GRIDVIEW_ID, this); + mView->activate(); + mView->setModel(mModel); + addView(mView); + connect(mView, SIGNAL(gridItemSelected(const QModelIndex &)), this, + SLOT( itemSelected(const QModelIndex &))); + + connect ( mView, SIGNAL(itemSpecificMenuTriggered(qint32,QPointF ) ), + this, SLOT( itemSpecificMenuTriggered(qint32,QPointF ) ), + Qt::QueuedConnection ); + } + +void GlxAiwServiceHandler::itemSpecificMenuTriggered(qint32 viewId,QPointF pos) + { + mFetcherContextMenu = new HbMenu(); + HbAction *action = mFetcherContextMenu->addAction(GLX_MENU_OPEN); + connect(action, SIGNAL(triggered()), this, SLOT(openFSView())); + connect(this, SIGNAL(aboutToChangeOrientation ()), mFetcherContextMenu, SLOT(close())); + connect( mFetcherContextMenu, SIGNAL( aboutToClose () ), this, SLOT( closeContextMenu() ) ); + mFetcherContextMenu->setPreferredPos( pos ); + mFetcherContextMenu->show(); + } + +void GlxAiwServiceHandler::closeContextMenu() + { + disconnect( this, SIGNAL( aboutToChangeOrientation () ), mFetcherContextMenu, SLOT( close() ) ); + disconnect( mFetcherContextMenu, SIGNAL( aboutToClose () ), this, SLOT( closeContextMenu() ) ); + mFetcherContextMenu->deleteLater(); + mFetcherContextMenu = NULL; + } + +void GlxAiwServiceHandler::openFSView() + { + HbAction* selectAction = new HbAction(GLX_BUTTON_SELECT); + connect(selectAction, SIGNAL(triggered()), this, SLOT(handleFSSelect())); + HbToolBar* toolBar = new HbToolBar(); + toolBar->setOrientation( Qt::Horizontal ); + toolBar->setVisible(true); + toolBar->addAction(selectAction); + + mModel->setData( QModelIndex(), FETCHER_S, GlxSubStateRole ); + mFSView = GlxViewsFactory::createView(GLX_FULLSCREENVIEW_ID, this); + //ownership transfered to view + mFSView->setToolBar(toolBar); + mFSView->activate(); + mFSView->setModel(mModel); + addView(mFSView); + setCurrentView(mFSView,false); + } + + +void GlxAiwServiceHandler::handleFSSelect() + { + QModelIndex selectedIndex = mModel->index(mModel->data(mModel->index(0,0),GlxFocusIndexRole).value(),0); + itemSelected(selectedIndex); + } + +void GlxAiwServiceHandler::launchImageViewer() + { + qApp->setApplicationName("Image Viewer"); + GlxExternalUtility* util = GlxExternalUtility::instance(); + util->setMainWindow(this); + delete mStateMgr; + mStateMgr = NULL; + mStateMgr = new GlxStateManager(); + mStateMgr->launchFromExternal(); + if (mImageViewerService && mImageViewerService->asyncRequest()) + { + connect(mImageViewerService, SIGNAL(returnValueDelivered()), this, + SLOT(handleAnswerDelivered())); + mImageViewerService->complete(true); + } + return; + } +// ---------------------------------------------------------------------------- +// GlxGetImageService() +// ---------------------------------------------------------------------------- +// +GlxGetImageService::GlxGetImageService(GlxAiwServiceHandler* parent) : + XQServiceProvider( + QLatin1String("com.nokia.services.media.Image"), parent), + mServiceApp(parent) + { + mImageRequestIndex = -1; + publishAll(); + connect(this, SIGNAL(clientDisconnected()), mServiceApp, + SLOT(handleClientDisconnect())); + } + +// ---------------------------------------------------------------------------- +// ~GlxGetImageService() +// ---------------------------------------------------------------------------- +// +GlxGetImageService::~GlxGetImageService() + { + } + +// ---------------------------------------------------------------------------- +// fetchFailed() +// ---------------------------------------------------------------------------- +// +void GlxGetImageService::fetchFailed(int errorCode) + { + QStringList filesList; + filesList.insert(0, QString::number(errorCode));//result + doComplete(filesList); + } + +// ---------------------------------------------------------------------------- +// complete() +// ---------------------------------------------------------------------------- +// +void GlxGetImageService::complete(QStringList filesList) + { + doComplete(filesList); + } + +// ---------------------------------------------------------------------------- +// doComplete() +// ---------------------------------------------------------------------------- +// +void GlxGetImageService::doComplete(QStringList filesList) + { + if (isActive()) + { + completeRequest(mImageRequestIndex, filesList); + mImageRequestIndex = -1; + connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); + } + } + +// ---------------------------------------------------------------------------- +// isActive() +// ---------------------------------------------------------------------------- +// +bool GlxGetImageService::isActive() + { + return mImageRequestIndex > -1; + } + +// ---------------------------------------------------------------------------- +// fetch() +// ---------------------------------------------------------------------------- +// +void GlxGetImageService::fetch(QVariantMap filter, QVariant flag) + { + Q_UNUSED(filter) + Q_UNUSED(flag) + mImageRequestIndex = setCurrentRequestAsync(); + mServiceApp->launchFetcher(); + } + +// ----------GlxImageViewerService--------------- + +GlxImageViewerService::GlxImageViewerService(GlxAiwServiceHandler* parent) : + XQServiceProvider(QLatin1String( + "com.nokia.services.media.com.nokia.symbian.IFileView"), parent), + mServiceApp(parent), mAsyncReqId(-1), mAsyncRequest(false), + mImageViewerInstance(NULL) + + { + publishAll(); + connect(this, SIGNAL(clientDisconnected()), mServiceApp, + SLOT(handleClientDisconnect())); + } + +GlxImageViewerService::~GlxImageViewerService() + { + if (mImageViewerInstance) + { + mImageViewerInstance->Close(); + } + } + +void GlxImageViewerService::complete(bool ok) + { + if (mAsyncReqId == -1) + return; + completeRequest(mAsyncReqId, QVariant(ok)); + } + +bool GlxImageViewerService::view(QString file) + { + XQRequestInfo info = requestInfo(); + mAsyncRequest = !info.isSynchronous(); + if (!mImageViewerInstance) + { + mImageViewerInstance = CGlxImageViewerManager::InstanceL(); + } + file.replace(QString("/"), QString("\\")); + TPtrC16 str(reinterpret_cast (file.utf16())); + HBufC* uri = str.Alloc(); + + mImageViewerInstance->SetImageUriL(*uri); + if (mAsyncRequest) + { + mAsyncReqId = setCurrentRequestAsync(); + } + mServiceApp->launchImageViewer(); + return true; + } + +bool GlxImageViewerService::view(XQSharableFile sf) + { + if (!mImageViewerInstance) + { + mImageViewerInstance = CGlxImageViewerManager::InstanceL(); + } + RFile file; + bool ok = sf.getHandle(file); + if (ok) + { + mImageViewerInstance->SetImageFileHandleL(file); + sf.close(); + } + mServiceApp->launchImageViewer(); + mAsyncRequest = !XQServiceUtil::isEmbedded(); + + if (mAsyncRequest) + { + mAsyncReqId = setCurrentRequestAsync(); + connect(this, SIGNAL(clientDisconnected()), this, + SLOT(handleClientDisconnect())); + } + return true; + } + + + diff -r 99ad1390cd33 -r c499df2dbb33 main/glxaiwservicehandler.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main/glxaiwservicehandler.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 +* +*/ + +#ifndef GLXFETCHER_H +#define GLXFETCHER_H + +#include +#include +#include +#include + +//FORWARD CLASS DECLARATION +class GlxView; +class HbPushButton; +class HbMenu; +class QGraphicsGridLayout; +class GlxGetImageService; +class GlxMediaModel; +class QModelIndex; +class GlxImageViewerService; +class GlxStateManager; +class CGlxImageViewerManager; +/** + * GlxAiwServiceHandler + * + */ +class GlxAiwServiceHandler: public HbMainWindow + { + Q_OBJECT +public: + /** + * Constructor + */ + GlxAiwServiceHandler(); + + /** + * Destructor. + */ + ~GlxAiwServiceHandler(); + void launchFetcher(); + void launchImageViewer(); +public slots: + void itemSelected(const QModelIndex & index); + void handleClientDisconnect(); + void itemSpecificMenuTriggered(qint32,QPointF ); + void openFSView(); + void handleFSSelect(); + void closeContextMenu(); + +private: + GlxMediaModel *mModel; + GlxView* mView; + GlxGetImageService* mService; + GlxImageViewerService* mImageViewerService; + GlxStateManager *mStateMgr; + GlxView* mFSView; + HbMenu *mFetcherContextMenu; + }; + +/** + * GlxGetImageService + * + */ +class GlxGetImageService : public XQServiceProvider +{ + Q_OBJECT +public: + GlxGetImageService( GlxAiwServiceHandler *parent = 0 ); + ~GlxGetImageService(); + bool isActive(); + void complete( QStringList filesList); + +public slots://for QTHighway to notify provider about request + void fetch( QVariantMap filter, QVariant flag); + +public slots://for provider to notify client + void fetchFailed( int errorCode ); + +private: + void doComplete( QStringList filesList); + +private: + int mImageRequestIndex; + GlxAiwServiceHandler* mServiceApp; +}; + + +class GlxImageViewerService : public XQServiceProvider +{ + Q_OBJECT + public: + GlxImageViewerService( GlxAiwServiceHandler *parent = 0 ); + ~GlxImageViewerService(); + void complete(bool ok); + + public slots: + bool view(QString file); + bool view(XQSharableFile file); + bool asyncRequest() {return mAsyncRequest;} + + private: + GlxAiwServiceHandler* mServiceApp; + int mAsyncReqId; + bool mRetValue; + bool mAsyncRequest; + CGlxImageViewerManager* mImageViewerInstance; +}; + + +#endif //GLXFETCHER_H diff -r 99ad1390cd33 -r c499df2dbb33 main/glxfetcher.cpp --- a/main/glxfetcher.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies 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 -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -// ---------------------------------------------------------------------------- -// GlxFetcher() -// ---------------------------------------------------------------------------- -// -GlxFetcher::GlxFetcher():HbMainWindow() ,mModel(NULL),mView(NULL),mService(NULL) -{ - mService = new GlxGetImageService( this); - -#ifdef _DEBUG - QString t; - QStringList args = QApplication::arguments(); - foreach (QString arg, args) - { - t += "GlxFetcher::cmdline arg=" + arg + "\n"; - } - qDebug()<< t; -#endif -} - -// ---------------------------------------------------------------------------- -// ~GlxFetcher() -// ---------------------------------------------------------------------------- -// -GlxFetcher::~GlxFetcher() -{ - if(mView){ - removeView(mView); - } - delete mView; - delete mModel; - delete mService; -} - -// ---------------------------------------------------------------------------- -// itemSelected() -// ---------------------------------------------------------------------------- -// -void GlxFetcher::itemSelected(const QModelIndex & index) -{ - qDebug()<< "GlxFetcher::itemSelected" ; - if ( mService->isActive() ){ - qDebug()<< "GlxFetcher::itemSelected :: SERVICE ACTIVE" ; - QVariant variant = mModel->data( index, GlxUriRole ); - if ( variant.isValid() ) { - QString itemPath = variant.value(); - qDebug()<< "GlxFetcher::itemSelected :: VALID URI -->" << itemPath; - QStringList list = (QStringList() << itemPath ); - mService->complete( list ); - } - } -} - -void GlxFetcher::launchFetcher() -{ - GlxModelParm modelParm (KGlxCollectionPluginAllImplementationUid, 0); - mModel = new GlxMediaModel (modelParm); - - mView = GlxViewsFactory::createView(GLX_GRIDVIEW_ID, this); - mView->activate(); - mView->setModel(mModel); - addView(mView); - connect(mView, SIGNAL(gridItemSelected(const QModelIndex &)), this, SLOT( itemSelected(const QModelIndex &))); - -} -// ---------------------------------------------------------------------------- -// GlxGetImageService() -// ---------------------------------------------------------------------------- -// -GlxGetImageService::GlxGetImageService(GlxFetcher* parent) -: XQServiceProvider(QLatin1String("com.nokia.services.media.Image"),parent),mServiceApp(parent) -{ - mImageRequestIndex=-1; - publishAll(); -} - -// ---------------------------------------------------------------------------- -// ~GlxGetImageService() -// ---------------------------------------------------------------------------- -// -GlxGetImageService::~GlxGetImageService() -{ -} - -// ---------------------------------------------------------------------------- -// fetchFailed() -// ---------------------------------------------------------------------------- -// -void GlxGetImageService::fetchFailed( int errorCode ) -{ - QStringList filesList; - filesList.insert(0, QString::number( errorCode ));//result - doComplete(filesList); -} - -// ---------------------------------------------------------------------------- -// complete() -// ---------------------------------------------------------------------------- -// -void GlxGetImageService::complete( QStringList filesList ) -{ - doComplete(filesList); -} - -// ---------------------------------------------------------------------------- -// doComplete() -// ---------------------------------------------------------------------------- -// -void GlxGetImageService::doComplete( QStringList filesList) -{ - if ( isActive() ){ - completeRequest(mImageRequestIndex, filesList); - mImageRequestIndex=-1; - connect(this, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); - } -} - -// ---------------------------------------------------------------------------- -// isActive() -// ---------------------------------------------------------------------------- -// -bool GlxGetImageService::isActive() -{ - return mImageRequestIndex> -1; -} - -// ---------------------------------------------------------------------------- -// fetch() -// ---------------------------------------------------------------------------- -// -void GlxGetImageService::fetch( QVariantMap filter, QVariant flag) -{ - Q_UNUSED(filter) - Q_UNUSED(flag) - mImageRequestIndex = setCurrentRequestAsync(); - mServiceApp->launchFetcher(); - } diff -r 99ad1390cd33 -r c499df2dbb33 main/glxfetcher.h --- a/main/glxfetcher.h Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ?Description -* -*/ - -#ifndef GLXFETCHER_H -#define GLXFETCHER_H - -#include -#include -#include - - -//FORWARD CLASS DECLARATION -class GlxView; -class HbPushButton; -class QGraphicsGridLayout; -class GlxGetImageService; -class GlxMediaModel; -class QModelIndex; -/** - * GlxFetcher - * - */ -class GlxFetcher: public HbMainWindow - { - Q_OBJECT -public: - /** - * Constructor - */ - GlxFetcher(); - - /** - * Destructor. - */ - ~GlxFetcher(); - void launchFetcher(); -public slots: - void itemSelected(const QModelIndex & index); - -private: - GlxMediaModel *mModel; - GlxView* mView; - GlxGetImageService* mService; - }; - -/** - * GlxGetImageService - * - */ -class GlxGetImageService : public XQServiceProvider -{ - Q_OBJECT -public: - GlxGetImageService( GlxFetcher *parent = 0 ); - ~GlxGetImageService(); - bool isActive(); - void complete( QStringList filesList); - -public slots://for QTHighway to notify provider about request - void fetch( QVariantMap filter, QVariant flag); - -public slots://for provider to notify client - void fetchFailed( int errorCode ); - -private: - void doComplete( QStringList filesList); - -private: - int mImageRequestIndex; - GlxFetcher* mServiceApp; -}; - -#endif //GLXFETCHER_H diff -r 99ad1390cd33 -r c499df2dbb33 main/main.cpp --- a/main/main.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/main/main.cpp Mon May 03 12:31:32 2010 +0300 @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "OstTraceDefinitions.h" #ifdef OST_TRACE_COMPILER_IN_USE @@ -43,14 +43,20 @@ localTime.hour(), localTime.minute(), localTime.second() ); HbApplication app(argc, argv); - - // TODO: this needs to be checked where translator _really_ should be installed + + bool loaded(false); + QTranslator translator; - translator.load("photos_" + QLocale::system().name()); - qApp->installTranslator(&translator); + QString path = "Z:/resource/qt/translations/"; + loaded = translator.load("photos_" + QLocale::system().name(), path); + if(loaded) + { + qApp->installTranslator(&translator); + } + GlxStateManager* stateMgr = NULL; - GlxFetcher* mainWindow = NULL; + GlxAiwServiceHandler* mainWindow = NULL; OstTraceEventStart0( EVENT_DUP1__MAIN_START, "launch" ); @@ -61,7 +67,7 @@ } else { - mainWindow = new GlxFetcher(); + mainWindow = new GlxAiwServiceHandler(); mainWindow->show(); } OstTraceEventStop( EVENT_DUP1__MAIN_STOP, "launch", EVENT_DUP1__MAIN_START ); diff -r 99ad1390cd33 -r c499df2dbb33 main/main.pro --- a/main/main.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/main/main.pro Mon May 03 12:31:32 2010 +0300 @@ -49,12 +49,15 @@ LIBS += -lglxstatehandler.dll \ -lglxloggerqt.dll \ -lglxviews.dll \ - -lglxmediamodel.dll + -lglxmediamodel.dll \ + -lglxexternalutility.dll \ + -lglximageviewermanager.dll + # Input SOURCES += main.cpp \ - glxfetcher.cpp -HEADERS +=glxfetcher.h + glxaiwservicehandler.cpp +HEADERS +=glxaiwservicehandler.h RESOURCES += ../photos.qrc TRANSLATIONS= photos.ts @@ -64,3 +67,114 @@ SERVICE.FILE = service_conf.xml SERVICE.OPTIONS = embeddable ##### /qthighway + +RSS_RULES += \ + "datatype_list = " \ + " {" \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/jpeg\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/jpg\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/jp2\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/tiff\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/x-wmf\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/ico\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/gif\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/bmp\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/x-bmp\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/x-bitmap\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/x-xbitmap\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/x-win-bitmap\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/x-windows-bmp\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/ms-bmp\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/x-ms-bmp\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/vnd.wap.wbmp\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/png\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/x-epoc-mbm\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/vnd.nokia.ota-bitmap\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/x-ota-bitmap\";" \ + " }," \ + " DATATYPE" \ + " {" \ + " priority = EDataTypePriorityHigh;" \ + " type = \"image/mng\";" \ + " }" \ + " };" \ + diff -r 99ad1390cd33 -r c499df2dbb33 main/service_conf.xml --- a/main/service_conf.xml Fri Apr 16 14:58:46 2010 +0300 +++ b/main/service_conf.xml Mon May 03 12:31:32 2010 +0300 @@ -9,4 +9,9 @@ Interface which may do something Fetch + + com.nokia.symbian.IFileView + 1.0 + Interface for showing Files + \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 photos.pro --- a/photos.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/photos.pro Mon May 03 12:31:32 2010 +0300 @@ -25,9 +25,9 @@ SUBDIRS = group \ loggers \ commonutilities \ + tvout\tvoutwrapper \ ui \ - main \ - imageviewerapp + main BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ "rom/photos.iby CORE_APP_LAYER_IBY_EXPORT_PATH(photos.iby)" \ diff -r 99ad1390cd33 -r c499df2dbb33 rom/photos.iby --- a/rom/photos.iby Fri Apr 16 14:58:46 2010 +0300 +++ b/rom/photos.iby Mon May 03 12:31:32 2010 +0300 @@ -56,6 +56,7 @@ file=ABI_DIR/BUILD_DIR/glxcommandhandlerbase.dll SHARED_LIB_DIR/glxcommandhandlerbase.dll file=ABI_DIR/BUILD_DIR/glxcommoncommandhandlers.dll SHARED_LIB_DIR/glxcommoncommandhandlers.dll +file=ABI_DIR/BUILD_DIR/glxtvoutwrapper.dll SHARED_LIB_DIR/glxtvoutwrapper.dll file=ABI_DIR/BUILD_DIR/glxdrmutility.dll SHARED_LIB_DIR/glxdrmutility.dll file=ABI_DIR/BUILD_DIR/glxmedialists.dll SHARED_LIB_DIR/glxmedialists.dll @@ -73,10 +74,6 @@ data=/epoc32/data/z/private/10003a3f/import/apps/photos_reg.rsc private/10003a3f/import/apps/photos_reg.rsc data=DATAZ_/APP_RESOURCE_DIR/0xE2C223D9.mif APP_RESOURCE_DIR/0xE2C223D9.mif -;fetcher binaries -S60_APP_EXE(imageviewerapp) -data=DATAZ_/APP_RESOURCE_DIR/imageviewerapp.rsc APP_RESOURCE_DIR/imageviewerapp.rsc -data=/epoc32/data/z/private/10003a3f/import/apps/imageviewerapp_reg.rsc private/10003a3f/import/apps/imageviewerapp_reg.rsc //data=/epoc32/data/z/system/install/photos_stub.sis /system/install/photos_stub.sis #endif //__PHOTOS_IBY__ \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 tsrc/tsrc.pro --- a/tsrc/tsrc.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/tsrc/tsrc.pro Mon May 03 12:31:32 2010 +0300 @@ -18,7 +18,7 @@ #*/ TEMPLATE = subdirs -DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT +DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT QT_NO_DEBUG CONFIG += ordered diff -r 99ad1390cd33 -r c499df2dbb33 tsrc/unittest/unittest.pro --- a/tsrc/unittest/unittest.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/tsrc/unittest/unittest.pro Mon May 03 12:31:32 2010 +0300 @@ -18,7 +18,7 @@ #*/ TEMPLATE = subdirs -DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT +DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT QT_NO_DEBUG CONFIG += ordered diff -r 99ad1390cd33 -r c499df2dbb33 tsrc/unittest/unittest_imagedecoderwrapper/unittest_imagedecoderwrapper.cpp --- a/tsrc/unittest/unittest_imagedecoderwrapper/unittest_imagedecoderwrapper.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/tsrc/unittest/unittest_imagedecoderwrapper/unittest_imagedecoderwrapper.cpp Mon May 03 12:31:32 2010 +0300 @@ -17,28 +17,8 @@ #include "unittest_imagedecoderwrapper.h" #include "glximagedecoderwrapper.h" -#include "hbmainwindow.h" -#include "hbapplication.h" #include -int main(int argc, char *argv[]) -{ - Q_UNUSED(argc); - HbApplication app(argc, argv); - - HbMainWindow *mMainWindow = new HbMainWindow(); - TestGlxImageDecoderWrapper tv; - - char *pass[3]; - pass[0] = argv[0]; - pass[1] = "-o"; - pass[2] = "c:\\data\\testdecoder.txt"; - - int res = QTest::qExec(&tv, 3, pass); - - return res; -} - // ----------------------------------------------------------------------------- // initTestCase // ----------------------------------------------------------------------------- @@ -46,7 +26,8 @@ void TestGlxImageDecoderWrapper::initTestCase() { mTestObject = 0; - //mMainWindow = new HbMainWindow(); + TRAP_IGNORE(mTestObject = new GlxImageDecoderWrapper()); + QVERIFY(mTestObject); } // ----------------------------------------------------------------------------- @@ -55,8 +36,7 @@ // void TestGlxImageDecoderWrapper::init() { - TRAP_IGNORE(mTestObject = new GlxImageDecoderWrapper()); - QVERIFY(mTestObject); + } // ----------------------------------------------------------------------------- @@ -65,11 +45,7 @@ // void TestGlxImageDecoderWrapper::cleanup() { - if(mTestObject) - { - delete mTestObject; - mTestObject = 0; - } + } // ----------------------------------------------------------------------------- @@ -78,7 +54,11 @@ // void TestGlxImageDecoderWrapper::cleanupTestCase() { - + if(mTestObject) + { + delete mTestObject; + mTestObject = 0; + } } void TestGlxImageDecoderWrapper::testgetPixmap() @@ -90,7 +70,7 @@ { QString imagePath = "c:\\data\\images\\Battle.jpg"; TRAP_IGNORE(mTestObject->decodeImage(imagePath)); - //QTest::qWait(1000); + QTest::qWait(1000); //QEXPECT_FAIL("", "Will fix in the next release", Continue); QVERIFY(!mTestObject->getPixmap().isNull()); } @@ -99,7 +79,7 @@ { QString imagePath = "c:\\data\\images\\Battle.jpg"; TRAP_IGNORE(mTestObject->decodeImage(imagePath)); - //QTest::qWait(1000); + QTest::qWait(1000); //QEXPECT_FAIL("", "This should fail", Continue); QVERIFY(!mTestObject->getPixmap().isNull()); @@ -107,3 +87,5 @@ QVERIFY(mTestObject->getPixmap().isNull()); } +QTEST_MAIN(TestGlxImageDecoderWrapper) +#include "moc_unittest_imagedecoderwrapper.cpp" diff -r 99ad1390cd33 -r c499df2dbb33 tsrc/unittest/unittest_imagedecoderwrapper/unittest_imagedecoderwrapper.pro --- a/tsrc/unittest/unittest_imagedecoderwrapper/unittest_imagedecoderwrapper.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/tsrc/unittest/unittest_imagedecoderwrapper/unittest_imagedecoderwrapper.pro Mon May 03 12:31:32 2010 +0300 @@ -33,4 +33,13 @@ SOURCES += unittest_imagedecoderwrapper.cpp -BLD_INF_RULES.prj_exports += "../../../gallery/data/Battle.jpg /epoc32/winscw/c/data/images/Battle.jpg" \ No newline at end of file +symbian: { + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCHEAPSIZE = 0x20000 0x1600000 + TARGET.UID3 = 0x20000A05 +} +#BLD_INF_RULES.prj_exports += "../../../gallery/data/Battle.jpg c:/data/images/Battle.jpg" + +myFiles.sources = "../../../gallery/data/Battle.jpg" +myFiles.path = c:\data\images +DEPLOYMENT += myFiles diff -r 99ad1390cd33 -r c499df2dbb33 tsrc/unittest/unittest_medialistwrapper/unittest_medialistwrapper.cpp --- a/tsrc/unittest/unittest_medialistwrapper/unittest_medialistwrapper.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/tsrc/unittest/unittest_medialistwrapper/unittest_medialistwrapper.cpp Mon May 03 12:31:32 2010 +0300 @@ -14,8 +14,6 @@ * Description: * */ -#include "hbmainwindow.h" -#include "hbapplication.h" #include "unittest_medialistwrapper.h" #include "glxmlwrapper.h" @@ -27,25 +25,6 @@ -//#include "glxmlwrapper_p.h" - -int main(int argc, char *argv[]) -{ - Q_UNUSED(argc); - HbApplication app(argc, argv); - - HbMainWindow *mMainWindow = new HbMainWindow(); - TestGlxMLWrapper tv; - - char *pass[3]; - pass[0] = argv[0]; - pass[1] = "-o"; - pass[2] = "c:\\data\\testmlwrapper.txt"; - - int res = QTest::qExec(&tv, 3, pass); - - return res; -} // ----------------------------------------------------------------------------- // initTestCase @@ -54,6 +33,8 @@ void TestGlxMLWrapper::initTestCase() { mTestObject = 0; + mTestObject = new GlxMLWrapper(KGlxCollectionPluginAllImplementationUid,0,EGlxFilterImage); + QVERIFY(mTestObject); } // ----------------------------------------------------------------------------- @@ -62,8 +43,7 @@ // void TestGlxMLWrapper::init() { - mTestObject = new GlxMLWrapper(KGlxCollectionPluginAllImplementationUid,0,EGlxFilterImage); - QVERIFY(mTestObject); + } // ----------------------------------------------------------------------------- @@ -72,6 +52,15 @@ // void TestGlxMLWrapper::cleanup() { + +} + +// ----------------------------------------------------------------------------- +// cleanupTestCase +// ----------------------------------------------------------------------------- +// +void TestGlxMLWrapper::cleanupTestCase() +{ if(mTestObject) { delete mTestObject; @@ -80,39 +69,33 @@ } // ----------------------------------------------------------------------------- -// cleanupTestCase -// ----------------------------------------------------------------------------- -// -void TestGlxMLWrapper::cleanupTestCase() -{ - -} - -// ----------------------------------------------------------------------------- // testGetItemCount // ----------------------------------------------------------------------------- // void TestGlxMLWrapper::testGetItemCount() { + QTest::qWait(3000); int count = mTestObject->getItemCount(); - QVERIFY(count != 0); + QVERIFY(count >= 0); } void TestGlxMLWrapper::testGetFocusIndex() { int focusIndex = mTestObject->getFocusIndex(); - QVERIFY(focusIndex == -1); + //QVERIFY(focusIndex == -1); mTestObject->setFocusIndex(mTestObject->getItemCount()-1); focusIndex = mTestObject->getFocusIndex(); QVERIFY(focusIndex == mTestObject->getItemCount()-1); } + void TestGlxMLWrapper::testSetFocusIndex() { mTestObject->setFocusIndex(mTestObject->getItemCount()-1); int focusIndex = mTestObject->getFocusIndex(); QVERIFY(focusIndex == mTestObject->getItemCount()-1); } + void TestGlxMLWrapper::testSetContextMode() { int itemIndex = mTestObject->getItemCount()-1; @@ -134,7 +117,7 @@ int count = mTestObject->getItemCount(); mTestObject->setContextMode(GlxContextPtGrid); - QTest::qWait(20000); + QTest::qWait(10000); QString uri = mTestObject->retrieveItemUri(count-1); qDebug("TestGlxMLWrapper::testRetrieveItemUri =%d",uri.isEmpty()); QVERIFY( uri.isEmpty() == 0 ); @@ -146,7 +129,7 @@ int count = mTestObject->getItemCount(); mTestObject->setContextMode(GlxContextPtGrid); - QTest::qWait(20000); + QTest::qWait(10000); QString uri = mTestObject->retrieveItemUri(count-1); QString imageName = uri.section('\\',-1); @@ -154,22 +137,26 @@ QVERIFY( imageName.isEmpty() == 0 ); } -void TestGlxMLWrapper::testRetrieveItemIcon() +void TestGlxMLWrapper::testRetrieveItemIconIsNull() { - int itemIndex = mTestObject->getItemCount()-1; - - // grid icon should be NULL + int itemIndex = mTestObject->getItemCount()-1; +// grid icon should be NULL HbIcon* icon = mTestObject->retrieveItemIcon(itemIndex,GlxTBContextGrid); QVERIFY(icon == NULL); // fullscreen icon should be NULL icon = mTestObject->retrieveItemIcon(itemIndex,GlxTBContextLsFs); - QVERIFY(icon == NULL); + QVERIFY(icon == NULL); +} + +void TestGlxMLWrapper::testRetrieveItemIcon() +{ + int itemIndex = mTestObject->getItemCount()-1; // Should get fullscreen icon mTestObject->setContextMode(GlxContextLsFs); QTest::qWait(4000); - icon = mTestObject->retrieveItemIcon(itemIndex,GlxTBContextLsFs); + HbIcon* icon = mTestObject->retrieveItemIcon(itemIndex,GlxTBContextLsFs); QVERIFY(icon != NULL); // Should get grid icon @@ -185,7 +172,7 @@ qDebug("TestGlxMLWrapper::testRetrieveItemDateIsNotNull enter"); int count = mTestObject->getItemCount(); mTestObject->setContextMode(GlxContextPtGrid); - QTest::qWait(20000); + QTest::qWait(10000); QDate date = mTestObject->retrieveItemDate(count-1); qDebug("TestGlxMLWrapper::testRetrieveItemDateIsNotNull =%d",date.isNull()); @@ -198,7 +185,7 @@ qDebug("TestGlxMLWrapper::testRetrieveItemDateIsValid enter"); int count = mTestObject->getItemCount(); mTestObject->setContextMode( GlxContextPtGrid ); - QTest::qWait(20000); + QTest::qWait(10000); QDate date = mTestObject->retrieveItemDate(count-1); qDebug("TestGlxMLWrapper::testRetrieveItemDateIsValid IsNull=%d",date.isNull()); @@ -213,7 +200,7 @@ qDebug("TestGlxMLWrapper::testRetrieveItemDateValidate enter"); int count = mTestObject->getItemCount(); mTestObject->setContextMode( GlxContextPtGrid ); - QTest::qWait(20000); + QTest::qWait(10000); QDate date = mTestObject->retrieveItemDate(count-1); qDebug("TestGlxMLWrapper::testRetrieveItemDateValidate =%d",date.isValid(date.year(), date.month(), date.day()) ); @@ -340,9 +327,6 @@ qDebug("Signal Count %d",spysignal.count()); QVERIFY(spysignal.count() == 1); QVERIFY(spysignal.value(0).at(0).toInt() == count-1); - qDebug("update Item enum %d",spysignal.value(0).at(1).toInt()); - QVERIFY(spysignal.value(0).at(1).toInt() == 3); - } void TestGlxMLWrapper::testRetrieveItemDateIsNull() @@ -352,3 +336,6 @@ qDebug("TestGlxMLWrapper::testRetrieveItemDateIsNull =%d",date.isNull()); QVERIFY( date.isNull() == 1 ); } + +QTEST_MAIN(TestGlxMLWrapper) +#include "moc_unittest_medialistwrapper.cpp" diff -r 99ad1390cd33 -r c499df2dbb33 tsrc/unittest/unittest_medialistwrapper/unittest_medialistwrapper.h --- a/tsrc/unittest/unittest_medialistwrapper/unittest_medialistwrapper.h Fri Apr 16 14:58:46 2010 +0300 +++ b/tsrc/unittest/unittest_medialistwrapper/unittest_medialistwrapper.h Mon May 03 12:31:32 2010 +0300 @@ -52,13 +52,15 @@ void cleanupTestCase(); - void testGetItemCount(); + void testGetItemCount(); + void testRetrieveItemDateIsNull(); + void testRetrieveItemIconIsNull(); + void testSetContextMode(); + void testRetrieveItemIcon(); void testGetFocusIndex(); void testSetFocusIndex(); - void testSetContextMode(); void testRetrieveItemUri(); void testRetrieveItemUriName(); - void testRetrieveItemIcon(); void testRetrieveItemDateIsNotNull(); void testRetrieveItemDateIsValid(); void testRetrieveItemDateValidate(); @@ -69,7 +71,6 @@ void testHandleReceivedIcon(); void testHandleIconCorrupt(); void testHandleListItemAvailable(); - void testRetrieveItemDateIsNull(); // void testRetrieveListTitle(); // void testRetrieveListSubTitle(); // void testRetrieveItemDimension(); diff -r 99ad1390cd33 -r c499df2dbb33 tsrc/unittest/unittest_medialistwrapper/unittest_medialistwrapper.pro --- a/tsrc/unittest/unittest_medialistwrapper/unittest_medialistwrapper.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/tsrc/unittest/unittest_medialistwrapper/unittest_medialistwrapper.pro Mon May 03 12:31:32 2010 +0300 @@ -39,4 +39,8 @@ SOURCES += unittest_medialistwrapper.cpp -symbian: {TARGET.CAPABILITY = ALL -TCB } \ No newline at end of file +symbian: { + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCHEAPSIZE = 0x20000 0x1600000 + TARGET.UID3 = 0x20000A0E +} \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 tsrc/unittest/unittest_statehandler/unittest_statehandler.cpp --- a/tsrc/unittest/unittest_statehandler/unittest_statehandler.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/tsrc/unittest/unittest_statehandler/unittest_statehandler.cpp Mon May 03 12:31:32 2010 +0300 @@ -14,8 +14,6 @@ * Description: * */ -#include "hbmainwindow.h" -#include "hbapplication.h" #include "unittest_statehandler.h" #include "glxstatemanager.h" @@ -25,31 +23,21 @@ #include #include "glxmediaid.h" -int main(int argc, char *argv[]) -{ - Q_UNUSED(argc); - HbApplication app(argc, argv); - - HbMainWindow *mMainWindow = new HbMainWindow(); - TestGlxStateManager tv; - - char *pass[3]; - pass[0] = argv[0]; - pass[1] = "-o"; - pass[2] = "c:\\data\\teststatehandler.txt"; - - int res = QTest::qExec(&tv, 3, pass); - - return res; -} // ----------------------------------------------------------------------------- // initTestCase // ----------------------------------------------------------------------------- // void TestGlxStateManager::initTestCase() -{ - mStateManager = 0; +{ + mStateManager = new GlxStateManager(); + //mStateManager->setupItems(); + mStateManager->mCurrentState = mStateManager->createState(GLX_GRIDVIEW_ID); + mStateManager->mCurrentState->setState(ALL_ITEM_S); + + QVERIFY(mStateManager); + QVERIFY(mStateManager->mViewManager); + QVERIFY(mStateManager->mActionHandler == 0); } // ----------------------------------------------------------------------------- @@ -58,10 +46,7 @@ // void TestGlxStateManager::init() { - mStateManager = new GlxStateManager(); - QVERIFY(mStateManager); - QVERIFY(mStateManager->mViewManager); - QVERIFY(mStateManager->mActionHandler); + } void TestGlxStateManager::removeModelTestCase1() @@ -112,8 +97,10 @@ QVERIFY(mStateManager->mAllMediaModel); mStateManager->removeCurrentModel(); - delete mStateManager->mCurrentState; - mStateManager->mCurrentState = NULL; + GlxState *state = mStateManager->mCurrentState; + mStateManager->mCurrentState = state->previousState(); + delete state; + state = NULL; } void TestGlxStateManager::createGridModelTestCase1() @@ -139,11 +126,7 @@ // void TestGlxStateManager::cleanup() { - if(mStateManager) - { - delete mStateManager; - mStateManager = 0; - } + } // ----------------------------------------------------------------------------- @@ -152,5 +135,13 @@ // void TestGlxStateManager::cleanupTestCase() { + if(mStateManager) + { + QCoreApplication::processEvents(); //To:Do remove it once mainwindow delete hang problem will resolve + delete mStateManager; + mStateManager = 0; + } +} -} +QTEST_MAIN(TestGlxStateManager) +#include "moc_unittest_statehandler.cpp" diff -r 99ad1390cd33 -r c499df2dbb33 tsrc/unittest/unittest_statehandler/unittest_statehandler.pro --- a/tsrc/unittest/unittest_statehandler/unittest_statehandler.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/tsrc/unittest/unittest_statehandler/unittest_statehandler.pro Mon May 03 12:31:32 2010 +0300 @@ -31,7 +31,11 @@ CONFIG += qtestlib \ Hb -symbian: {TARGET.CAPABILITY = ALL -TCB } +symbian: { + TARGET.CAPABILITY = ALL -TCB + TARGET.EPOCHEAPSIZE = 0x20000 0x1600000 + TARGET.UID3 = 0x2000A773 +} LIBS += -lflogger.dll LIBS += -lglxstatehandler.dll diff -r 99ad1390cd33 -r c499df2dbb33 tvout/bwins/glxtvoutu.def --- a/tvout/bwins/glxtvoutu.def Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -EXPORTS - ?ActivateZoom@CGlxHdmiController@@QAEXH@Z @ 1 NONAME ; void CGlxHdmiController::ActivateZoom(int) - ?ScreenSizeL@CGlxTv@@QBE?AVTSize@@XZ @ 2 NONAME ; class TSize CGlxTv::ScreenSizeL(void) const - ??1CGlxTv@@UAE@XZ @ 3 NONAME ; CGlxTv::~CGlxTv(void) - ??1CGlxHdmiController@@UAE@XZ @ 4 NONAME ; CGlxHdmiController::~CGlxHdmiController(void) - ?NewL@CGlxHdmiController@@SAPAV1@XZ @ 5 NONAME ; class CGlxHdmiController * CGlxHdmiController::NewL(void) - ?IsWidescreen@CGlxTv@@QBEHXZ @ 6 NONAME ; int CGlxTv::IsWidescreen(void) const - ?IsHDMIConnected@CGlxHdmiController@@QAEHXZ @ 7 NONAME ; int CGlxHdmiController::IsHDMIConnected(void) - ?ShiftToPostingMode@CGlxHdmiController@@QAEXXZ @ 8 NONAME ; void CGlxHdmiController::ShiftToPostingMode(void) - ?ShiftToCloningMode@CGlxHdmiController@@QAEXXZ @ 9 NONAME ; void CGlxHdmiController::ShiftToCloningMode(void) - ?SetImageL@CGlxHdmiController@@QAEXABVTDesC16@@H@Z @ 10 NONAME ; void CGlxHdmiController::SetImageL(class TDesC16 const &, int) - ?NewL@CGlxTv@@SAPAV1@AAVMGlxTvObserver@@@Z @ 11 NONAME ; class CGlxTv * CGlxTv::NewL(class MGlxTvObserver &) - ?IsConnected@CGlxTv@@QBEHXZ @ 12 NONAME ; int CGlxTv::IsConnected(void) const - ?ItemNotSupported@CGlxHdmiController@@QAEXXZ @ 13 NONAME ; void CGlxHdmiController::ItemNotSupported(void) - ?IsHDMIConnected@CGlxTv@@QBEHXZ @ 14 NONAME ; int CGlxTv::IsHDMIConnected(void) const - ?DeactivateZoom@CGlxHdmiController@@QAEXXZ @ 15 NONAME ; void CGlxHdmiController::DeactivateZoom(void) - diff -r 99ad1390cd33 -r c499df2dbb33 tvout/bwins/glxtvoutwrapperu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/bwins/glxtvoutwrapperu.def Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,11 @@ +EXPORTS + ?itemNotSupported@GlxTvOutWrapper@@QAEXXZ @ 1 NONAME ; void GlxTvOutWrapper::itemNotSupported(void) + ??1GlxTvOutWrapper@@QAE@XZ @ 2 NONAME ; GlxTvOutWrapper::~GlxTvOutWrapper(void) + ?activateZoom@GlxTvOutWrapper@@QAEX_N@Z @ 3 NONAME ; void GlxTvOutWrapper::activateZoom(bool) + ?setModel@GlxTvOutWrapper@@QAEXPAVQAbstractItemModel@@@Z @ 4 NONAME ; void GlxTvOutWrapper::setModel(class QAbstractItemModel *) + ??0GlxTvOutWrapper@@QAE@XZ @ 5 NONAME ; GlxTvOutWrapper::GlxTvOutWrapper(void) + ?deactivateZoom@GlxTvOutWrapper@@QAEXXZ @ 6 NONAME ; void GlxTvOutWrapper::deactivateZoom(void) + ?setImagetoHDMI@GlxTvOutWrapper@@QAEXXZ @ 7 NONAME ; void GlxTvOutWrapper::setImagetoHDMI(void) + ?setToCloningMode@GlxTvOutWrapper@@QAEXXZ @ 8 NONAME ; void GlxTvOutWrapper::setToCloningMode(void) + ?setToNativeMode@GlxTvOutWrapper@@QAEXXZ @ 9 NONAME ; void GlxTvOutWrapper::setToNativeMode(void) + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/eabi/glxtvoutu.def --- a/tvout/eabi/glxtvoutu.def Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -EXPORTS - _ZN18CGlxHdmiController12ActivateZoomEi @ 1 NONAME - _ZN18CGlxHdmiController14DeactivateZoomEv @ 2 NONAME - _ZN18CGlxHdmiController15IsHDMIConnectedEv @ 3 NONAME - _ZN18CGlxHdmiController16ItemNotSupportedEv @ 4 NONAME - _ZN18CGlxHdmiController18ShiftToCloningModeEv @ 5 NONAME - _ZN18CGlxHdmiController18ShiftToPostingModeEv @ 6 NONAME - _ZN18CGlxHdmiController4NewLEv @ 7 NONAME - _ZN18CGlxHdmiController9SetImageLERK7TDesC16i @ 8 NONAME - _ZN18CGlxHdmiControllerD0Ev @ 9 NONAME - _ZN18CGlxHdmiControllerD1Ev @ 10 NONAME - _ZN18CGlxHdmiControllerD2Ev @ 11 NONAME - _ZN6CGlxTv4NewLER14MGlxTvObserver @ 12 NONAME - _ZN6CGlxTvD0Ev @ 13 NONAME - _ZN6CGlxTvD1Ev @ 14 NONAME - _ZN6CGlxTvD2Ev @ 15 NONAME - _ZNK6CGlxTv11IsConnectedEv @ 16 NONAME - _ZNK6CGlxTv11ScreenSizeLEv @ 17 NONAME - _ZNK6CGlxTv12IsWidescreenEv @ 18 NONAME - _ZNK6CGlxTv15IsHDMIConnectedEv @ 19 NONAME - _ZTI17CGlxHdmiContainer @ 20 NONAME - _ZTI17CGlxHdmiDecoderAO @ 21 NONAME - _ZTI18CGlxHdmiController @ 22 NONAME - _ZTI22CGlxHdmiSurfaceUpdater @ 23 NONAME - _ZTV17CGlxHdmiContainer @ 24 NONAME - _ZTV17CGlxHdmiDecoderAO @ 25 NONAME - _ZTV18CGlxHdmiController @ 26 NONAME - _ZTV22CGlxHdmiSurfaceUpdater @ 27 NONAME - diff -r 99ad1390cd33 -r c499df2dbb33 tvout/eabi/glxtvoutwrapperu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/eabi/glxtvoutwrapperu.def Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,13 @@ +EXPORTS + _ZN15GlxTvOutWrapper12activateZoomEb @ 1 NONAME + _ZN15GlxTvOutWrapper14deactivateZoomEv @ 2 NONAME + _ZN15GlxTvOutWrapper14setImagetoHDMIEv @ 3 NONAME + _ZN15GlxTvOutWrapper15setToNativeModeEv @ 4 NONAME + _ZN15GlxTvOutWrapper16itemNotSupportedEv @ 5 NONAME + _ZN15GlxTvOutWrapper16setToCloningModeEv @ 6 NONAME + _ZN15GlxTvOutWrapper8setModelEP18QAbstractItemModel @ 7 NONAME + _ZN15GlxTvOutWrapperC1Ev @ 8 NONAME + _ZN15GlxTvOutWrapperC2Ev @ 9 NONAME + _ZN15GlxTvOutWrapperD1Ev @ 10 NONAME + _ZN15GlxTvOutWrapperD2Ev @ 11 NONAME + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/group/bld.inf --- a/tvout/group/bld.inf Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Build information for TV out component -* -*/ - - - -/** - * @internal reviewed 24/08/2007 by D Holland - */ - - #include - -PRJ_EXPORTS -../rom/glxtvout.iby CORE_APP_LAYER_IBY_EXPORT_PATH(glxtvout.iby) - -PRJ_MMPFILES -glxtvout.mmp - -PRJ_TESTMMPFILES -//../tsrc/group/t_glxtvout.mmp diff -r 99ad1390cd33 -r c499df2dbb33 tvout/group/glxtvout.mmp --- a/tvout/group/glxtvout.mmp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file -* -*/ - -#include -#include - -TARGET glxtvout.dll -TARGETTYPE dll -UID 0x1000008d 0x2000A7BC - -CAPABILITY CAP_GENERAL_DLL - -// System includes from epoc32/include -APP_LAYER_SYSTEMINCLUDE - -// Class descriptions -SOURCEPATH ../src -SOURCE glxwindowvisibilitymonitor.cpp -SOURCE glxtvconnectionmonitor.cpp -SOURCE glxtv.cpp -SOURCE glxhdmicontainer.cpp -SOURCE glxhdmicontroller.cpp -SOURCE glxhdmisurfaceupdater.cpp -SOURCE glxactivedecoder.cpp - -// Component class definitions -USERINCLUDE ../inc - - -// System includes from the source tree -SYSTEMINCLUDE ../../inc // for tv out constants -SYSTEMINCLUDE /epoc32/include -SYSTEMINCLUDE /epoc32/include/icl - -// Common Libraries -LIBRARY euser.lib -LIBRARY ws32.lib // for RWsSession -LIBRARY avkon.lib // for AppUi -LIBRARY cone.lib // for CCoeEnv -LIBRARY centralrepository.lib // for Central Repository -LIBRARY accclient.lib // for RAccessoryServer -LIBRARY alfclient.lib // For Alfred Hitchcock framework -LIBRARY fbscli.lib -LIBRARY gdi.lib -LIBRARY surfaceupdateclient.lib // surface update client -LIBRARY surfacemanager.lib // surface manager -LIBRARY imageconversion.lib // ICL -LIBRARY efsrv.lib -LIBRARY glxlogging.lib -// Other Dependency Libraries -#ifdef __MARM -LIBRARY GSServerEngine.lib // FOr AspectRatio -#endif -// End of File diff -r 99ad1390cd33 -r c499df2dbb33 tvout/inc/glxactivecallback.h --- a/tvout/inc/glxactivecallback.h Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handles & propogates UI state change notifications. -* -*/ - - -#ifndef CGLXACTIVE_CALLBACK_H -#define CGLXACTIVE_CALLBACK_H - -// INCLUDES -#include - -// CLASS DECLARATION - -class CGlxActiveCallBack : public CActive - { - public: - CGlxActiveCallBack( TCallBack aCallBack, TInt aPriority): CActive(aPriority), - iCallBack(aCallBack) {}; - CGlxActiveCallBack(); - - public: // Functions from base classes - void SetActive() { CActive::SetActive();}; - void RunL() { iCallBack.CallBack();}; - void DoCancel() {}; - - private: // Data - TCallBack iCallBack; - }; - -#endif // CGLXACTIVE_CALLBACK_H - -// End of File - diff -r 99ad1390cd33 -r c499df2dbb33 tvout/inc/glxactivedecoder.h --- a/tvout/inc/glxactivedecoder.h Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -#ifndef GLXACTIVEDECODER_H_ -#define GLXACTIVEDECODER_H_ - -// INCLUDES -#include -#include -#include "glxhdmisurfaceupdater.h" - -class CImageDecoder; -// CLASS DECLARATION - -class CGlxHdmiDecoderAO : public CActive - { -public: - /* - * NewL() - * @Param1 CGlxHdmiSurfaceUpdater - */ - static CGlxHdmiDecoderAO* NewL(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater); - - /* - * Destructor - */ - ~CGlxHdmiDecoderAO(); - - /* - * ConvertImageL() - * This calls the asyncronous service request to ICL convert - * @param1 - Destination Bitmap - * @param2 - Image decoder - */ - void ConvertImageL(CFbsBitmap& iBitmap,CImageDecoder* aDecoder); - -protected: - // from CActive - void RunL(); - void DoCancel(); - -private: - /* - * Constructor - */ - CGlxHdmiDecoderAO(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater); - -private: - CGlxHdmiSurfaceUpdater* iHdmiSurfaceUpdater; // not owned - CImageDecoder* iDecoder; - }; - -#endif /* GLXACTIVEDECODER_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/inc/glxhdmicontainer.h --- a/tvout/inc/glxhdmicontainer.h Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handles & propogates UI state change notifications. -* -*/ - -#ifndef GLXHDMICONTAINER_H_ -#define GLXHDMICONTAINER_H_ - -#include -#include "glxhdmisurfaceupdater.h" - -class CGlxHdmiContainer : public CCoeControl, public MGlxGenCallback - { -public: - /* - * NewLC - */ - static CGlxHdmiContainer* NewL(const TRect& aRect); - - /* - * Destructor - */ - ~CGlxHdmiContainer(); - - /* - * Get window instance - */ - RWindow* GetWindow(); - -private:// from MGlxGenCallback - void DoGenCallback(); - -private: // from CCoeControl - void Draw(); - -private: - /* - * Ctor - */ - CGlxHdmiContainer(const TRect& aRect); - - /* - * ConstructL() - */ - void ConstructL(); - - /* - * Create window for HDMI - * Create a screendevice - */ - void CreateHdmiWindowL(); - -private: - TRect iRect; - RWsSession iSession; - RWindow iWsWindow; - CWsScreenDevice* iScreenDevice; - RWindowGroup iWsWindowGroup; - CWindowGc* iWindowGc; - TInt iWsWindowGroupID; - }; - -#endif /* GLXHDMICONTAINER_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/inc/glxhdmicontroller.h --- a/tvout/inc/glxhdmicontroller.h Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handles & propogates UI state change notifications. -* -*/ - -#ifndef GLXHDMICONTROLLER_H_ -#define GLXHDMICONTROLLER_H_ - -// Internal includes -#include // for inteface MGlxTvObserver - -class CGlxHdmiContainer; -class CGlxHdmiSurfaceUpdater; -class CGlxTv; - -/* - * This class will be called from FS and Slideshow for its requirements - */ -class CGlxHdmiController : public CBase, - public MGlxTvObserver // for TV Out - { -public: - /* - * NewLC - * @param1 - Image file path default to NULL - */ - IMPORT_C static CGlxHdmiController* NewL(); - - /* - * Destructor - */ - IMPORT_C ~CGlxHdmiController(); - - /* - * Update Image - * @param1 - Image file path - */ - IMPORT_C void SetImageL(const TDesC& aImageFile, TBool aStore = ETrue); - - /* - * To intimate that the item is not supported. - */ - IMPORT_C void ItemNotSupported(); - - /* - * Activating zoom in posting mode - */ - IMPORT_C void ActivateZoom(TBool aAutoZoomOut); - /* - * Deactivating zoom in posting mode - */ - IMPORT_C void DeactivateZoom(); - - /* - * ShiftToCloningMode - */ - IMPORT_C void ShiftToCloningMode(); - - /* - * ShiftToPostingMode - */ - IMPORT_C void ShiftToPostingMode(); - - /* - * Tells if HDMi is Connected. - */ - IMPORT_C TBool IsHDMIConnected(); - -private:// From MGlxTvObserver - virtual void HandleTvStatusChangedL ( TTvChangeType aChangeType ); - -private: - /* - * Constructor - */ - CGlxHdmiController(); - - /* - * ConstructL - */ - void ConstructL(); - - /* - * Create the Hdmi Container - */ - void CreateHdmiContainerL(); - - /* - * Create surface updater and update background surface - * @param1 - Image file - */ - void CreateSurfaceUpdaterL(const TDesC& aImageFile); - - /* - * To Destroy the surface updater if present - */ - void DestroySurfaceUpdater(); - - /* - * Detroy the container - */ - void DestroyContainer(); - - /* - * Stores the Image File name - * @param1 - Image file - */ - void StoreImageInfoL(const TDesC& aImageFile); - -private: - HBufC* iStoredImagePath; - - CGlxHdmiContainer* iHdmiContainer; - CGlxHdmiSurfaceUpdater* iSurfaceUpdater; - CGlxTv* iGlxTvOut; - TBool iIsImageSupported; - TBool iIsPostingMode; - }; - -#endif /* GLXHDMICONTROLLER_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/inc/glxhdmisurfaceupdater.h --- a/tvout/inc/glxhdmisurfaceupdater.h Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,183 +0,0 @@ -/* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handles & propogates UI state change notifications. -* -*/ - -#ifndef GLXHDMISURFACEUPDATER_H_ -#define GLXHDMISURFACEUPDATER_H_ - -#include -#include - -// GCE Surface -#include "graphics/surfacemanager.h" -#include "graphics/surface.h" -#include "graphics/surfaceupdateclient.h" -#include -class CGlxActiveCallBack; -class CGlxHdmiDecoderAO; -class CImageDecoder; -class TSurfaceConfiguration; -class MGlxGenCallback - { -public: - virtual void DoGenCallback() = 0; - }; - -class CGlxHdmiSurfaceUpdater: public CBase - { -public: - /* - * - */ - static CGlxHdmiSurfaceUpdater* NewL(RWindow* aWindow, const TDesC& aImageFile, - MGlxGenCallback* aCallBack); - - /* - * destructor - */ - ~CGlxHdmiSurfaceUpdater(); - -public: - /* - * This is to cancel the active object from decoding - */ - void HandleRunL(TRequestStatus& aStatus); - - /* - * This updates the new image. - */ - void UpdateNewImageL(const TDesC& aImageFile); - - /* - * Activate Zoom - */ - void ActivateZoom(TBool aAutoZoomOut); - /* - * Deactivate Zoom - */ - void DeactivateZoom(); - /* - * Zoom in our out depending on parameter - */ - void Zoom(TBool aZoom); - - /* - ShiftToCloningMOde - */ - void ShiftToCloningMode(); - - /* - ShiftToPostingMode - */ - void ShiftToPostingMode(); - -private: - /* - * Ctor - */ - CGlxHdmiSurfaceUpdater(RWindow* aWindow, const TDesC& aImageFile, - MGlxGenCallback* aCallBack); - - /* - * ConstructL() - */ - void ConstructL(); - - /* - * Create a New surface with given size - */ - void CreateSurfaceL(); - /* - * @param1 size - */ - void MapSurfaceL(); - - static TInt SurfBuffer0Ready(TAny* aObject); - /* - * Call a refresh on the screen - */ - void Refresh(); - - /* - * Dump the buffer on to the surface stride - */ - void SwapBuffers(); - - /* - * Release contents - */ - void ReleaseContent(); - - /* - * Create bitmap - */ - void CreateBitmapL(); - - /* - * Create an image decoder with given file - * @param1 - Image file - */ - void CreateImageDecoderL(const TDesC& aImageFile); - - /* - * Creating all enablers for HDMI - * @param1 if creating a surface is required, - * by default it is not required - */ - void CreateHdmiL(TBool aCreateSurface = ETrue); - - static TInt TimeOut(TAny* aSelf); - - /* - * ModifySurface positions of the surface to be displayed on screen - */ - void ModifySurfacePostion(); -private: - RWindow* iWindow; - const TDesC& iImagePath; - MGlxGenCallback* iCallBack; - - // GCE Surface - RSurfaceUpdateSession iSurfUpdateSession; - TSurfaceId iSurfId; // TSurfaceId - RSurfaceManager* iSurfManager; // RSurfaceManager - RChunk* iSurfChunk; // RChunk - TInt iSurfaceStride; // surface stride - TSurfaceConfiguration iConfig; // surface configuration for zoom - - TSize iZoomRectSz ; - CFbsBitmap* iDecodedBitmap; //Decoded bitmap of the focussed image - - void* iSurfBuffer; // Surface buffer - CGlxActiveCallBack* iSurfBufferAO; // Surface buffer AO - - //ICL - CGlxHdmiDecoderAO* iGlxDecoderAO; // Internal Image decoder AO - CImageDecoder* iImageDecoder; // Image Decoder - RFs iFsSession; // RFs - - TPoint iLeftCornerForZoom; - CPeriodic* iTimer; - TBool iZoom; - TBool iBitmapReady; - TBool iAutoZoomOut; - TBool iSurfSessionConnected; -#ifdef _DEBUG - TTime iStartTime; - TTime iStopTime; -#endif - - }; -#endif /* GLXHDMISURFACEUPDATER_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/inc/glxtv.h --- a/tvout/inc/glxtv.h Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handles & propogates UI state change notifications. -* -*/ - - - -/** - * @internal reviewed 24/08/2007 by D Holland - */ - -#ifndef __GLXTV_H__ -#define __GLXTV_H__ - -// External Includes -#include -#include - -// Internal Includes -#include - -// Forward Declarations -class MGlxTvObserver; -class CGlxWindowVisibilityMonitor; -class CGlxTvConnectionMonitor; -class CRepository; - -// For window server visibility notifications -class MGlxWindowVisibilityObserver - { -public: - /** - * Handle changes to the application window visiblity - * Called when window visible state changes - * @param aChangeType The visibility change type - */ - virtual void HandleWindowVisibilityChangedL( TTvChangeType aChangeType ) = 0; - }; - - - -// For Tv connection notification -class MGlxTvConnectionObserver - { -public: - /** - * Handle TV connection state changes - */ - virtual void HandleTvConnectionStatusChangedL( ) = 0; - }; - - - - -/** - * Class Description - * A class that handles and propagates UI change notifications - * @author Loughlin - */ -NONSHARABLE_CLASS (CGlxTv) : public CBase, - public MGlxWindowVisibilityObserver, - public MGlxTvConnectionObserver - { -public: - /** - * Static Symbian 2 stage constructor. - * @param a TvObserver - */ - IMPORT_C static CGlxTv* NewL( MGlxTvObserver& aTvObserver ); - - /** - * Destructor. - */ - IMPORT_C ~CGlxTv(); - -private: - - /** - * Standard C++ constructor - * @param a TvObserver - */ - CGlxTv(MGlxTvObserver& aTvObserver); - - /* - * Symbian second stage construction - */ - void ConstructL(); - -public: // class public method - - /** - * Get the current screen size - * @return the Screen size in pixels - */ - IMPORT_C TSize ScreenSizeL() const; - - /** - * Is the Analog TV Connected - * @return ETrue if active, otherwise EFalse - */ - IMPORT_C TBool IsConnected() const; - - /** - * Is the TV widescreen - * @return ETrue if widescreen, otherwise EFalse - */ - IMPORT_C TBool IsWidescreen() const; - - /** - * Is the HDMI TV Connected - * @return ETrue if active, otherwise EFalse - */ - IMPORT_C TBool IsHDMIConnected() const; - -public: // from MGlxWindowVisibilityObserver - /** - * @ref MGlxWindowVisibilityObserver::HandleWindowVisibilityChangedL - */ - void HandleWindowVisibilityChangedL( TTvChangeType aChangeType ); - - -public: // from MGlxTvConnectionObserver - /** - * @ref MGlxTvConnectionObserver::HandleTvConnectionStatusChangedL - */ - void HandleTvConnectionStatusChangedL( ); - -private: // new private methods - /** - * Retrive the TV Display Aspect Ratio and TV Setting - * Calculate the screen size from aspect ratio and TV type - */ - void CalcTvScreenSzL(); - - /** - * Start monitoring the environment for changes to the TV aspect ratio - * and the Gallery window groups visiblity - */ - void MonitorEnvironmentL(); - - /** - * Stop monitoring the environment for changes to the TV aspect ratio - * and the Gallery window groups visiblity - */ - void StopMonitoringEnvironment(); - -private: // class member data - // Not Owned: The TV out observer - MGlxTvObserver& iTvObserver; - - // Owned: The Window visibility monitor - CGlxWindowVisibilityMonitor* iWindowVisibilityMonitor; - - // Owned: The TV connection monitor - CGlxTvConnectionMonitor* iTvConnectionMonitor; - - // Size of the TV Out display size - TSize iSzInPixels; - - // Owned: The central repository where TV display ratio is held. - CRepository* iCenRep; - - // The implementation of the class, hidden from clients - class CGlxTvOutCenRepMonitor; - - // Owned: Monitoring class for Tv Ratio Values - CGlxTvOutCenRepMonitor* iTvDisplayAspectRatioMonitor; - - // The TV aspect ratio - TInt iAspectRatio; - }; - - -#endif // __GLXTV_H__ \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/inc/glxtvconnectionmonitor.h --- a/tvout/inc/glxtvconnectionmonitor.h Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Monitoring class of the Tv Out Connection -* -*/ - - - -/** - * @internal reviewed 24/08/2007 by D Holland - */ - -#ifndef __GLX_WNDWCONNECTION_MONITOR_H__ -#define __GLX_WNDWCONNECTION_MONITOR_H__ - -// External Includes -#include // for CActive -#include // for MAknWsEventObserver -#include // for RAccessoryServer -#include // for RAccessoryMode - - -// Forward Declarations -class MGlxTvConnectionObserver; - - -/** - * Class Description - * An Active object derived class is used to monitor the TV out connection - * @author Loughlin - */ -NONSHARABLE_CLASS(CGlxTvConnectionMonitor) : public CActive - { -public: - - /** - * Static Symbian 2 stage constructor. - */ - static CGlxTvConnectionMonitor* NewL( - MGlxTvConnectionObserver& aConnectionObserver); - - /** - * Destructor. - */ - ~CGlxTvConnectionMonitor(); - -private: - - /** - * Standard C++ constructor - */ - CGlxTvConnectionMonitor( - MGlxTvConnectionObserver& aConnectionObserver); - - /* - * Symbian second stage construction - */ - void ConstructL(); - -public: // class member functions - - /* - * Provides the caller with the current TV connetion state - * @return The TV connection state - */ - TBool IsConnected() const; - - /* - * Provides the caller with the current HDMI connetion state - * @return The HDMI connection state - */ - TBool IsHDMIConnected() const; - - -private: // From CActive - /** - * @ref CActive::RunL - */ - void RunL(); - - /** - * @ref CActive::DoCancel - */ - void DoCancel(); - - /** - * @ref CActive::RunError - */ - TInt RunError( TInt aError ); - - -private: - - /** - * Requests TV on/off events - */ - void IssueRequest(); - - /** - * Sends notification to observers when TV Out cable is connected - */ - void IssueNotificationL(); - - -private: // class member data - - // Not owned: TV connection observer - MGlxTvConnectionObserver& iConnectionObserver; - - // TVout The Connection state - TBool iTvOutConnectionState; - - // TVout The Connection state - TBool iHDMIConnectionState; - - // The (external device) Accessory Server - RAccessoryServer iTvAccServer; - - // Accessory mode - RAccessoryMode iTvAccMode; - - // Accessory Mode structure - details the type of accessory - TAccPolAccessoryMode iCurrentAccMode; - - }; - - -#endif // __GLX_WNDWCONNECTION_MONITOR_H__ \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/inc/glxwindowvisibilitymonitor.h --- a/tvout/inc/glxwindowvisibilitymonitor.h Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class definition that monitors tv window visibility -* -*/ - - - -/** - * @internal reviewed 24/08/2007 by D Holland - */ - -#ifndef __GLXWINVISIBILITYMONITOR_H__ -#define __GLXWINVISIBILITYMONITOR_H__ - -// External Includes -#include // for CBase -#include // for MAknWsEventObserver - - -// Forward Declarations -class MGlxWindowVisibilityObserver; - - - -/** - * Class Description - * An Active object derived class is used to monitor the visibility of the - * TV out window. - * @author Loughlin - */ -NONSHARABLE_CLASS(CGlxWindowVisibilityMonitor) : public CBase, - public MAknWsEventObserver - { -public: - /** - * Static Symbian 2 stage constructor. - */ - static CGlxWindowVisibilityMonitor* NewL( - MGlxWindowVisibilityObserver& aVisibilityObserver ); - - /** - * Destructor. - */ - ~CGlxWindowVisibilityMonitor(); - - - /** - * Close. - */ - void Close(); - -private: - - /** - * Standard C++ constructor - */ - CGlxWindowVisibilityMonitor( - MGlxWindowVisibilityObserver& aVisibilityObserver ); - - /* - * Symbian second stage construction - */ - void ConstructL(); - -public: // class member functions - - /* - * Provides the caller with the current visible state - * @return ETrue if the window is visible or false otherwise - */ - TBool IsVisible() const; - -public: // from MAknWsEventObserver - - void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); - -private: // class member data - // Not ownded: The Akn event monitor - CAknWsEventMonitor* iAknEventMonitor; - - // Not owned: Window visibility observer - MGlxWindowVisibilityObserver& iVisibilityObserver; - - // The visible state - TBool iIsVisible; - }; - - - -#endif // __GLXWINVISIBILITYMONITOR_H__ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/rom/glxtvout.iby --- a/tvout/rom/glxtvout.iby Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Photos TV Out iby file. -* -*/ - - - - -#ifndef __GLX_TVOUT_IBY__ -#define __GLX_TVOUT_IBY__ - -file=ABI_DIR\BUILD_DIR\glxtvout.dll SHARED_LIB_DIR\glxtvout.dll - -#endif // __GLX_TVOUT_IBY__ - -// End of file ------------------------------------------------------------ \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/src/glxactivedecoder.cpp --- a/tvout/src/glxactivedecoder.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include -#include "glxactivedecoder.h" - -// ----------------------------------------------------------------------------- -// NewL -// ----------------------------------------------------------------------------- -CGlxHdmiDecoderAO* CGlxHdmiDecoderAO::NewL(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater) - { - TRACER("CGlxHdmiDecoderAO::NewL()"); - CGlxHdmiDecoderAO* self = new (ELeave) CGlxHdmiDecoderAO(aHdmiSurfaceUpdater); - return self; - } - -// ----------------------------------------------------------------------------- -// CGlxHdmiDecoderAO() -// ----------------------------------------------------------------------------- -CGlxHdmiDecoderAO::CGlxHdmiDecoderAO(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater): - CActive(CActive::EPriorityStandard-1),iHdmiSurfaceUpdater(aHdmiSurfaceUpdater) - { - TRACER("CGlxHdmiDecoderAO::CGlxHdmiDecoderAO()"); - CActiveScheduler::Add(this); - } - -// ----------------------------------------------------------------------------- -// ~CGlxHdmiDecoderAO -// Cancel the outstanding request -// ----------------------------------------------------------------------------- -CGlxHdmiDecoderAO::~CGlxHdmiDecoderAO() - { - TRACER("CGlxHdmiDecoderAO::~CGlxHdmiDecoderAO()"); - } - -// ----------------------------------------------------------------------------- -// RunL -// Calls iHdmiSurfaceUpdater->HandleRunL() which is expected to handle the call -// ----------------------------------------------------------------------------- -void CGlxHdmiDecoderAO::RunL() - { - TRACER("CGlxHdmiDecoderAO::RunL()"); - if(iStatus == KErrUnderflow) - { - GLX_LOG_INFO("CGlxHdmiDecoderAO::RunL() - call continueconvert"); - iDecoder->ContinueConvert(&iStatus); - } - else - { - GLX_LOG_INFO("CGlxHdmiDecoderAO::RunL() - call handlerunL"); - iHdmiSurfaceUpdater->HandleRunL(iStatus); - } - } - -// ----------------------------------------------------------------------------- -// DoCancel -// ----------------------------------------------------------------------------- -void CGlxHdmiDecoderAO::DoCancel() - { - TRACER("CGlxHdmiDecoderAO::DoCancel()"); - iDecoder->Cancel(); - } - -// ----------------------------------------------------------------------------- -// ConvertImageL -// ----------------------------------------------------------------------------- -void CGlxHdmiDecoderAO::ConvertImageL(CFbsBitmap& aBitmap, - CImageDecoder* aDecoder) - { - TRACER("CGlxHdmiDecoderAO::ConvertImageL()"); - iDecoder = aDecoder; - iDecoder->Convert(&iStatus,aBitmap); - SetActive(); - } - - - diff -r 99ad1390cd33 -r c499df2dbb33 tvout/src/glxhdmicontainer.cpp --- a/tvout/src/glxhdmicontainer.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include -#include -#include -#include "glxhdmicontainer.h" -const TInt KGroupNameLength = 32; -// ----------------------------------------------------------------------------- -// NewLC -// ----------------------------------------------------------------------------- -CGlxHdmiContainer* CGlxHdmiContainer::NewL(const TRect& aRect) - { - TRACER("CGlxHdmiContainer* CGlxHdmiContainer::NewL()"); - CGlxHdmiContainer* self = new (ELeave) CGlxHdmiContainer(aRect); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// destructor -// ----------------------------------------------------------------------------- -CGlxHdmiContainer::~CGlxHdmiContainer() - { - TRACER("CGlxHdmiContainer::~CGlxHdmiContainer()"); - iWsWindowGroup.Close(); - delete iWindowGc; - delete iScreenDevice; - } - -// ----------------------------------------------------------------------------- -// CTor -// ----------------------------------------------------------------------------- -CGlxHdmiContainer::CGlxHdmiContainer(const TRect& aRect): - iRect(aRect) - { - TRACER("CGlxHdmiContainer::CGlxHdmiContainer()"); - // Implement nothing here - } - -// ----------------------------------------------------------------------------- -// ConstructL -// ----------------------------------------------------------------------------- -void CGlxHdmiContainer::ConstructL() - { - TRACER("CGlxHdmiContainer::ConstructL()"); - CreateHdmiWindowL(); - ActivateL(); - } - -// ---------------------------------------------------------- -// GetWindow() -// ---------------------------------------------------------- -// -RWindow* CGlxHdmiContainer::GetWindow() - { - TRACER("CGlxHdmiContainer::GetWindow()"); - return &Window(); - } - -// ----------------------------------------------------------------------------- -// CreateHdmiWindowL -// ----------------------------------------------------------------------------- -void CGlxHdmiContainer::CreateHdmiWindowL() - { - TRACER ("CGlxHdmiContainer::CreateHdmiWindowL()"); - const TUint32 id = 12345678; - - // Create screen device and gc - iSession = ControlEnv()->WsSession(); - iScreenDevice = new(ELeave) CWsScreenDevice(iSession); - User::LeaveIfError(iScreenDevice->Construct(1)); // use Screen 1 - User::LeaveIfError(iScreenDevice->CreateContext(iWindowGc)); - - // Create window group - iWsWindowGroup = RWindowGroup(iSession); - User::LeaveIfError(iWsWindowGroup.Construct(id, iScreenDevice)); - iWsWindowGroup.SetOrdinalPosition(0); - TBuf winGroupName(_L("PhotosHdmi")); - iWsWindowGroup.SetName(winGroupName); - iWsWindowGroupID = iWsWindowGroup.Identifier(); - - // Create window - CreateWindowL(iWsWindowGroup); - iWsWindow = Window(); - SetRect(TRect(iScreenDevice->SizeInPixels())); - } - -// ----------------------------------------------------------------------------- -// ConstructL -// ----------------------------------------------------------------------------- -void CGlxHdmiContainer::Draw() - { - TRACER("CGlxHdmiContainer::Draw()"); - CWindowGc& gc = SystemGc(); - gc.DrawRect(iRect); - } - -// ----------------------------------------------------------------------------- -// ConstructL -// ----------------------------------------------------------------------------- -void CGlxHdmiContainer::DoGenCallback() - { - TRACER("CGlxHdmiContainer::DoGenCallback()"); - DrawNow(); - } diff -r 99ad1390cd33 -r c499df2dbb33 tvout/src/glxhdmicontroller.cpp --- a/tvout/src/glxhdmicontroller.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,273 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include -#include -#include -#include "glxtv.h" // for CGlxTv -#include "glxhdmicontainer.h" -#include "glxhdmisurfaceupdater.h" - - -#include "glxhdmicontroller.h" - -// ----------------------------------------------------------------------------- -// NewLC -// ----------------------------------------------------------------------------- -EXPORT_C CGlxHdmiController* CGlxHdmiController::NewL() - { - TRACER("CGlxHdmiController* CGlxHdmiController::NewL()"); - CGlxHdmiController* self = new (ELeave) CGlxHdmiController(); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// destructor -// ----------------------------------------------------------------------------- -EXPORT_C CGlxHdmiController::~CGlxHdmiController() - { - TRACER("CGlxHdmiController::~CGlxHdmiController()"); - DestroySurfaceUpdater(); - DestroyContainer(); - delete iStoredImagePath; - iStoredImagePath = NULL; - if(iGlxTvOut) - { - delete iGlxTvOut; - } - } - -// ----------------------------------------------------------------------------- -// Setting an Image Path -// ----------------------------------------------------------------------------- -EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile, - TBool aStore) - { - TRACER("CGlxHdmiController::SetImageL()"); - if (aStore) - { - iIsImageSupported = ETrue; - StoreImageInfoL(aImageFile); - } - if (iGlxTvOut->IsHDMIConnected()) - { - iIsPostingMode = ETrue; - GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2"); - // do not close the surface , use the same surface instead. - // Call a function to pass imagefile - if (!iHdmiContainer) - { - CreateHdmiContainerL(); - } - if (!iSurfaceUpdater) - { - // This case would come when surface updater is not created at the first instance and also - // it satisfies the 720p condition - CreateSurfaceUpdaterL(aImageFile); - } - else - { - GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 3"); - iSurfaceUpdater->UpdateNewImageL(aImageFile); - } - iHdmiContainer->DrawNow(); - } - } - -// ----------------------------------------------------------------------------- -// IsVideo -// ----------------------------------------------------------------------------- -EXPORT_C void CGlxHdmiController::ItemNotSupported() - { - TRACER("CGlxHdmiController::IsVideo()"); - iIsImageSupported = EFalse; - if (iGlxTvOut->IsHDMIConnected()) - { - DestroySurfaceUpdater(); - } - } - - -// ----------------------------------------------------------------------------- -// ActivateZoom -// ----------------------------------------------------------------------------- -EXPORT_C void CGlxHdmiController::ActivateZoom(TBool aAutoZoomOut) - { - TRACER("CGlxHdmiController::ActivateZoom()"); - if (iGlxTvOut->IsHDMIConnected()) - { - iSurfaceUpdater->ActivateZoom(aAutoZoomOut); - } - } - -// ----------------------------------------------------------------------------- -// DeactivateZoom -// ----------------------------------------------------------------------------- -EXPORT_C void CGlxHdmiController::DeactivateZoom() - { - TRACER("CGlxHdmiController::DeactivateZoom()"); - if (iGlxTvOut->IsHDMIConnected()) - { - iSurfaceUpdater->DeactivateZoom(); - } - } - -// ----------------------------------------------------------------------------- -// ShiftToCloningMode -// ----------------------------------------------------------------------------- -EXPORT_C void CGlxHdmiController::ShiftToCloningMode() - { - TRACER("CGlxHdmiController::ShiftToCloningMode()"); - iIsPostingMode = EFalse; - if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) - { - iSurfaceUpdater->ShiftToCloningMode(); - } - } - -// ----------------------------------------------------------------------------- -// ShiftToPostingMode -// ----------------------------------------------------------------------------- -EXPORT_C void CGlxHdmiController::ShiftToPostingMode() - { - TRACER("CGlxHdmiController::ShiftToPostingMode()"); - iIsPostingMode = ETrue; - if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) - { - iSurfaceUpdater->ShiftToPostingMode(); - } - } - -// ----------------------------------------------------------------------------- -// Constructor -// ----------------------------------------------------------------------------- -CGlxHdmiController::CGlxHdmiController(): - iIsPostingMode(EFalse) - { - TRACER("CGlxHdmiController::CGlxHdmiController()"); - // Implement nothing here - } - -// ----------------------------------------------------------------------------- -// ConstructL -// ----------------------------------------------------------------------------- -void CGlxHdmiController::ConstructL() - { - TRACER("CGlxHdmiController::ConstructL()"); - iGlxTvOut = CGlxTv::NewL(*this); - } - -// ----------------------------------------------------------------------------- -// DestroyContainer -// ----------------------------------------------------------------------------- -void CGlxHdmiController::DestroyContainer() - { - TRACER("CGlxHdmiController::DestroyContainer()"); - if (iHdmiContainer) - { - GLX_LOG_INFO("CGlxHdmiController::DestroyHdmi() - deleting iHdmiContainer 1"); - delete iHdmiContainer; - iHdmiContainer = NULL; - } - } - -// ----------------------------------------------------------------------------- -// DestroySurfaceUpdater -// ----------------------------------------------------------------------------- -void CGlxHdmiController::DestroySurfaceUpdater() - { - TRACER("CGlxHdmiController::DestroySurfaceUpdater()"); - if (iSurfaceUpdater) - { - delete iSurfaceUpdater; - iSurfaceUpdater = NULL; - } - } - - -// ----------------------------------------------------------------------------- -// CreateHdmiContainerL -// ----------------------------------------------------------------------------- -void CGlxHdmiController::CreateHdmiContainerL() - { - TRACER("CGlxHdmiController::CreateHdmiContainer()"); - TRect rect = AlfUtil::ScreenSize(); - iHdmiContainer = CGlxHdmiContainer::NewL(rect); - } - -// ----------------------------------------------------------------------------- -// CreateSurfaceUpdaterL -// ----------------------------------------------------------------------------- -void CGlxHdmiController::CreateSurfaceUpdaterL(const TDesC& aImageFile) - { - TRACER("CGlxHdmiController::CreateSurfaceUpdater()"); - RWindow* window = iHdmiContainer->GetWindow(); - iSurfaceUpdater = CGlxHdmiSurfaceUpdater::NewL(window, aImageFile, - iHdmiContainer); - iHdmiContainer->DrawNow(); - } - -// ----------------------------------------------------------------------------- -// StoreImageInfoL -// ----------------------------------------------------------------------------- -void CGlxHdmiController::StoreImageInfoL(const TDesC& aImageFile) - { - TRACER("CGlxHdmiController::StoreImageInfoL()"); - if(iStoredImagePath) - { - delete iStoredImagePath; - iStoredImagePath = NULL; - } - iStoredImagePath = aImageFile.AllocL(); - } - -// ----------------------------------------------------------------------------- -// HandleTvStatusChangedL -// ----------------------------------------------------------------------------- -void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType ) - { - TRACER("CGlxHdmiController::HandleTvStatusChangedL()"); - if ( aChangeType == ETvConnectionChanged ) - { - if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported && iIsPostingMode) - { - GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected"); - // Calling SetImageL() with appropriate parameters - SetImageL(iStoredImagePath->Des(), EFalse); - } - else - { - // if it gets disconnected, destroy the surface - GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected"); - DestroySurfaceUpdater(); - } - } - } - -// ----------------------------------------------------------------------------- -// HandleTvStatusChangedL -// ----------------------------------------------------------------------------- -EXPORT_C TBool CGlxHdmiController::IsHDMIConnected() - { - TRACER("CGlxHdmiController::IsHDMIConnected()"); - return iGlxTvOut->IsHDMIConnected(); - } - diff -r 99ad1390cd33 -r c499df2dbb33 tvout/src/glxhdmisurfaceupdater.cpp --- a/tvout/src/glxhdmisurfaceupdater.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,606 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "glxactivecallback.h" -#include "glxhdmisurfaceupdater.h" -#include "glxactivedecoder.h" - -// 720p image size -const TInt KHdTvWidth = 1280; -const TInt KHdTvHeight = 720; -const TInt KMulFactorToCreateBitmap = 4; -const TInt KZoomDelay = 10000; -//100 , is decide for 20 steps of zooming , with each step being 5 pixels. -const TInt KMaxZoomLimit = 100; -//evey time we zoom , there is a increase in the ht amd width by 10 pixels. -const TInt KSingleStepForZoom = 10; -// ----------------------------------------------------------------------------- -// NewLC -// ----------------------------------------------------------------------------- -CGlxHdmiSurfaceUpdater* CGlxHdmiSurfaceUpdater::NewL(RWindow* aWindow, const TDesC& aImageFile, - MGlxGenCallback* aCallBack) - { - TRACER("CGlxHdmiSurfaceUpdater* CGlxHdmiSurfaceUpdater::NewL()"); - CGlxHdmiSurfaceUpdater* self = new (ELeave) CGlxHdmiSurfaceUpdater(aWindow, aImageFile, - aCallBack); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; - } - -// ----------------------------------------------------------------------------- -// destructor -// ----------------------------------------------------------------------------- -CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater() - { - TRACER("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater()"); - ReleaseContent(); - if(iWindow) - { - iWindow->RemoveBackgroundSurface(ETrue); - } - if(iTimer->IsActive()) - { - iTimer->Cancel(); - } - delete iTimer; - if (iGlxDecoderAO) - { - delete iGlxDecoderAO; - } - iGlxDecoderAO = NULL; - iFsSession.Close(); - if (iSurfManager) - { - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater() - Close"); - if(iSurfSessionConnected) - { - iSurfUpdateSession.Close(); - } - if (iSurfChunk) - { - iSurfChunk->Close(); - } - delete iSurfChunk; - iSurfChunk = NULL; - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater(). iSurfManager->CloseSurface()"); - iSurfManager->CloseSurface(iSurfId); - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater(). iSurfManager->Close()"); - iSurfManager->Close(); - delete iSurfManager; - iSurfManager = NULL; - } - } - -// ----------------------------------------------------------------------------- -// ReleaseContent -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::ReleaseContent() - { - TRACER("void CGlxHdmiSurfaceUpdater::ReleaseContent()"); - if ( iGlxDecoderAO ) - { - iGlxDecoderAO->Cancel(); - } - - if ( iDecodedBitmap ) - { - delete iDecodedBitmap; - iDecodedBitmap= NULL; - } - - if(iSurfBufferAO && iSurfBufferAO->IsActive()) - { - iSurfBufferAO->Cancel(); - } - - if ( iImageDecoder ) - { - delete iImageDecoder; - iImageDecoder = NULL; - } - - if (iSurfSessionConnected && iSurfManager) - { - iSurfUpdateSession.CancelAllUpdateNotifications(); - } - } - -// ----------------------------------------------------------------------------- -// CTor -// ----------------------------------------------------------------------------- -CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater(RWindow* aWindow, - const TDesC& aImageFile, MGlxGenCallback* aCallBack): - iWindow(aWindow), iImagePath(aImageFile), - iCallBack(aCallBack) - { - TRACER("CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater()"); - // Implement nothing here - } - -// ----------------------------------------------------------------------------- -// ConstructL -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::ConstructL() - { - TRACER("CGlxHdmiSurfaceUpdater::ConstructL()"); - TInt error = iFsSession.Connect (); - GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ConstructL() FsSession Connect error = %d", error); - User::LeaveIfError(error); - - iBitmapReady = EFalse; - // Create the active object - iGlxDecoderAO = CGlxHdmiDecoderAO::NewL(this); - CreateImageDecoderL(iImagePath); - CreateBitmapL(); - CreateHdmiL(); - error = iSurfUpdateSession.Connect(); - GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ConstructL() Surface update Session Connect error = %d", error); - User::LeaveIfError(error); - iSurfSessionConnected = ETrue; - -#ifdef _DEBUG - iStartTime.HomeTime(); -#endif - //start decoding the image - iGlxDecoderAO->ConvertImageL(*iDecodedBitmap,iImageDecoder); - - iLeftCornerForZoom.iX = 0; - iLeftCornerForZoom.iY = 0; - iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); - iZoom = ETrue; - } - -// ----------------------------------------------------------------------------- -// UpdateNewImageL -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::UpdateNewImageL(const TDesC& aImageFile) - { - TRACER("CGlxHdmiSurfaceUpdater::UpdateNewImageL()"); - //Cancel the zoom timers if any - if(iTimer->IsActive()) - { - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::UpdateNewImageL() - Cancel Timer"); - iTimer->Cancel(); - } - - iBitmapReady = EFalse; - iLeftCornerForZoom.iX = 0; - iLeftCornerForZoom.iY = 0; - ReleaseContent(); - CreateImageDecoderL(aImageFile); - CreateBitmapL(); - CreateHdmiL(EFalse); -#ifdef _DEBUG - iStartTime.HomeTime(); -#endif - //start decoding the image - iGlxDecoderAO->ConvertImageL(*iDecodedBitmap,iImageDecoder); - } - -// ----------------------------------------------------------------------------- -// CreateHDMI -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::CreateHdmiL(TBool aCreateSurface) - { - TRACER("CGlxHdmiSurfaceUpdater::CreateHdmiL()"); - - if (aCreateSurface) - { - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::CreateHdmiL() Create Surface"); - CreateSurfaceL(); - } - - // Active objects for double buffered draw signalling - if(!iSurfBufferAO) - { - iSurfBufferAO = new(ELeave) CGlxActiveCallBack(TCallBack(SurfBuffer0Ready, this), - CActive::EPriorityStandard-1); - CActiveScheduler::Add(iSurfBufferAO); - } - } - -// ----------------------------------------------------------------------------- -// CreateSurfaceL -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::CreateSurfaceL() - { - TRACER("CGlxHdmiSurfaceUpdater::CreateSurfaceL()"); - TSize surfaceSize = iWindow->Size(); // create surface of the screen size, i.e 1280x720 - iSurfManager = new(ELeave) RSurfaceManager(); - TInt error = iSurfManager->Open(); - GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::CreateSurfaceL Open Surface manager error = %d", error); - User::LeaveIfError(error); - - RSurfaceManager::TSurfaceCreationAttributesBuf attributes; - attributes().iPixelFormat = EUidPixelFormatARGB_8888;// EUidPixelFormatYUV_420Planar; - attributes().iSize = surfaceSize; - - attributes().iBuffers = 1; - attributes().iStride = surfaceSize.iWidth * KMulFactorToCreateBitmap; - attributes().iAlignment = KMulFactorToCreateBitmap; - attributes().iContiguous = EFalse; - attributes().iMappable = ETrue; - - error = iSurfManager->CreateSurface(attributes, iSurfId); - GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::CreateSurfaceL, Creating surface error : %d",error); - User::LeaveIfError(error); - - //Map the surface and stride the surface info - MapSurfaceL(); - // Set the Configuration to the surface ID when creating a surface - iConfig.SetSurfaceId(iSurfId); - } - -// ----------------------------------------------------------------------------- -// MapSurfaceL -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::MapSurfaceL() - { - TRACER("CGlxHdmiSurfaceUpdater::MapSurfaceL()"); - - //Create chunk to map it to the surface ID. - iSurfChunk = new(ELeave) RChunk(); - User::LeaveIfNull(iSurfChunk); - TInt error = iSurfManager->MapSurface(iSurfId, *iSurfChunk); - GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::MapSurfaceL(), MapSurface error : %d",error); - User::LeaveIfError(error); - - // Get the info from the surfaceManager - // and store pointers to the pixel data - RSurfaceManager::TInfoBuf info; - error = iSurfManager->SurfaceInfo(iSurfId, info); - GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::MapSurfaceL(), SurfaceInfo error : %d",error); - User::LeaveIfError(error); - - iSurfaceStride = info().iStride; - TInt offset = 0; - iSurfManager->GetBufferOffset( iSurfId, 0,offset); - iSurfBuffer = iSurfChunk->Base()+offset; - } - -// ----------------------------------------------------------------------------- -// SurfBuffer0Ready -// ----------------------------------------------------------------------------- -TInt CGlxHdmiSurfaceUpdater::SurfBuffer0Ready(TAny* /*aObject*/) - { - TRACER("CGlxHdmiSurfaceUpdater::SurfBuffer0Ready()"); - return ETrue; - } - -// ----------------------------------------------------------------------------- -// Refresh -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::Refresh() - { - TRACER("CGlxHdmiSurfaceUpdater::Refresh()"); - // copy the decoded bitmap on to the surface - SwapBuffers(); - // Modify the surface position with respect to the buffer size - ModifySurfacePostion(); - // refresh the window - iCallBack->DoGenCallback(); - } - -// ----------------------------------------------------------------------------- -// SwapBuffers -// This is used to sawp the buffers shown and to be shown -// After this is done, a refresh to the window should be done to refresh the TV -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::SwapBuffers() - { - TRACER("CGlxHdmiSurfaceUpdater::SwapBuffers()"); - - // Lock the heap so that subsequent call to dataaddress doesnt happen - iDecodedBitmap->LockHeap(); - - // Data stride - TUint fs = iDecodedBitmap->DataStride(); - - //Bitmap address from where the data has to be copied. - TUint8* from = (TUint8*)iDecodedBitmap->DataAddress(); - - //surface chunk address to where the bitmap data has to be copied. - TUint8* to = (TUint8*)iSurfBuffer; - - // To buffer (32 bit colors) - TUint ts = iSurfaceStride; - //No of bytes to be copied on to the surface. - TUint bytes = iDecodedBitmap->SizeInPixels().iWidth * KMulFactorToCreateBitmap; - - GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::SwapBuffers() - decodeSize width = %d and height %d", - iDecodedBitmap->SizeInPixels().iWidth, iDecodedBitmap->SizeInPixels().iHeight ); - - // Copy the bitmap on to the surface. - for (TInt y = iDecodedBitmap->SizeInPixels().iHeight; y >0; y--) - { - Mem::Copy(to, from, bytes); - to += ts; - from += fs; - } - iDecodedBitmap->UnlockHeap(); - } - -// ----------------------------------------------------------------------------- -// CreateBitmapL -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::CreateBitmapL() - { - TRACER("CGlxHdmiSurfaceUpdater::CreateBitmapL()"); - TSize scrnSize = iWindow->Size(); - TSize targetBitmapSize; - TSize imageSize = iImageDecoder->FrameInfo().iOverallSizeInPixels; - GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::StartImageDecodeL() - bitmapsize=%d, %d",imageSize.iWidth,imageSize.iHeight); - TReal32 scaleFactor = 0.0f; - if (scrnSize.iWidth * imageSize.iHeight > scrnSize.iHeight - * imageSize.iWidth) - { - scaleFactor = (TReal32) scrnSize.iHeight - / (TReal32) imageSize.iHeight; - } - else - { - scaleFactor = (TReal32) scrnSize.iWidth - / (TReal32) imageSize.iWidth; - } - GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::StartImageDecodeL() - scaleFactor=%f",scaleFactor); - targetBitmapSize.iHeight = imageSize.iHeight * scaleFactor; - targetBitmapSize.iWidth = imageSize.iWidth * scaleFactor; - - GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::StartImageDecodeL() - targetBitmapSize=%d, %d",targetBitmapSize.iWidth,targetBitmapSize.iHeight); - //create the bitmap for the required size - iDecodedBitmap = new (ELeave) CFbsBitmap(); - - TInt err = iDecodedBitmap->Create(targetBitmapSize, EColor16MU); - User::LeaveIfNull(iDecodedBitmap); - } - -// ----------------------------------------------------------------------------- -// HandleRunL -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::HandleRunL(TRequestStatus& aStatus) - { - TRACER("CGlxHdmiSurfaceUpdater::HandleRunL()"); - -#ifdef _DEBUG - iStopTime.HomeTime(); - GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::HandleRunL() ConvertImageL took" - " <%d> us", (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64()); -#endif - if(aStatus.Int() !=KErrNone) - { - GLX_LOG_INFO("HandleRunL - Convert failed"); - ShiftToCloningMode(); - } - else - { - iZoomRectSz = iDecodedBitmap->SizeInPixels(); - if (iSurfBufferAO->iStatus != KRequestPending - && !iSurfBufferAO->IsActive()) - { - Refresh(); - iSurfBufferAO->iStatus = KRequestPending; - iSurfBufferAO->SetActive(); - iSurfUpdateSession.NotifyWhenAvailable(iSurfBufferAO->iStatus); - TInt err = iSurfUpdateSession.SubmitUpdate(1, iSurfId, 0, NULL); - } - iBitmapReady = ETrue; - } - //release imagedecoder after the conversion is over - if(iImageDecoder) - { - delete iImageDecoder; - iImageDecoder = NULL; - } - } - -// ----------------------------------------------------------------------------- -// CreateImageDecoderL -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::CreateImageDecoderL(const TDesC& aImageFile) - { - TRACER("CGlxHdmiController::CreateImageDecoderL()"); - // Create a decoder for the image in the named file - TRAPD(error,iImageDecoder = CImageDecoder::FileNewL(iFsSession, - aImageFile, CImageDecoder::EOptionNone, KNullUid)); - GLX_LOG_INFO1("CreateImageDecoderL CImageDecoder:FileNewL error %d",error); - User::LeaveIfError(error); - - } - -// ----------------------------------------------------------------------------- -// ActivateZoom -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::ActivateZoom(TBool aAutoZoomOut) - { - TRACER("CGlxHdmiSurfaceUpdater::ActivateZoom()"); - iZoom = ETrue; - iAutoZoomOut = aAutoZoomOut; - if(iTimer->IsActive()) - { - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ActivateZoom() - Cancel Timer"); - iTimer->Cancel(); - } - - if(!iTimer->IsActive() && iBitmapReady) - { - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ActivateZoom() - Start Timer"); - iTimer->Start(KZoomDelay,KZoomDelay,TCallBack( TimeOut,this )); - } - } - -// ----------------------------------------------------------------------------- -// DeactivateZoom -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::DeactivateZoom() - { - TRACER("CGlxHdmiSurfaceUpdater::DeactivateZoom()"); - - if(iTimer->IsActive()) - { - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::DeactivateZoom() - Cancel Timer"); - iTimer->Cancel(); - } - if(!iTimer->IsActive() && iBitmapReady && iLeftCornerForZoom.iX) - { - GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::DeactivateZoom() - Start Timer"); - iZoom = EFalse; - iTimer->Start(KZoomDelay,KZoomDelay,TCallBack( TimeOut,this )); - } - } - -// --------------------------------------------------------------------------- -// TimeOut -// --------------------------------------------------------------------------- -// -TInt CGlxHdmiSurfaceUpdater::TimeOut(TAny* aSelf) - { - TRACER("CGlxHdmiSurfaceUpdater::TimeOut"); - if(aSelf) - { - CGlxHdmiSurfaceUpdater* self = static_cast (aSelf); - if (self) - { - self->Zoom(ETrue); - } - } - return KErrNone; - } - -// ----------------------------------------------------------------------------- -// Zoom -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::Zoom(TBool aZoom) - { - TRACER("CGlxHdmiSurfaceUpdater::Zoom()"); - - if(!iBitmapReady) - { - return; - } - - if(iLeftCornerForZoom.iX == KMaxZoomLimit) - { - iZoom = EFalse; - //If autozoomout is not set then cancel the timer and do - //the zoom out on DeactivateZoom. - if(!iAutoZoomOut) - { - iTimer->Cancel(); - } - } - if(aZoom && iZoom) - { - iZoomRectSz.iWidth = TInt(iZoomRectSz.iWidth-KSingleStepForZoom); - iZoomRectSz.iHeight = TInt(iZoomRectSz.iHeight-KSingleStepForZoom); - iLeftCornerForZoom.iX =iLeftCornerForZoom.iX+KSingleStepForZoom/2; - iLeftCornerForZoom.iY =iLeftCornerForZoom.iY+KSingleStepForZoom/2; - GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::Zoom()--- 2,iZoomRectSz.iWidth = %d, iZoomRectSz.iHeight = %d", iZoomRectSz.iWidth,iZoomRectSz.iHeight); - iConfig.SetViewport(TRect(iLeftCornerForZoom.iX,iLeftCornerForZoom.iY, - iZoomRectSz.iWidth,iZoomRectSz.iHeight)); - } - else - { - iZoomRectSz.iWidth = TInt(iZoomRectSz.iWidth+KSingleStepForZoom); - iZoomRectSz.iHeight = TInt(iZoomRectSz.iHeight+KSingleStepForZoom); - iLeftCornerForZoom.iX =iLeftCornerForZoom.iX-KSingleStepForZoom/2; - iLeftCornerForZoom.iY =iLeftCornerForZoom.iY-KSingleStepForZoom/2; - if(iLeftCornerForZoom.iX == 0) - { - iTimer->Cancel(); - iZoom = ETrue; - } - GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::Zoom()--- 4,iZoomRectSz.iWidth = %d, iZoomRectSz.iHeight = %d", iZoomRectSz.iWidth,iZoomRectSz.iHeight); - iConfig.SetViewport(TRect(iLeftCornerForZoom.iX,iLeftCornerForZoom.iY, - iZoomRectSz.iWidth,iZoomRectSz.iHeight)); - } - iWindow->SetBackgroundSurface(iConfig, ETrue); - } - -// ----------------------------------------------------------------------------- -// ModifySurfacePostion -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::ModifySurfacePostion() - { - TRACER("CGlxHdmiSurfaceUpdater::ModifySurfacePostion()"); - TSize bitmapSize = iDecodedBitmap->SizeInPixels(); - TPoint startPoint(0,0); - if (bitmapSize.iWidth SetBackgroundSurface(iConfig, ETrue); - } - -// ----------------------------------------------------------------------------- -// ShiftToCloningMode -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::ShiftToCloningMode() - { - TRACER("CGlxHdmiSurfaceUpdater::ShiftToCloningMode()"); - iWindow->RemoveBackgroundSurface(ETrue); - } - -// ----------------------------------------------------------------------------- -// ShiftToPostingMode -// ----------------------------------------------------------------------------- -void CGlxHdmiSurfaceUpdater::ShiftToPostingMode() - { - TRACER("CGlxHdmiSurfaceUpdater::ShiftToPostingMode()"); -#ifdef _DEBUG - TRect ex, vp; - iConfig.GetExtent(ex); - iConfig.GetViewport(vp); - GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ShiftToPostingMode() - vp - TL=%d, %d",vp.iTl.iX,vp.iTl.iY); - GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ShiftToPostingMode() - vp - BR=%d, %d",vp.iBr.iX,vp.iBr.iY); - GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ShiftToPostingMode() - ex - TL=%d, %d",ex.iTl.iX,ex.iTl.iY); - GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ShiftToPostingMode() - ex - BR=%d, %d",ex.iBr.iX,ex.iBr.iY); -#endif - iWindow->SetBackgroundSurface(iConfig, ETrue); - } diff -r 99ad1390cd33 -r c499df2dbb33 tvout/src/glxtv.cpp --- a/tvout/src/glxtv.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,474 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Handles & propogates UI state change notifications. -* -*/ - - - -/** - * @internal reviewed 24/08/2007 by D Holland - */ - -// Class header -#include "glxtv.h" - -// External includes -#include // for TWsVisibilityChangedEvent - -// INTERNAL INCLUDES -#include // for debug logging -#include // for debug logging -#include // for Gallery panic codes -#include // for ETvConnectionChanged, TV heights -#include // for CRepository -#ifdef __MARM -#include -#endif - -// GLXTVOUT INCLUDES -#include "mglxtvobserver.h" // for MGlxTvObserver -#include "glxwindowvisibilitymonitor.h" // for CGlxWindowVisibilityMonitor -#include "glxtvconnectionmonitor.h" // for CGlxTvConnectionMonitor - -const TUid KCRUidTvoutSettings = {0x1020730B}; - -using namespace glxTvOut; - -/** -* CGlxTvOutCenRepMonitor -* CGlxTv conainted class for observing changes in central -* repository TV aspect Ratio value -* @author Loughlin Spollen -*/ -NONSHARABLE_CLASS( CGlxTv::CGlxTvOutCenRepMonitor ) - : public CActive - { - public: // Constructors and destructor - /** - * Symbian Constructor. - * @param The TV Observer - * @param The central repository - * @return constructed object - */ - static CGlxTvOutCenRepMonitor* NewL(MGlxTvObserver& aTvObserver, - CRepository& aRepository); - - /** - * Destructor. - */ - ~CGlxTvOutCenRepMonitor(); - - private: - /** - * C++ constructor. - * @param The TV Observer - * @param The central repository - * @return constructed object - */ - CGlxTvOutCenRepMonitor(MGlxTvObserver& aTvObserver, - CRepository& aRepository); - /** - * 2nd phase constructor - */ - void ConstructL(); - - protected: // from CActive - /** - * @ref CActive::RunL - */ - void RunL(); - - /** - * @ref CActive::DoCancel - */ - void DoCancel(); - - /** - * @ref CActive::RunError - */ - TInt RunError(TInt aError); - - private: - - // Not Owned: the Glx TV observer - MGlxTvObserver& iTvObserver; - - // Not Owned: the central repository API - CRepository& iRepository; - - TUint iSettingsTVAspectRatio; - // the central repository identifier - TUid iRepositoryUid; - }; - - - - -// ----------------------------------------------------------------------------- -// Two-phased constructor. -// ----------------------------------------------------------------------------- -CGlxTv::CGlxTvOutCenRepMonitor* CGlxTv::CGlxTvOutCenRepMonitor::NewL - ( MGlxTvObserver& aTvObserver, - CRepository& aRepository ) - { - TRACER("CGlxTv::CGlxTvOutCenRepMonitor::NewL()"); - - CGlxTvOutCenRepMonitor* self - = new(ELeave) CGlxTvOutCenRepMonitor( aTvObserver, aRepository ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - - - -// ----------------------------------------------------------------------------- -// C++ constructor. -// ----------------------------------------------------------------------------- -inline CGlxTv::CGlxTvOutCenRepMonitor::CGlxTvOutCenRepMonitor - ( MGlxTvObserver& aTvObserver, - CRepository& aRepository ) - : CActive( EPriorityStandard ), - iTvObserver ( aTvObserver ), - iRepository( aRepository ) - { - TRACER("CGlxTv::CGlxTvOutCenRepMonitor::CGlxTvOutCenRepMonitor()"); - } - - - -// ---------------------------------------------------------------------------- -// Symbian 2nd phase constructor -// ---------------------------------------------------------------------------- -void CGlxTv::CGlxTvOutCenRepMonitor::ConstructL() - { - TRACER("CGlxTv::CGlxTvOutCenRepMonitor::ConstructL"); - CActiveScheduler::Add( this ); -#ifdef __MARM - CGSServerEngine* aGSServerEngine= CGSServerEngine::NewLC(); - iSettingsTVAspectRatio = aGSServerEngine->AspectRatioL(); - CleanupStack::Pop(aGSServerEngine); -#else - iSettingsTVAspectRatio = 0; -#endif - } - - - -// ---------------------------------------------------------------------------- -// Destructor -// ---------------------------------------------------------------------------- -CGlxTv::CGlxTvOutCenRepMonitor::~CGlxTvOutCenRepMonitor() - { - TRACER("CGlxTv::~CGlxTvOutCenRepMonitor()"); - Cancel(); - } - - - -// ---------------------------------------------------------------------------- -// CGlxTvOutCenRepMonitor::RunL -// From class CActive. -// ---------------------------------------------------------------------------- -void CGlxTv::CGlxTvOutCenRepMonitor::RunL() - { - TRACER("CGlxTv::CGlxTvOutCenRepMonitor::RunL"); - // Check for errors - User::LeaveIfError( iStatus.Int() ); - GLX_LOG_INFO("CGlxTvOutCenRepMonitor - RunL completed with Err Code"); - User::LeaveIfError( iRepository.NotifyRequest( iSettingsTVAspectRatio, iStatus ) ); - if (!IsActive()) - { - SetActive(); - iTvObserver.HandleTvStatusChangedL( ETvConnectionChanged ); - } - } - - - -// ---------------------------------------------------------------------------- -// CGlxTvOutCenRepMonitor::DoCancel -// From class CActive. -// ---------------------------------------------------------------------------- -void CGlxTv::CGlxTvOutCenRepMonitor::DoCancel() - { - TRACER("CGlxTv::CGlxTvOutCenRepMonitor::DoCancel()"); - iRepository.NotifyCancel( iSettingsTVAspectRatio ); - } - - - -//----------------------------------------------------------------------------- -// CGlxTvOutCenRepMonitor::RunError -// From class CActive. -//----------------------------------------------------------------------------- -// -TInt CGlxTv::CGlxTvOutCenRepMonitor::RunError( TInt /*aError*/ ) - { - TRACER("CGlxTv::CGlxTvOutCenRepMonitor::RunError()"); - return KErrNone; - } - - -//----------------------------------------------------------------------------- -// Return new object -//----------------------------------------------------------------------------- -// -EXPORT_C CGlxTv* CGlxTv::NewL( MGlxTvObserver& aTvObserver ) - { - TRACER("CGlxTv::NewL()"); - CGlxTv* self = new (ELeave) CGlxTv( aTvObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - - - -//----------------------------------------------------------------------------- -// Destructor -//----------------------------------------------------------------------------- -// -EXPORT_C CGlxTv::~CGlxTv() - { - TRACER("CGlxTv::~CGlxTv()"); - StopMonitoringEnvironment(); - delete iTvConnectionMonitor; - } - - - - -//----------------------------------------------------------------------------- -// Default C++ constructor -//----------------------------------------------------------------------------- -// -CGlxTv::CGlxTv( MGlxTvObserver& aTvObserver ) : iTvObserver( aTvObserver ), - iAspectRatio( KErrUnknown ) - { - TRACER("CGlxTv::CGlxTv()"); - } - - - - -//----------------------------------------------------------------------------- -// Symbian second phase constructor -//----------------------------------------------------------------------------- -// -void CGlxTv::ConstructL() - { - TRACER("CGlxTv::ConstructL()"); - // Don't create the visibility monitor until the TV Out cable is connected - - // Owned: The TV connection monitor - iTvConnectionMonitor = CGlxTvConnectionMonitor::NewL( *this ); - - if ( iTvConnectionMonitor->IsConnected() ) - { - // Start monitoring the environment for changes - MonitorEnvironmentL(); - - // Calculate the TV Out screen buffer size - CalcTvScreenSzL(); - } - } - - - - -//----------------------------------------------------------------------------- -// returns the TV screen size -//----------------------------------------------------------------------------- -// -EXPORT_C TSize CGlxTv::ScreenSizeL() const - { - TRACER("CGlxTv::ScreenSizeL()"); - return iSzInPixels; - } - - - - -//----------------------------------------------------------------------------- -// Is the analog TV Connected -//----------------------------------------------------------------------------- -// -EXPORT_C TBool CGlxTv::IsConnected() const - { - TRACER("CGlxTv::IsConnected()"); - return iTvConnectionMonitor->IsConnected(); - } - - -//----------------------------------------------------------------------------- -// Is the HDMI TV Connected -//----------------------------------------------------------------------------- -// -EXPORT_C TBool CGlxTv::IsHDMIConnected() const - { - TRACER("CGlxTv::IsHDMIConnected()"); - return iTvConnectionMonitor->IsHDMIConnected(); - } - -//----------------------------------------------------------------------------- -// Is the TV widescreen -//----------------------------------------------------------------------------- -// -EXPORT_C TBool CGlxTv::IsWidescreen() const - { - TRACER("CGlxTv::IsWidescreen()"); - return iAspectRatio == KGlxTvAspectWide; - } - - -//----------------------------------------------------------------------------- -// From class MGlxWindowVisibilityObserver. -// Called when window becomes fully visible or not visible. -//----------------------------------------------------------------------------- -// -void CGlxTv::HandleWindowVisibilityChangedL( TTvChangeType aChangeType ) - { - TRACER("CGlxTv::HandleWindowVisibilityChangedL()"); - iTvObserver.HandleTvStatusChangedL( aChangeType ); - } - - - -//----------------------------------------------------------------------------- -// From class MGlxTvConnectionObserver. -// Called when TV connection state changes -//----------------------------------------------------------------------------- -// -void CGlxTv::HandleTvConnectionStatusChangedL( ) - { - TRACER("CGlxTv::HandleTvConnectionStatusChangedL()"); - - if ( iTvConnectionMonitor->IsConnected() ) - { - // Start monitoring the environment for changes - MonitorEnvironmentL(); - // Calculate the TV Out screen buffer - CalcTvScreenSzL(); - } - else - { - StopMonitoringEnvironment(); - } - iTvObserver.HandleTvStatusChangedL( ETvConnectionChanged ); - } - - - -//----------------------------------------------------------------------------- -// Retrieve the TV display aspect ratio -//----------------------------------------------------------------------------- -// -void CGlxTv::CalcTvScreenSzL() - { - TRACER("CGlxTv::CalcTvScreenSzL()"); - - // Retrieve the aspect ratio and the settings info from CenRep - iAspectRatio = KErrNotFound; - -#ifdef __MARM - CGSServerEngine* aGSServerEngine = CGSServerEngine::NewLC(); - iAspectRatio = aGSServerEngine->AspectRatioL(); - CleanupStack::Pop(aGSServerEngine); - User::LeaveIfError( iAspectRatio ); -#else - iAspectRatio = 0; -#endif - // note: Constants are defined in the GSServerEngine.cpp and not exported - // they are defined locally in glxtvconstants.h - switch( iAspectRatio ) - { - case KGlxTvAspectWide: - { - iSzInPixels = TSize ( KGlxTvOutWidthWide, KGlxTvOutHeightWide) ; - break; - } - case KGlxTvAspectNormal: - { - iSzInPixels = TSize ( KGlxTvOutWidth, KGlxTvOutHeight ); - break; - } - default: - { - User::Leave(KErrUnknown); - } - } - } - - -//----------------------------------------------------------------------------- -// From class MonitorEnvironmentL. -// Called when TV connection state changes to connected -//----------------------------------------------------------------------------- -// -void CGlxTv::MonitorEnvironmentL() - { - TRACER("CGlxTv::MonitorEnvironmentL()"); - - // Instantiate the central repository - if (!iCenRep) - { - // The Uid is hardcoded here as the hrh file giving us the Uid has been depricated and - // moved to a private folder - iCenRep = CRepository::NewL( KCRUidTvoutSettings ); - } - - // Monitor changes to the aspect ratio in the central repository - if (!iTvDisplayAspectRatioMonitor) - { - iTvDisplayAspectRatioMonitor - = CGlxTvOutCenRepMonitor::NewL( iTvObserver, *iCenRep ); - } - - // create window visibility monitoring object - if ( !iWindowVisibilityMonitor ) - { - iWindowVisibilityMonitor = - CGlxWindowVisibilityMonitor::NewL( *this ); - } - } - - -//----------------------------------------------------------------------------- -// StopMonitoringEnvironment(). -// Called when TV connection state changes to disconnected -//----------------------------------------------------------------------------- -// -void CGlxTv::StopMonitoringEnvironment() - { - TRACER("CGlxTv::StopMonitoringEnvironment()"); - delete iTvDisplayAspectRatioMonitor; // destroy before iCenRep - must cancel - iTvDisplayAspectRatioMonitor = NULL; // outstanding requests - if (iWindowVisibilityMonitor) - { - iWindowVisibilityMonitor->Close(); - } - delete iWindowVisibilityMonitor; - iWindowVisibilityMonitor = NULL; - delete iCenRep; - iCenRep = NULL; - } - - -// End of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/src/glxtvconnectionmonitor.cpp --- a/tvout/src/glxtvconnectionmonitor.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,198 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Monitors the Tv Out Connection -* -*/ - - - -/** - * @internal reviewed 24/08/2007 by D Holland - */ - -// CLASS HEADER -#include "glxtvconnectionmonitor.h" - -// EXTERNAL INCLUDES - -// INTERNAL INCLUDES - -#include -#include -#include "glxtv.h" - - -//----------------------------------------------------------------------------- -// Return new object -//----------------------------------------------------------------------------- -// -CGlxTvConnectionMonitor* CGlxTvConnectionMonitor::NewL( - MGlxTvConnectionObserver& aConnectionObserver ) - { - GLX_LOG_INFO("CGlxTvConnectionMonitor::NewL"); - CGlxTvConnectionMonitor* self = new (ELeave) - CGlxTvConnectionMonitor( aConnectionObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -//----------------------------------------------------------------------------- -// Destructor -//----------------------------------------------------------------------------- -// -CGlxTvConnectionMonitor::~CGlxTvConnectionMonitor() - { - GLX_LOG_INFO("~CGlxTvConnectionMonitor"); - Cancel(); - iTvAccServer.Disconnect(); - } - - -//----------------------------------------------------------------------------- -// Default C++ constructor -//----------------------------------------------------------------------------- -// -CGlxTvConnectionMonitor::CGlxTvConnectionMonitor - ( MGlxTvConnectionObserver& aConnectionObserver ) - :CActive(EPriorityStandard), - iConnectionObserver ( aConnectionObserver ) - { - GLX_LOG_INFO("CGlxTvConnectionMonitor"); - CActiveScheduler::Add( this ); - } - - -//----------------------------------------------------------------------------- -// Symbian second phase constructor -//----------------------------------------------------------------------------- -// -void CGlxTvConnectionMonitor::ConstructL() - { - GLX_LOG_INFO("CGlxTvConnectionMonitor::ConstructL"); - User::LeaveIfError( iTvAccServer.Connect() ); - User::LeaveIfError( iTvAccMode.CreateSubSession( iTvAccServer ) ); - User::LeaveIfError( iTvAccMode.GetAccessoryMode( iCurrentAccMode ) ); - iTvOutConnectionState = ( iCurrentAccMode.iAccessoryMode == EAccModeTVOut); - iHDMIConnectionState = ( iCurrentAccMode.iAccessoryMode == EAccModeHDMI); - - IssueRequest(); - } - -//----------------------------------------------------------------------------- -// From class CActive. -// Receive notification of change in the connection state -//----------------------------------------------------------------------------- -// -void CGlxTvConnectionMonitor::RunL() - { - GLX_LOG_INFO("CGlxTvConnectionMonitor::RunL"); - // Check for errors - User::LeaveIfError( iStatus.Int() ); - // Notify observers - IssueNotificationL(); - // Request the next event - IssueRequest(); - } - - -//----------------------------------------------------------------------------- -// From class CActive. -// DoCancel -//----------------------------------------------------------------------------- -// -void CGlxTvConnectionMonitor::DoCancel() - { - GLX_LOG_INFO("CGlxTvConnectionMonitor::DoCancel"); - iTvAccMode.CancelNotifyAccessoryModeChanged(); - } - - - -//----------------------------------------------------------------------------- -// From class CActive. -// RunError -//----------------------------------------------------------------------------- -// -TInt CGlxTvConnectionMonitor::RunError(TInt aError) - { - GLX_LOG_INFO1("CGlxTvConnectionMonitor::RunError - %d", aError); - return KErrNone; - } - -//----------------------------------------------------------------------------- -// Is the TV out cable connected -// IsConnected -//----------------------------------------------------------------------------- -// -TBool CGlxTvConnectionMonitor::IsConnected() const - { - GLX_LOG_INFO("CGlxTvConnectionMonitor::IsConnected"); - return iTvOutConnectionState; - } - -//----------------------------------------------------------------------------- -// Is the TV out cable connected -// IsConnected -//----------------------------------------------------------------------------- -// -TBool CGlxTvConnectionMonitor::IsHDMIConnected() const - { - GLX_LOG_INFO("CGlxTvConnectionMonitor::IsHDMIConnected"); - return iHDMIConnectionState; - } - -//----------------------------------------------------------------------------- -// Request accessory server events -//----------------------------------------------------------------------------- -// -void CGlxTvConnectionMonitor::IssueRequest() - { - GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueRequest"); - if (!IsActive()) // required for testing - { - iTvAccMode.NotifyAccessoryModeChanged( iStatus, iCurrentAccMode ); - SetActive(); - } - } - - -//----------------------------------------------------------------------------- -// Sends notification to observers if TV Out is connected -//----------------------------------------------------------------------------- -// -void CGlxTvConnectionMonitor::IssueNotificationL() - { - GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueNotificationL"); - TBool previousTvState = iTvOutConnectionState; - TBool previousHDMIState = iHDMIConnectionState; - GLX_LOG_INFO2("previousTvState = %d , previousHDMIState = %d", - previousTvState,previousHDMIState); - iTvOutConnectionState = ( iCurrentAccMode.iAccessoryMode == EAccModeTVOut); - iHDMIConnectionState = ( iCurrentAccMode.iAccessoryMode == EAccModeHDMI); - // Call Statuschnage only if actually TvState or HDMIState has changed. - if ( previousTvState!= iTvOutConnectionState || - previousHDMIState != iHDMIConnectionState) - { - GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueNotificationL -" - " TvConnectionStatusChanged"); - iConnectionObserver.HandleTvConnectionStatusChangedL(); - } - } - - - - diff -r 99ad1390cd33 -r c499df2dbb33 tvout/src/glxwindowvisibilitymonitor.cpp --- a/tvout/src/glxwindowvisibilitymonitor.cpp Fri Apr 16 14:58:46 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,142 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class that monitors tv window visibility -* -*/ - - - -/** - * @internal reviewed 24/08/2007 by D Holland - */ - -// CLASS HEADER -#include "glxwindowvisibilitymonitor.h" - -// EXTERNAL INCLUDES -#include // for TWsEvent -#include // for KAknFullOrPartialForegroundLost -#include // for EventMonitor -#include - -// INTERNAL INCLUDES -#include -#include -#include "glxtv.h" // for MGlxWindowVisibilityObserver - - - -//----------------------------------------------------------------------------- -// Return new object -//----------------------------------------------------------------------------- -// -CGlxWindowVisibilityMonitor* CGlxWindowVisibilityMonitor::NewL( - MGlxWindowVisibilityObserver& aVisibilityObserver ) - { - GLX_LOG_INFO("CGlxWindowVisibilityMonitor::NewL"); - CGlxWindowVisibilityMonitor* self = new ( ELeave ) - CGlxWindowVisibilityMonitor( aVisibilityObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - - -//----------------------------------------------------------------------------- -// Destructor -//----------------------------------------------------------------------------- -// -CGlxWindowVisibilityMonitor::~CGlxWindowVisibilityMonitor() - { - GLX_LOG_INFO("~CGlxWindowVisibilityMonitor"); - } - - -//----------------------------------------------------------------------------- -// Close -// To overcome code-scanner high rated warning -//----------------------------------------------------------------------------- -// -void CGlxWindowVisibilityMonitor::Close() - { - iAknEventMonitor->Enable( EFalse ); - iAknEventMonitor->RemoveObserver( this ); - } - -//----------------------------------------------------------------------------- -// Default C++ constructor -//----------------------------------------------------------------------------- -// -CGlxWindowVisibilityMonitor::CGlxWindowVisibilityMonitor - ( MGlxWindowVisibilityObserver& aVisibilityObserver ) - :iVisibilityObserver ( aVisibilityObserver ) - { - GLX_LOG_INFO("CGlxWindowVisibilityMonitor"); - } - - -//----------------------------------------------------------------------------- -// Symbian second phase constructor -//----------------------------------------------------------------------------- -// -void CGlxWindowVisibilityMonitor::ConstructL() - { - GLX_LOG_INFO("CGlxWindowVisibilityMonitor::ConstructL"); - // Register for visibility events - iAknEventMonitor = - static_cast(CCoeEnv::Static()->AppUi())->EventMonitor(); - iAknEventMonitor->Enable( ETrue ); - iAknEventMonitor->AddObserverL( this ); - } - - -//----------------------------------------------------------------------------- -// From class MAknWsEventObserver -// Propagates window server visibility events to the observer -//----------------------------------------------------------------------------- -// -void CGlxWindowVisibilityMonitor::HandleWsEventL( const TWsEvent& aEvent, - CCoeControl* /*aDestination*/ ) - { - GLX_LOG_INFO("CGlxWindowVisibilityMonitor::HandleWsEventL"); - TInt eventType = aEvent.Type(); - - if ( eventType == EEventWindowVisibilityChanged ) - { - // check the state - TUint visible = aEvent.VisibilityChanged()->iFlags; - // notify the observer - if ( visible & TWsVisibilityChangedEvent::EFullyVisible ) - { - GLX_LOG_INFO("Visibility Event - EFullyVisible"); - iVisibilityObserver.HandleWindowVisibilityChangedL( ETvDisplayIsVisible ); - } - else if ( visible & TWsVisibilityChangedEvent::ENotVisible ) - { - GLX_LOG_INFO("Visibility Event - ENotVisible"); - iVisibilityObserver.HandleWindowVisibilityChangedL( ETvDisplayNotVisible ); - } - else if (visible & TWsVisibilityChangedEvent::EPartiallyVisible) - { - GLX_LOG_INFO("Visibility Event - EPartiallyVisible"); - iVisibilityObserver.HandleWindowVisibilityChangedL( ETvDisplayNotVisible ); - } - } - } - - - - - diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/bwins/glxtvoutu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/bwins/glxtvoutu.def Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,17 @@ +EXPORTS + ?ActivateZoom@CGlxHdmiController@@QAEXH@Z @ 1 NONAME ; void CGlxHdmiController::ActivateZoom(int) + ?ScreenSizeL@CGlxTv@@QBE?AVTSize@@XZ @ 2 NONAME ; class TSize CGlxTv::ScreenSizeL(void) const + ?SetImageL@CGlxHdmiController@@QAEXABVTDesC16@@PAVCFbsBitmap@@H@Z @ 3 NONAME ; void CGlxHdmiController::SetImageL(class TDesC16 const &, class CFbsBitmap *, int) + ??1CGlxTv@@UAE@XZ @ 4 NONAME ; CGlxTv::~CGlxTv(void) + ??1CGlxHdmiController@@UAE@XZ @ 5 NONAME ; CGlxHdmiController::~CGlxHdmiController(void) + ?NewL@CGlxHdmiController@@SAPAV1@XZ @ 6 NONAME ; class CGlxHdmiController * CGlxHdmiController::NewL(void) + ?IsWidescreen@CGlxTv@@QBEHXZ @ 7 NONAME ; int CGlxTv::IsWidescreen(void) const + ?IsHDMIConnected@CGlxHdmiController@@QAEHXZ @ 8 NONAME ; int CGlxHdmiController::IsHDMIConnected(void) + ?ShiftToPostingMode@CGlxHdmiController@@QAEXXZ @ 9 NONAME ; void CGlxHdmiController::ShiftToPostingMode(void) + ?ShiftToCloningMode@CGlxHdmiController@@QAEXXZ @ 10 NONAME ; void CGlxHdmiController::ShiftToCloningMode(void) + ?NewL@CGlxTv@@SAPAV1@AAVMGlxTvObserver@@@Z @ 11 NONAME ; class CGlxTv * CGlxTv::NewL(class MGlxTvObserver &) + ?IsConnected@CGlxTv@@QBEHXZ @ 12 NONAME ; int CGlxTv::IsConnected(void) const + ?ItemNotSupported@CGlxHdmiController@@QAEXXZ @ 13 NONAME ; void CGlxHdmiController::ItemNotSupported(void) + ?IsHDMIConnected@CGlxTv@@QBEHXZ @ 14 NONAME ; int CGlxTv::IsHDMIConnected(void) const + ?DeactivateZoom@CGlxHdmiController@@QAEXXZ @ 15 NONAME ; void CGlxHdmiController::DeactivateZoom(void) + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/eabi/glxtvoutu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/eabi/glxtvoutu.def Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,29 @@ +EXPORTS + _ZN18CGlxHdmiController12ActivateZoomEi @ 1 NONAME + _ZN18CGlxHdmiController14DeactivateZoomEv @ 2 NONAME + _ZN18CGlxHdmiController15IsHDMIConnectedEv @ 3 NONAME + _ZN18CGlxHdmiController16ItemNotSupportedEv @ 4 NONAME + _ZN18CGlxHdmiController18ShiftToCloningModeEv @ 5 NONAME + _ZN18CGlxHdmiController18ShiftToPostingModeEv @ 6 NONAME + _ZN18CGlxHdmiController4NewLEv @ 7 NONAME + _ZN18CGlxHdmiController9SetImageLERK7TDesC16P10CFbsBitmapi @ 8 NONAME + _ZN18CGlxHdmiControllerD0Ev @ 9 NONAME + _ZN18CGlxHdmiControllerD1Ev @ 10 NONAME + _ZN18CGlxHdmiControllerD2Ev @ 11 NONAME + _ZN6CGlxTv4NewLER14MGlxTvObserver @ 12 NONAME + _ZN6CGlxTvD0Ev @ 13 NONAME + _ZN6CGlxTvD1Ev @ 14 NONAME + _ZN6CGlxTvD2Ev @ 15 NONAME + _ZNK6CGlxTv11IsConnectedEv @ 16 NONAME + _ZNK6CGlxTv11ScreenSizeLEv @ 17 NONAME + _ZNK6CGlxTv12IsWidescreenEv @ 18 NONAME + _ZNK6CGlxTv15IsHDMIConnectedEv @ 19 NONAME + _ZTI17CGlxHdmiContainer @ 20 NONAME + _ZTI17CGlxHdmiDecoderAO @ 21 NONAME + _ZTI18CGlxHdmiController @ 22 NONAME + _ZTI22CGlxHdmiSurfaceUpdater @ 23 NONAME + _ZTV17CGlxHdmiContainer @ 24 NONAME + _ZTV17CGlxHdmiDecoderAO @ 25 NONAME + _ZTV18CGlxHdmiController @ 26 NONAME + _ZTV22CGlxHdmiSurfaceUpdater @ 27 NONAME + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/group/bld.inf Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,33 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information for TV out component +* +*/ + + + +/** + * @internal reviewed 24/08/2007 by D Holland + */ + + #include + +PRJ_EXPORTS +../rom/glxtvout.iby CORE_APP_LAYER_IBY_EXPORT_PATH(glxtvout.iby) + +PRJ_MMPFILES +glxtvout.mmp + +PRJ_TESTMMPFILES +//../tsrc/group/t_glxtvout.mmp diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/group/glxtvout.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/group/glxtvout.mmp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file +* +*/ + +#include +#include + +TARGET glxtvout.dll +TARGETTYPE dll +UID 0x1000008d 0x2000A7BC + +CAPABILITY CAP_GENERAL_DLL + +// System includes from epoc32/include +APP_LAYER_SYSTEMINCLUDE + +// Class descriptions +SOURCEPATH ../src +SOURCE glxwindowvisibilitymonitor.cpp +SOURCE glxtvconnectionmonitor.cpp +SOURCE glxtv.cpp +SOURCE glxhdmicontainer.cpp +SOURCE glxhdmicontroller.cpp +SOURCE glxhdmisurfaceupdater.cpp +SOURCE glxactivedecoder.cpp + +// Component class definitions +USERINCLUDE ../inc + + +// System includes from the source tree +SYSTEMINCLUDE ../../../inc // for tv out constants +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/icl + +// Common Libraries +LIBRARY euser.lib +LIBRARY ws32.lib // for RWsSession +LIBRARY avkon.lib // for AppUi +LIBRARY cone.lib // for CCoeEnv +LIBRARY centralrepository.lib // for Central Repository +LIBRARY accclient.lib // for RAccessoryServer +LIBRARY alfclient.lib // For Alfred Hitchcock framework +LIBRARY fbscli.lib +LIBRARY gdi.lib +LIBRARY surfaceupdateclient.lib // surface update client +LIBRARY surfacemanager.lib // surface manager +LIBRARY imageconversion.lib // ICL +LIBRARY efsrv.lib +LIBRARY bitgdi.lib +LIBRARY apgrfx.lib // +LIBRARY apmime.lib // For ImageViewer mime type extraction +LIBRARY glxlogging.lib +LIBRARY AccPolicy.lib //For RAccessoryConnection status ID's +// Other Dependency Libraries +#ifdef __MARM +LIBRARY GSServerEngine.lib // FOr AspectRatio +#endif +// End of File diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/inc/glxactivecallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/inc/glxactivecallback.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles & propogates UI state change notifications. +* +*/ + + +#ifndef CGLXACTIVE_CALLBACK_H +#define CGLXACTIVE_CALLBACK_H + +// INCLUDES +#include + +// CLASS DECLARATION + +class CGlxActiveCallBack : public CActive + { + public: + CGlxActiveCallBack( TCallBack aCallBack, TInt aPriority): CActive(aPriority), + iCallBack(aCallBack) {}; + CGlxActiveCallBack(); + + public: // Functions from base classes + void SetActive() { CActive::SetActive();}; + void RunL() { iCallBack.CallBack();}; + void DoCancel() {}; + + private: // Data + TCallBack iCallBack; + }; + +#endif // CGLXACTIVE_CALLBACK_H + +// End of File + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/inc/glxactivedecoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/inc/glxactivedecoder.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef GLXACTIVEDECODER_H_ +#define GLXACTIVEDECODER_H_ + +// INCLUDES +#include +#include +#include "glxhdmisurfaceupdater.h" + +class CImageDecoder; +// CLASS DECLARATION + +class CGlxHdmiDecoderAO : public CActive + { +public: + /* + * NewL() + * @Param1 CGlxHdmiSurfaceUpdater + */ + static CGlxHdmiDecoderAO* NewL(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater); + + /* + * Destructor + */ + ~CGlxHdmiDecoderAO(); + + /* + * ConvertImageL() + * This calls the asyncronous service request to ICL convert + * @param1 - Destination Bitmap + * @param2 - Image decoder + */ + void ConvertImageL(CFbsBitmap& iBitmap,CImageDecoder* aDecoder); + +protected: + // from CActive + void RunL(); + void DoCancel(); + +private: + /* + * Constructor + */ + CGlxHdmiDecoderAO(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater); + +private: + CGlxHdmiSurfaceUpdater* iHdmiSurfaceUpdater; // not owned + CImageDecoder* iDecoder; + }; + +#endif /* GLXACTIVEDECODER_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/inc/glxhdmicontainer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/inc/glxhdmicontainer.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,75 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles & propogates UI state change notifications. +* +*/ + +#ifndef GLXHDMICONTAINER_H_ +#define GLXHDMICONTAINER_H_ + +#include +#include "glxhdmisurfaceupdater.h" + +class CGlxHdmiContainer : public CCoeControl, public MGlxGenCallback + { +public: + /* + * NewLC + */ + static CGlxHdmiContainer* NewL(const TRect& aRect); + + /* + * Destructor + */ + ~CGlxHdmiContainer(); + + /* + * Get window instance + */ + RWindow* GetWindow(); + +private:// from MGlxGenCallback + void DoGenCallback(); + +private: // from CCoeControl + void Draw(); + +private: + /* + * Ctor + */ + CGlxHdmiContainer(const TRect& aRect); + + /* + * ConstructL() + */ + void ConstructL(); + + /* + * Create window for HDMI + * Create a screendevice + */ + void CreateHdmiWindowL(); + +private: + TRect iRect; + RWsSession iSession; + RWindow iWsWindow; + CWsScreenDevice* iScreenDevice; + RWindowGroup iWsWindowGroup; + CWindowGc* iWindowGc; + TInt iWsWindowGroupID; + }; + +#endif /* GLXHDMICONTAINER_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/inc/glxhdmicontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/inc/glxhdmicontroller.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,134 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles & propogates UI state change notifications. +* +*/ + +#ifndef GLXHDMICONTROLLER_H_ +#define GLXHDMICONTROLLER_H_ + +// Internal includes +#include // for inteface MGlxTvObserver +#include + +class CGlxHdmiContainer; +class CGlxHdmiSurfaceUpdater; +class CGlxTv; + +/* + * This class will be called from FS and Slideshow for its requirements + */ +class CGlxHdmiController : public CBase, + public MGlxTvObserver // for TV Out + { +public: + /* + * NewLC + * @param1 - Image file path default to NULL + */ + IMPORT_C static CGlxHdmiController* NewL(); + + /* + * Destructor + */ + IMPORT_C ~CGlxHdmiController(); + + /* + * Update Image + * @param1 - Image file path + */ + IMPORT_C void SetImageL(const TDesC& aImageFile, CFbsBitmap* aFsBitmap = NULL, + TBool aStore = ETrue); + + /* + * To intimate that the item is not supported. + */ + IMPORT_C void ItemNotSupported(); + + /* + * Activating zoom in posting mode + */ + IMPORT_C void ActivateZoom(TBool aAutoZoomOut); + /* + * Deactivating zoom in posting mode + */ + IMPORT_C void DeactivateZoom(); + + /* + * ShiftToCloningMode + */ + IMPORT_C void ShiftToCloningMode(); + + /* + * ShiftToPostingMode + */ + IMPORT_C void ShiftToPostingMode(); + + /* + * Tells if HDMi is Connected. + */ + IMPORT_C TBool IsHDMIConnected(); + +private:// From MGlxTvObserver + void HandleTvStatusChangedL ( TTvChangeType aChangeType ); + +private: + /* + * Constructor + */ + CGlxHdmiController(); + + /* + * ConstructL + */ + void ConstructL(); + + /* + * Create the Hdmi Container + */ + void CreateHdmiContainerL(); + + /* + * Create surface updater and update background surface + * @param1 - Image file + */ + void CreateSurfaceUpdaterL(const TDesC& aImageFile); + + /* + * To Destroy the surface updater if present + */ + void DestroySurfaceUpdater(); + + /* + * Detroy the container + */ + void DestroyContainer(); + + /* + * Stores the Image File name + * @param1 - Image file + */ + void StoreImageInfoL(const TDesC& aImageFile, CFbsBitmap* aFsBitmap); + +private: + CFbsBitmap* iFsBitmap; + HBufC* iStoredImagePath; + + CGlxHdmiContainer* iHdmiContainer; + CGlxHdmiSurfaceUpdater* iSurfaceUpdater; + CGlxTv* iGlxTvOut; + TBool iIsImageSupported; + }; + +#endif /* GLXHDMICONTROLLER_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/inc/glxhdmisurfaceupdater.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/inc/glxhdmisurfaceupdater.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,245 @@ +/* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles & propogates UI state change notifications. +* +*/ + +#ifndef GLXHDMISURFACEUPDATER_H_ +#define GLXHDMISURFACEUPDATER_H_ + +#include +#include + +// GCE Surface +#include "graphics/surfacemanager.h" +#include "graphics/surface.h" +#include "graphics/surfaceupdateclient.h" +#include + +// forward decleration +class CGlxActiveCallBack; +class CGlxHdmiDecoderAO; +class CImageDecoder; +class TSurfaceConfiguration; +class MGlxGenCallback + { +public: + virtual void DoGenCallback() = 0; + }; + +class CGlxHdmiSurfaceUpdater: public CBase + { +public: + /* + * NewL + */ + static CGlxHdmiSurfaceUpdater* NewL(RWindow* aWindow, const TDesC& aImageFile, + CFbsBitmap* aFsBitmap, MGlxGenCallback* aCallBack); + + /* + * Destructor + */ + ~CGlxHdmiSurfaceUpdater(); + +public: + /* + * This is to cancel the active object from decoding + */ + void HandleRunL(TRequestStatus& aStatus); + + /* + * This updates the new image. + */ + void UpdateNewImageL(const TDesC& aImageFile,CFbsBitmap* aFsBitmap); + + /* + * Activate Zoom + */ + void ActivateZoom(TBool aAutoZoomOut); + /* + * Deactivate Zoom + */ + void DeactivateZoom(); + /* + * Zoom in our out depending on parameter + */ + void Zoom(TBool aZoom); + + /* + ShiftToCloningMOde + */ + void ShiftToCloningMode(); + + /* + ShiftToPostingMode + */ + void ShiftToPostingMode(); + +private: + /* + * Constructor + */ + CGlxHdmiSurfaceUpdater(RWindow* aWindow, MGlxGenCallback* aCallBack); + + /* + * ConstructL() + */ + void ConstructL(CFbsBitmap* aFsBitmap,const TDesC& aImageFile); + + /* + * Create a New surface with given size + */ + void CreateSurfaceL(); + /* + * @param1 size + */ + void MapSurfaceL(); + + /* + * This fundtion wont be called , could be used if double buffering is planned in future + * to start the second decoder AO and update the surface with a new session. + */ + static TInt SurfBuffer0Ready(TAny* aObject); + + /* + * Call a refresh on the screen + */ + void Refresh(); + + /* + * Dump the buffer on to the surface stride + */ + void SwapBuffers(); + + /* + * Release contents + */ + void ReleaseContent(); + + /* + * Create bitmap + */ + void CreateBitmapL(); + + /* + * Create an image decoder with given file + * @param1 - Image file + */ + void CreateImageDecoderL(); + + /* + * Creating all enablers for HDMI + * @param1 if creating a surface is required, + * by default it is not required + */ + void CreateHdmiL(TBool aCreateSurface = ETrue); + + /* + * This if for zoom timer timeout + */ + static TInt TimeOut(TAny* aSelf); + + /* + * ModifySurface positions of the surface to be displayed on screen + */ + void ModifySurfacePostion(); + + /* + * Process the image for TV + */ + void ProcessTvImage(); + + /* + * Shows the FS thumbnail first before showing + * Decoded HD image + */ + void ShowFsThumbnailL(); + + /* + * Recalculate the size for png/bmp as decoder fails to + * decode for desired size + */ + TSize ReCalculateSizeL(); + + /* + * If the image format is non jpeg, then we need to calculate as per + * reduction factor and reduced size as what the decoder is going to return us + * This function returns if that needs to be done. + */ + TBool DoesMimeTypeNeedsRecalculateL(); + + /* + * If the image format is non jpeg, then we need to scale the bitmap after it is + * decoded, as the return value would not fit the screen + */ + void ScaleDecodedBitmapL(TInt aBitmapIndex); + + /* + * InitiateHDMI + */ + void InitiateHdmiL(CFbsBitmap* aFsBitmap,const TDesC& aImageFile); + +private: + RWindow* iWindow; // window object + CFbsBitmap* iFsBitmap; // FS bitmap + MGlxGenCallback* iCallBack; // callback to the HdmiContainer window + HBufC* iImagePath; // To store the image uri path + + // GCE Surface + RSurfaceUpdateSession iSurfUpdateSession; + TSurfaceId iSurfId; // TSurfaceId + RSurfaceManager* iSurfManager; // RSurfaceManager + RChunk* iSurfChunk; // RChunk + TInt iSurfaceStride; // surface stride + TSurfaceConfiguration iConfig; // surface configuration for zoom + + CFbsBitmap* iDecodedBitmap[3]; // Array of Decoded bitmaps of the focussed image + // 1 - contains FS/Grid Thumbnail, 2- HD image, + // (optional)3-Scaled png/bmp images + + void* iSurfBuffer; // Surface buffer + CGlxActiveCallBack* iSurfBufferAO; // Surface buffer AO + + //ICL + CGlxHdmiDecoderAO* iGlxDecoderAO; // Internal Image decoder AO + CImageDecoder* iImageDecoder; // Image Decoder + RFs iFsSession; // RFs + + TPoint iLeftCornerForZoom; // + CPeriodic* iTimer; // Timer for Zoom + + // Various objects to store sizes and count + TSize iTvScreenSize; // to store the Tv screen size + TSize iTargetBitmapSize; // To Store the target bitmap size to display(as per Aspect Ratio) + + // Various flags to store values + TBool iZoom; // Is zoomed + TBool iBitmapReady; // If the bitmap is decoded and ready + TBool iAutoZoomOut; // If the UI has asked for auto zoomout + TBool iSurfSessionConnected; // If surface session is connected + TBool iShiftToCloning; + TBool iShwFsThumbnail; // If the Fs thumbnail is to be shown before decoding HD images + TBool iIsNonJpeg; // If the item is non jpeg + +#ifdef _DEBUG + TTime iStartTime; + TTime iStopTime; +#endif + // The bitmap index in the array of bitmaps + enum { + EFSBitmapIndex = 0, + EJpgDecodedBitmapIndex, + ENonJpgDecodedBitmapIndex + }; + }; +#endif /* GLXHDMISURFACEUPDATER_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/inc/glxtv.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/inc/glxtv.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,186 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles & propogates UI state change notifications. +* +*/ + + + +/** + * @internal reviewed 24/08/2007 by D Holland + */ + +#ifndef __GLXTV_H__ +#define __GLXTV_H__ + +// External Includes +#include +#include + +// Internal Includes +#include + +// Forward Declarations +class MGlxTvObserver; +class CGlxWindowVisibilityMonitor; +class CGlxTvConnectionMonitor; +class CRepository; + +// For window server visibility notifications +class MGlxWindowVisibilityObserver + { +public: + /** + * Handle changes to the application window visiblity + * Called when window visible state changes + * @param aChangeType The visibility change type + */ + virtual void HandleWindowVisibilityChangedL( TTvChangeType aChangeType ) = 0; + }; + + + +// For Tv connection notification +class MGlxTvConnectionObserver + { +public: + /** + * Handle TV connection state changes + */ + virtual void HandleTvConnectionStatusChangedL( ) = 0; + }; + + + + +/** + * Class Description + * A class that handles and propagates UI change notifications + * @author Loughlin + */ +NONSHARABLE_CLASS (CGlxTv) : public CBase, + public MGlxWindowVisibilityObserver, + public MGlxTvConnectionObserver + { +public: + /** + * Static Symbian 2 stage constructor. + * @param a TvObserver + */ + IMPORT_C static CGlxTv* NewL( MGlxTvObserver& aTvObserver ); + + /** + * Destructor. + */ + IMPORT_C ~CGlxTv(); + +private: + + /** + * Standard C++ constructor + * @param a TvObserver + */ + CGlxTv(MGlxTvObserver& aTvObserver); + + /* + * Symbian second stage construction + */ + void ConstructL(); + +public: // class public method + + /** + * Get the current screen size + * @return the Screen size in pixels + */ + IMPORT_C TSize ScreenSizeL() const; + + /** + * Is the Analog TV Connected + * @return ETrue if active, otherwise EFalse + */ + IMPORT_C TBool IsConnected() const; + + /** + * Is the TV widescreen + * @return ETrue if widescreen, otherwise EFalse + */ + IMPORT_C TBool IsWidescreen() const; + + /** + * Is the HDMI TV Connected + * @return ETrue if active, otherwise EFalse + */ + IMPORT_C TBool IsHDMIConnected() const; + +public: // from MGlxWindowVisibilityObserver + /** + * @ref MGlxWindowVisibilityObserver::HandleWindowVisibilityChangedL + */ + void HandleWindowVisibilityChangedL( TTvChangeType aChangeType ); + + +public: // from MGlxTvConnectionObserver + /** + * @ref MGlxTvConnectionObserver::HandleTvConnectionStatusChangedL + */ + void HandleTvConnectionStatusChangedL( ); + +private: // new private methods + /** + * Retrive the TV Display Aspect Ratio and TV Setting + * Calculate the screen size from aspect ratio and TV type + */ + void CalcTvScreenSzL(); + + /** + * Start monitoring the environment for changes to the TV aspect ratio + * and the Gallery window groups visiblity + */ + void MonitorEnvironmentL(); + + /** + * Stop monitoring the environment for changes to the TV aspect ratio + * and the Gallery window groups visiblity + */ + void StopMonitoringEnvironment(); + +private: // class member data + // Not Owned: The TV out observer + MGlxTvObserver& iTvObserver; + + // Owned: The Window visibility monitor + CGlxWindowVisibilityMonitor* iWindowVisibilityMonitor; + + // Owned: The TV connection monitor + CGlxTvConnectionMonitor* iTvConnectionMonitor; + + // Size of the TV Out display size + TSize iSzInPixels; + + // Owned: The central repository where TV display ratio is held. + CRepository* iCenRep; + + // The implementation of the class, hidden from clients + class CGlxTvOutCenRepMonitor; + + // Owned: Monitoring class for Tv Ratio Values + CGlxTvOutCenRepMonitor* iTvDisplayAspectRatioMonitor; + + // The TV aspect ratio + TInt iAspectRatio; + }; + + +#endif // __GLXTV_H__ \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/inc/glxtvconnectionmonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/inc/glxtvconnectionmonitor.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,143 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Monitoring class of the Tv Out Connection +* +*/ + + + +/** + * @internal reviewed 24/08/2007 by D Holland + */ + +#ifndef __GLX_WNDWCONNECTION_MONITOR_H__ +#define __GLX_WNDWCONNECTION_MONITOR_H__ + +// External Includes +#include // for CActive +#include // for MAknWsEventObserver +#include // for RAccessoryServer +#include // for RAccessoryMode +#include // for RAccessoryConnection +#include + + +// Forward Declarations +class MGlxTvConnectionObserver; + + +/** + * Class Description + * An Active object derived class is used to monitor the TV out connection + * @author Loughlin + */ +NONSHARABLE_CLASS(CGlxTvConnectionMonitor) : public CActive + { +public: + + /** + * Static Symbian 2 stage constructor. + */ + static CGlxTvConnectionMonitor* NewL( + MGlxTvConnectionObserver& aConnectionObserver); + + /** + * Destructor. + */ + ~CGlxTvConnectionMonitor(); + +private: + + /** + * Standard C++ constructor + */ + CGlxTvConnectionMonitor( + MGlxTvConnectionObserver& aConnectionObserver); + + /* + * Symbian second stage construction + */ + void ConstructL(); + +public: // class member functions + + /* + * Provides the caller with the current TV connetion state + * @return The TV connection state + */ + TBool IsConnected() const; + + /* + * Provides the caller with the current HDMI connetion state + * @return The HDMI connection state + */ + TBool IsHDMIConnected() const; + + +private: // From CActive + /** + * @ref CActive::RunL + */ + void RunL(); + + /** + * @ref CActive::DoCancel + */ + void DoCancel(); + + /** + * @ref CActive::RunError + */ + TInt RunError( TInt aError ); + + +private: + + /** + * Requests TV on/off events + */ + void IssueRequest(); + + /** + * Sends notification to observers when TV Out cable is connected + */ + void IssueNotificationL(); + + +private: // class member data + + // Not owned: TV connection observer + MGlxTvConnectionObserver& iConnectionObserver; + + // TVout The Connection state + TBool iTvOutConnectionState; + + // TVout The Connection state + TBool iHDMIConnectionState; + + // The (external device) Accessory Server + RAccessoryServer iTvAccServer; + + // Accessory mode + RAccessoryMode iTvAccMode; + + // Accessory Connection - details the type of accessory + RAccessoryConnection iTvAccCon; + + //Class gives Generic ID + TAccPolGenericIDArray iCurrentAccArray; + }; + + +#endif // __GLX_WNDWCONNECTION_MONITOR_H__ \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/inc/glxwindowvisibilitymonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/inc/glxwindowvisibilitymonitor.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,102 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class definition that monitors tv window visibility +* +*/ + + + +/** + * @internal reviewed 24/08/2007 by D Holland + */ + +#ifndef __GLXWINVISIBILITYMONITOR_H__ +#define __GLXWINVISIBILITYMONITOR_H__ + +// External Includes +#include // for CBase +#include // for MAknWsEventObserver + + +// Forward Declarations +class MGlxWindowVisibilityObserver; + + + +/** + * Class Description + * An Active object derived class is used to monitor the visibility of the + * TV out window. + * @author Loughlin + */ +NONSHARABLE_CLASS(CGlxWindowVisibilityMonitor) : public CBase, + public MAknWsEventObserver + { +public: + /** + * Static Symbian 2 stage constructor. + */ + static CGlxWindowVisibilityMonitor* NewL( + MGlxWindowVisibilityObserver& aVisibilityObserver ); + + /** + * Destructor. + */ + ~CGlxWindowVisibilityMonitor(); + + + /** + * Close. + */ + void Close(); + +private: + + /** + * Standard C++ constructor + */ + CGlxWindowVisibilityMonitor( + MGlxWindowVisibilityObserver& aVisibilityObserver ); + + /* + * Symbian second stage construction + */ + void ConstructL(); + +public: // class member functions + + /* + * Provides the caller with the current visible state + * @return ETrue if the window is visible or false otherwise + */ + TBool IsVisible() const; + +public: // from MAknWsEventObserver + + void HandleWsEventL( const TWsEvent& aEvent, CCoeControl* aDestination ); + +private: // class member data + // Not ownded: The Akn event monitor + CAknWsEventMonitor* iAknEventMonitor; + + // Not owned: Window visibility observer + MGlxWindowVisibilityObserver& iVisibilityObserver; + + // The visible state + TBool iIsVisible; + }; + + + +#endif // __GLXWINVISIBILITYMONITOR_H__ diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/rom/glxtvout.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/rom/glxtvout.iby Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Photos TV Out iby file. +* +*/ + + + + +#ifndef __GLX_TVOUT_IBY__ +#define __GLX_TVOUT_IBY__ + +file=ABI_DIR\BUILD_DIR\glxtvout.dll SHARED_LIB_DIR\glxtvout.dll + +#endif // __GLX_TVOUT_IBY__ + +// End of file +----------------------------------------------------------- \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/src/glxactivedecoder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/src/glxactivedecoder.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include "glxactivedecoder.h" + +// ----------------------------------------------------------------------------- +// NewL +// ----------------------------------------------------------------------------- +CGlxHdmiDecoderAO* CGlxHdmiDecoderAO::NewL(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater) + { + TRACER("CGlxHdmiDecoderAO::NewL()"); + CGlxHdmiDecoderAO* self = new (ELeave) CGlxHdmiDecoderAO(aHdmiSurfaceUpdater); + return self; + } + +// ----------------------------------------------------------------------------- +// CGlxHdmiDecoderAO() +// ----------------------------------------------------------------------------- +CGlxHdmiDecoderAO::CGlxHdmiDecoderAO(CGlxHdmiSurfaceUpdater* aHdmiSurfaceUpdater): + CActive(CActive::EPriorityStandard-1),iHdmiSurfaceUpdater(aHdmiSurfaceUpdater) + { + TRACER("CGlxHdmiDecoderAO::CGlxHdmiDecoderAO()"); + CActiveScheduler::Add(this); + } + +// ----------------------------------------------------------------------------- +// ~CGlxHdmiDecoderAO +// Cancel the outstanding request +// ----------------------------------------------------------------------------- +CGlxHdmiDecoderAO::~CGlxHdmiDecoderAO() + { + TRACER("CGlxHdmiDecoderAO::~CGlxHdmiDecoderAO()"); + } + +// ----------------------------------------------------------------------------- +// RunL +// Calls iHdmiSurfaceUpdater->HandleRunL() which is expected to handle the call +// ----------------------------------------------------------------------------- +void CGlxHdmiDecoderAO::RunL() + { + TRACER("CGlxHdmiDecoderAO::RunL()"); + if(iStatus == KErrUnderflow) + { + GLX_LOG_INFO("CGlxHdmiDecoderAO::RunL() - call continueconvert"); + iDecoder->ContinueConvert(&iStatus); + } + else + { + GLX_LOG_INFO("CGlxHdmiDecoderAO::RunL() - call handlerunL"); + iHdmiSurfaceUpdater->HandleRunL(iStatus); + } + } + +// ----------------------------------------------------------------------------- +// DoCancel +// ----------------------------------------------------------------------------- +void CGlxHdmiDecoderAO::DoCancel() + { + TRACER("CGlxHdmiDecoderAO::DoCancel()"); + iDecoder->Cancel(); + } + +// ----------------------------------------------------------------------------- +// ConvertImageL +// ----------------------------------------------------------------------------- +void CGlxHdmiDecoderAO::ConvertImageL(CFbsBitmap& aBitmap, + CImageDecoder* aDecoder) + { + TRACER("CGlxHdmiDecoderAO::ConvertImageL()"); + iDecoder = aDecoder; + iDecoder->Convert(&iStatus,aBitmap); + SetActive(); + } + + + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/src/glxhdmicontainer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/src/glxhdmicontainer.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,126 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include "glxhdmicontainer.h" + +const TInt KGroupNameLength = 32; +_LIT(KPhotosHdmi,"PhotosHdmi"); + +// ----------------------------------------------------------------------------- +// NewLC +// ----------------------------------------------------------------------------- +CGlxHdmiContainer* CGlxHdmiContainer::NewL(const TRect& aRect) + { + TRACER("CGlxHdmiContainer* CGlxHdmiContainer::NewL()"); + CGlxHdmiContainer* self = new (ELeave) CGlxHdmiContainer(aRect); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// destructor +// ----------------------------------------------------------------------------- +CGlxHdmiContainer::~CGlxHdmiContainer() + { + TRACER("CGlxHdmiContainer::~CGlxHdmiContainer()"); + iWsWindowGroup.Close(); + delete iWindowGc; + delete iScreenDevice; + } + +// ----------------------------------------------------------------------------- +// CTor +// ----------------------------------------------------------------------------- +CGlxHdmiContainer::CGlxHdmiContainer(const TRect& aRect): + iRect(aRect) + { + TRACER("CGlxHdmiContainer::CGlxHdmiContainer()"); + // Implement nothing here + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +void CGlxHdmiContainer::ConstructL() + { + TRACER("CGlxHdmiContainer::ConstructL()"); + CreateHdmiWindowL(); + ActivateL(); + } + +// ---------------------------------------------------------- +// GetWindow() +// ---------------------------------------------------------- +// +RWindow* CGlxHdmiContainer::GetWindow() + { + TRACER("CGlxHdmiContainer::GetWindow()"); + return &Window(); + } + +// ----------------------------------------------------------------------------- +// CreateHdmiWindowL +// ----------------------------------------------------------------------------- +void CGlxHdmiContainer::CreateHdmiWindowL() + { + TRACER ("CGlxHdmiContainer::CreateHdmiWindowL()"); + const TUint32 id = 12345678; + + // Create screen device and gc + iSession = ControlEnv()->WsSession(); + iScreenDevice = new(ELeave) CWsScreenDevice(iSession); + User::LeaveIfError(iScreenDevice->Construct(1)); // use Screen 1 + User::LeaveIfError(iScreenDevice->CreateContext(iWindowGc)); + + // Create window group + iWsWindowGroup = RWindowGroup(iSession); + User::LeaveIfError(iWsWindowGroup.Construct(id, iScreenDevice)); + iWsWindowGroup.SetOrdinalPosition(0); + TBuf winGroupName(KPhotosHdmi); + iWsWindowGroup.SetName(winGroupName); + iWsWindowGroupID = iWsWindowGroup.Identifier(); + + // Create window + CreateWindowL(iWsWindowGroup); + iWsWindow = Window(); + SetRect(TRect(iScreenDevice->SizeInPixels())); + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +void CGlxHdmiContainer::Draw() + { + TRACER("CGlxHdmiContainer::Draw()"); + CWindowGc& gc = SystemGc(); + gc.DrawRect(iRect); + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +void CGlxHdmiContainer::DoGenCallback() + { + TRACER("CGlxHdmiContainer::DoGenCallback()"); + DrawNow(); + } diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/src/glxhdmicontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/src/glxhdmicontroller.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,283 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include "glxtv.h" // for CGlxTv +#include "glxhdmicontainer.h" +#include "glxhdmisurfaceupdater.h" + +#include "glxhdmicontroller.h" + +// ----------------------------------------------------------------------------- +// NewLC +// ----------------------------------------------------------------------------- +EXPORT_C CGlxHdmiController* CGlxHdmiController::NewL() + { + TRACER("CGlxHdmiController* CGlxHdmiController::NewL()"); + CGlxHdmiController* self = new (ELeave) CGlxHdmiController(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// destructor +// ----------------------------------------------------------------------------- +EXPORT_C CGlxHdmiController::~CGlxHdmiController() + { + TRACER("CGlxHdmiController::~CGlxHdmiController()"); + DestroySurfaceUpdater(); + DestroyContainer(); + delete iStoredImagePath; + iStoredImagePath = NULL; + if (iFsBitmap) + { + delete iFsBitmap; + iFsBitmap = NULL; + } + if(iGlxTvOut) + { + delete iGlxTvOut; + } + } + +// ----------------------------------------------------------------------------- +// Setting an Image Path +// ----------------------------------------------------------------------------- +EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile, CFbsBitmap* aFsBitmap, + TBool aStore) + { + TRACER("CGlxHdmiController::SetImageL()"); + if (aStore) + { + iIsImageSupported = ETrue; + StoreImageInfoL( aImageFile, aFsBitmap ); + } + if (iGlxTvOut->IsHDMIConnected()) + { + GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2"); + // do not close the surface , use the same surface instead. + // Call a function to pass imagefile + if (!iHdmiContainer) + { + CreateHdmiContainerL(); + } + if (!iSurfaceUpdater) + { + // This case would come when surface updater is not created at the first instance and also + // it satisfies the 720p condition + CreateSurfaceUpdaterL(aImageFile); + } + else + { + GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 3"); + iSurfaceUpdater->UpdateNewImageL(aImageFile, aFsBitmap); + } + iHdmiContainer->DrawNow(); + } + } + +// ----------------------------------------------------------------------------- +// IsVideo +// ----------------------------------------------------------------------------- +EXPORT_C void CGlxHdmiController::ItemNotSupported() + { + TRACER("CGlxHdmiController::IsVideo()"); + iIsImageSupported = EFalse; + if (iGlxTvOut->IsHDMIConnected()) + { + DestroySurfaceUpdater(); + } + } + + +// ----------------------------------------------------------------------------- +// ActivateZoom +// ----------------------------------------------------------------------------- +EXPORT_C void CGlxHdmiController::ActivateZoom(TBool aAutoZoomOut) + { + TRACER("CGlxHdmiController::ActivateZoom()"); + if (iGlxTvOut->IsHDMIConnected()) + { + iSurfaceUpdater->ActivateZoom(aAutoZoomOut); + } + } + +// ----------------------------------------------------------------------------- +// DeactivateZoom +// ----------------------------------------------------------------------------- +EXPORT_C void CGlxHdmiController::DeactivateZoom() + { + TRACER("CGlxHdmiController::DeactivateZoom()"); + if (iGlxTvOut->IsHDMIConnected()) + { + iSurfaceUpdater->DeactivateZoom(); + } + } + +// ----------------------------------------------------------------------------- +// ShiftToCloningMode +// ----------------------------------------------------------------------------- +EXPORT_C void CGlxHdmiController::ShiftToCloningMode() + { + TRACER("CGlxHdmiController::ShiftToCloningMode()"); + if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) + { + iSurfaceUpdater->ShiftToCloningMode(); + } + } + +// ----------------------------------------------------------------------------- +// ShiftToPostingMode +// ----------------------------------------------------------------------------- +EXPORT_C void CGlxHdmiController::ShiftToPostingMode() + { + TRACER("CGlxHdmiController::ShiftToPostingMode()"); + if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater) + { + iSurfaceUpdater->ShiftToPostingMode(); + } + } + +// ----------------------------------------------------------------------------- +// HandleTvStatusChangedL +// ----------------------------------------------------------------------------- +EXPORT_C TBool CGlxHdmiController::IsHDMIConnected() + { + TRACER("CGlxHdmiController::IsHDMIConnected()"); + return iGlxTvOut->IsHDMIConnected(); + } + + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +CGlxHdmiController::CGlxHdmiController(): + iFsBitmap(NULL) + { + TRACER("CGlxHdmiController::CGlxHdmiController()"); + // Implement nothing here + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +void CGlxHdmiController::ConstructL() + { + TRACER("CGlxHdmiController::ConstructL()"); + iGlxTvOut = CGlxTv::NewL(*this); + } + +// ----------------------------------------------------------------------------- +// DestroyContainer +// ----------------------------------------------------------------------------- +void CGlxHdmiController::DestroyContainer() + { + TRACER("CGlxHdmiController::DestroyContainer()"); + if (iHdmiContainer) + { + GLX_LOG_INFO("CGlxHdmiController::DestroyHdmi() - deleting iHdmiContainer 1"); + delete iHdmiContainer; + iHdmiContainer = NULL; + } + } + +// ----------------------------------------------------------------------------- +// DestroySurfaceUpdater +// ----------------------------------------------------------------------------- +void CGlxHdmiController::DestroySurfaceUpdater() + { + TRACER("CGlxHdmiController::DestroySurfaceUpdater()"); + if (iSurfaceUpdater) + { + delete iSurfaceUpdater; + iSurfaceUpdater = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CreateHdmiContainerL +// ----------------------------------------------------------------------------- +void CGlxHdmiController::CreateHdmiContainerL() + { + TRACER("CGlxHdmiController::CreateHdmiContainer()"); + TRect rect = AlfUtil::ScreenSize(); + iHdmiContainer = CGlxHdmiContainer::NewL(rect); + } + +// ----------------------------------------------------------------------------- +// CreateSurfaceUpdaterL +// ----------------------------------------------------------------------------- +void CGlxHdmiController::CreateSurfaceUpdaterL(const TDesC& aImageFile) + { + TRACER("CGlxHdmiController::CreateSurfaceUpdater()"); + RWindow* window = iHdmiContainer->GetWindow(); + iSurfaceUpdater = CGlxHdmiSurfaceUpdater::NewL(window, aImageFile, iFsBitmap, + iHdmiContainer); + iHdmiContainer->DrawNow(); + } + +// ----------------------------------------------------------------------------- +// StoreImageInfoL +// ----------------------------------------------------------------------------- +void CGlxHdmiController::StoreImageInfoL(const TDesC& aImageFile, CFbsBitmap* aFsBitmap) + { + TRACER("CGlxHdmiController::StoreImageInfoL()"); + if(iStoredImagePath) + { + delete iStoredImagePath; + iStoredImagePath = NULL; + } + if (iFsBitmap) + { + delete iFsBitmap; + iFsBitmap = NULL; + } + iStoredImagePath = aImageFile.AllocL(); + iFsBitmap = new (ELeave) CFbsBitmap; + iFsBitmap->Duplicate(aFsBitmap->Handle()); + } + +// ----------------------------------------------------------------------------- +// HandleTvStatusChangedL +// ----------------------------------------------------------------------------- +void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType ) + { + TRACER("CGlxHdmiController::HandleTvStatusChangedL()"); + if ( aChangeType == ETvConnectionChanged ) + { + if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported ) + { + GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected"); + // Calling SetImageL() with appropriate parameters + SetImageL(iStoredImagePath->Des(), iFsBitmap, EFalse); + } + else + { + GLX_LOG_INFO2("CGlxHdmiController::HandleTvStatusChangedL() iIsImageSupported=%d, iGlxTvOut->IsHDMIConnected()=%d", + iIsImageSupported,iGlxTvOut->IsHDMIConnected()); + // if it gets disconnected, destroy the surface + GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected"); + DestroySurfaceUpdater(); + } + } + } + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/src/glxhdmisurfaceupdater.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/src/glxhdmisurfaceupdater.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,829 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "glxactivecallback.h" +#include "glxhdmisurfaceupdater.h" +#include "glxactivedecoder.h" +#include + +const TInt KMulFactorToCreateBitmap = 4; +const TInt KZoomDelay = 10000; +//100 , is decide for 20 steps of zooming , with each step being 5 pixels. +const TInt KMaxZoomLimit = 100; +//evey time we zoom , there is a increase in the ht amd width by 10 pixels. +const TInt KSingleStepForZoom = 10; + +_LIT(KMimeJpeg,"image/jpeg"); +_LIT(KMimeJpg,"image/jpg"); + +// ----------------------------------------------------------------------------- +// NewLC +// ----------------------------------------------------------------------------- +CGlxHdmiSurfaceUpdater* CGlxHdmiSurfaceUpdater::NewL(RWindow* aWindow, const TDesC& aImageFile, + CFbsBitmap* aFsBitmap, + MGlxGenCallback* aCallBack) + { + TRACER("CGlxHdmiSurfaceUpdater* CGlxHdmiSurfaceUpdater::NewL()"); + CGlxHdmiSurfaceUpdater* self = new (ELeave) CGlxHdmiSurfaceUpdater(aWindow, aCallBack); + CleanupStack::PushL(self); + self->ConstructL(aFsBitmap,aImageFile); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// destructor +// ----------------------------------------------------------------------------- +CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater() + { + TRACER("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater()"); + ReleaseContent(); + if(iWindow) + { + iWindow->RemoveBackgroundSurface(ETrue); + } + if(iTimer && iTimer->IsActive()) // Check for a CPeriodic Instance + { + iTimer->Cancel(); + } + delete iTimer; + if (iGlxDecoderAO) + { + delete iGlxDecoderAO; + } + iGlxDecoderAO = NULL; + iFsSession.Close(); + if (iSurfManager) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater() - Close"); + if(iSurfSessionConnected) + { + iSurfUpdateSession.Close(); + } + if (iSurfChunk) + { + iSurfChunk->Close(); + } + delete iSurfChunk; + iSurfChunk = NULL; + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater(). iSurfManager->CloseSurface()"); + iSurfManager->CloseSurface(iSurfId); + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::~CGlxHdmiSurfaceUpdater(). iSurfManager->Close()"); + iSurfManager->Close(); + delete iSurfManager; + iSurfManager = NULL; + } + } + +// ----------------------------------------------------------------------------- +// ReleaseContent +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ReleaseContent() + { + TRACER("void CGlxHdmiSurfaceUpdater::ReleaseContent()"); + if ( iGlxDecoderAO ) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ReleaseContent() -1"); + iGlxDecoderAO->Cancel(); + } + if (iFsBitmap) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ReleaseContent() -2"); + delete iFsBitmap; + iFsBitmap = NULL; + } + for (TInt i=0; i<=2 ; i++) + { + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ReleaseContent() -3, %d", i); + delete iDecodedBitmap[i]; + iDecodedBitmap[i]= NULL; + } + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ReleaseContent() -4"); + if(iSurfBufferAO && iSurfBufferAO->IsActive()) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ReleaseContent() -5"); + iSurfBufferAO->Cancel(); + } + if ( iImageDecoder ) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ReleaseContent() -6"); + delete iImageDecoder; + iImageDecoder = NULL; + } + if (iSurfSessionConnected && iSurfManager) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ReleaseContent() -7"); + iSurfUpdateSession.CancelAllUpdateNotifications(); + } + if (iImagePath) + { + delete iImagePath; + iImagePath = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CTor +// ----------------------------------------------------------------------------- +CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater(RWindow* aWindow, + MGlxGenCallback* aCallBack): + iWindow(aWindow), iCallBack(aCallBack), + iShwFsThumbnail(ETrue), iIsNonJpeg(EFalse) + { + TRACER("CGlxHdmiSurfaceUpdater::CGlxHdmiSurfaceUpdater()"); + // Implement nothing here + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ConstructL(CFbsBitmap* aFsBitmap, const TDesC& aImageFile) + { + TRACER("CGlxHdmiSurfaceUpdater::ConstructL()"); + // Initiate the HDMI by assigning the necessary values + InitiateHdmiL(aFsBitmap,aImageFile); + + TInt error = iFsSession.Connect (); + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ConstructL() FsSession Connect error = %d", error); + User::LeaveIfError(error); + iShiftToCloning = EFalse; + // Create the active object + iGlxDecoderAO = CGlxHdmiDecoderAO::NewL(this); + + // Create the HDMI Decoder + CreateImageDecoderL(); + + // Create the Bitmap + CreateBitmapL(); + + // Create the surface and AO for updating the surface + TRAP_IGNORE(CreateHdmiL()); + + if(iSurfManager) + { + error = iSurfUpdateSession.Connect(); + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ConstructL() Surface update Session Connect error = %d", error); + User::LeaveIfError(error); + iSurfSessionConnected = ETrue; + + ShowFsThumbnailL(); +#ifdef _DEBUG + iStartTime.HomeTime(); +#endif + //start decoding the image + iGlxDecoderAO->ConvertImageL(*iDecodedBitmap[EJpgDecodedBitmapIndex],iImageDecoder); + } + iTimer = CPeriodic::NewL( CActive::EPriorityStandard ); + } + +// ----------------------------------------------------------------------------- +// UpdateNewImageL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::UpdateNewImageL(const TDesC& aImageFile,CFbsBitmap* aFsBitmap) + { + TRACER("CGlxHdmiSurfaceUpdater::UpdateNewImageL()"); + ReleaseContent(); + // Initiate the HDMI by assigning the necessary values + InitiateHdmiL(aFsBitmap,aImageFile); + //Cancel the zoom timers if any + if(iTimer->IsActive()) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::UpdateNewImageL() - Cancel Timer"); + iTimer->Cancel(); + } + + // Create the HDMI Decoder + CreateImageDecoderL(); + + // Create the Bitmap + CreateBitmapL(); + if(iSurfManager) + { + // Create the surface and AO for updating the surface + CreateHdmiL(EFalse); + } + else + { + TRAP_IGNORE(CreateHdmiL(ETrue)); + } + +#ifdef _DEBUG + iStartTime.HomeTime(); +#endif + if(iSurfManager) + { + // Show FS Thumbnail + ShowFsThumbnailL(); + //start decoding the image + iGlxDecoderAO->ConvertImageL(*iDecodedBitmap[EJpgDecodedBitmapIndex],iImageDecoder); + } + } + +// ----------------------------------------------------------------------------- +// InitiateHdmiL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::InitiateHdmiL(CFbsBitmap* aFsBitmap,const TDesC& aImageFile) + { + TRACER("CGlxHdmiSurfaceUpdater::InitiateHdmiL()"); + iImagePath = aImageFile.Alloc(); + iFsBitmap = new (ELeave) CFbsBitmap; + iFsBitmap->Duplicate(aFsBitmap->Handle()); + iIsNonJpeg = EFalse; + iTvScreenSize = iWindow->Size(); + + iBitmapReady = EFalse; + iLeftCornerForZoom.iX = 0; + iLeftCornerForZoom.iY = 0; + + iZoom = ETrue; + } + +// ----------------------------------------------------------------------------- +// CreateHDMI +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::CreateHdmiL(TBool aCreateSurface) + { + TRACER("CGlxHdmiSurfaceUpdater::CreateHdmiL()"); + + if (aCreateSurface) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::CreateHdmiL() Create Surface"); + CreateSurfaceL(); + } + + // Active objects for double buffered draw signalling + if(!iSurfBufferAO) + { + iSurfBufferAO = new(ELeave) CGlxActiveCallBack(TCallBack(SurfBuffer0Ready, this), + CActive::EPriorityStandard-1); + CActiveScheduler::Add(iSurfBufferAO); + } + } + +// ----------------------------------------------------------------------------- +// CreateSurfaceL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::CreateSurfaceL() + { + TRACER("CGlxHdmiSurfaceUpdater::CreateSurfaceL()"); + iSurfManager = new(ELeave) RSurfaceManager(); + TInt error = iSurfManager->Open(); + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::CreateSurfaceL Open Surface manager error = %d", error); + User::LeaveIfError(error); + + RSurfaceManager::TSurfaceCreationAttributesBuf attributes; + attributes().iPixelFormat = EUidPixelFormatARGB_8888;// EUidPixelFormatYUV_420Planar; + attributes().iSize = iTvScreenSize; + + attributes().iBuffers = 1; + attributes().iStride = iTvScreenSize.iWidth * KMulFactorToCreateBitmap; + attributes().iAlignment = KMulFactorToCreateBitmap; + attributes().iContiguous = EFalse; + attributes().iMappable = ETrue; + + error = iSurfManager->CreateSurface(attributes, iSurfId); + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::CreateSurfaceL, Creating surface error : %d",error); + if(error == KErrNoMemory) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::CreateSurfaceL(). iSurfManager->Close()"); + iSurfManager->Close(); + delete iSurfManager; + iSurfManager = NULL; + if(iShiftToCloning == EFalse) + { + // Show Error Note + iShiftToCloning = ETrue; + } + ShiftToCloningMode(); // Shift from Posting Mode to Cloning Mode + } + User::LeaveIfError(error); + + //Map the surface and stride the surface info + MapSurfaceL(); + // Set the Configuration to the surface ID when creating a surface + iConfig.SetSurfaceId(iSurfId); + } + +// ----------------------------------------------------------------------------- +// MapSurfaceL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::MapSurfaceL() + { + TRACER("CGlxHdmiSurfaceUpdater::MapSurfaceL()"); + + //Create chunk to map it to the surface ID. + iSurfChunk = new(ELeave) RChunk(); + User::LeaveIfNull(iSurfChunk); + TInt error = iSurfManager->MapSurface(iSurfId, *iSurfChunk); + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::MapSurfaceL(), MapSurface error : %d",error); + User::LeaveIfError(error); + + // Get the info from the surfaceManager + // and store pointers to the pixel data + RSurfaceManager::TInfoBuf info; + error = iSurfManager->SurfaceInfo(iSurfId, info); + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::MapSurfaceL(), SurfaceInfo error : %d",error); + User::LeaveIfError(error); + + iSurfaceStride = info().iStride; + TInt offset = 0; + iSurfManager->GetBufferOffset( iSurfId, 0,offset); + iSurfBuffer = iSurfChunk->Base()+offset; + } + +// ----------------------------------------------------------------------------- +// SurfBuffer0Ready +// ----------------------------------------------------------------------------- +TInt CGlxHdmiSurfaceUpdater::SurfBuffer0Ready(TAny* /*aObject*/) + { + TRACER("CGlxHdmiSurfaceUpdater::SurfBuffer0Ready()"); + return ETrue; + } + +// ----------------------------------------------------------------------------- +// Refresh +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::Refresh() + { + TRACER("CGlxHdmiSurfaceUpdater::Refresh()"); + // copy the decoded bitmap on to the surface + SwapBuffers(); + + // refresh the window + iCallBack->DoGenCallback(); + } + +// ----------------------------------------------------------------------------- +// SwapBuffers +// This is used to sawp the buffers shown and to be shown +// After this is done, a refresh to the window should be done to refresh the TV +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::SwapBuffers() + { + TRACER("CGlxHdmiSurfaceUpdater::SwapBuffers()"); + TInt bitmapIndex = KErrNotFound; + + if (iShwFsThumbnail) // show FS thumbnail + { + bitmapIndex = EFSBitmapIndex; + } + else if(iIsNonJpeg && !iShwFsThumbnail) // this indicates it is non jpeg image and decoding finished + { + bitmapIndex = ENonJpgDecodedBitmapIndex; + } + else // if none of the above state means it is jpeg image and decoding finished + { + bitmapIndex = EJpgDecodedBitmapIndex; + } + + // Lock the heap so that subsequent call to dataaddress doesnt happen + iDecodedBitmap[bitmapIndex]->LockHeap(); + + // Data stride + TUint fs = iDecodedBitmap[bitmapIndex]->DataStride(); + + //Bitmap address from where the data has to be copied. + TUint8* from = (TUint8*)iDecodedBitmap[bitmapIndex]->DataAddress(); + + //surface chunk address to where the bitmap data has to be copied. + TUint8* to = (TUint8*)iSurfBuffer; + + // To buffer (32 bit colors) + TUint ts = iSurfaceStride; + //No of bytes to be copied on to the surface. + TUint bytes = iDecodedBitmap[bitmapIndex]->SizeInPixels().iWidth * KMulFactorToCreateBitmap; + + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::SwapBuffers() - decodeSize width = %d and height %d", + iDecodedBitmap[bitmapIndex]->SizeInPixels().iWidth, + iDecodedBitmap[bitmapIndex]->SizeInPixels().iHeight ); + + // Copy the bitmap on to the surface. + for (TInt y = iDecodedBitmap[bitmapIndex]->SizeInPixels().iHeight; y >0; y--) + { + Mem::Copy(to, from, bytes); + to += ts; + from += fs; + } + iDecodedBitmap[bitmapIndex]->UnlockHeap(); + } + +// ----------------------------------------------------------------------------- +// CreateBitmapL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::CreateBitmapL() + { + TRACER("CGlxHdmiSurfaceUpdater::CreateBitmapL()"); + TSize imageSize = iImageDecoder->FrameInfo().iOverallSizeInPixels; + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::StartImageDecodeL() - bitmapsize=%d, %d", + imageSize.iWidth,imageSize.iHeight); + TReal32 scaleFactor = 0.0f; + if (iTvScreenSize.iWidth * imageSize.iHeight > iTvScreenSize.iHeight + * imageSize.iWidth) + { + scaleFactor = (TReal32) iTvScreenSize.iHeight + / (TReal32) imageSize.iHeight; + } + else + { + scaleFactor = (TReal32) iTvScreenSize.iWidth + / (TReal32) imageSize.iWidth; + } + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::StartImageDecodeL() - scaleFactor=%f",scaleFactor); + iTargetBitmapSize.iHeight = imageSize.iHeight * scaleFactor; + iTargetBitmapSize.iWidth = imageSize.iWidth * scaleFactor; + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::StartImageDecodeL() - targetBitmapSize=%d, %d", + iTargetBitmapSize.iWidth,iTargetBitmapSize.iHeight); + //create the bitmap for the required size + iDecodedBitmap[EJpgDecodedBitmapIndex] = new (ELeave) CFbsBitmap(); + // to check if the Mimetype is supported by the decoder to to arbitary scaling + // if not then we recalculate the size + TInt err = iDecodedBitmap[EJpgDecodedBitmapIndex]->Create(ReCalculateSizeL(), EColor16MU); + User::LeaveIfNull(iDecodedBitmap[EJpgDecodedBitmapIndex]); + } + +// ----------------------------------------------------------------------------- +// DoesMimeTypeNeedsRecalculateL() +// ----------------------------------------------------------------------------- +// +TBool CGlxHdmiSurfaceUpdater::DoesMimeTypeNeedsRecalculateL() + { + TRACER("CGlxHdmiSurfaceUpdater::DoesMimeTypeNeedsRecalculateL"); + RApaLsSession session; + TDataType mimeType; + TUid uid; + + User::LeaveIfError( session.Connect() ); + CleanupClosePushL( session ); + User::LeaveIfError( session.AppForDocument( iImagePath->Des(), uid, mimeType ) ); + CleanupStack::PopAndDestroy(&session); + + if (mimeType.Des().Compare(KMimeJpeg)==0 || + mimeType.Des().Compare(KMimeJpg)==0) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::DoesMimeTypeNeedsRecalculateL - jpeg"); + return EFalse; + } + else + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::DoesMimeTypeNeedsRecalculateL - non jpeg"); + return ETrue; + } + } + +// ----------------------------------------------------------------------------- +// ReCalculateSize +// ----------------------------------------------------------------------------- +TSize CGlxHdmiSurfaceUpdater::ReCalculateSizeL() + { + TRACER("CGlxHdmiSurfaceUpdater::ReCalculateSizeL()"); + if(DoesMimeTypeNeedsRecalculateL()) + { + iIsNonJpeg = ETrue; + TSize fullFrameSize = iImageDecoder->FrameInfo().iOverallSizeInPixels; + // calculate the reduction factor on what size we need + TInt reductionFactor = iImageDecoder->ReductionFactor(fullFrameSize, iTargetBitmapSize); + // get the reduced size onto destination size + TSize destSize; + User::LeaveIfError(iImageDecoder->ReducedSize(fullFrameSize, reductionFactor, destSize)); + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ReCalculateSizeL() - destSize=%d, %d",destSize.iWidth,destSize.iHeight); + return destSize; + } + else + { + return iTargetBitmapSize; + } + } + +// ----------------------------------------------------------------------------- +// HandleRunL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::HandleRunL(TRequestStatus& aStatus) + { + TRACER("CGlxHdmiSurfaceUpdater::HandleRunL()"); + +#ifdef _DEBUG + iStopTime.HomeTime(); + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::HandleRunL() ConvertImageL took" + " <%d> us", (TInt)iStopTime.MicroSecondsFrom(iStartTime).Int64()); +#endif + if(aStatus.Int() !=KErrNone) + { + GLX_LOG_INFO("HandleRunL - Convert failed"); + ShiftToCloningMode(); + } + else if(iSurfManager) + { + iShwFsThumbnail = EFalse; + if (iIsNonJpeg) + { + // if this is non jpeg image, make sure we scale the bitmap + ScaleDecodedBitmapL(ENonJpgDecodedBitmapIndex); + } + ProcessTvImage(); + iBitmapReady = ETrue; + } + //release imagedecoder after the conversion is over + if(iImageDecoder) + { + delete iImageDecoder; + iImageDecoder = NULL; + } + } + +// ----------------------------------------------------------------------------- +// CreateImageDecoderL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::CreateImageDecoderL() + { + TRACER("CGlxHdmiController::CreateImageDecoderL()"); + // Create a decoder for the image in the named file + TRAPD(error,iImageDecoder = CImageDecoder::FileNewL(iFsSession, + iImagePath->Des(), CImageDecoder::EOptionNone, KNullUid)); + GLX_LOG_INFO1("CreateImageDecoderL CImageDecoder:FileNewL error %d",error); + User::LeaveIfError(error); + } + +// ----------------------------------------------------------------------------- +// ActivateZoom +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ActivateZoom(TBool aAutoZoomOut) + { + TRACER("CGlxHdmiSurfaceUpdater::ActivateZoom()"); + iZoom = ETrue; + iAutoZoomOut = aAutoZoomOut; + if(iTimer->IsActive()) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ActivateZoom() - Cancel Timer"); + iTimer->Cancel(); + } + + if(!iTimer->IsActive() && iBitmapReady) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::ActivateZoom() - Start Timer"); + iTimer->Start(KZoomDelay,KZoomDelay,TCallBack( TimeOut,this )); + } + } + +// ----------------------------------------------------------------------------- +// DeactivateZoom +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::DeactivateZoom() + { + TRACER("CGlxHdmiSurfaceUpdater::DeactivateZoom()"); + + if(iTimer->IsActive()) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::DeactivateZoom() - Cancel Timer"); + iTimer->Cancel(); + } + if(!iTimer->IsActive() && iBitmapReady && iLeftCornerForZoom.iX) + { + GLX_LOG_INFO("CGlxHdmiSurfaceUpdater::DeactivateZoom() - Start Timer"); + iZoom = EFalse; + iTimer->Start(KZoomDelay,KZoomDelay,TCallBack( TimeOut,this )); + } + } + +// --------------------------------------------------------------------------- +// TimeOut +// --------------------------------------------------------------------------- +// +TInt CGlxHdmiSurfaceUpdater::TimeOut(TAny* aSelf) + { + TRACER("CGlxHdmiSurfaceUpdater::TimeOut"); + if(aSelf) + { + CGlxHdmiSurfaceUpdater* self = static_cast (aSelf); + if (self) + { + self->Zoom(ETrue); + } + } + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// Zoom +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::Zoom(TBool aZoom) + { + TRACER("CGlxHdmiSurfaceUpdater::Zoom()"); + + if(!iBitmapReady) + { + return; + } + + if(iLeftCornerForZoom.iX == KMaxZoomLimit) + { + iZoom = EFalse; + //If autozoomout is not set then cancel the timer and do + //the zoom out on DeactivateZoom. + if(!iAutoZoomOut) + { + iTimer->Cancel(); + } + } + if(aZoom && iZoom) + { + iTargetBitmapSize.iWidth = TInt(iTargetBitmapSize.iWidth-KSingleStepForZoom); + iTargetBitmapSize.iHeight = TInt(iTargetBitmapSize.iHeight-KSingleStepForZoom); + iLeftCornerForZoom.iX =iLeftCornerForZoom.iX+KSingleStepForZoom/2; + iLeftCornerForZoom.iY =iLeftCornerForZoom.iY+KSingleStepForZoom/2; + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::Zoom()--- 2,iTargetBitmapSize.iWidth = %d, iTargetBitmapSize.iHeight = %d", iTargetBitmapSize.iWidth,iTargetBitmapSize.iHeight); + iConfig.SetViewport(TRect(iLeftCornerForZoom.iX,iLeftCornerForZoom.iY, + iTargetBitmapSize.iWidth,iTargetBitmapSize.iHeight)); + } + else + { + iTargetBitmapSize.iWidth = TInt(iTargetBitmapSize.iWidth+KSingleStepForZoom); + iTargetBitmapSize.iHeight = TInt(iTargetBitmapSize.iHeight+KSingleStepForZoom); + iLeftCornerForZoom.iX =iLeftCornerForZoom.iX-KSingleStepForZoom/2; + iLeftCornerForZoom.iY =iLeftCornerForZoom.iY-KSingleStepForZoom/2; + if(iLeftCornerForZoom.iX == 0) + { + iTimer->Cancel(); + iZoom = ETrue; + } + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::Zoom()--- 4,iTargetBitmapSize.iWidth = %d, iTargetBitmapSize.iHeight = %d", iTargetBitmapSize.iWidth,iTargetBitmapSize.iHeight); + iConfig.SetViewport(TRect(iLeftCornerForZoom.iX,iLeftCornerForZoom.iY, + iTargetBitmapSize.iWidth,iTargetBitmapSize.iHeight)); + } + iWindow->SetBackgroundSurface(iConfig, ETrue); + } + +// ----------------------------------------------------------------------------- +// ModifySurfacePostion +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ModifySurfacePostion() + { + TRACER("CGlxHdmiSurfaceUpdater::ModifySurfacePostion()"); + TPoint startPoint(0,0); + if (iTargetBitmapSize.iWidth RemoveBackgroundSurface(ETrue); + } + +// ----------------------------------------------------------------------------- +// ShiftToPostingMode +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ShiftToPostingMode() + { + TRACER("CGlxHdmiSurfaceUpdater::ShiftToPostingMode()"); + if(iSurfManager) + { +#ifdef _DEBUG + TRect ex, vp; + iConfig.GetExtent(ex); + iConfig.GetViewport(vp); + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ShiftToPostingMode() - vp - TL=%d, %d",vp.iTl.iX,vp.iTl.iY); + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ShiftToPostingMode() - vp - BR=%d, %d",vp.iBr.iX,vp.iBr.iY); + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ShiftToPostingMode() - ex - TL=%d, %d",ex.iTl.iX,ex.iTl.iY); + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ShiftToPostingMode() - ex - BR=%d, %d",ex.iBr.iX,ex.iBr.iY); +#endif + iWindow->SetBackgroundSurface(iConfig, ETrue); + iShiftToCloning = EFalse; + } + } + +// ----------------------------------------------------------------------------- +// ShowFsThumbnailL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ShowFsThumbnailL() + { + TRACER("CGlxHdmiSurfaceUpdater::ShowFsThumbnailL()"); + iShwFsThumbnail = ETrue; + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ShowFsThumbnailL() iTargetBitmapSize Width=%d, Height=%d", + iTargetBitmapSize.iWidth,iTargetBitmapSize.iHeight); + // Modify the surface position with respect to the buffer size + ModifySurfacePostion(); + // this is for FS thumbnail stored in array pointer 0 + ScaleDecodedBitmapL(EFSBitmapIndex); + // Process the Image to TV + ProcessTvImage(); + // set the surface onto background + iWindow->SetBackgroundSurface(iConfig, ETrue); + } + +// ----------------------------------------------------------------------------- +// ScaleDecodedBitmapL +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ScaleDecodedBitmapL(TInt aBitmapIndex) + { + TRACER("CGlxHdmiSurfaceUpdater::ScaleDecodedBitmapL()"); + GLX_LOG_INFO2("CGlxHdmiSurfaceUpdater::ScaleDecodedBitmapL() iTargetBitmapSize Width=%d, Height=%d", + iTargetBitmapSize.iWidth,iTargetBitmapSize.iHeight); + + if (iDecodedBitmap[aBitmapIndex]) + { + delete iDecodedBitmap[aBitmapIndex]; + iDecodedBitmap[aBitmapIndex] = NULL; + } + iDecodedBitmap[aBitmapIndex] = new (ELeave) CFbsBitmap(); + // create destination with size + TInt err = iDecodedBitmap[aBitmapIndex]->Create(iTargetBitmapSize, EColor16MU); + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ScaleDecodedBitmapL() creating bitmap error, err=%d",err); + User::LeaveIfNull(iDecodedBitmap[aBitmapIndex]); + + // Create bitmap device for destination bitmap + CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL(iDecodedBitmap[aBitmapIndex]); + CleanupStack::PushL(bitmapDevice); + + CFbsBitGc* bitmapGc = CFbsBitGc::NewL(); + CleanupStack::PushL(bitmapGc); + bitmapGc->Activate(bitmapDevice); + if (aBitmapIndex==EFSBitmapIndex) + { + // scale the source bitmap which is a FS bitmap + bitmapGc->DrawBitmap(TRect(iTargetBitmapSize), iFsBitmap); + } + else + { + // scale the source bitmap which is a decoded bitmap + bitmapGc->DrawBitmap(TRect(iTargetBitmapSize), iDecodedBitmap[EJpgDecodedBitmapIndex]); + } + + CleanupStack::PopAndDestroy(bitmapGc); + CleanupStack::PopAndDestroy(bitmapDevice); + + } + +// ----------------------------------------------------------------------------- +// ProcessTvImage +// ----------------------------------------------------------------------------- +void CGlxHdmiSurfaceUpdater::ProcessTvImage() + { + TRACER("CGlxHdmiSurfaceUpdater::ProcessTvImage()"); + if (iSurfBufferAO->iStatus != KRequestPending + && !iSurfBufferAO->IsActive()) + { + Refresh(); + iSurfBufferAO->iStatus = KRequestPending; + iSurfBufferAO->SetActive(); + iSurfUpdateSession.NotifyWhenAvailable(iSurfBufferAO->iStatus); + TInt err = iSurfUpdateSession.SubmitUpdate(1, iSurfId, 0, NULL); + GLX_LOG_INFO1("CGlxHdmiSurfaceUpdater::ProcessTvImage() Surfaceupdatesession error %d",err); + } + } + + + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/src/glxtv.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/src/glxtv.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,474 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles & propogates UI state change notifications. +* +*/ + + + +/** + * @internal reviewed 24/08/2007 by D Holland + */ + +// Class header +#include "glxtv.h" + +// External includes +#include // for TWsVisibilityChangedEvent + +// INTERNAL INCLUDES +#include // for debug logging +#include // for debug logging +#include // for Gallery panic codes +#include // for ETvConnectionChanged, TV heights +#include // for CRepository +#ifdef __MARM +#include +#endif + +// GLXTVOUT INCLUDES +#include "mglxtvobserver.h" // for MGlxTvObserver +#include "glxwindowvisibilitymonitor.h" // for CGlxWindowVisibilityMonitor +#include "glxtvconnectionmonitor.h" // for CGlxTvConnectionMonitor + +const TUid KCRUidTvoutSettings = {0x1020730B}; + +using namespace glxTvOut; + +/** +* CGlxTvOutCenRepMonitor +* CGlxTv conainted class for observing changes in central +* repository TV aspect Ratio value +* @author Loughlin Spollen +*/ +NONSHARABLE_CLASS( CGlxTv::CGlxTvOutCenRepMonitor ) + : public CActive + { + public: // Constructors and destructor + /** + * Symbian Constructor. + * @param The TV Observer + * @param The central repository + * @return constructed object + */ + static CGlxTvOutCenRepMonitor* NewL(MGlxTvObserver& aTvObserver, + CRepository& aRepository); + + /** + * Destructor. + */ + ~CGlxTvOutCenRepMonitor(); + + private: + /** + * C++ constructor. + * @param The TV Observer + * @param The central repository + * @return constructed object + */ + CGlxTvOutCenRepMonitor(MGlxTvObserver& aTvObserver, + CRepository& aRepository); + /** + * 2nd phase constructor + */ + void ConstructL(); + + protected: // from CActive + /** + * @ref CActive::RunL + */ + void RunL(); + + /** + * @ref CActive::DoCancel + */ + void DoCancel(); + + /** + * @ref CActive::RunError + */ + TInt RunError(TInt aError); + + private: + + // Not Owned: the Glx TV observer + MGlxTvObserver& iTvObserver; + + // Not Owned: the central repository API + CRepository& iRepository; + + TUint iSettingsTVAspectRatio; + // the central repository identifier + TUid iRepositoryUid; + }; + + + + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +CGlxTv::CGlxTvOutCenRepMonitor* CGlxTv::CGlxTvOutCenRepMonitor::NewL + ( MGlxTvObserver& aTvObserver, + CRepository& aRepository ) + { + TRACER("CGlxTv::CGlxTvOutCenRepMonitor::NewL()"); + + CGlxTvOutCenRepMonitor* self + = new(ELeave) CGlxTvOutCenRepMonitor( aTvObserver, aRepository ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + + + +// ----------------------------------------------------------------------------- +// C++ constructor. +// ----------------------------------------------------------------------------- +inline CGlxTv::CGlxTvOutCenRepMonitor::CGlxTvOutCenRepMonitor + ( MGlxTvObserver& aTvObserver, + CRepository& aRepository ) + : CActive( EPriorityStandard ), + iTvObserver ( aTvObserver ), + iRepository( aRepository ) + { + TRACER("CGlxTv::CGlxTvOutCenRepMonitor::CGlxTvOutCenRepMonitor()"); + } + + + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor +// ---------------------------------------------------------------------------- +void CGlxTv::CGlxTvOutCenRepMonitor::ConstructL() + { + TRACER("CGlxTv::CGlxTvOutCenRepMonitor::ConstructL"); + CActiveScheduler::Add( this ); +#ifdef __MARM + CGSServerEngine* gsServerEngine= CGSServerEngine::NewLC(); + iSettingsTVAspectRatio = gsServerEngine->AspectRatioL(); + CleanupStack::Pop(gsServerEngine); +#else + iSettingsTVAspectRatio = 0; +#endif + } + + + +// ---------------------------------------------------------------------------- +// Destructor +// ---------------------------------------------------------------------------- +CGlxTv::CGlxTvOutCenRepMonitor::~CGlxTvOutCenRepMonitor() + { + TRACER("CGlxTv::~CGlxTvOutCenRepMonitor()"); + Cancel(); + } + + + +// ---------------------------------------------------------------------------- +// CGlxTvOutCenRepMonitor::RunL +// From class CActive. +// ---------------------------------------------------------------------------- +void CGlxTv::CGlxTvOutCenRepMonitor::RunL() + { + TRACER("CGlxTv::CGlxTvOutCenRepMonitor::RunL"); + // Check for errors + User::LeaveIfError( iStatus.Int() ); + GLX_LOG_INFO("CGlxTvOutCenRepMonitor - RunL completed with Err Code"); + User::LeaveIfError( iRepository.NotifyRequest( iSettingsTVAspectRatio, iStatus ) ); + if (!IsActive()) + { + SetActive(); + iTvObserver.HandleTvStatusChangedL( ETvConnectionChanged ); + } + } + + + +// ---------------------------------------------------------------------------- +// CGlxTvOutCenRepMonitor::DoCancel +// From class CActive. +// ---------------------------------------------------------------------------- +void CGlxTv::CGlxTvOutCenRepMonitor::DoCancel() + { + TRACER("CGlxTv::CGlxTvOutCenRepMonitor::DoCancel()"); + iRepository.NotifyCancel( iSettingsTVAspectRatio ); + } + + + +//----------------------------------------------------------------------------- +// CGlxTvOutCenRepMonitor::RunError +// From class CActive. +//----------------------------------------------------------------------------- +// +TInt CGlxTv::CGlxTvOutCenRepMonitor::RunError( TInt /*aError*/ ) + { + TRACER("CGlxTv::CGlxTvOutCenRepMonitor::RunError()"); + return KErrNone; + } + + +//----------------------------------------------------------------------------- +// Return new object +//----------------------------------------------------------------------------- +// +EXPORT_C CGlxTv* CGlxTv::NewL( MGlxTvObserver& aTvObserver ) + { + TRACER("CGlxTv::NewL()"); + CGlxTv* self = new (ELeave) CGlxTv( aTvObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + + + +//----------------------------------------------------------------------------- +// Destructor +//----------------------------------------------------------------------------- +// +EXPORT_C CGlxTv::~CGlxTv() + { + TRACER("CGlxTv::~CGlxTv()"); + StopMonitoringEnvironment(); + delete iTvConnectionMonitor; + } + + + + +//----------------------------------------------------------------------------- +// Default C++ constructor +//----------------------------------------------------------------------------- +// +CGlxTv::CGlxTv( MGlxTvObserver& aTvObserver ) : iTvObserver( aTvObserver ), + iAspectRatio( KErrUnknown ) + { + TRACER("CGlxTv::CGlxTv()"); + } + + + + +//----------------------------------------------------------------------------- +// Symbian second phase constructor +//----------------------------------------------------------------------------- +// +void CGlxTv::ConstructL() + { + TRACER("CGlxTv::ConstructL()"); + // Don't create the visibility monitor until the TV Out cable is connected + + // Owned: The TV connection monitor + iTvConnectionMonitor = CGlxTvConnectionMonitor::NewL( *this ); + + if ( iTvConnectionMonitor->IsConnected() ) + { + // Start monitoring the environment for changes + MonitorEnvironmentL(); + + // Calculate the TV Out screen buffer size + CalcTvScreenSzL(); + } + } + + + + +//----------------------------------------------------------------------------- +// returns the TV screen size +//----------------------------------------------------------------------------- +// +EXPORT_C TSize CGlxTv::ScreenSizeL() const + { + TRACER("CGlxTv::ScreenSizeL()"); + return iSzInPixels; + } + + + + +//----------------------------------------------------------------------------- +// Is the analog TV Connected +//----------------------------------------------------------------------------- +// +EXPORT_C TBool CGlxTv::IsConnected() const + { + TRACER("CGlxTv::IsConnected()"); + return iTvConnectionMonitor->IsConnected(); + } + + +//----------------------------------------------------------------------------- +// Is the HDMI TV Connected +//----------------------------------------------------------------------------- +// +EXPORT_C TBool CGlxTv::IsHDMIConnected() const + { + TRACER("CGlxTv::IsHDMIConnected()"); + return iTvConnectionMonitor->IsHDMIConnected(); + } + +//----------------------------------------------------------------------------- +// Is the TV widescreen +//----------------------------------------------------------------------------- +// +EXPORT_C TBool CGlxTv::IsWidescreen() const + { + TRACER("CGlxTv::IsWidescreen()"); + return iAspectRatio == KGlxTvAspectWide; + } + + +//----------------------------------------------------------------------------- +// From class MGlxWindowVisibilityObserver. +// Called when window becomes fully visible or not visible. +//----------------------------------------------------------------------------- +// +void CGlxTv::HandleWindowVisibilityChangedL( TTvChangeType aChangeType ) + { + TRACER("CGlxTv::HandleWindowVisibilityChangedL()"); + iTvObserver.HandleTvStatusChangedL( aChangeType ); + } + + + +//----------------------------------------------------------------------------- +// From class MGlxTvConnectionObserver. +// Called when TV connection state changes +//----------------------------------------------------------------------------- +// +void CGlxTv::HandleTvConnectionStatusChangedL( ) + { + TRACER("CGlxTv::HandleTvConnectionStatusChangedL()"); + + if ( iTvConnectionMonitor->IsConnected() ) + { + // Start monitoring the environment for changes + MonitorEnvironmentL(); + // Calculate the TV Out screen buffer + CalcTvScreenSzL(); + } + else + { + StopMonitoringEnvironment(); + } + iTvObserver.HandleTvStatusChangedL( ETvConnectionChanged ); + } + + + +//----------------------------------------------------------------------------- +// Retrieve the TV display aspect ratio +//----------------------------------------------------------------------------- +// +void CGlxTv::CalcTvScreenSzL() + { + TRACER("CGlxTv::CalcTvScreenSzL()"); + + // Retrieve the aspect ratio and the settings info from CenRep + iAspectRatio = KErrNotFound; + +#ifdef __MARM + CGSServerEngine* gsServerEngine = CGSServerEngine::NewLC(); + iAspectRatio = gsServerEngine->AspectRatioL(); + CleanupStack::Pop(gsServerEngine); + User::LeaveIfError( iAspectRatio ); +#else + iAspectRatio = 0; +#endif + // note: Constants are defined in the GSServerEngine.cpp and not exported + // they are defined locally in glxtvconstants.h + switch( iAspectRatio ) + { + case KGlxTvAspectWide: + { + iSzInPixels = TSize ( KGlxTvOutWidthWide, KGlxTvOutHeightWide) ; + break; + } + case KGlxTvAspectNormal: + { + iSzInPixels = TSize ( KGlxTvOutWidth, KGlxTvOutHeight ); + break; + } + default: + { + User::Leave(KErrUnknown); + } + } + } + + +//----------------------------------------------------------------------------- +// From class MonitorEnvironmentL. +// Called when TV connection state changes to connected +//----------------------------------------------------------------------------- +// +void CGlxTv::MonitorEnvironmentL() + { + TRACER("CGlxTv::MonitorEnvironmentL()"); + + // Instantiate the central repository + if (!iCenRep) + { + // The Uid is hardcoded here as the hrh file giving us the Uid has been depricated and + // moved to a private folder + iCenRep = CRepository::NewL( KCRUidTvoutSettings ); + } + + // Monitor changes to the aspect ratio in the central repository + if (!iTvDisplayAspectRatioMonitor) + { + iTvDisplayAspectRatioMonitor + = CGlxTvOutCenRepMonitor::NewL( iTvObserver, *iCenRep ); + } + + // create window visibility monitoring object + if ( !iWindowVisibilityMonitor ) + { + iWindowVisibilityMonitor = + CGlxWindowVisibilityMonitor::NewL( *this ); + } + } + + +//----------------------------------------------------------------------------- +// StopMonitoringEnvironment(). +// Called when TV connection state changes to disconnected +//----------------------------------------------------------------------------- +// +void CGlxTv::StopMonitoringEnvironment() + { + TRACER("CGlxTv::StopMonitoringEnvironment()"); + delete iTvDisplayAspectRatioMonitor; // destroy before iCenRep - must cancel + iTvDisplayAspectRatioMonitor = NULL; // outstanding requests + if (iWindowVisibilityMonitor) + { + iWindowVisibilityMonitor->Close(); + } + delete iWindowVisibilityMonitor; + iWindowVisibilityMonitor = NULL; + delete iCenRep; + iCenRep = NULL; + } + + +// End of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/src/glxtvconnectionmonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/src/glxtvconnectionmonitor.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,252 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Monitors the Tv Out Connection +* +*/ + + + +/** + * @internal reviewed 24/08/2007 by D Holland + */ + +// CLASS HEADER +#include "glxtvconnectionmonitor.h" + +// EXTERNAL INCLUDES + +// INTERNAL INCLUDES + +#include +#include +#include "glxtv.h" +#include +#include +//----------------------------------------------------------------------------- +// Return new object +//----------------------------------------------------------------------------- +// +CGlxTvConnectionMonitor* CGlxTvConnectionMonitor::NewL( + MGlxTvConnectionObserver& aConnectionObserver ) + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::NewL"); + CGlxTvConnectionMonitor* self = new (ELeave) + CGlxTvConnectionMonitor( aConnectionObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +//----------------------------------------------------------------------------- +// Destructor +//----------------------------------------------------------------------------- +// +CGlxTvConnectionMonitor::~CGlxTvConnectionMonitor() + { + GLX_LOG_INFO("~CGlxTvConnectionMonitor"); + Cancel(); + iTvAccCon.CloseSubSession(); + iTvAccServer.Disconnect(); + } + + +//----------------------------------------------------------------------------- +// Default C++ constructor +//----------------------------------------------------------------------------- +// +CGlxTvConnectionMonitor::CGlxTvConnectionMonitor + ( MGlxTvConnectionObserver& aConnectionObserver ) + :CActive(EPriorityStandard), + iConnectionObserver ( aConnectionObserver ) + { + GLX_LOG_INFO("CGlxTvConnectionMonitor"); + CActiveScheduler::Add( this ); + } + + +//----------------------------------------------------------------------------- +// Symbian second phase constructor +//----------------------------------------------------------------------------- +// +void CGlxTvConnectionMonitor::ConstructL() + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::ConstructL"); + User::LeaveIfError(iTvAccServer.Connect()); + User::LeaveIfError(iTvAccCon.CreateSubSession(iTvAccServer)); + User::LeaveIfError(iTvAccCon.GetAccessoryConnectionStatus(iCurrentAccArray)); + for (int i = 0; i < iCurrentAccArray.Count(); i++) + { + iTvOutConnectionState + = (iCurrentAccArray.GetGenericIDL(i).PhysicalConnectionCaps() + == KPCWired); + iHDMIConnectionState + = (iCurrentAccArray.GetGenericIDL(i).PhysicalConnectionCaps() + == KPCHDMI); + } + IssueRequest(); + } + +//----------------------------------------------------------------------------- +// From class CActive. +// Receive notification of change in the connection state +//----------------------------------------------------------------------------- +// +void CGlxTvConnectionMonitor::RunL() + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::RunL"); + // Check for errors + User::LeaveIfError( iStatus.Int() ); + // Notify observers + IssueNotificationL(); + // Request the next event + IssueRequest(); + } + + +//----------------------------------------------------------------------------- +// From class CActive. +// DoCancel +//----------------------------------------------------------------------------- +// +void CGlxTvConnectionMonitor::DoCancel() + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::DoCancel"); + iTvAccCon.CancelGetAccessoryConnectionStatus(); + iTvAccCon.CancelNotifyAccessoryConnectionStatusChanged(); + } + + + +//----------------------------------------------------------------------------- +// From class CActive. +// RunError +//----------------------------------------------------------------------------- +// +TInt CGlxTvConnectionMonitor::RunError(TInt aError) + { + GLX_LOG_INFO1("CGlxTvConnectionMonitor::RunError - %d", aError); + return KErrNone; + } + +//----------------------------------------------------------------------------- +// Is the TV out cable connected +// IsConnected +//----------------------------------------------------------------------------- +// +TBool CGlxTvConnectionMonitor::IsConnected() const + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::IsConnected"); + GLX_LOG_INFO1("CGlxTvConnectionMonitor::IsConnected iTvOutConnectionState=%d",iTvOutConnectionState); + return iTvOutConnectionState; + } + +//----------------------------------------------------------------------------- +// Is the TV out cable connected +// IsConnected +//----------------------------------------------------------------------------- +// +TBool CGlxTvConnectionMonitor::IsHDMIConnected() const + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::IsHDMIConnected"); + GLX_LOG_INFO1("CGlxTvConnectionMonitor::IsHDMIConnected iHDMIConnectionState=%d",iHDMIConnectionState); + return iHDMIConnectionState; + } + +//----------------------------------------------------------------------------- +// Request accessory server events +//----------------------------------------------------------------------------- +// +void CGlxTvConnectionMonitor::IssueRequest() + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueRequest"); + if (!IsActive()) // required for testing + { + iTvAccCon.NotifyAccessoryConnectionStatusChanged(iStatus,iCurrentAccArray); + SetActive(); + } + } + + +//----------------------------------------------------------------------------- +// Sends notification to observers if TV Out is connected +//----------------------------------------------------------------------------- +// +void CGlxTvConnectionMonitor::IssueNotificationL() + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueNotificationL"); + TBool previousTvState = iTvOutConnectionState; + TBool previousHDMIState = iHDMIConnectionState; + GLX_LOG_INFO2("previousTvState = %d , previousHDMIState = %d", + previousTvState,previousHDMIState); + + //gets the TV status in to the iCurrentAccArray and haves the Latest Accesory in 0-index + User::LeaveIfError(iTvAccCon.GetAccessoryConnectionStatus(iCurrentAccArray)); + + CAccPolSubblockNameArray* nameArray = CAccPolSubblockNameArray::NewL(); + CleanupStack::PushL(nameArray); + + // + // Get the number of currently connected accessories + // Loop through each connected accessory looking for + // the desired capabilities + // + iTvOutConnectionState = EFalse; + iHDMIConnectionState = EFalse; + const TInt count = iCurrentAccArray.Count(); + for (TInt index = 0; index < count; index++) + { + TAccPolGenericID genId = iCurrentAccArray.GetGenericIDL(index); + // Get all supported capabilities for this connected accessory. + iTvAccCon.GetSubblockNameArrayL(genId, *nameArray); + // Check if this connected accessory supports TV-Out capabality. + if (nameArray->HasName(KAccVideoOut)) + { + GLX_LOG_INFO("TV-Out Capabilities Exist"); + TAccPolNameRecord nameRecord; + nameRecord.SetNameL(KAccVideoOut); + TAccValueTypeTInt value; + iTvAccCon.GetValueL(genId, nameRecord, value); + if (value.iValue == EAccVideoOutEHDMI) + { + GLX_LOG_INFO("HDMI is connected Capabilities Exist"); + iHDMIConnectionState = ETrue; + break; + } + else if (value.iValue == EAccVideoOutCVideo) + { + GLX_LOG_INFO("TV is connected Capabilities Exist"); + iTvOutConnectionState = ETrue; + break; + } + } + + } + CleanupStack::PopAndDestroy(nameArray); + + if (previousTvState != iTvOutConnectionState || previousHDMIState + != iHDMIConnectionState) + { + GLX_LOG_INFO("CGlxTvConnectionMonitor::IssueNotificationL -" + " TvConnectionStatusChanged"); + GLX_LOG_INFO2("CurrentTvState = %d , CurrentHDMIState = %d", + iTvOutConnectionState,iHDMIConnectionState); + iConnectionObserver.HandleTvConnectionStatusChangedL(); + } + } + + + + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutengine/src/glxwindowvisibilitymonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutengine/src/glxwindowvisibilitymonitor.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,142 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class that monitors tv window visibility +* +*/ + + + +/** + * @internal reviewed 24/08/2007 by D Holland + */ + +// CLASS HEADER +#include "glxwindowvisibilitymonitor.h" + +// EXTERNAL INCLUDES +#include // for TWsEvent +#include // for KAknFullOrPartialForegroundLost +#include // for EventMonitor +#include + +// INTERNAL INCLUDES +#include +#include +#include "glxtv.h" // for MGlxWindowVisibilityObserver + + + +//----------------------------------------------------------------------------- +// Return new object +//----------------------------------------------------------------------------- +// +CGlxWindowVisibilityMonitor* CGlxWindowVisibilityMonitor::NewL( + MGlxWindowVisibilityObserver& aVisibilityObserver ) + { + GLX_LOG_INFO("CGlxWindowVisibilityMonitor::NewL"); + CGlxWindowVisibilityMonitor* self = new ( ELeave ) + CGlxWindowVisibilityMonitor( aVisibilityObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +//----------------------------------------------------------------------------- +// Destructor +//----------------------------------------------------------------------------- +// +CGlxWindowVisibilityMonitor::~CGlxWindowVisibilityMonitor() + { + GLX_LOG_INFO("~CGlxWindowVisibilityMonitor"); + } + + +//----------------------------------------------------------------------------- +// Close +// To overcome code-scanner high rated warning +//----------------------------------------------------------------------------- +// +void CGlxWindowVisibilityMonitor::Close() + { + iAknEventMonitor->Enable( EFalse ); + iAknEventMonitor->RemoveObserver( this ); + } + +//----------------------------------------------------------------------------- +// Default C++ constructor +//----------------------------------------------------------------------------- +// +CGlxWindowVisibilityMonitor::CGlxWindowVisibilityMonitor + ( MGlxWindowVisibilityObserver& aVisibilityObserver ) + :iVisibilityObserver ( aVisibilityObserver ) + { + GLX_LOG_INFO("CGlxWindowVisibilityMonitor"); + } + + +//----------------------------------------------------------------------------- +// Symbian second phase constructor +//----------------------------------------------------------------------------- +// +void CGlxWindowVisibilityMonitor::ConstructL() + { + GLX_LOG_INFO("CGlxWindowVisibilityMonitor::ConstructL"); + // Register for visibility events + iAknEventMonitor = + static_cast(CCoeEnv::Static()->AppUi())->EventMonitor(); + iAknEventMonitor->Enable( ETrue ); + iAknEventMonitor->AddObserverL( this ); + } + + +//----------------------------------------------------------------------------- +// From class MAknWsEventObserver +// Propagates window server visibility events to the observer +//----------------------------------------------------------------------------- +// +void CGlxWindowVisibilityMonitor::HandleWsEventL( const TWsEvent& aEvent, + CCoeControl* /*aDestination*/ ) + { + GLX_LOG_INFO("CGlxWindowVisibilityMonitor::HandleWsEventL"); + TInt eventType = aEvent.Type(); + + if ( eventType == EEventWindowVisibilityChanged ) + { + // check the state + TUint visible = aEvent.VisibilityChanged()->iFlags; + // notify the observer + if ( visible & TWsVisibilityChangedEvent::EFullyVisible ) + { + GLX_LOG_INFO("Visibility Event - EFullyVisible"); + iVisibilityObserver.HandleWindowVisibilityChangedL( ETvDisplayIsVisible ); + } + else if ( visible & TWsVisibilityChangedEvent::ENotVisible ) + { + GLX_LOG_INFO("Visibility Event - ENotVisible"); + iVisibilityObserver.HandleWindowVisibilityChangedL( ETvDisplayNotVisible ); + } + else if (visible & TWsVisibilityChangedEvent::EPartiallyVisible) + { + GLX_LOG_INFO("Visibility Event - EPartiallyVisible"); + iVisibilityObserver.HandleWindowVisibilityChangedL( ETvDisplayNotVisible ); + } + } + } + + + + + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutwrapper/inc/glxtvconnectionobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutwrapper/inc/glxtvconnectionobserver.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,61 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header of Tv connection Observer class +* +*/ + +#ifndef GLXTVCONNECTIONOBSERVER_H +#define GLXTVCONNECTIONOBSERVER_H + +#include +#include // for inteface MGlxTvObserver + +// forward decelration +class CGlxTv; +class GlxTvOutWrapperPrivate; + +class CGlxConnectionObserver : public CBase, + public MGlxTvObserver + { +public: + /* + * NewL() + */ + static CGlxConnectionObserver* NewL(GlxTvOutWrapperPrivate* aTvWrapperPrivate); + + /* + * destructor + */ + ~CGlxConnectionObserver(); +private: + /* + * ConstructL + */ + void ConstructL(); + + /* + * constructor + */ + CGlxConnectionObserver(GlxTvOutWrapperPrivate* aTvWrapperPrivate); + +private:// From MGlxTvObserver + void HandleTvStatusChangedL ( TTvChangeType aChangeType ); + +private: + CGlxTv* iGlxTvOut; + GlxTvOutWrapperPrivate* iTvWrapperPrivate; + }; +#endif // GLXTVCONNECTIONOBSERVER_H + + diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutwrapper/inc/glxtvoutwrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutwrapper/inc/glxtvoutwrapper.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header of Wrapper class exposed to Views for HDMI +* +*/ + +#ifndef GLXTVOUTWRAPPER_H +#define GLXTVOUTWRAPPER_H + +#include + +// forward decleration +class GlxTvOutWrapperPrivate; + +#ifdef BUILD_TVOUTWRAPPER +#define GLX_TVOUTWRAPPER_EXPORT Q_DECL_EXPORT +#else +#define GLX_TVOUTWRAPPER_EXPORT Q_DECL_IMPORT +#endif + +class GLX_TVOUTWRAPPER_EXPORT GlxTvOutWrapper +{ +public: + /* + * Constructor + */ + GlxTvOutWrapper(); + + /* + * Destructor + */ + ~GlxTvOutWrapper(); + + /* + * Setting the model + * This also creates the private instance of the wrapper + * to pass the model + */ + void setModel(QAbstractItemModel* aModel); + + /* + * Set the image on to HDMI + */ + void setImagetoHDMI(); + + /* + * Sets HDMI to cloning mode + */ + void setToCloningMode(); + + /* + * Sets HDMI to Native posting mode + */ + void setToNativeMode(); + + /* + * views should call this if for any item it doesnt want to move to + * HDMI posting mode + */ + void itemNotSupported(); + + /* + * Activate zoom in posting mode + * This can be called if the zoom animation in HDMI(bounce back effect) + * needs to be shown + * @param1 - send true if want to auto zoom out on animation effect + */ + void activateZoom(bool autoZoomOut); + + /* + * Deactivate zoom in posting mode. + * This can be called when zoom animation needs to bounce back. + * Note : This function is not required if bounce back effect finishes automatically + */ + void deactivateZoom(); +private: + GlxTvOutWrapperPrivate* mTvOutWrapperPrivate; +}; + +#endif //GLXTVOUTWRAPPER_H +// End of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutwrapper/inc/glxtvoutwrapper_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutwrapper/inc/glxtvoutwrapper_p.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header of private wrapper class which speaks to HDMI and +* also observes TVout connections +* +*/ +#ifndef GLXTVOUTWRAPPERPRIVATE_P_H +#define GLXTVOUTWRAPPERPRIVATE_P_H + +#include +#include +#include + +class GlxTvOutWrapper; +class CGlxConnectionObserver; +class CGlxHdmiController; + +// Converting the QVariant to CFbsBitmap* +Q_DECLARE_METATYPE(CFbsBitmap*); + +class GlxTvOutWrapperPrivate + { +public: + /* + * Static method to create an instance + */ + static GlxTvOutWrapperPrivate* Instance(GlxTvOutWrapper* aTvOutWrapper, + QAbstractItemModel* aModel); + + /* + * destructor + */ + ~GlxTvOutWrapperPrivate(); + + /* + * HandleConnectionChange + * @param1 true if connected, false if disconnected + * Note this is only being done for HDMI as there is no + * implementation for Analog TV. + */ + void HandleConnectionChange(bool aConnected); + + /* + * SetImagetoHDMI() + */ + void SetImagetoHDMI(); + + /* + * Sets HDMI to cloning mode + */ + void SetToCloningMode(); + + /* + * Sets HDMI to Native posting mode + */ + void SetToNativeMode(); + + /* + * views should call this if for any item it doesnt want to move to + * HDMI posting mode + */ + void ItemNotSupported(); + + /* + * Activate zoom in posting mode + */ + void ActivateZoom(bool autoZoomOut); + + /* + * Deactivate zoom in posting mode. + */ + void DeactivateZoom(); +private: + /* + * constructor + */ + GlxTvOutWrapperPrivate(GlxTvOutWrapper* aTvOutWrapper, + QAbstractItemModel* aModel); + + /* + * constructL() + */ + void ConstructL(); + + /* + * SetNewImage + * Get the uri and bmp from the media model + * and pass it to HDMI controller + */ + void SetNewImage(); +private: + GlxTvOutWrapper* iTvOutWrapper; // Instance of the Tv Wrapper + QAbstractItemModel* iModel; // Instance of the model + CGlxConnectionObserver* iConnectionObserver; // Symbian connection observer + CGlxHdmiController* iHdmiController; // Symbian Hdmi Controller + + bool iHdmiConnected; // To check if the HDMI is connected + bool isImageSetToHdmi; // to check if the image is set to HDMI + }; + +#endif //GLXTVOUTWRAPPERPRIVATE_P_H + +// End of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutwrapper/src/glxtvconnectionobserver.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutwrapper/src/glxtvconnectionobserver.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,76 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Tv connection Observer class +* +*/ + +#include "glxtv.h" // for CGlxTv +#include "glxtvconnectionobserver.h" +#include "glxtvoutwrapper_p.h" + + +// ----------------------------------------------------------------------------- +// NewL +// ----------------------------------------------------------------------------- +CGlxConnectionObserver* CGlxConnectionObserver::NewL(GlxTvOutWrapperPrivate* aTvWrapperPrivate) + { + CGlxConnectionObserver* self = new (ELeave)CGlxConnectionObserver(aTvWrapperPrivate); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// ConstructL +// ----------------------------------------------------------------------------- +void CGlxConnectionObserver::ConstructL() + { + iGlxTvOut = CGlxTv::NewL(*this); + } + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +CGlxConnectionObserver::CGlxConnectionObserver(GlxTvOutWrapperPrivate* aTvWrapperPrivate): + iTvWrapperPrivate(aTvWrapperPrivate) + { + // ctor + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +CGlxConnectionObserver::~CGlxConnectionObserver() + { + if (iGlxTvOut){ + delete iGlxTvOut; + iGlxTvOut = NULL; + } + } + +// ----------------------------------------------------------------------------- +// HandleTvStatusChangedL +// ----------------------------------------------------------------------------- +void CGlxConnectionObserver::HandleTvStatusChangedL(TTvChangeType aChangeType) + { + if ( aChangeType == ETvConnectionChanged ){ + if ( iGlxTvOut->IsHDMIConnected() ){ + iTvWrapperPrivate->HandleConnectionChange(ETrue); + // emit HDMI connected signal + } + else{ + iTvWrapperPrivate->HandleConnectionChange(EFalse); + // emit HDMI disconnected + } + } + } diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutwrapper/src/glxtvoutwrapper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutwrapper/src/glxtvoutwrapper.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Wrapper class exposed to Views for HDMI +* +*/ + +#include +#include + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +GlxTvOutWrapper::GlxTvOutWrapper(): + mTvOutWrapperPrivate(NULL) + { + // Do Nothing + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +GlxTvOutWrapper::~GlxTvOutWrapper() + { + if (mTvOutWrapperPrivate) + { + delete mTvOutWrapperPrivate; + mTvOutWrapperPrivate = NULL; + } + } + +// ----------------------------------------------------------------------------- +// setModel +// and Create the private instance to pass the model +// ----------------------------------------------------------------------------- +void GlxTvOutWrapper::setModel(QAbstractItemModel* aModel) + { + if (!mTvOutWrapperPrivate) + { + mTvOutWrapperPrivate = GlxTvOutWrapperPrivate::Instance(this,aModel); + } + else + { + return; + } + } + +// ----------------------------------------------------------------------------- +// setImagetoHDMI +// ----------------------------------------------------------------------------- +void GlxTvOutWrapper::setImagetoHDMI() + { + if(mTvOutWrapperPrivate){ + mTvOutWrapperPrivate->SetImagetoHDMI(); + } + } + +// ----------------------------------------------------------------------------- +// setToCloningMode +// ----------------------------------------------------------------------------- +void GlxTvOutWrapper::setToCloningMode() + { + if(mTvOutWrapperPrivate){ + mTvOutWrapperPrivate->SetToCloningMode(); + } + } + +// ----------------------------------------------------------------------------- +// setToNativeMode +// ----------------------------------------------------------------------------- +void GlxTvOutWrapper::setToNativeMode() + { + if(mTvOutWrapperPrivate){ + mTvOutWrapperPrivate->SetToNativeMode(); + } + } + +// ----------------------------------------------------------------------------- +// itemNotSupported +// ----------------------------------------------------------------------------- +void GlxTvOutWrapper::itemNotSupported() + { + if(mTvOutWrapperPrivate){ + mTvOutWrapperPrivate->ItemNotSupported(); + } + } + +// ----------------------------------------------------------------------------- +// activateZoom +// ----------------------------------------------------------------------------- +void GlxTvOutWrapper::activateZoom(bool autoZoomOut) + { + if(mTvOutWrapperPrivate){ + mTvOutWrapperPrivate->ActivateZoom(autoZoomOut); + } + } + +// ----------------------------------------------------------------------------- +// deactivateZoom +// ----------------------------------------------------------------------------- +void GlxTvOutWrapper::deactivateZoom() + { + if(mTvOutWrapperPrivate){ + mTvOutWrapperPrivate->DeactivateZoom(); + } + } + +// End of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutwrapper/src/glxtvoutwrapper_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutwrapper/src/glxtvoutwrapper_p.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,191 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of private wrapper class +* +*/ + +#include "glxtvoutwrapper.h" +#include "glxtvoutwrapper_p.h" +#include "glxtvconnectionobserver.h" +#include "glxhdmicontroller.h" +#include "glxmodelparm.h" + +// ----------------------------------------------------------------------------- +// Static method to create the private wrapper instance +// ----------------------------------------------------------------------------- +GlxTvOutWrapperPrivate* GlxTvOutWrapperPrivate::Instance(GlxTvOutWrapper* aTvOutWrapper, + QAbstractItemModel* aModel) + { + GlxTvOutWrapperPrivate* self = new GlxTvOutWrapperPrivate(aTvOutWrapper,aModel); + if (self){ + TRAPD(err,self->ConstructL()); + if(err != KErrNone){ + delete self; + self = NULL; + } + } + return self; + } + +// ----------------------------------------------------------------------------- +// ConstructL +// This creates the Connection observer and the Hdmi Controller +// ----------------------------------------------------------------------------- +void GlxTvOutWrapperPrivate::ConstructL() + { + iConnectionObserver = CGlxConnectionObserver::NewL(this); + if (!iHdmiController) { + iHdmiController = CGlxHdmiController::NewL(); + iHdmiConnected = iHdmiController->IsHDMIConnected(); + } + } + +// ----------------------------------------------------------------------------- +// Constructor +// ----------------------------------------------------------------------------- +GlxTvOutWrapperPrivate::GlxTvOutWrapperPrivate(GlxTvOutWrapper* aTvOutWrapper, + QAbstractItemModel* aModel):iTvOutWrapper(aTvOutWrapper), + iModel(aModel), + iConnectionObserver(NULL), + iHdmiController(NULL), + iHdmiConnected(false), + isImageSetToHdmi(false) + { + // Do Nothing + } + +// ----------------------------------------------------------------------------- +// Destructor +// ----------------------------------------------------------------------------- +GlxTvOutWrapperPrivate::~GlxTvOutWrapperPrivate() + { + if (iConnectionObserver){ + delete iConnectionObserver; + iConnectionObserver = NULL; + } + if (iHdmiController){ + delete iHdmiController; + iHdmiController = NULL; + } + } + +// ----------------------------------------------------------------------------- +// HandleConnectionChange +// observes the connection change to modify the connection flag +// ----------------------------------------------------------------------------- +void GlxTvOutWrapperPrivate::HandleConnectionChange(bool aConnected) + { + iHdmiConnected = aConnected; + // if Connection state positive and uri/bmp are not passed to HDMI already + // then it is a new image - Set it. + if (!isImageSetToHdmi && iHdmiConnected) + { + SetNewImage(); + } + } + +// ----------------------------------------------------------------------------- +// SetImagetoHDMI +// if the Hdmi is connected, Set the new image else do nothing +// ----------------------------------------------------------------------------- +void GlxTvOutWrapperPrivate::SetImagetoHDMI() + { + if (iHdmiConnected) + { + // Set the Image + SetNewImage(); + // Set the flag after HDMI is set for the image + isImageSetToHdmi = true; + } + else + { + // UnSet the flag as HDMI not set + // this would be in future use if HDMI not set for a image in FS/SS and + // cable connected + isImageSetToHdmi = false; + } + } + +// ----------------------------------------------------------------------------- +// SetNewImage +// Private implementation of setting the image to HDMI +// ----------------------------------------------------------------------------- +void GlxTvOutWrapperPrivate::SetNewImage() + { + int focusIndex = (iModel->data(iModel->index(0,0),GlxFocusIndexRole).value()); + + // Get the image uri + QString imagePath = (iModel->data(iModel->index(focusIndex,0),GlxUriRole)).value(); + if(imagePath.isNull()) { + // Null path no need to proceed + return ; + } + + TPtrC aPtr = reinterpret_cast(imagePath.utf16()); + QVariant var = (iModel->data(iModel->index(focusIndex,0),GlxHdmiBitmap)); + CFbsBitmap* bmp = var.value(); + iHdmiController->SetImageL(aPtr,bmp); + } + +// ----------------------------------------------------------------------------- +// setToCloningMode +// ----------------------------------------------------------------------------- +void GlxTvOutWrapperPrivate::SetToCloningMode() + { + if(iHdmiController){ + iHdmiController->ShiftToCloningMode(); + } + } + +// ----------------------------------------------------------------------------- +// setToNativeMode +// ----------------------------------------------------------------------------- +void GlxTvOutWrapperPrivate::SetToNativeMode() + { + if(iHdmiController){ + iHdmiController->ShiftToPostingMode(); + } + } + +// ----------------------------------------------------------------------------- +// itemNotSupported +// ----------------------------------------------------------------------------- +void GlxTvOutWrapperPrivate::ItemNotSupported() + { + if(iHdmiController){ + iHdmiController->ItemNotSupported(); + } + } + +// ----------------------------------------------------------------------------- +// activateZoom +// ----------------------------------------------------------------------------- +void GlxTvOutWrapperPrivate::ActivateZoom(bool autoZoomOut) + { + if(iHdmiController){ + iHdmiController->ActivateZoom(autoZoomOut); + } + } + +// ----------------------------------------------------------------------------- +// deactivateZoom +// ----------------------------------------------------------------------------- +void GlxTvOutWrapperPrivate::DeactivateZoom() + { + if(iHdmiController){ + iHdmiController->DeactivateZoom(); + } + } + +// End of file diff -r 99ad1390cd33 -r c499df2dbb33 tvout/tvoutwrapper/tvoutwrapper.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tvout/tvoutwrapper/tvoutwrapper.pro Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,45 @@ +#/* +#* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +#* All rights reserved. +#* This component and the accompanying materials are made available +#* under the terms of "Eclipse Public License v1.0" +#* which accompanies this distribution, and is available +#* at the URL "http://www.eclipse.org/legal/epl-v10.html". +#* +#* Initial Contributors: +#* Nokia Corporation - initial contribution. +#* +#* Contributors: +#* +#* Description: +#* +#*/ +TEMPLATE = lib +TARGET = glxtvoutwrapper +DEPENDPATH += . inc src +INCLUDEPATH += . ../../inc \ + ../../../inc \ + ../tvoutengine/inc \ + ../../ui/inc + +CONFIG += hb +LIBS += -lglxtvout.dll \ + +DEFINES += BUILD_TVOUTWRAPPER + +symbian: { +INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE +TARGET.UID3 = 0x2000A772 +TARGET.CAPABILITY = ALL -TCB +TARGET.EPOCALLOWDLLDATA = 1 +} +# Input +HEADERS += inc/glxtvoutwrapper.h \ + inc/glxtvoutwrapper_p.h \ + inc/glxtvconnectionobserver.h + +SOURCES += src/glxtvoutwrapper.cpp \ + src/glxtvoutwrapper_p.cpp \ + src/glxtvconnectionobserver.cpp + +DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT \ No newline at end of file diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/bwins/glxcommoncommandhandlersu.def --- a/ui/commandhandlers/bwins/glxcommoncommandhandlersu.def Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/bwins/glxcommoncommandhandlersu.def Mon May 03 12:31:32 2010 +0300 @@ -66,4 +66,11 @@ ??1GlxCommandHandlerDelete@@UAE@XZ @ 65 NONAME ; GlxCommandHandlerDelete::~GlxCommandHandlerDelete(void) ??0GlxCommandHandlerRotate@@QAE@XZ @ 66 NONAME ; GlxCommandHandlerRotate::GlxCommandHandlerRotate(void) ?qt_metacast@GlxCommandHandlerAddToContainer@@UAEPAXPBD@Z @ 67 NONAME ; void * GlxCommandHandlerAddToContainer::qt_metacast(char const *) + ??0GlxCommandHandlerRename@@QAE@XZ @ 68 NONAME ; GlxCommandHandlerRename::GlxCommandHandlerRename(void) + ?GetName@GlxCommandHandlerRename@@ABE?AVQString@@AAVMGlxMediaList@@@Z @ 69 NONAME ; class QString GlxCommandHandlerRename::GetName(class MGlxMediaList &) const + ?CreateCommandL@GlxCommandHandlerRename@@UBEPAVCMPXMedia@@HAAVMGlxMediaList@@AAH@Z @ 70 NONAME ; class CMPXMedia * GlxCommandHandlerRename::CreateCommandL(int, class MGlxMediaList &, int &) const + ?CompletionTextL@GlxCommandHandlerRename@@EBE?AVQString@@XZ @ 71 NONAME ; class QString GlxCommandHandlerRename::CompletionTextL(void) const + ??1GlxCommandHandlerRename@@UAE@XZ @ 72 NONAME ; GlxCommandHandlerRename::~GlxCommandHandlerRename(void) + ??_EGlxCommandHandlerRename@@UAE@I@Z @ 73 NONAME ; GlxCommandHandlerRename::~GlxCommandHandlerRename(unsigned int) + ?HandleErrorL@GlxCommandHandlerRename@@EAEXH@Z @ 74 NONAME ; void GlxCommandHandlerRename::HandleErrorL(int) diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commandhandlerbase/src/glxmpxcommandhandler.cpp --- a/ui/commandhandlers/commandhandlerbase/src/glxmpxcommandhandler.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/commandhandlerbase/src/glxmpxcommandhandler.cpp Mon May 03 12:31:32 2010 +0300 @@ -32,6 +32,7 @@ #include #include +#include #include #include #include "OstTraceDefinitions.h" @@ -365,9 +366,7 @@ QString qtText = QString::fromUtf16(text.Ptr(), text.Length()); - HbMessageBox box(HbMessageBox::MessageTypeInformation); - box.setText(qtText); - box.exec(); + HbNotificationDialog::launchDialog(qtText); CleanupStack::PopAndDestroy(textresolver); OstTraceFunctionExit0( GLXMPXCOMMANDHANDLER_HANDLEERRORL_EXIT ); } @@ -377,7 +376,7 @@ QString displayText = CompletionTextL(); if (!displayText.isNull()) { - HbMessageBox::information(displayText); + HbNotificationDialog::launchDialog(displayText); } } diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/commoncommandhandlers.pro --- a/ui/commandhandlers/commoncommandhandlers/commoncommandhandlers.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/commoncommandhandlers/commoncommandhandlers.pro Mon May 03 12:31:32 2010 +0300 @@ -50,9 +50,9 @@ -lglxmedialists.dll \ -lglxcommonui.dll \ -lshareui.dll \ - -lexiflib.dll \ - -lfbscli.dll \ - -lbafl.dll + -lexiflib.dll \ + -lfbscli.dll \ + -lbafl.dll # Input HEADERS += inc/glxcommandhandlerdelete.h @@ -61,7 +61,8 @@ HEADERS += inc/glxcommandhandlerrotate.h HEADERS += inc/glxcommandhandlersend.h HEADERS += inc/glxcommandhandlerremovefrom.h - +HEADERS += inc/glxcommandhandlerrename.h +HEADERS += inc/glxcommondialogs.h SOURCES += src/glxcommandhandlerdelete.cpp SOURCES += src/glxcommandhandleraddtocontainer.cpp @@ -69,7 +70,8 @@ SOURCES += src/glxcommandhandlerrotate.cpp SOURCES += src/glxcommandhandlersend.cpp SOURCES += src/glxcommandhandlerremovefrom.cpp - +SOURCES += src/glxcommandhandlerrename.cpp +SOURCES += src/glxcommondialogs.cpp DEFINES += QT_NO_DEBUG_OUTPUT QT_NO_WARNING_OUTPUT diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/inc/glxcommandhandlernewmedia.h --- a/ui/commandhandlers/commoncommandhandlers/inc/glxcommandhandlernewmedia.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/commoncommandhandlers/inc/glxcommandhandlernewmedia.h Mon May 03 12:31:32 2010 +0300 @@ -78,20 +78,6 @@ }; -class GlxTextInputDialog : public QObject -{ - Q_OBJECT -public: - GlxTextInputDialog(); - ~GlxTextInputDialog(); - QString getText(const QString &label,const QString &text = QString(),bool *ok = 0); - -public slots: - void textChanged(const QString &text); - -private: - HbInputDialog* mDialog; -}; #endif // GLXCOMMANDHANDLERNEWMEDIA_H diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/inc/glxcommandhandlerrename.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/commandhandlers/commoncommandhandlers/inc/glxcommandhandlerrename.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 GLXCOMMANDHANDLERRENAME_H +#define GLXCOMMANDHANDLERRENAME_H + +#include + +#ifdef BUILD_COMMONCOMMANDHANDLERS +#define GLX_COMMONCOMMANDHANDLERS_EXPORT Q_DECL_EXPORT +#else +#define GLX_COMMONCOMMANDHANDLERS_EXPORT Q_DECL_IMPORT +#endif + + +class GLX_COMMONCOMMANDHANDLERS_EXPORT GlxCommandHandlerRename : public GlxMpxCommandHandler + { +public: + GlxCommandHandlerRename(); + ~GlxCommandHandlerRename(); + CMPXCommand* CreateCommandL(TInt aCommandId, MGlxMediaList& aMediaList, TBool& aConsume) const ; +private: + QString CompletionTextL() const; + QString GetName(MGlxMediaList& aMediaList) const; + void HandleErrorL(TInt aErrorCode); + }; + +#endif // GLXCOMMANDHANDLERRENAME_H diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/inc/glxcommondialogs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/commandhandlers/commoncommandhandlers/inc/glxcommondialogs.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 GLXCOMMONDIALOGS_H +#define GLXCOMMONDIALOGS_H + +#include + +#include + +class GlxTextInputDialog : public QObject +{ + Q_OBJECT +public: + GlxTextInputDialog(); + ~GlxTextInputDialog(); + QString getText(const QString &label,const QString &text = QString(),bool *ok = 0); + +public slots: + void textChanged(const QString &text); + +private: + HbInputDialog* mDialog; +}; + +#endif // GLXCOMMONDIALOGS_H diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/src/glxcommandhandleraddtocontainer.cpp --- a/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandleraddtocontainer.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandleraddtocontainer.cpp Mon May 03 12:31:32 2010 +0300 @@ -37,6 +37,8 @@ #include #include +#include "glxlocalisationstrings.h" + #include "OstTraceDefinitions.h" #ifdef OST_TRACE_COMPILER_IN_USE #include "glxcommandhandleraddtocontainerTraces.h" @@ -46,6 +48,7 @@ TInt GlxCommandHandlerAddToContainer::iSelectionCount = 0; const TInt KSelectionPopupListHierarchy = 5; +const TInt KListPrefferedHeight = 400; GlxQueryContentWidget::GlxQueryContentWidget(QGraphicsItem* parent) : QGraphicsWidget(parent), mButton(0), mListView(0), mGrid(0) @@ -57,6 +60,7 @@ mButton = new HbPushButton("New Item"); mListView = new HbListView(this); mListView->setSelectionMode(HbAbstractItemView::MultiSelection); + mListView->setPreferredHeight(KListPrefferedHeight); mGrid->addItem(mButton, 0, 0); mGrid->addItem(mListView, 1, 0); @@ -150,6 +154,10 @@ CleanupStack::Pop(command); mNewMediaAdded = false; } + else + { + MGlxMediaList::UnmarkAllL(aMediaList); + } MGlxMediaList::UnmarkAllL(*targetMediaList); targetMediaList->Close(); @@ -181,10 +189,10 @@ connect(view->mButton, SIGNAL(released ()), this, SLOT(createNewMedia())); - HbAction *primary = new HbAction("OK"); + HbAction *primary = new HbAction(GLX_BUTTON_OK); popup.setPrimaryAction(primary); - HbAction *secondary = new HbAction("Cancel"); + HbAction *secondary = new HbAction(GLX_BUTTON_CANCEL); popup.setSecondaryAction(secondary); popup.setContentWidget(view); //ownership transfer @@ -257,7 +265,7 @@ QString GlxCommandHandlerAddToContainer::CompletionTextL() const { - return QString("Item added!"); + return QString(); } QString GlxCommandHandlerAddToContainer::ProgressTextL() const diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdelete.cpp --- a/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdelete.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerdelete.cpp Mon May 03 12:31:32 2010 +0300 @@ -54,7 +54,7 @@ QString GlxCommandHandlerDelete::CompletionTextL() const { - return QString("Item deleted!"); + return QString(); } QString GlxCommandHandlerDelete::ProgressTextL() const diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp --- a/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlernewmedia.cpp Mon May 03 12:31:32 2010 +0300 @@ -24,7 +24,7 @@ #include #include #include - +#include #include #include #include @@ -34,60 +34,6 @@ #endif #include -GlxTextInputDialog::GlxTextInputDialog() - { - } - -GlxTextInputDialog::~GlxTextInputDialog() - { - } - -QString GlxTextInputDialog::getText(const QString &label, - const QString &text, bool *ok) - { - mDialog = new HbInputDialog(); - mDialog->setPromptText(label); - mDialog->setInputMode(HbInputDialog::TextInput); - mDialog->setValue(text); - connect(mDialog->lineEdit(0), SIGNAL( textChanged (const QString &) ), - this, SLOT( textChanged (const QString &))); - HbAction* action = mDialog->exec(); - QString retText = NULL; - if (action == mDialog->secondaryAction()) - { //Cancel was pressed - if (ok) - { - *ok = false; - } - } - else - { //OK was pressed - if (ok) - { - *ok = true; - } - retText = mDialog->value().toString().trimmed(); - } - disconnect(mDialog->lineEdit(0), SIGNAL( textChanged (const QString &) ), - this, SLOT( textChanged (const QString &))); - delete mDialog; - mDialog = NULL; - return retText; - } - -void GlxTextInputDialog::textChanged(const QString &text) - { - if (text.trimmed().isEmpty()) - { - mDialog->primaryAction()->setEnabled(false); - } - else - { - mDialog->primaryAction()->setEnabled(true); - } - } - - GlxCommandHandlerNewMedia::GlxCommandHandlerNewMedia() : iNewMediaCreationError(KErrNone), iNewMediaItemTitle(0) , mShowConfirmation(false) { @@ -334,10 +280,6 @@ QString GlxCommandHandlerNewMedia::CompletionTextL() const { - if (!mShowConfirmation) - { - return QString("Album added"); - } return QString(); } diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerremovefrom.cpp --- a/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerremovefrom.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerremovefrom.cpp Mon May 03 12:31:32 2010 +0300 @@ -56,7 +56,7 @@ QString GlxCommandHandlerRemoveFrom::CompletionTextL() const { - return QString("Item removed!"); + return QString(); } QString GlxCommandHandlerRemoveFrom::ProgressTextL() const diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrename.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrename.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,160 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 +#include +#include +#include +#include +#include +#include + +GlxCommandHandlerRename::GlxCommandHandlerRename() + { + } + +GlxCommandHandlerRename::~GlxCommandHandlerRename() + { + } + +CMPXCommand* GlxCommandHandlerRename::CreateCommandL(TInt aCommandId, + MGlxMediaList& aMediaList, TBool& aConsume) const + { + Q_UNUSED(aCommandId); + Q_UNUSED(aConsume); + + CMPXCommand* command = NULL; + QString mainPane = GetName(aMediaList); + QString title("Rename"); + QString mediaTitle = NULL; + bool ok = false; + GlxTextInputDialog* dlg = new GlxTextInputDialog(); + mediaTitle = dlg->getText(title, mainPane, &ok); + delete dlg; + + if(ok == true) + { + TPtrC16 newMediaItemTitleDes + = (reinterpret_cast (mediaTitle.utf16())); + + HBufC* newMediaItemTitle = newMediaItemTitleDes.Alloc(); + CleanupStack::PushL(newMediaItemTitle); + + CMPXCollectionPath* path = aMediaList.PathLC( + NGlxListDefs::EPathFocusOrSelection); + command = + TGlxCommandFactory::RenameCommandLC(*newMediaItemTitle,*path); + CleanupStack::Pop(command); + CleanupStack::PopAndDestroy(path); + CleanupStack::PopAndDestroy(newMediaItemTitle); + } + return command; + } + +QString GlxCommandHandlerRename::CompletionTextL() const + { + //return command completion text + return QString(); + } + +QString GlxCommandHandlerRename::GetName(MGlxMediaList& aMediaList) const + { + // Create an iterator to retrieve the relevant attribute + TGlxSelectionIterator iterator; + // only want the title of one item + iterator.SetRange( 1 ); + CGlxAttributeContext* context = new( ELeave ) + CGlxAttributeContext( &iterator ); + CleanupStack::PushL( context ); + + // Want to read the title attribute + // Configure the context + context->AddAttributeL( KMPXMediaGeneralTitle ); + + // Add the context to the media list + aMediaList.AddContextL( context, KGlxFetchContextPriorityBlocking ); + + // TGlxContextRemover will remove the context when it goes out of scope + // Used here to avoid a trap and still have safe cleanup + TGlxFetchContextRemover contextRemover( context, aMediaList ); + // put to cleanupstack as cleanupstack is emptied before stack objects + // are deleted + CleanupClosePushL( contextRemover ); + // Yuck - a leave and a return code! + // EFalse => don't show a progress dialog + TInt err = GlxAttributeRetriever::RetrieveL( *context, aMediaList, EFalse ); + // Using a distinct error value as "LeaveIfError( FuncL() );" looks bad + User::LeaveIfError( err ); + // context off the list + CleanupStack::PopAndDestroy( &contextRemover ); + + // Now get the title of the relevant item: if *an* item is selected use its + // title, otherwise use the item with focus + // Get the index of the item to rename + TInt index = KErrNotFound; + QString title = NULL; + // first see if there's a selected item... + if ( aMediaList.SelectionCount() == 1 ) + { + // Find the index of the selected item + index = aMediaList.Count(); + do + { + --index; + } + while ( !aMediaList.IsSelected( index ) && index > 0 ); + } + else + { + // Use the index of the item with focus + index = aMediaList.FocusIndex(); + } + + if ( index != KErrNotFound ) + { + // use iterator to get the right item + iterator.SetToFirst( &aMediaList ); + const CGlxMedia* media = aMediaList.Item( iterator++ ).Properties(); + if( media ) + { + // found the item's media properties, extract the title + const TDesC& titleDesc = media->ValueText(KMPXMediaGeneralTitle); + title = QString::fromUtf16(titleDesc.Ptr(), + titleDesc.Length()); + } + } + CleanupStack::PopAndDestroy( context ); + + return title; + } + +void GlxCommandHandlerRename::HandleErrorL(TInt aErrorCode) + { + if(aErrorCode == KErrAlreadyExists) + { + HbMessageBox::warning("Name Already Exist!!!", new HbLabel( + "Rename")); + } + else{ + GlxMpxCommandHandler::HandleErrorL(aErrorCode); + } + } + diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrotate.cpp --- a/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrotate.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommandhandlerrotate.cpp Mon May 03 12:31:32 2010 +0300 @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include "OstTraceDefinitions.h" #ifdef OST_TRACE_COMPILER_IN_USE diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/commoncommandhandlers/src/glxcommondialogs.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/commandhandlers/commoncommandhandlers/src/glxcommondialogs.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 + +GlxTextInputDialog::GlxTextInputDialog() + { + } + +GlxTextInputDialog::~GlxTextInputDialog() + { + } + +QString GlxTextInputDialog::getText(const QString &label, + const QString &text, bool *ok) + { + mDialog = new HbInputDialog(); + mDialog->setPromptText(label); + mDialog->setInputMode(HbInputDialog::TextInput); + mDialog->setValue(text); + connect(mDialog->lineEdit(0), SIGNAL( textChanged (const QString &) ), + this, SLOT( textChanged (const QString &))); + HbAction* action = mDialog->exec(); + QString retText = NULL; + if (action == mDialog->secondaryAction()) + { //Cancel was pressed + if (ok) + { + *ok = false; + } + } + else + { //OK was pressed + if (ok) + { + *ok = true; + } + retText = mDialog->value().toString().trimmed(); + } + disconnect(mDialog->lineEdit(0), SIGNAL( textChanged (const QString &) ), + this, SLOT( textChanged (const QString &))); + delete mDialog; + mDialog = NULL; + return retText; + } + +void GlxTextInputDialog::textChanged(const QString &text) + { + if (text.trimmed().isEmpty()) + { + mDialog->primaryAction()->setEnabled(false); + } + else + { + mDialog->primaryAction()->setEnabled(true); + } + } diff -r 99ad1390cd33 -r c499df2dbb33 ui/commandhandlers/eabi/glxcommoncommandhandlersu.def --- a/ui/commandhandlers/eabi/glxcommoncommandhandlersu.def Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/commandhandlers/eabi/glxcommoncommandhandlersu.def Mon May 03 12:31:32 2010 +0300 @@ -84,4 +84,15 @@ _ZTV31GlxCommandHandlerAddToContainer @ 83 NONAME _ZThn8_N25GlxCommandHandlerNewMedia11HandleErrorEi @ 84 NONAME _ZThn8_N25GlxCommandHandlerNewMedia16HandleItemAddedLEiiP13MGlxMediaList @ 85 NONAME + _ZN23GlxCommandHandlerRenameC1Ev @ 86 NONAME + _ZN23GlxCommandHandlerRenameC2Ev @ 87 NONAME + _ZN23GlxCommandHandlerRenameD0Ev @ 88 NONAME + _ZN23GlxCommandHandlerRenameD1Ev @ 89 NONAME + _ZN23GlxCommandHandlerRenameD2Ev @ 90 NONAME + _ZNK23GlxCommandHandlerRename14CreateCommandLEiR13MGlxMediaListRi @ 91 NONAME + _ZNK23GlxCommandHandlerRename15CompletionTextLEv @ 92 NONAME + _ZNK23GlxCommandHandlerRename7GetNameER13MGlxMediaList @ 93 NONAME + _ZTI23GlxCommandHandlerRename @ 94 NONAME + _ZTV23GlxCommandHandlerRename @ 95 NONAME + _ZN23GlxCommandHandlerRename12HandleErrorLEi @ 96 NONAME diff -r 99ad1390cd33 -r c499df2dbb33 ui/inc/glxcommandhandlers.hrh --- a/ui/inc/glxcommandhandlers.hrh Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/inc/glxcommandhandlers.hrh Mon May 03 12:31:32 2010 +0300 @@ -110,6 +110,7 @@ EGlxCmdContextDelete, EGlxCmdContextAlbumDelete, EGlxCmdContextSend, + EGlxCmdContextRename, EGlxCmdSetupItem, EGlxCmdAiwBase = 0x6000 }; diff -r 99ad1390cd33 -r c499df2dbb33 ui/inc/glxicondefs.h --- a/ui/inc/glxicondefs.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/inc/glxicondefs.h Mon May 03 12:31:32 2010 +0300 @@ -22,9 +22,10 @@ //FULLSCREEN TOOLBAR -#define GLXICON_FLIP "qtg_mono_info" -#define GLXICON_SEND "qtg_mono_send" -#define GLXICON_DELETE "qtg_mono_delete" +#define GLXICON_FLIP "qtg_mono_info" +#define GLXICON_SEND "qtg_mono_send" +#define GLXICON_DELETE "qtg_mono_delete" +#define GLXICON_USEIMAGE "qtg_small_ovi" //GRID TOOLBAR #define GLXICON_ALL "qtg_mono_photos_all" diff -r 99ad1390cd33 -r c499df2dbb33 ui/inc/glxmodelparm.h --- a/ui/inc/glxmodelparm.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/inc/glxmodelparm.h Mon May 03 12:31:32 2010 +0300 @@ -35,6 +35,7 @@ GlxDateRole, //to get the image created or modified date GlxFrameCount, //to get the number of frame in an image GlxSubStateRole, //to publish the sub state of a SM states + GlxHdmiBitmap, //to get the pre decoded thumbnail for HDMI }; diff -r 99ad1390cd33 -r c499df2dbb33 ui/inc/glxviewids.h --- a/ui/inc/glxviewids.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/inc/glxviewids.h Mon May 03 12:31:32 2010 +0300 @@ -25,6 +25,7 @@ #define GLX_FULLSCREENVIEW_ID 0x12121214 #define GLX_SLIDESHOWVIEW_ID 0x12121215 #define GLX_DETAILSVIEW_ID 0x12121216 +#define GLX_SLIDESHOWSETTINGSVIEW_ID 0x12121217 typedef enum @@ -38,7 +39,8 @@ { NO_FULLSCREEN_S, EXTERNAL_S, - IMAGEVIEWER_S + IMAGEVIEWER_S, + FETCHER_S } FullScreenState; typedef enum diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/bwins/glxmedialistwrapperu.def --- a/ui/uiengine/bwins/glxmedialistwrapperu.def Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/bwins/glxmedialistwrapperu.def Mon May 03 12:31:32 2010 +0300 @@ -32,8 +32,9 @@ ??0GlxMLWrapper@@QAE@HHW4TGlxFilterItemType@@@Z @ 31 NONAME ; GlxMLWrapper::GlxMLWrapper(int, int, enum TGlxFilterItemType) ?setContextMode@GlxMLWrapper@@QAEXW4GlxContextMode@@@Z @ 32 NONAME ; void GlxMLWrapper::setContextMode(enum GlxContextMode) ??1GlxMLWrapper@@UAE@XZ @ 33 NONAME ; GlxMLWrapper::~GlxMLWrapper(void) - ?qt_metacast@GlxMLWrapper@@UAEPAXPBD@Z @ 34 NONAME ; void * GlxMLWrapper::qt_metacast(char const *) - ?setSelectedIndex@GlxMLWrapper@@QAEXH@Z @ 35 NONAME ; void GlxMLWrapper::setSelectedIndex(int) - ?itemsAdded@GlxMLWrapper@@QAEXHH@Z @ 36 NONAME ; void GlxMLWrapper::itemsAdded(int, int) - ?retrieveItemIcon@GlxMLWrapper@@QAEPAVHbIcon@@HW4GlxTBContextType@@@Z @ 37 NONAME ; class HbIcon * GlxMLWrapper::retrieveItemIcon(int, enum GlxTBContextType) + ?RetrieveBitmap@GlxMLWrapper@@QAE?AVQVariant@@H@Z @ 34 NONAME ; class QVariant GlxMLWrapper::RetrieveBitmap(int) + ?qt_metacast@GlxMLWrapper@@UAEPAXPBD@Z @ 35 NONAME ; void * GlxMLWrapper::qt_metacast(char const *) + ?setSelectedIndex@GlxMLWrapper@@QAEXH@Z @ 36 NONAME ; void GlxMLWrapper::setSelectedIndex(int) + ?itemsAdded@GlxMLWrapper@@QAEXHH@Z @ 37 NONAME ; void GlxMLWrapper::itemsAdded(int, int) + ?retrieveItemIcon@GlxMLWrapper@@QAEPAVHbIcon@@HW4GlxTBContextType@@@Z @ 38 NONAME ; class HbIcon * GlxMLWrapper::retrieveItemIcon(int, enum GlxTBContextType) diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/eabi/glxmedialistwrapperu.def --- a/ui/uiengine/eabi/glxmedialistwrapperu.def Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/eabi/glxmedialistwrapperu.def Mon May 03 12:31:32 2010 +0300 @@ -9,30 +9,31 @@ _ZN12GlxMLWrapper12itemsRemovedEii @ 8 NONAME _ZN12GlxMLWrapper13itemCorruptedEi @ 9 NONAME _ZN12GlxMLWrapper13setFocusIndexEi @ 10 NONAME - _ZN12GlxMLWrapper14setContextModeE14GlxContextMode @ 11 NONAME - _ZN12GlxMLWrapper15retrieveItemUriEi @ 12 NONAME - _ZN12GlxMLWrapper16retrieveItemDateEi @ 13 NONAME - _ZN12GlxMLWrapper16retrieveItemIconEi16GlxTBContextType @ 14 NONAME - _ZN12GlxMLWrapper16setSelectedIndexEi @ 15 NONAME - _ZN12GlxMLWrapper16staticMetaObjectE @ 16 NONAME DATA 16 - _ZN12GlxMLWrapper17handleIconCorruptEi @ 17 NONAME - _ZN12GlxMLWrapper17retrieveListTitleEi @ 18 NONAME - _ZN12GlxMLWrapper18handleGeneralErrorEi @ 19 NONAME - _ZN12GlxMLWrapper18handleReceivedIconEi16GlxTBContextType @ 20 NONAME - _ZN12GlxMLWrapper19getStaticMetaObjectEv @ 21 NONAME - _ZN12GlxMLWrapper20retrieveListSubTitleEi @ 22 NONAME - _ZN12GlxMLWrapper21getVisibleWindowIndexEv @ 23 NONAME - _ZN12GlxMLWrapper21retrieveItemDimensionEi @ 24 NONAME - _ZN12GlxMLWrapper21setVisibleWindowIndexEi @ 25 NONAME - _ZN12GlxMLWrapper22retrieveItemFrameCountEi @ 26 NONAME - _ZN12GlxMLWrapper23handleListItemAvailableEi @ 27 NONAME - _ZN12GlxMLWrapperC1Eii18TGlxFilterItemType @ 28 NONAME - _ZN12GlxMLWrapperC2Eii18TGlxFilterItemType @ 29 NONAME - _ZN12GlxMLWrapperD0Ev @ 30 NONAME - _ZN12GlxMLWrapperD1Ev @ 31 NONAME - _ZN12GlxMLWrapperD2Ev @ 32 NONAME - _ZNK12GlxMLWrapper10metaObjectEv @ 33 NONAME - _ZNK12GlxMLWrapper13getFocusIndexEv @ 34 NONAME - _ZTI12GlxMLWrapper @ 35 NONAME - _ZTV12GlxMLWrapper @ 36 NONAME + _ZN12GlxMLWrapper14RetrieveBitmapEi @ 11 NONAME + _ZN12GlxMLWrapper14setContextModeE14GlxContextMode @ 12 NONAME + _ZN12GlxMLWrapper15retrieveItemUriEi @ 13 NONAME + _ZN12GlxMLWrapper16retrieveItemDateEi @ 14 NONAME + _ZN12GlxMLWrapper16retrieveItemIconEi16GlxTBContextType @ 15 NONAME + _ZN12GlxMLWrapper16setSelectedIndexEi @ 16 NONAME + _ZN12GlxMLWrapper16staticMetaObjectE @ 17 NONAME DATA 16 + _ZN12GlxMLWrapper17handleIconCorruptEi @ 18 NONAME + _ZN12GlxMLWrapper17retrieveListTitleEi @ 19 NONAME + _ZN12GlxMLWrapper18handleGeneralErrorEi @ 20 NONAME + _ZN12GlxMLWrapper18handleReceivedIconEi16GlxTBContextType @ 21 NONAME + _ZN12GlxMLWrapper19getStaticMetaObjectEv @ 22 NONAME + _ZN12GlxMLWrapper20retrieveListSubTitleEi @ 23 NONAME + _ZN12GlxMLWrapper21getVisibleWindowIndexEv @ 24 NONAME + _ZN12GlxMLWrapper21retrieveItemDimensionEi @ 25 NONAME + _ZN12GlxMLWrapper21setVisibleWindowIndexEi @ 26 NONAME + _ZN12GlxMLWrapper22retrieveItemFrameCountEi @ 27 NONAME + _ZN12GlxMLWrapper23handleListItemAvailableEi @ 28 NONAME + _ZN12GlxMLWrapperC1Eii18TGlxFilterItemType @ 29 NONAME + _ZN12GlxMLWrapperC2Eii18TGlxFilterItemType @ 30 NONAME + _ZN12GlxMLWrapperD0Ev @ 31 NONAME + _ZN12GlxMLWrapperD1Ev @ 32 NONAME + _ZN12GlxMLWrapperD2Ev @ 33 NONAME + _ZNK12GlxMLWrapper10metaObjectEv @ 34 NONAME + _ZNK12GlxMLWrapper13getFocusIndexEv @ 35 NONAME + _ZTI12GlxMLWrapper @ 36 NONAME + _ZTV12GlxMLWrapper @ 37 NONAME diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/medialists/inc/glxcachemanager.h --- a/ui/uiengine/medialists/inc/glxcachemanager.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/medialists/inc/glxcachemanager.h Mon May 03 12:31:32 2010 +0300 @@ -55,8 +55,7 @@ */ class CGlxCacheManager : public CBase, public MGlxCache, - public MGlxMediaPool, - public MImageReadyCallBack + public MGlxMediaPool #ifdef USE_S60_TNM , public MThumbnailManagerObserver #endif @@ -183,9 +182,6 @@ void StopRAMReleaseL(); //OOM void ForceCleanupMedia(TGlxIdSpaceId aSpaceId,TGlxMediaId aId); - -public: - void ImageSizeReady(TInt aError, const TSize aSz); private: /** @@ -362,11 +358,6 @@ RArray iRequestedItemIndexes; CGlxImageReader* iReader; - TSize iImgSz; - /** - * Active scheduler wait object. (Owned) - */ - CActiveSchedulerWait* iSchedulerWait; #ifdef USE_S60_TNM CThumbnailManager* iTnEngine; // Own CMPXMedia* iMPXMedia; diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/medialists/inc/glximagereader.h --- a/ui/uiengine/medialists/inc/glximagereader.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/medialists/inc/glximagereader.h Mon May 03 12:31:32 2010 +0300 @@ -24,52 +24,30 @@ class CFbsBitmap; /** - * Image Size observer. - * - * Callback interface for getting size information of a given image. - */ -class MImageReadyCallBack - { -public: - /** - * Getting image size information is complete. - * - * @param aError Error code. - * @param aSz Size of the image. - */ - virtual void ImageSizeReady(TInt aError, const TSize aSz) = 0; - }; - -/** * CGlxImageReader * * Image Attributes Reader * * @lib glxmedialists.lib */ -class CGlxImageReader : public CActive +class CGlxImageReader : public CBase { private: - static CGlxImageReader* NewLC(MImageReadyCallBack& aNotify); - CGlxImageReader(MImageReadyCallBack& aNotify); + static CGlxImageReader* NewLC(); + CGlxImageReader(); void ConstructL(); - void GetFileTypeL(TDataType aMimeType); -protected: - void DoCancel(); - void RunL(); - public: - static CGlxImageReader* NewL(MImageReadyCallBack& aNotify); + static CGlxImageReader* NewL(); ~CGlxImageReader(); TInt GetDRMRightsL(TInt aAttribute); + TInt GetFrameCount(); + TSize GetDimensions(); private: - MImageReadyCallBack& iNotify; CImageDecoder* iImageDecoder; - CFbsBitmap* iFrame; CGlxImageViewerManager* iImgViewerMgr; }; diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/medialists/src/glxcachemanager.cpp --- a/ui/uiengine/medialists/src/glxcachemanager.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/medialists/src/glxcachemanager.cpp Mon May 03 12:31:32 2010 +0300 @@ -116,7 +116,6 @@ iGarbageCollector = CGlxGarbageCollector::NewL( iCaches ); iTempErrorTimer = CPeriodic::NewL(CActive::EPriorityStandard); - iSchedulerWait = new (ELeave) CActiveSchedulerWait(); iMaintainCacheCallback = new ( ELeave ) CAsyncCallBack( TCallBack( MaintainCacheL, this ), CActive::EPriorityStandard ); @@ -134,7 +133,6 @@ { TRACER("CGlxCacheManager::Destructor"); - delete iSchedulerWait; iObserverList.ResetAndDestroy(); iCaches.ResetAndDestroy(); delete iTempThumbnail; @@ -779,20 +777,16 @@ iRequestOwner = list; CleanupStack::PopAndDestroy(attrSpecs); TGlxIdSpaceId spaceId = list->IdSpaceId(iRequestedItemIndexes[0]); - HandleCollectionMediaL(spaceId, *iMPXMedia, KErrArgument); + HandleCollectionMediaL(spaceId, *iMPXMedia, errInImage); CleanupStack::PopAndDestroy(imageVwrMgr); return; } if(!iReader) { - TRAP(errInImage,iReader = CGlxImageReader::NewL(*this)); - if(errInImage == KErrNone) - { - iSchedulerWait->Start(); - } + TRAP(errInImage, iReader = CGlxImageReader::NewL()); } - + for ( TInt i = 0; i < iRequestedAttrs.Count(); i++ ) { if ( iRequestedAttrs[i] == KMPXMediaGeneralId ) @@ -932,21 +926,29 @@ } else if ( iRequestedAttrs[i] == KGlxMediaGeneralDimensions ) { + TSize dimensions = TSize(); if(errInImage == KErrNone) { //need to fetch the original file dimensions - TSize dimensions(iImgSz.iWidth,iImgSz.iHeight); + if(errInImage == KErrNone) + { + dimensions = iReader->GetDimensions(); + } iMPXMedia->SetTObjectValueL(KGlxMediaGeneralDimensions, dimensions); } else { - TSize dimensions(0,0); iMPXMedia->SetTObjectValueL(KGlxMediaGeneralDimensions, dimensions); } } else if ( iRequestedAttrs[i] == KGlxMediaGeneralFramecount ) { TInt fcount = 1; + if(errInImage == KErrNone) + { + fcount = iReader->GetFrameCount(); + } + GLX_DEBUG2("Imageviewer Collection framecount(%d)", fcount); iMPXMedia->SetTObjectValueL(KGlxMediaGeneralFramecount, fcount); } else if ( iRequestedAttrs[i] == KMPXMediaGeneralComment ) @@ -1546,23 +1548,5 @@ CleanupStack::PopAndDestroy(&session); } -// ----------------------------------------------------------------------------- -// ImageSizeReady() -// ----------------------------------------------------------------------------- -// -void CGlxCacheManager::ImageSizeReady(TInt aError, const TSize aSz) - { - TRACER("CGlxCacheManager::ImageSizeReady"); - GLX_DEBUG2("CGlxCacheManager::ImageSizeReady aError=%d", aError); - iImgSz = TSize(); - if(iSchedulerWait) - { - iSchedulerWait->AsyncStop(); - } - - iImgSz = aSz; - GLX_DEBUG3("CGlxCacheManager::ImageSizeReady() iImgSz w(%d) h(%d)", - iImgSz.iWidth, iImgSz.iHeight); - } //End of file diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/medialists/src/glximagereader.cpp --- a/ui/uiengine/medialists/src/glximagereader.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/medialists/src/glximagereader.cpp Mon May 03 12:31:32 2010 +0300 @@ -28,16 +28,17 @@ #include "glximagereader.h" +const TInt KDefaultFrameCount = 1; // --------------------------------------------------------- // CGlxImageReader::NewL // --------------------------------------------------------- // -CGlxImageReader* CGlxImageReader::NewL(MImageReadyCallBack& aNotify) +CGlxImageReader* CGlxImageReader::NewL() { TRACER("CGlxImageReader::NewL"); - CGlxImageReader* self = CGlxImageReader::NewLC( aNotify); + CGlxImageReader* self = CGlxImageReader::NewLC(); CleanupStack::Pop(self); return self; } @@ -46,11 +47,11 @@ // CGlxImageReader::NewLC // --------------------------------------------------------- // -CGlxImageReader* CGlxImageReader::NewLC(MImageReadyCallBack& aNotify) +CGlxImageReader* CGlxImageReader::NewLC() { TRACER("CGlxImageReader::NewLC"); - CGlxImageReader* self = new(ELeave) CGlxImageReader(aNotify); + CGlxImageReader* self = new(ELeave) CGlxImageReader(); CleanupStack::PushL(self); self->ConstructL(); return self; @@ -60,8 +61,7 @@ // CGlxImageReader::CGlxImageReader // --------------------------------------------------------- // -CGlxImageReader::CGlxImageReader(MImageReadyCallBack& aNotify) -:CActive(0),iNotify(aNotify) +CGlxImageReader::CGlxImageReader() { //no implementation } @@ -75,15 +75,9 @@ TRACER("CGlxImageReader::~"); if(iImageDecoder) { - Cancel(); delete iImageDecoder; } - if(iFrame) - { - delete iFrame; - } - if(iImgViewerMgr) { iImgViewerMgr->Close(); @@ -98,8 +92,6 @@ { TRACER("CGlxImageReader::ConstructL"); - CActiveScheduler::Add(this); - iImgViewerMgr = CGlxImageViewerManager::InstanceL(); if (!iImgViewerMgr) { @@ -125,45 +117,8 @@ { User::Leave(errInImage); } - - if ( iImageDecoder ) - { - iFrame = new (ELeave) CFbsBitmap(); - iFrame->Create(iImageDecoder->FrameInfo(0).iOverallSizeInPixels, - iImageDecoder->FrameInfo(0).iFrameDisplayMode); - iImageDecoder->Convert(&iStatus, *iFrame, 0); - SetActive(); - } } - -// --------------------------------------------------------- -// CGlxImageReader::DoCancel -// --------------------------------------------------------- -// -void CGlxImageReader::DoCancel() - { - TRACER("CGlxImageReader::DoCancel"); - iImageDecoder->Cancel(); - } - -// --------------------------------------------------------- -// CGlxImageReader::RunL -// --------------------------------------------------------- -// -void CGlxImageReader::RunL() - { - TRACER("CGlxImageReader::RunL"); - - TSize size = TSize(); - TInt reqStatus = iStatus.Int(); - if (reqStatus == KErrNone && iFrame) - { - size = iFrame->SizeInPixels(); - } - GLX_DEBUG2("CGlxImageReader::RunL() reqStatus=%d", reqStatus); - iNotify.ImageSizeReady(reqStatus, size); - } // --------------------------------------------------------- // CGlxImageReader::GetDRMRightsL // --------------------------------------------------------- @@ -209,3 +164,36 @@ } return value; } + +// --------------------------------------------------------- +// CGlxImageReader::GetFrameCount +// --------------------------------------------------------- +// +TInt CGlxImageReader::GetFrameCount() + { + TRACER("CGlxImageReader::GetFrameCount"); + TInt frameCount = KDefaultFrameCount; + if (iImageDecoder) + { + frameCount = iImageDecoder->FrameCount(); + } + GLX_DEBUG2("CGlxImageReader::GetFrameCount frameCount=%d", frameCount); + return frameCount; + } + +// --------------------------------------------------------- +// CGlxImageReader::GetDimensions +// --------------------------------------------------------- +// +TSize CGlxImageReader::GetDimensions() + { + TRACER("CGlxImageReader::GetDimensions"); + TSize size = TSize(); + if (iImageDecoder) + { + size = iImageDecoder->FrameInfo().iOverallSizeInPixels; + } + GLX_DEBUG3("CGlxImageReader::GetImageSize() size w(%d) h(%d)", + size.iWidth, size.iHeight); + return size; + } diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/medialists/src/glxmedialist.cpp --- a/ui/uiengine/medialists/src/glxmedialist.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/medialists/src/glxmedialist.cpp Mon May 03 12:31:32 2010 +0300 @@ -1091,7 +1091,9 @@ HandleItemModifiedL(itemId, attributes); CleanupStack::PopAndDestroy(&attributes); iManager->HandleWindowChangedL(this); - + //Fix for Bug 'ESLM-827JU8 Vasco w03':Dont 'ReOpenL()' in any case + //Side Effect: Does not reorder album list in case of renaming album (To be handled later). + break; // Drop through to perform sync, in case the order has changed } case EMPXItemInserted: diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/medialistwrapper/inc/glxmlwrapper.h --- a/ui/uiengine/medialistwrapper/inc/glxmlwrapper.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/medialistwrapper/inc/glxmlwrapper.h Mon May 03 12:31:32 2010 +0300 @@ -23,12 +23,16 @@ #include #include #include +#include #include #include +#include + #include //forward declarations class GlxMLWrapperPrivate; class HbIcon; +class CFbsBitmap; //constant declarations @@ -38,6 +42,7 @@ #define GLX_MLWRAPPER_EXPORT Q_DECL_IMPORT #endif +Q_DECLARE_METATYPE(CFbsBitmap*); class GLX_MLWRAPPER_EXPORT GlxMLWrapper : public QObject { @@ -82,7 +87,13 @@ QSize retrieveItemDimension(int index); QDate retrieveItemDate(int index); int retrieveItemFrameCount(int index); - + + /* + * retriveBitmap helps to retrive the bitmap + * @param1 index + */ + QVariant RetrieveBitmap(int index); + signals: void updateItem(int index, GlxTBContextType tbContextType); void insertItems(int startIndex,int endIndex); diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/medialistwrapper/inc/glxmlwrapper_p.h --- a/ui/uiengine/medialistwrapper/inc/glxmlwrapper_p.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/medialistwrapper/inc/glxmlwrapper_p.h Mon May 03 12:31:32 2010 +0300 @@ -106,7 +106,7 @@ QSize RetrieveItemDimension(int index); QDate RetrieveItemDate(int index); int RetrieveItemFrameCount(int aItemIndex); - + CFbsBitmap* RetrieveBitmap(int aItemIndex); private: diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/medialistwrapper/src/glxmlwrapper.cpp --- a/ui/uiengine/medialistwrapper/src/glxmlwrapper.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/medialistwrapper/src/glxmlwrapper.cpp Mon May 03 12:31:32 2010 +0300 @@ -109,9 +109,17 @@ } int GlxMLWrapper::retrieveItemFrameCount(int index) - { +{ return (mMLWrapperPrivate->RetrieveItemFrameCount(index)); - } +} + +QVariant GlxMLWrapper::RetrieveBitmap(int index) +{ + QVariant var; + var.setValue(mMLWrapperPrivate->RetrieveBitmap(index)); + return var; +} + // --------------------------------------------------------------------------- // getFocusIndex. // --------------------------------------------------------------------------- diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp --- a/ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/medialistwrapper/src/glxmlwrapper_p.cpp Mon May 03 12:31:32 2010 +0300 @@ -683,10 +683,59 @@ date = QDate(dateTime.Year(),TInt(dateTime.Month()+1),(dateTime.Day()+1)); } return date; - } // --------------------------------------------------------------------------- +// RetrieveFsBitmap +// --------------------------------------------------------------------------- +// +CFbsBitmap* GlxMLWrapperPrivate::RetrieveBitmap(int aItemIndex) + { + GLX_LOG_INFO1("GlxMLWrapperPrivate::RetrieveBitmap %d",aItemIndex); + const TGlxMedia& item = iMediaList->Item( aItemIndex ); + TMPXAttribute fsTnAttrib= TMPXAttribute(KGlxMediaIdThumbnail, + GlxFullThumbnailAttributeId(ETrue, KFullScreenTNPTWidth, + KFullScreenTNPTHeight)); + const CGlxThumbnailAttribute* fsTnValue = item.ThumbnailAttribute( + fsTnAttrib); + if (fsTnValue) + { + GLX_LOG_INFO("GlxMLWrapperPrivate::RetrieveBitmap - returning FS bitmap"); + CFbsBitmap* fsTnBitmap = new (ELeave) CFbsBitmap; + fsTnBitmap->Duplicate( fsTnValue->iBitmap->Handle()); + + GLX_LOG_INFO2("GlxMLWrapperPrivate::RetrieveBitmap - bitmap height=%d, bitmap width=%d", + fsTnBitmap->SizeInPixels().iHeight,fsTnBitmap->SizeInPixels().iWidth); + + return fsTnBitmap; + } + else // fetch grid Thumbnail + { + TMPXAttribute gridTnAttrib = TMPXAttribute(KGlxMediaIdThumbnail, + GlxFullThumbnailAttributeId(ETrue, KGridTNWIdth, + KGridTNHeight)); + const CGlxThumbnailAttribute* gridTnValue = item.ThumbnailAttribute( + gridTnAttrib); + if (gridTnValue) + { + GLX_LOG_INFO("GlxMLWrapperPrivate::RetrieveBitmap - returning Grid bitmap"); + CFbsBitmap* gridTnBitmap = new (ELeave) CFbsBitmap; + gridTnBitmap->Duplicate( gridTnValue->iBitmap->Handle()); + + GLX_LOG_INFO2("GlxMLWrapperPrivate::RetrieveBitmap - bitmap height=%d, bitmap width=%d", + gridTnBitmap->SizeInPixels().iHeight,gridTnBitmap->SizeInPixels().iWidth); + return gridTnBitmap; + } + else + { + GLX_LOG_INFO("GlxMLWrapperPrivate::RetrieveBitmap - returning default bitmap"); + CFbsBitmap* defaultBitmap = new (ELeave) CFbsBitmap; + return defaultBitmap; + } + } +} + +// --------------------------------------------------------------------------- // HandleItemAddedL // --------------------------------------------------------------------------- // diff -r 99ad1390cd33 -r c499df2dbb33 ui/uiengine/model/mediamodel/src/glxmediamodel.cpp --- a/ui/uiengine/model/mediamodel/src/glxmediamodel.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/uiengine/model/mediamodel/src/glxmediamodel.cpp Mon May 03 12:31:32 2010 +0300 @@ -152,6 +152,10 @@ //todo refactor this whole function ... too many return statements are not good QVariant GlxMediaModel::data(const QModelIndex &index, int role) const { + if ( role == GlxSubStateRole ) { + return mSubState; + } + HbIcon* itemIcon = NULL; int itemIndex = index.row(); qDebug("GlxMediaModel::data buffer concept index %d role %d", index.row(), role); @@ -232,8 +236,8 @@ return (mMLWrapper->retrieveItemFrameCount(itemIndex)); } - if ( role == GlxSubStateRole ) { - return mSubState; + if (role == GlxHdmiBitmap) { + return mMLWrapper->RetrieveBitmap(itemIndex); } return QVariant(); diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/bwins/glxviewmanageru.def --- a/ui/viewmanagement/bwins/glxviewmanageru.def Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/bwins/glxviewmanageru.def Mon May 03 12:31:32 2010 +0300 @@ -43,4 +43,5 @@ ?setupItems@GlxViewManager@@QAEXXZ @ 42 NONAME ABSENT ; void GlxViewManager::setupItems(void) ?launchApplication@GlxViewManager@@QAEXHPAVQAbstractItemModel@@@Z @ 43 NONAME ; void GlxViewManager::launchApplication(int, class QAbstractItemModel *) ?setupItems@GlxViewManager@@QAEXH@Z @ 44 NONAME ; void GlxViewManager::setupItems(int) + ?checkMarked@GlxViewManager@@AAEXXZ @ 45 NONAME ; void GlxViewManager::checkMarked(void) diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/eabi/glxviewmanageru.def --- a/ui/viewmanagement/eabi/glxviewmanageru.def Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/eabi/glxviewmanageru.def Mon May 03 12:31:32 2010 +0300 @@ -42,4 +42,5 @@ _ZNK14GlxViewManager11orientationEv @ 41 NONAME _ZTI14GlxViewManager @ 42 NONAME _ZTV14GlxViewManager @ 43 NONAME + _ZN14GlxViewManager11checkMarkedEv @ 44 NONAME diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/statehandler/inc/glxslideshowsettingsstate.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/viewmanagement/statehandler/inc/glxslideshowsettingsstate.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class handles the state corresponding to the Slide Show settings view +* +*/ + + + +#ifndef GLXSLIDESHOWSETTINGSSTATE_H +#define GLXSLIDESHOWSETTINGSSTATE_H + +#include + +class GlxStateManager; + +class GlxSlideShowSettingsState : public GlxState +{ +public : + + GlxSlideShowSettingsState(GlxStateManager *stateManager, GlxState *preState = NULL); + void eventHandler(qint32 &id); //Overriding the pure virtual function + +private: + + GlxStateManager *mStateManager; +}; + + +#endif /* GLXSLIDESHOWSETTINGSSTATE_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/statehandler/src/glxactionhandler.cpp --- a/ui/viewmanagement/statehandler/src/glxactionhandler.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/statehandler/src/glxactionhandler.cpp Mon May 03 12:31:32 2010 +0300 @@ -52,6 +52,10 @@ case EGlxCmdContextSend: commandId = EGlxCmdSend; break; + + case EGlxCmdContextRename: + commandId = EGlxCmdRename; + break; default : break; } diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/statehandler/src/glxcommandhandlerfactory.cpp --- a/ui/viewmanagement/statehandler/src/glxcommandhandlerfactory.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/statehandler/src/glxcommandhandlerfactory.cpp Mon May 03 12:31:32 2010 +0300 @@ -24,6 +24,7 @@ #include #include #include +#include GlxCommandHandler* GlxCommandHandlerFactory::CreateCommandHandler(int commandId) { @@ -43,6 +44,10 @@ case EGlxCmdSend : cmdHandler = new GlxCommandHandlerSend(); break; + + case EGlxCmdRename: cmdHandler = new GlxCommandHandlerRename(); + break; + default: break; } diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/statehandler/src/glxgridstate.cpp --- a/ui/viewmanagement/statehandler/src/glxgridstate.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/statehandler/src/glxgridstate.cpp Mon May 03 12:31:32 2010 +0300 @@ -114,8 +114,7 @@ break ; default : - break; - + break; } } @@ -125,6 +124,7 @@ switch(id) { case EGlxCmdAllGridOpen : + mStateManager->removeCurrentModel(); mStateManager->goBack( GLX_GRIDVIEW_ID, ALL_ITEM_S ); id = EGlxCmdHandled; break ; diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/statehandler/src/glxslideshowsettingsstate.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/viewmanagement/statehandler/src/glxslideshowsettingsstate.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 +#include +#include + + +GlxSlideShowSettingsState::GlxSlideShowSettingsState(GlxStateManager *stateManager, GlxState *preState ) : GlxState(GLX_SLIDESHOWSETTINGSVIEW_ID, preState) +{ + if ( preState) + qDebug("GlxSlideShowSettingsState::GlxSlideShowSettingsState() state id = %d", preState->id()); + mStateManager = stateManager ; +} + +void GlxSlideShowSettingsState::eventHandler(qint32 &id) +{ + qDebug("GlxSlideShowSettingsState::eventHandler() action id = %d", id); + return; +} + diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/statehandler/src/glxstatemanager.cpp --- a/ui/viewmanagement/statehandler/src/glxstatemanager.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/statehandler/src/glxstatemanager.cpp Mon May 03 12:31:32 2010 +0300 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -39,7 +40,7 @@ #include #include #include -#include +#include #include GlxStateManager::GlxStateManager() : mAllMediaModel(NULL), mAlbumGridMediaModel(NULL), @@ -110,8 +111,7 @@ createModel(GLX_FULLSCREENVIEW_ID); mCurrentModel->setData( mCurrentModel->index(0,0), 0, GlxFocusIndexRole ); mViewManager->launchApplication( GLX_FULLSCREENVIEW_ID, mCurrentModel); - //todo remove state dependency from view manager - mViewManager->setupItems(IMAGEVIEWER_S); + setupItems(); } void GlxStateManager::actionTriggered(qint32 id) @@ -276,6 +276,8 @@ case GLX_SLIDESHOWVIEW_ID : return new GlxSlideShowState( this, mCurrentState ); + case GLX_SLIDESHOWSETTINGSVIEW_ID : + return new GlxSlideShowSettingsState(this, mCurrentState ); default : return NULL; @@ -305,6 +307,7 @@ if ( mCurrentState->state() == IMAGEVIEWER_S) { GlxModelParm modelParm (KGlxCollectionPluginImageViewerImplementationUid, 0); mCurrentModel = mImageviewerMediaModel = new GlxMediaModel (modelParm); + mCollectionId = KGlxCollectionPluginImageViewerImplementationUid; } else if ( mCurrentState->state() == EXTERNAL_S) { if(!mAllMediaModel) { @@ -324,7 +327,7 @@ break; case GLX_SLIDESHOWVIEW_ID : - if ( mCurrentState->state() == ALBUM_ITEM_S ) { + if ( mCurrentState->state() == SLIDESHOW_ALBUM_ITEM_S ) { GlxModelParm modelParm ( KGlxAlbumsMediaId , 0); mCurrentModel = mAlbumGridMediaModel = new GlxMediaModel( modelParm ); } @@ -429,6 +432,10 @@ id = EGlxCmdHandled; break; + case EGlxCmdSlideshowSettings: + nextState(GLX_SLIDESHOWSETTINGSVIEW_ID,-1 ); + id = EGlxCmdHandled; + break; case EGlxCmdDetailsOpen: qDebug("GlxStateManager::eventHandler EGlxCmdDetailsOpen"); nextState( GLX_DETAILSVIEW_ID, -1 ); @@ -454,9 +461,7 @@ case EGlxCmdOviOpen: { - HbMessageBox box(HbMessageBox::MessageTypeInformation); - box.setText("Not Implemented"); - box.exec(); + HbNotificationDialog::launchDialog("Not Implemented"); id = EGlxCmdHandled; } break; diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/statehandler/statehandler.pro --- a/ui/viewmanagement/statehandler/statehandler.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/statehandler/statehandler.pro Mon May 03 12:31:32 2010 +0300 @@ -54,6 +54,7 @@ inc/glxfullscreenstate.h \ inc/glxdetailstate.h \ inc/glxgridstate.h \ + inc/glxslideshowsettingsstate.h \ inc/glxliststate.h \ inc/glxstatemanager.h \ inc/glxslideshowstate.h \ @@ -64,6 +65,7 @@ src/glxfullscreenstate.cpp \ src/glxdetailstate.cpp \ src/glxgridstate.cpp \ + src/glxslideshowsettingsstate.cpp \ src/glxliststate.cpp \ src/glxstatemanager.cpp \ src/glxslideshowstate.cpp \ diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/viewmanager/inc/glxmenumanager.h --- a/ui/viewmanagement/viewmanager/inc/glxmenumanager.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/viewmanager/inc/glxmenumanager.h Mon May 03 12:31:32 2010 +0300 @@ -22,6 +22,7 @@ class QAction; class HbMainWindow; + //Grid view option menu enum { GlxGridViewSend, @@ -43,6 +44,7 @@ void setModel(QAbstractItemModel *model) { mModel = model ; } void addMenu(qint32 viewId, HbMenu* menu); void removeMenu(qint32 viewId, HbMenu* menu); + void disableAction(HbMenu* menu,bool disable); signals : void commandTriggered(qint32 commandId); @@ -58,8 +60,11 @@ void menuItemSelected(); void updateGridMenu(); void updateFullscreenMenu(); + void closeContextMenu(); private: QAbstractItemModel *mModel; //It should point to current view model HbMainWindow* mMainWindow; + HbMenu *mContextMenu; + HbMenu* mSubMenu; }; diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/viewmanager/inc/glxviewmanager.h --- a/ui/viewmanagement/viewmanager/inc/glxviewmanager.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/viewmanager/inc/glxviewmanager.h Mon May 03 12:31:32 2010 +0300 @@ -19,7 +19,7 @@ #ifndef GLXVIEWMANAGER_H #define GLXVIEWMANAGER_H - + #include #include #include #include @@ -141,6 +141,7 @@ private slots: + void checkMarked(); private: /* * It will create and return the view @@ -196,6 +197,7 @@ HbMenu *mMenu; GlxView *mView; QAbstractItemModel *mModel; //no ownership + QItemSelectionModel * mSelectionModel; }; diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/viewmanager/src/glxmenumanager.cpp --- a/ui/viewmanagement/viewmanager/src/glxmenumanager.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/viewmanager/src/glxmenumanager.cpp Mon May 03 12:31:32 2010 +0300 @@ -26,8 +26,13 @@ #include "glxmenumanager.h" #include "glxcommandhandlers.hrh" #include "glxmodelparm.h" +#include "glxlocalisationstrings.h" -GlxMenuManager::GlxMenuManager(HbMainWindow* mainWindow):mMainWindow(mainWindow) + + +GlxMenuManager::GlxMenuManager(HbMainWindow* mainWindow) + : mMainWindow( mainWindow ), + mContextMenu( 0 ) { } @@ -40,25 +45,26 @@ qDebug()<< "GlxMenuManager::CreateMarkingModeMenu" ; HbAction *action = NULL; - action = menu->addAction("Mark All"); + action = menu->addAction(GLX_OPTION_MARK_ALL); action->setData(EGlxCmdMarkAll); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = menu->addAction("UnMark All"); - action->setData(EGlxCmdUnMarkAll); - connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - - action = menu->addAction("Help"); + action = menu->addAction(GLX_OPTION_UN_MARK_ALL); + action->setDisabled(true); //Dim UnMarkAll when no images are marked action->setData(EGlxCmdUnMarkAll); - action->setVisible(FALSE); - connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - - action = menu->addAction("Exit"); - action->setData(EGlxCmdUnMarkAll); - action->setVisible(FALSE); - connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); + connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); } +void GlxMenuManager::disableAction(HbMenu* menu, bool disable) +{ + QList actionList = menu->actions(); + for ( int i = 0 ; i < actionList.count(); i++) { + if(actionList.at(i)->data()==EGlxCmdUnMarkAll) { + actionList.at(i)->setDisabled(disable); + break; + } + } +} void GlxMenuManager::addMenu(qint32 viewId, HbMenu* menu) { switch(viewId) { @@ -102,23 +108,27 @@ qDebug()<<"GlxMenuManager::CreateGridMenu"; HbAction *action = NULL; - action = menu->addAction("Send"); + action = menu->addAction(GLX_OPTION_SHARE); action->setData(EGlxCmdSend); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = menu->addAction("Slide Show"); + mSubMenu = menu->addMenu(GLX_OPTION_SLIDESHOW); + action = mSubMenu->addAction(GLX_OPTION_SS_PLAY); action->setData(EGlxCmdFirstSlideshow); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = menu->addAction("Add to album"); + action = mSubMenu->addAction(GLX_OPTION_SS_SETTINGS); + action->setData(EGlxCmdSlideshowSettings); + connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); + action = menu->addAction(GLX_OPTION_ADD_TO_ALBUM); action->setData(EGlxCmdAddToAlbum); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = menu->addAction("Remove From Album"); + action = menu->addAction(GLX_OPTION_REMOVE_FROM_ALBUM); action->setData(EGlxCmdRemoveFrom); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = menu->addAction("Delete"); + action = menu->addAction(GLX_OPTION_DELETE); action->setData(EGlxCmdDelete); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); } @@ -128,7 +138,7 @@ qDebug()<<"GlxMenuManager::CreateListMenu"; HbAction *action = NULL; - action = menu->addAction("New album"); + action = menu->addAction(GLX_OPTION_NEW_ALBUM); action->setData(EGlxCmdAddMedia); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); } @@ -138,15 +148,19 @@ qDebug()<<"GlxMenuManager::CreateFullscreenMenu"; HbAction *action = NULL; - action = menu->addAction("Send"); + action = menu->addAction(GLX_OPTION_SHARE); action->setData(EGlxCmdSend); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = menu->addAction("Slide Show"); + mSubMenu = menu->addMenu(GLX_OPTION_SLIDESHOW); + action = mSubMenu->addAction(GLX_OPTION_SS_PLAY); action->setData(EGlxCmdSelectSlideshow); + connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); + action = mSubMenu->addAction(GLX_OPTION_SS_SETTINGS); + action->setData(EGlxCmdSlideshowSettings); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = menu->addAction("Add to album"); + action = menu->addAction(GLX_OPTION_ADD_TO_ALBUM); action->setData(EGlxCmdAddToAlbum); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); @@ -237,43 +251,58 @@ void GlxMenuManager::ShowItemSpecificMenu(qint32 viewId,QPointF pos) { qDebug("GlxMenuManager::showContextMenu " ); - HbMenu *mainMenu = new HbMenu(); + mContextMenu = new HbMenu(); HbAction *action = NULL; - switch ( viewId ) { + + switch ( viewId ) { case GLX_GRIDVIEW_ID : - action = mainMenu->addAction("Send"); + action = mContextMenu->addAction(GLX_MENU_SHARE); action->setData(EGlxCmdContextSend); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = mainMenu->addAction("Slide Show"); + action = mContextMenu->addAction(GLX_MENU_SLIDESHOW); action->setData(EGlxCmdSelectSlideshow); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = mainMenu->addAction("Add to album"); + action = mContextMenu->addAction(GLX_MENU_ADD_TO_ALBUM); action->setData(EGlxCmdContextAddToAlbum); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = mainMenu->addAction("Delete"); + action = mContextMenu->addAction(GLX_MENU_DELETE); action->setData(EGlxCmdContextDelete); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); break; case GLX_LISTVIEW_ID : - action = mainMenu->addAction("Slide Show"); + action = mContextMenu->addAction(GLX_MENU_SLIDESHOW); action->setData(EGlxCmdAlbumSlideShow); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); + + action = mContextMenu->addAction(GLX_MENU_RENAME); + action->setData(EGlxCmdContextRename); + connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); - action = mainMenu->addAction("Delete"); + action = mContextMenu->addAction(GLX_MENU_DELETE); action->setData(EGlxCmdContextAlbumDelete); connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); break; + default: break; } - connect(mMainWindow, SIGNAL(aboutToChangeOrientation ()), mainMenu, SLOT(close())); - mainMenu->exec(pos); - disconnect(mMainWindow, SIGNAL(aboutToChangeOrientation ()), mainMenu, SLOT(close())); - delete mainMenu; + connect( mMainWindow, SIGNAL( aboutToChangeOrientation () ), mContextMenu, SLOT( close() ) ); + connect( mContextMenu, SIGNAL( aboutToClose () ), this, SLOT( closeContextMenu() ) ); + mContextMenu->setPreferredPos( pos ); + mContextMenu->show(); + +} +void GlxMenuManager::closeContextMenu() +{ + disconnect( mMainWindow, SIGNAL( aboutToChangeOrientation () ), mContextMenu, SLOT( close() ) ); + disconnect( mContextMenu, SIGNAL( aboutToClose () ), this, SLOT( closeContextMenu() ) ); + mContextMenu->deleteLater(); + mContextMenu = NULL; } + diff -r 99ad1390cd33 -r c499df2dbb33 ui/viewmanagement/viewmanager/src/glxviewmanager.cpp --- a/ui/viewmanagement/viewmanager/src/glxviewmanager.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/viewmanagement/viewmanager/src/glxviewmanager.cpp Mon May 03 12:31:32 2010 +0300 @@ -28,6 +28,7 @@ #include #include #include +#include "glxlocalisationstrings.h" #include #include @@ -41,8 +42,9 @@ mMenuManager( NULL ), mEffectEngine( NULL ), mViewToolBar( NULL ), - mMarkingToolBar( NULL ), - mMenu( NULL ) + mMarkingToolBar( NULL ), + mMenu( NULL ), + mSelectionModel ( NULL ) { qDebug("GlxViewManager::GlxViewManager() "); PERFORMANCE_ADV ( viewMgrD1, "main window creation time" ) { @@ -218,6 +220,19 @@ } } +void GlxViewManager::checkMarked() +{ + qDebug("GlxViewManager::checkMarked"); + QModelIndexList selectedModelIndex = mSelectionModel->selectedIndexes(); + for ( int i = 0 ; i < mMarkingActionList.count(); i++) { + if( mMarkingActionList.at(i)->data()==EGlxCmdSelect) { + bool noSelection=selectedModelIndex.empty(); + mMarkingActionList.at(i)->setDisabled(noSelection); + mMenuManager->disableAction(mView->menu(),noSelection); + break; + } + } +} void GlxViewManager::enterMarkingMode(qint32 viewId) { GlxView *view = findView ( viewId ); @@ -240,6 +255,12 @@ mMenu = menu; view->takeToolBar(); view->addToolBar(mMarkingToolBar); + mSelectionModel = view->getSelectionModel(); + if(mSelectionModel) + { + connect(mSelectionModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection& ) ), this, SLOT(checkMarked())); + checkMarked(); + } } qDebug("GlxViewManager::enterMarkingMode view ID %d exit", viewId); } @@ -255,6 +276,10 @@ mMenu = menu; view->takeToolBar(); view->addToolBar(mViewToolBar); + if(mSelectionModel) + { + disconnect(mSelectionModel, SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection& ) ), this, SLOT(checkMarked())); + } } qDebug("GlxViewManager::exitMarkingMode view ID %d exit", viewId); } @@ -400,14 +425,14 @@ mMarkingActionList.clear(); //create the ok tool bar button action - HbAction* selectAction = new HbAction("Ok", this); + HbAction* selectAction = new HbAction(GLX_BUTTON_OK, this); selectAction->setData(EGlxCmdSelect); mMarkingActionList.append(selectAction); connect( selectAction, SIGNAL(triggered( )), this, SLOT(handleAction( )), Qt::QueuedConnection ); mMarkingToolBar->addAction( selectAction ); //create the cancel tool bar button action - HbAction* cancelAction = new HbAction("Cancel", this); + HbAction* cancelAction = new HbAction(GLX_BUTTON_CANCEL, this); cancelAction->setData(EGlxCmdCancel); mMarkingActionList.append(cancelAction); connect( cancelAction, SIGNAL(triggered( )), this, SLOT(handleAction( )), Qt::QueuedConnection ); diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/detailsview/src/glxdetailscustomwidgets.cpp --- a/ui/views/detailsview/src/glxdetailscustomwidgets.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/detailsview/src/glxdetailscustomwidgets.cpp Mon May 03 12:31:32 2010 +0300 @@ -50,40 +50,14 @@ modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); switch(itemType) { - case ImageNameItem: - { - qDebug("GlxDetailsCustomWidgets::createCustomWidget:ImageNameItem"); - HbLineEdit *lineEdit = new HbLineEdit(); - lineEdit->setGeometry(25,25,280,120); - return lineEdit; - } - - case DateLabelItem : + + case DateLabelItem : { qDebug("GlxDetailsCustomWidgets::createCustomWidget:DateLabelItem"); HbLabel *dateLabel = new HbLabel(); return dateLabel; } - - case LocationTagItem: - { - qDebug("GlxDetailsCustomWidgets::createCustomWidget:LocationTagItem"); - HbLabel *locationLabel = new HbLabel(); - return locationLabel; - } - - case DurationItem: - { - qDebug("GlxDetailsCustomWidgets::createCustomWidget:DurationLabelItem"); - HbLabel *durationLabel = new HbLabel(); - return durationLabel; - } - - case ShareWithItem: - { - //To be added later. - } - + case CommentsItem: { qDebug("GlxDetailsCustomWidgets::createCustomWidget:CommentsItem"); diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/detailsview/src/glxdetailsview.cpp --- a/ui/views/detailsview/src/glxdetailsview.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/detailsview/src/glxdetailsview.cpp Mon May 03 12:31:32 2010 +0300 @@ -172,22 +172,20 @@ //----------------------------START OF CREATION OF WIDGETS---------------------------------// // To add new widgets in the details view, add it here. - - //---------------------------IMAGE NAME LABEL --------------------------------------------// + + //---------------------------IMAGE NAME LABEL --------------------------------------------// OstTrace0( TRACE_NORMAL, DUP1_GLXDETAILSVIEW_ADDWIDGETS, "GlxDetailsView::addWidgets create Image Label" ); - HbDataFormModelItem *imageLabelitem = mDetailModel->appendDataFormItem((HbDataFormModelItem::DataItemType)(ImageNameItem), QString("Name"), mDetailModel->invisibleRootItem()); - imageLabelitem->setData(HbDataFormModelItem::KeyRole,QString("")); + HbDataFormModelItem *imageLabelitem = + mDetailModel->appendDataFormItem(HbDataFormModelItem::TextItem, QString("Name"), mDetailModel->invisibleRootItem()); + imageLabelitem->setData(HbDataFormModelItem::KeyRole, QString("")); + imageLabelitem->setContentWidgetData(QString("text"),QString("")); + //---------------------------DATE LABEL --------------------------------------------// OstTrace0( TRACE_NORMAL, DUP2_GLXDETAILSVIEW_ADDWIDGETS, "GlxDetailsView::addWidgets date label" ); HbDataFormModelItem *dateLabelItem = mDetailModel->appendDataFormItem((HbDataFormModelItem::DataItemType)(DateLabelItem), QString("Date"), mDetailModel->invisibleRootItem()); dateLabelItem->setData(HbDataFormModelItem::KeyRole,QString("")); - //---------------------------LOCATION LABEL--------------------------------------------// - OstTrace0( TRACE_NORMAL, DUP3_GLXDETAILSVIEW_ADDWIDGETS, "GlxDetailsView::addWidgets location label" ); - HbDataFormModelItem *locationLabelItem = mDetailModel->appendDataFormItem((HbDataFormModelItem::DataItemType)(LocationTagItem), QString("Location Tag"), mDetailModel->invisibleRootItem()); - locationLabelItem->setData(HbDataFormModelItem::KeyRole, QString("")); - //----------------------------COMMENTS TEXT ITEM---------------------------------------------// OstTrace0( TRACE_NORMAL, DUP5_GLXDETAILSVIEW_ADDWIDGETS, "GlxDetailsView::addWidgets comment text" ); HbDataFormModelItem *commentsLabelItem = mDetailModel->appendDataFormItem((HbDataFormModelItem::DataItemType)(CommentsItem), QString("Comments"), mDetailModel->invisibleRootItem()); diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/fullscreenview/inc/glxcoverflow.h --- a/ui/views/fullscreenview/inc/glxcoverflow.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/fullscreenview/inc/glxcoverflow.h Mon May 03 12:31:32 2010 +0300 @@ -102,7 +102,7 @@ void initializeNewModel(); //reset all the data of cover flow void resetCoverFlow(); - + int getSubState(); private slots: private: diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/fullscreenview/inc/glxfullscreenview.h --- a/ui/views/fullscreenview/inc/glxfullscreenview.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/fullscreenview/inc/glxfullscreenview.h Mon May 03 12:31:32 2010 +0300 @@ -39,7 +39,7 @@ //User Defined forward declartion class GlxZoomSlider; class GlxZoomControl; -class CGlxHdmiController; +class GlxTvOutWrapper; class GlxFullScreenView : public GlxView { @@ -105,31 +105,31 @@ void createUiControl(); void setImageStripModel(); - /* - * Called when an item is highlighted. - */ - void SetImageToHdmiL(); void loadFullScreenToolBar(); void imageSelectionAnimation(const QModelIndex &index); - + int getSubState(); + void setHdmiModel(QAbstractItemModel *model); private: QAbstractItemModel *mModel; //no ownership HbMainWindow *mWindow; //no ownership GlxCoverFlow *mCoverFlow; HbGridView *mImageStrip; - bool mUiOff; // to check the current status of ui on / off QTimer *mUiOffTimer; //use for ui off after 30 sec HbIconItem *mIconItem ; //temporary item for play the image strip select animation - //for Zoom + GlxTvOutWrapper *mTvOutWrapper; + HbToolBar *mFullScreenToolBar; //Fullscreen Toolbar + HbAction *mFlipAction; //Action : it starts activates the details view + HbAction *mSendAction; + HbAction *mDeleteAction; + HbAction *mUseImageAction; + + //for Zoom HbPushButton *mZmPushButton; GlxZoomSlider *mZoomSlider; GlxZoomControl *mZoomControl; HbDocumentLoader *mDocLoader; - CGlxHdmiController* iHdmiController; - HbToolBar *mFullScreenToolBar; //Fullscreen Toolbar - HbAction *mFlipAction; //Action : it starts activates the details view - HbAction *mSendAction; - HbAction *mDeleteAction; + + bool mUiOff; // to check the current status of ui on / off }; #endif /* GLXFULLSCREENVIEW_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/fullscreenview/src/glxcoverflow.cpp --- a/ui/views/fullscreenview/src/glxcoverflow.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/fullscreenview/src/glxcoverflow.cpp Mon May 03 12:31:32 2010 +0300 @@ -25,7 +25,7 @@ //User Includes #include #include - +#include "glxviewids.h" const int KMoveX = 60; //coverflow auto move speed @@ -138,7 +138,10 @@ void GlxCoverFlow::panGesture ( const QPointF & delta ) { qDebug("GlxCoverFlow::panGesture deltaX= %d", (int)delta.x()); - + if(getSubState() == IMAGEVIEWER_S || getSubState() == FETCHER_S ) + { + return; + } move((int) delta.x()); if( delta.x() > 0 ) { mMoveDir = RIGHT_MOVE; @@ -157,6 +160,10 @@ { Q_UNUSED(value); qDebug("GlxCoverFlow::leftGesture CurrentPos= %d value %d", mCurrentPos, value); + if(getSubState() == IMAGEVIEWER_S || getSubState() == FETCHER_S ) + { + return; + } mMoveDir = NO_MOVE; mBounceBackDeltaX = mItemSize.width() >> 2; emit autoLeftMoveSignal(); @@ -170,6 +177,10 @@ { Q_UNUSED(value); qDebug("GlxCoverFlow::rightGesture CurrentPos= %d value %d ", mCurrentPos, value); + if(getSubState() == IMAGEVIEWER_S || getSubState() == FETCHER_S ) + { + return; + } mMoveDir = NO_MOVE; mBounceBackDeltaX = mItemSize.width() >> 2; emit autoRightMoveSignal(); @@ -567,3 +578,13 @@ } } } + +int GlxCoverFlow::getSubState() +{ + int substate = NO_FULLSCREEN_S; + QVariant variant = mModel->data( mModel->index(0,0), GlxSubStateRole ); + if ( variant.isValid() && variant.canConvert () ) { + substate = variant.value(); + } + return substate; +} diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/fullscreenview/src/glxfullscreenview.cpp --- a/ui/views/fullscreenview/src/glxfullscreenview.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/fullscreenview/src/glxfullscreenview.cpp Mon May 03 12:31:32 2010 +0300 @@ -39,7 +39,7 @@ #include "glxcoverflow.h" #include "glxdocloaderdefs.h" //contains the definations of path, widget names and view names in docml #include "glxloggerenabler.h" -#include "glxhdmicontroller.h" +#include "glxtvoutwrapper.h" #include "glxfullscreenview.h" #include "glxcommandhandlers.hrh" //#include "glxzoomwidget.h" @@ -59,11 +59,13 @@ mCoverFlow(NULL) , mImageStrip (NULL), mUiOffTimer(NULL), - iHdmiController(NULL), + mIconItem(NULL), + mTvOutWrapper(NULL), mFullScreenToolBar(NULL), mFlipAction(NULL), mSendAction(NULL), - mDeleteAction(NULL) + mDeleteAction(NULL), + mUseImageAction(NULL) { OstTraceFunctionEntry0( GLXFULLSCREENVIEW_GLXFULLSCREENVIEW_ENTRY ); @@ -80,6 +82,11 @@ { OstTraceFunctionEntry0( GLXFULLSCREENVIEW_INITIALIZEVIEW_ENTRY ); + // if animations is on, then Set the image to HDMI here + if (!mTvOutWrapper){ + mTvOutWrapper = new GlxTvOutWrapper(); + } + setHdmiModel(model); //Load/Retrieve the Widgets loadWidgets(); @@ -142,12 +149,23 @@ //create Delete tool bar button action mDeleteAction = new HbAction(this); mDeleteAction->setData(EGlxCmdDelete); - mDeleteAction->setIcon(HbIcon(GLXICON_DELETE)); - mFullScreenToolBar->addAction( mDeleteAction); + mDeleteAction->setIcon(HbIcon(GLXICON_DELETE)); + + //create Use Image tool bar button action + mUseImageAction = new HbAction(this); + //mUseImageAction->setData(EGlxCmdDelete); + mUseImageAction->setIcon(HbIcon(GLXICON_USEIMAGE)); + if(getSubState() != IMAGEVIEWER_S){ + mFullScreenToolBar->addAction( mDeleteAction); + }else{ + mFullScreenToolBar->addAction( mUseImageAction); + } + connect(mFlipAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); connect(mSendAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); connect(mDeleteAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); + connect(mUseImageAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); OstTraceFunctionExit0( GLXFULLSCREENVIEW_LOADFULLSCREENTOOLBAR_EXIT ); } @@ -173,15 +191,12 @@ mUiOff = true; mUiOffTimer->stop(); mCoverFlow->setUiOn(FALSE); - addConnection(); setLayout(); - if (!iHdmiController) { - OstTrace0( TRACE_NORMAL, GLXFULLSCREENVIEW_ACTIVATE, "GlxFullScreenView::activate - CGlxHdmi" ); - iHdmiController = CGlxHdmiController::NewL(); - } - + if (!mTvOutWrapper){ + mTvOutWrapper = new GlxTvOutWrapper(); + } OstTraceFunctionExit0( GLXFULLSCREENVIEW_ACTIVATE_EXIT ); } @@ -206,11 +221,11 @@ { OstTraceFunctionEntry0( GLXFULLSCREENVIEW_RESETVIEW_ENTRY ); + //Clean up the rest of the resources allocated + cleanUp(); + //Clear the 4 icons present in the Coverflow,so that the transition between the views are smooth mCoverFlow->partiallyClean(); - - //Clean up the rest of the resources allocated - cleanUp(); OstTraceFunctionExit0( GLXFULLSCREENVIEW_RESETVIEW_EXIT ); } @@ -252,13 +267,10 @@ mFullScreenToolBar = NULL; } - - if (iHdmiController) { - OstTrace0( TRACE_NORMAL, DUP2_GLXFULLSCREENVIEW_CLEANUP, "GlxFullScreenView::cleanUp() delete iHdmiController" ); - delete iHdmiController; - iHdmiController = NULL; + if (mTvOutWrapper) { + delete mTvOutWrapper; + mTvOutWrapper = NULL; } - OstTraceFunctionExit0( GLXFULLSCREENVIEW_CLEANUP_EXIT ); } @@ -279,13 +291,29 @@ OstTraceExt2( TRACE_NORMAL, GLXFULLSCREENVIEW_SETMODEL, "GlxFullScreenView::setModel; model=%x; mModel=%u", ( TUint )( model ), ( TUint ) mModel ); mModel = model; - mCoverFlow->setModel(mModel); - setImageStripModel(); - SetImageToHdmiL(); // for the first image on screen - + setHdmiModel(mModel); + + mCoverFlow->setModel(mModel); + setImageStripModel(); + if(getSubState() == IMAGEVIEWER_S) + { + setTitle("Image Viewer"); + } + else if(getSubState() == FETCHER_S){ + setItemVisible(Hb::AllItems, TRUE) ; + } OstTraceFunctionExit0( GLXFULLSCREENVIEW_SETMODEL_EXIT ); } +void GlxFullScreenView::setHdmiModel(QAbstractItemModel* model) + { + if (mTvOutWrapper) + mTvOutWrapper->setModel(model); + + // for the first image on screen + mTvOutWrapper->setImagetoHDMI(); + } + void GlxFullScreenView::setModelContext() { OstTraceFunctionEntry0( GLXFULLSCREENVIEW_SETMODELCONTEXT_ENTRY ); @@ -324,7 +352,7 @@ { OstTraceFunctionEntry0( GLXFULLSCREENVIEW_ACTIVATEUI_ENTRY ); - if ( mUiOff ){ + if ( mUiOff && getSubState() != FETCHER_S){ if(!mFullScreenToolBar) { loadFullScreenToolBar(); } @@ -336,10 +364,16 @@ mImageStrip->scrollTo( mModel->index( variant.value(), 0), HbGridView::PositionAtTop ); } - mImageStrip->show(); mFullScreenToolBar->show(); setItemVisible(Hb::AllItems, TRUE) ; - HbEffect::start(mImageStrip, QString("HbGridView"), QString("TapShow"), this, "effectFinished" ); + + if ( mImageStrip && getSubState() != IMAGEVIEWER_S) { + mImageStrip->show(); + HbEffect::start(mImageStrip, QString("HbGridView"), QString("TapShow"), this, "effectFinished" ); + } + else if( getSubState() == IMAGEVIEWER_S){ + setTitle("Image Viewer"); + } } else { hideUi(); @@ -360,8 +394,10 @@ } mUiOff = TRUE; - setItemVisible(Hb::AllItems, FALSE) ; - if ( mImageStrip ) { + if ( getSubState() != FETCHER_S ) { + setItemVisible(Hb::AllItems, FALSE) ; + } + if ( mImageStrip && ( getSubState() != IMAGEVIEWER_S && getSubState() != FETCHER_S )) { HbEffect::start(mImageStrip, QString("HbGridView"), QString("TapHide"), this, "effectFinished" ); } @@ -379,11 +415,17 @@ QVariant variant = mModel->data( mModel->index(0,0), GlxFocusIndexRole ); if ( variant.isValid() && variant.canConvert () && ( index.row() == variant.value() ) ) { OstTraceFunctionExit0( GLXFULLSCREENVIEW_CHANGESELECTEDINDEX_EXIT ); + if (mTvOutWrapper){ + // for the image changed on deletion + mTvOutWrapper->setImagetoHDMI(); + } return; } mModel->setData( index, index.row(), GlxFocusIndexRole ); - SetImageToHdmiL(); // for the image changed on swipe - + if (mTvOutWrapper){ + // for the image changed on swipe + mTvOutWrapper->setImagetoHDMI(); + } OstTraceFunctionExit0( DUP1_GLXFULLSCREENVIEW_CHANGESELECTEDINDEX_EXIT ); } @@ -399,8 +441,11 @@ mModel->setData( index, index.row(), GlxFocusIndexRole ); mCoverFlow->indexChanged(index.row()); mImageStrip->scrollTo(index, HbGridView::EnsureVisible ); - SetImageToHdmiL(); // for the indexchnaged through filmstrip - //disable the animation for the time being + if (mTvOutWrapper){ + // for the indexchnaged through filmstrip + mTvOutWrapper->setImagetoHDMI(); + } + //disable the animation for the time being //imageSelectionAnimation( index ); OstTraceFunctionExit0( DUP1_GLXFULLSCREENVIEW_INDEXCHANGED_EXIT ); @@ -503,6 +548,10 @@ { OstTraceFunctionEntry0( GLXFULLSCREENVIEW_EFFECTFINISHED_ENTRY ); + if ( mUiOffTimer == NULL ){ //view is already deactivate so no need to do any thing + return ; + } + if ( mUiOff ) { mUiOffTimer->stop(); mCoverFlow->setUiOn(FALSE); @@ -605,6 +654,10 @@ disconnect(mDeleteAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); } + if(mUseImageAction) { + disconnect(mUseImageAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); + } + disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); OstTraceFunctionExit0( GLXFULLSCREENVIEW_REMOVECONNECTION_EXIT ); @@ -678,27 +731,6 @@ OstTraceFunctionExit0( GLXFULLSCREENVIEW_HANDLEUSERACTION_EXIT ); } -void GlxFullScreenView::SetImageToHdmiL() -{ - OstTraceFunctionEntry0( GLXFULLSCREENVIEW_SETIMAGETOHDMIL_ENTRY ); - - if (iHdmiController) { - OstTrace0( TRACE_NORMAL, GLXFULLSCREENVIEW_SETIMAGETOHDMIL, "GlxFullScreenView::SetImageToHdmiL() - CGlxHdmi 2" ); - - // Get the image uri - QString imagePath = (mModel->data(mModel->index(mModel->data(mModel->index(0,0),GlxFocusIndexRole).value(),0),GlxUriRole)).value(); - if(imagePath.isNull()) { - OstTrace0( TRACE_NORMAL, DUP1_GLXFULLSCREENVIEW_SETIMAGETOHDMIL, "GlxFullScreenView::SetImageToHdmiL() path is null" ); - } - - TPtrC aPtr = reinterpret_cast(imagePath.utf16()); - - iHdmiController->SetImageL(aPtr); - } - - OstTraceFunctionExit0( GLXFULLSCREENVIEW_SETIMAGETOHDMIL_EXIT ); -} - void GlxFullScreenView::imageSelectionAnimation(const QModelIndex &index) { OstTraceFunctionEntry0( GLXFULLSCREENVIEW_IMAGESELECTIONANIMATION_ENTRY ); @@ -736,3 +768,13 @@ OstTraceFunctionExit0( GLXFULLSCREENVIEW_HANDLETOOLBARACTION_EXIT ); } + +int GlxFullScreenView::getSubState() +{ + int substate = NO_FULLSCREEN_S; + QVariant variant = mModel->data( mModel->index(0,0), GlxSubStateRole ); + if ( variant.isValid() && variant.canConvert () ) { + substate = variant.value(); + } + return substate; +} diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/gridview/inc/glxgridview.h --- a/ui/views/gridview/inc/glxgridview.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/gridview/inc/glxgridview.h Mon May 03 12:31:32 2010 +0300 @@ -81,6 +81,7 @@ int mVisualIndex; //first item index of the page //To:Do remove later HbAbstractViewItem *mItem; HbDocumentLoader *mDocLoader; //Docml loader to load the widgets from docml + bool mIsLongPress; //to check the long press has happend or not }; #endif /* GLXGRIDVIEW_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/gridview/src/glxgridview.cpp --- a/ui/views/gridview/src/glxgridview.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/gridview/src/glxgridview.cpp Mon May 03 12:31:32 2010 +0300 @@ -50,7 +50,8 @@ mWindow(window), mModel ( NULL), mVisualIndex(0), - mItem(NULL) + mItem(NULL), + mIsLongPress (false) { OstTraceFunctionEntry0( GLXGRIDVIEW_GLXGRIDVIEW_ENTRY ); mDocLoader = new HbDocumentLoader(); @@ -73,6 +74,7 @@ { OstTraceFunctionEntry0( GLXGRIDVIEW_DEACTIVATE_ENTRY ); removeViewConnection(); + mModel = NULL; OstTraceFunctionExit0( GLXGRIDVIEW_DEACTIVATE_EXIT ); } @@ -175,7 +177,7 @@ void GlxGridView::loadGridView(Qt::Orientation orient) { OstTraceFunctionEntry0( GLXGRIDVIEW_LOADGRIDVIEW_ENTRY ); - bool loaded = true; + bool loaded = false; QString section; GlxContextMode mode ; @@ -234,9 +236,6 @@ connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(loadGridView(Qt::Orientation))); connect(mGridView, SIGNAL(activated(const QModelIndex &)), this, SLOT( itemSelected(const QModelIndex &))); connect( mGridView, SIGNAL( scrollingEnded() ), this, SLOT( setVisvalWindowIndex() ) ); - if(XQServiceUtil::isService()){ - connect(mGridView, SIGNAL(activated(const QModelIndex &)), this, SIGNAL( gridItemSelected(const QModelIndex &))); - } connect(mGridView, SIGNAL(longPressed( HbAbstractViewItem*, QPointF )),this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); } @@ -245,7 +244,6 @@ OstTrace0( TRACE_NORMAL, GLXGRIDVIEW_REMOVEVIEWCONNECTION, "GlxGridView::removeViewConnection" ); disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(loadGridView(Qt::Orientation))); disconnect(mGridView, SIGNAL(activated(const QModelIndex &)), this, SLOT( itemSelected(const QModelIndex &))); - disconnect(mGridView, SIGNAL(activated(const QModelIndex &)), this, SIGNAL( gridItemSelected(const QModelIndex &))); disconnect( mGridView, SIGNAL( scrollingEnded() ), this, SLOT( setVisvalWindowIndex() ) ); disconnect(mGridView, SIGNAL(longPressed( HbAbstractViewItem*, QPointF )),this, SLOT( indicateLongPress( HbAbstractViewItem*, QPointF ) ) ); } @@ -265,15 +263,23 @@ { OstTrace1( TRACE_NORMAL, GLXGRIDVIEW_ITEMSELECTED, "GlxGridView::itemSelected;index=%d", index.row() ); - if ( mGridView->selectionMode() == HbGridView::MultiSelection ){ //in multi selection mode no need to open the full screen - return ; + if ( mGridView->selectionMode() == HbGridView::MultiSelection ) { //in multi selection mode no need to open the full screen + return ; } + if ( mIsLongPress ) { + mIsLongPress = false; + return ; + } + if(XQServiceUtil::isService()){ + emit gridItemSelected(index); + return; + } + OstTraceEventStart0( EVENT_DUP1_GLXGRIDVIEW_ITEMSELECTED_START, "Fullscreen Launch Time" ); - if ( mModel ) - { + if ( mModel ) { mModel->setData( index, index.row(), GlxFocusIndexRole ); - } + } emit actionTriggered( EGlxCmdFullScreenOpen ); OstTraceEventStop( EVENT_DUP1_GLXGRIDVIEW_ITEMSELECTED_STOP, "Fullscreen Launch Time", EVENT_DUP1_GLXGRIDVIEW_ITEMSELECTED_START ); } @@ -329,5 +335,6 @@ if ( mModel ) { mModel->setData( item->modelIndex(), item->modelIndex().row(), GlxFocusIndexRole ); } + mIsLongPress = true; emit itemSpecificMenuTriggered(viewId(),coords); } diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/listview/inc/glxlistview.h --- a/ui/views/listview/inc/glxlistview.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/listview/inc/glxlistview.h Mon May 03 12:31:32 2010 +0300 @@ -64,6 +64,7 @@ HbMainWindow *mWindow; //no ownership QAbstractItemModel *mModel ; HbDocumentLoader *mDocLoader; //Docml loader to load the widgets from docml + bool mIsLongPress; }; #endif /* GLXLISTVIEW_H */ diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/listview/src/glxlistview.cpp --- a/ui/views/listview/src/glxlistview.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/listview/src/glxlistview.cpp Mon May 03 12:31:32 2010 +0300 @@ -24,7 +24,7 @@ #include #include #include -#include +#include //User Includes #include "glxviewids.h" #include "glxlistview.h" @@ -33,8 +33,13 @@ #include "glxcommandhandlers.hrh" -GlxListView::GlxListView(HbMainWindow *window) : GlxView ( GLX_LISTVIEW_ID ), - mListView(NULL), mView(NULL), mWindow(window), mModel ( NULL) +GlxListView::GlxListView(HbMainWindow *window) + : GlxView ( GLX_LISTVIEW_ID ), + mListView(NULL), + mView(NULL), + mWindow(window), + mModel ( NULL), + mIsLongPress( false ) { qDebug("GlxListView::GlxListView()"); mDocLoader = new HbDocumentLoader(); @@ -103,7 +108,7 @@ } void GlxListView::setVisvalWindowIndex() - { +{ QList< HbAbstractViewItem * > visibleItemList = mListView->visibleItems(); qDebug("GlxListView::setVisvalWindowIndex() %d", visibleItemList.count()); @@ -118,31 +123,28 @@ return ; mModel->setData( item->modelIndex (), item->modelIndex().row(), GlxVisualWindowIndex); - } +} void GlxListView::loadListView() { qDebug("GlxListView::loadListView()"); bool loaded = true; //Load the widgets accroding to the current Orientation - if (mListView == NULL ) - { + if (mListView == NULL ) { mDocLoader->load(GLX_LISTVIEW_DOCMLPATH,&loaded); - if(loaded) - { + if(loaded) { //retrieve the widgets mView = static_cast(mDocLoader->findWidget(QString(GLX_LISTVIEW_VIEW))); mListView = static_cast(mDocLoader->findWidget(QString(GLX_LISTVIEW_LIST))); - if(mListView) - { + if(mListView) { //sets the widget setWidget((QGraphicsWidget*) mView); - } - } + } + } HbListViewItem *prototype = mListView->listItemPrototype(); prototype->setStretchingStyle(HbListViewItem::StretchLandscape); - } + } } void GlxListView::createListView() @@ -156,35 +158,36 @@ { qDebug("GlxListView::~GlxListView()"); - if(widget()) - { + if(widget()) { qDebug("GlxListView::~GlxListView() takeWidget"); takeWidget(); - } + } removeViewConnection(); - if(mListView) - { + if(mListView) { delete mListView; mListView = NULL; - } + } - if(mView) - { + if(mView) { delete mView ; mView = NULL; - } - if(mDocLoader) - { + } + + if(mDocLoader) { delete mDocLoader; mDocLoader = NULL; - } + } } void GlxListView::itemSelected(const QModelIndex & index) { qDebug("GlxListView::itemSelected() index = %d", index.row() ); + if ( mIsLongPress ) { + mIsLongPress = false ; + return ; + } if ( mModel ) { mModel->setData( index, index.row(), GlxFocusIndexRole ); } @@ -197,7 +200,8 @@ qDebug() << "GlxListView:indicateLongPress Item " << item->modelIndex() << "long pressed at " << coords; if ( mModel ) { mModel->setData( item->modelIndex(), item->modelIndex().row(), GlxFocusIndexRole ); - } + } + mIsLongPress = true; emit itemSpecificMenuTriggered(viewId(),coords); } diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/slideshowsettingsview/inc/glxslideshowsettingsview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/views/slideshowsettingsview/inc/glxslideshowsettingsview.h Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,62 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: View for Slide show Settings. Slide Show settings consists +* of Drop down box for settings the trnasition effect and the transition delay. + +* +*/ + + +#ifndef GLXSLIDESHOWSETTINGSVIEW_H +#define GLXSLIDESHOWSETTINGSVIEW_H + +#include "glxview.h" + + +//Qt/Orbit forward declarations +class HbLabel; +class HbView; +class HbMainWindow; +class HbComboBox; +class QAbstractItemModel; + +class GlxSlideShowSettingsView : public GlxView +{ + Q_OBJECT + +public : + GlxSlideShowSettingsView(HbMainWindow *window); + ~GlxSlideShowSettingsView(); + void activate() ; + void deActivate(); + void setModel (QAbstractItemModel *model); + +private slots: + void orientationChanged(Qt::Orientation); + +private: +void setLayout(); + +private: + HbComboBox *mEffect; //Drop down box to display transition effect + HbComboBox *mDelay; //Drop down box to display transition delay + HbMainWindow *mWindow; //no ownership + HbLabel *mContextlabel; //Display SlideShow label + HbLabel *mEffectlabel; //Display "Transition Effect: " + HbLabel *mDelaylabel; //Display "Transition delay: " + int mTempEffect; //To store the index of effect.Temporary usage, Will be removed. + int mTempDelay; //To store the index of effect.Temporary usage, Will be removed. +}; + +#endif /* GLXGRIDVIEW_H_ */ diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/slideshowsettingsview/src/glxslideshowsettingsview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ui/views/slideshowsettingsview/src/glxslideshowsettingsview.cpp Mon May 03 12:31:32 2010 +0300 @@ -0,0 +1,140 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies 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 +* +*/ + + + +//Includes +#include +#include +#include +#include + +//User Includes +#include "glxuistd.h" +#include "glxviewids.h" +#include "glxslideshowsettingsview.h" +#include "glxmodelparm.h" + + + + +GlxSlideShowSettingsView::GlxSlideShowSettingsView(HbMainWindow *window) + : GlxView ( GLX_SLIDESHOWSETTINGSVIEW_ID ), + mDelay(NULL), + mEffect(NULL), + mContextlabel (NULL), + mEffectlabel (NULL), + mDelaylabel (NULL), + mWindow(window) +{ + mTempEffect = 0; + mTempDelay =0 ; + setContentFullScreen( true ); +} + +GlxSlideShowSettingsView::~GlxSlideShowSettingsView() +{ + if(mContextlabel) { + delete mContextlabel; + mContextlabel = NULL; + } + if(mEffectlabel) { + delete mEffectlabel; + mEffectlabel = NULL; + } + if(mDelaylabel) { + delete mDelaylabel; + mDelaylabel = NULL; + } + if(mEffect) { + delete mEffect; + mEffect = NULL; + } + if(mDelay) { + delete mDelay; + mDelay = NULL; + } +} + +void GlxSlideShowSettingsView::setModel(QAbstractItemModel *model) +{ + return; +} + +void GlxSlideShowSettingsView::orientationChanged(Qt::Orientation) +{ + setLayout(); +} + +void GlxSlideShowSettingsView::activate() +{ + connect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); + + if ( mContextlabel == NULL ) { + mContextlabel = new HbLabel("Slideshow", this); + } + + if ( mEffectlabel == NULL ) { + mEffectlabel = new HbLabel("Transition effect:", this); + } + + if ( mEffect == NULL ) { + mEffect = new HbComboBox(this); + QStringList effectList; + effectList<<"wave"<<"smooth fade"<<"zoom to face"; + mEffect->addItems( effectList ); + + } + + if ( mDelaylabel == NULL ) { + mDelaylabel = new HbLabel("Transition delay:", this); + } + + if ( mDelay == NULL ) { + mDelay = new HbComboBox(this); + QStringList delayList; + delayList<<"slow"<<"medium"<<"fast"; + mDelay->addItems( delayList ); + } + + mEffect->setCurrentIndex( mTempEffect); + mDelay->setCurrentIndex ( mTempDelay ); + + setLayout(); +} + +void GlxSlideShowSettingsView::setLayout() +{ + QSize sz = screenSize(); + + mContextlabel->setGeometry( 5, 25, sz.width() - 50, 100); + mEffectlabel->setGeometry(5, 75, sz.width() - 50, 100 ); + mEffect->setGeometry(15, 150, sz.width() - 50, 100 ); + mDelaylabel->setGeometry(5, 180, sz.width() - 50, 100 ); + mDelay->setGeometry(15, 255, sz.width() - 50, 100 ); +} + +void GlxSlideShowSettingsView::deActivate() +{ + //Store the current effect and delay before going back to the previous view + mTempEffect = mEffect->currentIndex(); + mTempDelay = mDelay->currentIndex(); + disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); +} + + + diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/slideshowview/inc/glxslideshowview.h --- a/ui/views/slideshowview/inc/glxslideshowview.h Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/slideshowview/inc/glxslideshowview.h Mon May 03 12:31:32 2010 +0300 @@ -31,8 +31,7 @@ //User Includes forward Declaration class GlxView; class GlxSlideShowWidget; -class CGlxHdmiController; - +class GlxTvOutWrapper; class GlxSlideShowView : public GlxView { @@ -56,13 +55,12 @@ private: void loadObjects(); - void SetImageToHdmiL(); private: QAbstractItemModel *mModel; HbMainWindow *mWindow; GlxSlideShowWidget *mSlideShowWidget; HbDocumentLoader *mDocLoader; //Docml loader to load the widgets from docml - CGlxHdmiController* iHdmiController; + GlxTvOutWrapper* mTvOutWrapper; }; #endif /*GLXSLIDESHOWVIEW_H*/ diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/slideshowview/src/glxslideshowview.cpp --- a/ui/views/slideshowview/src/glxslideshowview.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/slideshowview/src/glxslideshowview.cpp Mon May 03 12:31:32 2010 +0300 @@ -32,12 +32,13 @@ #include "glxslideshowwidget.h" #include "glxcommandhandlers.hrh" //To:Do temporary remove once orbit back problem is resolved -#include +#include + #include #include GlxSlideShowView::GlxSlideShowView(HbMainWindow *window,HbDocumentLoader *DocLoader) : GlxView(GLX_SLIDESHOWVIEW_ID), mModel(NULL), - mWindow(window), mSlideShowWidget(NULL),iHdmiController(NULL) + mWindow(window), mSlideShowWidget(NULL),mTvOutWrapper(NULL) { TRACER("GlxSlideShowView::GlxSlideShowView()"); mDocLoader = DocLoader; @@ -71,10 +72,9 @@ connect( mSlideShowWidget, SIGNAL( slideShowEvent( GlxSlideShowEvent ) ), this, SLOT( slideShowEventHandler( GlxSlideShowEvent ) ) ); connect( mSlideShowWidget, SIGNAL( indexchanged() ), this, SLOT( indexchanged() ) ); - if (!iHdmiController) { - GLX_LOG_INFO("GlxSlideShowView::activate() - CGlxHdmi" ); - iHdmiController = CGlxHdmiController::NewL(); - } + if (!mTvOutWrapper){ + mTvOutWrapper = new GlxTvOutWrapper(); + } } void GlxSlideShowView::deActivate() @@ -87,10 +87,9 @@ //Delete the Items in the slide show widget mSlideShowWidget->cleanUp(); mModel = NULL; - if (iHdmiController) { - GLX_LOG_INFO("GlxSlideShowView() deActivate delete iHdmiController " ); - delete iHdmiController; - iHdmiController = NULL; + if (mTvOutWrapper){ + delete mTvOutWrapper; + mTvOutWrapper = NULL; } } @@ -103,7 +102,10 @@ } mModel = model; mSlideShowWidget->setModel(mModel); - SetImageToHdmiL(); + if (mTvOutWrapper){ + mTvOutWrapper->setModel(mModel); + mTvOutWrapper->setImagetoHDMI(); + } } void GlxSlideShowView::setModelContext() @@ -153,7 +155,10 @@ void GlxSlideShowView::indexchanged() { TRACER("GlxSlideShowView::indexchanged()"); - SetImageToHdmiL(); + if (mTvOutWrapper){ + mTvOutWrapper->setImagetoHDMI(); + } + } bool GlxSlideShowView::event(QEvent *event) @@ -182,19 +187,3 @@ mSlideShowWidget->setItemGeometry( screenGeometry() ); } -void GlxSlideShowView::SetImageToHdmiL() -{ - TRACER("GlxSlideShowView::SetImageToHdmiL() - CGlxHdmi 1" ); - if (iHdmiController) { - GLX_LOG_INFO("GlxSlideShowView::SetImageToHdmiL() - CGlxHdmi 2" ); - // Get the image uri - QString imagePath = (mModel->data(mModel->index(mModel->data(mModel->index(0,0),GlxFocusIndexRole).value(),0),GlxUriRole)).value(); - if(imagePath.isNull()) { - GLX_LOG_INFO("GlxSlideShowView::SetImageToHdmiL() path is null" ); - } - qDebug() << "GlxSlideShowView::SetImageToHdmiL() imagePath= " << imagePath; - TPtrC aPtr = reinterpret_cast(imagePath.utf16()); - - iHdmiController->SetImageL(aPtr); - } -} diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/views.pro --- a/ui/views/views.pro Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/views.pro Mon May 03 12:31:32 2010 +0300 @@ -17,7 +17,7 @@ TEMPLATE = lib TARGET = glxviews -DEPENDPATH += . fullscreenview/inc fullscreenview/src gridview/inc gridview/src viewbase/inc +DEPENDPATH += . fullscreenview/inc fullscreenview/src gridview/inc gridview/src slideshowsettingsview/inc slideshowsettingsview/src viewbase/inc CONFIG += hb LIBS += -lglxmediamodel.dll \ @@ -26,6 +26,7 @@ -lglxloggerqt.dll \ -lshareui.dll \ -lglxtvout.dll \ + -lglxtvoutwrapper.dll \ -lxqserviceutil.dll \ -lglxlogging.dll @@ -39,7 +40,8 @@ ../viewbase/inc \ ../../commonutilities/imagedecoderwrapper/inc \ ../../loggers/loggerqt/inc \ - ../../traces + ../../traces \ + ../../tvout/tvoutwrapper/inc symbian: { TARGET.UID3 = 0x200009EF @@ -57,6 +59,7 @@ detailsview/inc/glxdetailsview.h \ detailsview/inc/glxdetailscustomwidgets.h \ gridview/inc/glxgridview.h \ + slideshowsettingsview/inc/glxslideshowsettingsview.h \ listview/inc/glxlistview.h \ effectengine/inc/glxeffectengine.h \ slideshowview/inc/glxslideshowview.h \ @@ -67,7 +70,6 @@ effectengine/effectplugin/inc/glxfadeplugin.h \ docloaders/inc/glxviewdocloader.h \ viewsfactory/inc/glxviewsfactory.h \ - ../../tvout/inc/glxhdmicontroller.h \ SOURCES += viewbase/src/glxview.cpp \ fullscreenview/src/glxcoverflow.cpp \ @@ -77,6 +79,7 @@ detailsview/src/glxdetailsview.cpp \ detailsview/src/glxdetailscustomwidgets.cpp \ gridview/src/glxgridview.cpp \ + slideshowsettingsview/src/glxslideshowsettingsview.cpp \ listview/src/glxlistview.cpp \ effectengine/src/glxeffectengine.cpp \ slideshowview/src/glxslideshowview.cpp \ diff -r 99ad1390cd33 -r c499df2dbb33 ui/views/viewsfactory/src/glxviewsfactory.cpp --- a/ui/views/viewsfactory/src/glxviewsfactory.cpp Fri Apr 16 14:58:46 2010 +0300 +++ b/ui/views/viewsfactory/src/glxviewsfactory.cpp Mon May 03 12:31:32 2010 +0300 @@ -22,6 +22,7 @@ #include "glxview.h" #include "glxviewids.h" #include "glxgridview.h" +#include "glxslideshowsettingsview.h" #include "glxlistview.h" #include "glxdetailsview.h" #include "glxviewsfactory.h" @@ -41,7 +42,7 @@ case GLX_FULLSCREENVIEW_ID : { - GlxFullScreenView *fullscreenView; + GlxFullScreenView *fullscreenView = NULL; bool isloaded; GlxFullscreenViewDocLoader *docLoader = new GlxFullscreenViewDocLoader(); @@ -61,7 +62,7 @@ case GLX_SLIDESHOWVIEW_ID : { - GlxSlideShowView *slideShowView; + GlxSlideShowView *slideShowView = NULL; bool isloaded; GlxSlideShowViewDocLoader *docLoader = new GlxSlideShowViewDocLoader(); @@ -75,6 +76,8 @@ return slideShowView; } + case GLX_SLIDESHOWSETTINGSVIEW_ID : + return new GlxSlideShowSettingsView ( window ); default : return 0; }